From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id BDF2974003A for ; Wed, 26 Jul 2023 13:58:35 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=N/muVGVR6v+nEIDc5lKGpaSmn1GQXEZATRa7m8jrjn8=; c=relaxed/simple; d=groups.io; h=X-Received:X-Received:ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:X-Received:X-Received:Message-ID:Date:User-Agent:Subject:To:Cc:References:From:In-Reply-To:X-ClientProxiedBy:MIME-Version:X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic:X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck:X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam-Message-Info:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg:X-MS-Exchange-CrossTenant-Network-Message-Id:X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs:X-MS-Exchange-CrossTenant-OriginalArrivalTime:X-MS-Exchange-CrossTenant-FromEntityHeader:X-MS-Exchange-CrossTenant-Id:X-MS-Exchange-CrossTenant-MailboxType:X-MS-Exchange-CrossTenant-UserPrincipalName:X-MS-Exchange-Transport-CrossTenantHeadersStamped:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:X-Gm-Message-State:Cont ent-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1690379914; v=1; b=nrjy+PvMUdP2v9Et4y2Hqt93AK2zzkJPVdJZaHl05ROtHTOhfFjgktGF8YMrUfeTMFJyJ/GH +amy+EX8jn3gJjKkNEqkJR+4n13KIyHrRqIDXhHoZ8vwyp2IHR2I4t5SE+WolqiW7TApPfZiF/K ti2SWmSlJbXz0NHEEHssVQw4= X-Received: by 127.0.0.2 with SMTP id nHvnYY7687511x2IUj65Wauj; Wed, 26 Jul 2023 06:58:34 -0700 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.52]) by mx.groups.io with SMTP id smtpd.web11.11758.1690379913387779765 for ; Wed, 26 Jul 2023 06:58:33 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LNtLa/W40zmxhSmn7SPNxLSi58xbtlfH4awUGLP5zzHLfqIlCGVDgg3Md7GReTv50g+9O8viHZCsUIW00yNnlO+zv//LmCfKt55WUPTeZWdQQ+tXP9DSZzffrgpgL3C80uDU2Dgi/BgXMOaSomHTaxPIekWMma4XQ4j7lUptCxuEOdafhG/5iuYFGBKHB1yAzSTyMF8Esps129FCjAQZvIlG91jVrE1gABSu8udAWy34J8iavijcQuZw2vQ4Y2Y7EUvdSYs4UXYnWqVFTwTCZMGes5WaE1m9FXN5FROOG9FdLJk1ydam41lWs0e6ELkodypviRuYWUzhSTZGOpabSg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uhW+rCNEtTJwYesGI990HX3KRMAQr8kVg7evT6R5uko=; b=iKmrCrD5GPfLOpqi0y5GVpQjP4uXHJryI7JcFau3nNrqlD+qvvFJgbN2ILHFtJxyLbiVaNUXgH5dngNiRAK1ZncDsKqU86183AMLC/sokNeEQoA6MfXeChNdwDRg/A7EEPi3lpygXnEP/JPnkN+p3zM6nW+zVVRXRmsbGsE/9hVQkRPt5Fg98HorVwSDy3ubzMGTboigEl28epMaKSyW3LVA3G9+1BTZeexwhYL9yADv6wfzv1tO8seUTfuVQ9wMOl8+nTiYjXDnquRd6qh/SI6+D475FSwMoK8Z2nN00VEx2RxCWaRmqjPmNwj9Yf3DvJ0ypsl1RO6BkBZDM04wpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none X-Received: from DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) by SN7PR12MB6716.namprd12.prod.outlook.com (2603:10b6:806:270::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Wed, 26 Jul 2023 13:58:31 +0000 X-Received: from DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::d267:7b8b:844f:8bcd]) by DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::d267:7b8b:844f:8bcd%7]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023 13:58:31 +0000 Message-ID: <0ba13773-7704-321b-90b8-f5f535d6cd67@amd.com> Date: Wed, 26 Jul 2023 08:58:29 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [edk2-devel] [Patch V3] UefiCpuPkg: Decouple the SEV-ES functionality. To: YuanhaoXie , devel@edk2.groups.io Cc: Eric Dong , Rahul Kumar , Ray Ni References: <20230726075126.5836-1-yuanhao.xie@intel.com> From: "Lendacky, Thomas via groups.io" In-Reply-To: <20230726075126.5836-1-yuanhao.xie@intel.com> X-ClientProxiedBy: DS7PR06CA0029.namprd06.prod.outlook.com (2603:10b6:8:54::29) To DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR12MB5229:EE_|SN7PR12MB6716:EE_ X-MS-Office365-Filtering-Correlation-Id: 99e08dba-c945-45f9-2d24-08db8de0651c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: oKqpeOj4OeOvy0Yf/4V7wk0c3YxmKEHMhRXMOKmS3RnctImU63HLWkDGOAd2/hygbvuOtof8OAYZwVSV35+ZD5vmvfv4t94R2AbSOl+LB/TQODfTKg7Ob5h5WRftDh5ZdjZycv4SwjVpK2rU1UKaDVmXXKvKn6XRBtayBTHkBb/J517/uc8cF/Q69+LuxaYHYrbHhNrpO7PiNBi1iOImpP4Pw+yyyNey5zO/JxSfe/vZTZFxrrPTdBYoUC6/aZ4968OHz+i13omE6idCgGzHpyJU9gtSG1Ty5SD/6nQrwJXopJdspVTbDPRda4/xSRDWXjkvUpuYKX8DeEYpgYz2GhzcGvfQEmGy/pnU8Wiu+vZTtrljFE2WK5uSW5AueIHxpricMXbHhCBTjOi0qoU1hlVySkNdq+FNkwydj07UCDOWtgiVH/OYKFXAToCC5Z7Zied98rzjAg3EgCyg65L+HGC4TYEWf5mTraBhglSDfC8IHHSHXUURk8+l09I1jSlkhsYwRutdvDW/6642Nj9YofGGYurjFuQ+KmelEH12lyaxsq5TYfbe86KgPVQ1d5UAbyBU66W3BSKTxJI40SOwmMU5EiYinAno24XbZ25BIFk/xPtlifVYXRB/vIwc3drTaFGW2VDwwxJ8PrXsCO/2CQ== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QnhxeTlzM0pQZTZVYVRjQ241NTQwY3NFZzZnRzZaREdla0xWNlM1WTZENW9m?= =?utf-8?B?SDI2VmJzOS9obHpFSStQdWFHL1pUWEp0TDdKdm5wOU1pMElrUCtPQzVFR1hN?= =?utf-8?B?WVVuOHMrZnBiR0xrUEFDcytrenFGdyttUUk3UE16ZzRNYjlaSks0RW5KWXcw?= =?utf-8?B?ZlVBTXk5TzVkaXNXVHNoSm9URllCTHNiSzV2VHNzcExORmg2NjdVR3ZIek45?= =?utf-8?B?ZGN6OUF4VitjM0QvOE8vWkZ0UEZ0eS91UEVCak9MR1RqbU5NRytuS2NkUkpy?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hsV2VZdEIrSWlvbmdrcjF0ZWRIc1BFTlliWFl1cThZYVBXN1p5?= =?utf-8?Q?ylqrZ34pWTtbIMDKFxzaYuwvZ?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 99e08dba-c945-45f9-2d24-08db8de0651c X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5229.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 13:58:31.2758 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: odCL5DlT8BjuziyUSrUAUP0fl4Bu3eqo4fQTnNasjCnqEFa2OvUasqrHONhGMjbAqYrEZFuOG/qCwsebWoljfg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6716 Precedence: Bulk List-Subscribe: List-Help: 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,thomas.lendacky@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 4iuz3CQoWoGuSUJVzmHr749ax7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=nrjy+PvM; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") On 7/26/23 02:51, YuanhaoXie wrote: > The purpose is to fix an issue where an exception occurs at the start > of the DXE phase by applying the following patch series on INTEL-based > systems. >=20 > UefiCpuPkg: Refactor the logic for placing APs in HltLoop. > UefiCpuPkg: Refactor the logic for placing APs in Mwait/Runloop. > UefiCpuPkg: Create MpHandOff. > UefiCpuPkg: ApWakeupFunction directly use CpuMpData. > UefiCpuPkg: Eliminate the second INIT-SIPI-SIPI sequence. >=20 > This series of patches makes changes to the way the APs are > initialized and woken up. It removes the 2nd time INIT-SIPI-SIPI and > introduces a special startup signal to wake up APs. These patches also > create a new HOB identified by the mMpHandOffGuid, which stores only the > minimum information required from the PEI phase to the DXE phase. > As a result, the original HOB (mCpuInitMpLibHobGuid) is now used only > as a global variable in the PEI phase and is no longer necessary in the > DXE phase for INTEL-based systems. The AMD SEV-ES related code > still relies on the OldCpuMpData in the DXE phase. >=20 > This patch decouple the SEV-ES functionality of assigning CpuMpData to > OldCpuMpData->NewCpuMpData from the Intel logic. >=20 > Cc: Eric Dong > Cc: Rahul Kumar > Cc: Tom Lendacky > Cc: Ray Ni > Signed-off-by: Yuanhao Xie > --- > UefiCpuPkg/Library/MpInitLib/MpLib.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/Mp= InitLib/MpLib.c > index 737e03ffc5..e7054adbcc 100644 > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c > @@ -2160,7 +2160,10 @@ MpInitLibInitialize ( > // APs have been wakeup before, just get the CPU Information > // from HOB > // > - AmdSevUpdateCpuMpData (CpuMpData); > + if (CpuMpData->UseSevEsAPMethod) { > + AmdSevUpdateCpuMpData (CpuMpData); > + } This looks fine. Applying this patch did not regress SEV-ES or SEV-SNP=20 guest boots. Reviewed-by: Tom Lendacky Thanks, Tom > + > CpuMpData->CpuCount =3D MpHandOff->CpuCount; > CpuMpData->BspNumber =3D GetBspNumber (MpHandOff); > CpuInfoInHob =3D (CPU_INFO_IN_HOB *)(UINTN)CpuMpData->CpuIn= foInHob; -=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 (#107270): https://edk2.groups.io/g/devel/message/107270 Mute This Topic: https://groups.io/mt/100366586/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-