From: "Jan Beulich" Subject: [PATCH] VT-d: fix mask applied to DMIBAR in desktop chipset XSA-59 workaround Date: Fri, 23 May 2014 11:27:46 +0100 Message-ID: <537F3EC202000078000154E9@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartD4E6F5B2.1__=" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WnmhZ-00077s-2M for xen-devel@lists.xenproject.org; Fri, 23 May 2014 10:27:49 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Yang Z Zhang , Kevin Tian List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartD4E6F5B2.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 --- a/xen/drivers/passthrough/vtd/quirks.c +++ b/xen/drivers/passthrough/vtd/quirks.c @@ -467,7 +467,7 @@ void pci_vtd_quirk(const struct pci_dev=20 case 0xc00: case 0xc04: case 0xc08: /* Haswell */ bar =3D pci_conf_read32(seg, bus, dev, func, 0x6c); bar =3D (bar << 32) | pci_conf_read32(seg, bus, dev, func, 0x68); - pa =3D bar & 0x7fffff000; /* bits 12...38 */ + pa =3D bar & 0x7ffffff000UL; /* bits 12...38 */ if ( (bar & 1) && pa && page_is_ram_type(paddr_to_pfn(pa), RAM_TYPE_RESERVED) ) { --=__PartD4E6F5B2.1__= Content-Type: text/plain; name="VT-d-DMIBAR-width.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="VT-d-DMIBAR-width.patch" VT-d: fix mask applied to DMIBAR in desktop chipset XSA-59 workaround=0A=0A= In commit ("VT-d: suppress UR signaling for desktop chipsets")=0Athe mask = applied to the value read from DMIBAR is to narrow, only the=0Acomment = accompanying it was correct. Fix that and tag the literal=0Anumber as = "long" at once to avoid eventual compiler warnings.=0A=0AThe widest = possible value so far is 39 bits; all chipsets covered here=0Abut having = less than this number of bits have the remaining bits marked=0Areserved = (zero), and hence there's no need for making the mask chipset=0Aspecific.= =0A=0ASigned-off-by: Jan Beulich =0A=0A--- a/xen/drivers= /passthrough/vtd/quirks.c=0A+++ b/xen/drivers/passthrough/vtd/quirks.c=0A@@= -467,7 +467,7 @@ void pci_vtd_quirk(const struct pci_dev =0A case = 0xc00: case 0xc04: case 0xc08: /* Haswell */=0A bar =3D pci_conf_re= ad32(seg, bus, dev, func, 0x6c);=0A bar =3D (bar << 32) | = pci_conf_read32(seg, bus, dev, func, 0x68);=0A- pa =3D bar & = 0x7fffff000; /* bits 12...38 */=0A+ pa =3D bar & 0x7ffffff000UL; /* = bits 12...38 */=0A if ( (bar & 1) && pa &&=0A = page_is_ram_type(paddr_to_pfn(pa), RAM_TYPE_RESERVED) )=0A {=0A --=__PartD4E6F5B2.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__PartD4E6F5B2.1__=--