From: "Jan Beulich" Subject: [PATCH] x86-64: revert mmconfig part of c/s 24425:053a44894279 Date: Thu, 21 Jun 2012 16:29:26 +0100 Message-ID: <4FE359F6020000780008B299@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part3F119EC6.0__=" Return-path: 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: dgdegra@tycho.nsa.gov 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. --=__Part3F119EC6.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline These additions did not fulfill their purpose - they checked hypervisor config space accesses instead of guest (Dom0) ones. Signed-off-by: Jan Beulich --- a/xen/arch/x86/x86_64/mmconfig_64.c +++ b/xen/arch/x86/x86_64/mmconfig_64.c @@ -14,7 +14,6 @@ #include #include #include -#include =20 #include "mmconfig.h" =20 @@ -59,7 +58,6 @@ int pci_mmcfg_read(unsigned int seg, uns unsigned int devfn, int reg, int len, u32 *value) { char __iomem *addr; - uint32_t mbdf; =20 /* Why do we have this when nobody checks it. How about a BUG()!? -AK = */ if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) { @@ -67,12 +65,6 @@ err: *value =3D -1; return -EINVAL; } =20 - mbdf =3D (seg << 16) | (bus << 8) | devfn; - if (xsm_pci_config_permission(current->domain, mbdf, reg, reg + len - = 1, 0)) { - *value =3D -1; - return -EPERM; - } - addr =3D pci_dev_base(seg, bus, devfn); if (!addr) goto err; @@ -96,16 +88,11 @@ int pci_mmcfg_write(unsigned int seg, un unsigned int devfn, int reg, int len, u32 value) { char __iomem *addr; - uint32_t mbdf; =20 /* Why do we have this when nobody checks it. How about a BUG()!? -AK = */ if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) return -EINVAL; =20 - mbdf =3D (seg << 16) | (bus << 8) | devfn; - if (xsm_pci_config_permission(current->domain, mbdf, reg, reg + len - = 1, 1)) - return -EPERM; - addr =3D pci_dev_base(seg, bus, devfn); if (!addr) return -EINVAL; --=__Part3F119EC6.0__= Content-Type: text/plain; name="x86_64-mmcfg-revert-24425.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86_64-mmcfg-revert-24425.patch" x86-64: revert mmconfig part of c/s 24425:053a44894279=0A=0AThese = additions did not fulfill their purpose - they checked hypervisor=0Aconfig = space accesses instead of guest (Dom0) ones.=0A=0ASigned-off-by: Jan = Beulich =0A=0A--- a/xen/arch/x86/x86_64/mmconfig_64.c=0A= +++ b/xen/arch/x86/x86_64/mmconfig_64.c=0A@@ -14,7 +14,6 @@=0A #include = =0A #include =0A #include =0A-#in= clude =0A =0A #include "mmconfig.h"=0A =0A@@ -59,7 +58,6 @@ int = pci_mmcfg_read(unsigned int seg, uns=0A unsigned int devfn, = int reg, int len, u32 *value)=0A {=0A char __iomem *addr;=0A- = uint32_t mbdf;=0A =0A /* Why do we have this when nobody checks it. = How about a BUG()!? -AK */=0A if (unlikely((bus > 255) || (devfn > = 255) || (reg > 4095))) {=0A@@ -67,12 +65,6 @@ err: *value =3D = -1;=0A return -EINVAL;=0A }=0A =0A- mbdf =3D (seg << 16) | = (bus << 8) | devfn;=0A- if (xsm_pci_config_permission(current->domain, = mbdf, reg, reg + len - 1, 0)) {=0A- *value =3D -1;=0A- = return -EPERM;=0A- }=0A-=0A addr =3D pci_dev_base(seg, bus, = devfn);=0A if (!addr)=0A goto err;=0A@@ -96,16 +88,11 @@ int = pci_mmcfg_write(unsigned int seg, un=0A unsigned int devfn, = int reg, int len, u32 value)=0A {=0A char __iomem *addr;=0A- = uint32_t mbdf;=0A =0A /* Why do we have this when nobody checks it. = How about a BUG()!? -AK */=0A if (unlikely((bus > 255) || (devfn > = 255) || (reg > 4095)))=0A return -EINVAL;=0A =0A- mbdf =3D (seg = << 16) | (bus << 8) | devfn;=0A- if (xsm_pci_config_permission(current->= domain, mbdf, reg, reg + len - 1, 1))=0A- return -EPERM;=0A-=0A = addr =3D pci_dev_base(seg, bus, devfn);=0A if (!addr)=0A = return -EINVAL;=0A --=__Part3F119EC6.0__= 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 --=__Part3F119EC6.0__=--