From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.71]) by mx.groups.io with SMTP id smtpd.web08.6505.1667396989427147406 for ; Wed, 02 Nov 2022 06:49:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=ZKLgP8ww; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.223.71, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=og3Uv8txLO9VBpU/rI9joI4vKr5Oi+AQWXkTXHKK+1T8ZTrDkYA7XD1qILA8TUWSyhE02/IkBv8Qj4FfVUP2YEDEV4RNd+YDy4zlX10F009j/NomC99/eksEba+4+IKTX16RqzVBnF7YoN9e2id6neoujsTQOm0GAdJP+4xHqTbGq1NAMCGw39C/UvspEVL4qMGPEfSCnIFb99ab4lRquk0HikMnE7czJxQ+HHBaG+dqWvX1fJ3jQ+ofGijuVpq6lIwKDCxM32YMboEbMrl9Lk+vsshO+CBHjL7qVT7IcpVvlOTu1/P3OVkpo7dphpOEfpZBaHi/Tfk6LtebxtUTUg== 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=x9biVI1MlFax8aILvZD7yliIZl2WOq18Kv/nhZzqw7U=; b=oQ1M9nz+AXrdUQIzCWaQzzwpYpYAEPmZakGDtAQzbBYKB/OEepHLQLoiffcsoBV/kPp+j50ogg5ZVBhGpcvijF/XRzK8lRFTrNMKbIvgJfYfawcMZYGNDsq5OvMA4bGsluZcL2Lhq/Lm9sBZmR6ONxnNrkQgWOAIHihCy0W6Q1K0qghLCjdQUp4sUMSOwo/buuMAz5WYIJ+6VWWK0Gx7ch7ntdBhX9UQLe6HGcSod0S1hmP8i2i8Q4WSP07PuJE5U7wE/w+2YFgLvMabxyO1JEhOC/wTmV7m4j7rnTSgvxVf7vR40+EqU/W+tAyL2HG9A0aGIYOuiBCf6LHLEKS8og== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x9biVI1MlFax8aILvZD7yliIZl2WOq18Kv/nhZzqw7U=; b=ZKLgP8wwBFVSCcvcWkSNZU6wO8YVDGhpZi1NoiYaFSa+mhvM7aRKz0orIYl+SZanRW7f8qsyAZjNdsVvpuVlkMBavvX8jNqSdlspx/YIsA8Ayk64B8YFG3VmXBFx4cecqcCk0URA1PIImJ7iDq+Y2xLGvbA00FSablVndpmjqgc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) by CY8PR12MB7290.namprd12.prod.outlook.com (2603:10b6:930:55::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.16; Wed, 2 Nov 2022 13:49:47 +0000 Received: from DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::4da8:e3eb:20eb:f00]) by DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::4da8:e3eb:20eb:f00%2]) with mapi id 15.20.5769.021; Wed, 2 Nov 2022 13:49:47 +0000 Message-ID: <27b41d62-5e0c-16e0-74b1-4f9fe6491832@amd.com> Date: Wed, 2 Nov 2022 08:49:45 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH 3/8] UefiCpuPkg: Use CcExitLib instead of VmgExitLib To: Min Xu , devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Brijesh Singh , Erdem Aktas , Gerd Hoffmann , James Bottomley , Jiewen Yao References: <20221102051050.852-1-min.m.xu@intel.com> <20221102051050.852-4-min.m.xu@intel.com> From: "Lendacky, Thomas" In-Reply-To: <20221102051050.852-4-min.m.xu@intel.com> X-ClientProxiedBy: CH0PR03CA0227.namprd03.prod.outlook.com (2603:10b6:610:e7::22) To DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) Return-Path: Thomas.Lendacky@amd.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR12MB5229:EE_|CY8PR12MB7290:EE_ X-MS-Office365-Filtering-Correlation-Id: dcc4d62b-f4b4-4bfe-6b36-08dabcd91aec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: z3C5+YuWBbWaNHTZDEV5Y37QcsdtqqBPmQAad2PLH6w2ST0Dn7O0xl07N3DdBkCfm+/lOFh3H6cD/1ZIl0s0tq2cDJFk/wzA0DXOo89Bl5E/2UEIXUSFbqnfN8cUIq5p7l3dtP9JuAQAc0AM6j/3JBiUS0vPCziCmoQz+35wqbBIyflFj1QvqW7r41sGHC4QjG3/oZsoqDNqfnAzs/L41vXswvUJmpeWz3yxK3WYD5uKSimHnII5JGytqaD3xAv8/2dCmVRS2WpNniC1gTbahSY9WkuBsuUgcYQZvFCU7F3wOfloXNE+7LSHGreEiM9R50gB2rw79O6ymKecW4AfmbKLDKNyyLr5NnDXoFreT75X2tt0S5lfmaWA+XOxLxTWBVTw8EwF3qTnb9DQywq6QmYRMUAPzN5g29HnDl2v+hH/0SR9UEemiz3woom9zBcEhX0dR4mRgH+KXL8utR7HdR5vzle9ISfe3Yh6MM7VQiV7HQa0yiiPi9J4V7pBvMxEezW6Uu7y23DWOTGzkofkAXR768HpohojkoAJPGL8dQxnIjCOYpmVvRiSBa2fN2Dp+Coyz1bukGIFly5kDO+KJOANVDF7e9h2UHGIk3wERhBC1/oh4nHm2YQD7u068x+CnODxwsOhTDxyzFLSs3sRNQG4t9ynRI6DtwIN49gIFUuOmJ2T9nDKra++1BnSMVSB5W/EyjGvyds+nw35uAWHLfx3W3q1AA31WVd6dPwe4M5C2hFHxx+C/8G+iyfnWBHaEgIS8Pb52B9lSAVbFvsRV13UfUacFoSdQNGsMor1Of/xJIZPALn875bLOWsHKRj3QQJm32eCq8yEgD1UTGP1zw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR12MB5229.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(6029001)(4636009)(396003)(136003)(39860400002)(346002)(366004)(376002)(451199015)(19627235002)(316002)(31686004)(83380400001)(6506007)(54906003)(966005)(6486002)(53546011)(4326008)(8676002)(66556008)(66476007)(66946007)(478600001)(6512007)(26005)(2616005)(8936002)(30864003)(2906002)(5660300002)(41300700001)(186003)(31696002)(38100700002)(86362001)(36756003)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?T1RzZUwvOXZ5L0pGSklsL0lYanN4a3F0YW5yeDJPTUwxZGhNa25HNFlZVGtD?= =?utf-8?B?Y2lhNnl1R2FwaTZNZ09mWHdHZE5lc1dwOTJvdGJTNjdOb2c5VXExTlRYMWpG?= =?utf-8?B?dTk4MDFWZTJERnFXbzBuU2oyWFNzcW8vblRHcXRUcFN1SU1WOE9jWVVwVDRi?= =?utf-8?B?SU5LRzdYb3p0QnEwZlhXN1JlVEw0Q1dvTjFhcXg5VGl0enQzNzhJc2xLYUt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djM0l2UkJmZGpCRk50OXVCRFR1OWw0?= =?utf-8?B?VUJSTXpiRTJiMk1jd0FNSEhxRW5MSFpPUU8rVXhCYTJsZmp0VjFLUWJoclE3?= =?utf-8?Q?Rhh/m8WaYu21Qc/hZ8KYdE+Zs?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: dcc4d62b-f4b4-4bfe-6b36-08dabcd91aec X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5229.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2022 13:49:47.3366 (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: nQvvqzcO84wNqjHDzO6/i3jtOOb/2v8SAlNVz4ZSWjkIaL28cbmau5w3Ump2i7iorFngj7zX+6AEbiYXK5YlwQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7290 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/2/22 00:10, Min Xu wrote: > From: Min M Xu > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4123 > > VmgExitLib once was designed to provide interfaces to support #VC handler > and issue VMGEXIT instruction. After TDVF (enable TDX feature in OVMF) is > introduced, this library is updated to support #VE as well. Now the name > of VmgExitLib cannot reflect what the lib does. So VmgExitLib is replaced > by CcExitLib. I get a build failure when building this patch: build.py... /root/kernels/ovmf-build-X64/OvmfPkg/OvmfPkgX64.dsc(...): error 4000: Instance of library class [CcExitLib] is not found in [/root/kernels/ovmf-build-X64/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf] [X64] consumed by module [/root/kernels/ovmf-build-X64/OvmfPkg/Sec/SecMain.inf] - Failed - Thanks, Tom > > Cc: Eric Dong > Cc: Ray Ni > Cc: Brijesh Singh > Cc: Erdem Aktas > Cc: Gerd Hoffmann > Cc: James Bottomley > Cc: Jiewen Yao > Cc: Tom Lendacky > Signed-off-by: Min Xu > --- > .../DxeCpuExceptionHandlerLib.inf | 2 +- > .../PeiCpuExceptionHandlerLib.inf | 2 +- > .../CpuExceptionHandlerLib/PeiDxeSmmCpuException.c | 6 +++--- > .../CpuExceptionHandlerLib/SecPeiCpuException.c | 6 +++--- > .../SecPeiCpuExceptionHandlerLib.inf | 2 +- > .../SmmCpuExceptionHandlerLib.inf | 2 +- > .../Xcode5SecPeiCpuExceptionHandlerLib.inf | 2 +- > UefiCpuPkg/Library/MpInitLib/AmdSev.c | 10 +++++----- > UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 2 +- > UefiCpuPkg/Library/MpInitLib/DxeMpLib.c | 8 ++++---- > UefiCpuPkg/Library/MpInitLib/MpLib.c | 2 +- > UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf | 2 +- > UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c | 10 +++++----- > UefiCpuPkg/UefiCpuPkg.dsc | 2 ++ > 14 files changed, 30 insertions(+), 28 deletions(-) > > diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf > index e7a81bebdb13..d0f82095cf92 100644 > --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf > +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf > @@ -60,4 +60,4 @@ > PeCoffGetEntryPointLib > MemoryAllocationLib > DebugLib > - VmgExitLib > + CcExitLib > diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf > index 7c2ec3b2db4c..5339f8e60404 100644 > --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf > +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf > @@ -52,7 +52,7 @@ > HobLib > MemoryAllocationLib > SynchronizationLib > - VmgExitLib > + CcExitLib > > [Pcd] > gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard # CONSUMES > diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c > index a7d0897ef1f9..748cf8d3bfc6 100644 > --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c > +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c > @@ -7,7 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > **/ > > #include > -#include > +#include > #include "CpuExceptionCommon.h" > > /** > @@ -40,7 +40,7 @@ CommonExceptionHandlerWorker ( > // On other - ExceptionType contains (possibly new) exception > // value > // > - Status = VmgExitHandleVc (&ExceptionType, SystemContext); > + Status = CcExitHandleVc (&ExceptionType, SystemContext); > if (!EFI_ERROR (Status)) { > return; > } > @@ -57,7 +57,7 @@ CommonExceptionHandlerWorker ( > // On other - ExceptionType contains (possibly new) exception > // value > // > - Status = VmTdExitHandleVe (&ExceptionType, SystemContext); > + Status = CcExitHandleVe (&ExceptionType, SystemContext); > if (!EFI_ERROR (Status)) { > return; > } > diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c > index ad5e0e9ed4f1..497cd1649930 100644 > --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c > +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c > @@ -7,7 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > **/ > > #include > -#include > +#include > #include "CpuExceptionCommon.h" > > CONST UINTN mDoFarReturnFlag = 0; > @@ -39,7 +39,7 @@ CommonExceptionHandler ( > // On other - ExceptionType contains (possibly new) exception > // value > // > - Status = VmgExitHandleVc (&ExceptionType, SystemContext); > + Status = CcExitHandleVc (&ExceptionType, SystemContext); > if (!EFI_ERROR (Status)) { > return; > } > @@ -57,7 +57,7 @@ CommonExceptionHandler ( > // On other - ExceptionType contains (possibly new) exception > // value > // > - Status = VmTdExitHandleVe (&ExceptionType, SystemContext); > + Status = CcExitHandleVe (&ExceptionType, SystemContext); > if (!EFI_ERROR (Status)) { > return; > } > diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf > index 6a170286c8fc..df44371fe018 100644 > --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf > +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf > @@ -48,7 +48,7 @@ > PrintLib > LocalApicLib > PeCoffGetEntryPointLib > - VmgExitLib > + CcExitLib > > [Pcd] > gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard > diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf > index 9dde07612a04..8f8a5dab7930 100644 > --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf > +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf > @@ -51,7 +51,7 @@ > LocalApicLib > PeCoffGetEntryPointLib > DebugLib > - VmgExitLib > + CcExitLib > > [Pcd] > gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard > diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf > index 6d2f66504a5b..619b39d7f1de 100644 > --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf > +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf > @@ -53,7 +53,7 @@ > PrintLib > LocalApicLib > PeCoffGetEntryPointLib > - VmgExitLib > + CcExitLib > > [Pcd] > gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard > diff --git a/UefiCpuPkg/Library/MpInitLib/AmdSev.c b/UefiCpuPkg/Library/MpInitLib/AmdSev.c > index 4e4c63a52de4..9af108fcb5ff 100644 > --- a/UefiCpuPkg/Library/MpInitLib/AmdSev.c > +++ b/UefiCpuPkg/Library/MpInitLib/AmdSev.c > @@ -8,7 +8,7 @@ > **/ > > #include "MpLib.h" > -#include > +#include > > /** > Get Protected mode code segment with 16-bit default addressing > @@ -209,7 +209,7 @@ SevEsPlaceApHlt ( > Msr.GhcbPhysicalAddress = AsmReadMsr64 (MSR_SEV_ES_GHCB); > Ghcb = Msr.Ghcb; > > - VmgInit (Ghcb, &InterruptState); > + CcExitLibVmgInit (Ghcb, &InterruptState); > > if (DoDecrement) { > DoDecrement = FALSE; > @@ -221,13 +221,13 @@ SevEsPlaceApHlt ( > InterlockedDecrement ((UINT32 *)&CpuMpData->MpCpuExchangeInfo->NumApsExecuting); > } > > - Status = VmgExit (Ghcb, SVM_EXIT_AP_RESET_HOLD, 0, 0); > + Status = CcExitLibVmgExit (Ghcb, SVM_EXIT_AP_RESET_HOLD, 0, 0); > if ((Status == 0) && (Ghcb->SaveArea.SwExitInfo2 != 0)) { > - VmgDone (Ghcb, InterruptState); > + CcExitLibVmgDone (Ghcb, InterruptState); > break; > } > > - VmgDone (Ghcb, InterruptState); > + CcExitLibVmgDone (Ghcb, InterruptState); > } > > // > diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf > index e1cd0b350008..cd07de3a3c0b 100644 > --- a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf > +++ b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf > @@ -54,7 +54,7 @@ > DebugAgentLib > SynchronizationLib > PcdLib > - VmgExitLib > + CcExitLib > MicrocodeLib > > [Protocols] > diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c > index 78cc3e2b93fd..8c7a131a0a3f 100644 > --- a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c > +++ b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c > @@ -12,7 +12,7 @@ > #include > #include > #include > -#include > +#include > #include > #include > > @@ -222,9 +222,9 @@ GetSevEsAPMemory ( > Msr.GhcbPhysicalAddress = AsmReadMsr64 (MSR_SEV_ES_GHCB); > Ghcb = Msr.Ghcb; > > - VmgInit (Ghcb, &InterruptState); > - VmgExit (Ghcb, SVM_EXIT_AP_JUMP_TABLE, 0, (UINT64)(UINTN)StartAddress); > - VmgDone (Ghcb, InterruptState); > + CcExitLibVmgInit (Ghcb, &InterruptState); > + CcExitLibVmgExit (Ghcb, SVM_EXIT_AP_JUMP_TABLE, 0, (UINT64)(UINTN)StartAddress); > + CcExitLibVmgDone (Ghcb, InterruptState); > > return (UINTN)StartAddress; > } > diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c > index 1c053f87a4c6..e5dc852ed95f 100644 > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c > @@ -9,7 +9,7 @@ > **/ > > #include "MpLib.h" > -#include > +#include > #include > #include > > diff --git a/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf b/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf > index 5facf4db9499..afd551bb0f64 100644 > --- a/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf > +++ b/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf > @@ -53,7 +53,7 @@ > SynchronizationLib > PeiServicesLib > PcdLib > - VmgExitLib > + CcExitLib > MicrocodeLib > > [Pcd] > diff --git a/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c b/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c > index a3cd377ef600..933f765f3f5e 100644 > --- a/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c > +++ b/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c > @@ -9,7 +9,7 @@ > **/ > > #include "MpLib.h" > -#include > +#include > #include > #include > > @@ -150,16 +150,16 @@ SevSnpCreateSaveArea ( > Msr.GhcbPhysicalAddress = AsmReadMsr64 (MSR_SEV_ES_GHCB); > Ghcb = Msr.Ghcb; > > - VmgInit (Ghcb, &InterruptState); > + CcExitLibVmgInit (Ghcb, &InterruptState); > Ghcb->SaveArea.Rax = SaveArea->SevFeatures; > - VmgSetOffsetValid (Ghcb, GhcbRax); > - VmgExitStatus = VmgExit ( > + CcExitLibVmgSetOffsetValid (Ghcb, GhcbRax); > + VmgExitStatus = CcExitLibVmgExit ( > Ghcb, > SVM_EXIT_SNP_AP_CREATION, > ExitInfo1, > ExitInfo2 > ); > - VmgDone (Ghcb, InterruptState); > + CcExitLibVmgDone (Ghcb, InterruptState); > > ASSERT (VmgExitStatus == 0); > if (VmgExitStatus != 0) { > diff --git a/UefiCpuPkg/UefiCpuPkg.dsc b/UefiCpuPkg/UefiCpuPkg.dsc > index 0e1a99ddc09f..57c74ba844d2 100644 > --- a/UefiCpuPkg/UefiCpuPkg.dsc > +++ b/UefiCpuPkg/UefiCpuPkg.dsc > @@ -60,6 +60,7 @@ > PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf > TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf > VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf > + CcExitLib|UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf > MicrocodeLib|UefiCpuPkg/Library/MicrocodeLib/MicrocodeLib.inf > SmmCpuRendezvousLib|UefiCpuPkg/Library/SmmCpuRendezvousLib/SmmCpuRendezvousLib.inf > CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf > @@ -164,6 +165,7 @@ > UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf > UefiCpuPkg/Library/SmmCpuFeaturesLib/StandaloneMmCpuFeaturesLib.inf > UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf > + UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf > UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei.inf > UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationSmm.inf > UefiCpuPkg/SecCore/SecCore.inf