Skip to contentSkip to conversation

ioemu-remote: Fix pci pass-through

PATCH In review Jean Guyader 3 participants 6 messages Jul 15, 2008 – Jul 16, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ioemu-remote: Fix pci pass-through

ioemu-remote: Enable pci pass-through by default.

Signature · 1 line
Jean Guyader
xen-hooks.mak +11 -2
index 4e8b1fa..af977ef 100644
@@ -39,11 +39,20 @@ OBJS += tpm_tis.o
 
 ifdef CONFIG_STUBDOM
 CONFIG_PASSTHROUGH=1
-OBJS += xenfbfront.o
+else
+  ifeq (,$(wildcard /usr/include/pci))
+$(warning *** pciutils-devl package not found - missing /usr/include/pci)
+$(warning *** PCI passthrough capability has been disabled)
+  else
+CONFIG_PASSTHROUGH=1
+  endif
 endif
 
 ifdef CONFIG_PASSTHROUGH
-OBJS+= pass-through.o
+OBJS+= pass-through.o pt-msi.o
+LIBS += -lpci
+CFLAGS += -DCONFIG_PASSTHROUGH 
+$(info *** PCI passthrough capability has been enabled ***)
 endif
 
 BAD_OBJS += gdbstub.o acpi.o apic.o

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

Sorry, I missed the Signed-off.

ioemu-remote: Enable pci pass-through by default.

Signature · 1 line
Jean Guyader
xen-hooks.mak +11 -2
index 4e8b1fa..af977ef 100644
@@ -39,11 +39,20 @@ OBJS += tpm_tis.o
 
 ifdef CONFIG_STUBDOM
 CONFIG_PASSTHROUGH=1
-OBJS += xenfbfront.o
+else
+  ifeq (,$(wildcard /usr/include/pci))
+$(warning *** pciutils-devl package not found - missing /usr/include/pci)
+$(warning *** PCI passthrough capability has been disabled)
+  else
+CONFIG_PASSTHROUGH=1
+  endif
 endif
 
 ifdef CONFIG_PASSTHROUGH
-OBJS+= pass-through.o
+OBJS+= pass-through.o pt-msi.o
+LIBS += -lpci
+CFLAGS += -DCONFIG_PASSTHROUGH 
+$(info *** PCI passthrough capability has been enabled ***)
 endif
 
 BAD_OBJS += gdbstub.o acpi.o apic.o

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw

ioemu-remote: Fix the pass-through compilation.

Signature · 1 line
Jean Guyader
hw/pass-through.c +1 -1
index bddc203..f29f07d 100644
@@ -713,7 +713,7 @@ int pt_init(PCIBus *e_bus, char *direct_pci)
     dpci_infos.pci_access = pci_access;
     dpci_infos.e_bus      = e_bus;
 
