From nobody Thu Nov 14 17:05:46 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+70380+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+70380+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1610696758; cv=none; d=zohomail.com; s=zohoarc; b=asw83mzfP1/b9y012d+j9gECbNk3clCZIFfcUUhdl/MY7fVa4ofDohTdKaUm2gruIDM/gAJ7Job5muMkwyBDXw00WHl6x24bGmYB3uRA87VOiv2odXTlodyxD/FzyksUr8RuDMAfaTl2hucXROe6jQDwrKOGTPtPxvW7Ov5Wf84= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610696758; 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=UyvArbz3X5Ex+UUpAjKbHhs/70NzoakHS1x+ur2i4Po=; b=eDYmik9N6OysWkuTDweOhXDWcFoqqA75ziALYAhEdoH8tItZ6yPiv/wbd8LvrdB9n1UgSoMuktg3ZTUt5nS7VlveejctKxMk4SONKnNtR2pQd7Rw3KVmI/oD7wq+IosztKiYnjlQjh2d3hk58txhGv9D1d+tqFHFkEXcJJ8jDhQ= 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+70380+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 161069675826798.51125689931257; Thu, 14 Jan 2021 23:45:58 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id wdjIYY1788612xsxzQRfqpMb; Thu, 14 Jan 2021 23:45:57 -0800 X-Received: from aserp2130.oracle.com (aserp2130.oracle.com [141.146.126.79]) by mx.groups.io with SMTP id smtpd.web09.1065.1610696752388798541 for ; Thu, 14 Jan 2021 23:45:52 -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 10F7i0AZ185551; Fri, 15 Jan 2021 07:45:49 GMT X-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2130.oracle.com with ESMTP id 360kg23req-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Jan 2021 07:45:49 +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 10F7eeNO005459; Fri, 15 Jan 2021 07:45:48 GMT X-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 360kfapwp7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Jan 2021 07:45:48 +0000 X-Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 10F7jlgW013356; Fri, 15 Jan 2021 07:45:47 GMT X-Received: from localhost.localdomain (/70.36.60.91) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 14 Jan 2021 23:45:47 -0800 From: "Ankur Arora" To: devel@edk2.groups.io Cc: imammedo@redhat.com, lersek@redhat.com, Ankur Arora , Jordan Justen , Ard Biesheuvel , Boris Ostrovsky , Aaron Young Subject: [edk2-devel] [PATCH v3 09/10] OvmfPkg/SmmControl2Dxe: negotiate hot-unplug Date: Thu, 14 Jan 2021 23:45:32 -0800 Message-Id: <20210115074533.277448-10-ankur.a.arora@oracle.com> In-Reply-To: <20210115074533.277448-1-ankur.a.arora@oracle.com> References: <20210115074533.277448-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: HFAhAyWEdv17eJGvdTnlgOkox1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1610696757; bh=+STvSPYWgWJUBoLSvKM6xwDzHh/hS0yrfNZOewL6K24=; h=Cc:Date:From:Reply-To:Subject:To; b=j9WXb0xq6WH8HeuIolM6Hbjm7Mg5Ae6FORwmtwSpqM3J7Jt4hS4REGbYQy+Rk+iRQbE a8q5W6x2ghOnleNQc8M33SkSHahNk9hlAyQqo40tcweU8hp45AeMhr/YijiJwjimdg45o wfZAd6lblyIybCdR6jJoeSkHbVLOs/vbano= 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 | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c b/OvmfPkg/SmmControl2Dxe/= SmiFeatures.c index c9d875543205..9c205af00a08 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. @@ -120,8 +127,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-feat %x, 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 +179,8 @@ 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) ? ", un= plug" : "")); } =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 (#70380): https://edk2.groups.io/g/devel/message/70380 Mute This Topic: https://groups.io/mt/79697151/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-