From 16f6804c460109e8b126cc710a0072f9f83bd230 Mon Sep 17 00:00:00 2001 From: zuoboqun Date: Fri, 15 Nov 2024 16:03:12 +0800 Subject: [PATCH 01/13] vhost_net: fix assertion triggered by batch of host notifiers processing When the backend of vhost_net restarts during the vm is running, vhost_net is stopped and started. The virtio_device_grab_ioeventfd() fucntion in vhost_net_enable_notifiers() will result in a call to virtio_bus_set_host_notifier()(assign=false). And now virtio_device_grab_ioeventfd() is batched in a single transaction with virtio_bus_set_host_notifier()(assign=true). This triggers the following assertion: kvm_mem_ioeventfd_del: error deleting ioeventfd: Bad file descriptor This patch moves virtio_device_grab_ioeventfd() out of the batch to fix this problem. To be noted that the for loop to release ioeventfd should start from i+1, not i, because the i-th ioeventfd has already been released in vhost_dev_disable_notifiers_nvqs(). Fixes: 6166799f6 ("vhost_net: configure all host notifiers in a single MR transaction") Signed-off-by: Zuo Boqun Reported-by: Gao Shiyuan Message-Id: <20241115080312.3184-1-zuoboqun@baidu.com> Acked-by: Stefano Garzarella Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/net/vhost_net.c | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 997aab0557..891f235a0a 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -229,9 +229,24 @@ static int vhost_net_enable_notifiers(VirtIODevice *dev, int nvhosts = data_queue_pairs + cvq; struct vhost_net *net; struct vhost_dev *hdev; - int r, i, j; + int r, i, j, k; NetClientState *peer; + /* + * We will pass the notifiers to the kernel, make sure that QEMU + * doesn't interfere. + */ + for (i = 0; i < nvhosts; i++) { + r = virtio_device_grab_ioeventfd(dev); + if (r < 0) { + error_report("vhost %d binding does not support host notifiers", i); + for (k = 0; k < i; k++) { + virtio_device_release_ioeventfd(dev); + } + return r; + } + } + /* * Batch all the host notifiers in a single transaction to avoid * quadratic time complexity in address_space_update_ioeventfds(). @@ -247,16 +262,6 @@ static int vhost_net_enable_notifiers(VirtIODevice *dev, net = get_vhost_net(peer); hdev = &net->dev; - /* - * We will pass the notifiers to the kernel, make sure that QEMU - * doesn't interfere. - */ - r = virtio_device_grab_ioeventfd(dev); - if (r < 0) { - error_report("binding does not support host notifiers"); - memory_region_transaction_commit(); - goto fail_nvhosts; - } for (j = 0; j < hdev->nvqs; j++) { r = virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), @@ -277,6 +282,14 @@ static int vhost_net_enable_notifiers(VirtIODevice *dev, return 0; fail_nvhosts: vhost_net_disable_notifiers_nvhosts(dev, ncs, data_queue_pairs, i); + /* + * This for loop starts from i+1, not i, because the i-th ioeventfd + * has already been released in vhost_dev_disable_notifiers_nvqs(). + */ + for (k = i + 1; k < nvhosts; k++) { + virtio_device_release_ioeventfd(dev); + } + return r; } From ef5e7aeaa6e7a258798c1eff2f5c726504116609 Mon Sep 17 00:00:00 2001 From: Salil Mehta Date: Tue, 12 Nov 2024 18:02:52 +0100 Subject: [PATCH 02/13] qtest: allow ACPI DSDT Table changes list changed files in tests/qtest/bios-tables-test-allowed-diff.h Message-ID: <20241106100047.18901c9d@imammedo.users.ipa.redhat.com> Signed-off-by: Salil Mehta Signed-off-by: Igor Mammedov Message-Id: <20241112170258.2996640-2-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 41 +++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..512d40665d 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,42 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/x86/pc/DSDT", +"tests/data/acpi/x86/pc/DSDT.acpierst", +"tests/data/acpi/x86/pc/DSDT.acpihmat", +"tests/data/acpi/x86/pc/DSDT.bridge", +"tests/data/acpi/x86/pc/DSDT.cphp", +"tests/data/acpi/x86/pc/DSDT.dimmpxm", +"tests/data/acpi/x86/pc/DSDT.hpbridge", +"tests/data/acpi/x86/pc/DSDT.hpbrroot", +"tests/data/acpi/x86/pc/DSDT.ipmikcs", +"tests/data/acpi/x86/pc/DSDT.memhp", +"tests/data/acpi/x86/pc/DSDT.nohpet", +"tests/data/acpi/x86/pc/DSDT.numamem", +"tests/data/acpi/x86/pc/DSDT.roothp", +"tests/data/acpi/x86/q35/DSDT", +"tests/data/acpi/x86/q35/DSDT.acpierst", +"tests/data/acpi/x86/q35/DSDT.acpihmat", +"tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator", +"tests/data/acpi/x86/q35/DSDT.applesmc", +"tests/data/acpi/x86/q35/DSDT.bridge", +"tests/data/acpi/x86/q35/DSDT.core-count", +"tests/data/acpi/x86/q35/DSDT.core-count2", +"tests/data/acpi/x86/q35/DSDT.cphp", +"tests/data/acpi/x86/q35/DSDT.cxl", +"tests/data/acpi/x86/q35/DSDT.dimmpxm", +"tests/data/acpi/x86/q35/DSDT.ipmibt", +"tests/data/acpi/x86/q35/DSDT.ipmismbus", +"tests/data/acpi/x86/q35/DSDT.ivrs", +"tests/data/acpi/x86/q35/DSDT.memhp", +"tests/data/acpi/x86/q35/DSDT.mmio64", +"tests/data/acpi/x86/q35/DSDT.multi-bridge", +"tests/data/acpi/x86/q35/DSDT.noacpihp", +"tests/data/acpi/x86/q35/DSDT.nohpet", +"tests/data/acpi/x86/q35/DSDT.numamem", +"tests/data/acpi/x86/q35/DSDT.pvpanic-isa", +"tests/data/acpi/x86/q35/DSDT.thread-count", +"tests/data/acpi/x86/q35/DSDT.thread-count2", +"tests/data/acpi/x86/q35/DSDT.tis.tpm12", +"tests/data/acpi/x86/q35/DSDT.tis.tpm2", +"tests/data/acpi/x86/q35/DSDT.type4-count", +"tests/data/acpi/x86/q35/DSDT.viot", +"tests/data/acpi/x86/q35/DSDT.xapic", From cb36e2573a02da2a4d95bae71e4d2f1a746d8ee2 Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Tue, 12 Nov 2024 18:02:53 +0100 Subject: [PATCH 03/13] Revert "hw/acpi: Update ACPI `_STA` method with QOM vCPU ACPI Hotplug states" This reverts commit bf1ecc8dad6061914730a2a2d57af6b37c3a4f8d which broke cpu hotplug in x86 after migration to older QEMU Fixes: bf1ecc8dad606 (w/acpi: Update ACPI `_STA` method with QOM vCPU ACPI Hotplug states) Signed-off-by: Igor Mammedov Message-Id: <20241112170258.2996640-3-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/acpi/cpu.c | 38 ++++---------------------------------- include/hw/core/cpu.h | 1 - 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index 23443f09a5..9b03b4292e 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -50,18 +50,6 @@ void acpi_cpu_ospm_status(CPUHotplugState *cpu_st, ACPIOSTInfoList ***list) } } -static bool check_cpu_enabled_status(DeviceState *dev) -{ - CPUClass *k = dev ? CPU_GET_CLASS(dev) : NULL; - CPUState *cpu = CPU(dev); - - if (cpu && (!k->cpu_enabled_status || k->cpu_enabled_status(cpu))) { - return true; - } - - return false; -} - static uint64_t cpu_hotplug_rd(void *opaque, hwaddr addr, unsigned size) { uint64_t val = 0; @@ -75,11 +63,10 @@ static uint64_t cpu_hotplug_rd(void *opaque, hwaddr addr, unsigned size) cdev = &cpu_st->devs[cpu_st->selector]; switch (addr) { case ACPI_CPU_FLAGS_OFFSET_RW: /* pack and return is_* fields */ - val |= check_cpu_enabled_status(DEVICE(cdev->cpu)) ? 1 : 0; + val |= cdev->cpu ? 1 : 0; val |= cdev->is_inserting ? 2 : 0; val |= cdev->is_removing ? 4 : 0; val |= cdev->fw_remove ? 16 : 0; - val |= cdev->cpu ? 32 : 0; trace_cpuhp_acpi_read_flags(cpu_st->selector, val); break; case ACPI_CPU_CMD_DATA_OFFSET_RW: @@ -362,7 +349,6 @@ const VMStateDescription vmstate_cpu_hotplug = { #define CPU_REMOVE_EVENT "CRMV" #define CPU_EJECT_EVENT "CEJ0" #define CPU_FW_EJECT_EVENT "CEJF" -#define CPU_PRESENT "CPRS" void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts, build_madt_cpu_fn build_madt_cpu, hwaddr base_addr, @@ -423,9 +409,7 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts, aml_append(field, aml_named_field(CPU_EJECT_EVENT, 1)); /* tell firmware to do device eject, write only */ aml_append(field, aml_named_field(CPU_FW_EJECT_EVENT, 1)); - /* 1 if present, read only */ - aml_append(field, aml_named_field(CPU_PRESENT, 1)); - aml_append(field, aml_reserved_field(2)); + aml_append(field, aml_reserved_field(3)); aml_append(field, aml_named_field(CPU_COMMAND, 8)); aml_append(cpu_ctrl_dev, field); @@ -455,7 +439,6 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts, Aml *ctrl_lock = aml_name("%s.%s", cphp_res_path, CPU_LOCK); Aml *cpu_selector = aml_name("%s.%s", cphp_res_path, CPU_SELECTOR); Aml *is_enabled = aml_name("%s.%s", cphp_res_path, CPU_ENABLED); - Aml *is_present = aml_name("%s.%s", cphp_res_path, CPU_PRESENT); Aml *cpu_cmd = aml_name("%s.%s", cphp_res_path, CPU_COMMAND); Aml *cpu_data = aml_name("%s.%s", cphp_res_path, CPU_DATA); Aml *ins_evt = aml_name("%s.%s", cphp_res_path, CPU_INSERT_EVENT); @@ -484,26 +467,13 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts, { Aml *idx = aml_arg(0); Aml *sta = aml_local(0); - Aml *ifctx2; - Aml *else_ctx; aml_append(method, aml_acquire(ctrl_lock, 0xFFFF)); aml_append(method, aml_store(idx, cpu_selector)); aml_append(method, aml_store(zero, sta)); - ifctx = aml_if(aml_equal(is_present, one)); + ifctx = aml_if(aml_equal(is_enabled, one)); { - ifctx2 = aml_if(aml_equal(is_enabled, one)); - { - /* cpu is present and enabled */ - aml_append(ifctx2, aml_store(aml_int(0xF), sta)); - } - aml_append(ifctx, ifctx2); - else_ctx = aml_else(); - { - /* cpu is present but disabled */ - aml_append(else_ctx, aml_store(aml_int(0xD), sta)); - } - aml_append(ifctx, else_ctx); + aml_append(ifctx, aml_store(aml_int(0xF), sta)); } aml_append(method, ifctx); aml_append(method, aml_release(ctrl_lock)); diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index db8a6fbc6e..e7de77dc6d 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -159,7 +159,6 @@ struct CPUClass { void (*query_cpu_fast)(CPUState *cpu, CpuInfoFast *value); int64_t (*get_arch_id)(CPUState *cpu); bool (*cpu_persistent_status)(CPUState *cpu); - bool (*cpu_enabled_status)(CPUState *cpu); void (*set_pc)(CPUState *cpu, vaddr value); vaddr (*get_pc)(CPUState *cpu); int (*gdb_read_register)(CPUState *cpu, GByteArray *buf, int reg); From f2ba6ab6212b656179c4f4ce68ee74a500c409b0 Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Tue, 12 Nov 2024 18:02:54 +0100 Subject: [PATCH 04/13] Revert "hw/acpi: Make CPUs ACPI `presence` conditional during vCPU hot-unplug" This reverts commit 2d6cfbaf174b91dfa9a50065f7494634afb39c23. The patch is supposed to be part of ARM CPU hotplug series and has not value on its own without it. The series however is still in RFC stage and outside of scope 9.2 release. On top of that it introduces not needed callback that pokes directly into CPU state without any need for that. Instead properties and AML generator option should be used to configure static platform depended vCPU presence state. Drop the patch so that corrected version could be posted along with ARM CPU hotplug series and properly reviewed in relevant context. That also helps us to keep history cleaner with new patch being against original code vs a string of fixups on top of current mess. Signed-off-by: Igor Mammedov Message-Id: <20241112170258.2996640-4-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/acpi/cpu.c | 15 +-------------- include/hw/core/cpu.h | 1 - 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index 9b03b4292e..5cb60ca8bc 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -233,17 +233,6 @@ void cpu_hotplug_hw_init(MemoryRegion *as, Object *owner, memory_region_add_subregion(as, base_addr, &state->ctrl_reg); } -static bool should_remain_acpi_present(DeviceState *dev) -{ - CPUClass *k = CPU_GET_CLASS(dev); - /* - * A system may contain CPUs that are always present on one die, NUMA node, - * or socket, yet may be non-present on another simultaneously. Check from - * architecture specific code. - */ - return k->cpu_persistent_status && k->cpu_persistent_status(CPU(dev)); -} - static AcpiCpuStatus *get_cpu_status(CPUHotplugState *cpu_st, DeviceState *dev) { CPUClass *k = CPU_GET_CLASS(dev); @@ -300,9 +289,7 @@ void acpi_cpu_unplug_cb(CPUHotplugState *cpu_st, return; } - if (!should_remain_acpi_present(dev)) { - cdev->cpu = NULL; - } + cdev->cpu = NULL; } static const VMStateDescription vmstate_cpuhp_sts = { diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index e7de77dc6d..c3ca0babcb 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -158,7 +158,6 @@ struct CPUClass { void (*dump_state)(CPUState *cpu, FILE *, int flags); void (*query_cpu_fast)(CPUState *cpu, CpuInfoFast *value); int64_t (*get_arch_id)(CPUState *cpu); - bool (*cpu_persistent_status)(CPUState *cpu); void (*set_pc)(CPUState *cpu, vaddr value); vaddr (*get_pc)(CPUState *cpu); int (*gdb_read_register)(CPUState *cpu, GByteArray *buf, int reg); From e50a24ead1c0b39673060aa90466ab8ef246297f Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Tue, 12 Nov 2024 18:02:55 +0100 Subject: [PATCH 05/13] tests/acpi: update expected blobs Expected AML return to the state before bf1ecc8dad606 (w/acpi: Update ACPI `_STA` method with QOM vCPU ACPI Hotplug states) droping not needed CPRS and _STA logic that broke cpu hotplug @@ -2887,7 +2887,6 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC ", 0x00000001) CRMV, 1, CEJ0, 1, CEJF, 1, - CPRS, 1, Offset (0x05), CCMD, 8 } @@ -2922,16 +2921,9 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC ", 0x00000001) Acquire (\_SB.PCI0.PRES.CPLK, 0xFFFF) \_SB.PCI0.PRES.CSEL = Arg0 Local0 = Zero - If ((\_SB.PCI0.PRES.CPRS == One)) + If ((\_SB.PCI0.PRES.CPEN == One)) { - If ((\_SB.PCI0.PRES.CPEN == One)) - { - Local0 = 0x0F - } - Else - { - Local0 = 0x0D - } + Local0 = 0x0F } Signed-off-by: Igor Mammedov Message-Id: <20241112170258.2996640-5-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/data/acpi/x86/pc/DSDT | Bin 8560 -> 8526 bytes tests/data/acpi/x86/pc/DSDT.acpierst | Bin 8471 -> 8437 bytes tests/data/acpi/x86/pc/DSDT.acpihmat | Bin 9885 -> 9851 bytes tests/data/acpi/x86/pc/DSDT.bridge | Bin 15431 -> 15397 bytes tests/data/acpi/x86/pc/DSDT.cphp | Bin 9024 -> 8990 bytes tests/data/acpi/x86/pc/DSDT.dimmpxm | Bin 10214 -> 10180 bytes tests/data/acpi/x86/pc/DSDT.hpbridge | Bin 8511 -> 8477 bytes tests/data/acpi/x86/pc/DSDT.hpbrroot | Bin 5067 -> 5033 bytes tests/data/acpi/x86/pc/DSDT.ipmikcs | Bin 8632 -> 8598 bytes tests/data/acpi/x86/pc/DSDT.memhp | Bin 9919 -> 9885 bytes tests/data/acpi/x86/pc/DSDT.nohpet | Bin 8418 -> 8384 bytes tests/data/acpi/x86/pc/DSDT.numamem | Bin 8566 -> 8532 bytes tests/data/acpi/x86/pc/DSDT.roothp | Bin 12353 -> 12319 bytes tests/data/acpi/x86/q35/DSDT | Bin 8389 -> 8355 bytes tests/data/acpi/x86/q35/DSDT.acpierst | Bin 8406 -> 8372 bytes tests/data/acpi/x86/q35/DSDT.acpihmat | Bin 9714 -> 9680 bytes .../acpi/x86/q35/DSDT.acpihmat-noinitiator | Bin 8668 -> 8634 bytes tests/data/acpi/x86/q35/DSDT.applesmc | Bin 8435 -> 8401 bytes tests/data/acpi/x86/q35/DSDT.bridge | Bin 12002 -> 11968 bytes tests/data/acpi/x86/q35/DSDT.core-count | Bin 12947 -> 12913 bytes tests/data/acpi/x86/q35/DSDT.core-count2 | Bin 33804 -> 33770 bytes tests/data/acpi/x86/q35/DSDT.cphp | Bin 8853 -> 8819 bytes tests/data/acpi/x86/q35/DSDT.cxl | Bin 13180 -> 13146 bytes tests/data/acpi/x86/q35/DSDT.dimmpxm | Bin 10043 -> 10009 bytes tests/data/acpi/x86/q35/DSDT.ipmibt | Bin 8464 -> 8430 bytes tests/data/acpi/x86/q35/DSDT.ipmismbus | Bin 8477 -> 8443 bytes tests/data/acpi/x86/q35/DSDT.ivrs | Bin 8406 -> 8372 bytes tests/data/acpi/x86/q35/DSDT.memhp | Bin 9748 -> 9714 bytes tests/data/acpi/x86/q35/DSDT.mmio64 | Bin 9519 -> 9485 bytes tests/data/acpi/x86/q35/DSDT.multi-bridge | Bin 13242 -> 13208 bytes tests/data/acpi/x86/q35/DSDT.noacpihp | Bin 8269 -> 8235 bytes tests/data/acpi/x86/q35/DSDT.nohpet | Bin 8247 -> 8213 bytes tests/data/acpi/x86/q35/DSDT.numamem | Bin 8395 -> 8361 bytes tests/data/acpi/x86/q35/DSDT.pvpanic-isa | Bin 8490 -> 8456 bytes tests/data/acpi/x86/q35/DSDT.thread-count | Bin 12947 -> 12913 bytes tests/data/acpi/x86/q35/DSDT.thread-count2 | Bin 33804 -> 33770 bytes tests/data/acpi/x86/q35/DSDT.tis.tpm12 | Bin 8995 -> 8961 bytes tests/data/acpi/x86/q35/DSDT.tis.tpm2 | Bin 9021 -> 8987 bytes tests/data/acpi/x86/q35/DSDT.type4-count | Bin 18623 -> 18589 bytes tests/data/acpi/x86/q35/DSDT.viot | Bin 14646 -> 14612 bytes tests/data/acpi/x86/q35/DSDT.xapic | Bin 35752 -> 35718 bytes tests/qtest/bios-tables-test-allowed-diff.h | 41 ------------------ 42 files changed, 41 deletions(-) diff --git a/tests/data/acpi/x86/pc/DSDT b/tests/data/acpi/x86/pc/DSDT index f68a32e6068788c3fdfaff139206b725ba2bf1d1..8b8235fe79e2fa08a6f840c8479edb75f5a047b9 100644 GIT binary patch delta 76 zcmez1bk2#(CD@o=P99EwyZB(I_~<5&$!B=t7&Rtq^C~bgFi#HR)nM{9 go?OFg#^%B1930{}*^W<-i6LR~e_rX$3VZ>=07R=4p8x;= delta 125 zcmX@-^udYCCD*Nn-PWAb`lQ#13)G5RbZ4FS%c1_42?!C<8eq%ehD{TK_l_!Abg7I5)y J{>vLE3;@@vBVGUi diff --git a/tests/data/acpi/x86/pc/DSDT.acpierst b/tests/data/acpi/x86/pc/DSDT.acpierst index 0fd79699ebbfb650a5bbe49faecbebf2fc13a86c..06829b9c6c6d726d955dc7c99bc9f42448e22aeb 100644 GIT binary patch delta 76 zcmV-S0JHy>LiIrkL{mgm^&kKM0kW|QxeN(UK3`KpUt5AmlgtcW0VtCz4Ilyl1Cvq> iC<0A0lY9*}21o`&Q&d5dJ`OGd0AQ2<4I8r{4)+pssulqN delta 125 zcmezBINgcMCDP99E2$M|5U_~<6z$!B=t7 fC<075lY9+90!RjvzYR5$3l18Skq{NLKn`6P2n`eu delta 108 zcmezEGuM~PCD*Nn-PWAb`lQ#13)G5RbZ4FS%c1_42?!C<8eq%ehD{TK_l_!Abg7I5)y J{>!VO2LR(fBWeHu diff --git a/tests/data/acpi/x86/pc/DSDT.cphp b/tests/data/acpi/x86/pc/DSDT.cphp index 1079ff81c1ab05f0d5991835b3a0b014687924f4..045a52e75b7fcd4e5f840a758c548231498b96e4 100644 GIT binary patch delta 69 zcmV-L0J{IcMxI6rL{mgm9wPt%0nM=rxeN(UTVGQ`Ut5AmlgtcW0VtCz4Ilyl1Cvq> bC<0ATlY9+w0!Rjv@C`MSJPsPOTn^+E!a5Wv delta 108 zcmbQ|cEF9xCD43t0=ecoQZs5D?w$ I&v#w~08Tv}v;Y7A diff --git a/tests/data/acpi/x86/pc/DSDT.dimmpxm b/tests/data/acpi/x86/pc/DSDT.dimmpxm index 34fe3fcad9dc245eb173ca5a9655d17f15bd42ef..205219b99d903555125c4b07fc047c42993eb338 100644 GIT binary patch delta 96 zcmaFnf5e~5CDz&#S=1z&tsPSA)sT zb@Bw>NG1=q$**}$rKBdu=(B*-1~_{f1O&MTI|sP>F&1#~Crp+X5Z#=^S0xDmhw>Y! delta 103 zcmX@&|IDAuCD4FZB(gTYECOYupwE@Um>;@xb*H$f5r Dad91& diff --git a/tests/data/acpi/x86/pc/DSDT.hpbridge b/tests/data/acpi/x86/pc/DSDT.hpbridge index 33c7529f5c8a6ec651f979b3cebadb18774a781f..8fa8b519ec65bd5099c45f4e1c85b11b47a23845 100644 GIT binary patch delta 76 zcmdn*G}npCCD*Nn-PWAb`lQ#13)G5RbZ4FS%c1_42?!C<8eq%ehD{TK_l_!Abg7I5)y J{>!T%3;?JoBF+E+ diff --git a/tests/data/acpi/x86/pc/DSDT.hpbrroot b/tests/data/acpi/x86/pc/DSDT.hpbrroot index 2661170c833e23ae1985d31512a81a29afc858bd..01719462a72fd6d40ce433dac601e4b94eae574c 100644 GIT binary patch delta 98 zcmX@DzEYjbCD3`4>KsmU?=EFdib&YlJVL9W5h0j_?G1zh}_FY)|j0{}jp B8;bw{ delta 131 zcmZ3fep;Q&CD iC<0A0lY9*}21o`&Q&d5dJ`OGd0AQ2<4I8r{4ww^F-xWOo delta 125 zcmbQ{yu+ExCD*Nn-PWAb`lQ#13)G5RbZ4FS%c1_42?!C<8eq%ehD{TK_l_!Abg7I5)y J{>wX47yyb?BK!aV diff --git a/tests/data/acpi/x86/pc/DSDT.memhp b/tests/data/acpi/x86/pc/DSDT.memhp index 6ede4361f4b7bf18c496d7ca117310675126bbbf..03ff464ba4e72082fce0921815cfc09ca20b561a 100644 GIT binary patch delta 76 zcmV-S0JHzUO`S~&L{mgmohASP0b8*OxeN(KKVMTqUt5AmlgtcW0VtCz4Ilyl1Cvq> iC;~$?lY9*}21o`&Q&d5dJ`OGd0AQ2<4I8r{4xbo4h!ooZ delta 125 zcmbR1yWf|~CD_Are@}oWAs@-8Uma>4FZB(gTYD{NMQ=Q`Y{%8@h2=~E#Tta J{Firu1OUv#BbopJ diff --git a/tests/data/acpi/x86/pc/DSDT.nohpet b/tests/data/acpi/x86/pc/DSDT.nohpet index 9d6040733f57f243056ee8f7601af84dd3cf2fa2..b081030f0ed171e52b13e28cfdc8770a04c2806e 100644 GIT binary patch delta 76 zcmV-S0JHz%LBK%@L{mgmz#sqs0W+}*D+~!wK3`KpUt5AmlRgYy0VtE53?Kpk1CzuI iC<0A0lkN;Q21o`&Q&d5dunjH(0AQ1G4I8tP4Nwz7&=p4j delta 125 zcmX@$_{fpVCDP99Eo$M|5U_~<6z$!B=t7S?YsTctF?l_&shRoY7=0Fyh5%<(CDu1FqxnWIc1ccuyZB(I_~<5&$x@PWj2e?GB^8($m?tlg)L`;8 go_tEujLn11IXJ{|a*vcA6GOseUn%L$c~aqQ02K=qHUIzs delta 108 zcmZ4Nc+`>0CDAX8JH%| zmegSKGM#)>(u~QKWAa}~Q!(?&G5RbZ4FS%c1_42?!Cn7P1y_@g_{(C?mQ# IQOb!80A}|c$^ZZW diff --git a/tests/data/acpi/x86/q35/DSDT.acpierst b/tests/data/acpi/x86/q35/DSDT.acpierst index f91cbe55fcfeea319babf7c9a0c6a6ccdc3320d1..46fd25400b7c00ee9149ddb64cb5d5bd73f6a82b 100644 GIT binary patch delta 76 zcmccSxW$pnCD2b8v{`AX8JH%| zmegSKGM#)>(u~QKWAa}~Q!(?&G5RbZ4FS%c1_42?!Cn7P1y_@g_{(C?mQ# IQ7V`X09c|Ot^fc4 diff --git a/tests/data/acpi/x86/q35/DSDT.acpihmat b/tests/data/acpi/x86/q35/DSDT.acpihmat index 0949fb9d67c70dc882e50501ece421114ad8080b..61c5bd52a42242e85090934e8e45bf01642609d6 100644 GIT binary patch delta 96 zcmez5eZiZ{CD*F7d%m@zG5llcgl%7&RtWN-8ihFi&0}slnu9 zIr)^NBa;W)WL_y#DXGaZ`Ya%|0nVNV0YR?8&H=7|j0If$36mXVL^tAX8JH%| zmegSKw4Qua(vj1Z!#Oy_kuzF(vZ9ReL{mgmx*-4n0ll#b2N?-QP+wC*Ut5AmlNuRb0VtDs86W}x1CyW` iC;~)9lgb%c21o`&Q&d5duNp1_0AQ1F8XL2b8cPRMBNdqd delta 125 zcmdnxe8-u~CDAX8JH%| zmegSKGM#)>(u~QKWAa}~Q!(?&G5RbZ4FS%c1_42?!Cn7P1y_@g_{(C?mQ# IQL2Cq0GY8KasU7T diff --git a/tests/data/acpi/x86/q35/DSDT.bridge b/tests/data/acpi/x86/q35/DSDT.bridge index 3464f552974672bde25eb15f1c93c309c57ef5cb..d9938dba8fa5d405f7696c0dbdc24f3ae42ec934 100644 GIT binary patch delta 76 zcmaD9dmxs}CDQ`zV&nCD4FZB(gTYEC8%jyDEo3d=;!T*mQATug IqEx&H0I`T3t^fc4 diff --git a/tests/data/acpi/x86/q35/DSDT.core-count b/tests/data/acpi/x86/q35/DSDT.core-count index 08f5d5f54bcb61235b98fc85bb814046dd038c13..a24b04cbdbf09383b933a42a2a15182545543a87 100644 GIT binary patch delta 71 zcmV-N0J#5?W$|PRL{mgmaWVh^0k5$N2N?>DTLE8FLSI{gNRt~GUI8eRdKn-B00Wbu d87KmZP_xS!vjPH029tmsHIvL78nf&irxpI;78U>i delta 110 zcmeyEGC7sYCD>Gcqtu zo+GKj)E>0?nB-%qo diff --git a/tests/data/acpi/x86/q35/DSDT.core-count2 b/tests/data/acpi/x86/q35/DSDT.core-count2 index d29a7108f82110ce9f9b4e006501215d41c5420a..3a0cb8c581c8cc630a2ec21712b7f8b75fcad1c8 100644 GIT binary patch delta 100 zcmeC_V0zWg#N`s~67s5llNU;A zFg0gvJ}nu~!{os>Sx3!ON@{Y9J_|^3fU~DTK#*&&bAYQKV*wX`!sJ8^(ames;$s1w CTO4Nq delta 126 zcmaFW&eYSv#N`s~62jBMz`*FVk&9iDtD}@HKG-Qfy2*F4v}7Ek?&K;-1$O6vpkPJ@ zrpa?8HJBQ*HXoCW=izkaa1IV}>&YlJVL9W4I aos*;0q}dj-7I5(zZ%vD0Bsc$ delta 108 zcmezDGS!vKCDQ!(?&G5RbZ4FS%c1_42?!CAX8JH%| zmegSKGM#)>(u~QKWAa}~Q!(?&G5RbZ4FS%c1_42?!Cn7P1y_@g_{(C?mQ# IQR=4z0JAtBNdN!< diff --git a/tests/data/acpi/x86/q35/DSDT.dimmpxm b/tests/data/acpi/x86/q35/DSDT.dimmpxm index 1db0bf454a203006f866e6752d06422ae675cbd3..228374b55bd544116e359f659e546fc66cf8a895 100644 GIT binary patch delta 91 zcmdn(H`9;HCDNE4v?QlTKzy)Md~}n?WIf3^Mvck6k_t==%#*iBYB0IE tPQE7@$>hN{*;2|>QfhLHJ_|@~fU~DTK#*&&bAYQKV*wZc<|R_oc>rS!7_9&R delta 132 zcmbQ~x7&})CDAX8JH%o zm(*Z#cAtDxGLp@e!#Oy_aq>bbJxhj!1?H1u^jSdq0-QY!0)kwF!8#U5VG6tYF&1#~ QCoE(w;NsofBsHA}0HD?-HUIzs diff --git a/tests/data/acpi/x86/q35/DSDT.ipmibt b/tests/data/acpi/x86/q35/DSDT.ipmibt index 25f43ae8efb55364a739e6b5e3cb4e71e61862b0..45f911ada5645f158f3d6c0c430ec1d52cadc5d8 100644 GIT binary patch delta 76 zcmbQ>^v;pXCD`WA;Wac1ccuyZB(I_~<5&$x@PWj2e?GB^8($m?tlg)L`;8 go_tEujLn11IXJ{|a*vcA6GOseUn%L$c~Xnm06Z5J7XSbN delta 108 zcmaFoIKhd_CDAX8JH%| zmegSKGM#)>(u~QKWAa}~Q!(?&G5RbZ4FS%c1_42?!Cn7P1y_@g_{(C?mQ# IQL2{>06xVXs{jB1 diff --git a/tests/data/acpi/x86/q35/DSDT.ipmismbus b/tests/data/acpi/x86/q35/DSDT.ipmismbus index 32bcd25bda9e9d2775790385f8da6a11e9d5cb46..e5d6811bee1233d74236453c49060390d74d4416 100644 GIT binary patch delta 76 zcmV-S0JHy{Li<4qL{mgm`yc=S0o<_)2N?-ZK3`KpUt5AmlNuRb0VtDs86W}x1CyW` iC<0A0lgb%321o`&Q&d5dj2bQi0AQ0%8XL228m|Uoloh-H delta 108 zcmezEIM<2GCD02)FaPyhe` diff --git a/tests/data/acpi/x86/q35/DSDT.ivrs b/tests/data/acpi/x86/q35/DSDT.ivrs index f91cbe55fcfeea319babf7c9a0c6a6ccdc3320d1..46fd25400b7c00ee9149ddb64cb5d5bd73f6a82b 100644 GIT binary patch delta 76 zcmccSxW$pnCD2b8v{`AX8JH%| zmegSKGM#)>(u~QKWAa}~Q!(?&G5RbZ4FS%c1_42?!Cn7P1y_@g_{(C?mQ# IQ7V`X09c|Ot^fc4 diff --git a/tests/data/acpi/x86/q35/DSDT.memhp b/tests/data/acpi/x86/q35/DSDT.memhp index be90eb71d8dda8fe54c79ffffe103986ee06ae3a..5ce081187a578ba7145a9ba20d30be36c13b7663 100644 GIT binary patch delta 76 zcmbQ@^U0gbCD50iyCkQ(V|=hvd~}oVWGTrwM%~Gkk_zn30YSlx3`~<} zOKLDVm`y$^X~yKrG5N2gshIiX7=0Fyh5%66_M9ugbu{sJ)SkU6Rw?F+SKSKDxTqweHNNd4FZB(gTYEC8%jyDEo3d=;!T*mQATug IqLjHL0EhJ+B>(^b diff --git a/tests/data/acpi/x86/q35/DSDT.noacpihp b/tests/data/acpi/x86/q35/DSDT.noacpihp index 45cc2bcffa42d73db110afd5075556dcfe5d9936..8bc16887e1c963c61aaecf71712a09c0554f6d67 100644 GIT binary patch delta 75 zcmX@>u-bvkCDNGPy72LuH(GB8c{ zlh9!DGM!u@VaDXjF?oZ8shRoY7=0Fyh5%nCDoVSr39y=V|=hvd~}oVAX8JH&X zN@_59nNBvBG-Gn*n4B+ZYGyt;MxO2b8v{`Bc1ccm$M|5U_~<6z$x@PWjJlI6B^B761A>AX8JH%| zmegQ!Fq?c-(u~QKWAa}~Q!(?&G5RbZ4FS%c1_42?!Cn7P1y_@g_{(C?mQ# IQObi207+UMdH?_b diff --git a/tests/data/acpi/x86/q35/DSDT.pvpanic-isa b/tests/data/acpi/x86/q35/DSDT.pvpanic-isa index 7a8e568315a43f1fa98068d8e78995c98064fb91..6ad42873e91c80cef5a42224cb4d31936dad59b4 100644 GIT binary patch delta 76 zcmZ4G)ZxVC66_Mfp~%3%_;Mo`yCkQ-U3{=pd~}n?WGTrwMvcjpk_t==%##;LYB2d4 gPd+7S#^%B1930{}xkpNmi6LRKuaxxWJgGfw010Fie*gdg delta 108 zcmeBhTIIy$66_M9rO3d*Xtj}xU6Rw$F+SKSKDxTqweHNNdUP0Qtck6951J diff --git a/tests/data/acpi/x86/q35/DSDT.thread-count b/tests/data/acpi/x86/q35/DSDT.thread-count index 08f5d5f54bcb61235b98fc85bb814046dd038c13..a24b04cbdbf09383b933a42a2a15182545543a87 100644 GIT binary patch delta 71 zcmV-N0J#5?W$|PRL{mgmaWVh^0k5$N2N?>DTLE8FLSI{gNRt~GUI8eRdKn-B00Wbu d87KmZP_xS!vjPH029tmsHIvL78nf&irxpI;78U>i delta 110 zcmeyEGC7sYCD>Gcqtu zo+GKj)E>0?nB-%qo diff --git a/tests/data/acpi/x86/q35/DSDT.thread-count2 b/tests/data/acpi/x86/q35/DSDT.thread-count2 index d29a7108f82110ce9f9b4e006501215d41c5420a..3a0cb8c581c8cc630a2ec21712b7f8b75fcad1c8 100644 GIT binary patch delta 100 zcmeC_V0zWg#N`s~67s5llNU;A zFg0gvJ}nu~!{os>Sx3!ON@{Y9J_|^3fU~DTK#*&&bAYQKV*wX`!sJ8^(ames;$s1w CTO4Nq delta 126 zcmaFW&eYSv#N`s~62jBMz`*FVk&9iDtD}@HKG-Qfy2*F4v}7Ek?&K;-1$O6vpkPJ@ zrpa?8HJBQ*HXoCW=izkaa1IV}>&YlJVL9W4I aos*;0q}dj-7I5(TqsHV)Nd+bb=E(~rHJE&j gC!dluWAk8h4i0gg+#{vO#E>xAS4w(wp43(j0Oqn2?EnA( delta 108 zcmZp4TkOW=66_M9tjxf`xML$1yCkQhV|=hvd~}oVWGTrwM%~Gkk_zn30YSlx3`~<} zOKLEAnNB_`X~yKrG5N2gshIiX7=0Fyh5%0PFk|4*&oF delta 108 zcmbR3w%3izCD*k8bjqEG-$ws4=-pQh|wqdGbO@ z4W_oun@>xgW@Yzaa}Ex1 J&CCjWGytMf9?Ad! delta 135 zcmbO`k#YY-MlP3NmyrD)3=E928@bpexw;Q9#RogZM>qLSmX?fT)SX-} zgQ@@F=F^g=dD%VKoP$FgIVU%2h)=fC5R+j@SRgeyMxO1bj(qsVVzaPi| delta 135 zcmZph&a`4W6PHV{OUR0D1_nm`ja=-KTrKa};)9*yqnmsuOH0Nv>Q1hbRA6@w2nuFo zV46HfQiG}I@#bTar+L|2Ih=z-94Be$Su!LnFrOTw&jQjH;OuD-5ab#R*0DeeQ`psy Tv4D#|VIgY)7w_hW>PwRWojNEz diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index 512d40665d..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,42 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/x86/pc/DSDT", -"tests/data/acpi/x86/pc/DSDT.acpierst", -"tests/data/acpi/x86/pc/DSDT.acpihmat", -"tests/data/acpi/x86/pc/DSDT.bridge", -"tests/data/acpi/x86/pc/DSDT.cphp", -"tests/data/acpi/x86/pc/DSDT.dimmpxm", -"tests/data/acpi/x86/pc/DSDT.hpbridge", -"tests/data/acpi/x86/pc/DSDT.hpbrroot", -"tests/data/acpi/x86/pc/DSDT.ipmikcs", -"tests/data/acpi/x86/pc/DSDT.memhp", -"tests/data/acpi/x86/pc/DSDT.nohpet", -"tests/data/acpi/x86/pc/DSDT.numamem", -"tests/data/acpi/x86/pc/DSDT.roothp", -"tests/data/acpi/x86/q35/DSDT", -"tests/data/acpi/x86/q35/DSDT.acpierst", -"tests/data/acpi/x86/q35/DSDT.acpihmat", -"tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator", -"tests/data/acpi/x86/q35/DSDT.applesmc", -"tests/data/acpi/x86/q35/DSDT.bridge", -"tests/data/acpi/x86/q35/DSDT.core-count", -"tests/data/acpi/x86/q35/DSDT.core-count2", -"tests/data/acpi/x86/q35/DSDT.cphp", -"tests/data/acpi/x86/q35/DSDT.cxl", -"tests/data/acpi/x86/q35/DSDT.dimmpxm", -"tests/data/acpi/x86/q35/DSDT.ipmibt", -"tests/data/acpi/x86/q35/DSDT.ipmismbus", -"tests/data/acpi/x86/q35/DSDT.ivrs", -"tests/data/acpi/x86/q35/DSDT.memhp", -"tests/data/acpi/x86/q35/DSDT.mmio64", -"tests/data/acpi/x86/q35/DSDT.multi-bridge", -"tests/data/acpi/x86/q35/DSDT.noacpihp", -"tests/data/acpi/x86/q35/DSDT.nohpet", -"tests/data/acpi/x86/q35/DSDT.numamem", -"tests/data/acpi/x86/q35/DSDT.pvpanic-isa", -"tests/data/acpi/x86/q35/DSDT.thread-count", -"tests/data/acpi/x86/q35/DSDT.thread-count2", -"tests/data/acpi/x86/q35/DSDT.tis.tpm12", -"tests/data/acpi/x86/q35/DSDT.tis.tpm2", -"tests/data/acpi/x86/q35/DSDT.type4-count", -"tests/data/acpi/x86/q35/DSDT.viot", -"tests/data/acpi/x86/q35/DSDT.xapic", From c5e36a5a6adbab7f6dc17d3bcb7b06660995cdc3 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Fri, 8 Nov 2024 17:58:14 +0000 Subject: [PATCH 06/13] hw/cxl: Check for zero length features in cmd_features_set_feature() Zero length data for features doesn't make any sense so exclude that case early. This fixes the undefined behavior reported by coverity for a zero length memcpy(). Resolves CID 1564900 and 1564901 Reported-by: Peter Maydell Signed-off-by: Jonathan Cameron Message-Id: <20241108175814.1248278-1-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/cxl/cxl-mailbox-utils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/cxl/cxl-mailbox-utils.c b/hw/cxl/cxl-mailbox-utils.c index 2d4d62c454..ce9aa18364 100644 --- a/hw/cxl/cxl-mailbox-utils.c +++ b/hw/cxl/cxl-mailbox-utils.c @@ -1288,6 +1288,10 @@ static CXLRetCode cmd_features_set_feature(const struct cxl_cmd *cmd, set_feat_info->data_offset = hdr->offset; bytes_to_copy = len_in - sizeof(CXLSetFeatureInHeader); + if (bytes_to_copy == 0) { + return CXL_MBOX_INVALID_PAYLOAD_LENGTH; + } + if (qemu_uuid_is_equal(&hdr->uuid, &patrol_scrub_uuid)) { if (hdr->version != CXL_MEMDEV_PS_SET_FEATURE_VERSION) { return CXL_MBOX_UNSUPPORTED; From e069c115e00d9eeb1ad6bf224775585c3d30177d Mon Sep 17 00:00:00 2001 From: Vladimir Sementsov-Ogievskiy Date: Fri, 8 Nov 2024 10:19:57 +0300 Subject: [PATCH 07/13] qapi: fix device-sync-config since-version Actually it comes in 9.2, not 9.1. Fixes: 3f98408e2e ("qapi: introduce device-sync-config") Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20241108071957.727286-1-vsementsov@yandex-team.ru> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- qapi/qdev.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/qdev.json b/qapi/qdev.json index 2a581129c9..25cbcf977b 100644 --- a/qapi/qdev.json +++ b/qapi/qdev.json @@ -182,7 +182,7 @@ # # @unstable: The command is experimental. # -# Since: 9.1 +# Since: 9.2 ## { 'command': 'device-sync-config', 'features': [ 'unstable' ], From 13a4a6ba2bfd3cf9bd34a015929d93868d792de8 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Thu, 7 Nov 2024 12:34:42 +0000 Subject: [PATCH 08/13] hw/acpi: Fix size of HID in build_append_srat_acpi_device_handle() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The size should always be 8 so hard code that. By coincidience the incorrect use of sizeof(char *) is 8 on 64 bit hosts, but was caught by CI testing with i686 as the host. Reported-by: Michael S. Tsirkin Closes: https://lore.kernel.org/qemu-devel/20241104110025-mutt-send-email-mst@kernel.org/ Signed-off-by: Jonathan Cameron Message-Id: <20241107123446.902801-2-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Daniel P. Berrangé --- hw/acpi/aml-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 6a76626177..72282b173e 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -1960,7 +1960,7 @@ static void build_append_srat_acpi_device_handle(GArray *table_data, { assert(strlen(hid) == 8); /* Device Handle - ACPI */ - for (int i = 0; i < sizeof(hid); i++) { + for (int i = 0; i < 8; i++) { build_append_int_noprefix(table_data, hid[i], 1); } build_append_int_noprefix(table_data, uid, 4); From 37a14f24b4ee696def42d7629598ab6da7399f65 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Thu, 7 Nov 2024 12:34:43 +0000 Subject: [PATCH 09/13] qapi/qom: Change Since entry for AcpiGenericPortProperties to 9.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This feature was only applied during the 9.2 cycle, so reflect that rather than 9.1. Reported-by: Daniel P. Berrangé Closes: https://lore.kernel.org/qemu-devel/ZyngEiwmYeZ-DvCy@redhat.com/ Signed-off-by: Jonathan Cameron Message-Id: <20241107123446.902801-3-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Daniel P. Berrangé --- qapi/qom.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/qom.json b/qapi/qom.json index a8beeabf1f..28ce24cd8d 100644 --- a/qapi/qom.json +++ b/qapi/qom.json @@ -877,7 +877,7 @@ # complex as there may be interleaving across multiple devices # and shared links in the path. # -# Since: 9.1 +# Since: 9.2 ## { 'struct': 'AcpiGenericPortProperties', 'data': { 'pci-bus': 'str', From 2cb740932c567b57f6f51c9ead036a1d31d3e620 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Thu, 7 Nov 2024 12:34:44 +0000 Subject: [PATCH 10/13] bios-tables-test: Allow for new acpihmat-generic-x test data. The test to be added exercises many corner cases of the SRAT and HMAT table generation. Signed-off-by: Jonathan Cameron Message-Id: <20241107123446.902801-4-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/data/acpi/x86/q35/APIC.acpihmat-generic-x | 0 tests/data/acpi/x86/q35/CEDT.acpihmat-generic-x | 0 tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x | 0 tests/data/acpi/x86/q35/HMAT.acpihmat-generic-x | 0 tests/data/acpi/x86/q35/SRAT.acpihmat-generic-x | 0 tests/qtest/bios-tables-test-allowed-diff.h | 5 +++++ 6 files changed, 5 insertions(+) create mode 100644 tests/data/acpi/x86/q35/APIC.acpihmat-generic-x create mode 100644 tests/data/acpi/x86/q35/CEDT.acpihmat-generic-x create mode 100644 tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x create mode 100644 tests/data/acpi/x86/q35/HMAT.acpihmat-generic-x create mode 100644 tests/data/acpi/x86/q35/SRAT.acpihmat-generic-x diff --git a/tests/data/acpi/x86/q35/APIC.acpihmat-generic-x b/tests/data/acpi/x86/q35/APIC.acpihmat-generic-x new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/data/acpi/x86/q35/CEDT.acpihmat-generic-x b/tests/data/acpi/x86/q35/CEDT.acpihmat-generic-x new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x b/tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/data/acpi/x86/q35/HMAT.acpihmat-generic-x b/tests/data/acpi/x86/q35/HMAT.acpihmat-generic-x new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/data/acpi/x86/q35/SRAT.acpihmat-generic-x b/tests/data/acpi/x86/q35/SRAT.acpihmat-generic-x new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..3c0967078f 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,6 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/x86/q35/APIC.acpihmat-generic-x", +"tests/data/acpi/x86/q35/CEDT.acpihmat-generic-x", +"tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x", +"tests/data/acpi/x86/q35/HMAT.acpihmat-generic-x", +"tests/data/acpi/x86/q35/SRAT.acpihmat-generic-x", From 18afed7402038b772dc9e9250181bcaddda864ab Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Thu, 7 Nov 2024 12:34:45 +0000 Subject: [PATCH 11/13] bios-tables-test: Add complex SRAT / HMAT test for GI GP Add a test with 6 nodes to exercise most interesting corner cases of SRAT and HMAT generation including the new Generic Initiator and Generic Port Affinity structures. More details of the set up in the following patch adding the table data. Signed-off-by: Jonathan Cameron Message-Id: <20241107123446.902801-5-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test.c | 97 ++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index e79f3a03df..16d0ffbdf6 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1936,6 +1936,101 @@ static void test_acpi_q35_tcg_acpi_hmat_noinitiator(void) free_test_data(&data); } +/* Test intended to hit corner cases of SRAT and HMAT */ +static void test_acpi_q35_tcg_acpi_hmat_generic_x(void) +{ + test_data data = {}; + + data.machine = MACHINE_Q35; + data.arch = "x86"; + data.variant = ".acpihmat-generic-x"; + test_acpi_one(" -machine hmat=on,cxl=on" + " -smp 3,sockets=3" + " -m 128M,maxmem=384M,slots=2" + " -device pcie-root-port,chassis=1,id=pci.1" + " -device pci-testdev,bus=pci.1," + "multifunction=on,addr=00.0" + " -device pci-testdev,bus=pci.1,addr=00.1" + " -device pci-testdev,bus=pci.1,id=gidev,addr=00.2" + " -device pxb-cxl,bus_nr=64,bus=pcie.0,id=cxl.1" + " -object memory-backend-ram,size=64M,id=ram0" + " -object memory-backend-ram,size=64M,id=ram1" + " -numa node,nodeid=0,cpus=0,memdev=ram0" + " -numa node,nodeid=1" + " -object acpi-generic-initiator,id=gi0,pci-dev=gidev,node=1" + " -numa node,nodeid=2" + " -object acpi-generic-port,id=gp0,pci-bus=cxl.1,node=2" + " -numa node,nodeid=3,cpus=1" + " -numa node,nodeid=4,memdev=ram1" + " -numa node,nodeid=5,cpus=2" + " -numa hmat-lb,initiator=0,target=0,hierarchy=memory," + "data-type=access-latency,latency=10" + " -numa hmat-lb,initiator=0,target=0,hierarchy=memory," + "data-type=access-bandwidth,bandwidth=800M" + " -numa hmat-lb,initiator=0,target=2,hierarchy=memory," + "data-type=access-latency,latency=100" + " -numa hmat-lb,initiator=0,target=2,hierarchy=memory," + "data-type=access-bandwidth,bandwidth=200M" + " -numa hmat-lb,initiator=0,target=4,hierarchy=memory," + "data-type=access-latency,latency=100" + " -numa hmat-lb,initiator=0,target=4,hierarchy=memory," + "data-type=access-bandwidth,bandwidth=200M" + " -numa hmat-lb,initiator=0,target=5,hierarchy=memory," + "data-type=access-latency,latency=200" + " -numa hmat-lb,initiator=0,target=5,hierarchy=memory," + "data-type=access-bandwidth,bandwidth=400M" + " -numa hmat-lb,initiator=1,target=0,hierarchy=memory," + "data-type=access-latency,latency=500" + " -numa hmat-lb,initiator=1,target=0,hierarchy=memory," + "data-type=access-bandwidth,bandwidth=100M" + " -numa hmat-lb,initiator=1,target=2,hierarchy=memory," + "data-type=access-latency,latency=50" + " -numa hmat-lb,initiator=1,target=2,hierarchy=memory," + "data-type=access-bandwidth,bandwidth=400M" + " -numa hmat-lb,initiator=1,target=4,hierarchy=memory," + "data-type=access-latency,latency=50" + " -numa hmat-lb,initiator=1,target=4,hierarchy=memory," + "data-type=access-bandwidth,bandwidth=800M" + " -numa hmat-lb,initiator=1,target=5,hierarchy=memory," + "data-type=access-latency,latency=500" + " -numa hmat-lb,initiator=1,target=5,hierarchy=memory," + "data-type=access-bandwidth,bandwidth=100M" + " -numa hmat-lb,initiator=3,target=0,hierarchy=memory," + "data-type=access-latency,latency=20" + " -numa hmat-lb,initiator=3,target=0,hierarchy=memory," + "data-type=access-bandwidth,bandwidth=400M" + " -numa hmat-lb,initiator=3,target=2,hierarchy=memory," + "data-type=access-latency,latency=80" + " -numa hmat-lb,initiator=3,target=2,hierarchy=memory," + "data-type=access-bandwidth,bandwidth=200M" + " -numa hmat-lb,initiator=3,target=4,hierarchy=memory," + "data-type=access-latency,latency=80" + " -numa hmat-lb,initiator=3,target=4,hierarchy=memory," + "data-type=access-bandwidth,bandwidth=200M" + " -numa hmat-lb,initiator=3,target=5,hierarchy=memory," + "data-type=access-latency,latency=20" + " -numa hmat-lb,initiator=3,target=5,hierarchy=memory," + "data-type=access-bandwidth,bandwidth=400M" + " -numa hmat-lb,initiator=5,target=0,hierarchy=memory," + "data-type=access-latency,latency=20" + " -numa hmat-lb,initiator=5,target=0,hierarchy=memory," + "data-type=access-bandwidth,bandwidth=400M" + " -numa hmat-lb,initiator=5,target=2,hierarchy=memory," + "data-type=access-latency,latency=80" + " -numa hmat-lb,initiator=5,target=4,hierarchy=memory," + "data-type=access-bandwidth,bandwidth=200M" + " -numa hmat-lb,initiator=5,target=4,hierarchy=memory," + "data-type=access-latency,latency=80" + " -numa hmat-lb,initiator=5,target=2,hierarchy=memory," + "data-type=access-bandwidth,bandwidth=200M" + " -numa hmat-lb,initiator=5,target=5,hierarchy=memory," + "data-type=access-latency,latency=10" + " -numa hmat-lb,initiator=5,target=5,hierarchy=memory," + "data-type=access-bandwidth,bandwidth=800M", + &data); + free_test_data(&data); +} + #ifdef CONFIG_POSIX static void test_acpi_erst(const char *machine, const char *arch) { @@ -2414,6 +2509,8 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/q35/nohpet", test_acpi_q35_tcg_nohpet); qtest_add_func("acpi/q35/acpihmat-noinitiator", test_acpi_q35_tcg_acpi_hmat_noinitiator); + qtest_add_func("acpi/q35/acpihmat-genericx", + test_acpi_q35_tcg_acpi_hmat_generic_x); /* i386 does not support memory hotplug */ if (strcmp(arch, "i386")) { From 5d525294626ebdc2741c19167217ec79a6c2cc08 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Thu, 7 Nov 2024 12:34:46 +0000 Subject: [PATCH 12/13] bios-tables-test: Add data for complex numa test (GI, GP etc) Given this is a new configuration, there are affects on APIC, CEDT and DSDT, but the key elements are in SRAT (plus related data in HMAT). The configuration has node to exercise many different combinations. 0) CPUs + Memory 1) GI only 2) GP only 3) CPUS only 4) Memory only 5) CPUs + HP memory GI node, GP Node, Memory only node, hotplug memory only node, latency and bandwidth such that in Linux Access0 (any initiator) and Access1 (CPU initiators only) given different answers. Following cropped to remove details of each entry. [000h 0000 004h] Signature : "SRAT" [System Resource Affinity Table] ... [030h 0048 001h] Subtable Type : 00 [Processor Local APIC/SAPIC Affinity] ... [032h 0050 001h] Proximity Domain Low(8) : 00 [033h 0051 001h] Apic ID : 00 ... [040h 0064 001h] Subtable Type : 00 [Processor Local APIC/SAPIC Affinity] ... [042h 0066 001h] Proximity Domain Low(8) : 03 [043h 0067 001h] Apic ID : 01 ... [050h 0080 001h] Subtable Type : 00 [Processor Local APIC/SAPIC Affinity] ... [052h 0082 001h] Proximity Domain Low(8) : 05 [053h 0083 001h] Apic ID : 02 ... [060h 0096 001h] Subtable Type : 01 [Memory Affinity] ... [062h 0098 004h] Proximity Domain : 00000000 ... [068h 0104 008h] Base Address : 0000000000000000 [070h 0112 008h] Address Length : 00000000000A0000 ... [088h 0136 001h] Subtable Type : 01 [Memory Affinity] ... [08Ah 0138 004h] Proximity Domain : 00000000 ... [090h 0144 008h] Base Address : 0000000000100000 [098h 0152 008h] Address Length : 0000000003F00000 ... [0B0h 0176 001h] Subtable Type : 01 [Memory Affinity] ... [0B2h 0178 004h] Proximity Domain : 00000004 ... [0B8h 0184 008h] Base Address : 0000000004000000 [0C0h 0192 008h] Address Length : 0000000004000000 ... some zero length entries follow... [1A0h 0416 001h] Subtable Type : 05 [Generic Initiator Affinity] [1A1h 0417 001h] Length : 20 [1A2h 0418 001h] Reserved1 : 00 [1A3h 0419 001h] Device Handle Type : 01 [1A4h 0420 004h] Proximity Domain : 00000001 [1A8h 0424 010h] Device Handle : 00 00 01 02 00 00 00 00 00 00 00 00 00 00 00 00 [1B8h 0440 004h] Flags (decoded below) : 00000001 Enabled : 1 Architectural Transactions : 0 [1BCh 0444 004h] Reserved2 : 00000000 [1C0h 0448 001h] Subtable Type : 06 [Generic Port Affinity] [1C1h 0449 001h] Length : 20 [1C2h 0450 001h] Reserved1 : 00 [1C3h 0451 001h] Device Handle Type : 00 [1C4h 0452 004h] Proximity Domain : 00000002 [1C8h 0456 010h] Device Handle : 41 43 50 49 30 30 31 36 40 00 00 00 00 00 00 00 [1D8h 0472 004h] Flags (decoded below) : 00000001 Enabled : 1 Architectural Transactions : 0 [1DCh 0476 004h] Reserved2 : 00000000 [1E0h 0480 001h] Subtable Type : 01 [Memory Affinity] ... [1E2h 0482 004h] Proximity Domain : 00000005 ... [1E8h 0488 008h] Base Address : 0000000100000000 [1F0h 0496 008h] Address Length : 0000000090000000 Example block from HMAT: [0F0h 0240 002h] Structure Type : 0001 [System Locality Latency and Bandwidth Information] [0F2h 0242 002h] Reserved : 0000 [0F4h 0244 004h] Length : 00000078 [0F8h 0248 001h] Flags (decoded below) : 00 Memory Hierarchy : 0 Use Minimum Transfer Size : 0 Non-sequential Transfers : 0 [0F9h 0249 001h] Data Type : 03 [0FAh 0250 001h] Minimum Transfer Size : 00 [0FBh 0251 001h] Reserved1 : 00 [0FCh 0252 004h] Initiator Proximity Domains # : 00000004 [100h 0256 004h] Target Proximity Domains # : 00000006 [104h 0260 004h] Reserved2 : 00000000 [108h 0264 008h] Entry Base Unit : 0000000000000004 [110h 0272 004h] Initiator Proximity Domain List : 00000000 [114h 0276 004h] Initiator Proximity Domain List : 00000001 [118h 0280 004h] Initiator Proximity Domain List : 00000003 [11Ch 0284 004h] Initiator Proximity Domain List : 00000005 [120h 0288 004h] Target Proximity Domain List : 00000000 [124h 0292 004h] Target Proximity Domain List : 00000001 [128h 0296 004h] Target Proximity Domain List : 00000002 [12Ch 0300 004h] Target Proximity Domain List : 00000003 [130h 0304 004h] Target Proximity Domain List : 00000004 [134h 0308 004h] Target Proximity Domain List : 00000005 [138h 0312 002h] Entry : 00C8 [13Ah 0314 002h] Entry : 0000 [13Ch 0316 002h] Entry : 0032 [13Eh 0318 002h] Entry : 0000 [140h 0320 002h] Entry : 0032 [142h 0322 002h] Entry : 0064 [144h 0324 002h] Entry : 0019 [146h 0326 002h] Entry : 0000 [148h 0328 002h] Entry : 0064 [14Ah 0330 002h] Entry : 0000 [14Ch 0332 002h] Entry : 00C8 [14Eh 0334 002h] Entry : 0019 [150h 0336 002h] Entry : 0064 [152h 0338 002h] Entry : 0000 [154h 0340 002h] Entry : 0032 [156h 0342 002h] Entry : 0000 [158h 0344 002h] Entry : 0032 [15Ah 0346 002h] Entry : 0064 [15Ch 0348 002h] Entry : 0064 [15Eh 0350 002h] Entry : 0000 [160h 0352 002h] Entry : 0032 [162h 0354 002h] Entry : 0000 [164h 0356 002h] Entry : 0032 [166h 0358 002h] Entry : 00C8 Note the zeros represent entries where the target node has no memory. These could be surpressed but it isn't 'wrong' to provide them and it is (probably) permissible under ACPI to hotplug memory into these nodes later. Signed-off-by: Jonathan Cameron Message-Id: <20241107123446.902801-6-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/data/acpi/x86/q35/APIC.acpihmat-generic-x | Bin 0 -> 136 bytes tests/data/acpi/x86/q35/CEDT.acpihmat-generic-x | Bin 0 -> 68 bytes tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x | Bin 0 -> 12565 bytes tests/data/acpi/x86/q35/HMAT.acpihmat-generic-x | Bin 0 -> 360 bytes tests/data/acpi/x86/q35/SRAT.acpihmat-generic-x | Bin 0 -> 520 bytes tests/qtest/bios-tables-test-allowed-diff.h | 5 ----- 6 files changed, 5 deletions(-) diff --git a/tests/data/acpi/x86/q35/APIC.acpihmat-generic-x b/tests/data/acpi/x86/q35/APIC.acpihmat-generic-x index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..317ddb3fbed94e4f49a87976fdc7f23b1a6c3fdc 100644 GIT binary patch literal 136 zcmZ<^@O18AU|?WQaPoKd2v%^42yj*a0!E-1hz+6{7#{os(;N&85Soz@LNhUeXht58 ongjnpBoh}9gBTzdD=U!Z1+h3eVJt470*DwlH<-o3_8({j09efo0RR91 literal 0 HcmV?d00001 diff --git a/tests/data/acpi/x86/q35/CEDT.acpihmat-generic-x b/tests/data/acpi/x86/q35/CEDT.acpihmat-generic-x index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..31c9011663639b4a0f4816f3b2b06398f94682f7 100644 GIT binary patch literal 68 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 literal 0 HcmV?d00001 diff --git a/tests/data/acpi/x86/q35/HMAT.acpihmat-generic-x b/tests/data/acpi/x86/q35/HMAT.acpihmat-generic-x index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0e5765f6ee4c07638c70647ae145e968718b67cd 100644 GIT binary patch literal 360 zcmeb9bqvX1WME+Ock*}k2v%^42yj*a0-z8Bhz+7)Km*7?=EKC%X^=V)XaHgs5CaPU znNtB32dQC$vIW$k3?Kzk!wkf%P$3YX2`UEC0}=;`ae=W2gAr7W703dq;{anOBsL>h pJ=k8L!N~R^yOS7uPXNsZ*=NL%!XOExQ-JsckOiV);t2K$1^{D&4*>uG literal 0 HcmV?d00001 diff --git a/tests/data/acpi/x86/q35/SRAT.acpihmat-generic-x b/tests/data/acpi/x86/q35/SRAT.acpihmat-generic-x index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b45838adb7d304f8a36c38c90d89f3629ec48353 100644 GIT binary patch literal 520 zcmWFzatz^MVqjn_cJg=j2v%^42yj*a0!9V~1`r!WgD@Njp!1m-QRP{gkok-naGg*F z7hC|lI-mt$@PQeo5LF!uOc=(1(J1c3v=^ogl^*QsSQQwc;mZh&B?N$l37Y}~14zQr eIl$Avz|hPAsstv_sKE*qfydhfm;gM0fdT+OoeTj0 literal 0 HcmV?d00001 diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index 3c0967078f..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,6 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/x86/q35/APIC.acpihmat-generic-x", -"tests/data/acpi/x86/q35/CEDT.acpihmat-generic-x", -"tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x", -"tests/data/acpi/x86/q35/HMAT.acpihmat-generic-x", -"tests/data/acpi/x86/q35/SRAT.acpihmat-generic-x", From 571bdc97b83646dfd3746ec56fb2f70bca55b9a2 Mon Sep 17 00:00:00 2001 From: Prasad Pandit Date: Thu, 7 Nov 2024 17:02:47 +0530 Subject: [PATCH 13/13] vhost: fail device start if iotlb update fails While starting a vhost device, updating iotlb entries via 'vhost_device_iotlb_miss' may return an error. qemu-kvm: vhost_device_iotlb_miss: 700871,700871: Fail to update device iotlb Fail device start when such an error occurs. Signed-off-by: Prasad Pandit Message-Id: <20241107113247.46532-1-ppandit@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefano Garzarella --- hw/virtio/vhost.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 76f9b2aaad..c40f48ac4d 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -2095,11 +2095,22 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice *vdev, bool vrings) * vhost-kernel code requires for this.*/ for (i = 0; i < hdev->nvqs; ++i) { struct vhost_virtqueue *vq = hdev->vqs + i; - vhost_device_iotlb_miss(hdev, vq->used_phys, true); + r = vhost_device_iotlb_miss(hdev, vq->used_phys, true); + if (r) { + goto fail_iotlb; + } } } vhost_start_config_intr(hdev); return 0; +fail_iotlb: + if (vhost_dev_has_iommu(hdev) && + hdev->vhost_ops->vhost_set_iotlb_callback) { + hdev->vhost_ops->vhost_set_iotlb_callback(hdev, false); + } + if (hdev->vhost_ops->vhost_dev_start) { + hdev->vhost_ops->vhost_dev_start(hdev, false); + } fail_start: if (vrings) { vhost_dev_set_vring_enable(hdev, false);