VT-d: fix mask applied to DMIBAR in desktop chipset XSA-59 workaround
PATCH 1/1 VT-d: fix mask applied to DMIBAR in desktop chipset XSA-59 workaround
In commit ("VT-d: suppress UR signaling for desktop chipsets") the mask applied to the value read from DMIBAR is to narrow, only the comment accompanying it was correct. Fix that and tag the literal number as "long" at once to avoid eventual compiler warnings.
The widest possible value so far is 39 bits; all chipsets covered here but having less than this number of bits have the remaining bits marked reserved (zero), and hence there's no need for making the mask chipset specific.
xen/drivers/passthrough/vtd/quirks.c +1 -1
@@ -467,7 +467,7 @@ void pci_vtd_quirk(const struct pci_devcase 0xc00 :case 0xc04 :case 0xc08 :/* Haswell */ bar =pci_conf_read32 (seg, bus, dev, func,0x6c ); bar = (bar <<32 ) |pci_conf_read32 (seg, bus, dev, func,0x68 ); - pa = bar &0x7fffff000 ;/* bits 12...38 */ + pa = bar &0x7ffffff000UL ;/* bits 12...38 */ if ( (bar &1 ) && pa &&page_is_ram_type (paddr_to_pfn (pa),RAM_TYPE_RESERVED ) ) {
VT-d: fix mask applied to DMIBAR in desktop chipset XSA-59 workaround
In commit ("VT-d: suppress UR signaling for desktop chipsets") the mask applied to the value read from DMIBAR is to narrow, only the comment accompanying it was correct. Fix that and tag the literal number as "long" at once to avoid eventual compiler warnings.
The widest possible value so far is 39 bits; all chipsets covered here but having less than this number of bits have the remaining bits marked reserved (zero), and hence there's no need for making the mask chipset specific.
xen/drivers/passthrough/vtd/quirks.c +1 -1
@@ -467,7 +467,7 @@ void pci_vtd_quirk(const struct pci_devcase 0xc00 :case 0xc04 :case 0xc08 :/* Haswell */ bar =pci_conf_read32 (seg, bus, dev, func,0x6c ); bar = (bar <<32 ) |pci_conf_read32 (seg, bus, dev, func,0x68 ); - pa = bar &0x7fffff000 ;/* bits 12...38 */ + pa = bar &0x7ffffff000UL ;/* bits 12...38 */ if ( (bar &1 ) && pa &&page_is_ram_type (paddr_to_pfn (pa),RAM_TYPE_RESERVED ) ) {
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Jan Beulich wrote on 2014-05-23:
Quoted 10 lines
In commit ("VT-d: suppress UR signaling for desktop chipsets") the mask applied to the value read from DMIBAR is to narrow, only the comment accompanying it was correct. Fix that and tag the literal number as "long" at once to avoid eventual compiler warnings.
The widest possible value so far is 39 bits; all chipsets covered here but having less than this number of bits have the remaining bits
marked reserved (zero), and hence there's no need for making the mask chipset specific.Signed-off-by Jan Beulich <[email protected]>
Quoted 12 lines
xen/drivers/passthrough/vtd/quirks.c +1
-1@@ -467,7 +467,7 @@ void pci_vtd_quirk(const struct pci_devcase 0xc00 :case 0xc04 :case 0xc08 :/* Haswell */ bar =pci_conf_read32 (seg, bus, dev, func,0x6c ); bar = (bar <<32 ) |pci_conf_read32 (seg, bus, dev, func,0x68 ); - pa = bar &0x7fffff000 ;/* bits 12...38 */ + pa = bar &0x7ffffff000UL ;/* bits 12...38 */ if ( (bar &1 ) && pa &&page_is_ram_type (paddr_to_pfn (pa),RAM_TYPE_RESERVED ) )
Quoted 2 lines
{Best regards,
Yang