[PATCH v2] hw/arm/virt: Rename default_bus_bypass_iommu

2021-10-26 Thread Jean-Philippe Brucker
are transformed automatically. Fixes: 6d7a85483a06 ("hw/arm/virt: Add default_bus_bypass_iommu machine option") Reviewed-by: Eric Auger Reviewed-by: Philippe Mathieu-Daudé Tested-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- v2: Resending to be merged separately from th

Re: [PATCH v5 04/12] hw/i386/pc: Allow instantiating a virtio-iommu device

2021-10-25 Thread Jean-Philippe Brucker
On Thu, Oct 21, 2021 at 03:47:09PM +0200, Igor Mammedov wrote: > On Wed, 20 Oct 2021 18:27:38 +0100 > Jean-Philippe Brucker wrote: > > > Allow instantiating a virtio-iommu device by adding an ACPI Virtual I/O > > Translation table (VIOT), which describes the relation between

[PATCH v2] hw/i386: Rename default_bus_bypass_iommu

2021-10-25 Thread Jean-Philippe Brucker
are transformed automatically. Fixes: c9e96b04fc19 ("hw/i386: Add a default_bus_bypass_iommu pc machine option") Reviewed-by: Eric Auger Reviewed-by: Philippe Mathieu-Daudé Tested-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- v1: https://lore.kernel.org/qemu-devel/20211013

Re: [PATCH v4] tests: qtest: Add virtio-iommu test

2021-10-22 Thread Jean-Philippe Brucker
incorrect. I'll update them when adding the alignment checks. With the printf removed: Tested-by: Jean-Philippe Brucker Reviewed-by: Jean-Philippe Brucker

Re: [RESEND PATCH 2/2] hw/i386: Rename default_bus_bypass_iommu

2021-10-22 Thread Jean-Philippe Brucker
On Fri, Oct 22, 2021 at 10:46:08AM -0400, Michael S. Tsirkin wrote: > On Wed, Oct 13, 2021 at 05:06:08PM +0100, Jean-Philippe Brucker wrote: > > Since commit d8fb7d0969d5 ("vl: switch -M parsing to keyval"), machine > > parameter definitions cannot use underscore

Re: [RESEND PATCH 0/2] Fix machine parameter default_bus_bypass_iommu

2021-10-22 Thread Jean-Philippe Brucker
Hi Paolo, On Wed, Oct 13, 2021 at 05:06:06PM +0100, Jean-Philippe Brucker wrote: > The machine option "default_bus_bypass_iommu" is broken since commit > d8fb7d0969d5 ("vl: switch -M parsing to keyval"). Fix both machines that > implement it. Please could you take a

[PATCH v5 12/12] tests/acpi: add expected blobs for VIOT test on q35 machine

2021-10-20 Thread Jean-Philippe Brucker
// _ADR: Address +} + +Device (S18) +{ +Name (_ADR, 0x0003) // _ADR: Address +} + +Device (S20) +{ +Name (_ADR, 0x0004) // _ADR: Address +} + + Device (S28) +

[PATCH v5 11/12] tests/acpi: add expected blob for VIOT test on virt machine

2021-10-20 Thread Jean-Philippe Brucker
h 0078 2] PCI BDF end : 00FF [050h 0080 2] Output node : 0030 [052h 0082 6] Reserved : Acked-by: Ani Sinha Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- tests/qtest/bios-tables-test-allowed-d

[PATCH v5 07/12] hw/arm/virt: Reject instantiation of multiple IOMMUs

2021-10-20 Thread Jean-Philippe Brucker
ings") Reviewed-by: Eric Auger Reviewed-by: Igor Mammedov Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 3da7a86e37..25db8d4262 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2441,6 +24

[PATCH v5 10/12] tests/acpi: add test cases for VIOT

2021-10-20 Thread Jean-Philippe Brucker
Mammedov Signed-off-by: Jean-Philippe Brucker --- tests/qtest/bios-tables-test.c | 38 ++ 1 file changed, 38 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 4f11d03055..599b155201 100644 --- a/tests/qtest/bios-tables

[PATCH v5 00/12] virtio-iommu: Add ACPI support

2021-10-20 Thread Jean-Philippe Brucker
will be included in next ACPI version, here: https://jpbrucker.net/virtio-iommu/viot/viot-v9.pdf [1] https://lore.kernel.org/qemu-devel/20211001173358.863017-1-jean-phili...@linaro.org/ [2] https://lore.kernel.org/qemu-devel/20210930185050.262759-1-jean-phili...@linaro.org/ Jean-Philippe Brucker (12

[PATCH v5 09/12] tests/acpi: allow updates of VIOT expected data files

2021-10-20 Thread Jean-Philippe Brucker
Create empty data files and allow updates for the upcoming VIOT tests. Signed-off-by: Jean-Philippe Brucker --- tests/qtest/bios-tables-test-allowed-diff.h | 3 +++ tests/data/acpi/q35/DSDT.viot | 0 tests/data/acpi/q35/VIOT.viot | 0 tests/data/acpi/virt/VIOT

[PATCH v5 08/12] hw/arm/virt: Use object_property_set instead of qdev_prop_set

2021-10-20 Thread Jean-Philippe Brucker
To propagate errors to the caller of the pre_plug callback, use the object_poperty_set*() functions directly instead of the qdev_prop_set*() helpers. Suggested-by: Igor Mammedov Reviewed-by: Eric Auger Reviewed-by: Igor Mammedov Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c | 5

