From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=k8Zoes8x; spf=pass (domain: oracle.com, ip: 141.146.126.79, mailfrom: ankur.a.arora@oracle.com) 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=xe4A/Bt9lzM9Tt4pupxFTYqVeZUm33XXenjOcBPy5Ak=; b=k8Zoes8xiwrfQUBplfReMqKIn2ZKR7csjuSh8NaBOyJGDjSsF9Uka6H5KtMfv4Tz90Wd qiPQYrpoXNHGT0Iy/qPVw/wYs/AXjzkks8pKlvIWMHKMYwQ1YVdGfQp1WLbdgUfOXzom FG0ZM0ZtiDbIXFHBXSts5tfNIjdpP5aaru2qXV9ZGvNMufRvUiKRIhOpk9Z2zpe/dWVA Wo/gPYeo8/xmdalHoWDisVt0wQUMMPQlTHsUnTJ58X4zXT+jKX1o5JYvg3JBnwkqan48 sh2r0o+Z6cQcqRz3UEXH+XLZrny0iB8GLpBDkai8jjYrzaotwIShiLOFApr29TTi4cXV hw== 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 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 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 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 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: [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> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20210107195515.106158-1-ankur.a.arora@oracle.com> References: <20210107195515.106158-1-ankur.a.arora@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9857 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 bulkscore=0 suspectscore=0 spamscore=0 adultscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101070114 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9857 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 bulkscore=0 clxscore=1015 spamscore=0 impostorscore=0 priorityscore=1501 mlxscore=0 adultscore=0 mlxlogscore=999 lowpriorityscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101070115 Content-Transfer-Encoding: quoted-printable 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 valu= e=0D must be between 0 and the NumberOfCpus field in the= =0D System Management System Table (SMST).=0D + @param[in] IsBSP Is this CPU the SMM BSP?=0D **/=0D VOID=0D EFIAPI=0D SmmCpuFeaturesRendezvousExit (=0D - IN UINTN CpuIndex=0D + IN UINTN CpuIndex,=0D + IN BOOLEAN IsBSP=0D )=0D {=0D + if(gSmst->SmmShutdownAp)=0D + gSmst->SmmShutdownAp(CpuIndex, IsBSP);=0D }=0D =0D /**=0D 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=0D be between 0 and the NumberOfCpus field in the Syst= em=0D Management System Table (SMST).=0D + @param[in] IsBSP Is this CPU the SMM BSP?=0D **/=0D VOID=0D EFIAPI=0D SmmCpuFeaturesRendezvousExit (=0D - IN UINTN CpuIndex=0D + IN UINTN CpuIndex,=0D + IN BOOLEAN IsBSP=0D );=0D =0D /**=0D 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=0D be between 0 and the NumberOfCpus field in the Syst= em=0D Management System Table (SMST).=0D + @param[in] IsBSP Is this CPU the SMM BSP?=0D **/=0D VOID=0D EFIAPI=0D SmmCpuFeaturesRendezvousExit (=0D - IN UINTN CpuIndex=0D + IN UINTN CpuIndex,=0D + IN BOOLEAN IsBSP=0D )=0D {=0D }=0D 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 ( }=0D =0D Exit:=0D - SmmCpuFeaturesRendezvousExit (CpuIndex);=0D + SmmCpuFeaturesRendezvousExit (CpuIndex, IsBsp);=0D =0D //=0D // Restore Cr2=0D --=20 2.9.3