Re: [PATCH v3 0/4] virtio-iommu: Support VIRTIO_IOMMU_F_BYPASS_CONFIG

2022-03-03 Thread Jean-Philippe Brucker
Hello, On Mon, Feb 14, 2022 at 12:43:52PM +, Jean-Philippe Brucker wrote: > Replace the VIRTIO_IOMMU_F_BYPASS feature with > VIRTIO_IOMMU_F_BYPASS_CONFIG, which enables a config space bit to switch > global bypass on and off. > > Add a boot-bypass option, which defaults to &#x

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 b

[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

[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 0/3] virtio-iommu: Support VIRTIO_IOMMU_F_BYPASS_CONFIG

2021-09-30 Thread Jean-Philippe Brucker
are 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: Supp

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

2021-09-30 Thread Jean-Philippe Brucker
o DMA 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

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 > hav

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, doe

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 act

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

2021-10-01 Thread Jean-Philippe Brucker
s") 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

[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 00/11] virtio-iommu: Add ACPI support

2021-10-01 Thread Jean-Philippe Brucker
ps://lore.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

[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 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 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 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 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 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 --

[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 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 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,

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

2022-02-08 Thread Jean-Philippe Brucker
On Wed, Feb 02, 2022 at 02:21:37PM +0100, Eric Auger wrote: > >>> diff --git a/hw/virtio/virtio-iommu.c b/hw/virtio/virtio-iommu.c > >>> index ec02029bb6..a112428c65 100644 > >>> --- a/hw/virtio/virtio-iommu.c > >>> +++ b/hw/virtio/virtio-iommu.c > >>> @@ -43,6 +43,7 @@ > >>> > >>> typedef struc

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

2022-02-08 Thread Jean-Philippe Brucker
On Tue, Feb 08, 2022 at 02:29:21PM +0100, Eric Auger wrote: > Hi Jean, > > On 2/8/22 2:09 PM, Dr. David Alan Gilbert wrote: > > * Jean-Philippe Brucker (jean-phili...@linaro.org) wrote: > >> On Wed, Feb 02, 2022 at 02:21:37PM +0100, Eric Auger wrote: > >>>>&

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

2022-01-27 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 v2 1/4] linux-headers: update to v5.17-rc1

2022-01-27 Thread Jean-Philippe Brucker
Update Linux headers to v5.17-rc1 Signed-off-by: Jean-Philippe Brucker --- include/standard-headers/asm-x86/kvm_para.h | 1 + include/standard-headers/drm/drm_fourcc.h | 11 ++ include/standard-headers/linux/ethtool.h | 1 + include/standard-headers/linux/fuse.h | 60

[PATCH v2 4/4] tests/qtest/virtio-iommu-test: Check bypass config

2022-01-27 Thread Jean-Philippe Brucker
The bypass config field should be initialized to 1 by default. Signed-off-by: Jean-Philippe Brucker --- tests/qtest/virtio-iommu-test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qtest/virtio-iommu-test.c b/tests/qtest/virtio-iommu-test.c index 47e68388a0..068e7a9e6c 100644

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

2022-01-27 Thread Jean-Philippe Brucker
o DMA bypassing the IOMMU during boot. Add a "boot-bypass" property, defaulting to true, that lets users change this behavior. Replace the VIRTIO_IOMMU_F_BYPASS feature, which didn't support bypass before feature negotiation, with VIRTIO_IOMMU_F_BYPASS_CONFIG. Signed-off-by: J

[PATCH v2 0/4] virtio-iommu: Support VIRTIO_IOMMU_F_BYPASS_CONFIG

2022-01-27 Thread Jean-Philippe Brucker
valds/linux.git/commit/?id=063ebb19d962 Jean-Philippe Brucker (4): linux-headers: update to v5.17-rc1 virtio-iommu: Default to bypass during boot virtio-iommu: Support bypass domain tests/qtest/virtio-iommu-test: Check bypass config include/hw/virtio/virtio-iommu.h | 1 + i

Re: [PATCH v6 6/7] tests/acpi: add test case for VIOT on q35 machine

2021-11-04 Thread Jean-Philippe Brucker
Hi Michael, On Mon, Nov 01, 2021 at 07:35:04PM -0400, Michael S. Tsirkin wrote: > On Tue, Oct 26, 2021 at 07:20:25PM +0100, Jean-Philippe Brucker wrote: > > Add a test case for VIOT on the q35 machine. To test complex topologies > > it has two PCIe buses that bypass the IOMMU (an

Re: [PATCH v6 6/7] tests/acpi: add test case for VIOT on q35 machine

2021-11-04 Thread Jean-Philippe Brucker
On Thu, Nov 04, 2021 at 03:56:38AM -0400, Michael S. Tsirkin wrote: > On Thu, Nov 04, 2021 at 07:49:37AM +0000, Jean-Philippe Brucker wrote: > > Hi Michael, > > > > On Mon, Nov 01, 2021 at 07:35:04PM -0400, Michael S. Tsirkin wrote: > > > On Tue, Oct 26, 2021 at 0

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 bypass

[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

[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 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 03/12] hw/i386/pc: Move IOMMU singleton into PCMachineState

2021-10-20 Thread Jean-Philippe Brucker
-remapping 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 |

[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 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 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 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 00/12] virtio-iommu: Add ACPI support

2021-10-20 Thread Jean-Philippe Brucker
ll 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 Brucke

[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 07/12] hw/arm/virt: Reject instantiation of multiple IOMMUs

2021-10-20 Thread Jean-Philippe Brucker
s") 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 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 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) +

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

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: [PATCH v4] tests: qtest: Add virtio-iommu test

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

[PATCH v2] hw/i386: Rename default_bus_bypass_iommu

2021-10-25 Thread Jean-Philippe Brucker
the underscore 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

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/arm/virt: Rename default_bus_bypass_iommu

2021-10-26 Thread Jean-Philippe Brucker
the underscore 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 separa

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

2021-10-26 Thread Jean-Philippe Brucker
On Thu, Oct 21, 2021 at 11:02:27AM +0200, Eric Auger wrote: > Hi Jean, > > On 10/20/21 7:27 PM, 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 that >

[PATCH v6 0/7] virtio-iommu: Add ACPI support (x86 part)

2021-10-26 Thread Jean-Philippe Brucker
phili...@linaro.org/ [2] https://lore.kernel.org/qemu-devel/20210930185050.262759-1-jean-phili...@linaro.org/ Jean-Philippe Brucker (7): hw/acpi: Add VIOT table hw/i386/pc: Remove x86_iommu_get_type() hw/i386/pc: Move IOMMU singleton into PCMachineState hw/i386/pc: Allow instantiating a v

[PATCH v6 1/7] hw/acpi: Add VIOT table

2021-10-26 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 v6 6/7] tests/acpi: add test case for VIOT on q35 machine

2021-10-26 Thread Jean-Philippe Brucker
Add a test case for VIOT on the q35 machine. To test complex topologies it has two PCIe buses that bypass the IOMMU (and are therefore not described by VIOT), and two buses that are translated by virtio-iommu. Reviewed-by: Eric Auger Reviewed-by: Igor Mammedov Signed-off-by: Jean-Philippe

[PATCH v6 5/7] tests/acpi: allow updates of VIOT expected data files on q35 machine

2021-10-26 Thread Jean-Philippe Brucker
Create empty data files and allow updates for the upcoming VIOT tests on the q35 machine. Acked-by: Igor Mammedov Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- tests/qtest/bios-tables-test-allowed-diff.h | 2 ++ tests/data/acpi/q35/DSDT.viot | 0 tests/data

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

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

[PATCH v6 4/7] hw/i386/pc: Allow instantiating a virtio-iommu device

2021-10-26 Thread Jean-Philippe Brucker
this region. Reviewed-by: Eric Auger Reviewed-by: Igor Mammedov 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

[PATCH v6 3/7] hw/i386/pc: Move IOMMU singleton into PCMachineState

2021-10-26 Thread Jean-Philippe Brucker
-remapping 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. Reviewed-by: Eric Auger Reviewed-by: Igor Mammedov Signed

[PATCH v6 2/7] hw/i386/pc: Remove x86_iommu_get_type()

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

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

2022-01-11 Thread Jean-Philippe Brucker
Hi Eric, On Tue, Jan 11, 2022 at 10:02:12AM +0100, Eric Auger wrote: > Hi Jean, Michael, > > On 9/30/21 8:50 PM, Jean-Philippe Brucker wrote: > > Replace the VIRTIO_IOMMU_F_BYPASS feature with > > VIRTIO_IOMMU_F_BYPASS_CONFIG, which enables a config space bit to switch >

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

2022-01-11 Thread Jean-Philippe Brucker
Hi Michael, On Tue, Jan 11, 2022 at 10:40:28AM -0500, Michael S. Tsirkin wrote: > On Tue, Jan 11, 2022 at 10:02:12AM +0100, Eric Auger wrote: > > Hi Jean, Michael, > > > > On 9/30/21 8:50 PM, Jean-Philippe Brucker wrote: > > > Replace the VIRT

[PATCH v3 0/4] virtio-iommu: Support VIRTIO_IOMMU_F_BYPASS_CONFIG

2022-02-14 Thread Jean-Philippe Brucker
equired workarounds since they didn't support ACPI and boot-bypass)." [1] https://lore.kernel.org/qemu-devel/20220127142940.671333-1-jean-phili...@linaro.org/ Jean-Philippe Brucker (4): linux-headers: update to v5.17-rc1 virtio-iommu: Default to bypass during boot virtio-iommu:

[PATCH v3 1/4] linux-headers: update to v5.17-rc1

2022-02-14 Thread Jean-Philippe Brucker
Update Linux headers to v5.17-rc1 Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- include/standard-headers/asm-x86/kvm_para.h | 1 + include/standard-headers/drm/drm_fourcc.h | 11 ++ include/standard-headers/linux/ethtool.h | 1 + include/standard-headers

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

2022-02-14 Thread Jean-Philippe Brucker
ass). Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- include/hw/virtio/virtio-iommu.h | 1 + hw/virtio/virtio-iommu.c | 60 +++- hw/virtio/trace-events | 4 ++- 3 files changed, 56 insertions(+), 9 deletions(-) diff --git a/incl

[PATCH v3 4/4] tests/qtest/virtio-iommu-test: Check bypass config

2022-02-14 Thread Jean-Philippe Brucker
The bypass config field should be initialized to 1 by default. Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- tests/qtest/virtio-iommu-test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qtest/virtio-iommu-test.c b/tests/qtest/virtio-iommu-test.c index

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

2022-02-14 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 | 39

Re: [PATCH v3 0/4] virtio-iommu: Support VIRTIO_IOMMU_F_BYPASS_CONFIG

2022-02-15 Thread Jean-Philippe Brucker
On Tue, Feb 15, 2022 at 10:16:40AM +0100, Eric Auger wrote: > Hi Connie, > > On 2/14/22 6:34 PM, Cornelia Huck wrote: > > On Mon, Feb 14 2022, Jean-Philippe Brucker wrote: > > > >> Replace the VIRTIO_IOMMU_F_BYPASS feature with > >> VIRTIO_IOMMU_F_BYPASS_C

Re: [PATCH v3 0/4] virtio-iommu: Support VIRTIO_IOMMU_F_BYPASS_CONFIG

2022-02-15 Thread Jean-Philippe Brucker
On Tue, Feb 15, 2022 at 10:25:21AM +0100, Eric Auger wrote: > Hi Jean, > > On 2/14/22 1:43 PM, Jean-Philippe Brucker wrote: > > Replace the VIRTIO_IOMMU_F_BYPASS feature with > > VIRTIO_IOMMU_F_BYPASS_CONFIG, which enables a config space bit to switch > > global bypas

[PATCH 1/2] hw/arm/smmuv3: Cache event fault record

2022-04-27 Thread Jean-Philippe Brucker
uot;hw/arm/smmuv3: Implement translate callback") Signed-off-by: Jean-Philippe Brucker --- hw/arm/smmuv3-internal.h | 1 - include/hw/arm/smmu-common.h | 1 + hw/arm/smmuv3.c | 14 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/arm/smmuv3-inte

[PATCH 2/2] hw/arm/smmuv3: Add space in guest error message

2022-04-27 Thread Jean-Philippe Brucker
Make the translation error message prettier by adding a missing space before the parenthesis. Signed-off-by: Jean-Philippe Brucker --- hw/arm/smmuv3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c index 8b1d8103dc..3a989b09cb 100644 --- a

Re: [PATCH 1/2] hw/arm/smmuv3: Cache event fault record

2022-04-28 Thread Jean-Philippe Brucker
On Thu, Apr 28, 2022 at 01:58:50PM +0100, Peter Maydell wrote: > On Wed, 27 Apr 2022 at 12:17, Jean-Philippe Brucker > wrote: > > > > The Record bit in the Context Descriptor tells the SMMU to report fault > > events to the event queue. Since we don't cache the

[PATCH 00/10] hw/arm/virt: Fix dt-schema warnings

2022-08-24 Thread Jean-Philippe Brucker
nning dt-validate [1] and dtc: dt-validate -s linux/Documentation/devicetree/bindings/ qemu.dtb dtc -O dts qemu.dtb -o qemu.dts [1] https://lore.kernel.org/linux-devicetree/20220822152224.507497-1-jean-phili...@linaro.org/ [2] https://github.com/devicetree-org/dt-schema Jean-Philippe Brucke

[PATCH 06/10] hw/arm/virt: Fix devicetree warning about the gpio-key node

2022-08-24 Thread Jean-Philippe Brucker
#x27; From schema: linux/Documentation/devicetree/bindings/input/gpio-keys.yaml Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 5935f32a44..3d460f3686 100644 --- a/hw/arm/virt.

[PATCH 08/10] hw/arm/virt: Fix devicetree warnings about the GPIO node

2022-08-24 Thread Jean-Philippe Brucker
rrupt-cells' is a required property From schema: linux/Documentation/devicetree/bindings/gpio/pl061-gpio.yaml Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 952af37935..779eb5ea31 100644 --- a/hw/a

[PATCH 02/10] hw/arm/boot: Fix devicetree warning about the PSCI node

2022-08-24 Thread Jean-Philippe Brucker
s too long From schema: linux/Documentation/devicetree/bindings/arm/psci.yaml Signed-off-by: Jean-Philippe Brucker --- hw/arm/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index ada2717f76..527918227e 100644 --- a/hw/arm/boot.c +++ b/

[PATCH 07/10] hw/arm/virt: Fix devicetree warnings about node names

2022-08-24 Thread Jean-Philippe Brucker
does not match '^rtc(@.*|-[0-9a-f])*$' From schema: linux/Documentation/devicetree/bindings/rtc/arm,pl031.yaml pl011@900: $nodename:0: 'pl011@900' does not match '^serial(@.*)?$' From schema: linux/Documentation/devicetree/bindings/serial/pl011.yaml

[PATCH 01/10] hw/arm/virt: Fix devicetree warning about the root node

2022-08-24 Thread Jean-Philippe Brucker
llows the format 'manufacturer,model' and 'model' follows the format 'manufacturer,model-number'. Since our 'compatible' doesn't observe this, 'model' doesn't really need to either. Signed-off-by: Jean-Philippe Brucker --- This could

[PATCH 10/10] hw/arm/virt: Fix devicetree warnings about the virtio-iommu node

2022-08-24 Thread Jean-Philippe Brucker
/pcie@1000/virtio_iommu@16: PCI unit address format error, expected "2,0" The compatible property for a PCI child node should follow the rules from "PCI Bus Binding to: IEEE Std 1275-1994". It should contain the Vendor ID and Device ID (or class code). The unit-name should b

[PATCH 03/10] hw/arm/virt: Fix devicetree warnings about the GIC node

2022-08-24 Thread Jean-Philippe Brucker
on/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index abcf2716bc..b6aa311d8c 100644 --- a/hw/arm/virt.c +++ b/hw/arm/vir

[PATCH 04/10] hw/arm/virt: Use "msi-map" devicetree property for PCI

2022-08-24 Thread Jean-Philippe Brucker
tation/devicetree/bindings/pci/pci-msi.txt 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 b6aa311d8c..ca5d213895 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1489,8 +148

[PATCH 05/10] hw/arm/virt: Fix devicetree warning about the timer node

2022-08-24 Thread Jean-Philippe Brucker
om schema: linux/Documentation/devicetree/bindings/timer/arm,arch_timer.yaml Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index ca5d213895..5935f32a44 100644 --- a/hw/arm/virt.c +

[PATCH 09/10] hw/arm/virt: Fix devicetree warnings about the SMMU node

2022-08-24 Thread Jean-Philippe Brucker
o not match any of the regexes: 'pinctrl-[0-9]+' From schema: linux/Documentation/devicetree/bindings/iommu/arm,smmu-v3.yaml Fix them by: * changing the node name * reordering the IRQs * removing the clock properties which are not expected for the SMMU node Signed-off-by: Jean-Philipp

Re: [PATCH 02/10] hw/arm/boot: Fix devicetree warning about the PSCI node

2022-09-01 Thread Jean-Philippe Brucker
On Wed, Aug 24, 2022 at 08:33:54PM +0100, Peter Maydell wrote: > On Wed, 24 Aug 2022 at 16:51, Jean-Philippe Brucker > wrote: > > > > dt-validate warns that an implementation compatible with arm,psci-1.0 > > shouldn't have arm,psci in their compatible string. >

Re: [PATCH 03/10] hw/arm/virt: Fix devicetree warnings about the GIC node

2022-09-01 Thread Jean-Philippe Brucker
On Wed, Aug 24, 2022 at 08:36:33PM +0100, Peter Maydell wrote: > On Wed, 24 Aug 2022 at 16:51, Jean-Philippe Brucker > wrote: > > > > Fix three dt-validate warnings about the GIC node due to invalid names > > and missing property: > > > > intc@800: $noden

Re: [PATCH 05/10] hw/arm/virt: Fix devicetree warning about the timer node

2022-09-01 Thread Jean-Philippe Brucker
On Wed, Aug 24, 2022 at 08:40:21PM +0100, Peter Maydell wrote: > On Wed, 24 Aug 2022 at 16:51, Jean-Philippe Brucker > wrote: > > > > The compatible property of the Arm timer should contain either > > "arm,armv7-timer" or "arm,armv8-timer", n

Re: [PATCH 09/10] hw/arm/virt: Fix devicetree warnings about the SMMU node

2022-09-01 Thread Jean-Philippe Brucker
On Wed, Aug 24, 2022 at 08:45:05PM +0100, Peter Maydell wrote: > On Wed, 24 Aug 2022 at 16:51, Jean-Philippe Brucker > wrote: > > > > dt-validate reports three issues in the SMMU device-tree node: > > > > smmuv3@905: $nodename:0: 'smmuv3@905&#

Re: [PATCH 08/10] hw/arm/virt: Fix devicetree warnings about the GPIO node

2022-09-01 Thread Jean-Philippe Brucker
On Wed, Aug 24, 2022 at 08:48:26PM +0100, Peter Maydell wrote: > On Wed, 24 Aug 2022 at 16:51, Jean-Philippe Brucker > wrote: > > > > The GPIO devicetree node is missing "interrupt-controller" and > > "#interrupt-cells" properties: > > > &g

Re: [PATCH 10/10] hw/arm/virt: Fix devicetree warnings about the virtio-iommu node

2022-09-01 Thread Jean-Philippe Brucker
On Wed, Aug 24, 2022 at 08:51:18PM +0100, Peter Maydell wrote: > On Wed, 24 Aug 2022 at 16:51, Jean-Philippe Brucker > wrote: > > > > dt-validate and dtc throw a few warnings when parsing the virtio-iommu > > node: > > > > pcie@1000: virtio_iommu@16:compa

Re: [PATCH 2/2] hw/arm/smmu-common: Fix TTB1 handling

2023-02-14 Thread Jean-Philippe Brucker
On Mon, Feb 13, 2023 at 05:30:03PM +0100, Eric Auger wrote: > Hi Jean, > > On 2/10/23 17:37, Jean-Philippe Brucker wrote: > > Addresses targeting the second translation table (TTB1) in the SMMU have > > all upper bits set (except for the top byte when TBI is enabled). F

[PATCH v2 2/2] hw/arm/smmu-common: Fix TTB1 handling

2023-02-14 Thread Jean-Philippe Brucker
Addresses targeting the second translation table (TTB1) in the SMMU have all upper bits set (except for the top byte when TBI is enabled). Fix the TTB1 check. Reported-by: Ola Hugosson Reviewed-by: Eric Auger Reviewed-by: Richard Henderson Signed-off-by: Jean-Philippe Brucker --- hw/arm/smmu

[PATCH v2 1/2] hw/arm/smmu-common: Support 64-bit addresses

2023-02-14 Thread Jean-Philippe Brucker
Addresses targeting the second translation table (TTB1) in the SMMU have all upper bits set. Ensure the IOMMU region covers all 64 bits. Reviewed-by: Richard Henderson Signed-off-by: Jean-Philippe Brucker --- include/hw/arm/smmu-common.h | 2 -- hw/arm/smmu-common.c | 2 +- 2 files

[PATCH v2 0/2] hw/arm/smmu: Fixes for TTB1

2023-02-14 Thread Jean-Philippe Brucker
Two small changes to support TTB1. Since [v1] I removed the unused SMMU_MAX_VA_BITS and added tags, thanks! [v1] https://lore.kernel.org/qemu-devel/20230210163731.970130-1-jean-phili...@linaro.org/ Jean-Philippe Brucker (2): hw/arm/smmu-common: Support 64-bit addresses hw/arm/smmu-common

Re: [RFC PATCH 12/16] hw/arm/smmuv3: Add VMID to tlb tagging

2023-02-15 Thread Jean-Philippe Brucker
Hi Mostafa, On Sun, Feb 05, 2023 at 09:44:07AM +, Mostafa Saleh wrote: > Allow TLB to be tagged with VMID. > > If stage-1 is only supported, VMID is set to -1 and ignored from STE > and CMD_TLBI_NH* cmds. > > Signed-off-by: Mostafa Saleh > --- > hw/arm/smmu-common.c | 24 ++

[PATCH v2 5/8] hw/arm/virt: Fix devicetree warnings about the GPIO node

2022-09-27 Thread Jean-Philippe Brucker
linux/Documentation/devicetree/bindings/gpio/pl061-gpio.yaml pl061@903: '#interrupt-cells' is a required property From schema: linux/Documentation/devicetree/bindings/gpio/pl061-gpio.yaml Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c | 2 ++ 1 file changed, 2 insertions

[PATCH v2 7/8] hw/arm/virt: Fix devicetree warnings about the virtio-iommu node

2022-09-27 Thread Jean-Philippe Brucker
4,1057' was expected From schema: dtschema/schemas/pci/pci-bus.yaml Warning (pci_device_reg): /pcie@1000/virtio_iommu@16: PCI unit address format error, expected "2,0" Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(

[PATCH v2 0/8] hw/arm/virt: Fix dt-schema warnings

2022-09-27 Thread Jean-Philippe Brucker
phili...@linaro.org/ [3] https://github.com/devicetree-org/dt-schema Jean-Philippe Brucker (8): hw/arm/virt: Fix devicetree warning about the root node hw/arm/virt: Fix devicetree warning about the GIC node hw/arm/virt: Use "msi-map" devicetree property for PCI hw/arm/virt: Fix dev

[PATCH v2 6/8] hw/arm/virt: Fix devicetree warning about the SMMU node

2022-09-27 Thread Jean-Philippe Brucker
m,smmu-v3.yaml Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 10ce66c722..2de16f6324 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1362,8 +1362,6 @@ static void create_smmu(const VirtMachineState

[PATCH v2 8/8] hw/arm/virt: Fix devicetree warnings about node names

2022-09-27 Thread Jean-Philippe Brucker
,gic-v3.yaml smmuv3@905: $nodename:0: 'smmuv3@905' does not match '^iommu@[0-9a-f]*' From schema: linux/Documentation/devicetree/bindings/iommu/arm,smmu-v3.yaml Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c | 16 1 file changed, 8 insertion

[PATCH v2 1/8] hw/arm/virt: Fix devicetree warning about the root node

2022-09-27 Thread Jean-Philippe Brucker
nds that 'compatible' follows the format 'manufacturer,model' and 'model' follows the format 'manufacturer,model-number'. Since our 'compatible' doesn't observe this, 'model' doesn't really need to either. Signed-off-by: Jean-Phili

[PATCH v2 3/8] hw/arm/virt: Use "msi-map" devicetree property for PCI

2022-09-27 Thread Jean-Philippe Brucker
tation/devicetree/bindings/pci/pci-msi.txt 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 ed6f1ac41e..8605f5058a 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1489,8 +148

<    1   2   3   4   5   6   >