From nobody Sat May 18 23:14:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600854651; cv=none; d=zohomail.com; s=zohoarc; b=mIZUUqXY6MrZKxz10iXU8vW0Cn/QtUf4UNoy5BkH/gdBlLJsBneFAHv4ZZTCD2JQtHyyIei2GOaydmgkJP/nA3ON2gH/092rERiZcZv/u4ExSuniWP0MAeC5p3LVSO1uq2ulvgGGZLdpO8pqcZ171OEYE5ntU91tAl1jflJntwg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600854651; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GoW/qE+i0LwwkHjanLNRpSZyIljNlGdSZOSjJtcnZfM=; b=nPD4axSdnE1Nrpuv9ML09uWC7lDKxqXPGQGd/o+0v1ULgV7ffnxRCV9P6JJgTxPAouhEMCPe2kkhzovT3+wJnNeUmvGuSBULLPWlfhhxbLTLz6Cv4xVMn04sYjBnfXbk7Uja1KoYGaRezCefG6jAzCx96AAGnX3YrjXEGywywRY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600854651174479.73079067506535; Wed, 23 Sep 2020 02:50:51 -0700 (PDT) Received: from localhost ([::1]:40244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kL1QH-0002yL-Kl for importer@patchew.org; Wed, 23 Sep 2020 05:50:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kL1Mg-0006XP-N1 for qemu-devel@nongnu.org; Wed, 23 Sep 2020 05:47:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:47349) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kL1Me-0007UC-Va for qemu-devel@nongnu.org; Wed, 23 Sep 2020 05:47:06 -0400 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-399-z5P6GzvZOOuV9G4fUbT9_A-1; Wed, 23 Sep 2020 05:47:02 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 89C571074645; Wed, 23 Sep 2020 09:47:01 +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 77C5455778; Wed, 23 Sep 2020 09:47:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600854424; 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=GoW/qE+i0LwwkHjanLNRpSZyIljNlGdSZOSjJtcnZfM=; b=GHMUifD22xsmRLACQ2M12diHxoyjK22yWcqvZ0eGpCc2yR5RFZ88xo4TZ0rzqMCKnhEeLI 8ss62YGU8vqhd5XV8gEuTg1+0TNqRgBLLjQ48DNuFj8zzW3n+zFmXe4F/6fN8/XJQCS+D3 obg4V2BoykmkkXzXtdy5pdhcHfcPw/s= X-MC-Unique: z5P6GzvZOOuV9G4fUbT9_A-1 From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH v6 01/11] x86: lpc9: let firmware negotiate 'CPU hotplug with SMI' features Date: Wed, 23 Sep 2020 05:46:40 -0400 Message-Id: <20200923094650.1301166-2-imammedo@redhat.com> In-Reply-To: <20200923094650.1301166-1-imammedo@redhat.com> References: <20200923094650.1301166-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 23:02:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.455, 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_H5=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lersek@redhat.com, ankur.a.arora@oracle.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 Tested-by: Laszlo Ersek --- v4: - fix 5.2 machine types so they won't apply pc_compat_5_1 (Laszlo Ersek ) v3: - rebase on top of "[PATCH v2] hw: add compat machines for 5.2" so apply that before this patch v2: - rebase on top of 5.1 (move compat values to 5.1 machine) - make "x-smi-cpu-hotunplug" false by default (Laszlo Ersek ) fixup --- include/hw/i386/ich9.h | 2 ++ hw/i386/pc.c | 4 +++- hw/isa/lpc_ich9.c | 13 +++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index 48b442bc0b..703d56036a 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -247,5 +247,7 @@ struct ICH9LPCState { =20 /* 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 =20 #endif /* HW_ICH9_H */ diff --git a/hw/i386/pc.c b/hw/i386/pc.c index b55369357e..2af660c55e 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -97,7 +97,9 @@ #include "trace.h" #include CONFIG_DEVICES =20 -GlobalProperty pc_compat_5_1[] =3D {}; +GlobalProperty pc_compat_5_1[] =3D { + { "ICH9-LPC", "x-smi-cpu-hotplug", "off" }, +}; const size_t pc_compat_5_1_len =3D G_N_ELEMENTS(pc_compat_5_1); =20 GlobalProperty pc_compat_5_0[] =3D { diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 3303d2eab6..a54b3ec8bd 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; + } =20 /* valid feature subset requested, lock it down, report success */ lpc->smi_negotiated_features =3D guest_features; @@ -747,6 +756,10 @@ static Property ich9_lpc_properties[] =3D { 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_featur= es, + ICH9_LPC_SMI_F_CPU_HOT_UNPLUG_BIT, false), DEFINE_PROP_END_OF_LIST(), }; =20 --=20 2.27.0 From nobody Sat May 18 23:14:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600854515; cv=none; d=zohomail.com; s=zohoarc; b=AkM1avjSmp1k13jOgPX4UQ90BTYfj3f+tvpfkBL5hADWZS6ZRtbL+aBhk8Lqo8i8lFzNAf+6eB8cU5/Y3fRxmD2H4ybOLNbz+qmsCXmLGRfUV05F22RTToE8wziWAdOm/xfM8dler0HqMDOzcjD+6gWHLxxloJiFxJjqU7dzljs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600854515; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NHtq1ZlVg94Kf+6wpeThJeaxQyTxlv+PX6zeAnjEKIs=; b=OhouVpxRIe2wnRphPrH5YCEEsYubWNN8QMhj3o0vcpjqDoCEPezM7ldn2PbTffFHDsfmOZDMuT8UIRLvWcF3sZ+aggOJQqveU5/M7ve6Z/gh/TbKEjoeUnPHB8qXlwRP0CRMIsk57np19riuS8qwd6tW7As6O1ru7u/d/LyAu4w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160085451506759.82092601675288; Wed, 23 Sep 2020 02:48:35 -0700 (PDT) Received: from localhost ([::1]:60674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kL1O5-00089H-Pa for importer@patchew.org; Wed, 23 Sep 2020 05:48:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kL1Ml-0006e0-1M for qemu-devel@nongnu.org; Wed, 23 Sep 2020 05:47:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49610) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kL1Mj-0007VR-Af for qemu-devel@nongnu.org; Wed, 23 Sep 2020 05:47:10 -0400 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-215-n61frQ6VNrezlZqimImCXQ-1; Wed, 23 Sep 2020 05:47:06 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3ED20186DD29; Wed, 23 Sep 2020 09:47:05 +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 D535155778; Wed, 23 Sep 2020 09:47:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600854428; 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=NHtq1ZlVg94Kf+6wpeThJeaxQyTxlv+PX6zeAnjEKIs=; b=AWjuLq/nJmFq1ihDRTT3xGJzHzuveGfZaMbLyqQDjPW8BXoK+dipnILfCkIrBd/IS7liru 6kCRccHSjVnwGOJOs3uXzvho/KKcgXfoYvkxWOQjScX3PzJdrZ04bGyV80+Mb/6RY9HK98 rCC4C0SAm+cK4DpyaxWeQLYJfGT4X1k= X-MC-Unique: n61frQ6VNrezlZqimImCXQ-1 From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH v6 02/11] x86: cpuhp: prevent guest crash on CPU hotplug when broadcast SMI is in use Date: Wed, 23 Sep 2020 05:46:41 -0400 Message-Id: <20200923094650.1301166-3-imammedo@redhat.com> In-Reply-To: <20200923094650.1301166-1-imammedo@redhat.com> References: <20200923094650.1301166-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 23:02:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.455, 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_H5=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lersek@redhat.com, ankur.a.arora@oracle.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 --- v6: - rebase on top of current master, due to non trivial conflicts caused by microvm series, which moved/renamed pc_cpu_pre_plug() (Ankur Arora ) 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/x86.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 *hotpl= ug_dev, DeviceState *dev, ICH9LPCState *lpc =3D ICH9_LPC_DEVICE(hotplug_dev); =20 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-suppo= rt " "is not set", object_get_typename(OBJECT(lpc))); + } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { + uint64_t negotiated =3D 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 firmw= are"); + error_append_hint(errp, "update machine type to newer than 5.1= " + "and firmware that suppors CPU hotplug with SMM"); + } + } } =20 void ich9_pm_device_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, diff --git a/hw/i386/x86.c b/hw/i386/x86.c index c2ea989579..403c2b1dad 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -279,6 +279,17 @@ void x86_cpu_pre_plug(HotplugHandler *hotplug_dev, return; } =20 + if (x86ms->acpi_dev) { + Error *local_err =3D NULL; + + hotplug_handler_pre_plug(HOTPLUG_HANDLER(x86ms->acpi_dev), dev, + &local_err); + if (local_err) { + error_propagate(errp, local_err); + return; + } + } + init_topo_info(&topo_info, x86ms); =20 env->nr_dies =3D x86ms->smp_dies; --=20 2.27.0 From nobody Sat May 18 23:14:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600854859; cv=none; d=zohomail.com; s=zohoarc; b=KbSmCHA4nJl30dMs4POIg7aE1iPjYYsWCXEG8pFos8ar+nNdnmt0/UNtt5bsQ/MF5GRyr+qGk/nToHCfiPGXr+8K+3q+yysp/HsrXTU35ngEY5rGIf6wya5I/yIFIifZWHUxL8GN+awAI3K24caeFSKF3eYAcaYUg6RWvcPtVtk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600854859; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=i8i04RflSSAEa8AF3BhF/y7h5IJuR6XGASJTy9nNJmQ=; b=Vh+EDvOSPkLv4ysJWuUmRm9w5AlSI23VpzWbqtjncy/2mx5IfBvOqznz6daO+6gSNQMs9HXv2bHhFo8gQXTF93TCcHh17R7OLN107jBTC9l+O0+zjs+m/bftnWzBmACcDq++cnoy9YUeAoDzzk/PMVF3bU4AW5xm1O53snkd2Uk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600854859288516.1489900389652; Wed, 23 Sep 2020 02:54:19 -0700 (PDT) Received: from localhost ([::1]:48858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kL1Td-0006gB-Tg for importer@patchew.org; Wed, 23 Sep 2020 05:54:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35294) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kL1Mo-0006j4-4V for qemu-devel@nongnu.org; Wed, 23 Sep 2020 05:47:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:30819) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kL1Mm-0007W7-Br for qemu-devel@nongnu.org; Wed, 23 Sep 2020 05:47:13 -0400 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-26-M3kV4D0TNiu3P2N9YWYgFw-1; Wed, 23 Sep 2020 05:47:07 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 88EE6186DD2D; Wed, 23 Sep 2020 09:47:06 +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 89E5055778; Wed, 23 Sep 2020 09:47:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600854431; 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=i8i04RflSSAEa8AF3BhF/y7h5IJuR6XGASJTy9nNJmQ=; b=NG+xBg+yrsIieyG/EQB2yGezWk+Z0CgVxNH1JMcKmvaFyZnxDTj9ME29gaEHDDCTKEZ+ih kP0yP+YWbKQPMHYp1/EJpY9/tH/2VdAYkA6b2vTUtIIf2Bw5Laq2cuKgfiDS47QnNwApzc iqMXiKAsMaLTn2g4EenguMAhL+PNd4U= X-MC-Unique: M3kV4D0TNiu3P2N9YWYgFw-1 From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH v6 03/11] x86: cpuhp: refuse cpu hot-unplug request earlier if not supported Date: Wed, 23 Sep 2020 05:46:42 -0400 Message-Id: <20200923094650.1301166-4-imammedo@redhat.com> In-Reply-To: <20200923094650.1301166-1-imammedo@redhat.com> References: <20200923094650.1301166-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass 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/09/23 00:53:58 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.455, 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_H5=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lersek@redhat.com, ankur.a.arora@oracle.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 =3D 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 havi= ng " + "x-smi-cpu-hotunplug=3Don and firmware= that " + "supports CPU hot-unplug with SMM"); + return; + } + acpi_cpu_unplug_request_cb(hotplug_dev, &lpc->pm.cpuhp_state, dev, errp); } else { --=20 2.27.0 From nobody Sat May 18 23:14:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600854676; cv=none; d=zohomail.com; s=zohoarc; b=iR6hrQS0+mA074aLTCynr9+caUxFHe0Q4lyMTYzU0dCv/k/TSTdNlSEXxnS+tsO/CiAmntcQbERruwr0zabsq4iNavs7l6ez+6D0H3RZwQXe5036VoV8WLsKjvLUpM9nTC4v2HJYR1i8hDCk01oErOphXY7vH55Hjm3UiEuF+W4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600854676; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=F8R3RVawSIm8OmJ5LeYmowDznkJl7w8B8Dhm7a4s96c=; b=Ylz/e+O+y9Kgz93N2QaaNI2MiPMSABZAKGAkWvPHIZZVg4DjKscCXNMU7IsmInrwR9FKqlNV275lDsdQvodHZI2MsTVcZN+Gj4S8E/12pdKxe/yotLMNTkvopmb2F8YRRMygylO+fxi9N7g76ty7P29Hpf/a4PqcLbCcfLkCSYo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600854676834684.7751688058827; Wed, 23 Sep 2020 02:51:16 -0700 (PDT) Received: from localhost ([::1]:40846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kL1Qh-0003DH-BH for importer@patchew.org; Wed, 23 Sep 2020 05:51:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kL1Mn-0006hw-CW for qemu-devel@nongnu.org; Wed, 23 Sep 2020 05:47:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:34040) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kL1Ml-0007Vv-Kc for qemu-devel@nongnu.org; Wed, 23 Sep 2020 05:47:13 -0400 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-7-KRh45rnuPTCy5KQjLeRCjw-1; Wed, 23 Sep 2020 05:47:09 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 07D98801FDA; Wed, 23 Sep 2020 09:47:08 +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 D451455778; Wed, 23 Sep 2020 09:47:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600854431; 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=F8R3RVawSIm8OmJ5LeYmowDznkJl7w8B8Dhm7a4s96c=; b=Kvx3fgFLut5AC+kdbMWQ69Xf17ZxnC9WzcICiTX8a6HqrBYDw7MKCijC2hteZvPLcVp2dt 4Pw9fhQ4rleihpAHf2NdMw3S7R7Ddaw08J9k8UlJOCn1xGtiypDipQzPuz1ISX3NwXGqy2 tFmHRKo5W+cgqrfcXbhR6mkWf7yxHA4= X-MC-Unique: KRh45rnuPTCy5KQjLeRCjw-1 From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH v6 04/11] acpi: add aml_land() and aml_break() primitives Date: Wed, 23 Sep 2020 05:46:43 -0400 Message-Id: <20200923094650.1301166-5-imammedo@redhat.com> In-Reply-To: <20200923094650.1301166-1-imammedo@redhat.com> References: <20200923094650.1301166-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 23:02:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.455, 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_H5=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , lersek@redhat.com, ankur.a.arora@oracle.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Signed-off-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Laszlo Ersek Tested-by: Laszlo Ersek --- v5: - fix comment to match spec (Laszlo Ersek ) - reorder aml_lor() and aml_land() in header (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..fe0055fffb 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -290,6 +290,7 @@ Aml *aml_to_buffer(Aml *src, Aml *dst); 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_land(Aml *arg1, Aml *arg2); Aml *aml_lor(Aml *arg1, Aml *arg2); Aml *aml_shiftleft(Aml *arg1, Aml *count); Aml *aml_shiftright(Aml *arg1, Aml *count, Aml *dst); @@ -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..3792ba96ce 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); } =20 +/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefLAnd */ +Aml *aml_land(Aml *arg1, Aml *arg2) +{ + Aml *var =3D 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; } =20 +/* ACPI 1.0b: 16.2.5.3 Type 1 Opcodes Encoding: DefBreak */ +Aml *aml_break(void) +{ + Aml *var =3D aml_opcode(0xa5 /* BreakOp */); + return var; +} + /* helper to call method without argument */ Aml *aml_call0(const char *method) { --=20 2.27.0 From nobody Sat May 18 23:14:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600855008; cv=none; d=zohomail.com; s=zohoarc; b=dTxaBB9xU0L0sgKUG/XWD6GYWN2TpBiQjhyzDs9RxDwdsntKFGVWfeO/+YbsrVh6xfMSpaDmE7KyaonIypP1AOE7riKdPIH7gJ/sJC00o2o6woXmqxkPBtkuWw41pN3ya1HJmzE/O1P04igcMULAorhFxgjXE2Mj/1hllVlvyT4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600855008; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=aabSme6Lagu3M0YsB1G2o8hHynbhoukArXgvCa/doaU=; b=iTRygLmlRN3YsrGhw0Lk7yd6SDsZSeqinpKR+/b1G4uA4NvjIpnQCYhKB2hFyhqBsvrzOYh4dGQYqsMViMorNY6KdObyUMxWIRyOMFzPyZmopExnutb6h+ejHxcZZJnO6KT3aPXcy0o/MQ5G6Ql5YTDpjgfGUNUusU+3HsMGUek= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160085500854218.933500132738914; Wed, 23 Sep 2020 02:56:48 -0700 (PDT) Received: from localhost ([::1]:55132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kL1W2-0000ym-6g for importer@patchew.org; Wed, 23 Sep 2020 05:56:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kL1Mv-0006xA-QJ for qemu-devel@nongnu.org; Wed, 23 Sep 2020 05:47:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49670) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kL1Mu-0007X7-1H for qemu-devel@nongnu.org; Wed, 23 Sep 2020 05:47:21 -0400 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-547-I62qvfBZN6ekqjRQ8RjPKQ-1; Wed, 23 Sep 2020 05:47:17 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B0968425E0; Wed, 23 Sep 2020 09:47: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 5215255768; Wed, 23 Sep 2020 09:47:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600854439; 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=aabSme6Lagu3M0YsB1G2o8hHynbhoukArXgvCa/doaU=; b=bGeQMZyP08rd7bZX+8MFqEiu4Xkg8zFM71E5NmiwK+l7/tEkfS1Zwv6Wuk4LlLdvGZpeSk nXKqIYeMudG97GkAugxgxlEFnEm7l+myuJnm23bTIfOmFPjCWZhmxIKECAXaCVwgy6iMp9 ydcVAEVo2tenwHKQ49jK6dl/7aD2fEY= X-MC-Unique: I62qvfBZN6ekqjRQ8RjPKQ-1 From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH v6 05/11] tests: acpi: mark to be changed tables in bios-tables-test-allowed-diff Date: Wed, 23 Sep 2020 05:46:44 -0400 Message-Id: <20200923094650.1301166-6-imammedo@redhat.com> In-Reply-To: <20200923094650.1301166-1-imammedo@redhat.com> References: <20200923094650.1301166-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 23:02:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.455, 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_H5=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lersek@redhat.com, ankur.a.arora@oracle.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" ... 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", --=20 2.27.0 From nobody Sat May 18 23:14:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600854692; cv=none; d=zohomail.com; s=zohoarc; b=MtXOVgzN4cb9cYHQomVSfEpCGCGRZb6QZDFM6QN2wm0uttZyzTyTX+llBxSGnu7WTAy/dzBXi7hqTkFEAqxUublO+P4u7+gEAewp70rl0cFa64UHaxIS0mssxWMV7WDM7R8LoNuL29owYHOEsHVKgfCIAboG0itmbxg405kVuis= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600854692; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=W+u0K2zsKjxWFiQyWffMFjyVYBSqF19i98LFi7MUtkE=; b=KIFhAJwE5q/1Y9M3x7On1lMICjVsAiqv6lSpDv1GqF+B83lnCzCz8Ep/cia03wsEqxjGJw5oQzXepqwuaKux1bbuSU6+cmXgcyJ+dwevk4vvBeeWk91d1LUM7rfhqfUN6qmS1EqpM2fQvJ5iyFX8XVpfmMJu30ek/BR7kXH3p7Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160085469210666.43448528977467; Wed, 23 Sep 2020 02:51:32 -0700 (PDT) Received: from localhost ([::1]:41622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kL1Qw-0003Y0-Oq for importer@patchew.org; Wed, 23 Sep 2020 05:51:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kL1Mx-00070R-Hr for qemu-devel@nongnu.org; Wed, 23 Sep 2020 05:47:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:28749) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kL1Mv-0007XI-Ry for qemu-devel@nongnu.org; Wed, 23 Sep 2020 05:47:23 -0400 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-66-N6zA6ggnOr2ZmdbhkRhr6Q-1; Wed, 23 Sep 2020 05:47:19 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0931C81F004; Wed, 23 Sep 2020 09:47: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 082A95576A; Wed, 23 Sep 2020 09:47:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600854441; 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=W+u0K2zsKjxWFiQyWffMFjyVYBSqF19i98LFi7MUtkE=; b=ZsSLuxXURqgk8+tlHYbfuhPVj9E68YK/01nStTdX2Dw/LattXHxuCiXVdiZGX1Fu16aCk/ A7hPjS/WRsHAu8jcBfg28xx9Bw5KZgGZ80oe89GQn2lP+Qir8dGAxTF1IQyX9MQ0aPgVkv aJnuUR61+147f3EXRIpgtXX/YAUbHgM= X-MC-Unique: N6zA6ggnOr2ZmdbhkRhr6Q-1 From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH v6 06/11] x86: ich9: expose "smi_negotiated_features" as a QOM property Date: Wed, 23 Sep 2020 05:46:45 -0400 Message-Id: <20200923094650.1301166-7-imammedo@redhat.com> In-Reply-To: <20200923094650.1301166-1-imammedo@redhat.com> References: <20200923094650.1301166-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass 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/09/23 00:53:58 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.455, 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_H5=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lersek@redhat.com, ankur.a.arora@oracle.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Expose the "smi_negotiated_features" field of ICH9LPCState as a QOM property. Signed-off-by: Igor Mammedov Reviewed-by: Laszlo Ersek Tested-by: Laszlo Ersek --- include/hw/i386/ich9.h | 2 ++ hw/isa/lpc_ich9.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index 703d56036a..294024be5f 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -245,6 +245,8 @@ struct ICH9LPCState { #define ICH9_SMB_HST_D1 0x06 #define ICH9_SMB_HOST_BLOCK_DB 0x07 =20 +#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/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index a54b3ec8bd..04e5323140 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_C= MD, &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); =20 ich9_pm_add_properties(obj, &lpc->pm); } --=20 2.27.0 From nobody Sat May 18 23:14:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600855050; cv=none; d=zohomail.com; s=zohoarc; b=HBdRKEWrNA8/flmgr7WiMAmJvbKPOaOK6IOAeJ4oasJ+wlVJMzGiQ8+AP4Kz0QSSOHGxdmgtCMSdcy5M7mX3eQfEfuaSU0hCwl8AhuJUN5CDUM5njWHlt8U8E/sPoWmgXCNs2AtUGDKhCnLoxfMM3qppyXsNUSoQyYATxploH18= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600855050; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mqPp2UbFhHw5V0bsorcCcxAuZO9QipCw+rAumQmyMGU=; b=alsM0NvKvGuiwmng1VGGAJ5icKZuhlqfMCvCWfAAt1BIvdS1SmbT83+Af6WWgK+Cs9bg1L+dqLf5Ws6S5vp5xlPyv6G32lULnXlgZgH3ufQJIozDyzwlA5z78X+qbg5okc7nJp5+WcP/qcOHwStr6hpnTkyyp7I+NDZJulbs4wI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600855050235104.19759853900973; Wed, 23 Sep 2020 02:57:30 -0700 (PDT) Received: from localhost ([::1]:56862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kL1Wi-0001mt-TM for importer@patchew.org; Wed, 23 Sep 2020 05:57:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kL1N2-0007Av-Qn for qemu-devel@nongnu.org; Wed, 23 Sep 2020 05:47:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:51561) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kL1Mw-0007XW-UD for qemu-devel@nongnu.org; Wed, 23 Sep 2020 05:47:28 -0400 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-142-iaFTF_tcMviQTZjbPSfXew-1; Wed, 23 Sep 2020 05:47:20 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 531A6801AE9; Wed, 23 Sep 2020 09:47:19 +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 540615576A; Wed, 23 Sep 2020 09:47:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600854442; 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=mqPp2UbFhHw5V0bsorcCcxAuZO9QipCw+rAumQmyMGU=; b=eaXmh3Kmp3WsIqYI2Mh/2h2qTKEaaHUDw7wnWQGeO3OgXeksjbfQh5DCK1JyVk5NFGKMM+ sdsGTQm6ct8xetih7Ng/qlSfH7f1rAVupTI1U4OxshXwPk6+9NcZcEnM+ExFEWUS//+OC/ xUXgD5Pllx6Y/t7I4z5Xk7htttcMX7Q= X-MC-Unique: iaFTF_tcMviQTZjbPSfXew-1 From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH v6 07/11] x86: acpi: introduce AcpiPmInfo::smi_on_cpuhp Date: Wed, 23 Sep 2020 05:46:46 -0400 Message-Id: <20200923094650.1301166-8-imammedo@redhat.com> In-Reply-To: <20200923094650.1301166-1-imammedo@redhat.com> References: <20200923094650.1301166-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass 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/09/23 00:53:58 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.455, 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_H5=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lersek@redhat.com, ankur.a.arora@oracle.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Translate the "CPU hotplug with SMI" feature bit, from the property added in the last patch, to a dedicated boolean in AcpiPmInfo. Signed-off-by: Igor Mammedov Reviewed-by: Laszlo Ersek Tested-by: Laszlo Ersek --- hw/i386/acpi-build.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 0e0535d2e3..b408d62560 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, Acp= iPmInfo *pm) pm->cpu_hp_io_base =3D 0; pm->pcihp_io_base =3D 0; pm->pcihp_io_len =3D 0; + pm->smi_on_cpuhp =3D false; =20 assert(obj); init_common_fadt_data(machine, obj, &pm->fadt); @@ -207,12 +209,16 @@ static void acpi_get_pm_info(MachineState *machine, A= cpiPmInfo *pm) object_property_get_uint(obj, ACPI_PCIHP_IO_LEN_PROP, NULL); } if (lpc) { + uint64_t smi_features =3D object_property_get_uint(lpc, + ICH9_LPC_SMI_NEGOTIATED_FEAT_PROP, NULL); struct AcpiGenericAddress r =3D { .space_id =3D AML_AS_SYSTEM_IO, .bit_width =3D 8, .address =3D ICH9_RST_CNT_IOPORT }; pm->fadt.reset_reg =3D r; pm->fadt.reset_val =3D 0xf; pm->fadt.flags |=3D 1 << ACPI_FADT_F_RESET_REG_SUP; pm->cpu_hp_io_base =3D ICH9_CPU_HOTPLUG_IO_BASE; + pm->smi_on_cpuhp =3D + !!(smi_features & BIT_ULL(ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT)); } =20 /* The above need not be conditional on machine type because the reset= port --=20 2.27.0 From nobody Sat May 18 23:14:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600854883; cv=none; d=zohomail.com; s=zohoarc; b=gw09I2Tea+wnMvgepd5FZUFy/4IUE/7fqovo0Fb2qTZnIG6jlHITAIIrSLzXe6kpUPe6NazJ5J2YYmNRif+FlyhCMT7PY+vBok6KCbjWDz5KeJrlXb8RbOl0XcabUSgTnzTwn9NJPbp+7b3ipvtM49Dz4WxQdQJ9EAv4XXnYZ+8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600854883; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JqvtiRUuNfgUnTSx7g6ihjQg95SSYvwYufJNANjiL50=; b=gCQ0BdbNZxISlkpF1G92RcTN1vIwSdnft9k+uc5t3LaPtVfWazvq7b5XzJgHlOjh49V9JjCkfIASvhSi+V5PfBtixtt3nwJbBWWtEeF2XIJP2LRmfCEbxWAIZsQziRXtXIAO4g2mLK4BgE3CR9Vzh9XOM18ufIcWRkDJdo5P1Jc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600854883748729.2596729686403; Wed, 23 Sep 2020 02:54:43 -0700 (PDT) Received: from localhost ([::1]:50600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kL1U2-0007RQ-Cf for importer@patchew.org; Wed, 23 Sep 2020 05:54:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kL1N0-00076o-ES for qemu-devel@nongnu.org; Wed, 23 Sep 2020 05:47:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:52040) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kL1My-0007Xv-Ct for qemu-devel@nongnu.org; Wed, 23 Sep 2020 05:47:26 -0400 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-87-2Rl-BiuOMS6vf2jyuaqpxw-1; Wed, 23 Sep 2020 05:47:21 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9DE8081F002; Wed, 23 Sep 2020 09:47:20 +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 9E3BD5577A; Wed, 23 Sep 2020 09:47:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600854443; 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=JqvtiRUuNfgUnTSx7g6ihjQg95SSYvwYufJNANjiL50=; b=JZLWzTdnh7bhFA6W471OuLhdcaT0vM9M93Q9ztpJ10Wv1ZobQybdXdx+XUe8z2psEz1Wh4 bpZbj3zOAO3DjFIYHtKH2J2RVxS6RGDLlrnfUYj2Eth9g7yWSML6wD4jIgu2Xj3pklSMJj Y2/oXxn/V3PZZsJvzOz6zhqApb/iQvM= X-MC-Unique: 2Rl-BiuOMS6vf2jyuaqpxw-1 From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH v6 08/11] x86: acpi: introduce the PCI0.SMI0 ACPI device Date: Wed, 23 Sep 2020 05:46:47 -0400 Message-Id: <20200923094650.1301166-9-imammedo@redhat.com> In-Reply-To: <20200923094650.1301166-1-imammedo@redhat.com> References: <20200923094650.1301166-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 23:02:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.455, 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_H5=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lersek@redhat.com, ankur.a.arora@oracle.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" When CPU hotplug with SMI has been negotiated, describe the SMI register block in the DSDT. Pass the ACPI name of the SMI control register to build_cpus_aml(), so that CPU_SCAN_METHOD can access the register in the next patch. Signed-off-by: Igor Mammedov Reviewed-by: Laszlo Ersek Tested-by: Laszlo Ersek --- include/hw/acpi/cpu.h | 1 + hw/i386/acpi-build.c | 29 ++++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) 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; =20 void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures = opts, diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index b408d62560..b49d360ab2 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1521,6 +1521,32 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, aml_append(dev, aml_name_decl("_UID", aml_int(0))); 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 =3D aml_device("PCI0.SMI0"); + aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A06"))); + aml_append(dev, aml_name_decl("_UID", aml_string("SMI resource= s"))); + crs =3D 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 =3D 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); =20 build_hpet_aml(dsdt); @@ -1536,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 =3D { - .acpi_1_compatible =3D true, .has_legacy_cphp =3D true + .acpi_1_compatible =3D true, .has_legacy_cphp =3D true, + .smi_path =3D pm->smi_on_cpuhp ? "\\_SB.PCI0.SMI0.SMIC" : NULL, }; build_cpus_aml(dsdt, machine, opts, pm->cpu_hp_io_base, "\\_SB.PCI0", "\\_GPE._E02"); --=20 2.27.0 From nobody Sat May 18 23:14:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600855148; cv=none; d=zohomail.com; s=zohoarc; b=mWbCi4DAnnKD425NFBe8qf8Dv4Amt2g6L/F/kZUnBTJJfeh2ZOHgHpjnwGmcxqg8rbPMdQE09Ho9x5wv2n8zW8/BQnZY7c3/VIr+IEwjtaS3SYtLfuhIpFc8s14KTHkPDWDHEZ8sU21kzmWaBzLM0Ju3z5glM6nyDkS+mi9rGJM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600855148; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=rqGqtKQYjl+BZQtaCUdh1odL9kYy1L6L1FDqXYexFg0=; b=kTG5s45eJePT+dHMkeaOsiSHnO4+gZ1TwkDRhvGG+J86i1vhaGFcxt3dZ2pS+VIxQnmzAN2kjQ9matTD8Hd5ztQ3+PglpiJHO9uyuW9jnz5p95gECQS0eH120ef5LXuuqeOe3x/cnyubLuEpnbw3wADJn6Qa854J0x1M37+IpJE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600855148950578.2767700699696; Wed, 23 Sep 2020 02:59:08 -0700 (PDT) Received: from localhost ([::1]:33208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kL1YJ-0003jk-6O for importer@patchew.org; Wed, 23 Sep 2020 05:59:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35438) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kL1N1-00079Z-Ub for qemu-devel@nongnu.org; Wed, 23 Sep 2020 05:47:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:54283) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kL1Mz-0007YC-Ji for qemu-devel@nongnu.org; Wed, 23 Sep 2020 05:47:27 -0400 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-224-mK-ltPyAOG6Cs9UQKriZHg-1; Wed, 23 Sep 2020 05:47:22 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EB13F107465A; Wed, 23 Sep 2020 09:47: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 EA41455768; Wed, 23 Sep 2020 09:47:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600854444; 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=rqGqtKQYjl+BZQtaCUdh1odL9kYy1L6L1FDqXYexFg0=; b=KPzrw9o0Z0HKkGNxo7YlqUiz8YGXyYP/grdnXWxJM3K3qkWxwjbj/dbwrLJeJ+KntKEwkk UGRaG+SShhBPUiGW44jNcrGvdxohM9uMHGGI967fUpEweJX8AWzhu/46mHyugtd2c6q+gB zKlDQZ6UVW40GddcwtQKOpMhcCIYofc= X-MC-Unique: mK-ltPyAOG6Cs9UQKriZHg-1 From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH v6 09/11] x68: acpi: trigger SMI before sending hotplug Notify event to OSPM Date: Wed, 23 Sep 2020 05:46:48 -0400 Message-Id: <20200923094650.1301166-10-imammedo@redhat.com> In-Reply-To: <20200923094650.1301166-1-imammedo@redhat.com> References: <20200923094650.1301166-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass 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/09/23 00:53:58 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.455, 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_H5=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lersek@redhat.com, ankur.a.arora@oracle.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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, then send SMI and after that send 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 Tested-by: Laszlo Ersek --- v6: - Add comment explaining why while_ctx2 restarts from the last processed C= PU. v5: - fix hotplug on Windows when there is more than 256 possible CPUs (Windows isn't able to handle VarPackage over 255 elements so process CPUs in batches) - (Laszlo Ersek ) - fix off-by-one in package length - fix not selecting CPU before clearing insert event - use aml_lgreater() instead of aml_lnot(aml_equal(num_added_cpus, zero) - split off in separate patches: - making smi_negotiated_features a property - introduction of AcpiPmInfo.smi_on_cpuhp - introduction of PCI0.SMI0 ACPI device 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 --- hw/acpi/cpu.c | 165 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 138 insertions(+), 27 deletions(-) diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index 3d6a500fb7..8dd4d8ebbf 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 =20 +#define OVMF_CPUHP_SMI_CMD 4 + enum { CPHP_GET_NEXT_CPU_WITH_EVENT_CMD =3D 0, CPHP_OST_EVENT_CMD =3D 1, @@ -321,6 +323,7 @@ const VMStateDescription vmstate_cpu_hotplug =3D { #define CPU_NOTIFY_METHOD "CTFY" #define CPU_EJECT_METHOD "CEJ0" #define CPU_OST_METHOD "COST" +#define CPU_ADDED_LIST "CNEW" =20 #define CPU_ENABLED "CPEN" #define CPU_SELECTOR "CSEL" @@ -465,42 +468,150 @@ void build_cpus_aml(Aml *table, MachineState *machin= e, CPUHotplugFeatures opts, =20 method =3D aml_method(CPU_SCAN_METHOD, 0, AML_SERIALIZED); { + const uint8_t max_cpus_per_pass =3D 255; Aml *else_ctx; - Aml *while_ctx; + Aml *while_ctx, *while_ctx2; Aml *has_event =3D aml_local(0); Aml *dev_chk =3D aml_int(1); Aml *eject_req =3D aml_int(3); Aml *next_cpu_cmd =3D aml_int(CPHP_GET_NEXT_CPU_WITH_EVENT_CMD= ); + Aml *num_added_cpus =3D aml_local(1); + Aml *cpu_idx =3D aml_local(2); + Aml *uid =3D aml_local(3); + Aml *has_job =3D aml_local(4); + Aml *new_cpus =3D aml_name(CPU_ADDED_LIST); =20 aml_append(method, aml_acquire(ctrl_lock, 0xFFFF)); - aml_append(method, aml_store(one, has_event)); - while_ctx =3D aml_while(aml_equal(has_event, one)); + + /* + * Windows versions newer than XP (including Windows 10/Windows + * Server 2019), do support* VarPackageOp but, it is cripled t= o hold + * the same elements number as old PackageOp. + * For compatibility with Windows XP (so it won't crash) use A= CPI1.0 + * PackageOp which can hold max 255 elements. + * + * use named package as old Windows don't support it in local = var + */ + aml_append(method, aml_name_decl(CPU_ADDED_LIST, + aml_package(max_cpus_per_pass= ))); + + aml_append(method, aml_store(zero, uid)); + aml_append(method, aml_store(one, has_job)); + /* + * CPU_ADDED_LIST can hold limited number of elements, outer l= oop + * allows to process CPUs in batches which let us to handle mo= re + * CPUs than CPU_ADDED_LIST can hold. + */ + while_ctx2 =3D aml_while(aml_equal(has_job, one)); { - /* 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(next_cpu_cmd, cpu_cmd)); - ifctx =3D 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)); - aml_append(ifctx, aml_store(one, has_event)); - } - aml_append(while_ctx, ifctx); - else_ctx =3D aml_else(); - ifctx =3D aml_if(aml_equal(rm_evt, one)); - { - aml_append(ifctx, - aml_call2(CPU_NOTIFY_METHOD, cpu_data, 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_ctx2, aml_store(zero, has_job)); + + aml_append(while_ctx2, aml_store(one, has_event)); + aml_append(while_ctx2, aml_store(zero, num_added_cpus)); + + /* + * Scan CPUs, till there are CPUs with events or + * CPU_ADDED_LIST capacity is exhausted + */ + while_ctx =3D 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 w= ill + * 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 lo= op, + * so next_cpu_cmd continues to find already processe= d CPUs + */ + ifctx =3D aml_if(aml_lless(cpu_data, uid)); + { + aml_append(ifctx, aml_break()); + } + aml_append(while_ctx, ifctx); + + /* + * if CPU_ADDED_LIST is full, exit inner loop and pro= cess + * collected CPUs + */ + ifctx =3D aml_if( + aml_equal(num_added_cpus, aml_int(max_cpus_per_pa= ss))); + { + aml_append(ifctx, aml_store(one, has_job)); + aml_append(ifctx, aml_break()); + } + aml_append(while_ctx, ifctx); + + aml_append(while_ctx, aml_store(cpu_data, uid)); + ifctx =3D aml_if(aml_equal(ins_evt, one)); + { + /* 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); + else_ctx =3D aml_else(); + ifctx =3D aml_if(aml_equal(rm_evt, one)); + { + aml_append(ifctx, + 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(while_ctx2, 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 =3D aml_if(aml_lgreater(num_added_cpus, zero)); + { + aml_append(ifctx, aml_store(aml_int(OVMF_CPUHP_SMI= _CMD), + aml_name("%s", opts.smi_path))); + } + aml_append(while_ctx2, ifctx); + } + + /* Notify OSPM about new CPUs and clear insert events */ + aml_append(while_ctx2, aml_store(zero, cpu_idx)); + while_ctx =3D aml_while(aml_lless(cpu_idx, num_added_cpus)= ); + { + aml_append(while_ctx, + aml_store(aml_derefof(aml_index(new_cpus, cpu_idx)= ), + uid)); + aml_append(while_ctx, + aml_call2(CPU_NOTIFY_METHOD, uid, dev_chk)); + aml_append(while_ctx, aml_store(uid, aml_debug())); + aml_append(while_ctx, aml_store(uid, cpu_selector)); + aml_append(while_ctx, aml_store(one, ins_evt)); + aml_append(while_ctx, aml_increment(cpu_idx)); + } + aml_append(while_ctx2, while_ctx); + /* + * If another batch is needed, then it will resume scanning + * exactly at -- and not after -- the last CPU that's curr= ently + * in CPU_ADDED_LIST. In other words, the last CPU in + * CPU_ADDED_LIST is going to be re-checked. That's OK: we= 've + * just cleared the insert event for *all* CPUs in + * CPU_ADDED_LIST, including the last one. So the scan will + * simply seek past it. + */ } - aml_append(method, while_ctx); + aml_append(method, while_ctx2); aml_append(method, aml_release(ctrl_lock)); } aml_append(cpus_dev, method); --=20 2.27.0 From nobody Sat May 18 23:14:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600854539; cv=none; d=zohomail.com; s=zohoarc; b=LXJvsRMvogfVC/nrjsbF4mCGL/1lZjTu+0aFU1ajn4V9BEpJeoHAycdCIyOzsGt4BrfoQonzHYEP1b61KZ9Ruqx2z8RRlDPlg1gWQ9GakdLrluPBrQCQP+s0jszRllz3AtxMDZ6p9YJ5lrndycXAnBAsnqWyYlu54Tswhzxg0H0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600854539; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6b8fKL8tvHPOY4k3zTVgxYCcAcjyZ0dTBf3vXLvbEx4=; b=Tt/jQvx3m4UaaOJVIn2iFtRlCD7xdAIssnMA7YGHXsWa8aUwBnIm+C0dDKTsTExXHCBw7WS8wKjlPBggv5vMDnPA8/4sp21yiSy5Bgfmy0irRJgPJXD2dKsX5cSwhM04OIDite4OlpQm3jfecZSMBycbpoTd0/Hxn48uXYv0K74= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600854539403898.5597999319598; Wed, 23 Sep 2020 02:48:59 -0700 (PDT) Received: from localhost ([::1]:34674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kL1OT-0000cS-RO for importer@patchew.org; Wed, 23 Sep 2020 05:48:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kL1N5-0007F7-1G for qemu-devel@nongnu.org; Wed, 23 Sep 2020 05:47:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:34916) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kL1N1-0007YU-3T for qemu-devel@nongnu.org; Wed, 23 Sep 2020 05:47:30 -0400 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-490-iA1iD51sNq6VbX1GNCJQ_A-1; Wed, 23 Sep 2020 05:47:24 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 68CF11074645; Wed, 23 Sep 2020 09:47:23 +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 4266055768; Wed, 23 Sep 2020 09:47:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600854446; 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=6b8fKL8tvHPOY4k3zTVgxYCcAcjyZ0dTBf3vXLvbEx4=; b=JP74aqnRacGHoULlk+CLmGUoxp3RLNR5S12vgdWSqNG9Cc61JE3BW7oTaq2lgHwzp/bNbL RmemIfMjozYIWPxOLNqM2LiSRrzKkueEpd40mDbMxBR59Vafi9YJrmYhUGku5es03cz6V8 DBJHZBAMLBw2w9jjWlXbt5GzNgO2N8Y= X-MC-Unique: iA1iD51sNq6VbX1GNCJQ_A-1 From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH v6 10/11] tests: acpi: update acpi blobs with new AML Date: Wed, 23 Sep 2020 05:46:49 -0400 Message-Id: <20200923094650.1301166-11-imammedo@redhat.com> In-Reply-To: <20200923094650.1301166-1-imammedo@redhat.com> References: <20200923094650.1301166-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass 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/09/23 00:53:58 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.455, 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_H5=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lersek@redhat.com, ankur.a.arora@oracle.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" here is diff against tests/data/acpi/q35/DSDT for currently shipped ovmf binary. (once firmware blob is updated, it will negotiate CPU hotplug feature which will ad extra hunk sending SMI and Q35 tests will need to be updated), but otherwise diff shows new CPU hotplug AML that is shared between q35 and pc machines. Method (CSCN, 0, Serialized) { Acquire (\_SB.PCI0.PRES.CPLK, 0xFFFF) - Local0 =3D One - While ((Local0 =3D=3D One)) - { - Local0 =3D Zero - \_SB.PCI0.PRES.CCMD =3D Zero - If ((\_SB.PCI0.PRES.CINS =3D=3D One)) + Name (CNEW, Package (0xFF){}) + Local3 =3D Zero + Local4 =3D One + While ((Local4 =3D=3D One)) + { + Local4 =3D Zero + Local0 =3D One + Local1 =3D Zero + While (((Local0 =3D=3D One) && (Local3 < One))) { - CTFY (\_SB.PCI0.PRES.CDAT, One) - \_SB.PCI0.PRES.CINS =3D One - Local0 =3D One + Local0 =3D Zero + \_SB.PCI0.PRES.CSEL =3D Local3 + \_SB.PCI0.PRES.CCMD =3D Zero + If ((\_SB.PCI0.PRES.CDAT < Local3)) + { + Break + } + + If ((Local1 =3D=3D 0xFF)) + { + Local4 =3D One + Break + } + + Local3 =3D \_SB.PCI0.PRES.CDAT + If ((\_SB.PCI0.PRES.CINS =3D=3D One)) + { + CNEW [Local1] =3D Local3 + Local1++ + Local0 =3D One + } + ElseIf ((\_SB.PCI0.PRES.CRMV =3D=3D One)) + { + CTFY (Local3, 0x03) + \_SB.PCI0.PRES.CRMV =3D One + Local0 =3D One + } + + Local3++ } - ElseIf ((\_SB.PCI0.PRES.CRMV =3D=3D One)) + + Local2 =3D Zero + While ((Local2 < Local1)) { - CTFY (\_SB.PCI0.PRES.CDAT, 0x03) - \_SB.PCI0.PRES.CRMV =3D One - Local0 =3D One + Local3 =3D DerefOf (CNEW [Local2]) + CTFY (Local3, One) + Debug =3D Local3 + \_SB.PCI0.PRES.CSEL =3D Local3 + \_SB.PCI0.PRES.CINS =3D One + Local2++ } } Signed-off-by: Igor Mammedov --- tests/qtest/bios-tables-test-allowed-diff.h | 19 ------------------- tests/data/acpi/pc/DSDT | Bin 4934 -> 5060 bytes tests/data/acpi/pc/DSDT.acpihmat | Bin 6258 -> 6385 bytes tests/data/acpi/pc/DSDT.bridge | Bin 6793 -> 6919 bytes tests/data/acpi/pc/DSDT.cphp | Bin 5397 -> 5524 bytes tests/data/acpi/pc/DSDT.dimmpxm | Bin 6587 -> 6714 bytes tests/data/acpi/pc/DSDT.ipmikcs | Bin 5006 -> 5132 bytes tests/data/acpi/pc/DSDT.memhp | Bin 6293 -> 6419 bytes tests/data/acpi/pc/DSDT.numamem | Bin 4940 -> 5066 bytes tests/data/acpi/q35/DSDT | Bin 7678 -> 7804 bytes tests/data/acpi/q35/DSDT.acpihmat | Bin 9002 -> 9129 bytes tests/data/acpi/q35/DSDT.bridge | Bin 7695 -> 7821 bytes tests/data/acpi/q35/DSDT.cphp | Bin 8141 -> 8268 bytes tests/data/acpi/q35/DSDT.dimmpxm | Bin 9331 -> 9458 bytes tests/data/acpi/q35/DSDT.ipmibt | Bin 7753 -> 7879 bytes tests/data/acpi/q35/DSDT.memhp | Bin 9037 -> 9163 bytes tests/data/acpi/q35/DSDT.mmio64 | Bin 8808 -> 8934 bytes tests/data/acpi/q35/DSDT.numamem | Bin 7684 -> 7810 bytes tests/data/acpi/q35/DSDT.tis | Bin 8283 -> 8409 bytes 19 files changed, 19 deletions(-) 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", diff --git a/tests/data/acpi/pc/DSDT b/tests/data/acpi/pc/DSDT index b121bb5bc124be522e233516efb17cdc94de5a75..4ca46e5a2bdb1dfab79dd8630ae= eb9a386d8b30e 100644 GIT binary patch delta 323 zcmX@6c0`@aCD?R*zTg~KaJUN&BFO!?twfB{|5+1F)(_*8UJ7srs~r3*MGCvyD0OxV*en6V(a z1LVj=3DhSEf!vlf~!FvU<74GWSd>u{*D0xc{}+HA|o$prw{_+k$L delta 193 zcmX@2eoT$aCDG5)3}Gx_L>C3B l2AaFjn`MCq%VZl)NnLaWKy6&inEHZz!+`oW@8;y>0szAaHLw5x diff --git a/tests/data/acpi/pc/DSDT.acpihmat b/tests/data/acpi/pc/DSDT.acp= ihmat index b0dbb943f4cea83a5adde23aefa54f1678c560a1..35a74bce8cc152ecb615cb38c4b= 7f63c7c7d3ab3 100644 GIT binary patch delta 304 zcmexl@X?UVCDnK!N}<@<{a$o#}TbOnUO=3D- z>HmKYXFu0)A*TNY49NwIDT`c%CZ{kKFr*YPCKNCvF7oA>Fgby7YBCp70YgGTa*RGp ze6Uk|fU~DTK#*&&bFiz=3Drnh12oLh}Wt7|Mct!x)`I+#-{?mZZv2P>S7B(g?o5=3D^*Rx|k;Zq8-rVC3}Ra}IX)ID{_iTIET1JqD#9t vhA>Xvz$xkvG-aVT%K{IU$>>Uge8U)VXysxqV8o&vXx8L-4zbO5IYsyZgN-`x diff --git a/tests/data/acpi/pc/DSDT.bridge b/tests/data/acpi/pc/DSDT.bridge index 7b6c7a47875fc73b03fbe88807890f3867ddba1a..803d7a8e839ea8b7ac33c449045= 9ddaede584269 100644 GIT binary patch delta 323 zcmeA)Z8zg`33dr#mu6sK6xqnNg^kI}Zt?-P)l9y|lXKbsGP#LO&f$=3D$=3DWzCO4Hshi zU%-%Dz?ibgMQCygV*x`-0b@b|L*gPIo(Yo^7^fx!g%S#qWAs_#gPr07oIMQ!f?R{0 zgI#?J7|;cseO(raPem7XaSTabx`1i$(8AKB&9onzZ33dtTlwx3DZD_~4mrXoJo!Jn=3D;TWr zB23~_Co^&i^CmA{z&SaQ>pxKE(gKi(OY#Dh$uasY@xe~<0nVNV0YR?8&Yph3j0MRZ zAd3;&n=3D6=3DpLZUB`uOrrn* delta 220 zcmbQDJyna#CDKrRx|l|Y|dr3WMuc?a}IX)3nF6IJ8bQ6Kffo4sfz#+DokE@Lv0MS-FWdHyG diff --git a/tests/data/acpi/pc/DSDT.dimmpxm b/tests/data/acpi/pc/DSDT.dimm= pxm index 1649953b6cccb933e4a440dc56507dc9197c4a8a..e015b4594c96a6e0f34c0668e33= 83b9a91dff38e 100644 GIT binary patch delta 308 zcmdmOyvu~kCDKo@lOby*-j6pXgEG>Y_^TW*oDOjK~`8mr z$W@69rHMdyEHqzWIvL%#Am1=3DX=3DMcBZWG?0cMl6y*eWl3-3`vVzS*9i>7BqtmOkzj| c>tQTNjy5bvp6t(|%IfJCT$;2wfiqeF0OOlnivR!s delta 210 zcmdmGvfG%;CDn*;;q2!cF2wY|fFZenF=3Ddg9(Bu@x0)~_V#)JZf#6>hGgdu cw@9FylcNm_k|*!xRAmJkQ<}87m6MYT0IdjJEdT%j delta 202 zcmeCt=3Du_u%33dtT6J}sw4B5!_hmFa{Y%&M?Y9@c}$y?d~vU~732Rr+5Ojh8M;ATu% zNOW-*#}LK>Ms!i2 n>H@}uh2AU+JTQ$4@(sgf6c;ndtjS9_MJ6xg65TAp^@S4v*7-NU diff --git a/tests/data/acpi/pc/DSDT.memhp b/tests/data/acpi/pc/DSDT.memhp index 4026772906e910af514beb76de6e4cca0bc2171b..43f4e114e2cc48c68c35af47303= fa87c9255db40 100644 GIT binary patch delta 323 zcmbPgIN6BHCD+d@E<%%27z-Fu3K$a#7!nux@JyJTz&JG-D3nl;9HY+?AM6w#;OuD-5ab%{ z9PH{-z<@63?CY{Xd@8!Ai(^Rg(gmE86S@8atyx+Cldp%F1yZm;Wim`0ChX}K%vg}z z0diy_Lun$=3DSqsedD$dzSkQer_f*uW%) eWM^)WCZG+`h6Tx!bvRU6ffkk~ZMNl%;0FMI?qN#+ delta 193 zcmbPiG}VyHCDRCMULE) z6Br8^5(*e58*&NzEpTU<9HY+?AM6w#;OuD-5ab%{?CBTG=3Dp5n}i7xKq7{XY+d@E<%%27z-Fu3K$a#7!nux@JyJTz&JG-D3nl;9HY+?AM6w#;OuD-5ab%{ z9PH{-z<@63?CY{Xd@8!Ai(^Rg(gmE86S@8atyx+Cldp%F1yZm;Wim`0ChX}K%vg}z z0diy_Lun$=3DSqsedD$dzSkQer_f*uW%) eWM^)WCZG+`h6Tx!bvRU6ffkk~ZMNm)=3DK=3Dt6nPI;G delta 193 zcmX@5enySUCD52&7B(g)^T`L;Rx`QkOwMKh%jCf~Ifp}ruYfUOkt6ry z1jYh}gaU@ihFrpa3*1>I$LO=3Df2Rp?FIC~ld1i1z~d-?@4I)}JLqKmsYhAUq!chF6fh(%^5K~l78;scyL4FZB(gPlG7f*A{vJ3#g% zGL$9)OR$ W;xDbr3N*SjX|jQo*k*m{^GpEqI!~+s delta 203 zcmexk^Us>gCD~t63UDT ziyXNpComQ;Bor{j=3D(EHJJH-b$dm01;xduBs`?@S}XPNv_N>su*#4QqC+Ql)1adLyS rsDA-t!a{GB1s*Ju(Uk=3DGhB4yM%Ees3h($TjtjPvaVw=3D}WpJxI9Z#6rr diff --git a/tests/data/acpi/q35/DSDT.acpihmat b/tests/data/acpi/q35/DSDT.a= cpihmat index 9cac92418b5fcc2767dc74603d599642b59623fe..2b67045d6add69574499b97d938= cca01949231b4 100644 GIT binary patch delta 288 zcmZ4Gw$h!;CDwfB{|5+1F)(_*8UJ7srs~r3*MGCvyD<+OxC(DsKii3#4Fy%4BqX zo_@iM1<4&CS0*x)CIa2H(0qaE delta 203 zcmZ4KzRHcuCDS9yr@33dtTm1AIF4ByB#L4wK4Zt@(7)l9y|lRYK>vb%{n2Rr+5OnxsZuEXK% z=3DNc}=3D^uK^1xqvZck&Dpe6vhIElmfg0t|!o0~#7jRBaKy;*z{TWpa!@OMI|Xe1Nm3K|qjeu(PLMFk?Y-2gsg8 zhSEf!$qUUFm|`dk@(p8j4snZ2p8Q`*O0hJ#fFWs-E6dcR#DZq9-Xw-(ur$!DXhWb| W{H0Y{fku}mO*W7c+pI7BfC&KA`%aPo delta 203 zcmeCR?YH4_33dtLmt$aH^xnudL4wK0Z1Nn5)lB}{lRYK>vU~732Rr+5OnxsZq0E@D z$dP+;0%HL~LIFdJK1+PCQ+$B4r$IoFYp}Dkugd~=3DmdPKbL?xU<+#=3DDXT^vIgCpSoo q`WG-JEc9ks;K4E(T}hB{7$Xj?T+9WGSd;_Jnrt8?wt21e1112)r8$rQ diff --git a/tests/data/acpi/q35/DSDT.cphp b/tests/data/acpi/q35/DSDT.cphp index 57d859cef9fa16a8f125c4b338611c8472699f38..d7bedee7ff638f11b3bb84ef960= 364b409a49cce 100644 GIT binary patch delta 306 zcmX?Wf5w5!CD=3DRx|kqZ1$A2WUO}=3Da}IX)_snLa?h(0Ry_Av#-kn@u_gp5U6b~jv>iQ7jRBab%7 diff --git a/tests/data/acpi/q35/DSDT.dimmpxm b/tests/data/acpi/q35/DSDT.di= mmpxm index 9d5bd5744e2ba2e0f6126c3aba0bb36af865e499..13e80ae2e5c7606a7260d4cb3ab= 776488d0697d6 100644 GIT binary patch delta 325 zcmezD@yV0RCDvQVJLo3K$X>`SMJdoWM9WnTw@>A)z2SMxP}<*eO21+0!5( z$TiqG*wv?i0bS79*JXkDRCG}n$B^Wu3pghya{UL|v$OyzUk^76q+o%{WORL=3De!+|d z$sHh9CNh*J0^POHe1R#3vLN3uM&}T>$Yd_&0!DN*fRaFcrO5>hNsC-rrY0p8G=3DmLH eVo2rzYXaI3ZCH>zSzAh#6=3D-2;(qSy^)^ue diff --git a/tests/data/acpi/q35/DSDT.ipmibt b/tests/data/acpi/q35/DSDT.ipm= ibt index 5cd11de6a8fe47324e5f922823a22746882f19f5..9a1b635dab776fb25e378a00e6c= a0cadf9902c25 100644 GIT binary patch delta 286 zcmX?UbKI88CD?S{#Sk2^XJb8-bUv@V!=3DU`_)j>#7##p^ko z{anL^nEn?qBo{EIEOHT=3DoWfYZkW#>yP{5G5$cJab#fDMO_?2l9w*voSew@A85_e0+_rh%q)XI0eokQFr afo@KYHY`YCDcG{iGCD?hBWSk2^YGTBq|FT0zVbFi}?$K>~t;yN78 zey-s{O#cfQk_#A97P$ybPGKxyNGV`UC}2ojrG-v21^6YiZ%qg W#a~*L6=3D-y6(qscEvCaC@avT8KEKcbF delta 203 zcmX@@e%6i4CDUq!chF6fh(%^5K~l78;scyL4FZB(gPlG7f*A{vJ3#g% zGL$9)OR$ W;xDbr3N*SjX|jQo*k*lcOLhR{%1;Xb delta 203 zcmaFn`oe|FCD)i<1PLZ5^T~50Rx`QkO!k!g%kIJF9PI4JG5Niugfe5o zB1i7Y35*2{2?Y!>`YiFmPVoWGo(2IyuEEaEzAg*gStfs!5|wZcaf?Kkc5w`0oZKKS q>R-T^u+W=3Djfd|WEbR|K)VT?GmaxoV$Vo?q>YqEiq*ygp;mh1qbnmP#p diff --git a/tests/data/acpi/q35/DSDT.numamem b/tests/data/acpi/q35/DSDT.nu= mamem index 1978b55f1255402bf9bade0b91150b5cb49789a4..2b2433cc13ec3110abbc8440a0b= 1ad8c487edb6c 100644 GIT binary patch delta 249 zcmZp%X|m;V33dr-l4D?COx(ydL4wJ_e)1fN)lAMNlRYK>vb%{n2Rr+5OnxsZuEXK% z=3DNc}=3D^uK^1xqvZck&Dpe6vhIElmfg0t|!o0~#7jRBaKy;*z{TWpa!@OMI|Xe1Nm3K|qjeu(PLMFk?Y-2gsg8 zhSEf!$qUUFm|`dk@(p8j4snZ2p8Q`*O0hJ#fFWs-E6dcR#DZq9-Xw-(ur$!DXhWb| W{H0Y{fku}mO*W7c+pI5rl?ec^mQG#( delta 203 zcmZp&ZL#5U33dr#kz-(B4Bf~zL4wK2eDWNL)l9BBlRYK>vU~732Rr+5OnxsZq0E@D z$dP+;0%HL~LIFdJK1+PCQ+$B4r$IoFYp}Dkugd~=3DmdPKbL?xU<+#=3DDXT^vIgCpSoo q`WG-JEc9ks;K4E(T}hB{7$Xj?T+9WGSd;_Jnrt8?wt21eRVDzYo;h3q diff --git a/tests/data/acpi/q35/DSDT.tis b/tests/data/acpi/q35/DSDT.tis index 638de3872673d17b1958497d0e62c83653de1602..dd06ee4c348930b0684827ca057= 47b4f65dbd6b2 100644 GIT binary patch delta 249 zcmccZaMO{?CD?Y5VSk2^XJlRw7FT0zVbFi}?$K>~t;yN78 zey-s{O#cfQk_#A97P$ybPGKxyNGV`UC}2ojrG-v21^6YiZ%qg W#a~*L6=3D-y6(qscEvCaC@I;;Tg4o?UG delta 203 zcmccVc-w)?CD`YiFmPVoWGo(2IyuEEaEzAg*gStfs!5|wZcaf?Kkc5w`0oZKKS q>R-T^u+W=3Djfd|WEbR|K)VT?GmaxoV$Vo?q>YqEiq*ygp;I;;SvwmJp? --=20 2.27.0 From nobody Sat May 18 23:14:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600854748; cv=none; d=zohomail.com; s=zohoarc; b=GQ4HVhpfsHI2w6/3d4jzshmWthB+BUwiPpXXticJU3cdppJBgztjdRefG5J9NOGpyUE4O8c7xOpBUGMV5PUJZ7638mqTODuL8T6NhrAcVUmKtBqVXTXFY6GX0p7mzdQmkdLeLGGRFXpvJbIloxujHUK3Bko+IAPFPn0PtR0pON4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600854748; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oo3FyNnbdE1oNfEAiuyaQMsztgoSnO7oGPNBLGVebbs=; b=HKJmEOv6q5c/rLnKh0P4LcQlun8MMUYya5LwfNxMlUPL5Nbx3rr/HL3vB4cYHHED47QuDfDPdk0WBUNYFottLPw2WX6w0m3oglkZ5vH/mRsSYPDfwObvclAOC2Ju/ULhktwrmyb1M+EtS3sS6jvOAOwMB8xUkSyfhFnvUQXh3Vo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600854748538523.7833888779131; Wed, 23 Sep 2020 02:52:28 -0700 (PDT) Received: from localhost ([::1]:43310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kL1Rq-0004LB-55 for importer@patchew.org; Wed, 23 Sep 2020 05:52:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kL1N6-0007HD-5w for qemu-devel@nongnu.org; Wed, 23 Sep 2020 05:47:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:49764) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kL1N2-0007Yg-64 for qemu-devel@nongnu.org; Wed, 23 Sep 2020 05:47:31 -0400 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-236-3wznwnk3Poe_zpEBCKFHeg-1; Wed, 23 Sep 2020 05:47:25 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B37C4186DD35; Wed, 23 Sep 2020 09:47: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 B457F55778; Wed, 23 Sep 2020 09:47:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600854447; 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=oo3FyNnbdE1oNfEAiuyaQMsztgoSnO7oGPNBLGVebbs=; b=ic3mRhibOHbyGlXzR0l8BIHnV6gZrJ59Yem/XLvw94/Pei4yNZL3NxRYloN84x+h3i+zze w0By5ntslYyCVJoY9nH3ppMnEXowiNrmKQR80WHy543vqWhsNUFXkSQiYBg36hh/LbvKQt DcVanx8q8fUbha+df7D1ho2ZVeo8qvw= X-MC-Unique: 3wznwnk3Poe_zpEBCKFHeg-1 From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH v6 11/11] smp: drop support for deprecated (invalid topologies) Date: Wed, 23 Sep 2020 05:46:50 -0400 Message-Id: <20200923094650.1301166-12-imammedo@redhat.com> In-Reply-To: <20200923094650.1301166-1-imammedo@redhat.com> References: <20200923094650.1301166-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass 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/09/23 00:53:58 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.455, 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_H5=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lersek@redhat.com, ankur.a.arora@oracle.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" it's was deprecated since 3.1 Support for invalid topologies is removed, the user must ensure that topologies described with -smp include all possible cpus, i.e. (sockets * cores * threads) =3D=3D maxcpus or QEMU will exit with error. Signed-off-by: Igor Mammedov --- docs/system/deprecated.rst | 26 +++++++++++++------------- hw/core/machine.c | 16 ++++------------ hw/i386/pc.c | 16 ++++------------ 3 files changed, 21 insertions(+), 37 deletions(-) diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst index 808c334fe7..fb95d2ecc4 100644 --- a/docs/system/deprecated.rst +++ b/docs/system/deprecated.rst @@ -47,19 +47,6 @@ The 'file' driver for drives is no longer appropriate fo= r character or host devices and will only accept regular files (S_IFREG). The correct driver for these file types is 'host_cdrom' or 'host_device' as appropriate. =20 -``-smp`` (invalid topologies) (since 3.1) -''''''''''''''''''''''''''''''''''''''''' - -CPU topology properties should describe whole machine topology including -possible CPUs. - -However, historically it was possible to start QEMU with an incorrect topo= logy -where *n* <=3D *sockets* * *cores* * *threads* < *maxcpus*, -which could lead to an incorrect topology enumeration by the guest. -Support for invalid topologies will be removed, the user must ensure -topologies described with -smp include all possible cpus, i.e. -*sockets* * *cores* * *threads* =3D *maxcpus*. - ``-vnc acl`` (since 4.0.0) '''''''''''''''''''''''''' =20 @@ -642,6 +629,19 @@ New machine versions (since 5.1) will not accept the o= ption but it will still work with old machine types. User can check the QAPI schema to see if the = legacy option is supported by looking at MachineInfo::numa-mem-supported property. =20 +``-smp`` (invalid topologies) (removed 5.2) +''''''''''''''''''''''''''''''''''''''''''' + +CPU topology properties should describe whole machine topology including +possible CPUs. + +However, historically it was possible to start QEMU with an incorrect topo= logy +where *n* <=3D *sockets* * *cores* * *threads* < *maxcpus*, +which could lead to an incorrect topology enumeration by the guest. +Support for invalid topologies is removed, the user must ensure +topologies described with -smp include all possible cpus, i.e. +*sockets* * *cores* * *threads* =3D *maxcpus*. + Block devices ------------- =20 diff --git a/hw/core/machine.c b/hw/core/machine.c index ea26d61237..09aee4ea52 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -754,23 +754,15 @@ static void smp_parse(MachineState *ms, QemuOpts *opt= s) exit(1); } =20 - if (sockets * cores * threads > ms->smp.max_cpus) { - error_report("cpu topology: " - "sockets (%u) * cores (%u) * threads (%u) > " - "maxcpus (%u)", + if (sockets * cores * threads !=3D ms->smp.max_cpus) { + error_report("Invalid CPU topology: " + "sockets (%u) * cores (%u) * threads (%u) " + "!=3D maxcpus (%u)", sockets, cores, threads, ms->smp.max_cpus); exit(1); } =20 - if (sockets * cores * threads !=3D ms->smp.max_cpus) { - warn_report("Invalid CPU topology deprecated: " - "sockets (%u) * cores (%u) * threads (%u) " - "!=3D maxcpus (%u)", - sockets, cores, threads, - ms->smp.max_cpus); - } - ms->smp.cpus =3D cpus; ms->smp.cores =3D cores; ms->smp.threads =3D threads; diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 2af660c55e..53e21a186d 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -748,23 +748,15 @@ void pc_smp_parse(MachineState *ms, QemuOpts *opts) exit(1); } =20 - if (sockets * dies * cores * threads > ms->smp.max_cpus) { - error_report("cpu topology: " - "sockets (%u) * dies (%u) * cores (%u) * threads = (%u) > " - "maxcpus (%u)", + if (sockets * dies * cores * threads !=3D ms->smp.max_cpus) { + error_report("Invalid CPU topology deprecated: " + "sockets (%u) * dies (%u) * cores (%u) * threads = (%u) " + "!=3D maxcpus (%u)", sockets, dies, cores, threads, ms->smp.max_cpus); exit(1); } =20 - if (sockets * dies * cores * threads !=3D ms->smp.max_cpus) { - warn_report("Invalid CPU topology deprecated: " - "sockets (%u) * dies (%u) * cores (%u) * threads (= %u) " - "!=3D maxcpus (%u)", - sockets, dies, cores, threads, - ms->smp.max_cpus); - } - ms->smp.cpus =3D cpus; ms->smp.cores =3D cores; ms->smp.threads =3D threads; --=20 2.27.0