From: Alex Williamson <alex.williamson@redhat.com>
To: Knut Omang <knut.omang@oracle.com>
Cc: qemu-devel@nongnu.org, "Michael S . Tsirkin" <mst@redhat.com>,
Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
Tal Attaly <talat@mellanox.com>,
Elijah Shakkour <elijahs@mellanox.com>,
Stefan Hajnoczi <stefanha@gmail.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] gen_pcie_root_port: Add ACS (Access Control Services) capability
Date: Wed, 23 Jan 2019 12:04:38 -0700 [thread overview]
Message-ID: <20190123120438.2d47e352@w520.home> (raw)
In-Reply-To: <1062e3d54121ff3e19b5a4e821ae178c5387fd9a.1548266832.git-series.knut.omang@oracle.com>
On Wed, 23 Jan 2019 19:28:00 +0100
Knut Omang <knut.omang@oracle.com> wrote:
> Claiming ACS support allows passthrough of an emulated device
> (in a nested virt.setting) with VFIO without Alex Williamson's patch
> for the pcie_acs_override kernel parameter.
> A similar need appears on Windows with Hyper-V
>
> Signed-off-by: Knut Omang <knut.omang@oracle.com>
> ---
> hw/pci-bridge/gen_pcie_root_port.c | 2 ++
> hw/pci-bridge/ioh3420.c | 1 -
> hw/pci-bridge/pcie_root_port.c | 3 +++
> include/hw/pci/pcie_port.h | 1 +
> 4 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/hw/pci-bridge/gen_pcie_root_port.c b/hw/pci-bridge/gen_pcie_root_port.c
> index 9766edb..b5a5ecc 100644
> --- a/hw/pci-bridge/gen_pcie_root_port.c
> +++ b/hw/pci-bridge/gen_pcie_root_port.c
> @@ -20,6 +20,7 @@
> OBJECT_CHECK(GenPCIERootPort, (obj), TYPE_GEN_PCIE_ROOT_PORT)
>
> #define GEN_PCIE_ROOT_PORT_AER_OFFSET 0x100
> +#define GEN_PCIE_ROOT_PORT_ACS_OFFSET 0x148
Perhaps (GEN_PCIE_ROOT_PORT_AER_OFFSET + PCI_ERR_SIZEOF)
> #define GEN_PCIE_ROOT_PORT_MSIX_NR_VECTOR 1
>
> typedef struct GenPCIERootPort {
> @@ -149,6 +150,7 @@ static void gen_rp_dev_class_init(ObjectClass *klass, void *data)
> rpc->interrupts_init = gen_rp_interrupts_init;
> rpc->interrupts_uninit = gen_rp_interrupts_uninit;
> rpc->aer_offset = GEN_PCIE_ROOT_PORT_AER_OFFSET;
> + rpc->acs_offset = GEN_PCIE_ROOT_PORT_ACS_OFFSET;
> }
>
> static const TypeInfo gen_rp_dev_info = {
> diff --git a/hw/pci-bridge/ioh3420.c b/hw/pci-bridge/ioh3420.c
> index 81f2de6..2064939 100644
> --- a/hw/pci-bridge/ioh3420.c
> +++ b/hw/pci-bridge/ioh3420.c
> @@ -71,7 +71,6 @@ static int ioh3420_interrupts_init(PCIDevice *d, Error **errp)
> if (rc < 0) {
> assert(rc == -ENOTSUP);
> }
> -
Unrelated
> return rc;
> }
>
> diff --git a/hw/pci-bridge/pcie_root_port.c b/hw/pci-bridge/pcie_root_port.c
> index 34ad767..c33a493 100644
> --- a/hw/pci-bridge/pcie_root_port.c
> +++ b/hw/pci-bridge/pcie_root_port.c
> @@ -106,6 +106,9 @@ static void rp_realize(PCIDevice *d, Error **errp)
> pcie_aer_root_init(d);
> rp_aer_vector_update(d);
>
> + if (rpc->acs_offset) {
> + pcie_acs_init(d, rpc->acs_offset, 0);
> + }
> return;
>
> err:
> diff --git a/include/hw/pci/pcie_port.h b/include/hw/pci/pcie_port.h
> index df242a0..09586f4 100644
> --- a/include/hw/pci/pcie_port.h
> +++ b/include/hw/pci/pcie_port.h
> @@ -78,6 +78,7 @@ typedef struct PCIERootPortClass {
> int exp_offset;
> int aer_offset;
> int ssvid_offset;
> + int acs_offset; /* If nonzero, optional ACS capability offset */
> int ssid;
> } PCIERootPortClass;
>
next prev parent reply other threads:[~2019-01-23 19:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-23 18:27 [Qemu-devel] [PATCH 0/2] pcie: Add simple ACS "support" to the generic PCIe root port Knut Omang
2019-01-23 18:27 ` [Qemu-devel] [PATCH 1/2] pcie: Add a simple PCIe ACS (Access Control Services) helper function Knut Omang
2019-01-23 19:04 ` Alex Williamson
2019-01-23 19:14 ` Knut Omang
2019-01-23 19:32 ` Alex Williamson
2019-01-23 19:37 ` Knut Omang
2019-01-23 19:46 ` Knut Omang
2019-01-23 19:56 ` Alex Williamson
2019-01-23 19:58 ` Knut Omang
2019-01-23 18:28 ` [Qemu-devel] [PATCH 2/2] gen_pcie_root_port: Add ACS (Access Control Services) capability Knut Omang
2019-01-23 19:04 ` Alex Williamson [this message]
2019-01-23 19:14 ` Knut Omang
2019-01-31 17:49 ` [Qemu-devel] [PATCH 0/2] pcie: Add simple ACS "support" to the generic PCIe root port no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190123120438.2d47e352@w520.home \
--to=alex.williamson@redhat.com \
--cc=elijahs@mellanox.com \
--cc=knut.omang@oracle.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=talat@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.