From nobody Thu Nov 14 16:50:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+70484+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+70484+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1610951715; cv=none; d=zohomail.com; s=zohoarc; b=QM4hRIZJYLe1v4tQ1UchSUKPH59Dhv6qFt0uU+vFRPt1YEFQrPBaGVMdXvDGGEMy3Hhcsx1taTgU6gyigGD4VW2EJrhpKfhGRKWEDhE2E6fpE2Rsbr1+Bei1ahwLwgnFUEpSnfn/Fy5SCuU973/IxYP+zvHNu5a0ZtwarenqK3w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610951715; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=j/nyFUvstJYbH+AStZq974CeXEaYfHcp+04QDtLkuIQ=; b=YTGAYf0fpPmHVF3bWnKbM0K0+OenSNiBMWH0qNsoVui1CtNVyu1zR1FCx3a4GoQQGwLEXNOMrF17EzDilfXUTnvo3iQjx+TgzxB9mMEGHDqvcT19TLj8ytZIzPC7e3ykiAPcwAuXxml/M2SDvBLGMz5yi22FKmr/yoLJvq0oUCw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+70484+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 161095171568515.161449981018222; Sun, 17 Jan 2021 22:35:15 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id MfDpYY1788612x45LRDpGdbp; Sun, 17 Jan 2021 22:35:15 -0800 X-Received: from aserp2130.oracle.com (aserp2130.oracle.com [141.146.126.79]) by mx.groups.io with SMTP id smtpd.web08.30321.1610951714792259963 for ; Sun, 17 Jan 2021 22:35:14 -0800 X-Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10I6YUxY131333; Mon, 18 Jan 2021 06:35:11 GMT X-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2130.oracle.com with ESMTP id 363nnabtan-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 18 Jan 2021 06:35:11 +0000 X-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10I6UqO4031773; Mon, 18 Jan 2021 06:35:10 GMT X-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 3649wpejqd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 18 Jan 2021 06:35:10 +0000 X-Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 10I6Z9lm001703; Mon, 18 Jan 2021 06:35:09 GMT X-Received: from prion.us.oracle.com (/10.159.226.191) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 17 Jan 2021 22:35:09 -0800 From: "Ankur Arora" To: devel@edk2.groups.io Cc: lersek@redhat.com, imammedo@redhat.com, boris.ostrovsky@oracle.com, Ankur Arora , Jordan Justen , Ard Biesheuvel , Aaron Young Subject: [edk2-devel] [PATCH v4 9/9] OvmfPkg/SmmControl2Dxe: negotiate CPU hot-unplug Date: Sun, 17 Jan 2021 22:34:57 -0800 Message-Id: <20210118063457.358581-10-ankur.a.arora@oracle.com> In-Reply-To: <20210118063457.358581-1-ankur.a.arora@oracle.com> References: <20210118063457.358581-1-ankur.a.arora@oracle.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ankur.a.arora@oracle.com X-Gm-Message-State: lvBMNLRW8HvPllsopuzbNr4Kx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1610951715; bh=QvQcpUHN4mZ1o8/yjGGPulOaGJawPP3s9VWPCLbqt/Y=; h=Cc:Date:From:Reply-To:Subject:To; b=mO0V1K4/v+O9/fajvlWuBOXbXexICy2oSzQJK3S/RA6511MQvaFx0r+maOhTJj4EVcd O1yiml+DrOEsHyG8UXPib1f+vo1H4HximY0s8BS90NRcjzMN8n9EHtVXDf6VDzGg0m0wI EsTRJizF0v6IDvzTnszLa0UGy5hlX3tlhj4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" As part of the negotiation treat ICH9_LPC_SMI_F_CPU_HOT_UNPLUG as a subfeature of feature flag ICH9_LPC_SMI_F_CPU_HOTPLUG, so enable it only if the other is also being negotiated. Cc: Laszlo Ersek Cc: Jordan Justen Cc: Ard Biesheuvel Cc: Igor Mammedov Cc: Boris Ostrovsky Cc: Aaron Young Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3132 Signed-off-by: Ankur Arora --- OvmfPkg/SmmControl2Dxe/SmiFeatures.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c b/OvmfPkg/SmmControl2Dxe/= SmiFeatures.c index c9d875543205..00185253a820 100644 --- a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c +++ b/OvmfPkg/SmmControl2Dxe/SmiFeatures.c @@ -29,6 +29,13 @@ // #define ICH9_LPC_SMI_F_CPU_HOTPLUG BIT1 =20 +// The following bit value stands for "enable CPU hot unplug, and inject a= n SMI +// with control value ICH9_APM_CNT_CPU_HOT_UNPLUG upon hot unplug", in the +// "etc/smi/supported-features" and "etc/smi/requested-features" fw_cfg fi= les. +// Can only be negotiated alongside ICH9_LPC_SMI_F_CPU_HOTPLUG. +// +#define ICH9_LPC_SMI_F_CPU_HOT_UNPLUG BIT2 + // // Provides a scratch buffer (allocated in EfiReservedMemoryType type memo= ry) // for the S3 boot script fragment to write to and read from. @@ -112,7 +119,8 @@ NegotiateSmiFeatures ( QemuFwCfgReadBytes (sizeof mSmiFeatures, &mSmiFeatures); =20 // - // We want broadcast SMI, SMI on CPU hotplug, and nothing else. + // We want broadcast SMI, SMI on CPU hotplug, on CPU hot-unplug + // and nothing else. // RequestedFeaturesMask =3D ICH9_LPC_SMI_F_BROADCAST; if (!MemEncryptSevIsEnabled ()) { @@ -120,8 +128,18 @@ NegotiateSmiFeatures ( // For now, we only support hotplug with SEV disabled. // RequestedFeaturesMask |=3D ICH9_LPC_SMI_F_CPU_HOTPLUG; + RequestedFeaturesMask |=3D ICH9_LPC_SMI_F_CPU_HOT_UNPLUG; } mSmiFeatures &=3D RequestedFeaturesMask; + + if (!(mSmiFeatures & ICH9_LPC_SMI_F_CPU_HOTPLUG) && + (mSmiFeatures & ICH9_LPC_SMI_F_CPU_HOT_UNPLUG)) { + DEBUG ((DEBUG_WARN, "%a CPU host-features %Lx, requested mask %Lx\n", + __FUNCTION__, mSmiFeatures, RequestedFeaturesMask)); + + mSmiFeatures &=3D ~ICH9_LPC_SMI_F_CPU_HOT_UNPLUG; + } + QemuFwCfgSelectItem (mRequestedFeaturesItem); QemuFwCfgWriteBytes (sizeof mSmiFeatures, &mSmiFeatures); =20 @@ -162,8 +180,9 @@ NegotiateSmiFeatures ( if ((mSmiFeatures & ICH9_LPC_SMI_F_CPU_HOTPLUG) =3D=3D 0) { DEBUG ((DEBUG_INFO, "%a: CPU hotplug not negotiated\n", __FUNCTION__)); } else { - DEBUG ((DEBUG_INFO, "%a: CPU hotplug with SMI negotiated\n", - __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: CPU hotplug%s with SMI negotiated\n", + __FUNCTION__, + (mSmiFeatures & ICH9_LPC_SMI_F_CPU_HOT_UNPLUG) ? ", unplug" : "")); } =20 // --=20 2.9.3 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#70484): https://edk2.groups.io/g/devel/message/70484 Mute This Topic: https://groups.io/mt/79917581/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-