-    if ( strlen(direct_pci) == 0 ) {
+    if ( !direct_pci || strlen(direct_pci) == 0 ) {
         return 0;
     }
 
hw/pass-through.h +1 -1
index ffd87ef..d642be3 100644
@@ -27,7 +27,7 @@
 #define PT_LOGGING_ENABLED
 
 #ifdef PT_LOGGING_ENABLED
-#define PT_LOG(_f, _a...)   fprintf(logfile, "%s: " _f, __func__, ##_a)
+#define PT_LOG(_f, _a...)   fprintf(stdout, "%s: " _f, __func__, ##_a)
 #else
 #define PT_LOG(_f, _a...)
 #endif

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw

Hmm, I have already provided fixes for all these patches. IanJ, it is part of the patches I've sent you.

Quoted 32 lines · Jean Guyader, le Tue 15 Jul 2008 17:19:29 +0100, a écrit :
xen-hooks.mak +11 -2
index 4e8b1fa..af977ef 100644
@@ -39,11 +39,20 @@ OBJS += tpm_tis.o
 
 ifdef CONFIG_STUBDOM
 CONFIG_PASSTHROUGH=1
-OBJS += xenfbfront.o
+else
+  ifeq (,$(wildcard /usr/include/pci))
+$(warning *** pciutils-devl package not found - missing /usr/include/pci)
+$(warning *** PCI passthrough capability has been disabled)
+  else
+CONFIG_PASSTHROUGH=1
+  endif
 endif
 
 ifdef CONFIG_PASSTHROUGH
-OBJS+= pass-through.o
+OBJS+= pass-through.o pt-msi.o
+LIBS += -lpci
+CFLAGS += -DCONFIG_PASSTHROUGH 
+$(info *** PCI passthrough capability has been enabled ***)
 endif
 
 BAD_OBJS += gdbstub.o acpi.o apic.o

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Quoted 33 lines · Jean Guyader, le Tue 15 Jul 2008 17:25:01 +0100, a écrit :

ioemu-remote: Fix the pass-through compilation.

Signature · 1 line
Jean Guyader
hw/pass-through.c +1 -1
index bddc203..f29f07d 100644
@@ -713,7 +713,7 @@ int pt_init(PCIBus *e_bus, char *direct_pci)
     dpci_infos.pci_access = pci_access;
     dpci_infos.e_bus      = e_bus;
 
-    if ( strlen(direct_pci) == 0 ) {
+    if ( !direct_pci || strlen(direct_pci) == 0 ) {
         return 0;
     }
 
hw/pass-through.h +1 -1
index ffd87ef..d642be3 100644
@@ -27,7 +27,7 @@
 #define PT_LOGGING_ENABLED
 
 #ifdef PT_LOGGING_ENABLED
-#define PT_LOG(_f, _a...)   fprintf(logfile, "%s: " _f, __func__, ##_a)
+#define PT_LOG(_f, _a...)   fprintf(stdout, "%s: " _f, __func__, ##_a)
 #else
 #define PT_LOG(_f, _a...)
 #endif
#4 lore raw
In reply to Jean Guyader

Jean Guyader writes ("Re: [Xen-devel] [PATCH] ioemu-remote: Fix pci pass-through"):

Quoted 2 lines

Sorry, I missed the Signed-off.
ioemu-remote: Enable pci pass-through by default.

I applied your previous patch and this one and it said this:

/u/iwj/work/qemu-iwj.git/hw/pt-msi.c: In function 'pt_msi_map_update':
/u/iwj/work/qemu-iwj.git/hw/pt-msi.c:274: warning: format '%lx' expects type 'long unsigned int', but argument 5 has type 'uint64_t' /u/iwj/work/qemu-iwj.git/hw/pt-msi.c:274: warning: format '%lx' expects type 'long unsigned int', but argument 7 has type 'uint64_t' /u/iwj/work/qemu-iwj.git/hw/pt-msi.c: In function 'pci_msix_writel':
/u/iwj/work/qemu-iwj.git/hw/pt-msi.c:570: warning: format '%016lx' expects type 'long unsigned int', but argument 4 has type 'target_phys_addr_t' /u/iwj/work/qemu-iwj.git/hw/pt-msi.c: In function 'pci_msix_readl':
/u/iwj/work/qemu-iwj.git/hw/pt-msi.c:619: warning: format '%016lx' expects type 'long unsigned int', but argument 4 has type 'target_phys_addr_t' /u/iwj/work/qemu-iwj.git/hw/pt-msi.c: In function 'pt_msix_init':
/u/iwj/work/qemu-iwj.git/hw/pt-msi.c:726: warning: format '%lx' expects type 'long unsigned int', but argument 4 has type 'uint64_t'

/u/iwj/work/qemu-iwj.git/hw/pc.c: In function 'pc_init1':
/u/iwj/work/qemu-iwj.git/hw/pc.c:966: warning: implicit declaration of function 'pt_init'

These should probably be fixed.

Ian.

#5 lore raw
Quoted 10 lines · Ian Jackson

Jean Guyader writes ("Re: [Xen-devel] [PATCH] ioemu-remote: Fix pci pass-through"):

Quoted 2 lines

Sorry, I missed the Signed-off.
ioemu-remote: Enable pci pass-through by default.

I applied your previous patch and this one and it said this:

[...]

These should probably be fixed.

I forgot to check the 32 bits compilation, my mistake.
The pt_init declaration error should be fixed with another patch I sent.

ioemu-remote: Fix the pass-through compilation.

Signature · 1 line
Jean Guyader
hw/pass-through.h +1 -1
index ffd87ef..4f5d88a 100644
@@ -27,7 +27,7 @@
 #define PT_LOGGING_ENABLED
 
 #ifdef PT_LOGGING_ENABLED
-#define PT_LOG(_f, _a...)   fprintf(logfile, "%s: " _f, __func__, ##_a)
+#define PT_LOG(_f, _a...)   fprintf(stdout, "%s: " _f, __func__, ##_a)
 #else
 #define PT_LOG(_f, _a...)
 #endif
hw/pt-msi.c +4 -4
index 5e7c479..d5bd6b7 100644
@@ -271,7 +271,7 @@ pt_msi_map_update(struct pt_dev *d, uint32_t old_data, uint64_t old_addr)
     data = get_msi_gdata(d);
     addr = get_msi_gaddr(d);
 
-    PT_LOG("old_data %x old_addr %lx data %x addr %lx\n",
+    PT_LOG("old_data %x old_addr %"PRIx64" data %x addr %"PRIx64"\n",
             old_data, old_addr, data, addr);
 
     if ( data != old_data || addr != old_addr )
@@ -567,7 +567,7 @@ static void pci_msix_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
 
     if ( addr % 4 )
     {
-        PT_LOG("unaligned dword access to MSI-X table, addr %016lx\n",
+        PT_LOG("unaligned dword access to MSI-X table, addr %016"PRIx64"\n",
                 addr);
         return;
     }
@@ -616,7 +616,7 @@ static uint32_t pci_msix_readl(void *opaque, target_phys_addr_t addr)
 
     if ( addr % 4 )
     {
-        PT_LOG("unaligned dword access to MSI-X table, addr %016lx\n",
+        PT_LOG("unaligned dword access to MSI-X table, addr %016"PRIx64"\n",
                 addr);
         return 0;
     }
@@ -723,7 +723,7 @@ int pt_msix_init(struct pt_dev *dev, int pos)
         bar_base &= ~0xf;
         bar_base += (uint64_t)pci_read_long(pd, 0x10 + 4 * (bar_index + 1)) << 32;
     }
-    PT_LOG("get MSI-X table bar base %lx\n", bar_base);
+    PT_LOG("get MSI-X table bar base %"PRIx64"\n", bar_base);
 
     dev->msix->fd = open("/dev/mem", O_RDWR);
     dev->msix->phys_iomem_base = mmap(0, total_entries * 16,

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel