From: Alex Williamson <alex.williamson@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [RFC PATCH-for-5.0] hw/pci-host: Add Kconfig selector for IGD PCIe pass-through
Date: Fri, 22 Nov 2019 10:34:38 -0700 [thread overview]
Message-ID: <20191122103438.5cfa0570@x1.home> (raw)
In-Reply-To: <20191122172201.11456-1-philmd@redhat.com>
On Fri, 22 Nov 2019 18:22:01 +0100
Philippe Mathieu-Daudé <philmd@redhat.com> wrote:
> Introduce a kconfig selector to allow builds without Intel
> Integrated Graphics Device GPU PCIe passthrough.
> We keep the default as enabled.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> RFC because to be able to use the Kconfig-generated
> "config-devices.h" header we have to move this device
> out of $common-obj and build i440fx.o on a per-target
> basis, which is not optimal...
> ---
> hw/pci-host/i440fx.c | 9 ++++++++-
> hw/vfio/pci-quirks.c | 6 ++++++
> hw/pci-host/Kconfig | 5 +++++
> hw/pci-host/Makefile.objs | 2 +-
> 4 files changed, 20 insertions(+), 2 deletions(-)
>
> diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c
> index f27131102d..41e93581f4 100644
> --- a/hw/pci-host/i440fx.c
> +++ b/hw/pci-host/i440fx.c
> @@ -34,6 +34,7 @@
> #include "hw/pci-host/pam.h"
> #include "qapi/visitor.h"
> #include "qemu/error-report.h"
> +#include "config-devices.h"
>
> /*
> * I440FX chipset data sheet.
> @@ -386,6 +387,8 @@ static const TypeInfo i440fx_info = {
> },
> };
>
> +#ifdef CONFIG_INTEL_IGD_PASSTHROUGH
> +
> /* IGD Passthrough Host Bridge. */
> typedef struct {
> uint8_t offset;
> @@ -470,6 +473,8 @@ static const TypeInfo igd_passthrough_i440fx_info = {
> .class_init = igd_passthrough_i440fx_class_init,
> };
>
> +#endif /* CONFIG_INTEL_IGD_PASSTHROUGH */
> +
> static const char *i440fx_pcihost_root_bus_path(PCIHostState *host_bridge,
> PCIBus *rootbus)
> {
> @@ -514,8 +519,10 @@ static const TypeInfo i440fx_pcihost_info = {
> static void i440fx_register_types(void)
> {
> type_register_static(&i440fx_info);
> - type_register_static(&igd_passthrough_i440fx_info);
> type_register_static(&i440fx_pcihost_info);
> +#ifdef CONFIG_INTEL_IGD_PASSTHROUGH
> + type_register_static(&igd_passthrough_i440fx_info);
> +#endif /* CONFIG_INTEL_IGD_PASSTHROUGH */
> }
>
Note that this IGD thing has nothing to do with the one below in vfio
code. AIUI, the one above is specific to Xen and very unfortunately
named and placed to seem more generic than it is. vfio IGD
*assignment* (not passthrough) has no dependency on this, so please
don't link them together. Thanks,
Alex
> type_init(i440fx_register_types)
> diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c
> index 136f3a9ad6..858148fa39 100644
> --- a/hw/vfio/pci-quirks.c
> +++ b/hw/vfio/pci-quirks.c
> @@ -1166,6 +1166,8 @@ static void vfio_probe_rtl8168_bar2_quirk(VFIOPCIDevice *vdev, int nr)
> trace_vfio_quirk_rtl8168_probe(vdev->vbasedev.name);
> }
>
> +#ifdef CONFIG_INTEL_IGD_PASSTHROUGH
> +
> /*
> * Intel IGD support
> *
> @@ -1811,6 +1813,8 @@ out:
> g_free(lpc);
> }
>
> +#endif /* CONFIG_INTEL_IGD_PASSTHROUGH */
> +
> /*
> * Common quirk probe entry points.
> */
> @@ -1860,7 +1864,9 @@ void vfio_bar_quirk_setup(VFIOPCIDevice *vdev, int nr)
> vfio_probe_nvidia_bar5_quirk(vdev, nr);
> vfio_probe_nvidia_bar0_quirk(vdev, nr);
> vfio_probe_rtl8168_bar2_quirk(vdev, nr);
> +#ifdef CONFIG_INTEL_IGD_PASSTHROUGH
> vfio_probe_igd_bar4_quirk(vdev, nr);
> +#endif /* CONFIG_INTEL_IGD_PASSTHROUGH */
> }
>
> void vfio_bar_quirk_exit(VFIOPCIDevice *vdev, int nr)
> diff --git a/hw/pci-host/Kconfig b/hw/pci-host/Kconfig
> index b0aa8351c4..0b7539765a 100644
> --- a/hw/pci-host/Kconfig
> +++ b/hw/pci-host/Kconfig
> @@ -1,6 +1,10 @@
> config PAM
> bool
>
> +config INTEL_IGD_PASSTHROUGH
> + default y
> + bool
> +
> config PREP_PCI
> bool
> select PCI
> @@ -32,6 +36,7 @@ config PCI_I440FX
> bool
> select PCI
> select PAM
> + imply INTEL_IGD_PASSTHROUGH
>
> config PCI_EXPRESS_Q35
> bool
> diff --git a/hw/pci-host/Makefile.objs b/hw/pci-host/Makefile.objs
> index efd752b766..3c925192dd 100644
> --- a/hw/pci-host/Makefile.objs
> +++ b/hw/pci-host/Makefile.objs
> @@ -13,7 +13,7 @@ common-obj-$(CONFIG_VERSATILE_PCI) += versatile.o
>
> common-obj-$(CONFIG_PCI_SABRE) += sabre.o
> common-obj-$(CONFIG_FULONG) += bonito.o
> -common-obj-$(CONFIG_PCI_I440FX) += i440fx.o
> +obj-$(CONFIG_PCI_I440FX) += i440fx.o
> common-obj-$(CONFIG_PCI_EXPRESS_Q35) += q35.o
> common-obj-$(CONFIG_PCI_EXPRESS_GENERIC_BRIDGE) += gpex.o
> common-obj-$(CONFIG_PCI_EXPRESS_XILINX) += xilinx-pcie.o
next prev parent reply other threads:[~2019-11-22 18:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-22 17:22 [RFC PATCH-for-5.0] hw/pci-host: Add Kconfig selector for IGD PCIe pass-through Philippe Mathieu-Daudé
2019-11-22 17:34 ` Alex Williamson [this message]
2019-11-23 9:56 ` Paolo Bonzini
2019-11-22 18:03 ` Thomas Huth
2019-11-22 18:58 ` Philippe Mathieu-Daudé
2019-11-22 20:26 ` 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=20191122103438.5cfa0570@x1.home \
--to=alex.williamson@redhat.com \
--cc=armbru@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).