From nobody Thu Nov 14 16:56:00 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+69974+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+69974+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1610049339; cv=none; d=zohomail.com; s=zohoarc; b=VjAA1WwIdj+DuJyTT1Fri3BtvKxRfIUJE1ooxd6hDXqYiuMjeIg3RlWjimqhl3mwwAlZaMhyViT7IgJC+q/lXoEZDwttIqGGF6sM8x93FGhybiJT96hAQ8wcrnHi8A4Ft7hEK/WT34FMdi2enPrWv6SasYEFVzANxMu1r3mf4Nk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610049339; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=oRO8N/ZNxd0BnGQ/m2bXVBKT3GilUB1i+UxEA7jAg1g=; b=iE8fNwnpIgXf1indbW0oP3SR0radWo57kNa0qHoxLbxl1evRVX9Ha35ozGttSwuuFpXX9ajHEUk/l6kDT1ZaNF8qHIdMDMBBnUed4JreBQAnrdv2eka4PORMBaTsOrx1LqnyRMIwJT3ec3E8InftAoqeHu9c3PpDodw7xEQgSg4= ARC-Authentication-Results: i=1; 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+69974+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1610049339123995.2748726256764; Thu, 7 Jan 2021 11:55:39 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id k3W4YY1788612xdDxU9sNMSz; Thu, 07 Jan 2021 11:55:38 -0800 X-Received: from aserp2130.oracle.com (aserp2130.oracle.com [141.146.126.79]) by mx.groups.io with SMTP id smtpd.web09.2190.1610049333296358043 for ; Thu, 07 Jan 2021 11:55:33 -0800 X-Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 107JtQXq150426; Thu, 7 Jan 2021 19:55:30 GMT X-Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2130.oracle.com with ESMTP id 35wcuxxee7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 07 Jan 2021 19:55:30 +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 107JaW1h024058; Thu, 7 Jan 2021 19:55:30 GMT X-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 35v4ree7s3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Jan 2021 19:55:30 +0000 X-Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 107JtTeN021921; Thu, 7 Jan 2021 19:55:29 GMT X-Received: from localhost.localdomain (/70.36.60.91) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 07 Jan 2021 11:55:29 -0800 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 , Eric Dong , Ray Ni , Rahul Kumar , Aaron Young Subject: [edk2-devel] [PATCH v2 07/10] UefiCpuPkg/SmmCpuFeaturesLib: add IsBsp as a param to SmmCpuFeaturesRendezvousExit() Date: Thu, 7 Jan 2021 11:55:12 -0800 Message-Id: <20210107195515.106158-8-ankur.a.arora@oracle.com> In-Reply-To: <20210107195515.106158-1-ankur.a.arora@oracle.com> References: <20210107195515.106158-1-ankur.a.arora@oracle.com> MIME-Version: 1.0 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: RHMYXTP2L4uLoLJ1C4EpkNPbx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1610049338; bh=OYZOAPsxEzoC+H7eX02lJvH2kI+0potr2FNMYqWvIDg=; h=Cc:Date:From:Reply-To:Subject:To; b=D+WCdZsYgSL6MrPvUqzjhcGUcOtT0Ar2oJGyaD5TOc2aGeKEz9hA/jdRPf3r1U/RTYQ av+mKtZlDtIkmCnFH1XyoPaZROIEZWKBGM/lCSDOKeGoNl+0msxU5vbU8IFFV5nRfqlvV MTaTS9gS5a1zkx5NlXwkmKQbW5pNZgmTcmE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Add IsBsp as a parameter to SmmCpuFeaturesRendezvousExit(). This'll be used to disambiguate the BSP so it can eject hot-unplugged CPUs. Cc: Laszlo Ersek Cc: Jordan Justen Cc: Ard Biesheuvel Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar 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/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c | 6 +++++- UefiCpuPkg/Include/Library/SmmCpuFeaturesLib.h | 4 +++- UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c | 4 +++- UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c b/OvmfPk= g/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c index 7ef7ed98342e..4d78bbfe7634 100644 --- a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c +++ b/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c @@ -368,13 +368,17 @@ SmmCpuFeaturesRendezvousEntry ( @param[in] CpuIndex The index of the CPU that is exiting SMM. The value must be between 0 and the NumberOfCpus field in the System Management System Table (SMST). + @param[in] IsBSP Is this CPU the SMM BSP? **/ VOID EFIAPI SmmCpuFeaturesRendezvousExit ( - IN UINTN CpuIndex + IN UINTN CpuIndex, + IN BOOLEAN IsBSP ) { + if(gSmst->SmmShutdownAp) + gSmst->SmmShutdownAp(CpuIndex, IsBSP); } =20 /** diff --git a/UefiCpuPkg/Include/Library/SmmCpuFeaturesLib.h b/UefiCpuPkg/In= clude/Library/SmmCpuFeaturesLib.h index dbcd57e0ad42..5e8c4000f010 100644 --- a/UefiCpuPkg/Include/Library/SmmCpuFeaturesLib.h +++ b/UefiCpuPkg/Include/Library/SmmCpuFeaturesLib.h @@ -259,11 +259,13 @@ SmmCpuFeaturesRendezvousEntry ( @param[in] CpuIndex The index of the CPU that is exiting SMM. The valu= e must be between 0 and the NumberOfCpus field in the Syst= em Management System Table (SMST). + @param[in] IsBSP Is this CPU the SMM BSP? **/ VOID EFIAPI SmmCpuFeaturesRendezvousExit ( - IN UINTN CpuIndex + IN UINTN CpuIndex, + IN BOOLEAN IsBSP ); =20 /** diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c b/Uef= iCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c index 8fed18cf0e17..325518d3de3e 100644 --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c +++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c @@ -443,11 +443,13 @@ SmmCpuFeaturesRendezvousEntry ( @param[in] CpuIndex The index of the CPU that is exiting SMM. The valu= e must be between 0 and the NumberOfCpus field in the Syst= em Management System Table (SMST). + @param[in] IsBSP Is this CPU the SMM BSP? **/ VOID EFIAPI SmmCpuFeaturesRendezvousExit ( - IN UINTN CpuIndex + IN UINTN CpuIndex, + IN BOOLEAN IsBSP ) { } diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxe= Smm/MpService.c index e7ea44eb86fc..fb6aab17de37 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c @@ -1728,7 +1728,7 @@ SmiRendezvous ( } =20 Exit: - SmmCpuFeaturesRendezvousExit (CpuIndex); + SmmCpuFeaturesRendezvousExit (CpuIndex, IsBsp); =20 // // Restore Cr2 --=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 (#69974): https://edk2.groups.io/g/devel/message/69974 Mute This Topic: https://groups.io/mt/79507543/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-