From nobody Thu Nov 14 17:01:26 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+71918+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+71918+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 1613978399771540.7057518015431; Sun, 21 Feb 2021 23:19:59 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id yEnNYY1788612xZjuEykEx8p; Sun, 21 Feb 2021 23:19:59 -0800 X-Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) by mx.groups.io with SMTP id smtpd.web11.31685.1613978393933556067 for ; Sun, 21 Feb 2021 23:19:54 -0800 X-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11M7EsWr132240; Mon, 22 Feb 2021 07:19:50 GMT X-Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 36ttcm2kee-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Feb 2021 07:19:50 +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 11M7GSL9067574; Mon, 22 Feb 2021 07:19:50 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-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Feb 2021 07:19:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MMXyk/SQTK9KI4Y+jIp1qHqAxBQK0nTfwYgf/GpPQS3DdSbfVbgim7jxTVCX1dkQH8LtsxYPBHz0xyTP/an1HwHehMsYRKXKpiQWnJ5v+1d2pKCf0LzZfE/J+XXKVHAGebh8t0b6AJ6ULCWQtPHEghoVZx6FNaZdNl319mqqx7nTeVeHa3J3HcSlXF644KhTB7PjR/yM8M5rsgx0oFkNvtggySZFMMobZG5A7dVw+OeGTY3jo3ibpRda6wJWead8ZXccWhAIG1h0s2gV7WKDnpoU260HFgCjzEjxT0p3S+qKC94yWKdr0fL/jrb03K3H4GwTtav13gReO/Jg5ASR8w== 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=6EYCp3fdV5LngSVtDjqoaNvNu/L3do9lkVIBhAT0t3g=; b=gE4JbMva01QRWryGHe4Sqv2PyWlaDJoMhazIU2dot16wITtkO8izdoalsdZzkpyLCxyav3J5DIygi/kIaM2jnxcuvDAiajRDh77FJ0KzE1F9vlOuS3ZMdnqmvkMe1w2Tmp5MtSckjOMX2u5l3jYMtbxGwfqvzE1bgNU+F4YRJSU/45of8XBiAMyyL9kGOEwbMnaK/BwJamJhZxvrUNXuEY0RgYaWYC4a2nKvGX9ekpBwcq/w1wCca6SzDHyOwUp8IkzuulEtzKHvcJ81vmS+ll/IeEBTfMm5h83wgSQKipEZi6rl9FVmktQrDyg4DGdxP2wRv829tqK9TzqFRmkBYw== 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:46 +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:46 +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 07/10] OvmfPkg/SmmCpuFeaturesLib: call CPU hot-eject handler Date: Sun, 21 Feb 2021 23:19:25 -0800 Message-Id: <20210222071928.1401820-8-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:45 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cc3452e5-f123-4599-e292-08d8d7023b6a 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: NDh62lzq16baxmHPR67yepXRTvVb6I4r5GFILiCaMVqODoxRg1fU04Ff862jkSt89hIWRddzp0OawAVshT99OiWuMVX3wY2H+A0NViIsdHwFoVmyoFCeidXfszcM6GObL16oe+knMHEcp4KL8yLdNS6sPSecfYvPZozeDFFCS+BSodlLaBFcsupMBVrS8u14hS9jHAFcH8K0my5xd0INj+M0N0aWbKQ77UUKnzHzdnwG/eqBfdbF1vq3UEdkxEoqvxeVBMNGbc9YFsNVGg+hHptqyJu8cr078BEXdYZTwHIvhmndaHLWmtEsgXzE96utc5CpZV0e6fmYM1JQL7bvwpHZY7bhRNRTHWcJfs4mdTWG/vzhHsIOJVDMhfKA+QFVKmADs0jdY2KA7yWOeCQogah7yjEogtFVZo+433GtOJk+ss15O7fdGddPJbANs9gmVDBeYQiXx6+i6twRcHG31iSVlfTE5MFM+ZAYfMmGJTEy1JMAoEpVk2RhadIaha/UVtktEiGK6uEHdciNFb8rdJoBMj9KRCI3uMr91JhvW7zjfL/7lLYg3OInqxO0tzULjzAJc96IUS9wkRptfMv/D10Cks4yAsIMBS5g8BpT6JY= X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?wnJvWoNZDzacPnhpEVX+N10QqX50S3yqo6eX3MAGhA58Cv1EvoB0iCHgvwF4?= =?us-ascii?Q?CpOLk/lPy6//I4rzbDhFhMPXtwnSJfx6BHRzSLedHvOcwaTmA0pU7m5hUDao?= =?us-ascii?Q?ba3n+4XoJLGZ1AgBAwMsvDMw7/MIsXY8VR0mz6zlXNA+kHtnvJvBP3CIb84n?= =?us-ascii?Q?FMp2mv5aZN5VAuY7iWj4OmMY0Zd/8baBHsdm3vWwGdXJajaXnO96RKGHBrdK?= =?us-ascii?Q?Qbn1CQK3aRsu2UkX5rSmF7U2TKJpO2FLFirP0Cbb1TldulIIkLw4ScFN9abg?= =?us-ascii?Q?Ae8qx8O3/11BwDgMwEvO2UlvS/SV21bYQeaAA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ascii?Q?xPItiS041FYyZaDUm2GhNR7aNxfGZcxM2/MerQBThmMICFgUqKtUdjrWrqBY?= =?us-ascii?Q?PSSS532jbp1vcUPE0r/vd1nN0obshz9BlT/iutTq8PxMFS7S2SAAeQLS6WFx?= =?us-ascii?Q?5inUmvgoFnl9eXSCIw7S3bzX?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc3452e5-f123-4599-e292-08d8d7023b6a 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:46.1315 (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: +pUU+8vRZF346hl6r7XH5y66jop5RsS4lTId98ij3It8BynSm2EC4DhCzsEQMfqfCV8eLrwri//mwzpioTAH35TICjAr8tmLKIO+6j+g6F4= 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: s3se7scrryfpWVYHlFWWp7dIx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1613978399; bh=RpETlrDM66yAodqiFhUXbLeZ7SPGk9RvpAXRxrzaBAk=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=BwBqMsbY/yErp0rkK9mMhUVvivcIoMAmhh8++u/QKvCs9GwgHpS0o6VyOdg6erSGoDO YIS091QCGGxUmuM2xzH657zYmP9E381nB6kULQd+WdeQ0ol22vPm3YvhG0NMCEJRW+OTu jHmR/GAcQMQ4tKBwpYU0cfhXCOyFt/ENqHc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Call the CPU hot-eject handler if one is installed. The condition for installation is (PcdCpuMaxLogicalProcessorNumber > 1), and there's a hot-unplug request. The handler executes in context of SmmCpuFeaturesRendezvousExit(), which is called at the tail end of SmiRendezvous() after the BSP has given the signal to exit via the "AllCpusInSync" loop. 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: Address the following review comments from v6, patch-6: (19a) Move the call to the ejection handler to a separate patch. (19b) Describe the calling context of SmmCpuFeaturesRendezvousExit(). (20) Add comment describing the state when the Handler is not armed. OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c b/OvmfPk= g/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c index adbfc90ad46e..99988285b6a2 100644 --- a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c +++ b/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c @@ -467,6 +467,21 @@ SmmCpuFeaturesRendezvousExit ( IN UINTN CpuIndex ) { + // + // We only call the Handler if CPU hot-eject is enabled + // (PcdCpuMaxLogicalProcessorNumber > 1), and hot-eject is needed + // in this SMI exit (otherwise mCpuHotEjectData->Handler is not armed.) + // + + if (mCpuHotEjectData !=3D NULL) { + CPU_HOT_EJECT_HANDLER Handler; + + Handler =3D mCpuHotEjectData->Handler; + + if (Handler !=3D NULL) { + Handler (CpuIndex); + } + } } =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 (#71918): https://edk2.groups.io/g/devel/message/71918 Mute This Topic: https://groups.io/mt/80819862/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-