From nobody Thu Nov 14 16:50:13 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+70768+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+70768+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 1611643626229124.56900456807045; Mon, 25 Jan 2021 22:47:06 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id rthcYY1788612xGN4SmHW8FJ; Mon, 25 Jan 2021 22:47:05 -0800 X-Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by mx.groups.io with SMTP id smtpd.web12.8825.1611643625194674426 for ; Mon, 25 Jan 2021 22:47:05 -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 10Q6a3ol054946; Tue, 26 Jan 2021 06:47:02 GMT X-Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 368b7qrny9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Jan 2021 06:47:01 +0000 X-Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10Q6a68A097113; Tue, 26 Jan 2021 06:45:01 GMT X-Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2177.outbound.protection.outlook.com [104.47.59.177]) by userp3030.oracle.com with ESMTP id 368wqw1qcn-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Jan 2021 06:45:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gl4nJEy8jvWk75BsZ2xLzOUmf7plNbI/JzjBhWJWz74nylK0WzZ8mecKHfHoeqKTg5IeRUS8AuHOfEVRSzyxIjpzHram4re+iouHLQIME4zX5jtSHEys8qGL3uU4XSEF9yrQy3o8L2MUcbHRU8GYv5wHy38+Wq7lAh5bSxhfodVVEL2S37XmwqphH10vf2vrZg5MlXSe3DLyqyFlvHlPnMk+Z5T3QIH1rRZsn7z4teMXSXbtrOt3VtUIdCXvbj+OroOdnjfRP6LEvrQxk0Nb/KmykBx0ulxQwDVuCUy6NYZvoLQJuRs1slDvRafo02zkHyh11sVPj1T2uvFvn8vcFg== 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=7DHNoT91MtJFzMhEBvW0ixXWB1S8RLGtWlpmYOMA0gc=; b=SJw51HcAtNMwNUVduMxSSLfb2wMZzvKi4CtSZK2vMjJvhFlvs03NfRV1+45m0t1Ocl8yci+MY5DIIudL8eNsg0jrlhvM/3/fboa9blC/8GoC/iH52ZDLkE3YpyzlxpsmyW8bVsVmEzgHaULGxSaIuKXtDFiEgcN6hYNJIpU3euv+gIFEg+Nl2hbQ8VjaF1ReyGQNTlwv5OshcUIFPwuQms4UQwwi0PnvggqjAnevV0+rAG1a9mZ7DWAu7mDuy/pH4fIj7/6Xsvcd7pVFcwg2HhTn75atuprjt+AyjLDykxUxjTlv1emhThI07cMc7pMjywmVuAba7c/oMsDFr2INTw== 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 CY4PR10MB1718.namprd10.prod.outlook.com (2603:10b6:910:9::17) by CY4PR1001MB2184.namprd10.prod.outlook.com (2603:10b6:910:45::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.14; Tue, 26 Jan 2021 06:44:59 +0000 X-Received: from CY4PR10MB1718.namprd10.prod.outlook.com ([fe80::39dc:6ba7:9397:cb6]) by CY4PR10MB1718.namprd10.prod.outlook.com ([fe80::39dc:6ba7:9397:cb6%6]) with mapi id 15.20.3784.019; Tue, 26 Jan 2021 06:44:59 +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 v5 9/9] OvmfPkg/SmmControl2Dxe: negotiate CPU hot-unplug Date: Mon, 25 Jan 2021 22:44:40 -0800 Message-Id: <20210126064440.299596-10-ankur.a.arora@oracle.com> In-Reply-To: <20210126064440.299596-1-ankur.a.arora@oracle.com> References: <20210126064440.299596-1-ankur.a.arora@oracle.com> X-Originating-IP: [70.36.60.91] X-ClientProxiedBy: MWHPR18CA0061.namprd18.prod.outlook.com (2603:10b6:300:39::23) To CY4PR10MB1718.namprd10.prod.outlook.com (2603:10b6:910:9::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from localhost.localdomain (70.36.60.91) by MWHPR18CA0061.namprd18.prod.outlook.com (2603:10b6:300:39::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.12 via Frontend Transport; Tue, 26 Jan 2021 06:44:56 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ecafc1ba-6ace-4379-3659-08d8c1c5e4f3 X-MS-TrafficTypeDiagnostic: CY4PR1001MB2184: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X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bmsN5Jg1CFSI4wnO?= =?us-ascii?Q?oqsUAcieu+M8r4pvOZz14R/nM91MIYI6pvogB3vP32X1IfyyatHuz6zejtEp?= =?us-ascii?Q?rqeWBnLu8EsI17qYFbgkGnNltHvT0CI1Q391sRWC94/SWJqDxVAXLeBPORKp?= =?us-ascii?Q?dG6jaWVmn9AOUeguEab30kr9IQCdOkjQ0Ht/MVEiFzuQiN6jg3MI74QsREJo?= =?us-ascii?Q?TZvrhS5pUoxmpsL0TjrIRE0E+jCgLInU3dDLX2rE8SMqZ6h/q8BUdUmNwsqm?= =?us-ascii?Q?xA7mgjhwQSX6R0p7QEXi0GO5KhocV3hRWrnHU95448yMqF3DJBl3nGFKH2Kl?= =?us-ascii?Q?X+KhuIVtM/NonwLa/zs5uwcdYNEWF+n0pdLVTtLf7NfweBXBv06/6Z4Ug7Aw?= =?us-ascii?Q?62qWHGme2tnKLdJTwaXcuUN8/rn+Q8BvxrhhRUsJBr1HIbk3cTnYJXU1th/I?= =?us-ascii?Q?jaxJ8UOnlmW3xGgzLMMgKh3xrv4SKfAVfQQGw5YN1g4opKqggeONPgqBEg6A?= =?us-ascii?Q?az89dGDCuG/sFGiJYUSYEeMafLimQhs1tb36/ALQpR2wB/skvsxfqAfVXpOw?= =?us-ascii?Q?cP3ud4mDGEpsYzdfamQYt6DonO608FvJ4Bpesh32eHlrkZQGgOFlps1IEXez?= =?us-ascii?Q?g6TxwNyGWKRyPDOqdxeNeV5Cu4xakwfIt52HUJEVpaBZorcDuLd1pVbiPaHu?= =?us-ascii?Q?iQn2eWok?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ecafc1ba-6ace-4379-3659-08d8c1c5e4f3 X-MS-Exchange-CrossTenant-AuthSource: CY4PR10MB1718.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2021 06:44:56.8876 (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: bKN+omVyFwM3d0OpsoZWCO6I4P4KgIC7Ioeadb9T4vB125QCX/WkN/q6dWv8SHYi5ZZqV1GwBz86aU/fuqubgyWNrbc4FIW8f4I9R1Wuecs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1001MB2184 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: Bo2Q3p3r4gkYcTLehmIheQebx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1611643625; bh=I14oCflSu2+dXLMeTWWB4uugaHtDayGRe0Eidyx6F64=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=Umhf+xIH9a5HotC6WMXaj0fkb0EV+msxU1/t2DGhK4+lWLydlcpMjwMnb001+GK97Bx om1+vMCJKeTzWMIgyqJJj9olccfv39w8JCAKR9Inn31N4MUC3AAaH4hdJmQ9WhGOSuijc rfSIOl4bPpg1hVdoQ2xpVTd1APhR7SUr8W4= 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..af01104d69c6 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 (#70768): https://edk2.groups.io/g/devel/message/70768 Mute This Topic: https://groups.io/mt/80125324/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-