Skip to contentSkip to conversation

x86-64: revert mmconfig part of c/s 24425:053a44894279

PATCH In review Jan Beulich 2 participants 2 messages Jun 21, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86-64: revert mmconfig part of c/s 24425:053a44894279

These additions did not fulfill their purpose - they checked hypervisor config space accesses instead of guest (Dom0) ones.

xen/arch/x86/x86_64/mmconfig_64.c +0 -13
@@ -14,7 +14,6 @@
 #include <xen/xmalloc.h>
 #include <xen/pci.h>
 #include <xen/pci_regs.h>
-#include <xsm/xsm.h>
 
 #include "mmconfig.h"
 
@@ -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;
 
     /* 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 = -1;
         return -EINVAL;
     }
 
-    mbdf = (seg << 16) | (bus << 8) | devfn;
-    if (xsm_pci_config_permission(current->domain, mbdf, reg, reg + len - 1, 0)) {
-        *value = -1;
-        return -EPERM;
-    }
-
     addr = 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;
 
     /* Why do we have this when nobody checks it. How about a BUG()!? -AK */
     if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095)))
         return -EINVAL;
 
-    mbdf = (seg << 16) | (bus << 8) | devfn;
-    if (xsm_pci_config_permission(current->domain, mbdf, reg, reg + len - 1, 1))
-        return -EPERM;
-
     addr = pci_dev_base(seg, bus, devfn);
     if (!addr)
         return -EINVAL;

x86-64: revert mmconfig part of c/s 24425:053a44894279

These additions did not fulfill their purpose - they checked hypervisor config space accesses instead of guest (Dom0) ones.

xen/arch/x86/x86_64/mmconfig_64.c +0 -13
@@ -14,7 +14,6 @@
 #include <xen/xmalloc.h>
 #include <xen/pci.h>
 #include <xen/pci_regs.h>
-#include <xsm/xsm.h>
 
 #include "mmconfig.h"
 
@@ -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;
 
     /* 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 = -1;
         return -EINVAL;
     }
 
-    mbdf = (seg << 16) | (bus << 8) | devfn;
-    if (xsm_pci_config_permission(current->domain, mbdf, reg, reg + len - 1, 0)) {
-        *value = -1;
-        return -EPERM;
-    }
-
     addr = 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;
 
     /* Why do we have this when nobody checks it. How about a BUG()!? -AK */
     if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095)))
         return -EINVAL;
 
-    mbdf = (seg << 16) | (bus << 8) | devfn;
-    if (xsm_pci_config_permission(current->domain, mbdf, reg, reg + len - 1, 1))
-        return -EPERM;
-
     addr = pci_dev_base(seg, bus, devfn);
     if (!addr)
         return -EINVAL;

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

Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Jan Beulich

These additions did not fulfill their purpose - they checked hypervisor config space accesses instead of guest (Dom0) ones.

Quoted 57 lines
xen/arch/x86/x86_64/mmconfig_64.c +0 -8
@@ -14,7 +14,6 @@
 #include <xen/xmalloc.h>
 #include <xen/pci.h>
 #include <xen/pci_regs.h>
-#include <xsm/xsm.h>
 
 #include "mmconfig.h"
 
@@ -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;
 
     /* 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 = -1;
         return -EINVAL;
     }
 
-    mbdf = (seg << 16) | (bus << 8) | devfn;
-    if (xsm_pci_config_permission(current->domain, mbdf, reg, reg + len - 1,
 0)) {
-        *value = -1;
-        return -EPERM;
-    }
-
     addr = pci_dev_base(seg, bus, devfn);
     if (!addr)
         goto err;
xen/arch/x86/x86_64/mmconfig_64.c +0 -5
@@ -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;
 
     /* Why do we have this when nobody checks it. How about a BUG()!? -AK */
     if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095)))
         return -EINVAL;
 
-    mbdf = (seg << 16) | (bus << 8) | devfn;
-    if (xsm_pci_config_permission(current->domain, mbdf, reg, reg + len - 1,
 1))
-        return -EPERM;
-
     addr = pci_dev_base(seg, bus, devfn);
     if (!addr)
         return -EINVAL;

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