* [PATCH] x86-64: revert mmconfig part of c/s 24425:053a44894279
@ 2012-06-21 15:29 Jan Beulich
2012-06-21 16:26 ` Keir Fraser
0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2012-06-21 15:29 UTC (permalink / raw)
To: xen-devel; +Cc: dgdegra
[-- Attachment #1: Type: text/plain, Size: 1698 bytes --]
These additions did not fulfill their purpose - they checked hypervisor
config space accesses instead of guest (Dom0) ones.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/arch/x86/x86_64/mmconfig_64.c
+++ b/xen/arch/x86/x86_64/mmconfig_64.c
@@ -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;
[-- Attachment #2: x86_64-mmcfg-revert-24425.patch --]
[-- Type: text/plain, Size: 1750 bytes --]
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.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/arch/x86/x86_64/mmconfig_64.c
+++ b/xen/arch/x86/x86_64/mmconfig_64.c
@@ -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;
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] x86-64: revert mmconfig part of c/s 24425:053a44894279
2012-06-21 15:29 [PATCH] x86-64: revert mmconfig part of c/s 24425:053a44894279 Jan Beulich
@ 2012-06-21 16:26 ` Keir Fraser
0 siblings, 0 replies; 2+ messages in thread
From: Keir Fraser @ 2012-06-21 16:26 UTC (permalink / raw)
To: Jan Beulich, xen-devel; +Cc: dgdegra
On 21/06/2012 16:29, "Jan Beulich" <JBeulich@suse.com> wrote:
> These additions did not fulfill their purpose - they checked hypervisor
> config space accesses instead of guest (Dom0) ones.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
> --- a/xen/arch/x86/x86_64/mmconfig_64.c
> +++ b/xen/arch/x86/x86_64/mmconfig_64.c
> @@ -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
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-06-21 16:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-21 15:29 [PATCH] x86-64: revert mmconfig part of c/s 24425:053a44894279 Jan Beulich
2012-06-21 16:26 ` Keir Fraser
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.