virtio-iommu: Add ACPI support (Arm part + tests)
v7 cover virtio-iommu: Add ACPI support (Arm part + tests)
Add ACPI support for virtio-iommu on the virt machine, by instantiating a VIOT table. Also add the tests for the ACPI table.
Since last posting [1], I rebased onto v6.2.0-rc4. Note that v6 of this series [2] only contained the table and x86 support, which have been merged. Everything has now been reviewed and should be good to go.
* Patches 1-2 add the VIOT table for the virt machine
* Patches 3-4 are minor fixes
* Patches 5-8 add tests for the VIOT table. They contain the tests for q35 as well, which didn't make it last time because they depended on another fix that has now been merged.
[1] https://lore.kernel.org/qemu-devel/[email protected]/
[2] https://lore.kernel.org/qemu-devel/[email protected]/
Jean-Philippe Brucker (8):
hw/arm/virt-acpi-build: Add VIOT table for virtio-iommu hw/arm/virt: Remove device tree restriction for virtio-iommu hw/arm/virt: Reject instantiation of multiple IOMMUs hw/arm/virt: Use object_property_set instead of qdev_prop_set tests/acpi: allow updates of VIOT expected data files tests/acpi: add test case for VIOT
tests/acpi: add expected blobs for VIOT test on q35 machine tests/acpi: add expected blob for VIOT test on virt machine
hw/arm/virt-acpi-build.c | 7 ++++++ hw/arm/virt.c | 20 ++++++++--------- hw/virtio/virtio-iommu-pci.c | 12 ++--------- tests/qtest/bios-tables-test.c | 38 +++++++++++++++++++++++++++++++++ hw/arm/Kconfig | 1 + tests/data/acpi/q35/DSDT.viot | Bin 0 -> 9398 bytes tests/data/acpi/q35/VIOT.viot | Bin 0 -> 112 bytes tests/data/acpi/virt/VIOT | Bin 0 -> 88 bytes 8 files changed, 58 insertions(+), 20 deletions(-) create mode 100644 tests/data/acpi/q35/DSDT.viot create mode 100644 tests/data/acpi/q35/VIOT.viot create mode 100644 tests/data/acpi/virt/VIOT
Signature · 1 line
2.34.1
PATCH v7 1/8 hw/arm/virt-acpi-build: Add VIOT table for virtio-iommu
When a virtio-iommu is instantiated, describe it using the ACPI VIOT table.
--- hw/arm/virt-acpi-build.c | 7 +++++++ hw/arm/Kconfig | 1 + 2 files changed, 8 insertions(+)
hw/arm/virt-acpi-build.c +7 -0
@@ -55,6 +55,7 @@#include "kvm_arm.h" #include "migration/vmstate.h" #include "hw/acpi/ghes.h" +#include "hw/acpi/viot.h" #define ARM_SPI_BASE 32
@@ -1011,6 +1012,12 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables) }#endif +if (vms->iommu ==VIRT_IOMMU_VIRTIO ) { +acpi_add_table (table_offsets, tables_blob); +build_viot (ms, tables_blob, tables->linker, vms->virtio_iommu_bdf, + vms->oem_id, vms->oem_table_id); + } +/* XSDT is pointed to by RSDP */ xsdt = tables_blob->len; build_xsdt(tables_blob, tables->linker, table_offsets, vms->oem_id,
hw/arm/Kconfig +1 -0
@@ -27,6 +27,7 @@ config ARM_VIRT select DIMM select ACPI_HW_REDUCED select ACPI_APEI + select ACPI_VIOT config CHEETAH bool
Signature · 1 line
2.34.1
PATCH v7 2/8 hw/arm/virt: Remove device tree restriction for virtio-iommu
In reply to Jean-Philippe Bruckervirtio-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.
--- hw/arm/virt.c | 10 ++-------- hw/virtio/virtio-iommu-pci.c | 12 ++---------- 2 files changed, 4 insertions(+), 18 deletions(-)
hw/arm/virt.c +2 -8
@@ -2614,16 +2614,10 @@ static HotplugHandler *virt_machine_get_hotplug_handler(MachineState *machine,MachineClass *mc =MACHINE_GET_CLASS (machine);if (device_is_dynamic_sysbus (mc, dev) || - (object_dynamic_cast (OBJECT (dev),TYPE_PC_DIMM ))) { +object_dynamic_cast (OBJECT (dev),TYPE_PC_DIMM ) || +object_dynamic_cast (OBJECT (dev),TYPE_VIRTIO_IOMMU_PCI )) {return HOTPLUG_HANDLER (machine); } -if (object_dynamic_cast (OBJECT (dev),TYPE_VIRTIO_IOMMU_PCI )) { -VirtMachineState *vms =VIRT_MACHINE (machine); - -if (!vms->bootinfo.firmware_loaded || !virt_is_acpi_enabled (vms)) { -return HOTPLUG_HANDLER (machine); - } - }return NULL ; }
hw/virtio/virtio-iommu-pci.c +2 -10
@@ -48,16 +48,8 @@ static void virtio_iommu_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)VirtIOIOMMU *s =VIRTIO_IOMMU (vdev);if (!qdev_get_machine_hotplug_handler (DEVICE (vpci_dev))) { -MachineClass *mc =MACHINE_GET_CLASS (qdev_get_machine ()); - -error_setg (errp, -"%s machine fails to create iommu-map device tree bindings" , - mc->name); -error_append_hint (errp, -"Check your machine implements a hotplug handler " -"for the virtio-iommu-pci device\n" ); -error_append_hint (errp,"Check the guest is booted without FW or with " -"-no-acpi\n" ); +error_setg (errp,"Check your machine implements a hotplug handler " +"for the virtio-iommu-pci device" );return ; }for (int i =0 ; i < s->nb_reserved_regions; i++) {
Signature · 1 line
2.34.1
PATCH v7 3/8 hw/arm/virt: Reject instantiation of multiple IOMMUs
In reply to Jean-Philippe BruckerWe 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.
--- hw/arm/virt.c | 5 +++++ 1 file changed, 5 insertions(+)
hw/arm/virt.c +5 -0
@@ -2494,6 +2494,11 @@ static void virt_machine_device_pre_plug_cb(HotplugHandler *hotplug_dev,hwaddr db_start =0 , db_end =0 ;char *resv_prop_str; +if (vms->iommu !=VIRT_IOMMU_NONE ) { +error_setg (errp,"virt machine does not support multiple IOMMUs" ); +return ; + } +switch (vms->msi_controller) {case VIRT_MSI_CTRL_NONE :return ;
Signature · 1 line
2.34.1
PATCH v7 4/8 hw/arm/virt: Use object_property_set instead of qdev_prop_set
In reply to Jean-Philippe BruckerTo propagate errors to the caller of the pre_plug callback, use the object_poperty_set*() functions directly instead of the qdev_prop_set*() helpers.
--- hw/arm/virt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
hw/arm/virt.c +3 -2
@@ -2518,8 +2518,9 @@ static void virt_machine_device_pre_plug_cb(HotplugHandler *hotplug_dev, db_start, db_end, VIRTIO_IOMMU_RESV_MEM_T_MSI); -qdev_prop_set_uint32 (dev,"len-reserved-regions" ,1 ); -qdev_prop_set_string (dev,"reserved-regions[0]" , resv_prop_str); +object_property_set_uint (OBJECT (dev),"len-reserved-regions" ,1 , errp); +object_property_set_str (OBJECT (dev),"reserved-regions[0]" , + resv_prop_str, errp);g_free (resv_prop_str); } }
Signature · 1 line
2.34.1
PATCH v7 5/8 tests/acpi: allow updates of VIOT expected data files
In reply to Jean-Philippe BruckerCreate empty data files and allow updates for the upcoming VIOT tests.
--- 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 | 0 4 files changed, 3 insertions(+) create mode 100644 tests/data/acpi/q35/DSDT.viot create mode 100644 tests/data/acpi/q35/VIOT.viot create mode 100644 tests/data/acpi/virt/VIOT
tests/qtest/bios-tables-test-allowed-diff.h +3 -0
@@ -1 +1,4 @@/* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/virt/VIOT" , +"tests/data/acpi/q35/DSDT.viot" , +"tests/data/acpi/q35/VIOT.viot",
tests/data/acpi/q35/DSDT.viot new file +0 -0
tests/data/acpi/q35/VIOT.viot new file +0 -0
tests/data/acpi/virt/VIOT new file +0 -0
Signature · 1 line
2.34.1
PATCH v7 6/8 tests/acpi: add test case for VIOT
In reply to Jean-Philippe BruckerAdd 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.
--- tests/qtest/bios-tables-test.c | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)
tests/qtest/bios-tables-test.c +38 -0
@@ -1465,6 +1465,42 @@ static void test_acpi_virt_tcg(void)free_test_data (&data); } +static void test_acpi_q35_viot (void ) +{ +test_data data = { + .machine =MACHINE_Q35 , + .variant =".viot" , + }; + +/* +* To keep things interesting, two buses bypass the IOMMU. +* VIOT should only describes the other two buses. +*/ +test_acpi_one ("-machine default_bus_bypass_iommu=on " +"-device virtio-iommu-pci " +"-device pxb-pcie,bus_nr=0x10,id=pcie.100,bus=pcie.0 " +"-device pxb-pcie,bus_nr=0x20,id=pcie.200,bus=pcie.0,bypass_iommu=on " +"-device pxb-pcie,bus_nr=0x30,id=pcie.300,bus=pcie.0" , + &data); +free_test_data (&data); +} + +static void test_acpi_virt_viot (void ) +{ +test_data data = { + .machine ="virt" , + .uefi_fl1 ="pc-bios/edk2-aarch64-code.fd" , + .uefi_fl2 ="pc-bios/edk2-arm-vars.fd" , + .cd ="tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2" , + .ram_start =0x40000000ULL , + .scan_len =128ULL *1024 *1024 , + }; + +test_acpi_one ("-cpu cortex-a57 " +"-device virtio-iommu-pci" , &data); +free_test_data (&data); +} +static void test_oem_fields (test_data *data) {int i;
@@ -1639,6 +1675,7 @@ int main(int argc, char *argv[])qtest_add_func ("acpi/q35/kvm/xapic" , test_acpi_q35_kvm_xapic);qtest_add_func ("acpi/q35/kvm/dmar" , test_acpi_q35_kvm_dmar); } +qtest_add_func ("acpi/q35/viot" , test_acpi_q35_viot); }else if (strcmp (arch,"aarch64" ) ==0 ) {if (has_tcg) {qtest_add_func ("acpi/virt" , test_acpi_virt_tcg);
@@ -1646,6 +1683,7 @@ int main(int argc, char *argv[])qtest_add_func ("acpi/virt/memhp" , test_acpi_virt_tcg_memhp);qtest_add_func ("acpi/virt/pxb" , test_acpi_virt_tcg_pxb);qtest_add_func ("acpi/virt/oem-fields" , test_acpi_oem_fields_virt); +qtest_add_func ("acpi/virt/viot" , test_acpi_virt_viot); } } ret =g_test_run ();
Signature · 1 line
2.34.1
PATCH v7 7/8 tests/acpi: add expected blobs for VIOT test on q35 machine
In reply to Jean-Philippe BruckerAdd expected blobs of the VIOT and DSDT table for the VIOT test on the q35 machine.
Since the test instantiates a virtio device and two PCIe expander bridges, DSDT.viot has more blocks than the base DSDT.
The VIOT table generated for the q35 test is:
[000h 0000 4] Signature : "VIOT" [Virtual I/O Translation Table] [004h 0004 4] Table Length : 00000070 [008h 0008 1] Revision : 00 [009h 0009 1] Checksum : 3D [00Ah 0010 6] Oem ID : "BOCHS " [010h 0016 8] Oem Table ID : "BXPC " [018h 0024 4] Oem Revision : 00000001 [01Ch 0028 4] Asl Compiler ID : "BXPC" [020h 0032 4] Asl Compiler Revision : 00000001
[024h 0036 2] Node count : 0003 [026h 0038 2] Node offset : 0030 [028h 0040 8] Reserved : 0000000000000000
[030h 0048 1] Type : 03 [VirtIO-PCI IOMMU] [031h 0049 1] Reserved : 00 [032h 0050 2] Length : 0010
[034h 0052 2] PCI Segment : 0000 [036h 0054 2] PCI BDF number : 0010 [038h 0056 8] Reserved : 0000000000000000
[040h 0064 1] Type : 01 [PCI Range] [041h 0065 1] Reserved : 00 [042h 0066 2] Length : 0018
[044h 0068 4] Endpoint start : 00003000 [048h 0072 2] PCI Segment start : 0000 [04Ah 0074 2] PCI Segment end : 0000 [04Ch 0076 2] PCI BDF start : 3000 [04Eh 0078 2] PCI BDF end : 30FF [050h 0080 2] Output node : 0030 [052h 0082 6] Reserved : 000000000000
[058h 0088 1] Type : 01 [PCI Range] [059h 0089 1] Reserved : 00 [05Ah 0090 2] Length : 0018
[05Ch 0092 4] Endpoint start : 00001000 [060h 0096 2] PCI Segment start : 0000 [062h 0098 2] PCI Segment end : 0000 [064h 0100 2] PCI BDF start : 1000 [066h 0102 2] PCI BDF end : 10FF [068h 0104 2] Output node : 0030 [06Ah 0106 6] Reserved : 000000000000
And the DSDT diff is:
@@ -5,13 +5,13 @@
*
* Disassembling to symbolic ASL+ operators
*
- * Disassembly of tests/data/acpi/q35/DSDT, Fri Dec 10 15:03:08 2021
+ * Disassembly of /tmp/aml-H9Y5D1, Fri Dec 10 15:02:27 2021 *
* Original Table Header:
* Signature "DSDT"
- * Length 0x00002061 (8289)
+ * Length 0x000024B6 (9398)
* Revision 0x01 **** 32-bit table (V1), no 64-bit math support
- * Checksum 0xFA
+ * Checksum 0xA7
* OEM ID "BOCHS "
* OEM Table ID "BXPC "
* OEM Revision 0x00000001 (1)
@@ -3114,6 +3114,339 @@
}
}+ Scope (\_SB)
+ {
+ Device (PC30)
+ {
+ Name (_UID, 0x30) // _UID: Unique ID
+ Name (_BBN, 0x30) // _BBN: BIOS Bus Number
+ Name (_HID, EisaId ("PNP0A08") /* PCI Express Bus */) // _HID: Hardware ID
+ Name (_CID, EisaId ("PNP0A03") /* PCI Bus */) // _CID: Compatible ID
+ Method (_OSC, 4, NotSerialized) // _OSC: Operating System Capabilities
+ {
+ CreateDWordField (Arg3, Zero, CDW1)
+ If ((Arg0 == ToUUID ("33db4d5b-1ff7-401c-9657-7441c03dd766") /* PCI Host Bridge Device */))
+ {
+ CreateDWordField (Arg3, 0x04, CDW2)
+ CreateDWordField (Arg3, 0x08, CDW3)
+ Local0 = CDW3 /* \_SB_.PC30._OSC.CDW3 */
+ Local0 &= 0x1F
+ If ((Arg1 != One))
+ {+ CDW1 |= 0x08
+ }
+
+ If ((CDW3 != Local0))
+ {
+ CDW1 |= 0x10
+ }
+
+ CDW3 = Local0
+ }
+ Else
+ {+ CDW1 |= 0x04
+ }
+
+ Return (Arg3)
+ }
+
+ Method (_PRT, 0, NotSerialized) // _PRT: PCI Routing Table
+ {
+ Local0 = Package (0x80){}
+ Local1 = Zero
+ While ((Local1 < 0x80))
+ {
+ Local2 = (Local1 >> 0x02)
+ Local3 = ((Local1 + Local2) & 0x03)
+ If ((Local3 == Zero))
+ {
+ Local4 = Package (0x04)
+ {
+ Zero,
+ Zero,
+ LNKD,
+ Zero+ }
+ }
+
+ If ((Local3 == One))
+ {
+ Local4 = Package (0x04)
+ {
+ Zero, + Zero, + LNKA, + Zero
+ }
+ }
+
+ If ((Local3 == 0x02))
+ {
+ Local4 = Package (0x04)
+ {
+ Zero, + Zero, + LNKB, + Zero
+ }
+ }
+
+ If ((Local3 == 0x03))
+ {
+ Local4 = Package (0x04)
+ {
+ Zero, + Zero, + LNKC, + Zero + } + } + + Local4 [Zero] = ((Local2 << 0x10) | 0xFFFF) + Local4 [One] = (Local1 & 0x03) + Local0 [Local1] = Local4 + Local1++
+ }
+
+ Return (Local0)
+ }
+
+ Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
+ {
+ WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
+ 0x0000, // Granularity + 0x0030, // Range Minimum + 0x0030, // Range Maximum + 0x0000, // Translation Offset + 0x0001, // Length + ,, )
+ })
+ }
+ }
+
+ Scope (\_SB)
+ {
+ Device (PC20)
+ {
+ Name (_UID, 0x20) // _UID: Unique ID
+ Name (_BBN, 0x20) // _BBN: BIOS Bus Number
+ Name (_HID, EisaId ("PNP0A08") /* PCI Express Bus */) // _HID: Hardware ID
+ Name (_CID, EisaId ("PNP0A03") /* PCI Bus */) // _CID: Compatible ID
+ Method (_OSC, 4, NotSerialized) // _OSC: Operating System Capabilities
+ {
+ CreateDWordField (Arg3, Zero, CDW1)
+ If ((Arg0 == ToUUID ("33db4d5b-1ff7-401c-9657-7441c03dd766") /* PCI Host Bridge Device */))
+ {
+ CreateDWordField (Arg3, 0x04, CDW2)
+ CreateDWordField (Arg3, 0x08, CDW3)
+ Local0 = CDW3 /* \_SB_.PC20._OSC.CDW3 */
+ Local0 &= 0x1F
+ If ((Arg1 != One))
+ {+ CDW1 |= 0x08
+ }
+
+ If ((CDW3 != Local0))
+ {
+ CDW1 |= 0x10
+ }
+
+ CDW3 = Local0
+ }
+ Else
+ {+ CDW1 |= 0x04
+ }
+
+ Return (Arg3)
+ }
+
+ Method (_PRT, 0, NotSerialized) // _PRT: PCI Routing Table
+ {
+ Local0 = Package (0x80){}
+ Local1 = Zero
+ While ((Local1 < 0x80))
+ {
+ Local2 = (Local1 >> 0x02)
+ Local3 = ((Local1 + Local2) & 0x03)
+ If ((Local3 == Zero))
+ {
+ Local4 = Package (0x04)
+ {
+ Zero,
+ Zero,
+ LNKD,
+ Zero+ }
+ }
+
+ If ((Local3 == One))
+ {
+ Local4 = Package (0x04)
+ {
+ Zero, + Zero, + LNKA, + Zero
+ }
+ }
+
+ If ((Local3 == 0x02))
+ {
+ Local4 = Package (0x04)
+ {
+ Zero, + Zero, + LNKB, + Zero
+ }
+ }
+
+ If ((Local3 == 0x03))
+ {
+ Local4 = Package (0x04)
+ {
+ Zero, + Zero, + LNKC, + Zero + } + } + + Local4 [Zero] = ((Local2 << 0x10) | 0xFFFF) + Local4 [One] = (Local1 & 0x03) + Local0 [Local1] = Local4 + Local1++
+ }
+
+ Return (Local0)
+ }
+
+ Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
+ {
+ WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
+ 0x0000, // Granularity + 0x0020, // Range Minimum + 0x0020, // Range Maximum + 0x0000, // Translation Offset + 0x0001, // Length + ,, )
+ })
+ }
+ }
+
+ Scope (\_SB)
+ {
+ Device (PC10)
+ {
+ Name (_UID, 0x10) // _UID: Unique ID
+ Name (_BBN, 0x10) // _BBN: BIOS Bus Number
+ Name (_HID, EisaId ("PNP0A08") /* PCI Express Bus */) // _HID: Hardware ID
+ Name (_CID, EisaId ("PNP0A03") /* PCI Bus */) // _CID: Compatible ID
+ Method (_OSC, 4, NotSerialized) // _OSC: Operating System Capabilities
+ {
+ CreateDWordField (Arg3, Zero, CDW1)
+ If ((Arg0 == ToUUID ("33db4d5b-1ff7-401c-9657-7441c03dd766") /* PCI Host Bridge Device */))
+ {
+ CreateDWordField (Arg3, 0x04, CDW2)
+ CreateDWordField (Arg3, 0x08, CDW3)
+ Local0 = CDW3 /* \_SB_.PC10._OSC.CDW3 */
+ Local0 &= 0x1F
+ If ((Arg1 != One))
+ {+ CDW1 |= 0x08
+ }
+
+ If ((CDW3 != Local0))
+ {
+ CDW1 |= 0x10
+ }
+
+ CDW3 = Local0
+ }
+ Else
+ {+ CDW1 |= 0x04
+ }
+
+ Return (Arg3)
+ }
+
+ Method (_PRT, 0, NotSerialized) // _PRT: PCI Routing Table
+ {
+ Local0 = Package (0x80){}
+ Local1 = Zero
+ While ((Local1 < 0x80))
+ {
+ Local2 = (Local1 >> 0x02)
+ Local3 = ((Local1 + Local2) & 0x03)
+ If ((Local3 == Zero))
+ {
+ Local4 = Package (0x04)
+ {
+ Zero,
+ Zero,
+ LNKD,
+ Zero+ }
+ }
+
+ If ((Local3 == One))
+ {
+ Local4 = Package (0x04)
+ {
+ Zero, + Zero, + LNKA, + Zero
+ }
+ }
+
+ If ((Local3 == 0x02))
+ {
+ Local4 = Package (0x04)
+ {
+ Zero, + Zero, + LNKB, + Zero
+ }
+ }
+
+ If ((Local3 == 0x03))
+ {
+ Local4 = Package (0x04)
+ {
+ Zero, + Zero, + LNKC, + Zero + } + } + + Local4 [Zero] = ((Local2 << 0x10) | 0xFFFF) + Local4 [One] = (Local1 & 0x03) + Local0 [Local1] = Local4 + Local1++
+ }
+
+ Return (Local0)
+ }
+
+ Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
+ {
+ WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
+ 0x0000, // Granularity + 0x0010, // Range Minimum + 0x0010, // Range Maximum + 0x0000, // Translation Offset + 0x0001, // Length + ,, )
+ })
+ }
+ }
+
Scope (\_SB.PCI0)
{
Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
@@ -3121,9 +3454,9 @@
WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
0x0000, // Granularity
0x0000, // Range Minimum
- 0x00FF, // Range Maximum
+ 0x000F, // Range Maximum
0x0000, // Translation Offset
- 0x0100, // Length
+ 0x0010, // Length
,, )
IO (Decode16,
0x0CF8, // Range Minimum
@@ -3278,6 +3611,26 @@
}
}+ Device (S10)
+ {
+ Name (_ADR, 0x00020000) // _ADR: Address
+ }
+
+ Device (S18)
+ {
+ Name (_ADR, 0x00030000) // _ADR: Address
+ }
+
+ Device (S20)
+ {
+ Name (_ADR, 0x00040000) // _ADR: Address
+ }
+
+ Device (S28)
+ {
+ Name (_ADR, 0x00050000) // _ADR: Address
+ }
+
Method (PCNT, 0, NotSerialized)
{
}--- 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, 2 deletions(-)
tests/qtest/bios-tables-test-allowed-diff.h +0 -2
@@ -1,4 +1,2 @@/* List of comma-separated changed AML files to ignore */ "tests/data/acpi/virt/VIOT", -"tests/data/acpi/q35/DSDT.viot" , -"tests/data/acpi/q35/VIOT.viot",
tests/data/acpi/q35/DSDT.viot binary +0 -0
tests/data/acpi/q35/VIOT.viot binary +0 -0
Signature · 1 line
2.34.1
PATCH v7 8/8 tests/acpi: add expected blob for VIOT test on virt machine
In reply to Jean-Philippe BruckerThe VIOT blob contains the following:
[000h 0000 4] Signature : "VIOT" [Virtual I/O Translation Table] [004h 0004 4] Table Length : 00000058 [008h 0008 1] Revision : 00 [009h 0009 1] Checksum : 66 [00Ah 0010 6] Oem ID : "BOCHS " [010h 0016 8] Oem Table ID : "BXPC " [018h 0024 4] Oem Revision : 00000001 [01Ch 0028 4] Asl Compiler ID : "BXPC" [020h 0032 4] Asl Compiler Revision : 00000001
[024h 0036 2] Node count : 0002 [026h 0038 2] Node offset : 0030 [028h 0040 8] Reserved : 0000000000000000
[030h 0048 1] Type : 03 [VirtIO-PCI IOMMU] [031h 0049 1] Reserved : 00 [032h 0050 2] Length : 0010
[034h 0052 2] PCI Segment : 0000 [036h 0054 2] PCI BDF number : 0008 [038h 0056 8] Reserved : 0000000000000000
[040h 0064 1] Type : 01 [PCI Range] [041h 0065 1] Reserved : 00 [042h 0066 2] Length : 0018
[044h 0068 4] Endpoint start : 00000000 [048h 0072 2] PCI Segment start : 0000 [04Ah 0074 2] PCI Segment end : 0000 [04Ch 0076 2] PCI BDF start : 0000 [04Eh 0078 2] PCI BDF end : 00FF [050h 0080 2] Output node : 0030 [052h 0082 6] Reserved : 000000000000
--- tests/qtest/bios-tables-test-allowed-diff.h | 1 - tests/data/acpi/virt/VIOT | Bin 0 -> 88 bytes 2 files changed, 1 deletion(-)
tests/qtest/bios-tables-test-allowed-diff.h +0 -1
@@ -1,2 +1 @@/* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/virt/VIOT",
tests/data/acpi/virt/VIOT binary +0 -0
Signature · 1 line
2.34.1
Quoted 8 lines · Jean-Philippe Brucker
Add ACPI support for virtio-iommu on the virt machine, by instantiating a VIOT table. Also add the tests for the ACPI table.
Since last posting [1], I rebased onto v6.2.0-rc4. Note that v6 of this series [2] only contained the table and x86 support, which have been merged. Everything has now been reviewed and should be good to go.
Quoted 5 lines
* Patches 1-2 add the VIOT table for the virt machine
* Patches 3-4 are minor fixes
* Patches 5-8 add tests for the VIOT table. They contain the tests for q35 as well, which didn't make it last time because they depended on another fix that has now been merged.
I believe the entire patchset has been reviewed and you are re-sending it so that it gets pulled in after the release?
Quoted 30 lines
[1] https://lore.kernel.org/qemu-devel/[email protected]/
[2] https://lore.kernel.org/qemu-devel/[email protected]/Jean-Philippe Brucker (8):
hw/arm/virt-acpi-build: Add VIOT table for virtio-iommu hw/arm/virt: Remove device tree restriction for virtio-iommu hw/arm/virt: Reject instantiation of multiple IOMMUs hw/arm/virt: Useobject_property_setinstead ofqdev_prop_settests/acpi: allow updates of VIOT expected data files tests/acpi: add test case for VIOT
tests/acpi: add expected blobs for VIOT test on q35 machine tests/acpi: add expected blob for VIOT test on virt machinehw/arm/virt-acpi-build.c | 7 ++++++ hw/arm/virt.c | 20 ++++++++--------- hw/virtio/virtio-iommu-pci.c | 12 ++--------- tests/qtest/bios-tables-test.c | 38 +++++++++++++++++++++++++++++++++ hw/arm/Kconfig | 1 + tests/data/acpi/q35/DSDT.viot | Bin 0 -> 9398 bytes tests/data/acpi/q35/VIOT.viot | Bin 0 -> 112 bytes tests/data/acpi/virt/VIOT | Bin 0 -> 88 bytes 8 files changed, 58 insertions(+), 20 deletions(-) create mode 100644 tests/data/acpi/q35/DSDT.viot create mode 100644 tests/data/acpi/q35/VIOT.viot create mode 100644 tests/data/acpi/virt/VIOT--
2.34.1
Quoted 10 lines · Ani Sinha
Quoted 8 lines · Jean-Philippe Brucker
Add ACPI support for virtio-iommu on the virt machine, by instantiating a VIOT table. Also add the tests for the ACPI table.
Since last posting [1], I rebased onto v6.2.0-rc4. Note that v6 of this series [2] only contained the table and x86 support, which have been merged. Everything has now been reviewed and should be good to go.
Quoted 8 lines
Quoted 5 lines
* Patches 1-2 add the VIOT table for the virt machine
* Patches 3-4 are minor fixes
* Patches 5-8 add tests for the VIOT table. They contain the tests for q35 as well, which didn't make it last time because they depended on another fix that has now been merged.I believe the entire patchset has been reviewed and you are re-sending it so that it gets pulled in after the release?
Yes
Thanks,
Jean
Quoted 18 lines · Jean-Philippe Brucker
Quoted 16 lines · Ani Sinha
Quoted 13 lines · Jean-Philippe Brucker
Add ACPI support for virtio-iommu on the virt machine, by instantiating a VIOT table. Also add the tests for the ACPI table.
Since last posting [1], I rebased onto v6.2.0-rc4. Note that v6 of this series [2] only contained the table and x86 support, which have been merged. Everything has now been reviewed and should be good to go.
* Patches 1-2 add the VIOT table for the virt machine
* Patches 3-4 are minor fixes
* Patches 5-8 add tests for the VIOT table. They contain the tests for q35 as well, which didn't make it last time because they depended on another fix that has now been merged.
Quoted 4 lines
Quoted 2 lines
I believe the entire patchset has been reviewed and you are re-sending it so that it gets pulled in after the release?
Yes
To be clear, do you mean:
(1) The patchset has been reviewed, and I plan to resend it (ie a v8) to be pulled in after 6.2 releases
or
(2) The patchset has been reviewed already as v6, and this (v7) was just a resend to be pulled in after 6.2 releases
?
thanks
-- PMM
Quoted 23 lines · Peter Maydell
Quoted 21 lines · Jean-Philippe Brucker
Quoted 18 lines · Ani Sinha
Quoted 8 lines · Jean-Philippe Brucker
Add ACPI support for virtio-iommu on the virt machine, by instantiating a VIOT table. Also add the tests for the ACPI table.
Since last posting [1], I rebased onto v6.2.0-rc4. Note that v6 of this series [2] only contained the table and x86 support, which have been merged. Everything has now been reviewed and should be good to go.
Quoted 5 lines
* Patches 1-2 add the VIOT table for the virt machine
* Patches 3-4 are minor fixes
* Patches 5-8 add tests for the VIOT table. They contain the tests for q35 as well, which didn't make it last time because they depended on another fix that has now been merged.I believe the entire patchset has been reviewed and you are re-sending it so that it gets pulled in after the release?
Quoted 8 lines
Quoted 1 line
Yes
To be clear, do you mean:
(1) The patchset has been reviewed, and I plan to resend it (ie a v8) to be pulled in after 6.2 releases
or
(2) The patchset has been reviewed already as v6, and this (v7) was just a resend to be pulled in after 6.2 releases
I meant (2), v6 had already been reviewed and I'm resending v7 to be pulled after 6.2 releases, sorry about the confusion. Just for my understanding, should I have resent this after the 6.2 release, or is this OK and I should just state the intention for a patchset more clearly?
Thanks,
Jean
Quoted 34 lines · Jean-Philippe Brucker
Quoted 23 lines · Peter Maydell
Quoted 21 lines · Jean-Philippe Brucker
Quoted 18 lines · Ani Sinha
Quoted 8 lines · Jean-Philippe Brucker
Add ACPI support for virtio-iommu on the virt machine, by instantiating a VIOT table. Also add the tests for the ACPI table.
Since last posting [1], I rebased onto v6.2.0-rc4. Note that v6 of this series [2] only contained the table and x86 support, which have been merged. Everything has now been reviewed and should be good to go.
Quoted 5 lines
* Patches 1-2 add the VIOT table for the virt machine
* Patches 3-4 are minor fixes
* Patches 5-8 add tests for the VIOT table. They contain the tests for q35 as well, which didn't make it last time because they depended on another fix that has now been merged.I believe the entire patchset has been reviewed and you are re-sending it so that it gets pulled in after the release?
Quoted 8 lines
Quoted 1 line
Yes
To be clear, do you mean:
(1) The patchset has been reviewed, and I plan to resend it (ie a v8) to be pulled in after 6.2 releases
or
(2) The patchset has been reviewed already as v6, and this (v7) was just a resend to be pulled in after 6.2 releases
Quoted 4 lines
I meant (2), v6 had already been reviewed and I'm resending v7 to be pulled after 6.2 releases, sorry about the confusion. Just for my understanding, should I have resent this after the 6.2 release, or is this OK and I should just state the intention for a patchset more clearly?
Sending for-7.0 patchsets before 6.2 officially releases is fine; I just wanted to check what you intended. I've queued this patchset to target-arm.next.
thanks
-- PMM
Quoted 36 lines · Peter Maydell
Quoted 34 lines · Jean-Philippe Brucker
Quoted 31 lines · Peter Maydell
Quoted 18 lines · Jean-Philippe Brucker
Quoted 16 lines · Ani Sinha
Quoted 13 lines · Jean-Philippe Brucker
Add ACPI support for virtio-iommu on the virt machine, by instantiating a VIOT table. Also add the tests for the ACPI table.
Since last posting [1], I rebased onto v6.2.0-rc4. Note that v6 of this series [2] only contained the table and x86 support, which have been merged. Everything has now been reviewed and should be good to go.
* Patches 1-2 add the VIOT table for the virt machine
* Patches 3-4 are minor fixes
* Patches 5-8 add tests for the VIOT table. They contain the tests for q35 as well, which didn't make it last time because they depended on another fix that has now been merged.Quoted 4 lines
Quoted 2 lines
I believe the entire patchset has been reviewed and you are re-sending it so that it gets pulled in after the release?
Yes
To be clear, do you mean:
(1) The patchset has been reviewed, and I plan to resend it (ie a v8) to be pulled in after 6.2 releases
or
(2) The patchset has been reviewed already as v6, and this (v7) was just a resend to be pulled in after 6.2 releases
Quoted 7 lines
Quoted 4 lines
I meant (2), v6 had already been reviewed and I'm resending v7 to be pulled after 6.2 releases, sorry about the confusion. Just for my understanding, should I have resent this after the 6.2 release, or is this OK and I should just state the intention for a patchset more clearly?
Sending for-7.0 patchsets before 6.2 officially releases is fine; I just wanted to check what you intended. I've queued this patchset to target-arm.next.
Great, thank you!
Jean
Quoted 2 lines · Jean-Philippe Brucker
Add ACPI support for virtio-iommu on the virt machine, by instantiating a VIOT table. Also add the tests for the ACPI table.
ACPI parts:
Quoted 38 lines
Since last posting [1], I rebased onto v6.2.0-rc4. Note that v6 of this series [2] only contained the table and x86 support, which have been merged. Everything has now been reviewed and should be good to go.
* Patches 1-2 add the VIOT table for the virt machine
* Patches 3-4 are minor fixes
* Patches 5-8 add tests for the VIOT table. They contain the tests for q35 as well, which didn't make it last time because they depended on another fix that has now been merged.[1] https://lore.kernel.org/qemu-devel/[email protected]/
[2] https://lore.kernel.org/qemu-devel/[email protected]/Jean-Philippe Brucker (8):
hw/arm/virt-acpi-build: Add VIOT table for virtio-iommu hw/arm/virt: Remove device tree restriction for virtio-iommu hw/arm/virt: Reject instantiation of multiple IOMMUs hw/arm/virt: Useobject_property_setinstead ofqdev_prop_settests/acpi: allow updates of VIOT expected data files tests/acpi: add test case for VIOT
tests/acpi: add expected blobs for VIOT test on q35 machine tests/acpi: add expected blob for VIOT test on virt machinehw/arm/virt-acpi-build.c | 7 ++++++ hw/arm/virt.c | 20 ++++++++--------- hw/virtio/virtio-iommu-pci.c | 12 ++--------- tests/qtest/bios-tables-test.c | 38 +++++++++++++++++++++++++++++++++ hw/arm/Kconfig | 1 + tests/data/acpi/q35/DSDT.viot | Bin 0 -> 9398 bytes tests/data/acpi/q35/VIOT.viot | Bin 0 -> 112 bytes tests/data/acpi/virt/VIOT | Bin 0 -> 88 bytes 8 files changed, 58 insertions(+), 20 deletions(-) create mode 100644 tests/data/acpi/q35/DSDT.viot create mode 100644 tests/data/acpi/q35/VIOT.viot create mode 100644 tests/data/acpi/virt/VIOTSignature · 1 line
2.34.1