From nobody Thu Nov 14 22:52:53 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+72712+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+72712+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 161553044906937.70386532707255; Thu, 11 Mar 2021 22:27:29 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 9tKOYY1788612x0OqAfherfY; Thu, 11 Mar 2021 22:27:26 -0800 X-Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by mx.groups.io with SMTP id smtpd.web10.4850.1615530443436306720 for ; Thu, 11 Mar 2021 22:27:23 -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 12C6AP2d178589; Fri, 12 Mar 2021 06:27:20 GMT X-Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 37415rgyes-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Mar 2021 06:27:20 +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 12C6PZJ6028260; Fri, 12 Mar 2021 06:27:19 GMT X-Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by aserp3030.oracle.com with ESMTP id 374kasv216-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Mar 2021 06:27:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n/m9z3mIfRjH4l/OGXO9p5eJS/tVsycxYRttW1gxn96iNtSZZ/Ba8AGjdTgGsrNMnemQRbVGYXstr288hR7uOyEZar0SLuBFAGPkHytws/JRvzze1C412aaXzTeT+UrOkCHngqNF/NTlW8dRDsxFMJgmgz/ik6si+vWAqtFwcLCIqu3z3/RyC1UiCmoAhlFOoXf/UgkDwTH8br4PL6RxgSaUZZTE4wh2qXDVOCj6e7gv1nLRpwdHs+1p6mWu9QZov6sFV/q8SLD05dpJmLxNClYxYaVR7cuoVn/ckXfln/hndvKfhwXKnTrLhHG7yPDkQYvto13RB4jNrIbC/FD5sA== 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=ISCXpDOj5a8zRtidYkvfukmM3hiGm7++3qxBHtTwxe8=; b=VqzsfMvGqn0XkU72FSuMS6t5BLdJex2K1FXOtmxvJSb57e7PBEwVvIhx4nnLvYJWGFxpH8pUuK8XCQNd9tuT2XO9Dcyu12yp+dp8M13nIV/cq4WQqqIWDM6Q5CRLjXrPv8B9QoA7EiMkXvIe7g1tbQxz2uYGE7qP0UD6pUOUcu9kpylA9ac6nnliBRBOXksO2bqgul3HknH8tcLQspHXbQihyqbfqLamKLkw0/DBqZzvCudzW7JAtVm83UnsYe+p4BbBhF4QExA9+TftdwUSz4UyExfTD0MTX+Ev2KC3xciTma+n5wjlBujj6on7g14K9CiEYlxGzMA9Qq6Ch96n4Q== 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 SJ0PR10MB4544.namprd10.prod.outlook.com (2603:10b6:a03:2ad::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.31; Fri, 12 Mar 2021 06:27:17 +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.3912.030; Fri, 12 Mar 2021 06:27:17 +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 v9 10/10] OvmfPkg/SmmControl2Dxe: negotiate CPU hot-unplug Date: Thu, 11 Mar 2021 22:26:56 -0800 Message-Id: <20210312062656.2477515-11-ankur.a.arora@oracle.com> In-Reply-To: <20210312062656.2477515-1-ankur.a.arora@oracle.com> References: <20210312062656.2477515-1-ankur.a.arora@oracle.com> X-Originating-IP: [148.87.23.12] X-ClientProxiedBy: MWHPR02CA0018.namprd02.prod.outlook.com (2603:10b6:300:4b::28) 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.12) by MWHPR02CA0018.namprd02.prod.outlook.com (2603:10b6:300:4b::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17 via Frontend Transport; Fri, 12 Mar 2021 06:27:16 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0234e88d-4e57-4aa9-987e-08d8e51fe23a X-MS-TrafficTypeDiagnostic: SJ0PR10MB4544: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-Sender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ZErgb5V4BdLpsxYWzFeftHguK3pFx17o8N?= =?us-ascii?Q?xhh+hxlmmQTE3fBXcWe+jPFzF+ZZ37k8y9LGhad/UI+aqYB/8rhwdntQK0r0?= =?us-ascii?Q?7c9fihutqTPw+zhT2mN/63AsFJbafqHwxP6iFwrtdj7QbRPyIblAYiu8Pzdj?= =?us-ascii?Q?OvkQwuQYPw0ERWyk/OLAzBTK?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0234e88d-4e57-4aa9-987e-08d8e51fe23a X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4605.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2021 06:27:17.7174 (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: uSavlIv9wnnwZp1toZH59uxhuqgHn16zyGGVpx1TQQ50QU7R0nCs96T/1kdNEeMKaJiOjpEWsxGiv4ax7FVpYde4nIN7KHZ9WP5i2e4duC0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4544 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: HsB43gFC8QFqxsQBZqCo0i90x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1615530446; bh=dA9ye+dN4tbSEZzd703qlYC2FsC3jjRNJ9QhVXVILNo=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=orisjZKZk9c6aL9kvnkeikSNwkys4EoEf+EJLxICMk3PR4NSZ9wvpR9oyeXNH13orG5 l6yrajocfK1dtxXFoynoV7OnLnWtsWZLeXUUKIZGL2nCxXdFvmMGKBMI0AJ4O1upfrcjy gZWVLnk0hbq1k0H4S0FrtRUSUcYT62HF2EU= 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 Reviewed-by: Laszlo Ersek --- Notes: Addresses the following comments from v8: =20 (1) Remove inconsistent comment style (and stray newline) around the ne= wly added ICH9_LPC_SMI_F_CPU_HOT_UNPLUG. (2) Remove spurious empty line. OvmfPkg/SmmControl2Dxe/SmiFeatures.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c b/OvmfPkg/SmmControl2Dxe/= SmiFeatures.c index c9d875543205..3e2e61e4dbd0 100644 --- a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c +++ b/OvmfPkg/SmmControl2Dxe/SmiFeatures.c @@ -28,7 +28,12 @@ // "etc/smi/supported-features" and "etc/smi/requested-features" fw_cfg fi= les. // #define ICH9_LPC_SMI_F_CPU_HOTPLUG BIT1 - +// +// 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 +117,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,6 +126,7 @@ 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); @@ -166,6 +173,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 (#72712): https://edk2.groups.io/g/devel/message/72712 Mute This Topic: https://groups.io/mt/81273612/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-