From nobody Thu Nov 14 16:52:31 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+71838+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+71838+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 1613725521577646.2706312167082; Fri, 19 Feb 2021 01:05:21 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id q9H9YY1788612xTCOgpTa1RB; Fri, 19 Feb 2021 01:05:21 -0800 X-Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by mx.groups.io with SMTP id smtpd.web12.6146.1613725515382964226 for ; Fri, 19 Feb 2021 01:05:15 -0800 X-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11J94GeV111126; Fri, 19 Feb 2021 09:05:11 GMT X-Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 36p7dnrn88-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 19 Feb 2021 09:05:11 +0000 X-Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11J8uU7G011766; Fri, 19 Feb 2021 09:05:10 GMT X-Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2176.outbound.protection.outlook.com [104.47.55.176]) by aserp3030.oracle.com with ESMTP id 36prbrwvyu-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 19 Feb 2021 09:05:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SYcQt47fpLS4M28oXpv2qmFn7XmuCSoYWe/QzWsJ+SNIFKqqigJvPmvMyVFjySDV4+VQQXqiSWk5zvt/u6nXJAtttHj67YpX1TvKgbpexzE3FsldDOQmAjlkj+cruJtvL0ZXje647kN+2AJ6iqhX0VRD3nzLZwte9XPIAbfExZRj2d/bUskw3Bdtp+cPtRofN8gGT04ndugSKXV/osBwf1Y5OxaOnB/qB+b7vVDPeYLZoATaznPKvNS99QwWJqJXTWE/Oy6ejjkx3AiW2+aEVsLKTJvgghQb+J10qF17X/7RFRzED9cz9Waoy7YeK686iY+fvrSCSROTEBXJhZX1AQ== 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=EugBkJnKhrf8lOxlyocXIOH/ZhKra2r3nx9H8HV/pecFQuCztSVEDnOjhFFEkzHucoVYxeNyK8vHglNazVgvz5ADHjldsQFz36lskEXazZYpHEpyQMwLapQX+yrr6QoX3q4HfPwfwFqubh1nyxu+BRcuhCaTTGbP+hRAsHQ7eVuzdjZ621MIU1N8ZmEvVULijERKxin+GAaCp4W8r2SoUwX6eUr+KvKihwwxRxe4S3rHy+hodpOzrYBWnQyv3dox1Uwc+i7ntzmT13hs/qPR4gU/bAVjveZLxkpwdN58yeXqZwrf9QlKhURb2RiqzAFoi/7WlNPBeUz7cU1LOiVNjQ== 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 BYAPR10MB3605.namprd10.prod.outlook.com (2603:10b6:a03:129::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Fri, 19 Feb 2021 09:05:06 +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.029; Fri, 19 Feb 2021 09:05:06 +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 v7 10/10] OvmfPkg/SmmControl2Dxe: negotiate CPU hot-unplug Date: Fri, 19 Feb 2021 01:04:44 -0800 Message-Id: <20210219090444.1332380-11-ankur.a.arora@oracle.com> In-Reply-To: <20210219090444.1332380-1-ankur.a.arora@oracle.com> References: <20210219090444.1332380-1-ankur.a.arora@oracle.com> X-Originating-IP: [148.87.23.5] X-ClientProxiedBy: MWHPR13CA0004.namprd13.prod.outlook.com (2603:10b6:300:16::14) 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.5) by MWHPR13CA0004.namprd13.prod.outlook.com (2603:10b6:300:16::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.8 via Frontend Transport; Fri, 19 Feb 2021 09:05:05 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 95113c2f-49d5-4855-4afc-08d8d4b57318 X-MS-TrafficTypeDiagnostic: BYAPR10MB3605: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck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PsdOLb0EAdVwlhqpYphDWsafzTd/5z0nsbpWdtNXxOa7Jppkh?= =?us-ascii?Q?B7tNxJ8le5zdybuqKYwhI+8g+aK6iAHP80P5UhQ8ZderIfRGr+tIIdvu2dSF?= =?us-ascii?Q?GokoJQtfKY1n4u4SIEOhl8xi?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 95113c2f-49d5-4855-4afc-08d8d4b57318 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4605.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2021 09:05:06.0266 (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: Bi89IOPSEU6J4YVBPM0cbTqg1shi7gOmzUdqXfEjRy+GImi/QwDGAQZI0hbHTIqJc2yCdl5/DvHWXPRsQrTnnM5sds8u6HUBR4Qfei0B7/I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3605 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: mER1q60hGEjKIdNzcGE3VHCUx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1613725521; bh=QAfto4F3lqUOd/mtRob3fnTmUj3klz8pVxUvcGghhGs=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=qyQwgVZVQVAaYWjWbuKNGdo61VkSvsVBwhFZ48vwZaW2b17IiiXlrUmK87pOTBdRE6x gD8xslWO/rjfGZR/Du4Eree+mmLWGrviQI119CfUDim5Y1atdqrIwXwrkK6x1l6kkjtXt sLjKDyxwrkgPupqVlqr6i4m9gHk2JrFyI0E= 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 (#71838): https://edk2.groups.io/g/devel/message/71838 Mute This Topic: https://groups.io/mt/80751403/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-