From nobody Thu Nov 14 17:01:35 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+71835+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+71835+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 1613725509303359.0735383430374; Fri, 19 Feb 2021 01:05:09 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id qOOaYY1788612xxIKWGd3jQd; Fri, 19 Feb 2021 01:05:08 -0800 X-Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by mx.groups.io with SMTP id smtpd.web08.6044.1613725508235378302 for ; Fri, 19 Feb 2021 01:05:08 -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 11J94GeU111126; Fri, 19 Feb 2021 09:05:05 GMT X-Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 36p7dnrn81-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 19 Feb 2021 09:05:04 +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 11J8uDEf164199; Fri, 19 Feb 2021 09:05:04 GMT X-Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2169.outbound.protection.outlook.com [104.47.55.169]) by userp3030.oracle.com with ESMTP id 36prq1nxha-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 19 Feb 2021 09:05:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QPgr7VmdozPkpUOIJ9ERZkJ+sUqrhyoYDNuoGbjogr1vjkwSZqAcTNFVDq/sEUKTW71ixafOcO/23Dfz4tOr6YVIsDKeK8RIhMMkv+Pkckl+Ctnp2h/9S3P5fwLw1zjwrOT1jWfU1U37/qfPlMqOcopZW22huUq/ZH5CesDaXIGrsbGJf59EVgPPwO4T49jtdgORrwpYV/qinziJ8jp6DsY1fPjlDddpaniHtzjMUFAYg/zEwaSMkBeVh8Qf1v3uGU/JchJl5mx5N1fIkx+wQ6X2YFhZZTNkqwbA5vwTY1P4QQd+eKGpiYxsMP9qi0ILDN8jXIpmVd2xUgUxF4A2Mg== 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=peem+hchwuwd8Ambz/j8BraugAi7vEGN0rZ8mmkOR9U=; b=BLY3Lpt+IsC9OTerGGr4DqhHFf27pvUEVaHYQRiT/66NAMm6/GP8Ql/S0YPKvENkY9Ih8bUrOK+x3kbtlct+uZzjSpdIgyI5ru7X0M0ia7ePvvMg1MTO6X2FC9ab13DYr8JKXugCQUhugmQwjNjeD8xVnc61ViP38jTNakww+iQQi/Uk5Br2GmVC55dAr2pWMpTcNgV+UKEQcCzyduRXZBU5Z/BiS9XrAAI8WK7fqwPz57+tHrCDHILEtMzduu5zbFlt43ANEkyyNSDwnfZJMNZOVfwwUDd3540tqaC0QrpoNaIGdkmoBJVe2dy/C8uXYFGr4uGt4lNw86VnZHnv7Q== 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:02 +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:02 +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 07/10] OvmfPkg/SmmCpuFeaturesLib: call CPU hot-eject handler Date: Fri, 19 Feb 2021 01:04:41 -0800 Message-Id: <20210219090444.1332380-8-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:01 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fa14554c-81f9-4bdf-59be-08d8d4b570df 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: 1 X-Microsoft-Antispam-Message-Info: GbxGzF+WopetGtYLXlRbcM2HmfxAmndGLZFes5YVPgcB00oNKkXrC9w/cG1ZsEngXJnpsgzGiwwkgr0lsvWwWuxsEhQTO2qgXxx8nnCgZYS0yl7qz+EfSUYy6QzaJLMBljvUghVtrdO7W6hhdLMqjyXGSreh7mOvj3HsFGvWtJfsKNtsNWJsFnijuXq4fXgq9IdSnZdWN1TqYplYkoEKGGXKk1URT6GLvqD1NhJBy1X0fsAaGagEcVuQnjMcCnAPVp+MFy99+PRaKOIhJoppEz0xRDLqGcXgN/fA+oKIFd+q1Ny9RxTLXlX9E0eLrC2ifqQbss0uTG3+AV6wCij509UYPCzINPastfUIOw8BFPE/p1dVrKisdhupHBVo3jUSYOy8JrlockIvJLYbvvnLPLk05afntxPs4Q8ULDC6lKWITALfSUJHCJSmT2NEtLCQLaC0XePHpmzthLD6JyTojVIa3hzZRu3LPf8nX0VsEjAUg0PINyzxFtVGUqK/wK01L8QVg1jGTvRZv/pQ8tH+OE1u9tS3IPbxM+2+0lqg5nhzlV5MfV1NaEhLvzHN6cAYV+otB7Y/kLjGXzgic4u6kOBAi127VAEApRIoiJVGDRE= X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?CjXd+kEgKQUSbS/qKHa03KqPfhwpOptvuYht8PO6ormKhEK8Htad4gRrvQwt?= =?us-ascii?Q?QIac+BaJ25EZ5i+76/0nRL/Kc4T1a5GoHmCNGPpKvJB90w2xScyYpNPxhmnY?= =?us-ascii?Q?RQdW7pkJbm3R1ciba/I7jnL9Q/wUqNketWWUB2ZTIDKg2TyihDtoc6Y03Up9?= =?us-ascii?Q?2xTE0G43VW8Wal6emTQ8mL56HUFGal7GVO9ZObLrc/2JDzmWLwvjF8kpMjpJ?= =?us-ascii?Q?oY2F+NoP2heEFueyNpA5WIQzyfIlUP2YWigw/0+i7vlrDBQmURWsOf0ofVL6?= =?us-ascii?Q?yaSF29FTnH5UBID3L4P0F4BXKF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=?us-ascii?Q?qT7lOq2yt09ktbFzSTSmcCjFxc/h1g3sa1P4t68Zlt4cKn7li2M7XdMWT9rJ?= =?us-ascii?Q?VxwkR/JvQF77apZq5gegdroqL4ARo1AE936j4GgK1uLwf7yaePY7KsK331wq?= =?us-ascii?Q?vSNW3lVuBokPyi9N/Kn3ewkS?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: fa14554c-81f9-4bdf-59be-08d8d4b570df 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:02.2771 (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: 1GwGAQCNnnexzeZ2tu1VBtU/QEGebFkiyE1ccmCryWeOuGDwyA1qE6SybSt6OAfsI4EPiWSe717qVxVA97dTPo571y85tSxOkIgbpzIFFYs= 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: bu521SezxiIYl5fv8INirntOx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1613725508; bh=vFnuHpa7OPtZVVKX0SqfJBZ8qP6kcx6d2HmDsO95sdI=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=XGgpZMbZpPrMkuFV1of+h+fRi9QulgVUPJ39SJiQc2uiWaVJOh4u0qeK+P3dBFXKI1P SqhSYNm87ZQ4uWtsjLa9jae3zgIkpa2D29YWOBwHBFiAIgPdx0eBzX88PFpPVKGZSgpdf UmzPWu2xu7yJ+qqH1kWMYd/ivhFUrCIoTuE= 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 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c b/OvmfPk= g/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c index adbfc90ad46e..c5cfe2610c23 100644 --- a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c +++ b/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c @@ -467,6 +467,19 @@ 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 =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 (#71835): https://edk2.groups.io/g/devel/message/71835 Mute This Topic: https://groups.io/mt/80751399/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-