Skip to contentSkip to conversation

: msi: Mask out multi-function flag from PCI_HEADER_TYPE in read_pci_mem_bar()

PATCH In review Gianni Tedesco 2 participants 2 messages Oct 18, 2010 – Oct 19, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : msi: Mask out multi-function flag from PCI_HEADER_TYPE in read_pci_mem_bar()

This leads to an erroneous WARN_ON and possibly other side effects. It seems to me that even multi-function devices ought to enjoy the privilege of MSI-X capabilities.

xen/arch/x86/msi.c +1 -1
diff -r fc2242ac90e1 xen/arch/x86/msi.c
@@ -527,7 +527,7 @@ static u64 read_pci_mem_bar(u8 bus, u8 s
     u8 limit;
     u32 addr;
 
-    switch ( pci_conf_read8(bus, slot, func, PCI_HEADER_TYPE) )
+    switch ( pci_conf_read8(bus, slot, func, PCI_HEADER_TYPE) & 0x7f )
     {
     case PCI_HEADER_TYPE_NORMAL:
         limit = 6;
Acked-by on v1 1/1
#1 lore raw

Noticed I should have replied to this one.

Quoted 6 lines
Quoted 1 line
Quoted 1 line · Gianni Tedesco

This leads to an erroneous WARN_ON and possibly other side effects. It seems to me that even multi-function devices ought to enjoy the privilege of MSI-X capabilities.

Quoted 12 lines

diff -r fc2242ac90e1 xen/arch/x86/msi.c

xen/arch/x86/msi.c +1 -1
@@ -527,7 +527,7 @@ static u64 read_pci_mem_bar(u8 bus, u8 s
     u8 limit;
     u32 addr;
 
-    switch ( pci_conf_read8(bus, slot, func, PCI_HEADER_TYPE) )
+    switch ( pci_conf_read8(bus, slot, func, PCI_HEADER_TYPE) & 0x7f )
     {
     case PCI_HEADER_TYPE_NORMAL:
         limit = 6;