* [PATCH] xio3130_upstream: Add ACS (Access Control Services) capability
@ 2022-08-14 7:47 Paul Schlacter
2022-08-14 10:47 ` Michael S. Tsirkin
0 siblings, 1 reply; 4+ messages in thread
From: Paul Schlacter @ 2022-08-14 7:47 UTC (permalink / raw)
To: mst, marcel.apfelbaum, fam, kwolf, stefanha, k.jensen, f4bug, its,
xypron.glpk, imammedo, qemu-devel, armbru, kbusch, hreitz, ani
[-- Attachment #1: Type: text/plain, Size: 1120 bytes --]
If it is a pcie device, check that all devices on the path from
the device to the root complex have ACS enabled, and then the
device will become an iommu_group.
it will have the effect of isolation
Signed-off-by: wlfightup <wlfightup@gmail.com>
---
hw/pci-bridge/xio3130_upstream.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/pci-bridge/xio3130_upstream.c
b/hw/pci-bridge/xio3130_upstream.c
index 5ff46ef050..2df952222b 100644
--- a/hw/pci-bridge/xio3130_upstream.c
+++ b/hw/pci-bridge/xio3130_upstream.c
@@ -37,6 +37,8 @@
#define XIO3130_SSVID_SSID 0
#define XIO3130_EXP_OFFSET 0x90
#define XIO3130_AER_OFFSET 0x100
+#define XIO3130_ACS_OFFSET \
+ (XIO3130_AER_OFFSET + PCI_ERR_SIZEOF)
static void xio3130_upstream_write_config(PCIDevice *d, uint32_t address,
uint32_t val, int len)
@@ -92,6 +94,7 @@ static void xio3130_upstream_realize(PCIDevice *d, Error
**errp)
goto err;
}
+ pcie_acs_init(d, XIO3130_ACS_OFFSET);
return;
err:
--
2.24.3 (Apple Git-128)
[-- Attachment #2: Type: text/html, Size: 7656 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] xio3130_upstream: Add ACS (Access Control Services) capability
2022-08-14 7:47 [PATCH] xio3130_upstream: Add ACS (Access Control Services) capability Paul Schlacter
@ 2022-08-14 10:47 ` Michael S. Tsirkin
2022-08-14 15:59 ` Paul Schlacter
0 siblings, 1 reply; 4+ messages in thread
From: Michael S. Tsirkin @ 2022-08-14 10:47 UTC (permalink / raw)
To: Paul Schlacter
Cc: marcel.apfelbaum, fam, kwolf, stefanha, k.jensen, f4bug, its,
xypron.glpk, imammedo, qemu-devel, armbru, kbusch, hreitz, ani
On Sun, Aug 14, 2022 at 03:47:49PM +0800, Paul Schlacter wrote:
> If it is a pcie device, check that all devices on the path from
>
> the device to the root complex have ACS enabled, and then the
>
> device will become an iommu_group.
>
> it will have the effect of isolation
>
>
> Signed-off-by: wlfightup <wlfightup@gmail.com>
I don't think we can do this unconditionally. Has to have
a property and disabled for old versions.
> ---
>
> hw/pci-bridge/xio3130_upstream.c | 3 +++
>
> 1 file changed, 3 insertions(+)
>
>
> diff --git a/hw/pci-bridge/xio3130_upstream.c b/hw/pci-bridge/
> xio3130_upstream.c
>
> index 5ff46ef050..2df952222b 100644
>
> --- a/hw/pci-bridge/xio3130_upstream.c
>
> +++ b/hw/pci-bridge/xio3130_upstream.c
>
> @@ -37,6 +37,8 @@
>
> #define XIO3130_SSVID_SSID 0
>
> #define XIO3130_EXP_OFFSET 0x90
>
> #define XIO3130_AER_OFFSET 0x100
>
> +#define XIO3130_ACS_OFFSET \
>
> + (XIO3130_AER_OFFSET + PCI_ERR_SIZEOF)
>
>
> static void xio3130_upstream_write_config(PCIDevice *d, uint32_t address,
>
> uint32_t val, int len)
>
> @@ -92,6 +94,7 @@ static void xio3130_upstream_realize(PCIDevice *d, Error
> **errp)
>
> goto err;
>
> }
>
>
> + pcie_acs_init(d, XIO3130_ACS_OFFSET);
>
> return;
>
>
> err:
>
> --
>
> 2.24.3 (Apple Git-128)
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] xio3130_upstream: Add ACS (Access Control Services) capability
2022-08-14 10:47 ` Michael S. Tsirkin
@ 2022-08-14 15:59 ` Paul Schlacter
2022-08-14 22:55 ` Michael S. Tsirkin
0 siblings, 1 reply; 4+ messages in thread
From: Paul Schlacter @ 2022-08-14 15:59 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: marcel.apfelbaum, fam, kwolf, stefanha, k.jensen, f4bug, its,
xypron.glpk, imammedo, qemu-devel, armbru, kbusch, hreitz, ani
[-- Attachment #1: Type: text/plain, Size: 1646 bytes --]
What's wrong with not disabling the old version?
On Sun, Aug 14, 2022 at 6:48 PM Michael S. Tsirkin <mst@redhat.com> wrote:
> On Sun, Aug 14, 2022 at 03:47:49PM +0800, Paul Schlacter wrote:
> > If it is a pcie device, check that all devices on the path from
> >
> > the device to the root complex have ACS enabled, and then the
> >
> > device will become an iommu_group.
> >
> > it will have the effect of isolation
> >
> >
> > Signed-off-by: wlfightup <wlfightup@gmail.com>
>
> I don't think we can do this unconditionally. Has to have
> a property and disabled for old versions.
>
> > ---
> >
> > hw/pci-bridge/xio3130_upstream.c | 3 +++
> >
> > 1 file changed, 3 insertions(+)
> >
> >
> > diff --git a/hw/pci-bridge/xio3130_upstream.c b/hw/pci-bridge/
> > xio3130_upstream.c
> >
> > index 5ff46ef050..2df952222b 100644
> >
> > --- a/hw/pci-bridge/xio3130_upstream.c
> >
> > +++ b/hw/pci-bridge/xio3130_upstream.c
> >
> > @@ -37,6 +37,8 @@
> >
> > #define XIO3130_SSVID_SSID 0
> >
> > #define XIO3130_EXP_OFFSET 0x90
> >
> > #define XIO3130_AER_OFFSET 0x100
> >
> > +#define XIO3130_ACS_OFFSET \
> >
> > + (XIO3130_AER_OFFSET + PCI_ERR_SIZEOF)
> >
> >
> > static void xio3130_upstream_write_config(PCIDevice *d, uint32_t
> address,
> >
> > uint32_t val, int len)
> >
> > @@ -92,6 +94,7 @@ static void xio3130_upstream_realize(PCIDevice *d,
> Error
> > **errp)
> >
> > goto err;
> >
> > }
> >
> >
> > + pcie_acs_init(d, XIO3130_ACS_OFFSET);
> >
> > return;
> >
> >
> > err:
> >
> > --
> >
> > 2.24.3 (Apple Git-128)
> >
>
>
[-- Attachment #2: Type: text/html, Size: 3698 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] xio3130_upstream: Add ACS (Access Control Services) capability
2022-08-14 15:59 ` Paul Schlacter
@ 2022-08-14 22:55 ` Michael S. Tsirkin
0 siblings, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2022-08-14 22:55 UTC (permalink / raw)
To: Paul Schlacter
Cc: marcel.apfelbaum, fam, kwolf, stefanha, k.jensen, f4bug, its,
xypron.glpk, imammedo, qemu-devel, armbru, kbusch, hreitz, ani
On Sun, Aug 14, 2022 at 11:59:51PM +0800, Paul Schlacter wrote:
> What's wrong with not disabling the old version?
Old versions have to behave in the same way as they did,
or close enough. Changing that breaks migration between
qemu versions.
>
>
> On Sun, Aug 14, 2022 at 6:48 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Sun, Aug 14, 2022 at 03:47:49PM +0800, Paul Schlacter wrote:
> > If it is a pcie device, check that all devices on the path from
> >
> > the device to the root complex have ACS enabled, and then the
> >
> > device will become an iommu_group.
> >
> > it will have the effect of isolation
> >
> >
> > Signed-off-by: wlfightup <wlfightup@gmail.com>
>
> I don't think we can do this unconditionally. Has to have
> a property and disabled for old versions.
>
> > ---
> >
> > hw/pci-bridge/xio3130_upstream.c | 3 +++
> >
> > 1 file changed, 3 insertions(+)
> >
> >
> > diff --git a/hw/pci-bridge/xio3130_upstream.c b/hw/pci-bridge/
> > xio3130_upstream.c
> >
> > index 5ff46ef050..2df952222b 100644
> >
> > --- a/hw/pci-bridge/xio3130_upstream.c
> >
> > +++ b/hw/pci-bridge/xio3130_upstream.c
> >
> > @@ -37,6 +37,8 @@
> >
> > #define XIO3130_SSVID_SSID 0
> >
> > #define XIO3130_EXP_OFFSET 0x90
> >
> > #define XIO3130_AER_OFFSET 0x100
> >
> > +#define XIO3130_ACS_OFFSET \
> >
> > + (XIO3130_AER_OFFSET + PCI_ERR_SIZEOF)
> >
> >
> > static void xio3130_upstream_write_config(PCIDevice *d, uint32_t
> address,
> >
> > uint32_t val, int len)
> >
> > @@ -92,6 +94,7 @@ static void xio3130_upstream_realize(PCIDevice *d,
> Error
> > **errp)
> >
> > goto err;
> >
> > }
> >
> >
> > + pcie_acs_init(d, XIO3130_ACS_OFFSET);
> >
> > return;
> >
> >
> > err:
> >
> > --
> >
> > 2.24.3 (Apple Git-128)
> >
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-08-14 22:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-14 7:47 [PATCH] xio3130_upstream: Add ACS (Access Control Services) capability Paul Schlacter
2022-08-14 10:47 ` Michael S. Tsirkin
2022-08-14 15:59 ` Paul Schlacter
2022-08-14 22:55 ` Michael S. Tsirkin
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.