From patchwork Tue Nov 12 17:02:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 13872620 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 E3D0ED42BAF for ; Tue, 12 Nov 2024 17:08:31 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAuKf-0006eC-5l; Tue, 12 Nov 2024 12:05:37 -0500 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 1tAuIY-0003Uf-Bb for qemu-devel@nongnu.org; Tue, 12 Nov 2024 12:03:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAuIT-0001Z0-MS for qemu-devel@nongnu.org; Tue, 12 Nov 2024 12:03:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731430997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bYyCoABKXGGuyG9l7Gg9PZzugs/3n6FEjn8i2DmnPFg=; b=XnbCbt+sSO/YBVDXrTcJc04B+GmHzoXW4Xhph8ENXlc3DLRlMSD2hdDIqDrvqfMGOsP9oT jKjN4re5glf984JIIpr+awgs8gQC362djxhyUG8N66iO4yadZUEoFYhxfio3TBWnXJGcvp XuQvKROHH7vi+5vyho7ZvhSEUICveOc= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-179-aG95qGV0OFGAi8OA_6BTXQ-1; Tue, 12 Nov 2024 12:03:10 -0500 X-MC-Unique: aG95qGV0OFGAi8OA_6BTXQ-1 X-Mimecast-MFC-AGG-ID: aG95qGV0OFGAi8OA_6BTXQ Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 00CB2195609E; Tue, 12 Nov 2024 17:03:09 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5CBC61956086; Tue, 12 Nov 2024 17:03:06 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Cc: salil.mehta@huawei.com, mst@redhat.com, imammedo@redhat.com, jonathan.cameron@huawei.com, linuxarm@huawei.com, anisinha@redhat.com, karl.heubaum@oracle.com, miguel.luis@oracle.com, gustavo.romero@linaro.org Subject: [PATCH 1/7 for-9.2] qtest: allow ACPI DSDT Table changes Date: Tue, 12 Nov 2024 18:02:52 +0100 Message-ID: <20241112170258.2996640-2-imammedo@redhat.com> In-Reply-To: <20241112170258.2996640-1-imammedo@redhat.com> References: <20241112170258.2996640-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass client-ip=170.10.129.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.122, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.671, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Salil Mehta 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 --- 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 Tue Nov 12 17:02:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 13872618 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 88231D42BB3 for ; Tue, 12 Nov 2024 17:08:06 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAuKi-0006vU-LA; Tue, 12 Nov 2024 12:05:40 -0500 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 1tAuIa-0003Vc-6Y for qemu-devel@nongnu.org; Tue, 12 Nov 2024 12:03:30 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAuIW-0001ZP-Re for qemu-devel@nongnu.org; Tue, 12 Nov 2024 12:03:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731431003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j5hW+ko2CvgJ136Iuxuu+60x4pzVtirtMo/NDTCH6Ko=; b=NGXlCIHOYw4RZRXOkJcxPWW6/71sGk9OeDCOFv06jqmo/8goUiIdufSbhUWYPpgCOKCYyL rrDXh2ICfTcw6BuNTCsrk5L+S5NB3hi46OW4KH3v5att6l2vV3qkBdU5D9KihJacNXunGW ogSviZ1wdAfUUJWNyZnpebo5f+jyv1s= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-564-TX2hogeKP4ShvciahbDvyQ-1; Tue, 12 Nov 2024 12:03:13 -0500 X-MC-Unique: TX2hogeKP4ShvciahbDvyQ-1 X-Mimecast-MFC-AGG-ID: TX2hogeKP4ShvciahbDvyQ Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4238119560B0; Tue, 12 Nov 2024 17:03:12 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 924001956086; Tue, 12 Nov 2024 17:03:09 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Cc: salil.mehta@huawei.com, mst@redhat.com, imammedo@redhat.com, jonathan.cameron@huawei.com, linuxarm@huawei.com, anisinha@redhat.com, karl.heubaum@oracle.com, miguel.luis@oracle.com, gustavo.romero@linaro.org Subject: [PATCH 2/7 for-9.2] Revert "hw/acpi: Update ACPI `_STA` method with QOM vCPU ACPI Hotplug states" Date: Tue, 12 Nov 2024 18:02:53 +0100 Message-ID: <20241112170258.2996640-3-imammedo@redhat.com> In-Reply-To: <20241112170258.2996640-1-imammedo@redhat.com> References: <20241112170258.2996640-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass client-ip=170.10.133.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.122, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 --- include/hw/core/cpu.h | 1 - hw/acpi/cpu.c | 38 ++++---------------------------------- 2 files changed, 4 insertions(+), 35 deletions(-) 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); 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)); From patchwork Tue Nov 12 17:02:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 13872614 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 9EF29D42BAF for ; Tue, 12 Nov 2024 17:07:06 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAuKY-0005xX-JT; Tue, 12 Nov 2024 12:05:30 -0500 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 1tAuIY-0003Ug-BR for qemu-devel@nongnu.org; Tue, 12 Nov 2024 12:03:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAuIV-0001ZE-VE for qemu-devel@nongnu.org; Tue, 12 Nov 2024 12:03:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731431001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qVlo8MFDWWxPC+9r6AmKTmietuGa8U+YVrW6FdiP3KI=; b=XdZtoPxiL70DhieJBsN0MG3C/Y2DoAuCPtl0yLV/P9DYERPFjFyJ35q+/c5jY8Vw2rxaj2 FH3SRydiqdl854VhxzWYq0n9AmQrcyFcnsM7RbUswnTk8r6tgmanYR88984x8HHOgk1jmx wZEetBLM/vuyh+xslqGMU8Mr8fwYD3c= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-475-32GpZeY2MaGxldT5xkGTtg-1; Tue, 12 Nov 2024 12:03:19 -0500 X-MC-Unique: 32GpZeY2MaGxldT5xkGTtg-1 X-Mimecast-MFC-AGG-ID: 32GpZeY2MaGxldT5xkGTtg Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6CF821955EE7; Tue, 12 Nov 2024 17:03:15 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A6E65195607C; Tue, 12 Nov 2024 17:03:12 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Cc: salil.mehta@huawei.com, mst@redhat.com, imammedo@redhat.com, jonathan.cameron@huawei.com, linuxarm@huawei.com, anisinha@redhat.com, karl.heubaum@oracle.com, miguel.luis@oracle.com, gustavo.romero@linaro.org Subject: [PATCH 3/7 for-9.2] Revert "hw/acpi: Make CPUs ACPI `presence` conditional during vCPU hot-unplug" Date: Tue, 12 Nov 2024 18:02:54 +0100 Message-ID: <20241112170258.2996640-4-imammedo@redhat.com> In-Reply-To: <20241112170258.2996640-1-imammedo@redhat.com> References: <20241112170258.2996640-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass client-ip=170.10.129.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.122, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.671, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 --- include/hw/core/cpu.h | 1 - hw/acpi/cpu.c | 15 +-------------- 2 files changed, 1 insertion(+), 15 deletions(-) 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); 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 = { From patchwork Tue Nov 12 17:02:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 13872615 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 605EDD42BB3 for ; Tue, 12 Nov 2024 17:07:08 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAuKx-0007Ol-Tt; Tue, 12 Nov 2024 12:05:56 -0500 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 1tAuIf-0003gO-VX for qemu-devel@nongnu.org; Tue, 12 Nov 2024 12:03:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAuIb-0001aw-Nl for qemu-devel@nongnu.org; Tue, 12 Nov 2024 12:03:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731431008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q7Sw80feYdIpNPWhJFT98AEQYKPUwDpvCYX/S1i4AcA=; b=fMfFsvQNhoOiCe44d9E/+wG8LMQxLS98XvH+NM0vs+4umb6bN7xFNSxzvstchRGEDKUU9x Oj/0lViDcOMj9Q8EVQi8LiWnIlL3ozc9s0l4T5XUiwras4TLgo2TVpd3otgS15kUFxdmJM Pn169YMzOOGqUJmbJkNNRY9jDpdJFLg= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-96-b8dcXkPSP8eR-BgMdi7veQ-1; Tue, 12 Nov 2024 12:03:21 -0500 X-MC-Unique: b8dcXkPSP8eR-BgMdi7veQ-1 X-Mimecast-MFC-AGG-ID: b8dcXkPSP8eR-BgMdi7veQ Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9863119560B2; Tue, 12 Nov 2024 17:03:18 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B5F03195607C; Tue, 12 Nov 2024 17:03:15 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Cc: salil.mehta@huawei.com, mst@redhat.com, imammedo@redhat.com, jonathan.cameron@huawei.com, linuxarm@huawei.com, anisinha@redhat.com, karl.heubaum@oracle.com, miguel.luis@oracle.com, gustavo.romero@linaro.org Subject: [PATCH 4/7 for-9.2] tests/acpi: update expected blobs Date: Tue, 12 Nov 2024 18:02:55 +0100 Message-ID: <20241112170258.2996640-5-imammedo@redhat.com> In-Reply-To: <20241112170258.2996640-1-imammedo@redhat.com> References: <20241112170258.2996640-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass client-ip=170.10.133.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.122, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 --- tests/qtest/bios-tables-test-allowed-diff.h | 41 ------------------ 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 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 patchwork Tue Nov 12 17:02:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 13872610 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 4FC01D42BB3 for ; Tue, 12 Nov 2024 17:06:07 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAuKe-0006ZS-RW; Tue, 12 Nov 2024 12:05:36 -0500 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 1tAuIe-0003aJ-42 for qemu-devel@nongnu.org; Tue, 12 Nov 2024 12:03:32 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAuIa-0001aj-PH for qemu-devel@nongnu.org; Tue, 12 Nov 2024 12:03:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731431007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U+AxEZy2EKAfJ4HugDLM4SSnrhVh/F2CqwmRwaOYjnc=; b=YJr89xa2eqjy4LIjRgVYFrPxyBIMIE/1t9ZNplMYSfOXRBAaOBjjkFFWRh7ozgbq1hXoGB pExrtKpMULEMsrQeJv4DVc0VNIw8tXkIV8ggM55huxBC9qDRW0p8vUuLGIKaGvvbePm30u qtcM935BDi6PN09GFKDk9Dd8FpvR9bs= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-424-0RIq40jjMTSaMjpRU07xUA-1; Tue, 12 Nov 2024 12:03:24 -0500 X-MC-Unique: 0RIq40jjMTSaMjpRU07xUA-1 X-Mimecast-MFC-AGG-ID: 0RIq40jjMTSaMjpRU07xUA Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2F1F21955BFC; Tue, 12 Nov 2024 17:03:22 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 24CDA1956086; Tue, 12 Nov 2024 17:03:18 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Cc: salil.mehta@huawei.com, mst@redhat.com, imammedo@redhat.com, jonathan.cameron@huawei.com, linuxarm@huawei.com, anisinha@redhat.com, karl.heubaum@oracle.com, miguel.luis@oracle.com, gustavo.romero@linaro.org Subject: [RFC 5/7] DO NOT MERGE: acpi: cpuhp: add option to AML genrator to opt-in to always present vCPUs Date: Tue, 12 Nov 2024 18:02:56 +0100 Message-ID: <20241112170258.2996640-6-imammedo@redhat.com> In-Reply-To: <20241112170258.2996640-1-imammedo@redhat.com> References: <20241112170258.2996640-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass client-ip=170.10.133.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.122, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Looking at [1] what 'present' bit would do, it's no necessary as it's statically defined for VM instance. So instead of introducing new ABI in cpuhp flags register, add CPUHotplugFeatures::always_present_cpus config option, that when set change _STA default return value to always present but not enabled. And the interpose 'enabled' check on top of it, which would set 'enabled' bit in return value if vCPU is enabled. Platforms that need the feature can opt in by setting CPUHotplugFeatures::always_present_cpus = true for other plaforms _STA will revert to the behavior before [1] 1) bf1ecc8dad606 (w/acpi: Update ACPI `_STA` method with QOM vCPU ACPI Hotplug states) Signed-off-by: Igor Mammedov --- include/hw/acpi/cpu.h | 1 + hw/acpi/cpu.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/hw/acpi/cpu.h b/include/hw/acpi/cpu.h index 32654dc274..e9e9c28359 100644 --- a/include/hw/acpi/cpu.h +++ b/include/hw/acpi/cpu.h @@ -56,6 +56,7 @@ typedef struct CPUHotplugFeatures { bool acpi_1_compatible; bool has_legacy_cphp; bool fw_unplugs_cpu; + bool always_present_cpus; const char *smi_path; } CPUHotplugFeatures; diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index 5cb60ca8bc..67513450f9 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -452,15 +452,20 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts, method = aml_method(CPU_STS_METHOD, 1, AML_SERIALIZED); { + /* + * For always present CPUs set all bits except of 'enabled' + * ACPI 1.0b: chapter '6.3.5 _STA' + */ + uint8_t default_sta = opts.always_present_cpus ? 0xd : 0; Aml *idx = aml_arg(0); - Aml *sta = aml_local(0); + Aml *sta = aml_local(default_sta); 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)); { - aml_append(ifctx, aml_store(aml_int(0xF), sta)); + aml_append(ifctx, aml_or(aml_int(0xF), sta, sta)); } aml_append(method, ifctx); aml_append(method, aml_release(ctrl_lock)); From patchwork Tue Nov 12 17:02:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 13872619 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 21116D42BAF for ; Tue, 12 Nov 2024 17:08:16 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAuKm-00077H-Hb; Tue, 12 Nov 2024 12:05:47 -0500 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 1tAuIf-0003fF-I4 for qemu-devel@nongnu.org; Tue, 12 Nov 2024 12:03:33 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAuId-0001b7-Tl for qemu-devel@nongnu.org; Tue, 12 Nov 2024 12:03:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731431010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=azsMbEJLVwLj/lJ3E4CiHbyMN/j2xaFaI4UK3gAhKqY=; b=L1eR3sRDAuStsiLKmzCol6ZQV0i+mOruLEmIl1CmErdmQLbMf1i13cV3tgkh8WD+eRxkZd sega0hAQawDP5eky/op/6fTXnMoS1cTHx1L4aQJtfWuJlvoR9rnscRjL9lI843BlgvXMvQ kAMvURptT5xWJlOgY+efVlY+QmW0paM= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-185-QsGwEaroPOqit7oNn92OJw-1; Tue, 12 Nov 2024 12:03:26 -0500 X-MC-Unique: QsGwEaroPOqit7oNn92OJw-1 X-Mimecast-MFC-AGG-ID: QsGwEaroPOqit7oNn92OJw Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 551BB1956096; Tue, 12 Nov 2024 17:03:25 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B040F1956086; Tue, 12 Nov 2024 17:03:22 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Cc: salil.mehta@huawei.com, mst@redhat.com, imammedo@redhat.com, jonathan.cameron@huawei.com, linuxarm@huawei.com, anisinha@redhat.com, karl.heubaum@oracle.com, miguel.luis@oracle.com, gustavo.romero@linaro.org Subject: [RFC 6/7] DO NOT MERGE: acpi: cpuhp: use 'realized' status of vCPU to check if CPU is enabled Date: Tue, 12 Nov 2024 18:02:57 +0100 Message-ID: <20241112170258.2996640-7-imammedo@redhat.com> In-Reply-To: <20241112170258.2996640-1-imammedo@redhat.com> References: <20241112170258.2996640-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass client-ip=170.10.129.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.122, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.671, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org it still correct for x86 and other users, and can serve us as simpler to [1] cpu_enabled_status() callback that does the same in a roundabout way. It's still an RFC, and probably there we should add another property 'enabled' instead of abusing 'realized' and/or handle enabled state using hotplug handlers chain. i.e. in plug handler store enabled state AcpiCpuStatus and clear it in unplug handler instead of asking cpu from MMIO handler directly. 1) bf1ecc8dad606 (w/acpi: Update ACPI `_STA` method with QOM vCPU ACPI Hotplug states) Signed-off-by: Igor Mammedov --- hw/acpi/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index 67513450f9..992ae5d233 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -63,7 +63,9 @@ 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->cpu ? object_property_get_bool(OBJECT(cdev->cpu), + "realized", NULL) + : 0; val |= cdev->is_inserting ? 2 : 0; val |= cdev->is_removing ? 4 : 0; val |= cdev->fw_remove ? 16 : 0; From patchwork Tue Nov 12 17:02:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 13872613 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 4BADCD42BB5 for ; Tue, 12 Nov 2024 17:07:03 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAuL4-0007g4-Tw; Tue, 12 Nov 2024 12:06:02 -0500 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 1tAuIo-0003nq-B6 for qemu-devel@nongnu.org; Tue, 12 Nov 2024 12:03:44 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAuIk-0001cZ-FJ for qemu-devel@nongnu.org; Tue, 12 Nov 2024 12:03:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731431017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+2axKaCW1Z2fkq8aW+kN1R6He+CoS5FSvi1e/Yf1gaQ=; b=exQ121wkadvIn8E/tFVcbw8orkzF1m3Hf+xyMeLW8LxvBmYDHYtpTTryh59YqJg1ITmuUO s2CjZpOCaYe8FU/wj9JxhxpGOXhrqKRc2HZYv8376mlMHqvLdJ/Pw9Lf5gGpVcamopoHcT EIJ4mqdaIzzlos8r/p0T56qEhqzK1LI= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-204-B4s0NHw1MPekBbUsA14cpw-1; Tue, 12 Nov 2024 12:03:31 -0500 X-MC-Unique: B4s0NHw1MPekBbUsA14cpw-1 X-Mimecast-MFC-AGG-ID: B4s0NHw1MPekBbUsA14cpw Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D7DE51954230; Tue, 12 Nov 2024 17:03:28 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BCD4B1956089; Tue, 12 Nov 2024 17:03:25 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Cc: salil.mehta@huawei.com, mst@redhat.com, imammedo@redhat.com, jonathan.cameron@huawei.com, linuxarm@huawei.com, anisinha@redhat.com, karl.heubaum@oracle.com, miguel.luis@oracle.com, gustavo.romero@linaro.org Subject: [RFC 7/7] DO NOT MERGE: acpi: cpuhp: preserve always present vCPUs on unplug Date: Tue, 12 Nov 2024 18:02:58 +0100 Message-ID: <20241112170258.2996640-8-imammedo@redhat.com> In-Reply-To: <20241112170258.2996640-1-imammedo@redhat.com> References: <20241112170258.2996640-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass client-ip=170.10.133.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.122, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org do not drop reference to always present vCPU and also avoid destroying it (unparent) on unplug. Based-on: 2d6cfbaf174 (hw/acpi: Make CPUs ACPI `presence` conditional during vCPU hot-unplug) Signed-off-by: Igor Mammedov --- include/hw/acpi/cpu.h | 4 +++- hw/acpi/acpi-cpu-hotplug-stub.c | 3 ++- hw/acpi/cpu.c | 10 ++++++++-- hw/acpi/cpu_hotplug.c | 2 +- hw/acpi/generic_event_device.c | 2 +- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/include/hw/acpi/cpu.h b/include/hw/acpi/cpu.h index e9e9c28359..f6708cafba 100644 --- a/include/hw/acpi/cpu.h +++ b/include/hw/acpi/cpu.h @@ -36,6 +36,7 @@ typedef struct CPUHotplugState { uint32_t selector; uint8_t command; uint32_t dev_count; + bool always_present_cpus; AcpiCpuStatus *devs; } CPUHotplugState; @@ -50,7 +51,8 @@ void acpi_cpu_unplug_cb(CPUHotplugState *cpu_st, DeviceState *dev, Error **errp); void cpu_hotplug_hw_init(MemoryRegion *as, Object *owner, - CPUHotplugState *state, hwaddr base_addr); + CPUHotplugState *state, hwaddr base_addr, + bool always_present_cpus); typedef struct CPUHotplugFeatures { bool acpi_1_compatible; diff --git a/hw/acpi/acpi-cpu-hotplug-stub.c b/hw/acpi/acpi-cpu-hotplug-stub.c index c6c61bb9cd..748fd04006 100644 --- a/hw/acpi/acpi-cpu-hotplug-stub.c +++ b/hw/acpi/acpi-cpu-hotplug-stub.c @@ -20,7 +20,8 @@ void legacy_acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner, } void cpu_hotplug_hw_init(MemoryRegion *as, Object *owner, - CPUHotplugState *state, hwaddr base_addr) + CPUHotplugState *state, hwaddr base_addr, + bool always_present_cpus) { return; } diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index 992ae5d233..d85d4add60 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -145,7 +145,6 @@ static void cpu_hotplug_wr(void *opaque, hwaddr addr, uint64_t data, dev = DEVICE(cdev->cpu); hotplug_ctrl = qdev_get_hotplug_handler(dev); hotplug_handler_unplug(hotplug_ctrl, dev, NULL); - object_unparent(OBJECT(dev)); cdev->fw_remove = false; } else if (data & 16) { if (!cdev->cpu || cdev->cpu == first_cpu) { @@ -215,7 +214,8 @@ static const MemoryRegionOps cpu_hotplug_ops = { }; void cpu_hotplug_hw_init(MemoryRegion *as, Object *owner, - CPUHotplugState *state, hwaddr base_addr) + CPUHotplugState *state, hwaddr base_addr, + bool always_present_cpus) { MachineState *machine = MACHINE(qdev_get_machine()); MachineClass *mc = MACHINE_GET_CLASS(machine); @@ -226,6 +226,7 @@ void cpu_hotplug_hw_init(MemoryRegion *as, Object *owner, id_list = mc->possible_cpu_arch_ids(machine); state->dev_count = id_list->len; state->devs = g_new0(typeof(*state->devs), state->dev_count); + state->always_present_cpus = always_present_cpus; for (i = 0; i < id_list->len; i++) { state->devs[i].cpu = CPU(id_list->cpus[i].cpu); state->devs[i].arch_id = id_list->cpus[i].arch_id; @@ -286,12 +287,17 @@ void acpi_cpu_unplug_cb(CPUHotplugState *cpu_st, { AcpiCpuStatus *cdev; + if (cpu_st->always_present_cpus) { + return; + } + cdev = get_cpu_status(cpu_st, dev); if (!cdev) { return; } cdev->cpu = NULL; + object_unparent(OBJECT(dev)); } static const VMStateDescription vmstate_cpuhp_sts = { diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c index 83b8bc5deb..8c3618680f 100644 --- a/hw/acpi/cpu_hotplug.c +++ b/hw/acpi/cpu_hotplug.c @@ -115,7 +115,7 @@ void acpi_switch_to_modern_cphp(AcpiCpuHotplug *gpe_cpu, MemoryRegion *parent = pci_address_space_io(PCI_DEVICE(gpe_cpu->device)); memory_region_del_subregion(parent, &gpe_cpu->io); - cpu_hotplug_hw_init(parent, gpe_cpu->device, cpuhp_state, io_port); + cpu_hotplug_hw_init(parent, gpe_cpu->device, cpuhp_state, io_port, false); } void build_legacy_cpu_hotplug_aml(Aml *ctx, MachineState *machine, diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index 663d9cb093..9099b76f80 100644 --- a/hw/acpi/generic_event_device.c +++ b/hw/acpi/generic_event_device.c @@ -427,7 +427,7 @@ static void acpi_ged_realize(DeviceState *dev, Error **errp) ACPI_CPU_HOTPLUG_REG_LEN); sysbus_init_mmio(sbd, &s->container_cpuhp); cpu_hotplug_hw_init(&s->container_cpuhp, OBJECT(dev), - &s->cpuhp_state, 0); + &s->cpuhp_state, 0, false); break; } ged_events--;