[PATCH v5 05/12] hw/arm/virt-acpi-build: Add VIOT table for virtio-iommu

2021-10-20 Thread Jean-Philippe Brucker
When a virtio-iommu is instantiated, describe it using the ACPI VIOT table. Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt-acpi-build.c | 7 +++ hw/arm/Kconfig | 1 + 2 files changed, 8 insertions(+) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm

[PATCH v5 04/12] hw/i386/pc: Allow instantiating a virtio-iommu device

2021-10-20 Thread Jean-Philippe Brucker
this region. Reviewed-by: Eric Auger Tested-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- hw/i386/acpi-build.c | 10 +- hw/i386/pc.c | 16 +++- hw/i386/Kconfig | 1 + 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/hw/i386/acpi-build.c

[PATCH v5 03/12] hw/i386/pc: Move IOMMU singleton into PCMachineState

2021-10-20 Thread Jean-Philippe Brucker
IOMMU. Since virtio-iommu doesn't support IRQ remapping, this interface doesn't need to change for the moment. We could later replace X86IOMMUState with an "IRQ remapping IOMMU" interface if necessary. Signed-off-by: Jean-Philippe Brucker --- include/hw/i386/pc.h | 1 + hw/i386/pc.c

[PATCH v5 01/12] hw/acpi: Add VIOT table

2021-10-20 Thread Jean-Philippe Brucker
all PCI devices. When passing the "default_bus_bypass_iommu" machine option and "bypass_iommu" PXB option, only buses that do not bypass the IOMMU are described by PCI Range nodes. Reviewed-by: Eric Auger Tested-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- hw/ac

[PATCH v5 06/12] hw/arm/virt: Remove device tree restriction for virtio-iommu

2021-10-20 Thread Jean-Philippe Brucker
virtio-iommu is now supported with ACPI VIOT as well as device tree. Remove the restriction that prevents from instantiating a virtio-iommu device under ACPI. Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c| 10 ++ hw/virtio/virtio-iommu

[PATCH v5 02/12] hw/i386/pc: Remove x86_iommu_get_type()

2021-10-20 Thread Jean-Philippe Brucker
To generate the IOMMU ACPI table, acpi-build.c can use base QEMU types instead of a special IommuType value. Signed-off-by: Jean-Philippe Brucker --- include/hw/i386/x86-iommu.h | 12 hw/i386/acpi-build.c| 20 +--- hw/i386/amd_iommu.c | 2 -- hw

Re: [PATCH v4 00/11] virtio-iommu: Add ACPI support

2021-10-19 Thread Jean-Philippe Brucker
On Mon, Oct 18, 2021 at 11:25:05AM -0400, Michael S. Tsirkin wrote: > On Fri, Oct 08, 2021 at 04:17:37PM +0100, Jean-Philippe Brucker wrote: > > On Tue, Oct 05, 2021 at 11:45:42AM -0400, Michael S. Tsirkin wrote: > > > Looks like this can not be applied yet because the bypa

Re: [PATCH v3] tests: qtest: Add virtio-iommu test

2021-10-14 Thread Jean-Philippe Brucker
Hi Eric, On Thu, Oct 14, 2021 at 04:34:05AM -0400, Eric Auger wrote: > Add the framework to test the virtio-iommu-pci device > and tests exercising the attach/detach, map/unmap API. > > Signed-off-by: Eric Auger > Acked-by: Thomas Huth > > --- > > This applies on top of jean-Philippe's >

Re: [PATCH v3 2/2] virtio-iommu: Drop base_name and change generic_name

2021-10-14 Thread Jean-Philippe Brucker
rnelia Huck Reviewed-by: Jean-Philippe Brucker > --- > hw/virtio/virtio-iommu-pci.c | 3 +-- > include/hw/virtio/virtio-iommu.h | 2 +- > 2 files changed, 2 insertions(+), 3 deletions(-) > > diff --git a/hw/virtio/virtio-iommu-pci.c b/hw/virtio/virtio-iommu-pci.c > index 86

Re: [PATCH v3 1/2] virtio-iommu: Remove the non transitional name

2021-10-14 Thread Jean-Philippe Brucker
wed-by: Cornelia Huck Reviewed-by: Jean-Philippe Brucker > --- > hw/virtio/virtio-iommu-pci.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/hw/virtio/virtio-iommu-pci.c b/hw/virtio/virtio-iommu-pci.c > index 770c286be7..86fa4e6c28 100644 > --- a/hw/virtio/virtio-iommu-

[RESEND PATCH 2/2] hw/i386: Rename default_bus_bypass_iommu

2021-10-13 Thread Jean-Philippe Brucker
are transformed automatically. Fixes: c9e96b04fc19 ("hw/i386: Add a default_bus_bypass_iommu pc machine option") Reviewed-by: Eric Auger Tested-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- hw/i386/pc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i

[RESEND PATCH 0/2] Fix machine parameter default_bus_bypass_iommu

2021-10-13 Thread Jean-Philippe Brucker
85842.2511545-1-jean-phili...@linaro.org/ The fix was suggested by Paolo: https://lore.kernel.org/qemu-devel/6e233344-dd09-598f-082a-afe73d788...@redhat.com/ Jean-Philippe Brucker (2): hw/arm/virt: Rename default_bus_bypass_iommu hw/i386: Rename default_bus_bypass_iommu hw/arm/virt.c | 4 ++-

[RESEND PATCH 1/2] hw/arm/virt: Rename default_bus_bypass_iommu

