RISC-V: ACPI: Namespace updates
PATCH v2 2/9 hw/riscv/virt-acpi-build.c: Update the HID of RISC-V UART
In reply to Sunil V LThe RISC-V BRS specification [1] requires NS16550 compatible UART to have the HID RSCV0003. So, update the HID for the UART.
[1] - https://github.com/riscv-non-isa/riscv-brs
--- hw/riscv/virt-acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/riscv/virt-acpi-build.c +1 -1
@@ -192,7 +192,7 @@ acpi_dsdt_add_uart(Aml *scope, const MemMapEntry *uart_memmap, uint32_t uart_irq) {Aml *dev =aml_device ("COM0" ); -aml_append (dev,aml_name_decl ("_HID" ,aml_string ("PNP0501" ))); +aml_append (dev,aml_name_decl ("_HID" ,aml_string ("RSCV0003" )));aml_append (dev,aml_name_decl ("_UID" ,aml_int (0 )));Aml *crs =aml_resource_template ();
Signature · 1 line
2.43.0
v2 cover RISC-V: ACPI: Namespace updates
This series adds few updates to RISC-V ACPI namespace for virt platform. Additionally, it has patches to enable ACPI table testing for RISC-V.
1) PCI Link devices need to be created outside the scope of the PCI root complex to ensure correct probe ordering by the OS. This matches the example given in ACPI spec as well.
2) Add PLIC and APLIC as platform devices as well to ensure probing order as per BRS spec [1] requirement.
3) BRS spec requires RISC-V to use new ACPI ID for the generic UART. So, update the HID of the UART.
4) Enabled ACPI tables tests for RISC-V which were originally part of
[2] but couldn't get merged due to updates required in the expected AML files. I think combining those patches with this series makes it easier to merge since expected AML files are updated.
[1] - https://github.com/riscv-non-isa/riscv-brs
[2] - https://lists.gnu.org/archive/html/qemu-devel/2024-06/msg04734.html
Changes since v1:
1) Made changes in gpex-acpi.c generic as per feedback from Michael. This changes the DSDT for aarch64/virt and microvm machines. Hence, few patches are added to update the expected DSDT files for those machine so that CI tests don't fail.
2) Added patches to enable ACPI tables tests for RISC-V including a patch to remove the fallback path to search for expected AML files.
3) Rebased and added tags.
Sunil V L (9):
hw/riscv/virt-acpi-build.c: Add namespace devices for PLIC and APLIC hw/riscv/virt-acpi-build.c: Update the HID of RISC-V UART tests/acpi: Allow DSDT acpi table changes for aarch64 acpi/gpex: Create PCI link devices outside PCI root bridge tests/acpi: update expected DSDT blob for aarch64 and microvm tests/qtest/bios-tables-test.c: Remove the fall back path tests/acpi: Add empty ACPI data files for RISC-V tests/qtest/bios-tables-test.c: Enable basic testing for RISC-V tests/acpi: Add expected ACPI AML files for RISC-V
hw/pci-host/gpex-acpi.c | 13 ++--- hw/riscv/virt-acpi-build.c | 49 +++++++++++++++++- tests/data/acpi/aarch64/virt/DSDT | Bin 5196 -> 5196 bytes .../data/acpi/aarch64/virt/DSDT.acpihmatvirt | Bin 5282 -> 5282 bytes tests/data/acpi/aarch64/virt/DSDT.memhp | Bin 6557 -> 6557 bytes tests/data/acpi/aarch64/virt/DSDT.pxb | Bin 7679 -> 7679 bytes tests/data/acpi/aarch64/virt/DSDT.topology | Bin 5398 -> 5398 bytes tests/data/acpi/riscv64/virt/APIC | Bin 0 -> 116 bytes tests/data/acpi/riscv64/virt/DSDT | Bin 0 -> 3576 bytes tests/data/acpi/riscv64/virt/FACP | Bin 0 -> 276 bytes tests/data/acpi/riscv64/virt/MCFG | Bin 0 -> 60 bytes tests/data/acpi/riscv64/virt/RHCT | Bin 0 -> 332 bytes tests/data/acpi/riscv64/virt/SPCR | Bin 0 -> 80 bytes tests/data/acpi/x86/microvm/DSDT.pcie | Bin 3023 -> 3023 bytes tests/qtest/bios-tables-test.c | 40 +++++++++----- 15 files changed, 81 insertions(+), 21 deletions(-) create mode 100644 tests/data/acpi/riscv64/virt/APIC create mode 100644 tests/data/acpi/riscv64/virt/DSDT create mode 100644 tests/data/acpi/riscv64/virt/FACP create mode 100644 tests/data/acpi/riscv64/virt/MCFG create mode 100644 tests/data/acpi/riscv64/virt/RHCT create mode 100644 tests/data/acpi/riscv64/virt/SPCR
Signature · 1 line
2.43.0
PATCH v2 1/9 hw/riscv/virt-acpi-build.c: Add namespace devices for PLIC and APLIC
PLIC and APLIC should be in namespace as well. So, add them using the defined HID.
--- hw/riscv/virt-acpi-build.c | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+)
hw/riscv/virt-acpi-build.c +47 -0
@@ -141,6 +141,52 @@ static void acpi_dsdt_add_cpus(Aml *scope, RISCVVirtState *s) } } +static void acpi_dsdt_add_plic_aplic (Aml *scope,RISCVVirtState *s) +{ +MachineState *ms =MACHINE (s); +uint64_t plic_aplic_addr; +uint32_t gsi_base; +uint8_t socket; + +if (s->aia_type ==VIRT_AIA_TYPE_NONE ) { +/* PLICs */ +for (socket =0 ; socket <riscv_socket_count (ms); socket++) { + plic_aplic_addr = s->memmap[VIRT_PLIC ].base + + s->memmap[VIRT_PLIC ].size * socket; + gsi_base =VIRT_IRQCHIP_NUM_SOURCES * socket; +Aml *dev =aml_device ("IC%.02X" , socket); +aml_append (dev,aml_name_decl ("_HID" ,aml_string ("RSCV0001" ))); +aml_append (dev,aml_name_decl ("_UID" ,aml_int (socket))); +aml_append (dev,aml_name_decl ("_GSB" ,aml_int (gsi_base))); + +Aml *crs =aml_resource_template (); +aml_append (crs,aml_memory32_fixed (plic_aplic_addr, + s->memmap[VIRT_PLIC ].size, +AML_READ_WRITE )); +aml_append (dev,aml_name_decl ("_CRS" , crs)); +aml_append (scope, dev); + } + }else { +/* APLICs */ +for (socket =0 ; socket <riscv_socket_count (ms); socket++) { + plic_aplic_addr = s->memmap[VIRT_APLIC_S ].base + + s->memmap[VIRT_APLIC_S ].size * socket; + gsi_base =VIRT_IRQCHIP_NUM_SOURCES * socket; +Aml *dev =aml_device ("IC%.02X" , socket); +aml_append (dev,aml_name_decl ("_HID" ,aml_string ("RSCV0002" ))); +aml_append (dev,aml_name_decl ("_UID" ,aml_int (socket))); +aml_append (dev,aml_name_decl ("_GSB" ,aml_int (gsi_base))); + +Aml *crs =aml_resource_template (); +aml_append (crs,aml_memory32_fixed (plic_aplic_addr, + s->memmap[VIRT_APLIC_S ].size, +AML_READ_WRITE )); +aml_append (dev,aml_name_decl ("_CRS" , crs)); +aml_append (scope, dev); + } + } +} +static void acpi_dsdt_add_uart (Aml *scope,const MemMapEntry *uart_memmap,uint32_t uart_irq)
@@ -411,6 +457,7 @@ static void build_dsdt(GArray *table_data, socket_count =riscv_socket_count (ms); +acpi_dsdt_add_plic_aplic (scope, s);acpi_dsdt_add_uart (scope, &memmap[VIRT_UART0 ],UART0_IRQ );if (socket_count ==1 ) {
Signature · 1 line
2.43.0
PATCH v2 9/9 tests/acpi: Add expected ACPI AML files for RISC-V
In reply to Sunil V LAs per the step 5 in the process documented in bios-tables-test.c, generate the expected ACPI AML data files for RISC-V using the rebuild-expected-aml.sh script and update the bios-tables-test-allowed-diff.h.
These are all new files being added for the first time. Hence, iASL diff output is not added.
--- tests/data/acpi/riscv64/virt/APIC | Bin 0 -> 116 bytes tests/data/acpi/riscv64/virt/DSDT | Bin 0 -> 3576 bytes tests/data/acpi/riscv64/virt/FACP | Bin 0 -> 276 bytes tests/data/acpi/riscv64/virt/MCFG | Bin 0 -> 60 bytes tests/data/acpi/riscv64/virt/RHCT | Bin 0 -> 332 bytes tests/data/acpi/riscv64/virt/SPCR | Bin 0 -> 80 bytes tests/qtest/bios-tables-test-allowed-diff.h | 6 ------ 7 files changed, 6 deletions(-)
tests/data/acpi/riscv64/virt/APIC binary +0 -0
tests/data/acpi/riscv64/virt/DSDT binary +0 -0
tests/data/acpi/riscv64/virt/FACP binary +0 -0
tests/data/acpi/riscv64/virt/MCFG binary +0 -0
tests/data/acpi/riscv64/virt/RHCT binary +0 -0
tests/data/acpi/riscv64/virt/SPCR binary +0 -0
tests/qtest/bios-tables-test-allowed-diff.h +0 -6
@@ -1,7 +1 @@/* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/riscv64/virt/APIC" , -"tests/data/acpi/riscv64/virt/DSDT" , -"tests/data/acpi/riscv64/virt/FACP" , -"tests/data/acpi/riscv64/virt/MCFG" , -"tests/data/acpi/riscv64/virt/RHCT" , -"tests/data/acpi/riscv64/virt/SPCR",
Signature · 1 line
2.43.0
PATCH v2 6/9 tests/qtest/bios-tables-test.c: Remove the fall back path
In reply to Sunil V LThe expected ACPI AML files are moved now under ${arch}/{machine} path. Hence, there is no need to search in old path which didn't have ${arch}. Remove the code which searches for the expected AML files under old path as well.
--- tests/qtest/bios-tables-test.c | 14 -------------- 1 file changed, 14 deletions(-)
tests/qtest/bios-tables-test.c +0 -14
@@ -267,15 +267,6 @@ static void dump_aml_files(test_data *data, bool rebuild) data->arch, data->machine, sdt->aml, ext); -/* -* To keep test cases not failing before the DATA files are moved to -* ${arch}/${machine} folder, add this check as well. -*/ -if (!g_file_test (aml_file,G_FILE_TEST_EXISTS )) { - aml_file =g_strdup_printf ("%s/%s/%.4s%s" , data_dir, - data->machine, sdt->aml, ext); - } -if (!g_file_test (aml_file,G_FILE_TEST_EXISTS ) && sdt->aml_len == exp_sdt->aml_len && !memcmp (sdt->aml, exp_sdt->aml, sdt->aml_len)) {
@@ -412,11 +403,6 @@ static GArray *load_expected_aml(test_data *data) try_again: aml_file =g_strdup_printf ("%s/%s/%s/%.4s%s" , data_dir, data->arch, data->machine, sdt->aml, ext); -if (!g_file_test (aml_file,G_FILE_TEST_EXISTS )) { - aml_file =g_strdup_printf ("%s/%s/%.4s%s" , data_dir, data->machine, - sdt->aml, ext); - } -if (verbosity_level >=2 ) {fprintf (stderr,"Looking for expected file '%s'\n" , aml_file); }
Signature · 1 line
2.43.0
PATCH v2 4/9 acpi/gpex: Create PCI link devices outside PCI root bridge
In reply to Sunil V LCurrently, PCI link devices (PNP0C0F) are always created within the scope of the PCI root bridge. However, RISC-V needs these link devices to be created outside to ensure the probing order in the OS. This matches the example given in the ACPI specification [1] as well. Hence, create these link devices directly under _SB instead of under the PCI root bridge.
To keep these link device names unique for multiple PCI bridges, change the device name from GSIx to LXXY format where XX is the PCI bus number and Y is the INTx.
GPEX is currently used by riscv, aarch64/virt and x86/microvm machines. So, this change will alter the DSDT for those systems.
[1] - ACPI 5.1: 6.2.13.1 Example: Using _PRT to Describe PCI IRQ Routing
--- hw/pci-host/gpex-acpi.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
hw/pci-host/gpex-acpi.c +7 -6
@@ -7,7 +7,8 @@#include "hw/pci/pcie_host.h" #include "hw/acpi/cxl.h" -static void acpi_dsdt_add_pci_route_table (Aml *dev,uint32_t irq) +static void acpi_dsdt_add_pci_route_table (Aml *dev,uint32_t irq, +Aml *scope,uint8_t bus_num) {Aml *method, *crs;int i, slot_no;
@@ -20,7 +21,7 @@ static void acpi_dsdt_add_pci_route_table(Aml *dev, uint32_t irq)Aml *pkg =aml_package (4 );aml_append (pkg,aml_int ((slot_no <<16 ) |0xFFFF ));aml_append (pkg,aml_int (i)); -aml_append (pkg,aml_name ("GSI%d" , gsi)); +aml_append (pkg,aml_name ("L%.02X%d" , bus_num, gsi));aml_append (pkg,aml_int (0 ));aml_append (rt_pkg, pkg); }
@@ -30,7 +31,7 @@ static void acpi_dsdt_add_pci_route_table(Aml *dev, uint32_t irq)/* Create GSI link device */ for (i =0 ; i <PCI_NUM_PINS ; i++) {uint32_t irqs = irq + i; -Aml *dev_gsi =aml_device ("GSI%d" , i); +Aml *dev_gsi =aml_device ("L%.02X%d" , bus_num, i);aml_append (dev_gsi,aml_name_decl ("_HID" ,aml_string ("PNP0C0F" )));aml_append (dev_gsi,aml_name_decl ("_UID" ,aml_int (i))); crs =aml_resource_template ();
@@ -45,7 +46,7 @@ static void acpi_dsdt_add_pci_route_table(Aml *dev, uint32_t irq)aml_append (dev_gsi,aml_name_decl ("_CRS" , crs)); method =aml_method ("_SRS" ,1 ,AML_NOTSERIALIZED );aml_append (dev_gsi, method); -aml_append (dev, dev_gsi); +aml_append (scope, dev_gsi); } }
@@ -174,7 +175,7 @@ void acpi_dsdt_add_gpex(Aml *scope, struct GPEXConfig *cfg)aml_append (dev,aml_name_decl ("_PXM" ,aml_int (numa_node))); } -acpi_dsdt_add_pci_route_table (dev, cfg->irq); +acpi_dsdt_add_pci_route_table (dev, cfg->irq, scope, bus_num);/* * Resources defined for PXBs are composed of the following parts:
@@ -205,7 +206,7 @@ void acpi_dsdt_add_gpex(Aml *scope, struct GPEXConfig *cfg)aml_append (dev,aml_name_decl ("_STR" ,aml_unicode ("PCIe 0 Device" )));aml_append (dev,aml_name_decl ("_CCA" ,aml_int (1 ))); -acpi_dsdt_add_pci_route_table (dev, cfg->irq); +acpi_dsdt_add_pci_route_table (dev, cfg->irq, scope,0 ); method =aml_method ("_CBA" ,0 ,AML_NOTSERIALIZED );aml_append (method,aml_return (aml_int (cfg->ecam.base)));
Signature · 1 line
2.43.0
PATCH v2 7/9 tests/acpi: Add empty ACPI data files for RISC-V
In reply to Sunil V LAs per process documented (steps 1-3) in bios-tables-test.c, add empty AML data files for RISC-V ACPI tables and add the entries in bios-tables-test-allowed-diff.h.
--- tests/data/acpi/riscv64/virt/APIC | 0 tests/data/acpi/riscv64/virt/DSDT | 0 tests/data/acpi/riscv64/virt/FACP | 0 tests/data/acpi/riscv64/virt/MCFG | 0 tests/data/acpi/riscv64/virt/RHCT | 0 tests/data/acpi/riscv64/virt/SPCR | 0 tests/qtest/bios-tables-test-allowed-diff.h | 6 ++++++ 7 files changed, 6 insertions(+) create mode 100644 tests/data/acpi/riscv64/virt/APIC create mode 100644 tests/data/acpi/riscv64/virt/DSDT create mode 100644 tests/data/acpi/riscv64/virt/FACP create mode 100644 tests/data/acpi/riscv64/virt/MCFG create mode 100644 tests/data/acpi/riscv64/virt/RHCT create mode 100644 tests/data/acpi/riscv64/virt/SPCR
tests/data/acpi/riscv64/virt/APIC new file +0 -0
tests/data/acpi/riscv64/virt/DSDT new file +0 -0
tests/data/acpi/riscv64/virt/FACP new file +0 -0
tests/data/acpi/riscv64/virt/MCFG new file +0 -0
tests/data/acpi/riscv64/virt/RHCT new file +0 -0
tests/data/acpi/riscv64/virt/SPCR new file +0 -0
tests/qtest/bios-tables-test-allowed-diff.h +6 -0
@@ -1 +1,7 @@/* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/riscv64/virt/APIC" , +"tests/data/acpi/riscv64/virt/DSDT" , +"tests/data/acpi/riscv64/virt/FACP" , +"tests/data/acpi/riscv64/virt/MCFG" , +"tests/data/acpi/riscv64/virt/RHCT" , +"tests/data/acpi/riscv64/virt/SPCR",
Signature · 1 line
2.43.0
PATCH v2 8/9 tests/qtest/bios-tables-test.c: Enable basic testing for RISC-V
In reply to Sunil V LAdd basic ACPI table test case for RISC-V.
--- tests/qtest/bios-tables-test.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
tests/qtest/bios-tables-test.c +26 -0
@@ -1963,6 +1963,28 @@ static void test_acpi_microvm_acpi_erst(void) }#endif /* CONFIG_POSIX */ +static void test_acpi_riscv64_virt_tcg (void ) +{ +test_data data = { + .machine ="virt" , + .arch ="riscv64" , + .tcg_only = true, + .uefi_fl1 ="pc-bios/edk2-riscv-code.fd" , + .uefi_fl2 ="pc-bios/edk2-riscv-vars.fd" , + .cd ="tests/data/uefi-boot-images/bios-tables-test.riscv64.iso.qcow2" , + .ram_start =0x80000000ULL , + .scan_len =128ULL *1024 *1024 , + }; + +/* +* RHCT will have ISA string encoded. To reduce the effort +* of updating expected AML file for any new default ISA extension, +* use the profile rva22s64. +*/ +test_acpi_one ("-cpu rva22s64 " , &data); +free_test_data (&data); +} +static void test_acpi_aarch64_virt_tcg (void ) {test_data data = {
@@ -2441,6 +2463,10 @@ int main(int argc, char *argv[])qtest_add_func ("acpi/virt/viot" , test_acpi_aarch64_virt_viot); } } + }else if (strcmp (arch,"riscv64" ) ==0 ) { +if (has_tcg &&qtest_has_device ("virtio-blk-pci" )) { +qtest_add_func ("acpi/virt" , test_acpi_riscv64_virt_tcg); + } } ret =g_test_run ();boot_sector_cleanup (disk);
Signature · 1 line
2.43.0
PATCH v2 5/9 tests/acpi: update expected DSDT blob for aarch64 and microvm
In reply to Sunil V LAfter PCI link devices are moved out of the scope of PCI root complex, the DSDT files of machines which use GPEX, will change. So, update the expected AML files with these changes for these machines.
Mainly, there are 2 changes.
1) Since the link devices are created now directly under _SB for all PCI root bridges in the system, they should have unique names. So, instead of GSIx, named those devices as LXXY where L means link, XX will have PCI bus number and Y will have the INTx number (ex: L000 or L001). The _PRT entries will also be updated to reflect this name change.
2) PCI link devices are moved from the scope of each PCI root bridge to directly under _SB.
Below is the sample iASL difference for one such link device.
Scope (\_SB)
{
Name (_HID, "LNRO0005") // _HID: Hardware ID
Name (_UID, 0x1F) // _UID: Unique ID
Name (_CCA, One) // _CCA: Cache Coherency Attribute
Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
{
Memory32Fixed (ReadWrite,
0x0A003E00, // Address Base
0x00000200, // Address Length
)
Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, )
{
0x0000004F,
}
})+ Device (L000)
+ {
+ Name (_HID, "PNP0C0F" /* PCI Interrupt Link Device */)
+ Name (_UID, Zero) // _UID: Unique ID
+ Name (_PRS, ResourceTemplate ()
+ {+ Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, )
+ {
+ 0x00000023,
+ }
+ })
+ Name (_CRS, ResourceTemplate ()
+ {+ Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, )
+ {
+ 0x00000023,
+ }
+ })
+ Method (_SRS, 1, NotSerialized) // _SRS: Set Resource Settings
+ {
+ }
+ }
+
Device (PCI0)
{
Name (_HID, "PNP0A08" /* PCI Express Bus */) // _HID: Hardware ID
Name (_CID, "PNP0A03" /* PCI Bus */) // _CID: Compatible ID
Name (_SEG, Zero) // _SEG: PCI Segment
Name (_BBN, Zero) // _BBN: BIOS Bus Number
Name (_UID, Zero) // _UID: Unique ID
Name (_STR, Unicode ("PCIe 0 Device")) // _STR: Description String
Name (_CCA, One) // _CCA: Cache Coherency Attribute
Name (_PRT, Package (0x80) // _PRT: PCI Routing Table
{
Package (0x04)
{
0xFFFF,
Zero,
- GSI0,
+ L000,
Zero
},
.....
})
Device (GSI0)
{
Name (_HID, "PNP0C0F" /* PCI Interrupt Link Device */)
Name (_UID, Zero) // _UID: Unique ID
Name (_PRS, ResourceTemplate ()
{
Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, )
{
0x00000023,
}
})
Name (_CRS, ResourceTemplate ()
{
Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, )
{
0x00000023,
}
})
Method (_SRS, 1, NotSerialized) // _SRS: Set Resource Settings
{
}
}
}
}--- tests/data/acpi/aarch64/virt/DSDT | Bin 5196 -> 5196 bytes .../data/acpi/aarch64/virt/DSDT.acpihmatvirt | Bin 5282 -> 5282 bytes tests/data/acpi/aarch64/virt/DSDT.memhp | Bin 6557 -> 6557 bytes tests/data/acpi/aarch64/virt/DSDT.pxb | Bin 7679 -> 7679 bytes tests/data/acpi/aarch64/virt/DSDT.topology | Bin 5398 -> 5398 bytes tests/data/acpi/x86/microvm/DSDT.pcie | Bin 3023 -> 3023 bytes tests/qtest/bios-tables-test-allowed-diff.h | 6 ------ 7 files changed, 6 deletions(-)
tests/data/acpi/aarch64/virt/DSDT binary +0 -0
tests/data/acpi/aarch64/virt/DSDT.acpihmatvirt binary +0 -0
tests/data/acpi/aarch64/virt/DSDT.memhp binary +0 -0
tests/data/acpi/aarch64/virt/DSDT.pxb binary +0 -0
tests/data/acpi/aarch64/virt/DSDT.topology binary +0 -0
tests/data/acpi/x86/microvm/DSDT.pcie binary +0 -0
tests/qtest/bios-tables-test-allowed-diff.h +0 -6
@@ -1,7 +1 @@/* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/aarch64/virt/DSDT" , -"tests/data/acpi/aarch64/virt/DSDT.memhp" , -"tests/data/acpi/aarch64/virt/DSDT.topology" , -"tests/data/acpi/aarch64/virt/DSDT.acpihmatvirt" , -"tests/data/acpi/aarch64/virt/DSDT.pxb" , -"tests/data/acpi/x86/microvm/DSDT.pcie",
Signature · 1 line
2.43.0
PATCH v2 3/9 tests/acpi: Allow DSDT acpi table changes for aarch64
In reply to Sunil V Lso that CI tests don't fail when those ACPI tables are updated in the next patch. This is as per the documentation in bios-tables-tests.c.
--- tests/qtest/bios-tables-test-allowed-diff.h | 6 ++++++ 1 file changed, 6 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +6 -0
@@ -1 +1,7 @@/* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/aarch64/virt/DSDT" , +"tests/data/acpi/aarch64/virt/DSDT.memhp" , +"tests/data/acpi/aarch64/virt/DSDT.topology" , +"tests/data/acpi/aarch64/virt/DSDT.acpihmatvirt" , +"tests/data/acpi/aarch64/virt/DSDT.pxb" , +"tests/data/acpi/x86/microvm/DSDT.pcie",
Signature · 1 line
2.43.0
Re: [PATCH v2 6/9] tests/qtest/bios-tables-test.c: Remove the fall back path
In reply to Sunil V LQuoted 8 lines · Sunil V L
The expected ACPI AML files are moved now under ${arch}/{machine} path. Hence, there is no need to search in old path which didn't have ${arch}. Remove the code which searches for the expected AML files under old path as well.
Suggested-by Igor Mammedov <[email protected]>Signed-off-by Sunil V L <[email protected]>
Alistair
Quoted 40 lines
--- tests/qtest/bios-tables-test.c | 14 -------------- 1 file changed, 14 deletions(-)tests/qtest/bios-tables-test.c +0
-15@@ -267,15 +267,6 @@ static void dump_aml_files(test_data *data, bool rebuild) data->arch, data->machine, sdt->aml, ext); -/* -* To keep test cases not failing before the DATA files are moved to -* ${arch}/${machine} folder, add this check as well. -*/ -if (!g_file_test (aml_file,G_FILE_TEST_EXISTS )) { - aml_file =g_strdup_printf ("%s/%s/%.4s%s" , data_dir, - data->machine, sdt->aml, ext); - } -if (!g_file_test (aml_file,G_FILE_TEST_EXISTS ) && sdt->aml_len == exp_sdt->aml_len && !memcmp (sdt->aml, exp_sdt->aml, sdt->aml_len)) {@@ -412,11 +403,6 @@ static GArray *load_expected_aml(test_data *data) try_again: aml_file =g_strdup_printf ("%s/%s/%s/%.4s%s" , data_dir, data->arch, data->machine, sdt->aml, ext); -if (!g_file_test (aml_file,G_FILE_TEST_EXISTS )) { - aml_file =g_strdup_printf ("%s/%s/%.4s%s" , data_dir, data->machine, - sdt->aml, ext); - } -if (verbosity_level >=2 ) {fprintf (stderr,"Looking for expected file '%s'\n" , aml_file); } --2.43.0
Re: [PATCH v2 1/9] hw/riscv/virt-acpi-build.c: Add namespace devices for PLIC and APLIC
In reply to Sunil V LQuoted 2 lines · On Mon, 8 Jul 2024 17:17:33 +0530 Sunil V L <[email protected]> wrote:
PLIC and APLIC should be in namespace as well. So, add them using the defined HID.
defined where? REader shouldn't be forced to go over all web to find source. Cite it here.
Quoted 72 lines
Signed-off-by Sunil V L <[email protected]>Acked-by Alistair Francis <[email protected]>--- hw/riscv/virt-acpi-build.c | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+)hw/riscv/virt-acpi-build.c +47
-0@@ -141,6 +141,52 @@ static void acpi_dsdt_add_cpus(Aml *scope, RISCVVirtState *s) } } +static void acpi_dsdt_add_plic_aplic (Aml *scope,RISCVVirtState *s) +{ +MachineState *ms =MACHINE (s); +uint64_t plic_aplic_addr; +uint32_t gsi_base; +uint8_t socket; + +if (s->aia_type ==VIRT_AIA_TYPE_NONE ) { +/* PLICs */ +for (socket =0 ; socket <riscv_socket_count (ms); socket++) { + plic_aplic_addr = s->memmap[VIRT_PLIC ].base + + s->memmap[VIRT_PLIC ].size * socket; + gsi_base =VIRT_IRQCHIP_NUM_SOURCES * socket; +Aml *dev =aml_device ("IC%.02X" , socket); +aml_append (dev,aml_name_decl ("_HID" ,aml_string ("RSCV0001" ))); +aml_append (dev,aml_name_decl ("_UID" ,aml_int (socket))); +aml_append (dev,aml_name_decl ("_GSB" ,aml_int (gsi_base))); + +Aml *crs =aml_resource_template (); +aml_append (crs,aml_memory32_fixed (plic_aplic_addr, + s->memmap[VIRT_PLIC ].size, +AML_READ_WRITE )); +aml_append (dev,aml_name_decl ("_CRS" , crs)); +aml_append (scope, dev); + } + }else { +/* APLICs */ +for (socket =0 ; socket <riscv_socket_count (ms); socket++) { + plic_aplic_addr = s->memmap[VIRT_APLIC_S ].base + + s->memmap[VIRT_APLIC_S ].size * socket; + gsi_base =VIRT_IRQCHIP_NUM_SOURCES * socket; +Aml *dev =aml_device ("IC%.02X" , socket); +aml_append (dev,aml_name_decl ("_HID" ,aml_string ("RSCV0002" ))); +aml_append (dev,aml_name_decl ("_UID" ,aml_int (socket))); +aml_append (dev,aml_name_decl ("_GSB" ,aml_int (gsi_base))); + +Aml *crs =aml_resource_template (); +aml_append (crs,aml_memory32_fixed (plic_aplic_addr, + s->memmap[VIRT_APLIC_S ].size, +AML_READ_WRITE )); +aml_append (dev,aml_name_decl ("_CRS" , crs)); +aml_append (scope, dev); + } + } +} +static void acpi_dsdt_add_uart (Aml *scope,const MemMapEntry *uart_memmap,uint32_t uart_irq)@@ -411,6 +457,7 @@ static void build_dsdt(GArray *table_data, socket_count =riscv_socket_count (ms); +acpi_dsdt_add_plic_aplic (scope, s);acpi_dsdt_add_uart (scope, &memmap[VIRT_UART0 ],UART0_IRQ );if (socket_count ==1 ) {
Re: [PATCH v2 1/9] hw/riscv/virt-acpi-build.c: Add namespace devices for PLIC and APLIC
In reply to Sunil V LQuoted 17 lines · On Mon, 8 Jul 2024 17:17:33 +0530 Sunil V L <[email protected]> wrote:
PLIC and APLIC should be in namespace as well. So, add them using the defined HID.
Signed-off-by Sunil V L <[email protected]>Acked-by Alistair Francis <[email protected]>--- hw/riscv/virt-acpi-build.c | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+)hw/riscv/virt-acpi-build.c +0
-0@@ -141,6 +141,52 @@ static void acpi_dsdt_add_cpus(Aml *scope, RISCVVirtState *s) } }
hw/riscv/virt-acpi-build.c static void acpi_dsdt_add_cpus(Aml *scope, RISCVVirtState *s) · line 153
Quoted 10 lines
hw/riscv/virt-acpi-build.c +10
-0+static void acpi_dsdt_add_plic_aplic (Aml *scope,RISCVVirtState *s) +{ +MachineState *ms =MACHINE (s); +uint64_t plic_aplic_addr; +uint32_t gsi_base; +uint8_t socket; + +if (s->aia_type ==VIRT_AIA_TYPE_NONE ) { +/* PLICs */ +for (socket =0 ; socket <riscv_socket_count (ms); socket++) {
you have socket_count in caller already, pass it as argument and drop MachineState *ms = MACHINE(s) above.
Quoted 40 lines
hw/riscv/virt-acpi-build.c +36
-0+ plic_aplic_addr = s->memmap[VIRT_PLIC ].base + + s->memmap[VIRT_PLIC ].size * socket; + gsi_base =VIRT_IRQCHIP_NUM_SOURCES * socket; +Aml *dev =aml_device ("IC%.02X" , socket); +aml_append (dev,aml_name_decl ("_HID" ,aml_string ("RSCV0001" ))); +aml_append (dev,aml_name_decl ("_UID" ,aml_int (socket))); +aml_append (dev,aml_name_decl ("_GSB" ,aml_int (gsi_base))); + +Aml *crs =aml_resource_template (); +aml_append (crs,aml_memory32_fixed (plic_aplic_addr, + s->memmap[VIRT_PLIC ].size, +AML_READ_WRITE )); +aml_append (dev,aml_name_decl ("_CRS" , crs)); +aml_append (scope, dev); + } + }else { +/* APLICs */ +for (socket =0 ; socket <riscv_socket_count (ms); socket++) { + plic_aplic_addr = s->memmap[VIRT_APLIC_S ].base + + s->memmap[VIRT_APLIC_S ].size * socket; + gsi_base =VIRT_IRQCHIP_NUM_SOURCES * socket; +Aml *dev =aml_device ("IC%.02X" , socket); +aml_append (dev,aml_name_decl ("_HID" ,aml_string ("RSCV0002" ))); +aml_append (dev,aml_name_decl ("_UID" ,aml_int (socket))); +aml_append (dev,aml_name_decl ("_GSB" ,aml_int (gsi_base))); + +Aml *crs =aml_resource_template (); +aml_append (crs,aml_memory32_fixed (plic_aplic_addr, + s->memmap[VIRT_APLIC_S ].size, +AML_READ_WRITE )); +aml_append (dev,aml_name_decl ("_CRS" , crs)); +aml_append (scope, dev); + } + } +} +static void acpi_dsdt_add_uart (Aml *scope,const MemMapEntry *uart_memmap,uint32_t uart_irq)
hw/riscv/virt-acpi-build.c static void build_dsdt(GArray *table_data, · line 460
Quoted 4 lines
hw/riscv/virt-acpi-build.c +1
-0@@ -411,6 +457,7 @@ static void build_dsdt(GArray *table_data, socket_count =riscv_socket_count (ms); +acpi_dsdt_add_plic_aplic (scope, s);
Perhaps do the same for memmap/RISCVVirtState vvvv
Quoted 5 lines
hw/riscv/virt-acpi-build.c +0
-0acpi_dsdt_add_uart (scope, &memmap[VIRT_UART0 ],UART0_IRQ );if (socket_count == 1) {
Re: [PATCH v2 2/9] hw/riscv/virt-acpi-build.c: Update the HID of RISC-V UART
In reply to Sunil V LQuoted 4 lines · On Mon, 8 Jul 2024 17:17:34 +0530 Sunil V L <[email protected]> wrote:
The RISC-V BRS specification [1] requires NS16550 compatible UART to have the HID RSCV0003. So, update the HID for the UART.
it point's repo with a bunch of files,
please make it easier for reader to find
aka point to concrete document + title (for when link goes stale) and chapter. (similar to what we do for when documenting ACPI code)
Quoted 20 lines
Signed-off-by Sunil V L <[email protected]>Acked-by Alistair Francis <[email protected]>--- hw/riscv/virt-acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/riscv/virt-acpi-build.c +1
-1@@ -192,7 +192,7 @@ acpi_dsdt_add_uart(Aml *scope, const MemMapEntry *uart_memmap, uint32_t uart_irq) {Aml *dev =aml_device ("COM0" ); -aml_append (dev,aml_name_decl ("_HID" ,aml_string ("PNP0501" ))); +aml_append (dev,aml_name_decl ("_HID" ,aml_string ("RSCV0003" )));aml_append (dev,aml_name_decl ("_UID" ,aml_int (0 )));Aml *crs =aml_resource_template ();
Re: [PATCH v2 4/9] acpi/gpex: Create PCI link devices outside PCI root bridge
In reply to Sunil V LQuoted 36 lines · On Mon, 8 Jul 2024 17:17:36 +0530 Sunil V L <[email protected]> wrote:
Currently, PCI link devices (PNP0C0F) are always created within the scope of the PCI root bridge. However, RISC-V needs these link devices to be created outside to ensure the probing order in the OS. This matches the example given in the ACPI specification [1] as well. Hence, create these link devices directly under
_SBinstead of under the PCI root bridge.To keep these link device names unique for multiple PCI bridges, change the device name from GSIx to LXXY format where XX is the PCI bus number and Y is the INTx.
GPEX is currently used by riscv, aarch64/virt and x86/microvm machines. So, this change will alter the DSDT for those systems.
[1] - ACPI 5.1: 6.2.13.1 Example: Using
_PRTto Describe PCI IRQ RoutingSigned-off-by Sunil V L <[email protected]>--- hw/pci-host/gpex-acpi.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)hw/pci-host/gpex-acpi.c +2
-1@@ -7,7 +7,8 @@#include "hw/pci/pcie_host.h" #include "hw/acpi/cxl.h" -static void acpi_dsdt_add_pci_route_table (Aml *dev,uint32_t irq) +static void acpi_dsdt_add_pci_route_table (Aml *dev,uint32_t irq, +Aml *scope,uint8_t bus_num) {Aml *method, *crs;int i, slot_no;
hw/pci-host/gpex-acpi.c static void acpi_dsdt_add_pci_route_table(Aml *dev, uint32_t irq) · line 24
Quoted 5 lines
hw/pci-host/gpex-acpi.c +1
-1@@ -20,7 +21,7 @@ static void acpi_dsdt_add_pci_route_table(Aml *dev, uint32_t irq)Aml *pkg =aml_package (4 );aml_append (pkg,aml_int ((slot_no <<16 ) |0xFFFF ));aml_append (pkg,aml_int (i)); -aml_append (pkg,aml_name ("GSI%d" , gsi)); +aml_append (pkg,aml_name ("L%.02X%d" , bus_num, gsi));
instead of mixing hex and decimal here, make gsi hex as well to be consistent?
hw/pci-host/gpex-acpi.c static void acpi_dsdt_add_pci_route_table(Aml *dev, uint32_t irq) · line 34
Quoted 9 lines
hw/pci-host/gpex-acpi.c +1
-1aml_append (pkg,aml_int (0 ));aml_append (rt_pkg, pkg); }@@ -30,7 +31,7 @@ static void acpi_dsdt_add_pci_route_table(Aml *dev, uint32_t irq)/* Create GSI link device */ for (i =0 ; i <PCI_NUM_PINS ; i++) {uint32_t irqs = irq + i; -Aml *dev_gsi =aml_device ("GSI%d" , i); +Aml *dev_gsi =aml_device ("L%.02X%d" , bus_num, i);
ditto
Quoted 30 lines
hw/pci-host/gpex-acpi.c +3
-3aml_append (dev_gsi,aml_name_decl ("_HID" ,aml_string ("PNP0C0F" )));aml_append (dev_gsi,aml_name_decl ("_UID" ,aml_int (i))); crs =aml_resource_template ();@@ -45,7 +46,7 @@ static void acpi_dsdt_add_pci_route_table(Aml *dev, uint32_t irq)aml_append (dev_gsi,aml_name_decl ("_CRS" , crs)); method =aml_method ("_SRS" ,1 ,AML_NOTSERIALIZED );aml_append (dev_gsi, method); -aml_append (dev, dev_gsi); +aml_append (scope, dev_gsi); } }@@ -174,7 +175,7 @@ void acpi_dsdt_add_gpex(Aml *scope, struct GPEXConfig *cfg)aml_append (dev,aml_name_decl ("_PXM" ,aml_int (numa_node))); } -acpi_dsdt_add_pci_route_table (dev, cfg->irq); +acpi_dsdt_add_pci_route_table (dev, cfg->irq, scope, bus_num);/* * Resources defined for PXBs are composed of the following parts: @@ -205,7 +206,7 @@ void acpi_dsdt_add_gpex(Aml *scope, struct GPEXConfig *cfg)aml_append (dev,aml_name_decl ("_STR" ,aml_unicode ("PCIe 0 Device" )));aml_append (dev,aml_name_decl ("_CCA" ,aml_int (1 ))); -acpi_dsdt_add_pci_route_table (dev, cfg->irq); +acpi_dsdt_add_pci_route_table (dev, cfg->irq, scope,0 ); method =aml_method ("_CBA" ,0 ,AML_NOTSERIALIZED );aml_append (method,aml_return (aml_int (cfg->ecam.base)));
Re: [PATCH v2 3/9] tests/acpi: Allow DSDT acpi table changes for aarch64
In reply to Sunil V LQuoted 4 lines · On Mon, 8 Jul 2024 17:17:35 +0530 Sunil V L <[email protected]> wrote:
so that CI tests don't fail when those ACPI tables are updated in the next patch. This is as per the documentation in
bios-tables-tests.c.Signed-off-by Sunil V L <[email protected]>
Quoted 16 lines
--- tests/qtest/bios-tables-test-allowed-diff.h | 6 ++++++ 1 file changed, 6 insertions(+)tests/qtest/bios-tables-test-allowed-diff.h +6
-0@@ -1 +1,7 @@/* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/aarch64/virt/DSDT" , +"tests/data/acpi/aarch64/virt/DSDT.memhp" , +"tests/data/acpi/aarch64/virt/DSDT.topology" , +"tests/data/acpi/aarch64/virt/DSDT.acpihmatvirt" , +"tests/data/acpi/aarch64/virt/DSDT.pxb" , +"tests/data/acpi/x86/microvm/DSDT.pcie",
Re: [PATCH v2 6/9] tests/qtest/bios-tables-test.c: Remove the fall back path
In reply to Sunil V LQuoted 7 lines · On Mon, 8 Jul 2024 17:17:38 +0530 Sunil V L <[email protected]> wrote:
The expected ACPI AML files are moved now under ${arch}/{machine} path. Hence, there is no need to search in old path which didn't have ${arch}. Remove the code which searches for the expected AML files under old path as well.
Suggested-by Igor Mammedov <[email protected]>Signed-off-by Sunil V L <[email protected]>
Quoted 36 lines
--- tests/qtest/bios-tables-test.c | 14 -------------- 1 file changed, 14 deletions(-)tests/qtest/bios-tables-test.c +0
-14@@ -267,15 +267,6 @@ static void dump_aml_files(test_data *data, bool rebuild) data->arch, data->machine, sdt->aml, ext); -/* -* To keep test cases not failing before the DATA files are moved to -* ${arch}/${machine} folder, add this check as well. -*/ -if (!g_file_test (aml_file,G_FILE_TEST_EXISTS )) { - aml_file =g_strdup_printf ("%s/%s/%.4s%s" , data_dir, - data->machine, sdt->aml, ext); - } -if (!g_file_test (aml_file,G_FILE_TEST_EXISTS ) && sdt->aml_len == exp_sdt->aml_len && !memcmp (sdt->aml, exp_sdt->aml, sdt->aml_len)) {@@ -412,11 +403,6 @@ static GArray *load_expected_aml(test_data *data) try_again: aml_file =g_strdup_printf ("%s/%s/%s/%.4s%s" , data_dir, data->arch, data->machine, sdt->aml, ext); -if (!g_file_test (aml_file,G_FILE_TEST_EXISTS )) { - aml_file =g_strdup_printf ("%s/%s/%.4s%s" , data_dir, data->machine, - sdt->aml, ext); - } -if (verbosity_level >=2 ) {fprintf (stderr,"Looking for expected file '%s'\n" , aml_file); }
Re: [PATCH v2 2/9] hw/riscv/virt-acpi-build.c: Update the HID of RISC-V UART
In reply to Igor MammedovQuoted 20 lines · Igor Mammedov
Quoted 4 lines · On Mon, 8 Jul 2024 17:17:34 +0530 Sunil V L <[email protected]> wrote:
The RISC-V BRS specification [1] requires NS16550 compatible UART to have the HID RSCV0003. So, update the HID for the UART.
it point's repo with a bunch of files,
please make it easier for reader to find
aka point to concrete document + title (for when link goes stale) and chapter. (similar to what we do for when documenting ACPI code)Quoted 7 lines
Signed-off-by Sunil V L <[email protected]>Acked-by Alistair Francis <[email protected]>--- hw/riscv/virt-acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 11 lines
hw/riscv/virt-acpi-build.c acpi_dsdt_add_uart(Aml *scope, const MemMapEntry *uart_memmap, · line 196
Quoted 11 lines
hw/riscv/virt-acpi-build.c +1
-1@@ -192,7 +192,7 @@ acpi_dsdt_add_uart(Aml *scope, const MemMapEntry *uart_memmap, uint32_t uart_irq) {Aml *dev =aml_device ("COM0" ); -aml_append (dev,aml_name_decl ("_HID" ,aml_string ("PNP0501" ))); +aml_append (dev,aml_name_decl ("_HID" ,aml_string ("RSCV0003" )));aml_append (dev,aml_name_decl ("_UID" ,aml_int (0 )));
In fact, adding the link to the document here would be best. Pls link to the earliest version that lists this id, cite version and chapter in the document.
Thanks!
Quoted 2 lines
Quoted 2 lines
hw/riscv/virt-acpi-build.c +0
-0Aml *crs =aml_resource_template ();
Re: [PATCH v2 2/9] hw/riscv/virt-acpi-build.c: Update the HID of RISC-V UART
Quoted 30 lines · Michael S. Tsirkin
Quoted 29 lines · Igor Mammedov
Quoted 4 lines · On Mon, 8 Jul 2024 17:17:34 +0530 Sunil V L <[email protected]> wrote:
The RISC-V BRS specification [1] requires NS16550 compatible UART to have the HID RSCV0003. So, update the HID for the UART.
it point's repo with a bunch of files,
please make it easier for reader to find
aka point to concrete document + title (for when link goes stale) and chapter. (similar to what we do for when documenting ACPI code)Quoted 16 lines
Signed-off-by Sunil V L <[email protected]>Acked-by Alistair Francis <[email protected]>--- hw/riscv/virt-acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/riscv/virt-acpi-build.c +0
-1@@ -192,7 +192,7 @@ acpi_dsdt_add_uart(Aml *scope, const MemMapEntry *uart_memmap, uint32_t uart_irq) {Aml *dev =aml_device ("COM0" ); -aml_append (dev,aml_name_decl ("_HID" ,aml_string ("PNP0501" )));
Quoted 9 lines
Quoted 2 lines
hw/riscv/virt-acpi-build.c acpi_dsdt_add_uart(Aml *scope, const MemMapEntry *uart_memmap, · line 196
Quoted 2 lines
hw/riscv/virt-acpi-build.c +1
-0+aml_append (dev,aml_name_decl ("_HID" ,aml_string ("RSCV0003" )));aml_append (dev,aml_name_decl ("_UID" ,aml_int (0 )));In fact, adding the link to the document here would be best. Pls link to the earliest version that lists this id, cite version and chapter in the document.
Thanks!
Thanks Michael and Igor!. I will address your comments on the series and send next version.
Thanks,
Sunil
Quoted 13 lines · On Mon, 8 Jul 2024 17:17:32 +0530 Sunil V L <[email protected]> wrote:
This series adds few updates to RISC-V ACPI namespace for virt platform. Additionally, it has patches to enable ACPI table testing for RISC-V.
1) PCI Link devices need to be created outside the scope of the PCI root complex to ensure correct probe ordering by the OS. This matches the example given in ACPI spec as well.
2) Add PLIC and APLIC as platform devices as well to ensure probing order as per BRS spec [1] requirement.
3) BRS spec requires RISC-V to use new ACPI ID for the generic UART. So, update the HID of the UART.
Quoted 7 lines
4) Enabled ACPI tables tests for RISC-V which were originally part of
[2] but couldn't get merged due to updates required in the expected AML files. I think combining those patches with this series makes it easier to merge since expected AML files are updated.[1] - https://github.com/riscv-non-isa/riscv-brs
[2] - https://lists.gnu.org/archive/html/qemu-devel/2024-06/msg04734.html
btw: CI is not happy about series, see:
https://gitlab.com/imammedo/qemu/-/pipelines/1371119552
also 'cross-i686-tci' job routinely timeouts on bios-tables-test but we still keep adding more tests to it.
We should either bump timeout to account for slowness or disable bios-tables-test for that job.
Quoted 44 lines
Changes since v1:
1) Made changes ingpex-acpi.cgeneric as per feedback from Michael. This changes the DSDT for aarch64/virt and microvm machines. Hence, few patches are added to update the expected DSDT files for those machine so that CI tests don't fail.
2) Added patches to enable ACPI tables tests for RISC-V including a patch to remove the fallback path to search for expected AML files.
3) Rebased and added tags.Sunil V L (9):
hw/riscv/virt-acpi-build.c: Add namespace devices for PLIC and APLIChw/riscv/virt-acpi-build.c: Update the HID of RISC-V UART tests/acpi: Allow DSDT acpi table changes for aarch64 acpi/gpex: Create PCI link devices outside PCI root bridge tests/acpi: update expected DSDT blob for aarch64 and microvmtests/qtest/bios-tables-test.c: Remove the fall back path tests/acpi: Add empty ACPI data files for RISC-Vtests/qtest/bios-tables-test.c: Enable basic testing for RISC-V tests/acpi: Add expected ACPI AML files for RISC-Vhw/pci-host/gpex-acpi.c | 13 ++--- hw/riscv/virt-acpi-build.c | 49 +++++++++++++++++- tests/data/acpi/aarch64/virt/DSDT | Bin 5196 -> 5196 bytes .../data/acpi/aarch64/virt/DSDT.acpihmatvirt | Bin 5282 -> 5282 bytes tests/data/acpi/aarch64/virt/DSDT.memhp | Bin 6557 -> 6557 bytes tests/data/acpi/aarch64/virt/DSDT.pxb | Bin 7679 -> 7679 bytes tests/data/acpi/aarch64/virt/DSDT.topology | Bin 5398 -> 5398 bytes tests/data/acpi/riscv64/virt/APIC | Bin 0 -> 116 bytes tests/data/acpi/riscv64/virt/DSDT | Bin 0 -> 3576 bytes tests/data/acpi/riscv64/virt/FACP | Bin 0 -> 276 bytes tests/data/acpi/riscv64/virt/MCFG | Bin 0 -> 60 bytes tests/data/acpi/riscv64/virt/RHCT | Bin 0 -> 332 bytes tests/data/acpi/riscv64/virt/SPCR | Bin 0 -> 80 bytes tests/data/acpi/x86/microvm/DSDT.pcie | Bin 3023 -> 3023 bytes tests/qtest/bios-tables-test.c | 40 +++++++++----- 15 files changed, 81 insertions(+), 21 deletions(-) create mode 100644 tests/data/acpi/riscv64/virt/APIC create mode 100644 tests/data/acpi/riscv64/virt/DSDT create mode 100644 tests/data/acpi/riscv64/virt/FACP create mode 100644 tests/data/acpi/riscv64/virt/MCFG create mode 100644 tests/data/acpi/riscv64/virt/RHCT create mode 100644 tests/data/acpi/riscv64/virt/SPCR
Quoted 24 lines · Igor Mammedov
Quoted 13 lines · On Mon, 8 Jul 2024 17:17:32 +0530 Sunil V L <[email protected]> wrote:
This series adds few updates to RISC-V ACPI namespace for virt platform. Additionally, it has patches to enable ACPI table testing for RISC-V.
1) PCI Link devices need to be created outside the scope of the PCI root complex to ensure correct probe ordering by the OS. This matches the example given in ACPI spec as well.
2) Add PLIC and APLIC as platform devices as well to ensure probing order as per BRS spec [1] requirement.
3) BRS spec requires RISC-V to use new ACPI ID for the generic UART. So, update the HID of the UART.
Quoted 7 lines
4) Enabled ACPI tables tests for RISC-V which were originally part of
[2] but couldn't get merged due to updates required in the expected AML files. I think combining those patches with this series makes it easier to merge since expected AML files are updated.[1] - https://github.com/riscv-non-isa/riscv-brs
[2] - https://lists.gnu.org/archive/html/qemu-devel/2024-06/msg04734.html
Quoted 6 lines
btw: CI is not happy about series, see:
https://gitlab.com/imammedo/qemu/-/pipelines/1371119552
also 'cross-i686-tci' job routinely timeouts on bios-tables-test but we still keep adding more tests to it.
We should either bump timeout to account for slowness or disable bios-tables-test for that job.
Asumming the test is functionally correct, and not hanging, then bumping the timeout is the right answer. You can do this in the meson.build file
We should never disable tests only in CI, because non-CI users are just as likely to hit timeouts.
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Quoted 32 lines · On Fri, 12 Jul 2024 13:51:04 +0100 Daniel P. Berrangé <[email protected]>…
Quoted 24 lines · Igor Mammedov
Quoted 13 lines · On Mon, 8 Jul 2024 17:17:32 +0530 Sunil V L <[email protected]> wrote:
This series adds few updates to RISC-V ACPI namespace for virt platform. Additionally, it has patches to enable ACPI table testing for RISC-V.
1) PCI Link devices need to be created outside the scope of the PCI root complex to ensure correct probe ordering by the OS. This matches the example given in ACPI spec as well.
2) Add PLIC and APLIC as platform devices as well to ensure probing order as per BRS spec [1] requirement.
3) BRS spec requires RISC-V to use new ACPI ID for the generic UART. So, update the HID of the UART.
Quoted 7 lines
4) Enabled ACPI tables tests for RISC-V which were originally part of
[2] but couldn't get merged due to updates required in the expected AML files. I think combining those patches with this series makes it easier to merge since expected AML files are updated.[1] - https://github.com/riscv-non-isa/riscv-brs
[2] - https://lists.gnu.org/archive/html/qemu-devel/2024-06/msg04734.htmlQuoted 6 lines
btw: CI is not happy about series, see:
https://gitlab.com/imammedo/qemu/-/pipelines/1371119552
also 'cross-i686-tci' job routinely timeouts on bios-tables-test but we still keep adding more tests to it.
We should either bump timeout to account for slowness or disable bios-tables-test for that job.
Quoted 3 lines
Asumming the test is functionally correct, and not hanging, then bumping the timeout is the right answer. You can do this in the meson.build file
I think test is fine, since once in a while it passes (I guess it depends on runner host/load)
Overal job timeout is 1h, but that's not what fails.
What I see is, the test aborts after 10min timeout.
it's likely we hit boot_sector_test()/acpi_find_rsdp_address_uefi() timeout. That's what we should try to bump.
PS:
I've just started the job with 5min bump, lets see if it is enough.
Quoted 6 lines
We should never disable tests only in CI, because non-CI users are just as likely to hit timeouts.
With regards,
Daniel
Quoted 41 lines · Igor Mammedov
Quoted 32 lines · On Fri, 12 Jul 2024 13:51:04 +0100 Daniel P. Berrangé <[email protected]>…
Quoted 24 lines · Igor Mammedov
Quoted 13 lines · On Mon, 8 Jul 2024 17:17:32 +0530 Sunil V L <[email protected]> wrote:
This series adds few updates to RISC-V ACPI namespace for virt platform. Additionally, it has patches to enable ACPI table testing for RISC-V.
1) PCI Link devices need to be created outside the scope of the PCI root complex to ensure correct probe ordering by the OS. This matches the example given in ACPI spec as well.
2) Add PLIC and APLIC as platform devices as well to ensure probing order as per BRS spec [1] requirement.
3) BRS spec requires RISC-V to use new ACPI ID for the generic UART. So, update the HID of the UART.
Quoted 7 lines
4) Enabled ACPI tables tests for RISC-V which were originally part of
[2] but couldn't get merged due to updates required in the expected AML files. I think combining those patches with this series makes it easier to merge since expected AML files are updated.[1] - https://github.com/riscv-non-isa/riscv-brs
[2] - https://lists.gnu.org/archive/html/qemu-devel/2024-06/msg04734.htmlQuoted 6 lines
btw: CI is not happy about series, see:
https://gitlab.com/imammedo/qemu/-/pipelines/1371119552
also 'cross-i686-tci' job routinely timeouts on bios-tables-test but we still keep adding more tests to it.
We should either bump timeout to account for slowness or disable bios-tables-test for that job.Quoted 3 lines
Asumming the test is functionally correct, and not hanging, then bumping the timeout is the right answer. You can do this in the meson.build file
I think test is fine, since once in a while it passes (I guess it depends on runner host/load)
Quoted 7 lines
Overal job timeout is 1h, but that's not what fails.
What I see is, the test aborts after 10min timeout.
it's likely we hit boot_sector_test()/acpi_find_rsdp_address_uefi() timeout. That's what we should try to bump.PS:
I've just started the job with 5min bump, lets see if it is enough.
Because we should wait for 5min CPU time, not wall time. Why don't we do that?
Something like getrusage should work I think.
Quoted 6 lines
Quoted 6 lines
We should never disable tests only in CI, because non-CI users are just as likely to hit timeouts.
With regards,
Daniel
Quoted 47 lines · On Sun, 14 Jul 2024 03:46:36 -0400 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 46 lines · Igor Mammedov
Quoted 32 lines · On Fri, 12 Jul 2024 13:51:04 +0100 Daniel P. Berrangé <[email protected]>…
Quoted 24 lines · Igor Mammedov
Quoted 13 lines · On Mon, 8 Jul 2024 17:17:32 +0530 Sunil V L <[email protected]> wrote:
This series adds few updates to RISC-V ACPI namespace for virt platform. Additionally, it has patches to enable ACPI table testing for RISC-V.
1) PCI Link devices need to be created outside the scope of the PCI root complex to ensure correct probe ordering by the OS. This matches the example given in ACPI spec as well.
2) Add PLIC and APLIC as platform devices as well to ensure probing order as per BRS spec [1] requirement.
3) BRS spec requires RISC-V to use new ACPI ID for the generic UART. So, update the HID of the UART.
Quoted 7 lines
4) Enabled ACPI tables tests for RISC-V which were originally part of
[2] but couldn't get merged due to updates required in the expected AML files. I think combining those patches with this series makes it easier to merge since expected AML files are updated.[1] - https://github.com/riscv-non-isa/riscv-brs
[2] - https://lists.gnu.org/archive/html/qemu-devel/2024-06/msg04734.htmlQuoted 6 lines
btw: CI is not happy about series, see:
https://gitlab.com/imammedo/qemu/-/pipelines/1371119552
also 'cross-i686-tci' job routinely timeouts on bios-tables-test but we still keep adding more tests to it.
We should either bump timeout to account for slowness or disable bios-tables-test for that job.Quoted 3 lines
Asumming the test is functionally correct, and not hanging, then bumping the timeout is the right answer. You can do this in the meson.build file
I think test is fine, since once in a while it passes (I guess it depends on runner host/load)
Overal job timeout is 1h, but that's not what fails.
What I see is, the test aborts after 10min timeout.
it's likely we hit boot_sector_test()/acpi_find_rsdp_address_uefi() timeout. That's what we should try to bump.
Quoted 7 lines
Quoted 2 lines
PS:
I've just started the job with 5min bump, lets see if it is enough.Because we should wait for 5min CPU time, not wall time. Why don't we do that?
Something like getrusage should work I think.
It turned out to be a meson timeout that's set individually per test file. I'll send a patch later on.
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
We should never disable tests only in CI, because non-CI users are just as likely to hit timeouts.
With regards,
Daniel
Quoted 53 lines · Igor Mammedov
Quoted 50 lines · On Sun, 14 Jul 2024 03:46:36 -0400 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 48 lines · Igor Mammedov
Quoted 32 lines · On Fri, 12 Jul 2024 13:51:04 +0100 Daniel P. Berrangé <[email protected]>…
Quoted 24 lines · Igor Mammedov
Quoted 13 lines · On Mon, 8 Jul 2024 17:17:32 +0530 Sunil V L <[email protected]> wrote:
This series adds few updates to RISC-V ACPI namespace for virt platform. Additionally, it has patches to enable ACPI table testing for RISC-V.
1) PCI Link devices need to be created outside the scope of the PCI root complex to ensure correct probe ordering by the OS. This matches the example given in ACPI spec as well.
2) Add PLIC and APLIC as platform devices as well to ensure probing order as per BRS spec [1] requirement.
3) BRS spec requires RISC-V to use new ACPI ID for the generic UART. So, update the HID of the UART.
Quoted 7 lines
4) Enabled ACPI tables tests for RISC-V which were originally part of
[2] but couldn't get merged due to updates required in the expected AML files. I think combining those patches with this series makes it easier to merge since expected AML files are updated.[1] - https://github.com/riscv-non-isa/riscv-brs
[2] - https://lists.gnu.org/archive/html/qemu-devel/2024-06/msg04734.htmlQuoted 6 lines
btw: CI is not happy about series, see:
https://gitlab.com/imammedo/qemu/-/pipelines/1371119552
also 'cross-i686-tci' job routinely timeouts on bios-tables-test but we still keep adding more tests to it.
We should either bump timeout to account for slowness or disable bios-tables-test for that job.Quoted 3 lines
Asumming the test is functionally correct, and not hanging, then bumping the timeout is the right answer. You can do this in the meson.build file
I think test is fine, since once in a while it passes (I guess it depends on runner host/load)
Overal job timeout is 1h, but that's not what fails.
What I see is, the test aborts after 10min timeout.
it's likely we hit boot_sector_test()/acpi_find_rsdp_address_uefi() timeout. That's what we should try to bump.PS:
I've just started the job with 5min bump, lets see if it is enough.
Quoted 8 lines
Quoted 4 lines
Because we should wait for 5min CPU time, not wall time. Why don't we do that?
Something like getrusage should work I think.It turned out to be a meson timeout that's set individually per test file. I'll send a patch later on.
Hi Igor,
I am unable to get msys2-64bit test in CI to pass. I tried including your change in meson as well but no luck. I can't guess how enabling bios-tables-test for RISC-V is affecting this particular test. Does this pass for you?
https://gitlab.com/vlsunil/qemu/-/jobs/7343701148
Thanks!
Sunil
Quoted 62 lines · On Tue, 16 Jul 2024 17:56:11 +0530 Sunil V L <[email protected]> wrote:
Quoted 53 lines · Igor Mammedov
Quoted 50 lines · On Sun, 14 Jul 2024 03:46:36 -0400 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 48 lines · Igor Mammedov
Quoted 32 lines · On Fri, 12 Jul 2024 13:51:04 +0100 Daniel P. Berrangé <[email protected]>…
Quoted 24 lines · Igor Mammedov
Quoted 13 lines · On Mon, 8 Jul 2024 17:17:32 +0530 Sunil V L <[email protected]> wrote:
This series adds few updates to RISC-V ACPI namespace for virt platform. Additionally, it has patches to enable ACPI table testing for RISC-V.
1) PCI Link devices need to be created outside the scope of the PCI root complex to ensure correct probe ordering by the OS. This matches the example given in ACPI spec as well.
2) Add PLIC and APLIC as platform devices as well to ensure probing order as per BRS spec [1] requirement.
3) BRS spec requires RISC-V to use new ACPI ID for the generic UART. So, update the HID of the UART.
Quoted 7 lines
4) Enabled ACPI tables tests for RISC-V which were originally part of
[2] but couldn't get merged due to updates required in the expected AML files. I think combining those patches with this series makes it easier to merge since expected AML files are updated.[1] - https://github.com/riscv-non-isa/riscv-brs
[2] - https://lists.gnu.org/archive/html/qemu-devel/2024-06/msg04734.htmlQuoted 6 lines
btw: CI is not happy about series, see:
https://gitlab.com/imammedo/qemu/-/pipelines/1371119552
also 'cross-i686-tci' job routinely timeouts on bios-tables-test but we still keep adding more tests to it.
We should either bump timeout to account for slowness or disable bios-tables-test for that job.Quoted 3 lines
Asumming the test is functionally correct, and not hanging, then bumping the timeout is the right answer. You can do this in the meson.build file
I think test is fine, since once in a while it passes (I guess it depends on runner host/load)
Overal job timeout is 1h, but that's not what fails.
What I see is, the test aborts after 10min timeout.
it's likely we hit boot_sector_test()/acpi_find_rsdp_address_uefi() timeout. That's what we should try to bump.PS:
I've just started the job with 5min bump, lets see if it is enough.Quoted 8 lines
Quoted 4 lines
Because we should wait for 5min CPU time, not wall time. Why don't we do that?
Something like getrusage should work I think.It turned out to be a meson timeout that's set individually per test file. I'll send a patch later on.
Quoted 8 lines
Hi Igor,
I am unable to get msys2-64bit test in CI to pass. I tried including your change in meson as well but no luck. I can't guess how enabling bios-tables-test for RISC-V is affecting this particular test. Does this pass for you?
it doesn't pass for me either,
but bios-tables-test is not among those that timed out, so I'd ignore failure in this case
Quoted 4 lines
Thanks!
Sunil
Quoted 72 lines · On Tue, 16 Jul 2024 16:28:07 +0200 Igor Mammedov <[email protected]> wrote:
Quoted 69 lines · On Tue, 16 Jul 2024 17:56:11 +0530 Sunil V L <[email protected]> wrote:
Quoted 53 lines · Igor Mammedov
Quoted 50 lines · On Sun, 14 Jul 2024 03:46:36 -0400 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 48 lines · Igor Mammedov
Quoted 32 lines · On Fri, 12 Jul 2024 13:51:04 +0100 Daniel P. Berrangé <[email protected]>…
Quoted 24 lines · Igor Mammedov
Quoted 13 lines · On Mon, 8 Jul 2024 17:17:32 +0530 Sunil V L <[email protected]> wrote:
This series adds few updates to RISC-V ACPI namespace for virt platform. Additionally, it has patches to enable ACPI table testing for RISC-V.
1) PCI Link devices need to be created outside the scope of the PCI root complex to ensure correct probe ordering by the OS. This matches the example given in ACPI spec as well.
2) Add PLIC and APLIC as platform devices as well to ensure probing order as per BRS spec [1] requirement.
3) BRS spec requires RISC-V to use new ACPI ID for the generic UART. So, update the HID of the UART.
Quoted 7 lines
4) Enabled ACPI tables tests for RISC-V which were originally part of
[2] but couldn't get merged due to updates required in the expected AML files. I think combining those patches with this series makes it easier to merge since expected AML files are updated.[1] - https://github.com/riscv-non-isa/riscv-brs
[2] - https://lists.gnu.org/archive/html/qemu-devel/2024-06/msg04734.htmlQuoted 6 lines
btw: CI is not happy about series, see:
https://gitlab.com/imammedo/qemu/-/pipelines/1371119552
also 'cross-i686-tci' job routinely timeouts on bios-tables-test but we still keep adding more tests to it.
We should either bump timeout to account for slowness or disable bios-tables-test for that job.Quoted 3 lines
Asumming the test is functionally correct, and not hanging, then bumping the timeout is the right answer. You can do this in the meson.build file
I think test is fine, since once in a while it passes (I guess it depends on runner host/load)
Overal job timeout is 1h, but that's not what fails.
What I see is, the test aborts after 10min timeout.
it's likely we hit boot_sector_test()/acpi_find_rsdp_address_uefi() timeout. That's what we should try to bump.PS:
I've just started the job with 5min bump, lets see if it is enough.Quoted 8 lines
Quoted 4 lines
Because we should wait for 5min CPU time, not wall time. Why don't we do that?
Something like getrusage should work I think.It turned out to be a meson timeout that's set individually per test file. I'll send a patch later on.
Hi Igor,
I am unable to get msys2-64bit test in CI to pass. I tried including your change in meson as well but no luck. I can't guess how enabling bios-tables-test for RISC-V is affecting this particular test. Does this pass for you?
Quoted 5 lines
Quoted 1 line
it doesn't pass for me either,
but bios-tables-test is not among those that timed out, so I'd ignore failure in this case
as in your case it was sparc target tests that timed out:
https://gitlab.com/imammedo/qemu/-/jobs/7352989984
CCIng sparc folks as well
Quoted 6 lines
Quoted 5 lines
Thanks!
Sunil