From patchwork Thu Oct 31 20:04:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 13858334 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A7B58D767FA for ; Thu, 31 Oct 2024 20:07:43 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6bQv-00076q-4Y; Thu, 31 Oct 2024 16:06:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6bQq-000764-Sb; Thu, 31 Oct 2024 16:06:12 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6bQo-0007TM-Si; Thu, 31 Oct 2024 16:06:12 -0400 Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4XfZhs6PBpz6JBf6; Fri, 1 Nov 2024 04:04:45 +0800 (CST) Received: from frapeml500007.china.huawei.com (unknown [7.182.85.172]) by mail.maildlp.com (Postfix) with ESMTPS id B2E181400D3; Fri, 1 Nov 2024 04:06:07 +0800 (CST) Received: from 00293818-MRGF.huawei.com (10.48.152.207) by frapeml500007.china.huawei.com (7.182.85.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 31 Oct 2024 21:05:48 +0100 To: , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH V2 1/6] hw/acpi: Introduce `is_enabled` state in ACPI CPU Hotplug Status Date: Thu, 31 Oct 2024 20:04:57 +0000 Message-ID: <20241031200502.3869-2-salil.mehta@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241031200502.3869-1-salil.mehta@huawei.com> References: <20241031200502.3869-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.48.152.207] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To frapeml500007.china.huawei.com (7.182.85.172) Received-SPF: pass client-ip=185.176.79.56; envelope-from=salil.mehta@huawei.com; helo=frasgout.his.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Salil Mehta X-Patchwork-Original-From: Salil Mehta via From: Salil Mehta Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On most architectures, during vCPU hot-plug and hot-unplug actions, firmware or the VMM/QEMU can convey vCPU status to the OS by toggling the ACPI method `_STA.Present` Bit. However, certain CPU architecture specifications prohibit [1] modifications to CPU's `presence` after the kernel has booted. This limitation [2][3] arises because many per-CPU components, such as interrupt controllers that are closely integrated with CPUs, or other per-CPU features, may not support reconfiguration once the kernel is initialized. These components often cannot be powered down as they might belong to an `always-on` power domain. Consequently, specifications require all CPUs to remain `_STA.Present` after system initialization. To address this issue from an ACPI perspective, an `is_enabled` state has been introduced in the `AcpiCpuStatus`. This state reflects whether a vCPU has been hot-plugged or hot-unplugged in QEMU, thus indicating its availability to the guest kernel. The guest can evaluate this status by calling the ACPI `_STA` method and checking the `_STA.Enabled` bit after QEMU signals the hot-plug event via GED. References: [1] Check comment 5 in the bugzilla entry Link: https://bugzilla.tianocore.org/show_bug.cgi?id=4481#c5 [2] KVMForum 2023 Presentation: Challenges Revisited in Supporting Virt CPU Hotplug on architectures that don’t Support CPU Hotplug (like ARM64) a. Kernel Link: https://kvm-forum.qemu.org/2023/KVM-forum-cpu-hotplug_7OJ1YyJ.pdf b. Qemu Link: https://kvm-forum.qemu.org/2023/Challenges_Revisited_in_Supporting_Virt_CPU_Hotplug_-__ii0iNb3.pdf [3] KVMForum 2020 Presentation: Challenges in Supporting Virtual CPU Hotplug on SoC Based Systems (like ARM64) Link: https://kvmforum2020.sched.com/event/eE4m Signed-off-by: Salil Mehta Reviewed-by: Gustavo Romero --- hw/acpi/cpu.c | 9 ++++++++- include/hw/acpi/cpu.h | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index 5cb60ca8bc..238a0edbc1 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -225,7 +225,14 @@ void cpu_hotplug_hw_init(MemoryRegion *as, Object *owner, state->dev_count = id_list->len; state->devs = g_new0(typeof(*state->devs), state->dev_count); for (i = 0; i < id_list->len; i++) { - state->devs[i].cpu = CPU(id_list->cpus[i].cpu); + struct CPUState *cpu = CPU(id_list->cpus[i].cpu); + + state->devs[i].cpu = cpu; + if (cpu && DEVICE(cpu)->realized) { + state->devs[i].is_enabled = true; + } else { + state->devs[i].is_enabled = false; + } state->devs[i].arch_id = id_list->cpus[i].arch_id; } memory_region_init_io(&state->ctrl_reg, owner, &cpu_hotplug_ops, state, diff --git a/include/hw/acpi/cpu.h b/include/hw/acpi/cpu.h index 32654dc274..ff49caa501 100644 --- a/include/hw/acpi/cpu.h +++ b/include/hw/acpi/cpu.h @@ -26,6 +26,7 @@ typedef struct AcpiCpuStatus { uint64_t arch_id; bool is_inserting; bool is_removing; + bool is_enabled; bool fw_remove; uint32_t ost_event; uint32_t ost_status; @@ -74,5 +75,4 @@ extern const VMStateDescription vmstate_cpu_hotplug; #define VMSTATE_CPU_HOTPLUG(cpuhp, state) \ VMSTATE_STRUCT(cpuhp, state, 1, \ vmstate_cpu_hotplug, CPUHotplugState) - #endif From patchwork Thu Oct 31 20:04:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 13858332 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 115D3D767FB for ; Thu, 31 Oct 2024 20:07:26 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6bRD-00078K-Dl; Thu, 31 Oct 2024 16:06:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6bR8-00077p-RF; Thu, 31 Oct 2024 16:06:31 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6bR7-0007Uy-BJ; Thu, 31 Oct 2024 16:06:30 -0400 Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4XfZjF54Ynz6JBc6; Fri, 1 Nov 2024 04:05:05 +0800 (CST) Received: from frapeml500007.china.huawei.com (unknown [7.182.85.172]) by mail.maildlp.com (Postfix) with ESMTPS id 8617D140B35; Fri, 1 Nov 2024 04:06:27 +0800 (CST) Received: from 00293818-MRGF.huawei.com (10.48.152.207) by frapeml500007.china.huawei.com (7.182.85.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 31 Oct 2024 21:06:08 +0100 To: , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH V2 2/6] hw/acpi: Update ACPI CPU Hotplug state during vCPU hot(un)plug Date: Thu, 31 Oct 2024 20:04:58 +0000 Message-ID: <20241031200502.3869-3-salil.mehta@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241031200502.3869-1-salil.mehta@huawei.com> References: <20241031200502.3869-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.48.152.207] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To frapeml500007.china.huawei.com (7.182.85.172) Received-SPF: pass client-ip=185.176.79.56; envelope-from=salil.mehta@huawei.com; helo=frasgout.his.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Salil Mehta X-Patchwork-Original-From: Salil Mehta via From: Salil Mehta Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Update the `is_enabled` state in `AcpiCpuStatus` when vCPUs are hot-plugged or hot-unplugged. Signed-off-by: Salil Mehta Reviewed-by: Gustavo Romero --- hw/acpi/cpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index 238a0edbc1..8940687f90 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -265,6 +265,7 @@ void acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, } cdev->cpu = CPU(dev); + cdev->is_enabled = true; if (dev->hotplugged) { cdev->is_inserting = true; acpi_send_event(DEVICE(hotplug_dev), ACPI_CPU_HOTPLUG_STATUS); @@ -296,6 +297,7 @@ void acpi_cpu_unplug_cb(CPUHotplugState *cpu_st, return; } + cdev->is_enabled = false; cdev->cpu = NULL; } From patchwork Thu Oct 31 20:04:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 13858331 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D0319D767FC for ; Thu, 31 Oct 2024 20:07:27 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6bRU-0007Rv-38; Thu, 31 Oct 2024 16:06:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6bRT-0007Qd-18; Thu, 31 Oct 2024 16:06:51 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6bRR-0007WL-BQ; Thu, 31 Oct 2024 16:06:50 -0400 Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4XfZdZ2mSnz6LDK5; Fri, 1 Nov 2024 04:01:54 +0800 (CST) Received: from frapeml500007.china.huawei.com (unknown [7.182.85.172]) by mail.maildlp.com (Postfix) with ESMTPS id 63E2414058E; Fri, 1 Nov 2024 04:06:47 +0800 (CST) Received: from 00293818-MRGF.huawei.com (10.48.152.207) by frapeml500007.china.huawei.com (7.182.85.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 31 Oct 2024 21:06:27 +0100 To: , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH V2 3/6] qtest: allow ACPI DSDT Table changes Date: Thu, 31 Oct 2024 20:04:59 +0000 Message-ID: <20241031200502.3869-4-salil.mehta@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241031200502.3869-1-salil.mehta@huawei.com> References: <20241031200502.3869-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.48.152.207] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To frapeml500007.china.huawei.com (7.182.85.172) Received-SPF: pass client-ip=185.176.79.56; envelope-from=salil.mehta@huawei.com; helo=frasgout.his.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Salil Mehta X-Patchwork-Original-From: Salil Mehta via From: Salil Mehta Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org list changed files in tests/qtest/bios-tables-test-allowed-diff.h Reported-by: Zhao Liu Signed-off-by: Salil Mehta --- 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 patchwork Thu Oct 31 20:05:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 13858333 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8714DD767FA for ; Thu, 31 Oct 2024 20:07:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6bRp-00080d-QD; Thu, 31 Oct 2024 16:07:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6bRm-0007rw-RZ; Thu, 31 Oct 2024 16:07:10 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6bRl-0007Xg-3u; Thu, 31 Oct 2024 16:07:10 -0400 Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4XfZdy1Y0Wz6LDJl; Fri, 1 Nov 2024 04:02:14 +0800 (CST) Received: from frapeml500007.china.huawei.com (unknown [7.182.85.172]) by mail.maildlp.com (Postfix) with ESMTPS id 39E5B14058E; Fri, 1 Nov 2024 04:07:07 +0800 (CST) Received: from 00293818-MRGF.huawei.com (10.48.152.207) by frapeml500007.china.huawei.com (7.182.85.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 31 Oct 2024 21:06:47 +0100 To: , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH V2 4/6] hw/acpi: Update CPUs AML's `is_enabled` state in ACPI _STA method Date: Thu, 31 Oct 2024 20:05:00 +0000 Message-ID: <20241031200502.3869-5-salil.mehta@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241031200502.3869-1-salil.mehta@huawei.com> References: <20241031200502.3869-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.48.152.207] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To frapeml500007.china.huawei.com (7.182.85.172) Received-SPF: pass client-ip=185.176.79.56; envelope-from=salil.mehta@huawei.com; helo=frasgout.his.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Salil Mehta X-Patchwork-Original-From: Salil Mehta via From: Salil Mehta Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Update the CPUs AML code to reflect the ACPI CPU Hotplug `is_enabled` state in the `_STA.Enabled` Bit when the ACPI `_STA` method is evaluated by the Guest Kernel during initialization, as well as when vCPUs are hot-plugged or hot-unplugged. Signed-off-by: Salil Mehta Reviewed-by: Gustavo Romero --- hw/acpi/cpu.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index 8940687f90..017b847815 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -63,7 +63,7 @@ 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 |= cdev->cpu ? 1 : 0; + val |= cdev->is_enabled ? 1 : 0; val |= cdev->is_inserting ? 2 : 0; val |= cdev->is_removing ? 4 : 0; val |= cdev->fw_remove ? 16 : 0; @@ -463,15 +463,23 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts, { Aml *idx = aml_arg(0); Aml *sta = aml_local(0); + 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_enabled, one)); { + /* cpu is present and enabled */ aml_append(ifctx, aml_store(aml_int(0xF), sta)); } aml_append(method, ifctx); + else_ctx = aml_else(); + { + /* cpu is present but disabled */ + aml_append(else_ctx, aml_store(aml_int(0xD), sta)); + } + aml_append(method, else_ctx); aml_append(method, aml_release(ctrl_lock)); aml_append(method, aml_return(sta)); } From patchwork Thu Oct 31 20:05:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 13858343 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EED9BD767FA for ; Thu, 31 Oct 2024 20:08:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6bSS-0000zv-A2; Thu, 31 Oct 2024 16:07:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6bSJ-0000hY-EN; Thu, 31 Oct 2024 16:07:45 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6bSG-0007aG-F5; Thu, 31 Oct 2024 16:07:43 -0400 Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4XfZkP2wQbz6JBfK; Fri, 1 Nov 2024 04:06:05 +0800 (CST) Received: from frapeml500007.china.huawei.com (unknown [7.182.85.172]) by mail.maildlp.com (Postfix) with ESMTPS id 3ACC51400D3; Fri, 1 Nov 2024 04:07:27 +0800 (CST) Received: from 00293818-MRGF.huawei.com (10.48.152.207) by frapeml500007.china.huawei.com (7.182.85.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 31 Oct 2024 21:07:07 +0100 To: , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH V2 5/6] tests/qtest/bios-tables-test: Update DSDT golden masters for x86/{pc, q35} Date: Thu, 31 Oct 2024 20:05:01 +0000 Message-ID: <20241031200502.3869-6-salil.mehta@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241031200502.3869-1-salil.mehta@huawei.com> References: <20241031200502.3869-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.48.152.207] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To frapeml500007.china.huawei.com (7.182.85.172) Received-SPF: pass client-ip=185.176.79.56; envelope-from=salil.mehta@huawei.com; helo=frasgout.his.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Salil Mehta X-Patchwork-Original-From: Salil Mehta via From: Salil Mehta Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Update DSDT golden master files for x86/pc and x86/q35 platforms to accommodate changes made in the architecture-agnostic CPU AML. These updates notify the guest OS of vCPU hot-plug and hot-unplug status using the ACPI `_STA.Enabled` bit. The following is a diff of the changes in the .dsl file generated with IASL: * Disassembling to symbolic ASL+ operators * - * Disassembly of tests/data/acpi/x86/pc/DSDT, Wed Oct 30 11:24:52 2024 + * Disassembly of /tmp/aml-2A3EW2, Wed Oct 30 11:24:52 2024 * * Original Table Header: * Signature "DSDT" - * Length 0x0000214F (8527) + * Length 0x00002155 (8533) * Revision 0x01 **** 32-bit table (V1), no 64-bit math support - * Checksum 0x59 + * Checksum 0xD2 * OEM ID "BOCHS " * OEM Table ID "BXPC " * OEM Revision 0x00000001 (1) @@ -1517,6 +1517,10 @@ If ((\_SB.PCI0.PRES.CPEN == One)) { Local0 = 0x0F + } + Else + { + Local0 = 0x0D } Release (\_SB.PCI0.PRES.CPLK) Reported-by: Zhao Liu Signed-off-by: Salil Mehta --- tests/data/acpi/x86/pc/DSDT | Bin 8527 -> 8533 bytes tests/data/acpi/x86/pc/DSDT.acpierst | Bin 8438 -> 8444 bytes tests/data/acpi/x86/pc/DSDT.acpihmat | Bin 9852 -> 9858 bytes tests/data/acpi/x86/pc/DSDT.bridge | Bin 15398 -> 15404 bytes tests/data/acpi/x86/pc/DSDT.cphp | Bin 8991 -> 8997 bytes tests/data/acpi/x86/pc/DSDT.dimmpxm | Bin 10181 -> 10187 bytes tests/data/acpi/x86/pc/DSDT.hpbridge | Bin 8478 -> 8484 bytes tests/data/acpi/x86/pc/DSDT.hpbrroot | Bin 5034 -> 5040 bytes tests/data/acpi/x86/pc/DSDT.ipmikcs | Bin 8599 -> 8605 bytes tests/data/acpi/x86/pc/DSDT.memhp | Bin 9886 -> 9892 bytes tests/data/acpi/x86/pc/DSDT.nohpet | Bin 8385 -> 8391 bytes tests/data/acpi/x86/pc/DSDT.numamem | Bin 8533 -> 8539 bytes tests/data/acpi/x86/pc/DSDT.roothp | Bin 12320 -> 12326 bytes tests/data/acpi/x86/q35/DSDT | Bin 8355 -> 8361 bytes tests/data/acpi/x86/q35/DSDT.acpierst | Bin 8372 -> 8378 bytes tests/data/acpi/x86/q35/DSDT.acpihmat | Bin 9680 -> 9686 bytes .../acpi/x86/q35/DSDT.acpihmat-noinitiator | Bin 8634 -> 8640 bytes tests/data/acpi/x86/q35/DSDT.applesmc | Bin 8401 -> 8407 bytes tests/data/acpi/x86/q35/DSDT.bridge | Bin 11968 -> 11974 bytes tests/data/acpi/x86/q35/DSDT.core-count | Bin 12913 -> 12919 bytes tests/data/acpi/x86/q35/DSDT.core-count2 | Bin 33770 -> 33776 bytes tests/data/acpi/x86/q35/DSDT.cphp | Bin 8819 -> 8825 bytes tests/data/acpi/x86/q35/DSDT.cxl | Bin 13148 -> 13154 bytes tests/data/acpi/x86/q35/DSDT.dimmpxm | Bin 10009 -> 10015 bytes tests/data/acpi/x86/q35/DSDT.ipmibt | Bin 8430 -> 8436 bytes tests/data/acpi/x86/q35/DSDT.ipmismbus | Bin 8443 -> 8449 bytes tests/data/acpi/x86/q35/DSDT.ivrs | Bin 8372 -> 8378 bytes tests/data/acpi/x86/q35/DSDT.memhp | Bin 9714 -> 9720 bytes tests/data/acpi/x86/q35/DSDT.mmio64 | Bin 9485 -> 9491 bytes tests/data/acpi/x86/q35/DSDT.multi-bridge | Bin 13208 -> 13214 bytes tests/data/acpi/x86/q35/DSDT.noacpihp | Bin 8235 -> 8241 bytes tests/data/acpi/x86/q35/DSDT.nohpet | Bin 8213 -> 8219 bytes tests/data/acpi/x86/q35/DSDT.numamem | Bin 8361 -> 8367 bytes tests/data/acpi/x86/q35/DSDT.pvpanic-isa | Bin 8456 -> 8462 bytes tests/data/acpi/x86/q35/DSDT.thread-count | Bin 12913 -> 12919 bytes tests/data/acpi/x86/q35/DSDT.thread-count2 | Bin 33770 -> 33776 bytes tests/data/acpi/x86/q35/DSDT.tis.tpm12 | Bin 8961 -> 8967 bytes tests/data/acpi/x86/q35/DSDT.tis.tpm2 | Bin 8987 -> 8993 bytes tests/data/acpi/x86/q35/DSDT.type4-count | Bin 18589 -> 18595 bytes tests/data/acpi/x86/q35/DSDT.viot | Bin 14615 -> 14621 bytes tests/data/acpi/x86/q35/DSDT.xapic | Bin 35718 -> 35724 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 92225236e717b2e522a2ee00492fb0ded418dc7b..e9e1a1eba3c81b296804ea50f2a42c3841bff6ef 100644 GIT binary patch delta 50 zcmV-20L}l;Le)YFL{mgmRUrTX0n)Jwx(otEKa<7`umVFglXwj_0Zx;z4NwK41#k)t Iv;GZH6P#QR&;S4c delta 44 zcmV+{0Mq}~LeD}9L{mgmPayyR0a>vMx(otOK9j}_umVjplXwj_0Z5at4N$WM4p0*{ C5)Co{ diff --git a/tests/data/acpi/x86/pc/DSDT.acpierst b/tests/data/acpi/x86/pc/DSDT.acpierst index 25b39955059409b177870800949eaf937cd39005..7d0385b5f9e1f04e55cc190892ad26050a930122 100644 GIT binary patch delta 50 zcmV-20L}mQLHt1qL{mgm{2%}T0UNOjx(otEKa<7`umVFglXwj_0Zx;z4NwK41#k)t Iv;GbE60H&tu>b%7 delta 44 zcmV+{0Mq~cLH0okL{mgm_8T^Q)x5Q+c* delta 44 zcmV+{0Mq}1P5ev>L{mgmd?o+@0T!_ex(otNM3cr0umVgulXwk50Z5a&4N$WX4ssYW CtPNrS diff --git a/tests/data/acpi/x86/pc/DSDT.bridge b/tests/data/acpi/x86/pc/DSDT.bridge index 4cef454e379e1009141694e0f4036a2a701c80d7..5f91aafbefa0dd02d2cc18efbe146c9cd6c78063 100644 GIT binary patch delta 50 zcmV-20L}lVc&vB|L{mgmEIa@J0pPI;x(otEKa<7`umVFglXwj_0Zx;z4NwK41#k)t Iv;GYzE}&8m+yDRo delta 44 zcmV+{0Mq}hc&2y?L{mgmCOiND0cWuax(otOK9j}_umVjplXwj_0Z5at4N$WM4ks=+ CYz;mD diff --git a/tests/data/acpi/x86/pc/DSDT.cphp b/tests/data/acpi/x86/pc/DSDT.cphp index 1dc928333d7ae7e4df6bb51d850af5e1cb480158..26f4e272eb4146fffa8182e14d2ccd110860516b 100644 GIT binary patch delta 55 zcmV-70LcHJMx{myL{mgmB_jX;0XDG;x(otET$9EOumVF-lXwks0ZxjVL{mgm%O?N;0pzg?&I|!gli3Wh0ZfyN4O#(CljaRj1)&9S3JtS0 G4v-n5ED#g` delta 52 zcmV-40L%Z&PsL9PL{mgm#U}s&0g15+&I|!ali3Wh0Y;OH4O$0C218R+K?#!~5G|7# K4jr>R4v!hafDfkt diff --git a/tests/data/acpi/x86/pc/DSDT.hpbridge b/tests/data/acpi/x86/pc/DSDT.hpbridge index db420593a3c51eced25cd57420353fbb9ccdf63c..0606ddd2016530cc91834ef41860f94655a35a43 100644 GIT binary patch delta 50 zcmV-20L}lNLZm_pL{mgmBq0C*0S2)Ox(otEKa<7`umVFglXwj_0Zx;z4NwK41#k)t Iv;GYr6J)OrKmY&$ delta 44 zcmV+{0Mq}ZLY_hjL{mgm9w7h#0gbT=x(otOK9j}_umVjplXwj_0Z5at4N$WM4j&UE CpA4b^ diff --git a/tests/data/acpi/x86/pc/DSDT.hpbrroot b/tests/data/acpi/x86/pc/DSDT.hpbrroot index 31b6adb4eb941e5bf0c02ec8c3819c9213adf022..545b4019468d928df92e7f3c458280a387914140 100644 GIT binary patch delta 59 zcmV-B0L1^QC$J|9L{mgmuoD0P0rs&9Z3_ZLKa+V2umVFglPe5122KV;Q&d5d&1)&9S3JtUV G4WJl%{STJ_ delta 42 zcmV+_0M-AbO`c5(L{mgmo+bbQ0ZXw8x(oqDlf?|N0Yj5_4L1Quldla>vjq;H7#Z*k A`2YX_ diff --git a/tests/data/acpi/x86/pc/DSDT.nohpet b/tests/data/acpi/x86/pc/DSDT.nohpet index dd29f5cb620e5164601e303e37524530ddb12684..8e738e4ed34e90741b2af11bae2927ab23b9716f 100644 GIT binary patch delta 50 zcmV-20L}lwLB~M~L{mgm#~=Uz0i3Z4EDQogKa)5NumVFglj;mM0Zx-44NwK41#k)t Ivv3Vj6MnM}CIA2c delta 44 zcmV+{0Mq}+LBT-^L{mgm!5{zt0VA;rEDQoqK9e{MumVjplj;mM0Z5Y}4N$Xp4Nwyz C4h)9? diff --git a/tests/data/acpi/x86/pc/DSDT.numamem b/tests/data/acpi/x86/pc/DSDT.numamem index 8a6b56fe7da18bf42c339d13b863aabf81780527..78bc2ca8b1b6fa9a01182550dd9d80fe27035ddb 100644 GIT binary patch delta 48 zcmV-00MGx`Lfb+LL{mgmTOj}d0ba2Rx(oqJlf?|N0ZEg04L1Q!ldla>1)&9S3JtUV G4ObI(HxCN{ delta 42 zcmV+_0M-B7Le)YFL{mgmRUrTX0RyoLx(oqDlf?|N0Yj5_4L1Quldla>vjq-T6BV8e AZ2$lO diff --git a/tests/data/acpi/x86/pc/DSDT.roothp b/tests/data/acpi/x86/pc/DSDT.roothp index a16b0d9d4becec47fa3cf57ed0077ff6cff88908..f8164f4fb224b1accd45431baee9fa002c4f5cc7 100644 GIT binary patch delta 50 zcmV-20L}lPV5VRSL{mgmCNKa10ba2Rx(otEKa<7`umVFglXwj_0Zx;z4NwK41#k)t Iv;GYtB7e{h`Tzg` delta 44 zcmV+{0Mq}bV4z?ML{mgmATR&`0p+m@x(otOK9j}_umVjplXwj_0Z5at4N$WM4k02s C$_-oq diff --git a/tests/data/acpi/x86/q35/DSDT b/tests/data/acpi/x86/q35/DSDT index fb89ae0ac6d4346e33156e9e4d3718698a0a1a8e..de0b8b2511d0ddc72babf40cc4ce4f206c9306c3 100644 GIT binary patch delta 55 zcmV-70LcHNL8(CsL{mgmsUQFV0kE+O2N?oIKa&#~umVFglf@Y}0Zx*Tg0oSn#2N?oSK9ds}umVjplf@Y}0Z5bl8BnuQ8fXSF C> diff --git a/tests/data/acpi/x86/q35/DSDT.acpihmat b/tests/data/acpi/x86/q35/DSDT.acpihmat index 61c5bd52a42242e85090934e8e45bf01642609d6..3afe828b29962abf2f97bc5cdb04416994570bcf 100644 GIT binary patch delta 71 zcmV-N0J#6qOV&#YL{mgm)+GP{0d27g2N?oHMUxX5umVCllf@Z92~Gw>Q&d3-TO*Sp d921j^8W@v08XX3q1#k)tV3Qvl6|-y_WDDBY6G#96 delta 44 zcmV+{0Mq~0OVCRSL{mgm&?Nu>0ras72N?oRM3WO4umVgulf@Z90Z5Yv8c?%c8hHyq CcMWm? diff --git a/tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator b/tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator index 3aaa2bbdf54a0d0cade14421e84c6ec5a42f96fa..b804c531acb6e8900106dab687c8689bec69ef3d 100644 GIT binary patch delta 48 zcmV-00MGxrL%>4{L{mgmz##wt0T{6g2N?lOlM)%R0ZNm^8Cn5OlOGyT1)&9S3JtSv G8cYXG&J7Cy delta 42 zcmV+_0M-A%L%Kr>L{mgmx*-4n0ll#b2N?lIlM)%R0YsC;8Cn5IlOGyTvvnFv2NjkK AYybcN diff --git a/tests/data/acpi/x86/q35/DSDT.applesmc b/tests/data/acpi/x86/q35/DSDT.applesmc index 944209adeaa5bbb722431161c404cb51b8209993..02fdf5b3fd51f7ffb20305335d111b1278c1d645 100644 GIT binary patch delta 55 zcmV-70LcH*LDxYFL{mgm*B}4@0idx82N?oIKa&#~umVFglf@Y}0Zxycmv&I>-0s&5wdK^#&p#^XX O4PcWn9~HCT9Fi6PNfD_4 delta 45 zcmV+|0Mh^WWbtGQL{mgmaWVh^0k5$N2N?p5TayzRu>y)vv&I>-0s%;qdK^%*&>W`~ DX3-C_ diff --git a/tests/data/acpi/x86/q35/DSDT.core-count2 b/tests/data/acpi/x86/q35/DSDT.core-count2 index 3a0cb8c581c8cc630a2ec21712b7f8b75fcad1c8..2e3cc743567b8c166b2d4dc4ab421af931842418 100644 GIT binary patch delta 72 zcmV-O0Js0@hXU}20t!S^L{#vD00048u?hzn0gRIp8L|P1v&9);3<*vKLsL{i30otR eK`0ZGswNndStcC@p#^XX4PcW$C>67dCSP4Y85Q3E delta 45 zcmV+|0Mh^PhXU${0t!S^L{#d700032u?hzn0fv(j8L|O`v&9);3;{@!CMHm`d?s{V DRk03+ diff --git a/tests/data/acpi/x86/q35/DSDT.cphp b/tests/data/acpi/x86/q35/DSDT.cphp index 20955d0aa30120553da35d5a6640055d26255cf9..2cfc5a6669b09ca0bf8fda926a5c6e3848e819c1 100644 GIT binary patch delta 55 zcmV-70LcIIMEOJtL{mgmc_IJ+0Ti(c2N?oIT$2+SumVF-lf@Zw0Zx-R8c+tI1#k)t NV3SZB6|& P9R;BUa0(5xf*O|$)*}#C delta 58 zcmV-A0LA~GPMJ;$L{mgm87BY$0cNoZ8yNvelO`Fl0Y;P98CnTQ218R+K?z$UlkprA QlTI2nlTjQMvz{7(4AgrNjsO4v diff --git a/tests/data/acpi/x86/q35/DSDT.ipmibt b/tests/data/acpi/x86/q35/DSDT.ipmibt index 45f911ada5645f158f3d6c0c430ec1d52cadc5d8..875781741c0239bd70a6fc4013bc8f03ea6ced32 100644 GIT binary patch delta 55 zcmV-70LcIDLG(ciL{mgm^dJBL0pzg?2N?oIKa&#~umVFglf@Y}0Zx*Tg0oSn#2N?oSK9ds}umVjplf@Y}0Z5bl8BnuQ8fXSF C> diff --git a/tests/data/acpi/x86/q35/DSDT.memhp b/tests/data/acpi/x86/q35/DSDT.memhp index 5ce081187a578ba7145a9ba20d30be36c13b7663..2e90fba1e72c1ef94b9e8ddb5b5034fe7371e447 100644 GIT binary patch delta 53 zcmV-50LuUJOZZC)L{mgm_$2@U0fey%2N?lNlM)%R0ZEg@88-n=ll&P_2B8IT3JqYB Lu^bh%VH%MO*#Z#! delta 42 zcmV+_0M-BaOY%z!L{mgm@+ANO0V%Nx2N?lHlM)%R0Yj6-88-n)ll&P_vr-zS3ntSI AhX4Qo diff --git a/tests/data/acpi/x86/q35/DSDT.mmio64 b/tests/data/acpi/x86/q35/DSDT.mmio64 index bdf36c4d575bfc4eb2eac3f00c9b7b4270f88677..ebde2fed094fd0eecbbc83e8ccc12db3ff471b6a 100644 GIT binary patch delta 53 zcmV-50LuT3N|Q0m`uox)%aZK9j~5umVjplXw_50Z5at7*MkX87v1g CB@H8Bnvt8CM1Z C;0zW3 diff --git a/tests/data/acpi/x86/q35/DSDT.numamem b/tests/data/acpi/x86/q35/DSDT.numamem index ba6669437e65952f24516ded954b33fe54bdedfb..b97e22e837d05355d75d56fb93029cb1b08abf0d 100644 GIT binary patch delta 53 zcmV-50LuTVL9amyL{mgmuOI*b0X(q^2N?lNlM)%R0ZEg@88-n=ll&P_2B8IT3JqYB Lu^bh%VH!vVo@@_t delta 42 zcmV+_0M-AmL8(CsL{mgmsUQFV0pYO<2N?lHlM)%R0Yj6-88-n)ll&P_vr-ye1{Ki^ A{Qv*} diff --git a/tests/data/acpi/x86/q35/DSDT.pvpanic-isa b/tests/data/acpi/x86/q35/DSDT.pvpanic-isa index 6ad42873e91c80cef5a42224cb4d31936dad59b4..ac99bf0cee6ab2e2c20ddefb00330b105f524b24 100644 GIT binary patch delta 55 zcmV-70LcG{LXJWTL{mgm4j}*l0b;QV2N?oIKa&#~umVFglf@Y}0Zxycmv&I>-0s&5wdK^#&p#^XX O4PcWn9~HCT9Fi6PNfD_4 delta 45 zcmV+|0Mh^WWbtGQL{mgmaWVh^0k5$N2N?p5TayzRu>y)vv&I>-0s%;qdK^%*&>W`~ DX3-C_ diff --git a/tests/data/acpi/x86/q35/DSDT.thread-count2 b/tests/data/acpi/x86/q35/DSDT.thread-count2 index 3a0cb8c581c8cc630a2ec21712b7f8b75fcad1c8..2e3cc743567b8c166b2d4dc4ab421af931842418 100644 GIT binary patch delta 72 zcmV-O0Js0@hXU}20t!S^L{#vD00048u?hzn0gRIp8L|P1v&9);3<*vKLsL{i30otR eK`0ZGswNndStcC@p#^XX4PcW$C>67dCSP4Y85Q3E delta 45 zcmV+|0Mh^PhXU${0t!S^L{#d700032u?hzn0fv(j8L|O`v&9);3;{@!CMHm`d?s{V DRk03+ diff --git a/tests/data/acpi/x86/q35/DSDT.tis.tpm12 b/tests/data/acpi/x86/q35/DSDT.tis.tpm12 index e381ce4cbf2b11f56a2d0537db4d21acc97450c9..3305b0a67f4a672096a4c7e19d13e58e771c6c54 100644 GIT binary patch delta 55 zcmV-70LcG=Mu$cUL{mgm2O|Ig0pPI;2N?oIKa&#~umVFglf@Y}0Zx_l8L|R};bW delta 62 zcmV-E0Kxx^mjZ^D0t!S^L{x^00005)u?hzn0fLhf8L|S8;j_jW%MA%g218R+K?z$U UlTj)YldUH;ld&lkv;8NJV|@P=H~;_u 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 patchwork Thu Oct 31 20:05:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 13858344 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2DE03D767FB for ; Thu, 31 Oct 2024 20:08:07 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6bSe-00024A-Ka; Thu, 31 Oct 2024 16:08:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6bSc-0001xH-C0; Thu, 31 Oct 2024 16:08:02 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6bSa-0007bY-H4; Thu, 31 Oct 2024 16:08:02 -0400 Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4XfZfk0L2Mz6L6wx; Fri, 1 Nov 2024 04:02:54 +0800 (CST) Received: from frapeml500007.china.huawei.com (unknown [7.182.85.172]) by mail.maildlp.com (Postfix) with ESMTPS id 12727140A9C; Fri, 1 Nov 2024 04:07:47 +0800 (CST) Received: from 00293818-MRGF.huawei.com (10.48.152.207) by frapeml500007.china.huawei.com (7.182.85.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 31 Oct 2024 21:07:27 +0100 To: , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH V2 6/6] hw/acpi: Update GED with vCPU Hotplug VMSD for migration Date: Thu, 31 Oct 2024 20:05:02 +0000 Message-ID: <20241031200502.3869-7-salil.mehta@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241031200502.3869-1-salil.mehta@huawei.com> References: <20241031200502.3869-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.48.152.207] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To frapeml500007.china.huawei.com (7.182.85.172) Received-SPF: pass client-ip=185.176.79.56; envelope-from=salil.mehta@huawei.com; helo=frasgout.his.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Salil Mehta X-Patchwork-Original-From: Salil Mehta via From: Salil Mehta Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The ACPI CPU hotplug state `is_enabled` must be migrated along with other vCPU hotplug states to the destination VM. Update the GED's VM State Description (VMSD) table subsection to include the CPU Hotplug VM State Description (VMSD). Question: How to stop `is_enabled` state being migrated in case of x86? Excerpt of GED VMSD State Dump at Source: "acpi-ged (16)": { "ged_state": { "sel": "0x00000000" }, [...] "acpi-ged/cpuhp": { "cpuhp_state": { "selector": "0x00000005", "command": "0x00", "devs": [ { "is_inserting": false, "is_removing": false, "is_enabled": true, "ost_event": "0x00000000", "ost_status": "0x00000000" }, [...] { "is_inserting": false, "is_removing": false, "is_enabled": false, "ost_event": "0x00000000", "ost_status": "0x00000000" } ] } } }, Signed-off-by: Salil Mehta --- hw/acpi/cpu.c | 1 + hw/acpi/generic_event_device.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index 017b847815..514d671bfb 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -308,6 +308,7 @@ static const VMStateDescription vmstate_cpuhp_sts = { .fields = (const VMStateField[]) { VMSTATE_BOOL(is_inserting, AcpiCpuStatus), VMSTATE_BOOL(is_removing, AcpiCpuStatus), + VMSTATE_BOOL(is_enabled, AcpiCpuStatus), VMSTATE_UINT32(ost_event, AcpiCpuStatus), VMSTATE_UINT32(ost_status, AcpiCpuStatus), VMSTATE_END_OF_LIST() diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index d00f5a6c1c..663d9cb093 100644 --- a/hw/acpi/generic_event_device.c +++ b/hw/acpi/generic_event_device.c @@ -331,6 +331,24 @@ static const VMStateDescription vmstate_memhp_state = { } }; +static bool cpuhp_needed(void *opaque) +{ + MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine()); + + return mc->has_hotpluggable_cpus; +} + +static const VMStateDescription vmstate_cpuhp_state = { + .name = "acpi-ged/cpuhp", + .version_id = 1, + .minimum_version_id = 1, + .needed = cpuhp_needed, + .fields = (VMStateField[]) { + VMSTATE_CPU_HOTPLUG(cpuhp_state, AcpiGedState), + VMSTATE_END_OF_LIST() + } +}; + static const VMStateDescription vmstate_ged_state = { .name = "acpi-ged-state", .version_id = 1, @@ -379,6 +397,7 @@ static const VMStateDescription vmstate_acpi_ged = { }, .subsections = (const VMStateDescription * const []) { &vmstate_memhp_state, + &vmstate_cpuhp_state, &vmstate_ghes_state, NULL }