2021-10-13 Thread Jean-Philippe Brucker
are transformed automatically. Fixes: 6d7a85483a06 ("hw/arm/virt: Add default_bus_bypass_iommu machine option") Reviewed-by: Eric Auger Tested-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --g

Re: [PATCH v2 2/3] hw/arm/virt-acpi-build: IORT upgrade up to revision E.b

2021-10-13 Thread Jean-Philippe Brucker
On Tue, Oct 05, 2021 at 10:38:04AM +0200, Eric Auger wrote: > Upgrade the IORT table from B to E.b specification > revision (ARM DEN 0049E.b). > > Signed-off-by: Eric Auger Reviewed-by: Jean-Philippe Brucker Two nits below > > --- > > v1 -> v2: > - F

Re: [PATCH v4 00/11] virtio-iommu: Add ACPI support

2021-10-11 Thread Jean-Philippe Brucker
Hi Haiwei, On Mon, Oct 11, 2021 at 06:10:07PM +0800, Haiwei Li wrote: [...] > Gave up waiting for root file system device. Common problems: > - Boot args (cat /proc/cmdline) >- Check rootdelay= (did the system wait long enough?) > - Missing modules (cat /proc/modules; ls /dev) > ALERT!

Re: [PATCH v4 10/11] tests/acpi: add expected blob for VIOT test on virt machine

