From patchwork Tue Aug 18 12:22:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 11720665 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 99323722 for ; Tue, 18 Aug 2020 12:23:10 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 6F8042076D for ; Tue, 18 Aug 2020 12:23:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ai5ftDW/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6F8042076D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:36042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k80dx-0006dS-II for patchwork-qemu-devel@patchwork.kernel.org; Tue, 18 Aug 2020 08:23:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k80d8-0005Cr-VE for qemu-devel@nongnu.org; Tue, 18 Aug 2020 08:22:18 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:34794 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k80d6-0001tH-Ra for qemu-devel@nongnu.org; Tue, 18 Aug 2020 08:22:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597753335; 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=WQBI1hhME8vBeLvF+ckHEociDFGBXDINlrsHmzBKB+w=; b=ai5ftDW/VcbGV6san7lnOk2mhOMS4VxLb/2N6yb9QSX+sffZw0XCFmn22iKWMhOFel9dKv ZC5m+B04gz9NR7LghLhxGpyKOSkLOnoMzRaRs4RRfa7gBznu+7+RAxY7sN9qS8uZ79kILQ Itqs/WIgV4zapsGg3eFto4MABH9FzLA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-456-IJvoedqENwuk48vTi2bbrQ-1; Tue, 18 Aug 2020 08:22:14 -0400 X-MC-Unique: IJvoedqENwuk48vTi2bbrQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5C16218686CB; Tue, 18 Aug 2020 12:22:13 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5794A5882D; Tue, 18 Aug 2020 12:22:12 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH v2 1/7] x86: lpc9: let firmware negotiate 'CPU hotplug with SMI' features Date: Tue, 18 Aug 2020 08:22:02 -0400 Message-Id: <20200818122208.1243901-2-imammedo@redhat.com> In-Reply-To: <20200818122208.1243901-1-imammedo@redhat.com> References: <20200818122208.1243901-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Received-SPF: none client-ip=205.139.110.61; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/18 02:16:14 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -40 X-Spam_score: -4.1 X-Spam_bar: ---- X-Spam_report: (-4.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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=-1, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: boris.ostrovsky@oracle.com, lersek@redhat.com, aaron.young@oracle.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" It will allow firmware to notify QEMU that firmware requires SMI being triggered on CPU hot[un]plug, so that it would be able to account for hotplugged CPU and relocate it to new SMM base and/or safely remove CPU on unplug. Using negotiated features, follow up patches will insert SMI upcall into AML code, to make sure that firmware processes hotplug before guest OS would attempt to use new CPU. Signed-off-by: Igor Mammedov Reviewed-by: Laszlo Ersek --- v2: - rebase on top of 5.1 (move compat values to 5.1 machine) - make "x-smi-cpu-hotunplug" false by default (Laszlo Ersek ) --- include/hw/i386/ich9.h | 2 ++ include/hw/i386/pc.h | 3 +++ hw/i386/pc.c | 6 +++++- hw/i386/pc_piix.c | 1 + hw/i386/pc_q35.c | 1 + hw/isa/lpc_ich9.c | 13 +++++++++++++ 6 files changed, 25 insertions(+), 1 deletion(-) diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index a98d10b252..d1bb3f7bf0 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -247,5 +247,7 @@ typedef struct ICH9LPCState { /* bit positions used in fw_cfg SMI feature negotiation */ #define ICH9_LPC_SMI_F_BROADCAST_BIT 0 +#define ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT 1 +#define ICH9_LPC_SMI_F_CPU_HOT_UNPLUG_BIT 2 #endif /* HW_ICH9_H */ diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 3d7ed3a55e..fe52e165b2 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -193,6 +193,9 @@ void pc_system_firmware_init(PCMachineState *pcms, MemoryRegion *rom_memory); void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid, const CPUArchIdList *apic_ids, GArray *entry); +extern GlobalProperty pc_compat_5_1[]; +extern const size_t pc_compat_5_1_len; + extern GlobalProperty pc_compat_5_0[]; extern const size_t pc_compat_5_0_len; diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 47c5ca3e34..99c6bdbab4 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -97,8 +97,12 @@ #include "fw_cfg.h" #include "trace.h" -GlobalProperty pc_compat_5_0[] = { +GlobalProperty pc_compat_5_1[] = { + { "ICH9-LPC", "x-smi-cpu-hotplug", "off" }, }; +const size_t pc_compat_5_1_len = G_N_ELEMENTS(pc_compat_5_1); + +GlobalProperty pc_compat_5_0[] = { }; const size_t pc_compat_5_0_len = G_N_ELEMENTS(pc_compat_5_0); GlobalProperty pc_compat_4_2[] = { diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index b789e83f9a..d56f2e1b96 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -433,6 +433,7 @@ static void pc_i440fx_5_1_machine_options(MachineClass *m) m->alias = "pc"; m->is_default = true; pcmc->default_cpu_version = 1; + compat_props_add(m->compat_props, pc_compat_5_1, pc_compat_5_1_len); } DEFINE_I440FX_MACHINE(v5_1, "pc-i440fx-5.1", NULL, diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index a3e607a544..0ca1146a59 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -359,6 +359,7 @@ static void pc_q35_5_1_machine_options(MachineClass *m) pc_q35_machine_options(m); m->alias = "q35"; pcmc->default_cpu_version = 1; + compat_props_add(m->compat_props, pc_compat_5_1, pc_compat_5_1_len); } DEFINE_Q35_MACHINE(v5_1, "pc-q35-5.1", NULL, diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index cd6e169d47..19f32bed3e 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -373,6 +373,15 @@ static void smi_features_ok_callback(void *opaque) /* guest requests invalid features, leave @features_ok at zero */ return; } + if (!(guest_features & BIT_ULL(ICH9_LPC_SMI_F_BROADCAST_BIT)) && + guest_features & (BIT_ULL(ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT) | + BIT_ULL(ICH9_LPC_SMI_F_CPU_HOT_UNPLUG_BIT))) { + /* + * cpu hot-[un]plug with SMI requires SMI broadcast, + * leave @features_ok at zero + */ + return; + } /* valid feature subset requested, lock it down, report success */ lpc->smi_negotiated_features = guest_features; @@ -747,6 +756,10 @@ static Property ich9_lpc_properties[] = { DEFINE_PROP_BOOL("noreboot", ICH9LPCState, pin_strap.spkr_hi, true), DEFINE_PROP_BIT64("x-smi-broadcast", ICH9LPCState, smi_host_features, ICH9_LPC_SMI_F_BROADCAST_BIT, true), + DEFINE_PROP_BIT64("x-smi-cpu-hotplug", ICH9LPCState, smi_host_features, + ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT, true), + DEFINE_PROP_BIT64("x-smi-cpu-hotunplug", ICH9LPCState, smi_host_features, + ICH9_LPC_SMI_F_CPU_HOT_UNPLUG_BIT, false), DEFINE_PROP_END_OF_LIST(), }; From patchwork Tue Aug 18 12:22:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 11720675 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7882B722 for ; Tue, 18 Aug 2020 12:25:10 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 4FDFA2076D for ; Tue, 18 Aug 2020 12:25:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="J/289uLA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4FDFA2076D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:44332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k80ft-0001aj-Jg for patchwork-qemu-devel@patchwork.kernel.org; Tue, 18 Aug 2020 08:25:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60046) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k80dC-0005HU-7I for qemu-devel@nongnu.org; Tue, 18 Aug 2020 08:22:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:59311) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k80dA-0001uj-Hg for qemu-devel@nongnu.org; Tue, 18 Aug 2020 08:22:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597753339; 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=ngjltFjDGpueT3fX8n1U/9mQVt0Ckway8GzvKTbH3Qg=; b=J/289uLAOzFgvUqNUVAdjfOtsUm7LzNtMOKdqteyDl2ZWKCX5DEBNzF/8jRAPvBbPl4BKP NZEGBYe8PN2yPh6xxj5k0EcKYGTJM2gqi4iVk1W1PAzykwltiHsfiNTO6pdTo8kDacS1gE KjGEgGmfBK/w6GXX0mSZDE5qh5d0ooY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-386-snMUp7GuPEC5buHWr9KH5g-1; Tue, 18 Aug 2020 08:22:17 -0400 X-MC-Unique: snMUp7GuPEC5buHWr9KH5g-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DBA741DDF9; Tue, 18 Aug 2020 12:22:16 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id A86B95C641; Tue, 18 Aug 2020 12:22:13 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH v2 2/7] x86: cphp: prevent guest crash on CPU hotplug when broadcast SMI is in use Date: Tue, 18 Aug 2020 08:22:03 -0400 Message-Id: <20200818122208.1243901-3-imammedo@redhat.com> In-Reply-To: <20200818122208.1243901-1-imammedo@redhat.com> References: <20200818122208.1243901-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Received-SPF: none client-ip=63.128.21.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/18 02:02:19 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: boris.ostrovsky@oracle.com, lersek@redhat.com, aaron.young@oracle.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" There were reports of guest crash on CPU hotplug, when using q35 machine type and OVMF with SMM, due to hotplugged CPU trying to process SMI at default SMI handler location without it being relocated by firmware first. Fix it by refusing hotplug if firmware hasn't negotiated CPU hotplug with SMI support while SMI broadcast is in use. Signed-off-by: Igor Mammedov Reviewed-by: Laszlo Ersek Tested-by: Laszlo Ersek --- v1: fix typos an use suggested wording in commit and error msg s/secure boot/smm/; s/hotplug SMI/hotplug with SMI/ (Laszlo Ersek ) --- hw/acpi/ich9.c | 12 +++++++++++- hw/i386/pc.c | 11 +++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 6a19070cec..0acc9a3107 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -408,10 +408,20 @@ void ich9_pm_device_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, ICH9LPCState *lpc = ICH9_LPC_DEVICE(hotplug_dev); if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM) && - !lpc->pm.acpi_memory_hotplug.is_enabled) + !lpc->pm.acpi_memory_hotplug.is_enabled) { error_setg(errp, "memory hotplug is not enabled: %s.memory-hotplug-support " "is not set", object_get_typename(OBJECT(lpc))); + } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { + uint64_t negotiated = lpc->smi_negotiated_features; + + if (negotiated & BIT_ULL(ICH9_LPC_SMI_F_BROADCAST_BIT) && + !(negotiated & BIT_ULL(ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT))) { + error_setg(errp, "cpu hotplug with SMI wasn't enabled by firmware"); + error_append_hint(errp, "update machine type to newer than 5.1 " + "and firmware that suppors CPU hotplug with SMM"); + } + } } void ich9_pm_device_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 99c6bdbab4..f07a8ab6c4 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1499,6 +1499,17 @@ static void pc_cpu_pre_plug(HotplugHandler *hotplug_dev, return; } + if (pcms->acpi_dev) { + Error *local_err = NULL; + + hotplug_handler_pre_plug(HOTPLUG_HANDLER(pcms->acpi_dev), dev, + &local_err); + if (local_err) { + error_propagate(errp, local_err); + return; + } + } + init_topo_info(&topo_info, x86ms); env->nr_dies = x86ms->smp_dies; From patchwork Tue Aug 18 12:22:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 11720677 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 56BCB1392 for ; Tue, 18 Aug 2020 12:26:36 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 2A5AC2076D for ; Tue, 18 Aug 2020 12:26:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="e23y42TA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A5AC2076D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:48164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k80hH-0003I5-F0 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 18 Aug 2020 08:26:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k80dF-0005Nf-SP for qemu-devel@nongnu.org; Tue, 18 Aug 2020 08:22:25 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:50837 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k80dE-0001v1-3y for qemu-devel@nongnu.org; Tue, 18 Aug 2020 08:22:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597753343; 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=6Hdve1sjumZ59CnCf14s+G7y5rm1IAvCnGgoX78dIsE=; b=e23y42TApSalnxzvGhU+rEm2KJHP9B0LHTwalsooGsQCeOQnFjMGTeTPeQkM6szErhFx4V 6GmhzRDK+LUy2RkoaiLd9Eo+0tiF3ve7zp+8ULJrOWulE3GLOn+CTYqdgIdHvsF1pZuUTp hyk9iFX287ggm48vY4I29oDsigX7qzs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-504-_T8lyHKbOVi4nFzGhJbn-g-1; Tue, 18 Aug 2020 08:22:19 -0400 X-MC-Unique: _T8lyHKbOVi4nFzGhJbn-g-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 350C4807337; Tue, 18 Aug 2020 12:22:18 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 342B95C641; Tue, 18 Aug 2020 12:22:17 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH v2 3/7] x86: cpuhp: refuse cpu hot-unplug request earlier if not supported Date: Tue, 18 Aug 2020 08:22:04 -0400 Message-Id: <20200818122208.1243901-4-imammedo@redhat.com> In-Reply-To: <20200818122208.1243901-1-imammedo@redhat.com> References: <20200818122208.1243901-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Received-SPF: none client-ip=205.139.110.120; envelope-from=imammedo@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/18 03:19:25 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: boris.ostrovsky@oracle.com, lersek@redhat.com, aaron.young@oracle.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" CPU hot-unplug with SMM requires firmware participation to prevent guest crash (i.e. CPU can be removed only after OS _and_ firmware were prepared for the action). Previous patches introduced ICH9_LPC_SMI_F_CPU_HOT_UNPLUG_BIT feature bit, which is advertised by firmware when it has support for CPU hot-unplug. Use it to check if guest is able to handle unplug and make device_del fail gracefully if hot-unplug feature hasn't been negotiated. Signed-off-by: Igor Mammedov Tested-by: Laszlo Ersek Reviewed-by: Laszlo Ersek --- v2: - fix typo in commit message - drop 5.1 version from hint message (Laszlo) --- hw/acpi/ich9.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 0acc9a3107..95cb0f935b 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -460,6 +460,18 @@ void ich9_pm_device_unplug_request_cb(HotplugHandler *hotplug_dev, errp); } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU) && !lpc->pm.cpu_hotplug_legacy) { + uint64_t negotiated = lpc->smi_negotiated_features; + + if (negotiated & BIT_ULL(ICH9_LPC_SMI_F_BROADCAST_BIT) && + !(negotiated & BIT_ULL(ICH9_LPC_SMI_F_CPU_HOT_UNPLUG_BIT))) { + error_setg(errp, "cpu hot-unplug with SMI wasn't enabled " + "by firmware"); + error_append_hint(errp, "update machine type to a version having " + "x-smi-cpu-hotunplug=on and firmware that " + "supports CPU hot-unplug with SMM"); + return; + } + acpi_cpu_unplug_request_cb(hotplug_dev, &lpc->pm.cpuhp_state, dev, errp); } else { From patchwork Tue Aug 18 12:22:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 11720679 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E5324722 for ; Tue, 18 Aug 2020 12:27:48 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 6D1582076D for ; Tue, 18 Aug 2020 12:27:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="T9UmeqOq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D1582076D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:50676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k80iR-0004NG-BD for patchwork-qemu-devel@patchwork.kernel.org; Tue, 18 Aug 2020 08:27:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60084) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k80dG-0005O3-4s for qemu-devel@nongnu.org; Tue, 18 Aug 2020 08:22:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:22286) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k80dE-0001v8-HC for qemu-devel@nongnu.org; Tue, 18 Aug 2020 08:22:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597753343; 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=5rzVrrdUspB3LTxp/qx3gVwJkdECbW20a6KHHr6S9nE=; b=T9UmeqOqRMaMk8meY/PeHlYKs920+kWcRubqzmUdLlcsFH1BZQCdGiCNRdt5x7EXPYZoEC xga8WeEnpWPz/STOewhEFBOy60gv+jI7sOngPIY+kGxfP6nAwn6Hy0zlgru+7JGf0cKJNS TAP0chTm/pDXhDWtCJd8Jo7wzqLMHEc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-180-yFWGtJUUPQ6_OXYmxPah9A-1; Tue, 18 Aug 2020 08:22:22 -0400 X-MC-Unique: yFWGtJUUPQ6_OXYmxPah9A-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 65BB11007463; Tue, 18 Aug 2020 12:22:21 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 816295C64D; Tue, 18 Aug 2020 12:22:18 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH v2 4/7] acpi: add aml_land() and aml_break() primitives Date: Tue, 18 Aug 2020 08:22:05 -0400 Message-Id: <20200818122208.1243901-5-imammedo@redhat.com> In-Reply-To: <20200818122208.1243901-1-imammedo@redhat.com> References: <20200818122208.1243901-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Received-SPF: none client-ip=63.128.21.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/18 02:02:19 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: boris.ostrovsky@oracle.com, lersek@redhat.com, aaron.young@oracle.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Laszlo Ersek Tested-by: Laszlo Ersek --- include/hw/acpi/aml-build.h | 2 ++ hw/acpi/aml-build.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index d27da03d64..e213fc554c 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -291,6 +291,7 @@ Aml *aml_store(Aml *val, Aml *target); Aml *aml_and(Aml *arg1, Aml *arg2, Aml *dst); Aml *aml_or(Aml *arg1, Aml *arg2, Aml *dst); Aml *aml_lor(Aml *arg1, Aml *arg2); +Aml *aml_land(Aml *arg1, Aml *arg2); Aml *aml_shiftleft(Aml *arg1, Aml *count); Aml *aml_shiftright(Aml *arg1, Aml *count, Aml *dst); Aml *aml_lless(Aml *arg1, Aml *arg2); @@ -300,6 +301,7 @@ Aml *aml_increment(Aml *arg); Aml *aml_decrement(Aml *arg); Aml *aml_index(Aml *arg1, Aml *idx); Aml *aml_notify(Aml *arg1, Aml *arg2); +Aml *aml_break(void); Aml *aml_call0(const char *method); Aml *aml_call1(const char *method, Aml *arg1); Aml *aml_call2(const char *method, Aml *arg1, Aml *arg2); diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index f6fbc9b95d..14b41b56f0 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -556,6 +556,15 @@ Aml *aml_or(Aml *arg1, Aml *arg2, Aml *dst) return build_opcode_2arg_dst(0x7D /* OrOp */, arg1, arg2, dst); } +/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefLAnd */ +Aml *aml_land(Aml *arg1, Aml *arg2) +{ + Aml *var = aml_opcode(0x90 /* LandOp */); + aml_append(var, arg1); + aml_append(var, arg2); + return var; +} + /* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefLOr */ Aml *aml_lor(Aml *arg1, Aml *arg2) { @@ -629,6 +638,13 @@ Aml *aml_notify(Aml *arg1, Aml *arg2) return var; } +/* ACPI 1.0b: 16.2.5.3 Type 1 Opcodes Encoding: DefBreak */ +Aml *aml_break(void) +{ + Aml *var = aml_opcode(0xa5 /* BreakOp */); + return var; +} + /* helper to call method without argument */ Aml *aml_call0(const char *method) { From patchwork Tue Aug 18 12:22:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 11720667 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1394F722 for ; Tue, 18 Aug 2020 12:23:28 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id DE3EA2076D for ; Tue, 18 Aug 2020 12:23:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cyJv2u9+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DE3EA2076D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:37044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k80eE-00073N-7J for patchwork-qemu-devel@patchwork.kernel.org; Tue, 18 Aug 2020 08:23:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k80dH-0005QP-IJ for qemu-devel@nongnu.org; Tue, 18 Aug 2020 08:22:27 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:59808 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k80dG-0001vG-4M for qemu-devel@nongnu.org; Tue, 18 Aug 2020 08:22:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597753345; 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=CNrqDuxvUYwoxUreKhOkKO2k2Wkz5pO3b0+eW3WCsSk=; b=cyJv2u9+SNt076P8YV+zuYLZyXQ1Z+t/AXZ/QlBhp40T53jWrCoNPXw4VePIyxoqugTSeb 4ceZ8rzDSN7Z2XHlKs+YhbmPEUaq82nwJpEaR/ftjcv9rZ4GW0FQULZa8XPzkejFg1szoS Z4XiHkLQ8HcneIoxjn9uppFfv/NHctc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-182-u8Cx98WqNESgR2m3tfhBlw-1; Tue, 18 Aug 2020 08:22:23 -0400 X-MC-Unique: u8Cx98WqNESgR2m3tfhBlw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B29C618686CE; Tue, 18 Aug 2020 12:22:22 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id B1DF25882D; Tue, 18 Aug 2020 12:22:21 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH v2 5/7] tests: acpi: mark to be changed tables in bios-tables-test-allowed-diff Date: Tue, 18 Aug 2020 08:22:06 -0400 Message-Id: <20200818122208.1243901-6-imammedo@redhat.com> In-Reply-To: <20200818122208.1243901-1-imammedo@redhat.com> References: <20200818122208.1243901-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0.0 X-Mimecast-Originator: redhat.com Received-SPF: none client-ip=205.139.110.120; envelope-from=imammedo@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/18 03:19:25 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: boris.ostrovsky@oracle.com, lersek@redhat.com, aaron.young@oracle.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" ... to let tests pass until binary blobs are updated with new AML Signed-off-by: Igor Mammedov --- tests/qtest/bios-tables-test-allowed-diff.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..dba32d5613 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,20 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/pc/DSDT", +"tests/data/acpi/q35/DSDT", +"tests/data/acpi/q35/DSDT.tis", +"tests/data/acpi/q35/DSDT.bridge", +"tests/data/acpi/q35/DSDT.mmio64", +"tests/data/acpi/q35/DSDT.ipmibt", +"tests/data/acpi/q35/DSDT.cphp", +"tests/data/acpi/q35/DSDT.memhp", +"tests/data/acpi/q35/DSDT.numamem", +"tests/data/acpi/q35/DSDT.dimmpxm", +"tests/data/acpi/q35/DSDT.acpihmat", +"tests/data/acpi/pc/DSDT.bridge", +"tests/data/acpi/pc/DSDT.ipmikcs", +"tests/data/acpi/pc/DSDT.cphp", +"tests/data/acpi/pc/DSDT.memhp", +"tests/data/acpi/pc/DSDT.numamem", +"tests/data/acpi/pc/DSDT.dimmpxm", +"tests/data/acpi/pc/DSDT.acpihmat", +"tests/data/acpi/pc/DSDT.acpihmat", From patchwork Tue Aug 18 12:22:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 11720669 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C39AC722 for ; Tue, 18 Aug 2020 12:23:33 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8BC372076D for ; Tue, 18 Aug 2020 12:23:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="EJsRnh/l" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8BC372076D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:37424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k80eK-0007D4-PM for patchwork-qemu-devel@patchwork.kernel.org; Tue, 18 Aug 2020 08:23:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60116) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k80dK-0005Vd-9S for qemu-devel@nongnu.org; Tue, 18 Aug 2020 08:22:30 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:32601 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k80dH-0001vU-Vv for qemu-devel@nongnu.org; Tue, 18 Aug 2020 08:22:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597753347; 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=Qn04Di7tvbtKIz9MJGPqrUlOrLzEgKmR4HtPUXPcPNw=; b=EJsRnh/l5l3jlpMeY2MQb88ZWSfPzdWcGalEEAcsobTdavX4Hp32OxT6pNINaPqvZGeUSH Esd9WNT5+CxyqZIY1Th8Tz15AmY3ROBb23a6Y/iBQKr+XyFonVgLy0J2iwf9VQ/sg3sut2 bK6OOq5AkcJswL6w0N8yy2lw5xRzJUk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-438-vVAYN413Ox-8Hwd0Pnhhug-1; Tue, 18 Aug 2020 08:22:25 -0400 X-MC-Unique: vVAYN413Ox-8Hwd0Pnhhug-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0C88D1007464; Tue, 18 Aug 2020 12:22:24 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0B3235882D; Tue, 18 Aug 2020 12:22:22 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH v2 6/7] x68: acpi: trigger SMI before sending hotplug Notify event to OSPM Date: Tue, 18 Aug 2020 08:22:07 -0400 Message-Id: <20200818122208.1243901-7-imammedo@redhat.com> In-Reply-To: <20200818122208.1243901-1-imammedo@redhat.com> References: <20200818122208.1243901-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Received-SPF: none client-ip=205.139.110.61; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/18 02:16:14 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -40 X-Spam_score: -4.1 X-Spam_bar: ---- X-Spam_report: (-4.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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=-1, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: boris.ostrovsky@oracle.com, lersek@redhat.com, aaron.young@oracle.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" In case firmware has negotiated CPU hotplug SMI feature, generate AML to describe SMI IO port region and send SMI to firmware on each CPU hotplug SCI in case new CPUs were hotplugged. Since new CPUs can be hotplugged while CPU_SCAN_METHOD is running we can't send SMI before new CPUs are fetched from QEMU as it could cause sending Notify to a CPU that firmware hasn't seen yet. So fetch new CPUs into local cache first and then send SMI and after that sends Notify events to cached CPUs. This should ensure that Notify is sent only to CPUs which were processed by firmware first. Any CPUs that were hotplugged after caching will be processed by the next CPU_SCAN_METHOD, when pending SCI is handled. Signed-off-by: Igor Mammedov Reviewed-by: Laszlo Ersek Reviewed-by: Laszlo Ersek Reviewed-by: Laszlo Ersek --- v2: - clear insert event after firmware has returned control from SMI. (Laszlo Ersek ) v1: - make sure that Notify is sent only to CPUs seen by FW - (Laszlo Ersek ) - use macro instead of x-smi-negotiated-features - style fixes - reserve whole SMI block (0xB2, 0xB3) v0: - s/aml_string/aml_eisaid/ /fixes Windows BSOD, on nonsense value/ (Laszlo Ersek ) - put SMI device under PCI0 like the rest of hotplug IO port - do not generate SMI AML if CPU hotplug SMI feature hasn't been negotiated Signed-off-by: Igor Mammedov --- include/hw/acpi/cpu.h | 1 + include/hw/i386/ich9.h | 2 ++ hw/acpi/cpu.c | 80 +++++++++++++++++++++++++++++++++++++++--- hw/i386/acpi-build.c | 35 +++++++++++++++++- hw/isa/lpc_ich9.c | 3 ++ 5 files changed, 115 insertions(+), 6 deletions(-) diff --git a/include/hw/acpi/cpu.h b/include/hw/acpi/cpu.h index 62f0278ba2..0eeedaa491 100644 --- a/include/hw/acpi/cpu.h +++ b/include/hw/acpi/cpu.h @@ -50,6 +50,7 @@ void cpu_hotplug_hw_init(MemoryRegion *as, Object *owner, typedef struct CPUHotplugFeatures { bool acpi_1_compatible; bool has_legacy_cphp; + const char *smi_path; } CPUHotplugFeatures; void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts, diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index d1bb3f7bf0..0f43ef2481 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -245,6 +245,8 @@ typedef struct ICH9LPCState { #define ICH9_SMB_HST_D1 0x06 #define ICH9_SMB_HOST_BLOCK_DB 0x07 +#define ICH9_LPC_SMI_NEGOTIATED_FEAT_PROP "x-smi-negotiated-features" + /* bit positions used in fw_cfg SMI feature negotiation */ #define ICH9_LPC_SMI_F_BROADCAST_BIT 0 #define ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT 1 diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index 3d6a500fb7..4864c3b396 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -14,6 +14,8 @@ #define ACPI_CPU_CMD_DATA_OFFSET_RW 8 #define ACPI_CPU_CMD_DATA2_OFFSET_R 0 +#define OVMF_CPUHP_SMI_CMD 4 + enum { CPHP_GET_NEXT_CPU_WITH_EVENT_CMD = 0, CPHP_OST_EVENT_CMD = 1, @@ -321,6 +323,7 @@ const VMStateDescription vmstate_cpu_hotplug = { #define CPU_NOTIFY_METHOD "CTFY" #define CPU_EJECT_METHOD "CEJ0" #define CPU_OST_METHOD "COST" +#define CPU_ADDED_LIST "CNEW" #define CPU_ENABLED "CPEN" #define CPU_SELECTOR "CSEL" @@ -471,21 +474,61 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts, Aml *dev_chk = aml_int(1); Aml *eject_req = aml_int(3); Aml *next_cpu_cmd = aml_int(CPHP_GET_NEXT_CPU_WITH_EVENT_CMD); + Aml *num_added_cpus = aml_local(1); + Aml *cpu_idx = aml_local(2); + Aml *uid = aml_local(3); + Aml *new_cpus = aml_name(CPU_ADDED_LIST); aml_append(method, aml_acquire(ctrl_lock, 0xFFFF)); + + /* use named package as old Windows don't support it in local var */ + if (arch_ids->len <= 256) { + /* + * For compatibility with Windows Server 2008 (max 256 cpus), + * use ACPI1.0 PackageOp which can cache max 255 elements. + * Which is fine for 256 CPUs VM. Max 255 can be hotplugged, + * sice at least one CPU must be already present. + */ + aml_append(method, aml_name_decl(CPU_ADDED_LIST, + aml_package(arch_ids->len))); + } else { + aml_append(method, aml_name_decl(CPU_ADDED_LIST, + aml_varpackage(arch_ids->len))); + } + + aml_append(method, aml_store(zero, num_added_cpus)); aml_append(method, aml_store(one, has_event)); - while_ctx = aml_while(aml_equal(has_event, one)); + /* start scan from the 1st CPU */ + aml_append(method, aml_store(zero, uid)); + while_ctx = aml_while(aml_land(aml_equal(has_event, one), + aml_lless(uid, aml_int(arch_ids->len)))); { /* clear loop exit condition, ins_evt/rm_evt checks * will set it to 1 while next_cpu_cmd returns a CPU * with events */ aml_append(while_ctx, aml_store(zero, has_event)); + + aml_append(while_ctx, aml_store(uid, cpu_selector)); aml_append(while_ctx, aml_store(next_cpu_cmd, cpu_cmd)); + + /* + * wrap around case, scan is complete, exit loop. + * It happens since events are not cleared in scan loop, + * so next_cpu_cmd continues to find already processed CPUs. + */ + ifctx = aml_if(aml_lless(cpu_data, uid)); + { + aml_append(ifctx, aml_break()); + } + aml_append(while_ctx, ifctx); + + aml_append(while_ctx, aml_store(cpu_data, uid)); ifctx = aml_if(aml_equal(ins_evt, one)); { - aml_append(ifctx, - aml_call2(CPU_NOTIFY_METHOD, cpu_data, dev_chk)); - aml_append(ifctx, aml_store(one, ins_evt)); + /* cache added CPUs to Notify/Wakeup later */ + aml_append(ifctx, aml_store(uid, + aml_index(new_cpus, num_added_cpus))); + aml_append(ifctx, aml_increment(num_added_cpus)); aml_append(ifctx, aml_store(one, has_event)); } aml_append(while_ctx, ifctx); @@ -493,14 +536,41 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts, ifctx = aml_if(aml_equal(rm_evt, one)); { aml_append(ifctx, - aml_call2(CPU_NOTIFY_METHOD, cpu_data, eject_req)); + aml_call2(CPU_NOTIFY_METHOD, uid, eject_req)); aml_append(ifctx, aml_store(one, rm_evt)); aml_append(ifctx, aml_store(one, has_event)); } aml_append(else_ctx, ifctx); aml_append(while_ctx, else_ctx); + aml_append(while_ctx, aml_increment(uid)); + } + aml_append(method, while_ctx); + + /* + * in case FW negotiated ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT, + * make upcall to FW, so it can pull in new CPUs before + * OS is notified and wakes them up + */ + if (opts.smi_path) { + ifctx = aml_if(aml_lnot(aml_equal(num_added_cpus, zero))); + { + aml_append(ifctx, aml_store(aml_int(OVMF_CPUHP_SMI_CMD), + aml_name("%s", opts.smi_path))); + } + aml_append(method, ifctx); + } + + /* Notify OSPM about new CPUs and clear insert events */ + aml_append(method, aml_store(zero, cpu_idx)); + while_ctx = aml_while(aml_lless(cpu_idx, num_added_cpus)); + { + aml_append(while_ctx, aml_call2(CPU_NOTIFY_METHOD, + aml_derefof(aml_index(new_cpus, cpu_idx)), dev_chk)); + aml_append(while_ctx, aml_store(one, ins_evt)); + aml_append(while_ctx, aml_increment(cpu_idx)); } aml_append(method, while_ctx); + aml_append(method, aml_release(ctrl_lock)); } aml_append(cpus_dev, method); diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index b7bcbbbb2a..2291c050ba 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -95,6 +95,7 @@ typedef struct AcpiPmInfo { bool s3_disabled; bool s4_disabled; bool pcihp_bridge_en; + bool smi_on_cpuhp; uint8_t s4_val; AcpiFadtData fadt; uint16_t cpu_hp_io_base; @@ -194,6 +195,7 @@ static void acpi_get_pm_info(MachineState *machine, AcpiPmInfo *pm) pm->cpu_hp_io_base = 0; pm->pcihp_io_base = 0; pm->pcihp_io_len = 0; + pm->smi_on_cpuhp = false; assert(obj); init_common_fadt_data(machine, obj, &pm->fadt); @@ -207,12 +209,16 @@ static void acpi_get_pm_info(MachineState *machine, AcpiPmInfo *pm) object_property_get_uint(obj, ACPI_PCIHP_IO_LEN_PROP, NULL); } if (lpc) { + uint64_t smi_features = object_property_get_uint(lpc, + ICH9_LPC_SMI_NEGOTIATED_FEAT_PROP, NULL); struct AcpiGenericAddress r = { .space_id = AML_AS_SYSTEM_IO, .bit_width = 8, .address = ICH9_RST_CNT_IOPORT }; pm->fadt.reset_reg = r; pm->fadt.reset_val = 0xf; pm->fadt.flags |= 1 << ACPI_FADT_F_RESET_REG_SUP; pm->cpu_hp_io_base = ICH9_CPU_HOTPLUG_IO_BASE; + pm->smi_on_cpuhp = + !!(smi_features & BIT_ULL(ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT)); } /* The above need not be conditional on machine type because the reset port @@ -1515,6 +1521,32 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, aml_append(dev, aml_name_decl("_UID", aml_int(1))); aml_append(dev, build_q35_osc_method()); aml_append(sb_scope, dev); + + if (pm->smi_on_cpuhp) { + /* reserve SMI block resources, IO ports 0xB2, 0xB3 */ + dev = aml_device("PCI0.SMI0"); + aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A06"))); + aml_append(dev, aml_name_decl("_UID", aml_string("SMI resources"))); + crs = aml_resource_template(); + aml_append(crs, + aml_io( + AML_DECODE16, + ACPI_PORT_SMI_CMD, + ACPI_PORT_SMI_CMD, + 1, + 2) + ); + aml_append(dev, aml_name_decl("_CRS", crs)); + aml_append(dev, aml_operation_region("SMIR", AML_SYSTEM_IO, + aml_int(ACPI_PORT_SMI_CMD), 2)); + field = aml_field("SMIR", AML_BYTE_ACC, AML_NOLOCK, + AML_WRITE_AS_ZEROS); + aml_append(field, aml_named_field("SMIC", 8)); + aml_append(field, aml_reserved_field(8)); + aml_append(dev, field); + aml_append(sb_scope, dev); + } + aml_append(dsdt, sb_scope); build_hpet_aml(dsdt); @@ -1530,7 +1562,8 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, build_legacy_cpu_hotplug_aml(dsdt, machine, pm->cpu_hp_io_base); } else { CPUHotplugFeatures opts = { - .acpi_1_compatible = true, .has_legacy_cphp = true + .acpi_1_compatible = true, .has_legacy_cphp = true, + .smi_path = pm->smi_on_cpuhp ? "\\_SB.PCI0.SMI0.SMIC" : NULL, }; build_cpus_aml(dsdt, machine, opts, pm->cpu_hp_io_base, "\\_SB.PCI0", "\\_GPE._E02"); diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 19f32bed3e..8124d20338 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -647,6 +647,9 @@ static void ich9_lpc_initfn(Object *obj) &acpi_enable_cmd, OBJ_PROP_FLAG_READ); object_property_add_uint8_ptr(OBJECT(lpc), ACPI_PM_PROP_ACPI_DISABLE_CMD, &acpi_disable_cmd, OBJ_PROP_FLAG_READ); + object_property_add_uint64_ptr(obj, ICH9_LPC_SMI_NEGOTIATED_FEAT_PROP, + &lpc->smi_negotiated_features, + OBJ_PROP_FLAG_READ); ich9_pm_add_properties(obj, &lpc->pm); } From patchwork Tue Aug 18 12:22:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 11720673 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 664ED722 for ; Tue, 18 Aug 2020 12:24:48 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 29D2F2076D for ; Tue, 18 Aug 2020 12:24:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="EblQRoKt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 29D2F2076D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:43390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k80fX-0001Bv-FQ for patchwork-qemu-devel@patchwork.kernel.org; Tue, 18 Aug 2020 08:24:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k80dO-0005gH-Hs for qemu-devel@nongnu.org; Tue, 18 Aug 2020 08:22:34 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:23146 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k80dL-0001vy-LG for qemu-devel@nongnu.org; Tue, 18 Aug 2020 08:22:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597753351; 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=s13BQkNNlQLwUBLfKNzenzB85HVSJQHpHQ/xukPBF7g=; b=EblQRoKtroh/imX7KCczxi6F664c01tTLM2Rg27TWOJ6iIlxM0ss2fMZwlitDiItrJITNR lbkib/bL2RjgJgCQWv8zU2xMoXks21T8IzuGBEulLXtU+oD2fUzByMIduM0jl5tTxre0wx w3Urd1vfAHck5P2GGbcQ1yiSTzG2FaY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-434-Esqcdlt2P6yKoyiQ1V4rxQ-1; Tue, 18 Aug 2020 08:22:26 -0400 X-MC-Unique: Esqcdlt2P6yKoyiQ1V4rxQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 828C61DE0D; Tue, 18 Aug 2020 12:22:25 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 58ED85C64D; Tue, 18 Aug 2020 12:22:24 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH v2 7/7] tests: acpi: update acpi blobs with new AML Date: Tue, 18 Aug 2020 08:22:08 -0400 Message-Id: <20200818122208.1243901-8-imammedo@redhat.com> In-Reply-To: <20200818122208.1243901-1-imammedo@redhat.com> References: <20200818122208.1243901-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Received-SPF: none client-ip=205.139.110.120; envelope-from=imammedo@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/18 03:19:25 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: boris.ostrovsky@oracle.com, lersek@redhat.com, aaron.young@oracle.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Update CPU hotplug AML with following changes Method (CSCN, 0, Serialized) { Acquire (\_SB.PCI0.PRES.CPLK, 0xFFFF) + Name (CNEW, Package (0x01){}) + Local1 = Zero Local0 = One - While ((Local0 == One)) + Local3 = Zero + While (((Local0 == One) && (Local3 < One))) { Local0 = Zero + \_SB.PCI0.PRES.CSEL = Local3 \_SB.PCI0.PRES.CCMD = Zero + If ((\_SB.PCI0.PRES.CDAT < Local3)) + { + Break + } + + Local3 = \_SB.PCI0.PRES.CDAT If ((\_SB.PCI0.PRES.CINS == One)) { - CTFY (\_SB.PCI0.PRES.CDAT, One) - \_SB.PCI0.PRES.CINS = One + CNEW [Local1] = Local3 + Local1++ Local0 = One } ElseIf ((\_SB.PCI0.PRES.CRMV == One)) { - CTFY (\_SB.PCI0.PRES.CDAT, 0x03) + CTFY (Local3, 0x03) \_SB.PCI0.PRES.CRMV = One Local0 = One } + + Local3++ + } + + Local2 = Zero + While ((Local2 < Local1)) + { + CTFY (DerefOf (CNEW [Local2]), One) + \_SB.PCI0.PRES.CINS = One + Local2++ } Signed-off-by: Igor Mammedov --- tests/qtest/bios-tables-test-allowed-diff.h | 19 ------------------- tests/data/acpi/pc/DSDT | Bin 4934 -> 5009 bytes tests/data/acpi/pc/DSDT.acpihmat | Bin 6258 -> 6334 bytes tests/data/acpi/pc/DSDT.bridge | Bin 6793 -> 6868 bytes tests/data/acpi/pc/DSDT.cphp | Bin 5397 -> 5473 bytes tests/data/acpi/pc/DSDT.dimmpxm | Bin 6587 -> 6663 bytes tests/data/acpi/pc/DSDT.ipmikcs | Bin 5006 -> 5081 bytes tests/data/acpi/pc/DSDT.memhp | Bin 6293 -> 6368 bytes tests/data/acpi/pc/DSDT.numamem | Bin 4940 -> 5015 bytes tests/data/acpi/q35/DSDT | Bin 7678 -> 7753 bytes tests/data/acpi/q35/DSDT.acpihmat | Bin 9002 -> 9078 bytes tests/data/acpi/q35/DSDT.bridge | Bin 7695 -> 7770 bytes tests/data/acpi/q35/DSDT.cphp | Bin 8141 -> 8217 bytes tests/data/acpi/q35/DSDT.dimmpxm | Bin 9331 -> 9407 bytes tests/data/acpi/q35/DSDT.ipmibt | Bin 7753 -> 7828 bytes tests/data/acpi/q35/DSDT.memhp | Bin 9037 -> 9112 bytes tests/data/acpi/q35/DSDT.mmio64 | Bin 8808 -> 8883 bytes tests/data/acpi/q35/DSDT.numamem | Bin 7684 -> 7759 bytes tests/data/acpi/q35/DSDT.tis | Bin 8283 -> 8358 bytes 19 files changed, 19 deletions(-) diff --git a/tests/data/acpi/pc/DSDT b/tests/data/acpi/pc/DSDT index 6d0aaf729ac7d64cf966621adf276534de5cc555..716d412a2474e0990136560b0340f808e490b514 100644 GIT binary patch delta 304 zcmX@6Hc_3+CDw z#sY@K0>*>_hU7&~JQF4-FiuSd3MCXI$LO=f2Rp?FIC~ld1i1z~2fO+dFrW)M`?@R; zpNcN(;uw;=v;dpv0+q>7;d;2io_@iM1<4&C=Oi+ef*iBZe1R!U9b8$EZy2L`YiFmPVoWGo(2IyuEEaEzAg*gStkGI5EXY0af?Kkc5w`uT)-)23N&P) bH_HMKmdWTUf_%dmap`p6l-k_E$;kx(->We% diff --git a/tests/data/acpi/pc/DSDT.acpihmat b/tests/data/acpi/pc/DSDT.acpihmat index 2e5e02400b1bd2842989d395c573fc593f45503b..198e87dfc2d7df261f2f51d685d90db5c6eb8929 100644 GIT binary patch delta 295 zcmexlu+NaoCD>TXu#}TbOnUO=- z?EilbXFu0)Att5*hQtEKgaU@-Mb11ECMPgXP38iMB@`sb=(EHJJH-b$dm01;xduB2 zyZTI?&mmSXJ{4WY#W5s#X#qCT1uB!#g+2X(84Hp-K(;3`l!EMDXuiM{Ls^h-7^8ED zTVyg9a{(i=8I$cex%5ht3mB3XX-rK@1gU8To0i1Dh^i9gXrOJSNt5F_#5Tuqitqyf D&!|=a delta 215 zcmdmI_{o6FCDZZv3Dca7B(g?o5=^*Rx|k;Zq8-rU}X2;a}IX)%r8akP`UnC5wjePt diff --git a/tests/data/acpi/pc/DSDT.cphp b/tests/data/acpi/pc/DSDT.cphp index e0a43ccdadae150c0f39599c85e4e21ed8fff2a4..01c8baf29575aa9c90489891ea14a707fccbf326 100644 GIT binary patch delta 232 zcmbQL^-zn;CD{b`Ey-kXXQ&P{5G9$eCxth2{%PF_Z=QhA}#axJ4#U rj^~upD@`t7NLr*ZH7OA!)(qC2#K2gKrRx|l|Y|dr3WMuc?a}IX)K+{h^`flKq`T286S6F9^+-{x%N1^{(#}ZO&y^U}SO;p4`tNQ_tb-=Nc}= z#8SYJSiqQ2z>vJinP#fDMO_?2l9v`>6J4M(86rIS8V6r}L2?Jk6^RU`AU7;DUtkKAMc5kT8^-7y;ue|A x#azIMZX!?;sIN4+fFWs-#?+)lkiurLkx2}Un94ol78;scyL4FZB(gPlG7f*GAd+#=D%T^vIg3mDNwfvSOq iF7#$u;DKpWkZ%|+qqvwsW{IF$4O9;_Z1Wn&YDKtC_qECU0f`TkkCF9PI4J5v?4f&k`T( z6d&O1X%Gf#uZytKd;oA3ga$>_qKe!+|d$sHi)Br=qO9JA1Tf$3y>PD#e( p$=RGzVx`Fi3`vVLrY0pihqy&HgHbeU|uOr}zM8PlJFU*I;L7UzY{$ER)fNJ^g|iokQFrCmV7K%QF@* lVv#RkOjzj6vcQ97avrB7NSzcHGp52I-!P!U%@;U1xd2{IGED#g diff --git a/tests/data/acpi/pc/DSDT.memhp b/tests/data/acpi/pc/DSDT.memhp index 9a9418f4bde5fb18883c244ea956122e371ff01a..71f34760fe10a7f4face8d9f956b96668d5d2951 100644 GIT binary patch delta 304 zcmbPg_`s0MCD)|uMULE) z6Br8^5(*e%^jYGAo#F$WJq-eaT!WpReO(r~vrPWaAu8@1;ueW6?cx|Rxqws56llmo bZ|CD@o=7B(g)^T`L;Rx`QkOwMKh%jCf~Ifp|=rGPPEkt6ry z1jYh}gaU>beU|uOr}zM8PlJFU*I;L7UzY{$ER+9ph>AOhxJ9B%yEukSF5nb11sbx@ bn`MCq%VcyFLB3&(xO6&jN^S1og0t|!pzA_3qZ6> z@&c8~G5Rd=!A|i3&YlJVL9W5ho_@iM1<4&C6B8LqLFO$qUto%%EXX&E(K*B|GI{cU pDJi|ugCDG5)3}Gx_ nL>C3BE?`Vp=*_ag1Jfw!Am1=tW=)onmYQrJCAPUr`aBZ=mR>#8 diff --git a/tests/data/acpi/q35/DSDT.acpihmat b/tests/data/acpi/q35/DSDT.acpihmat index cd97b819824e4140d087e465d179b71775d6a494..1ebd77e15912c54d5d6ff2d6c23475b283dd3555 100644 GIT binary patch delta 252 zcmZ4G_RWpUCDoW-1PLZL$H{XfRx^2;ZT6JpU}Sd@b`Ey-59yA+dllp@1QIku%SP$q9^8levIm2?fb9`YiFmPVoWGo(2IyuEEa1u090} z=z`9^E(^q`qKmpXh9oa7z$UstWimuq0b#JGUoc}qatFvgi43J6*DN$&U^@Aplq6&F pWG-nbvC`xMhNMLrQp!77s&ChwOLV=7JBtRl_E0RVL(NvHq- delta 183 zcmez7w#tpmCDk8%T+5)|Y<31OWeXMc4oU delta 214 zcmca*({ID&66_MfFUP>Z=(Uk+f&`O~+2lDAtC{?@Cwof%W%uB74tDnAnA|8WQO}sL z$dP+;0%HL~LIFdJK1+PCQ+$B4r$IoFYp}Dkugd~=mdWVCo_@iM&LM7*=;AJpA&do# n=%PT?1&j#`y;&A`U>YSI>TXu#}Ta@qt6l_ z>=Ym1>}e1X;X+3m6g#7-IBU;)9*y1Drh#0)kwFot=GM7PzxaMi=(<3ubfxR@~&2Kj~o6>eTAUBLnX$bvLy diff --git a/tests/data/acpi/q35/DSDT.dimmpxm b/tests/data/acpi/q35/DSDT.dimmpxm index 29f19b22a38f9d8e7dc9870f0c1aa3d4470643ff..68859b7c9ff5ed9566650d75924d8ca8868c22fc 100644 GIT binary patch delta 306 zcmezDvEP%+CDl78;scyL4FZB(gPnt2eF_-R1)Y6e z7Kl$p7j}|EWQcG*!eCFoV8(*v4v>2i8A?H}S!lk%6siuPEXX&E(K*B| wGMS6HfDzqnpd?UVX>tKW(jtwiNr@nZ&0r&w7#J~?d-^d4mnLntkv8W90J=_Di2wiq delta 173 zcmdn*`PqZZCD#7##p^ko z{anL^m>3Hf5(^j;3K)_XIq^)GoWM9W87P!ckQ}4W5+CdoAK>h15D?@V>>TXsQ^0^O z=8DHp6X;Bs delta 228 zcmbPYd(wu>CDHp89ECDg0t|!pzA_3qZ6> z@&c8~G5Rd=!A|i3&YlJVL9W5ho_@iM1<4&C6B8LqLFO$qUto%%EXX&E(K*B|GI{cU pDJi|u delta 214 zcmbQ?e%6i4CD`YiFmPVoWGo(2IyuEEaEzAg*gStg?kd-?@4I)}JLqKmsYhAvyD6w diff --git a/tests/data/acpi/q35/DSDT.mmio64 b/tests/data/acpi/q35/DSDT.mmio64 index 6d8facd9e179140682ad5d4302f3dad14dbec342..318d5de996d97aaf175e232157e48a443ef7bbbc 100644 GIT binary patch delta 230 zcmaFive}i(CDg0t|!pzA_3qZ6> z@&c8~G5Rd=!A|i3&YlJVL9W5ho_@iM1<4&C6B8LqLFO$qUto%%EXX&E(K*B|GI{cU pDJi|uQMbZEO delta 214 zcmdn&`oe|FCDbeU|uOr}zM8PlJFU*I;L7UzY{$ER)fNJ^g|iokQFr(ZyXHLl_Gf n(M5r(3m6j?db2F>z%)ua$Ttj^S(9a?r6wCliEXZuwqyqYy%Rh% diff --git a/tests/data/acpi/q35/DSDT.numamem b/tests/data/acpi/q35/DSDT.numamem index 737325dc3082fdf06283857811f6f5174e0ff2a9..a964d7c6a4b2a781f8e8791d32e23eadf994b502 100644 GIT binary patch delta 230 zcmZp%Id8+|66_MZsK1eGf&`PV_2fActC<`OCwof%Wp@^K4tDnAnEYN+T!F*c z&ox|#iLrnov4An5fFXI26VHUn35-*dfkFud$&=?xicT()5@8abI(ea#Fmv+K0ub$z zyg+4gj6O?zuv2`1v!_8okZZ8Br(ZB*L2?Jk#6*Ttka-Ku7nouw3-S$PbPjQgOrHE- pN=mOZxqu;Qk;c@dM37iBSa%WwV*w);(@T>k8%T+5)|bA@1OVH=MWg@# delta 214 zcmX?a(_+Kr66_MfBFDhM7_yOTf&`P3`Q$kgtC?JNCVNW$W%uB74tDnAnA|8WQO}sL z$dP+;0%HL~LIFdJK1+PCQ+$B4r$IoFYp}Dkugd~=mdWVCo_@iM&LM7*=;AJpA&do# n=%PT?1&j#`y;&A`U>YSIg0t|!pzA_3qZ6> z@&c8~G5Rd=!A|i3&YlJVL9W5ho_@iM1<4&C6B8LqLFO$qUto%%EXX&E(K*B|GI{cU pDJi|ubeU|uOr}zM8PlJFU*I;L7UzY{$ER)fNJ^g|iokQFr(ZyXHLl_Gf n(M5r(3m6j?db2F>z%)ua$Ttj^S(9a?r6wCliEXZu)?ozz!?Qdw diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dba32d5613..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,20 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/pc/DSDT", -"tests/data/acpi/q35/DSDT", -"tests/data/acpi/q35/DSDT.tis", -"tests/data/acpi/q35/DSDT.bridge", -"tests/data/acpi/q35/DSDT.mmio64", -"tests/data/acpi/q35/DSDT.ipmibt", -"tests/data/acpi/q35/DSDT.cphp", -"tests/data/acpi/q35/DSDT.memhp", -"tests/data/acpi/q35/DSDT.numamem", -"tests/data/acpi/q35/DSDT.dimmpxm", -"tests/data/acpi/q35/DSDT.acpihmat", -"tests/data/acpi/pc/DSDT.bridge", -"tests/data/acpi/pc/DSDT.ipmikcs", -"tests/data/acpi/pc/DSDT.cphp", -"tests/data/acpi/pc/DSDT.memhp", -"tests/data/acpi/pc/DSDT.numamem", -"tests/data/acpi/pc/DSDT.dimmpxm", -"tests/data/acpi/pc/DSDT.acpihmat", -"tests/data/acpi/pc/DSDT.acpihmat",