From nobody Thu Nov 14 16:54:08 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+71921+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+71921+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oracle.com Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1613978402296511.562059770293; Sun, 21 Feb 2021 23:20:02 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id OjaYYY1788612xHXLlJ0vjwU; Sun, 21 Feb 2021 23:20:01 -0800 X-Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by mx.groups.io with SMTP id smtpd.web09.32253.1613978396461566180 for ; Sun, 21 Feb 2021 23:19:56 -0800 X-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11M7FAU5133303; Mon, 22 Feb 2021 07:19:52 GMT X-Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 36tsuqtku4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Feb 2021 07:19:52 +0000 X-Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11M7GSLC067574; Mon, 22 Feb 2021 07:19:51 GMT X-Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by aserp3020.oracle.com with ESMTP id 36ucawnxq0-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Feb 2021 07:19:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B+/0Vw3bOBgGx5tQ35WhfYzIYuayAhIW7PtjIJkTvCJ3x9IVe+ptatJhJCS1jdVeVXyia6XsGgWdXOdGQ4G2BwLbtDowGd3kkpRHg7ihOQ/ZpD7bCUgdVajll7EKIpqXg64jJ2J9iida9MEBL1dcDvHARQXw/MZdszlMVg/8q61ajjdcNEByGyKSi+/Wi38V4OOSVb+NbbVvGdIVkSVT+HAisawt+MIgH7tHuvFzVxYshdi2V/aiX0RrilRCUoeYu091coYhR5jD7oM+Pakx1U8zI1LgLB4N3tP03WwbMyoag1E4lglCg0OKVxry9oj7SHX31Md6giL9Bf7gWbFfpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9bkWGfoq1y7L5hpHb9XwV6nCkXOVbulHM1KyVz0wRtg=; b=dv+wo3u7+FaeU0aKV3YsWlgqP3SiQa/GShEqUfK9EZrCsh/gS3mt6PJx3Nw0H02n6DUe+8nQPuDkmAcinYDmApoJS90AR15bN3aefuSS++YcveYAyV+YrVDSNfd+HdhU3XpdY5mHNu7mtjtYNfwVuNEbb4VjUI3+P90oWSyAnYjv+hwmGjcEi0Ab5JZlWmIf6/IKAPCIMMLCuhr2VLcIHJcxi8x+HUNOMH/wO0eRUIxZu8BdMkupyT/9NiS3q11+cE56sn4SFl/7g7sMzfVhjK7c1+BuXxaA7xvhbM3vnsGiKY4OC9o7Oq0A9q62O6M84Uz/yXJ7BLZ3eW4rKCzcEw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none X-Received: from SJ0PR10MB4605.namprd10.prod.outlook.com (2603:10b6:a03:2d9::24) by BY5PR10MB3922.namprd10.prod.outlook.com (2603:10b6:a03:1fd::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.32; Mon, 22 Feb 2021 07:19:50 +0000 X-Received: from SJ0PR10MB4605.namprd10.prod.outlook.com ([fe80::a021:790:7ce6:6f16]) by SJ0PR10MB4605.namprd10.prod.outlook.com ([fe80::a021:790:7ce6:6f16%6]) with mapi id 15.20.3868.033; Mon, 22 Feb 2021 07:19:49 +0000 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 v8 10/10] OvmfPkg/SmmControl2Dxe: negotiate CPU hot-unplug Date: Sun, 21 Feb 2021 23:19:28 -0800 Message-Id: <20210222071928.1401820-11-ankur.a.arora@oracle.com> In-Reply-To: <20210222071928.1401820-1-ankur.a.arora@oracle.com> References: <20210222071928.1401820-1-ankur.a.arora@oracle.com> X-Originating-IP: [148.87.23.11] X-ClientProxiedBy: MWHPR17CA0065.namprd17.prod.outlook.com (2603:10b6:300:93::27) To SJ0PR10MB4605.namprd10.prod.outlook.com (2603:10b6:a03:2d9::24) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from prion.us.oracle.com (148.87.23.11) by MWHPR17CA0065.namprd17.prod.outlook.com (2603:10b6:300:93::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.27 via Frontend Transport; Mon, 22 Feb 2021 07:19:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 93931eab-db88-4230-30f9-08d8d7023d8d X-MS-TrafficTypeDiagnostic: BY5PR10MB3922: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: F3SEbQiu1n7jqQUf3fnlHEeiaf5OHSZNZ+Y4TsPULq16IKF0kg1K24QIaUfldBUwzU7ZXg/+OUGGHhertCMFfAXIuKRI8k/1cWSpsSW2d/KWrEys79NnON/zbDlshJVM31OaqRHcvFPETd/jeSSZ4Clssh7285dN/86LndAjyLefoYlOZBAfpgcFmPSlVxbjVPVj9d1w0359+EDkT/iwAdQVlQamoB0zRS55CR3IVq1UNJCh5SLQQY1j6OTsLqlNHQAfBCHlgLdR9TkkmRM+1eBu4FQVtXlXQpqQ3CgTptV9UElRBZg2nDJCvQhMMtjxBHsKrbeHX7v41EEUoxCjBaCYmwgxv746IVxo6MRgKMK8xUCk4L9shz/8bvDlVW98tu99CV8un2uJMkWQp90j0uEhNgL06IPU1rQnuzmOVbwPBNLfYnIhmWz2htwdS2FH/dvo2/d443/Cf1CrUi2vzz7DvHxLMWLo0wegHIpXj2FZrs92SSUJoxBdnFhr9qINir/kpuGFGfTYr3ooT9i92ZsCM8R65tOvod3r9LWfy5ofUZAQlykkHoPSyPYTt5JilhSQ4X6rpheGk5afsLF/tOaR+RQ0BZF1RouSCL3MhZg= X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?F3qei1Sb2soyURQDN4q4/Vz/LrOcEUL2Nb0S5UpNr6cyW5pI5Md0PfIeELXL?= =?us-ascii?Q?YDpzgdwZTtvW3HqqvtKdFWoipmX01q11Vf41B3BLX2lPVksl3vCndwmuuxN8?= =?us-ascii?Q?IkzY0AxjUQ6bk4VqVledsKXSvzIAOBh+lhsn64/v3E9ZRcs5SZPi9FTSjYzo?= =?us-ascii?Q?O9uxyqYHmnihyoVxYriBYRIs/c+/FfHieJ8ZKFU6AT3uNzWNGP+gOevNLX+x?= =?us-ascii?Q?MBo4vu+dSOUulZy8amoKPfyQc3yx/TEglv4+EF13Uyny3iQB67RyPd8k0amo?= =?us-ascii?Q?jNlYRREON2MtYx5yV8sj+fgNMLURk2+5ZB752Z7bFDWJ4WVy4G8EElkDt17G?= =?us-ascii?Q?uhmPhGAB1TpMoAdybnkpEWtaef/EKdbIJnOPmi2zeQ74ZRLirtQeZyfsGZTJ?= =?us-ascii?Q?2YZoqiX8ik08XEYcG8gKretGz5rticxtX1Vc7nxbeEe96RRY7TedsPSoIkcB?= =?us-ascii?Q?3SgxGNsv70pdxzFYMe4pYKc2JeqeVC1Emb2/U0oAZ83s16hfURdnwHOqRvNW?= =?us-ascii?Q?O2QExOIU6dYgxNkO/XiM4R6PlRklf//yuhpW2sZOxOJfb5KS6vd/JEx+imZW?= =?us-ascii?Q?JaL16dU88tyDUpQjw2GbEpmOlTEzerIVmwxmJjPgPIuaswb3/L5onhpe+KN/?= =?us-ascii?Q?TwxNXWI83ChE6ALuhqm9UcwRepRRkW+Cd0vyC5T28CvaJCyqUKpuHN5H3p9y?= =?us-ascii?Q?lTTBBOZHAjyKT8s7QSbasf5WOyGi7343qCs+4VCKheqdcekgHA4TEjBVOe2Y?= =?us-ascii?Q?NHPN2v7kNdQXmuey2/X1NH5z/Jx6Gqxoxcgl8fc/bG/RQTO+vkxvmmzSWpta?= =?us-ascii?Q?pBkY6J50zDq7mW8cXi54/n9+JqunvMUjf7rRKFLK31/ioL/KTMI9MvZrP+H7?= =?us-ascii?Q?Jp3CWm1djxFlA1gfDqZtwFeKInED39ClCgIb6pKymq5q/EhKQY2YJActpSkQ?= =?us-ascii?Q?myiDunO5BV9dSLurKaxelKa7pG4Q4jdSZNmQxl2Vo5oPjmaKpF8BVr6sgnw6?= =?us-ascii?Q?yTaCX5HOsPmPvamJS+ivcJBTetOumi843ASbpRbWY39as/yJn3491SggEim+?= =?us-ascii?Q?wTaZVY8Ohu1muHH58Zmf6SYs4dr0TxWCBcrjr929AUhmT1o6tONru4Ldp+iA?= =?us-ascii?Q?NIONISruWlZhKlRund7/uZN8g1ZQbQWV7Kn00EMqP+cl2LxzfyL+vc5uMNFj?= =?us-ascii?Q?crcjMuklVHFFlgSEeqqnmdEsFdiSg1GT/81w4yR/+gXoOJf+PjYcTnv4VoSX?= =?us-ascii?Q?et1l9JLgU4rV70APewb+1l3DgbdgufZWKu0LhNqwiN3y0b43OrjVcVBH49Pq?= =?us-ascii?Q?yAnwby3+h/DhHugH3Qvp3pVn?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 93931eab-db88-4230-30f9-08d8d7023d8d X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4605.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2021 07:19:49.6958 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vnVfv3rKh5PgFx0oksq9CZLlD4rCH7ZI7S2rmBSwrn+GtQJZ/1BuEiJI0B6cAAHmnp3cFzKxZ859FP12JebtbHMhPly3Cafd2VBk6FUGMxQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB3922 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: rc7YC5ShrMGlUwIYUKDJAYD0x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1613978401; bh=N3x2yOWSOdMTpRm8cCr5XqeN199yT5v3M/qfwUK/lIM=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=Hu6jxL2LhuNiyEKQEs50OiL/zWDJVySl6NXaGuKiFUNJFWwJY88R6ndZ0RYdtgU7l6n q8jQ2cRrVB9QI/Bvg8BmgjaTNYQSe/frwB8FlK8e8AvonN3P+5UqFD3zS34iF1S4i2tyO UBLxfIEExUb3c51/VInGRJhUm0SoxPeJymM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Advertise OVMF support for CPU hot-unplug and negotiate it if QEMU requests the feature. 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 --- Notes: Addresses the following review comments: (1,3) s/hot unplug/hot-unplug/ (2) Get rid of the reference to the made up ICH9_APM_CNT_CPU_HOT_UNPLUG (4,6) Remove the artificial tie in between ICH9_LPC_SMI_F_CPU_HOTPLUG, ICH9_LPC_SMI_F_CPU_HOT_UNPLUG. (5) Fully spell out "SMI on CPU hot-unplug". (7) Emit separate messages on negotiation (or not) of ICH9_LPC_SMI_F_CPU_HOT_UNPLUG. OvmfPkg/SmmControl2Dxe/SmiFeatures.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c b/OvmfPkg/SmmControl2Dxe/= SmiFeatures.c index c9d875543205..b1d59a559dae 100644 --- a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c +++ b/OvmfPkg/SmmControl2Dxe/SmiFeatures.c @@ -29,6 +29,12 @@ // #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_HOTPLUG upon hot-unplug", in the +// "etc/smi/supported-features" and "etc/smi/requested-features" fw_cfg fi= les. +// +#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 +118,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, SMI on CPU hot-unplug + // and nothing else. // RequestedFeaturesMask =3D ICH9_LPC_SMI_F_BROADCAST; if (!MemEncryptSevIsEnabled ()) { @@ -120,8 +127,10 @@ 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; + QemuFwCfgSelectItem (mRequestedFeaturesItem); QemuFwCfgWriteBytes (sizeof mSmiFeatures, &mSmiFeatures); =20 @@ -166,6 +175,13 @@ NegotiateSmiFeatures ( __FUNCTION__)); } =20 + if ((mSmiFeatures & ICH9_LPC_SMI_F_CPU_HOT_UNPLUG) =3D=3D 0) { + DEBUG ((DEBUG_INFO, "%a: CPU hot-unplug not negotiated\n", __FUNCTION_= _)); + } else { + DEBUG ((DEBUG_INFO, "%a: CPU hot-unplug with SMI negotiated\n", + __FUNCTION__)); + } + // // Negotiation successful (although we may not have gotten the optimal // feature set). --=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 (#71921): https://edk2.groups.io/g/devel/message/71921 Mute This Topic: https://groups.io/mt/80819865/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-