From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by mx.groups.io with SMTP id smtpd.web09.445.1614718137955573779 for ; Tue, 02 Mar 2021 12:48:57 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@ibm.com header.s=pp1 header.b=mxHQpaCg; spf=pass (domain: linux.ibm.com, ip: 148.163.156.1, mailfrom: tobin@linux.ibm.com) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 122Khg5x086245; Tue, 2 Mar 2021 15:48:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=xVlrVSc3LxOlEZtEbFEaInBQWnqFs76TrDKJ8t6BIO8=; b=mxHQpaCgIGgI1/7WXVKA8YcXHIfwYYq1qPHt5CZCljrZu10aSZVSZlVrwxfZ229qLqt8 bL3UCX9J+iN/n8iKo6XSWUFUNsjYyEO3Mxl9Y9ffC7a1MlWWXumZka08iyGnTKe2USkx rBQnM4fmK92ZH2ODUBtNybraXR7GM5u/Hcu7HjpiR0zkQLZGOlBRss+melMo98jVpprX NGzpaJBDJG98gb1FRcnMKAKz/dhBkATte9J21W6hZfpJ+bC+Dmk3cttxqcN5dGZo5Y// P+fUvTWTveeTbQ/XZjVHiJVDpVHS6EcbUB0gc8dxxSksMHQwBuVU0lrxyfn395VvVMv8 tQ== Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0a-001b2d01.pphosted.com with ESMTP id 371vncg7y5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 Mar 2021 15:48:55 -0500 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 122KmN6S016543; Tue, 2 Mar 2021 20:48:53 GMT Received: from b03cxnp07027.gho.boulder.ibm.com (b03cxnp07027.gho.boulder.ibm.com [9.17.130.14]) by ppma05wdc.us.ibm.com with ESMTP id 371b00xpys-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 Mar 2021 20:48:53 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 122Kmpqs27918626 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 2 Mar 2021 20:48:51 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AFE06C6057; Tue, 2 Mar 2021 20:48:51 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 268CBC6055; Tue, 2 Mar 2021 20:48:51 +0000 (GMT) Received: from amdrome1.watson.ibm.com (unknown [9.2.130.16]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 2 Mar 2021 20:48:51 +0000 (GMT) From: "Tobin Feldman-Fitzthum" To: devel@edk2.groups.io Cc: Dov Murik , Tobin Feldman-Fitzthum , Tobin Feldman-Fitzthum , James Bottomley , Hubertus Franke , Brijesh Singh , Ashish Kalra , Jon Grimm , Tom Lendacky Subject: [RFC PATCH 08/14] UefiCpuPkg/MpInitLib: temp removal of MpLib cleanup Date: Tue, 2 Mar 2021 15:48:33 -0500 Message-Id: <20210302204839.82042-9-tobin@linux.ibm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210302204839.82042-1-tobin@linux.ibm.com> References: <20210302204839.82042-1-tobin@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.761 definitions=2021-03-02_08:2021-03-01,2021-03-02 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 mlxlogscore=882 bulkscore=0 adultscore=0 lowpriorityscore=0 spamscore=0 suspectscore=0 mlxscore=0 priorityscore=1501 clxscore=1015 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103020156 Content-Transfer-Encoding: 8bit The Migration Handdler is started using the Mp Service, which is only designed to function during boot time. The MH needs to run continuously. In the abscence of a generalized persitent Mp Service, temporary alterations were made to keep the MH running. Here, we skip registering the ExitBootServices callback that would normally clean up the APs. Obviously this is not suitable for production, as it does not generalize for multiple APs (it leaves all APs untouched rather than just the MH) and it introduces a weird dependency where the MpLib needs an OVMF PCD. Signed-off-by: Tobin Feldman-Fitzthum --- UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 2 ++ UefiCpuPkg/Library/MpInitLib/DxeMpLib.c | 21 ++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf index 1771575c69..71cc968de8 100644 --- a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf +++ b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf @@ -39,6 +39,7 @@ MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec UefiCpuPkg/UefiCpuPkg.dec + OvmfPkg/OvmfPkg.dec [LibraryClasses] BaseLib @@ -76,3 +77,4 @@ gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaBase ## SOMETIMES_CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdGhcbBase ## CONSUMES + gUefiOvmfPkgTokenSpaceGuid.PcdStartConfidentialMigrationHandler diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c index 7839c24976..7d59ec4a92 100644 --- a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c @@ -569,14 +569,19 @@ InitMpGlobalData ( ); ASSERT_EFI_ERROR (Status); - Status = gBS->CreateEvent ( - EVT_SIGNAL_EXIT_BOOT_SERVICES, - TPL_CALLBACK, - MpInitChangeApLoopCallback, - NULL, - &mMpInitExitBootServicesEvent - ); - ASSERT_EFI_ERROR (Status); + // + // Workaround for persistent processes . + // + if (!PcdGetBool (PcdStartConfidentialMigrationHandler)) { + Status = gBS->CreateEvent ( + EVT_SIGNAL_EXIT_BOOT_SERVICES, + TPL_CALLBACK, + MpInitChangeApLoopCallback, + NULL, + &mMpInitExitBootServicesEvent + ); + ASSERT_EFI_ERROR (Status); + } Status = gBS->CreateEventEx ( EVT_NOTIFY_SIGNAL, -- 2.20.1