2021-10-08 Thread Jean-Philippe Brucker
On Tue, Oct 05, 2021 at 03:34:57PM +0530, Ani Sinha wrote: > > > On Fri, 1 Oct 2021, Jean-Philippe Brucker wrote: > > > The VIOT blob contains the following: > > > > [000h 4]Signature : "VIOT"[Virtual I/O &

Re: [PATCH v4 10/11] tests/acpi: add expected blob for VIOT test on virt machine

2021-10-08 Thread Jean-Philippe Brucker
On Tue, Oct 05, 2021 at 09:38:13PM +0200, Eric Auger wrote: > Hi Jean, > > On 10/1/21 7:33 PM, Jean-Philippe Brucker wrote: > > The VIOT blob contains the following: > > > > [000h 4]Signature : "VIOT"[Virtual I/O >

Re: [PATCH v4 09/11] tests/acpi: add test cases for VIOT

2021-10-08 Thread Jean-Philippe Brucker
On Tue, Oct 05, 2021 at 03:57:17PM +0530, Ani Sinha wrote: > > > On Fri, 1 Oct 2021, Jean-Philippe Brucker wrote: > > > Add two test cases for VIOT, one on the q35 machine and the other on > > virt. To test complex topologies the q35 test has two PCIe buses t

Re: [PATCH v4 08/11] tests/acpi: allow updates of VIOT expected data files

2021-10-08 Thread Jean-Philippe Brucker
On Wed, Oct 06, 2021 at 10:12:15AM +0200, Igor Mammedov wrote: > On Fri, 1 Oct 2021 18:33:56 +0100 > Jean-Philippe Brucker wrote: > > > Create empty data files and allow updates for the upcoming VIOT tests. > > > > Signed-off-by: Jean-Philippe Brucker > > ---

Re: [PATCH v4 07/11] pc: Allow instantiating a virtio-iommu device

2021-10-08 Thread Jean-Philippe Brucker
On Wed, Oct 06, 2021 at 09:19:54AM +0200, Igor Mammedov wrote: > > @@ -1367,8 +1368,11 @@ static void pc_virtio_md_pci_unplug(HotplugHandler > > *hotplug_dev, > > static void pc_machine_device_pre_plug_cb(HotplugHandler *hotplug_dev, > >DeviceState

Re: [PATCH v4 03/11] hw/arm/virt: Remove device tree restriction for virtio-iommu

2021-10-08 Thread Jean-Philippe Brucker
On Tue, Oct 05, 2021 at 01:57:35PM +0200, Eric Auger wrote: > > diff --git a/hw/virtio/virtio-iommu-pci.c b/hw/virtio/virtio-iommu-pci.c > > index 770c286be7..f30eb16cbf 100644 > > --- a/hw/virtio/virtio-iommu-pci.c > > +++ b/hw/virtio/virtio-iommu-pci.c > > @@ -48,16 +48,9 @@ static void

Re: [PATCH v4 01/11] hw/acpi: Add VIOT table

2021-10-08 Thread Jean-Philippe Brucker
On Wed, Oct 06, 2021 at 10:09:50AM +0200, Igor Mammedov wrote: > On Fri, 1 Oct 2021 18:33:49 +0100 > Jean-Philippe Brucker wrote: > > > Add a function that generates a Virtual I/O Translation table (VIOT), > > describing the topology of paravirtual IOMMUs. The

Re: [PATCH v4 00/11] virtio-iommu: Add ACPI support

2021-10-08 Thread Jean-Philippe Brucker
On Tue, Oct 05, 2021 at 11:45:42AM -0400, Michael S. Tsirkin wrote: > Looks like this can not be applied yet because the bypass bit > isn't in yet. what's up with that? The boot-bypass bit isn't a hard dependency for this series, but it will be needed for full support eventually. It will be

Re: [PATCH 2/3] virtio-iommu: Default to bypass during boot

2021-10-08 Thread Jean-Philippe Brucker
On Wed, Oct 06, 2021 at 03:04:15PM +0200, Eric Auger wrote: > > +if (config.bypass != dev->config.bypass) { > > +if (!virtio_vdev_has_feature(vdev, VIRTIO_IOMMU_F_BYPASS_CONFIG)) { > > +virtio_error(vdev, "cannot set config.bypass"); > > +return; > > +}

[PATCH v4 11/11] tests/acpi: add expected blobs for VIOT test on q35 machine

2021-10-01 Thread Jean-Philippe Brucker
h 0106 6] Reserved : 00000000 Signed-off-by: Jean-Philippe Brucker --- tests/qtest/bios-tables-test-allowed-diff.h | 2 -- tests/data/acpi/q35/DSDT.viot | Bin 0 -> 9398 bytes tests/data/acpi/q35/VIOT.viot | Bin 0 -> 112 bytes 3 files changed,

[PATCH v4 08/11] tests/acpi: allow updates of VIOT expected data files

2021-10-01 Thread Jean-Philippe Brucker
Create empty data files and allow updates for the upcoming VIOT tests. Signed-off-by: Jean-Philippe Brucker --- tests/qtest/bios-tables-test-allowed-diff.h | 3 +++ tests/data/acpi/q35/DSDT.viot | 0 tests/data/acpi/q35/VIOT.viot | 0 tests/data/acpi/virt/VIOT

[PATCH v4 09/11] tests/acpi: add test cases for VIOT

2021-10-01 Thread Jean-Philippe Brucker
Add two test cases for VIOT, one on the q35 machine and the other on virt. To test complex topologies the q35 test has two PCIe buses that bypass the IOMMU (and are therefore not described by VIOT), and two buses that are translated by virtio-iommu. Signed-off-by: Jean-Philippe Brucker

[PATCH v4 06/11] hw/i386: Move vIOMMU uniqueness check into pc.c

2021-10-01 Thread Jean-Philippe Brucker
We're about to need this check for a third vIOMMU, virtio-iommu, which doesn't inherit X86IOMMUState as it doesn't support IRQ remapping and is a virtio device. Move the check into the pre_plug callback to be shared by all three vIOMMUs. Signed-off-by: Jean-Philippe Brucker --- hw/i386/pc.c

[PATCH v4 02/11] hw/arm/virt-acpi-build: Add VIOT table for virtio-iommu

2021-10-01 Thread Jean-Philippe Brucker
When a virtio-iommu is instantiated, describe it using the ACPI VIOT table. Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt-acpi-build.c | 7 +++ hw/arm/Kconfig | 1 + 2 files changed, 8 insertions(+) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm

[PATCH v4 07/11] pc: Allow instantiating a virtio-iommu device

2021-10-01 Thread Jean-Philippe Brucker
this region. Signed-off-by: Jean-Philippe Brucker --- include/hw/i386/pc.h | 2 ++ hw/i386/acpi-build.c | 5 + hw/i386/pc.c | 24 ++-- hw/i386/Kconfig | 1 + 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw

[PATCH v4 05/11] hw/arm/virt: Use object_property_set instead of qdev_prop_set

2021-10-01 Thread Jean-Philippe Brucker
To propagate errors to the caller of the pre_plug callback, use the object_poperty_set*() functions directly instead of the qdev_prop_set*() helpers. Suggested-by: Igor Mammedov Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions

[PATCH v4 01/11] hw/acpi: Add VIOT table

2021-10-01 Thread Jean-Philippe Brucker
describes all PCI devices. When passing the "default_bus_bypass_iommu" machine option and "bypass_iommu" PXB option, only buses that do not bypass the IOMMU are described by PCI Range nodes. Reviewed-by: Eric Auger Tested-by: Eric Auger Signed-off-by: Jean-Philippe Brucker

[PATCH v4 03/11] hw/arm/virt: Remove device tree restriction for virtio-iommu

2021-10-01 Thread Jean-Philippe Brucker
virtio-iommu is now supported with ACPI VIOT as well as device tree. Remove the restriction that prevents from instantiating a virtio-iommu device under ACPI. Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c| 10 ++ hw/virtio/virtio-iommu

[PATCH v4 00/11] virtio-iommu: Add ACPI support

2021-10-01 Thread Jean-Philippe Brucker
kernel.org/qemu-devel/20210924122802.1455362-1-imamm...@redhat.com/ [3] https://lore.kernel.org/qemu-devel/20210930185050.262759-1-jean-phili...@linaro.org/ Jean-Philippe Brucker (11): hw/acpi: Add VIOT table hw/arm/virt-acpi-build: Add VIOT table for virtio-iommu hw/arm/virt: Remove d

[PATCH v4 10/11] tests/acpi: add expected blob for VIOT test on virt machine

2021-10-01 Thread Jean-Philippe Brucker
h 0078 2] PCI BDF end : 00FF [050h 0080 2] Output node : 0030 [052h 0082 6] Reserved : 00000000 Signed-off-by: Jean-Philippe Brucker --- tests/qtest/bios-tables-test-allowed-diff.h | 1 - tests/data/acpi/virt/VIOT

[PATCH v4 04/11] hw/arm/virt: Reject instantiation of multiple IOMMUs

2021-10-01 Thread Jean-Philippe Brucker
ings") Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 56e8fc7059..36f0261ef4 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2441,6 +2441,11 @@ static void virt_machin

Re: [PATCH v3 07/10] tests/acpi: add test cases for VIOT

2021-10-01 Thread Jean-Philippe Brucker
On Mon, Sep 20, 2021 at 10:39:36AM +0200, Igor Mammedov wrote: > > +static void test_acpi_q35_viot(void) > > +{ > > +test_data data = { > > +.machine = MACHINE_Q35, > > +.variant = ".viot", > > > +.blkdev = "virtio-blk,bus=pcie.0", > why is this necessary? It isn't

Re: [PATCH v3 05/10] pc: Allow instantiating a virtio-iommu device

2021-10-01 Thread Jean-Philippe Brucker
On Mon, Sep 20, 2021 at 10:24:40AM +0200, Igor Mammedov wrote: > > +if (pcms->virtio_iommu && x86_iommu_get_default()) { > > +error_report("QEMU does not support multiple vIOMMUs for x86 > > yet."); > > +exit(EXIT_FAILURE); > > +} > > previous patch does similar check,

Re: [PATCH v3 01/10] hw/acpi: Add VIOT table

2021-10-01 Thread Jean-Philippe Brucker
On Mon, Sep 20, 2021 at 10:06:09AM +0200, Igor Mammedov wrote: > > +/* > > + * Generate a VIOT table with one PCI-based virtio-iommu that manages PCI > > + * endpoints. > > We usually put a pointer to spec/revision and chapter in it > that describes being implemented table, so reviewer would >

[PATCH 2/3] virtio-iommu: Default to bypass during boot

2021-09-30 Thread Jean-Philippe Brucker
bypassing the IOMMU during boot. Add a "boot-bypass" option that lets users change this behavior. Signed-off-by: Jean-Philippe Brucker --- include/hw/virtio/virtio-iommu.h | 1 + hw/virtio/virtio-iommu.c | 28 +++- hw/virtio/trace-events |

[PATCH 0/3] virtio-iommu: Support VIRTIO_IOMMU_F_BYPASS_CONFIG

2021-09-30 Thread Jean-Philippe Brucker
of the IOMMU. See the spec change for more rationale https://lists.oasis-open.org/archives/virtio-dev/202109/msg00137.html Jean-Philippe Brucker (3): NOMERGE: virtio-iommu: Add definitions for VIRTIO_IOMMU_F_BYPASS_CONFIG virtio-iommu: Default to bypass during boot virtio-iommu: Support bypass

[PATCH 3/3] virtio-iommu: Support bypass domain

2021-09-30 Thread Jean-Philippe Brucker
The driver can create a bypass domain by passing the VIRTIO_IOMMU_ATTACH_F_BYPASS flag on the ATTACH request. Bypass domains perform slightly better than domains with identity mappings since they skip translation. Signed-off-by: Jean-Philippe Brucker --- hw/virtio/virtio-iommu.c | 32

[PATCH 1/3] NOMERGE: virtio-iommu: Add definitions for VIRTIO_IOMMU_F_BYPASS_CONFIG

2021-09-30 Thread Jean-Philippe Brucker
Pull VIRTIO_IOMMU_F_BYPASS_CONFIG changes from Linux (not upstream yet). Signed-off-by: Jean-Philippe Brucker --- include/standard-headers/linux/virtio_iommu.h | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/standard-headers/linux/virtio_iommu.h b/include

Re: [PATCH 0/6] virtio-iommu: Add ACPI support

2021-09-29 Thread Jean-Philippe Brucker
On Wed, Sep 29, 2021 at 11:18:39AM +0200, Eric Auger wrote: > > I've been postponing the boot-bypass patch since it requires a > > specification change to be done right, but it's next on my list. > The boot-bypass feature seems a critical feature to overcome the current > v3 limitation. Are there

[PATCH v3 07/10] tests/acpi: add test cases for VIOT

2021-09-14 Thread Jean-Philippe Brucker
Add two test cases for VIOT, one on the q35 machine and the other on virt. To test complex topologies the q35 test has two PCIe buses that bypass the IOMMU (and are therefore not described by VIOT), and two buses that are translated by virtio-iommu. Signed-off-by: Jean-Philippe Brucker

[PATCH v3 04/10] hw/arm/virt: Reject instantiation of multiple IOMMUs

2021-09-14 Thread Jean-Philippe Brucker
ings") Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index f238766aa1..26069f943a 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2471,6 +2471,11 @@ static void virt_ma

[PATCH v3 00/10] virtio-iommu: Add ACPI support

2021-09-14 Thread Jean-Philippe Brucker
rucker.net/virtio-iommu/viot/viot-v9.pdf [1] https://lore.kernel.org/qemu-devel/20210903143208.2434284-1-jean-phili...@linaro.org/ [2] https://lore.kernel.org/qemu-devel/20210907144814.741785-1-imamm...@redhat.com/ Jean-Philippe Brucker (10): hw/acpi: Add VIOT table hw/arm/virt-acpi-build: Add

[PATCH v3 02/10] hw/arm/virt-acpi-build: Add VIOT table for virtio-iommu

2021-09-14 Thread Jean-Philippe Brucker
When a virtio-iommu is instantiated, describe it using the ACPI VIOT table. Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt-acpi-build.c | 7 +++ hw/arm/Kconfig | 1 + 2 files changed, 8 insertions(+) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm

[PATCH v3 08/10] tests/acpi: add expected VIOT blob for virt machine

2021-09-14 Thread Jean-Philippe Brucker
h 0078 2] PCI BDF end : 00FF [050h 0080 2] Output node : 0030 [052h 0082 6] Reserved : 00000000 Signed-off-by: Jean-Philippe Brucker --- tests/qtest/bios-tables-test-allowed-diff.h | 1 - tests/data/acpi/virt/VIOT

[PATCH v3 09/10] tests/acpi: add expected DSDT blob for VIOT test on q35

2021-09-14 Thread Jean-Philippe Brucker
(_ADR, 0x00060000) // _ADR: Address +} + Method (PCNT, 0, NotSerialized) { } } } } Signed-off-by: Jean-Philippe Brucker --- tests/qtest/bios-tables-test-allowed-diff.h | 1 - tests/data/acpi/q35/DSDT.viot | Bi

[PATCH v3 10/10] tests/acpi: add expected VIOT blob for q35 machine

2021-09-14 Thread Jean-Philippe Brucker
[068h 0104 2] Output node : 0030 [06Ah 0106 6] Reserved : 00000000 Signed-off-by: Jean-Philippe Brucker --- tests/qtest/bios-tables-test-allowed-diff.h | 1 - tests/data/acpi/q35/VIOT.viot | Bin 0 -> 112 bytes 2 files changed, 1 deleti

[PATCH v3 06/10] tests/acpi: allow updates of VIOT expected data files

2021-09-14 Thread Jean-Philippe Brucker
Create empty data files and allow updates for the upcoming VIOT tests. Signed-off-by: Jean-Philippe Brucker --- tests/qtest/bios-tables-test-allowed-diff.h | 3 +++ tests/data/acpi/q35/DSDT.viot | 0 tests/data/acpi/q35/VIOT.viot | 0 tests/data/acpi/virt/VIOT

[PATCH v3 01/10] hw/acpi: Add VIOT table

2021-09-14 Thread Jean-Philippe Brucker
describes all PCI devices. When passing the "default_bus_bypass_iommu" machine option and "bypass_iommu" PXB option, only buses that do not bypass the IOMMU are described by PCI Range nodes. Signed-off-by: Jean-Philippe Brucker --- Sizes and types are hardcoded because it will now

[PATCH v3 03/10] hw/arm/virt: Remove device tree restriction for virtio-iommu

2021-09-14 Thread Jean-Philippe Brucker
virtio-iommu is now supported with ACPI VIOT as well as device tree. Remove the restriction that prevents from instantiating a virtio-iommu device under ACPI. Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c| 10 ++ hw/virtio/virtio-iommu

[PATCH v3 05/10] pc: Allow instantiating a virtio-iommu device

2021-09-14 Thread Jean-Philippe Brucker
this region. Signed-off-by: Jean-Philippe Brucker --- include/hw/i386/pc.h | 2 ++ hw/i386/acpi-build.c | 5 + hw/i386/pc.c | 28 +++- hw/i386/Kconfig | 1 + 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/include/hw/i386/pc.h b/include

Re: [PATCH v2 8/8] docs: Add '-device virtio-iommu' entry

2021-09-08 Thread Jean-Philippe Brucker
On Mon, Sep 06, 2021 at 03:45:28PM +0100, Daniel P. Berrangé wrote: > On Fri, Sep 03, 2021 at 04:32:09PM +0200, Jean-Philippe Brucker wrote: > > Document the virtio-iommu device for qemu-system-x86_64. In particular > > note the lack of interrupt remapping, which may be an important

Re: [PATCH v2 7/8] pc: Allow instantiating a virtio-iommu device

2021-09-08 Thread Jean-Philippe Brucker
On Mon, Sep 06, 2021 at 04:57:39PM +0200, Eric Auger wrote: > Hi Jean, > > On 9/3/21 4:32 PM, Jean-Philippe Brucker wrote: > > From: Eric Auger > > > > Add a hotplug handler for virtio-iommu on x86 and set the necessary > > reserved region property. On x86,

Re: [PATCH v2 6/8] pc: Add VIOT table for virtio-iommu

2021-09-08 Thread Jean-Philippe Brucker
On Mon, Sep 06, 2021 at 05:02:05PM +0200, Eric Auger wrote: > Hi jean, > > On 9/3/21 4:32 PM, Jean-Philippe Brucker wrote: > > The ACPI Virtual I/O Translation table (VIOT) describes the relation > > between a virtio-iommu and the endpoints it manages. When a vi

Re: [PATCH v2 2/8] hw/acpi: Add VIOT table

2021-09-08 Thread Jean-Philippe Brucker
On Mon, Sep 06, 2021 at 02:58:55PM +0200, Eric Auger wrote: > Hi Jean, > > On 9/3/21 4:32 PM, Jean-Philippe Brucker wrote: > > Add a function that generates a Virtual I/O Translation table (VIOT), > > describing the topology of paravirtual IOMMUs. The table is created w

Re: [PATCH 1/2] hw/arm/virt: Rename default_bus_bypass_iommu

2021-09-07 Thread Jean-Philippe Brucker
On Wed, Aug 25, 2021 at 09:34:45AM +0200, Markus Armbruster wrote: > Markus Armbruster writes: > > > Did this series fall through the cracks for 6.1? > > Missed 6.1. What now? Patches still apply onto master. Please let me know if I should change anything, or provide backports for 6.1.

[PATCH v2 8/8] docs: Add '-device virtio-iommu' entry

2021-09-03 Thread Jean-Philippe Brucker
Document the virtio-iommu device for qemu-system-x86_64. In particular note the lack of interrupt remapping, which may be an important limitation on x86. Suggested-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- qemu-options.hx | 3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCH v2 6/8] pc: Add VIOT table for virtio-iommu

2021-09-03 Thread Jean-Philippe Brucker
The ACPI Virtual I/O Translation table (VIOT) describes the relation between a virtio-iommu and the endpoints it manages. When a virtio-iommu device is instantiated, add a VIOT table. Signed-off-by: Jean-Philippe Brucker --- hw/i386/Kconfig | 1 + include/hw/i386/pc.h | 2 ++ hw/i386/acpi

[PATCH v2 4/8] hw/arm/virt: Remove device tree restriction for virtio-iommu

2021-09-03 Thread Jean-Philippe Brucker
virtio-iommu is now supported with ACPI VIOT as well as device tree. Remove the restriction that prevents from instantiating a virtio-iommu device under ACPI. Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c| 10 ++ hw/virtio/virtio-iommu-pci.c | 7 --- 2

[PATCH v2 3/8] hw/arm/virt-acpi-build: Add VIOT table for virtio-iommu

2021-09-03 Thread Jean-Philippe Brucker
When a virtio-iommu is instantiated, describe it using the ACPI VIOT table. Signed-off-by: Jean-Philippe Brucker --- hw/arm/Kconfig | 1 + hw/arm/virt-acpi-build.c | 7 +++ 2 files changed, 8 insertions(+) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 4ba0aca067..7da0422446

[PATCH v2 7/8] pc: Allow instantiating a virtio-iommu device

2021-09-03 Thread Jean-Philippe Brucker
virtio-iommu does not support IRQ remapping it must be informed of the reserved region so that it can forward DMA transactions targeting this region. Signed-off-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- hw/i386/pc.c | 21 - 1 file changed, 20 insertions(+), 1

[PATCH v2 5/8] hw/arm/virt: Reject instantiation of multiple IOMMUs

2021-09-03 Thread Jean-Philippe Brucker
We do not support instantiating multiple IOMMUs. Before adding a virtio-iommu, check that no other IOMMU is present. This will detect both "iommu=smmuv3" machine parameter and another virtio-iommu instance. Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c | 5 + 1 file

[PATCH v2 0/8] virtio-iommu: Add ACPI support

2021-09-03 Thread Jean-Philippe Brucker
/20210810084505.2257983-1-jean-phili...@linaro.org/ Eric Auger (1): pc: Allow instantiating a virtio-iommu device Jean-Philippe Brucker (7): acpi: Add VIOT structure definitions hw/acpi: Add VIOT table hw/arm/virt-acpi-build: Add VIOT table for virtio-iommu hw/arm/virt: Remove device tree restriction

[PATCH v2 2/8] hw/acpi: Add VIOT table

2021-09-03 Thread Jean-Philippe Brucker
describes all PCI devices. When passing the "default_bus_bypass_iommu" machine option and "bypass_iommu" PXB option, only buses that do not bypass the IOMMU are described by PCI Range nodes. Signed-off-by: Jean-Philippe Brucker --- hw/acpi/Kconfig | 4 ++ hw/acpi/viot.h

[PATCH v2 1/8] acpi: Add VIOT structure definitions

2021-09-03 Thread Jean-Philippe Brucker
The ACPI Virtual I/O Translation table (VIOT) table describes I/O topology for paravirtual devices. At the moment it describes the relation between virtio-iommu devices and their endpoints. Add the structure definitions for VIOT. Signed-off-by: Jean-Philippe Brucker --- Following the latest spec

Re: [PATCH 0/6] virtio-iommu: Add ACPI support

2021-08-27 Thread Jean-Philippe Brucker
Hi Eric, On Tue, Aug 17, 2021 at 04:58:01PM +0200, Eric Auger wrote: > Hi Jean, > > On 8/10/21 10:45 AM, Jean-Philippe Brucker wrote: > > Allow instantiating a virtio-iommu device on ACPI systems by adding a > > Virtual I/O Translation table (VIOT). Enable x86 support for

Re: [PATCH 2/6] hw/acpi: Add VIOT table

2021-08-27 Thread Jean-Philippe Brucker
On Tue, Aug 10, 2021 at 11:22:27AM +0200, Igor Mammedov wrote: > On Tue, 10 Aug 2021 10:45:02 +0200 > Jean-Philippe Brucker wrote: > > > Add a function that generates a Virtual I/O Translation table (VIOT), > > describing the topology of paravirtual IOMMUs. The

Re: [PATCH 4/6] hw/arm/virt: Remove device tree restriction for virtio-iommu

2021-08-27 Thread Jean-Philippe Brucker
On Tue, Aug 17, 2021 at 03:42:22PM +0200, Eric Auger wrote: > > diff --git a/hw/virtio/virtio-iommu-pci.c b/hw/virtio/virtio-iommu-pci.c > > index 770c286be7..f30eb16cbf 100644 > > --- a/hw/virtio/virtio-iommu-pci.c > > +++ b/hw/virtio/virtio-iommu-pci.c > > @@ -48,16 +48,9 @@ static void

Re: [PATCH 6/6] pc: Allow instantiating a virtio-iommu device

2021-08-27 Thread Jean-Philippe Brucker
On Tue, Aug 17, 2021 at 04:11:49PM +0200, Eric Auger wrote: > Hi Jean, > > On 8/10/21 10:45 AM, Jean-Philippe Brucker wrote: > > From: Eric Auger > > > > Add a hotplug handler for virtio-iommu on x86 and set the necessary > > reserved region property. On x86,

[PATCH 2/2] hw/i386: Rename default_bus_bypass_iommu

2021-08-11 Thread Jean-Philippe Brucker
are transformed automatically. Fixes: c9e96b04fc19 ("hw/i386: Add a default_bus_bypass_iommu pc machine option") Signed-off-by: Jean-Philippe Brucker --- hw/i386/pc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index fb24f000e7..ce475

[PATCH 1/2] hw/arm/virt: Rename default_bus_bypass_iommu

2021-08-11 Thread Jean-Philippe Brucker
are transformed automatically. Fixes: 6d7a85483a06 ("hw/arm/virt: Add default_bus_bypass_iommu machine option") Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index b4598d3fe

[PATCH] vl: fix machine option containing underscores

2021-08-10 Thread Jean-Philippe Brucker
explicitly checking for aliases of these options instead of transforming all machine options. Fixes: d8fb7d0969d5 ("vl: switch -M parsing to keyval") Signed-off-by: Jean-Philippe Brucker --- My first take was renaming default_bus_bypass_iommu, since it's the only machine option with u

[PATCH 3/6] hw/arm/virt-acpi-build: Add VIOT table for virtio-iommu

2021-08-10 Thread Jean-Philippe Brucker
When a virtio-iommu is instantiated, describe it using the ACPI VIOT table. Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt-acpi-build.c | 7 +++ hw/arm/Kconfig | 1 + 2 files changed, 8 insertions(+) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index

[PATCH 2/6] hw/acpi: Add VIOT table

2021-08-10 Thread Jean-Philippe Brucker
describes all PCI devices. When passing the "default_bus_bypass_iommu" machine option and "bypass_iommu" PXB option, only buses that do not bypass the IOMMU are described by PCI Range nodes. Signed-off-by: Jean-Philippe Brucker --- hw/acpi/viot.h | 13 +++ hw/a

[PATCH 4/6] hw/arm/virt: Remove device tree restriction for virtio-iommu

2021-08-10 Thread Jean-Philippe Brucker
virtio-iommu is now supported with ACPI VIOT as well as device tree. Remove the restriction that prevents from instantiating a virtio-iommu device under ACPI. Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c| 10 ++ hw/virtio/virtio-iommu-pci.c | 7 --- 2

[PATCH 6/6] pc: Allow instantiating a virtio-iommu device

2021-08-10 Thread Jean-Philippe Brucker
virtio-iommu does not support IRQ remapping it must be informed of the reserved region so that it can forward DMA transactions targeting this region. Signed-off-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- hw/i386/pc.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion

[PATCH 1/6] acpi: Add VIOT structure definitions

2021-08-10 Thread Jean-Philippe Brucker
The ACPI Virtual I/O Translation table (VIOT) table describes I/O topology for paravirtual devices. At the moment it describes the relation between virtio-iommu devices and their endpoints. Add the structure definitions for VIOT. Signed-off-by: Jean-Philippe Brucker --- Following the latest spec

[PATCH 5/6] pc: Add VIOT table for virtio-iommu

2021-08-10 Thread Jean-Philippe Brucker
The ACPI Virtual I/O Translation table (VIOT) describes the relation between a virtio-iommu and the endpoints it manages. When a virtio-iommu device is instantiated, add a VIOT table. Signed-off-by: Jean-Philippe Brucker --- include/hw/i386/pc.h | 2 ++ hw/i386/acpi-build.c | 5 + hw/i386

[PATCH 0/6] virtio-iommu: Add ACPI support

2021-08-10 Thread Jean-Philippe Brucker
pc: Allow instantiating a virtio-iommu device Jean-Philippe Brucker (5): acpi: Add VIOT structure definitions hw/acpi: Add VIOT table hw/arm/virt-acpi-build: Add VIOT table for virtio-iommu hw/arm/virt: Remove device tree restriction for virtio-iommu pc: Add VIOT table for virtio-iommu hw/a

[PATCH v2] hw/intc/arm_gicv3_cpuif: Tolerate spurious EOIR writes

2021-06-04 Thread Jean-Philippe Brucker
s. Display a guest error and tolerate spurious EOIR writes. Fixes: 382c7160d1cd ("hw/intc/arm_gicv3_cpuif: Fix EOIR write access check logic") Signed-off-by: Jean-Philippe Brucker --- v2: Added qemu_log_mask() (so I didn't keep the Reviewed-by tag) v1: https://lore.kernel.org/qemu-devel/2021

Re: [PATCH] hw/intc/arm_gicv3_cpuif: Tolerate spurious EOIR writes

2021-06-03 Thread Jean-Philippe Brucker
On Thu, Jun 03, 2021 at 02:39:30PM +0200, Philippe Mathieu-Daudé wrote: > > diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c > > index 81f94c7f4a..1d0964c9bf 100644 > > --- a/hw/intc/arm_gicv3_cpuif.c > > +++ b/hw/intc/arm_gicv3_cpuif.c > > @@ -1357,7 +1357,8 @@ static void

[PATCH] hw/intc/arm_gicv3_cpuif: Tolerate spurious EOIR writes

2021-06-03 Thread Jean-Philippe Brucker
ply ignore spurious EOIR writes. Fixes: 382c7160d1cd ("hw/intc/arm_gicv3_cpuif: Fix EOIR write access check logic") Signed-off-by: Jean-Philippe Brucker --- hw/intc/arm_gicv3_cpuif.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/in

Re: [PULL 1/2] amd_iommu: Fix pte_override_page_mask()

2021-04-26 Thread Jean-Philippe Brucker
On Fri, Apr 23, 2021 at 05:11:33PM +0100, Peter Maydell wrote: > > > Jean-Philippe, do you know if this is a regression since 5.2? > > > > I don't think so, I can reproduce it with v5.2.0. > > OK, thanks; I think I favour not putting this into rc5, then. No problem, please let me know if I

<    1   2   3   4   5   >