From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.44]) by mx.groups.io with SMTP id smtpd.web12.2129.1576184295997288514 for ; Thu, 12 Dec 2019 12:58:16 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=AYCv+mEy; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.93.44, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UL1452UcL1ItBmEEhdEHqm3UkbtB5Q9rI+a3V7Qr8Sgr3+6X659twYFNGPM4D3D1njIE+HCSLRmrt8G36P5B6vcynzuSrcyvlwcXn7IQws/u8MizaSc6AUB4E2LGP8Yk2g1duMmn9NkZak5/uDv6zHT2NoY2RlVNojqDob0lAW5tx04jR0068DtIb3MrwMyr4k/bBW5gjGN94kcTY+B1W+vs4sAVre5OWgrbfzo0QM75BvQEVvvO5QmYOj9Qr/9ppCgAN20q44ZbNk+1XYsvzLruosafYrb+zFI6AjRMTtuREkkE4rk/sgHgZHAT6uxw7utivyegtYqOoAS7mIZvqA== 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-SenderADCheck; bh=zw+Aa9FfAWQSlKNU5q2kZxDrzbEN8GbTidz1M/3phlE=; b=LGoieL8osYNr9BWmDue3iYXkkj6Q2RtLBZaZVoVf1FwZGZ7uqizFB/SG/yh4PjCDUSJ3Q43LgtedCRSnn+p/lqmE0/W2HPw+QxDRA8AJD9K5K2C0atcGUe0++Avbgtr5UzAHa2E8EsMlPdZwxx838u20LByV6NKNl+EyOvVATxOgapJqlxMbhgk2qcWz//kWMGKkWutjSs/7d1qmtq9vqeTQKiWW297C/aSlPiV+nCr609AykrG2vYTVBr2Vioe16/FxfX7tdb7o2GoE+w3iu2mvEMpGyD3Rvs+cEa3G79X5V47WURGeSRMjIUhMXWoIkNTu0Py3aX8qEL64vPz/sQ== 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=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zw+Aa9FfAWQSlKNU5q2kZxDrzbEN8GbTidz1M/3phlE=; b=AYCv+mEy5cj06l5Ut+IC/79BRIE6kjXBOQxL3E85bYW2go/brVmxO1eNjVIfmlZAAx6Bpp0qL0MUTVjmJPJCnFewl0utIL7PUjurzcX6uuo0ncp6L92RkGN/sBs3oanVdbHVoTUqBZ8hCzO9Uhf/jceUOSIQdWwyPhoZNfkX/Eo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Received: from DM6PR12MB3163.namprd12.prod.outlook.com (20.179.71.154) by DM6PR12MB2924.namprd12.prod.outlook.com (20.179.104.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.14; Thu, 12 Dec 2019 20:58:14 +0000 Received: from DM6PR12MB3163.namprd12.prod.outlook.com ([fe80::c16f:b437:4266:dbc1]) by DM6PR12MB3163.namprd12.prod.outlook.com ([fe80::c16f:b437:4266:dbc1%4]) with mapi id 15.20.2516.020; Thu, 12 Dec 2019 20:58:14 +0000 Subject: Re: [edk2-devel] [RFC PATCH v3 04/43] MdeModulePkg/DxeIplPeim: Support GHCB pages when creating page tables To: "Ni, Ray" , "devel@edk2.groups.io" Cc: "Justen, Jordan L" , Laszlo Ersek , Ard Biesheuvel , "Kinney, Michael D" , "Gao, Liming" , "Dong, Eric" , Brijesh Singh , "Wang, Jian J" , "Wu, Hao A" , "Bi, Dandan" References: <734D49CCEBEEF84792F5B80ED585239D5C399A24@SHSMSX104.ccr.corp.intel.com> From: "Lendacky, Thomas" Message-ID: <63bc94bd-aa64-258d-7b4d-b74793496cbe@amd.com> Date: Thu, 12 Dec 2019 14:58:12 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5C399A24@SHSMSX104.ccr.corp.intel.com> X-ClientProxiedBy: DM3PR08CA0013.namprd08.prod.outlook.com (2603:10b6:0:52::23) To DM6PR12MB3163.namprd12.prod.outlook.com (2603:10b6:5:15e::26) Return-Path: thomas.lendacky@amd.com MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 579a0fe2-dc1d-41a7-6894-08d77f460130 X-MS-TrafficTypeDiagnostic: DM6PR12MB2924:|DM6PR12MB2924: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-Forefront-PRVS: 0249EFCB0B X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4636009)(376002)(346002)(39860400002)(396003)(366004)(136003)(189003)(13464003)(199004)(5660300002)(6506007)(316002)(110136005)(26005)(52116002)(186003)(30864003)(53546011)(7416002)(2616005)(54906003)(31696002)(31686004)(86362001)(81156014)(8936002)(8676002)(81166006)(66556008)(66476007)(45080400002)(4326008)(2906002)(6512007)(6486002)(19627235002)(478600001)(66946007)(36756003)(966005);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR12MB2924;H:DM6PR12MB3163.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Pc3fsWvOGb5sjvTVxQsZ0CQ/PToO3BhK/IuJ8Cw451cGyAjmCpgK3MQR4XjtskIK4Y0KWyH03fYRFUzoAXZR4oVuGYIdtteC5em3Lh6WPyyh1hLtmZWbMQLBtTtvD+SJzXlY6nwuUjoH0FLwb6bBVm2lJw3bYtMNSSE5DuS1yWjQioqhvY3n3Ar5PzGnVLZSmpRN/XDrsYM7ZiSfxOkdJ9Cx2U9+XZW4J7YqMlgGZAobK9oiF+0LPxFwSEe+PUNgBu+DcegY+tx2m64MzEGwc9eyw5JPclBv/KXmG2kyxp+8saXCJ+ChN70L3QM55IE/ss3nL0uhi4b/vesD8BWvuTGcQmJdXtzvD4bp3eKj/5FHd3gy8/XZorqtblvtxiGIYl5C2ZtwbEVe+G/pbTJIq2zeGiuxa7YO1IuOGsW+OMCOcsJ3tRsqfgU5CqAta5+UlGwg5ZSGTHOlGmS8usOCsPh7XtqYoGEIxp4ni36Na95Qw8y/pb7in4JGpLsNJfuL X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 579a0fe2-dc1d-41a7-6894-08d77f460130 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2019 20:58:14.2261 (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: NRpAjEHDtN7PBxvzMz13IMNKKWdF4muYi5DrssHW5yMxqUZeHKQZnN47LZjPwPCr/ZeG1CO4b4xoerMAmSIeBQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2924 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 12/12/19 12:53 AM, Ni, Ray wrote: > Tom, > When are GHCP pages are allocated? Can DxeIpl gets the address by reading the GHCB MSR? > > Can the GHCB PCD be eliminated by updating all GHCB address consumer to read the GHCB MSR? The non-SEC GHCB pages are allocated in PEI. DxeIpl should be able to get the GHCB address by reading the GHCB MSR, but it wouldn't know the size of the area that needs to be marked un-encrypted, which is what PcdGhcbSize is used for. An alternative is to have some sort of callback service that can modify the newly built pagetables before they are made active. Thanks, Tom > > Thanks, > Ray > >> -----Original Message----- >> From: devel@edk2.groups.io On Behalf Of Lendacky, Thomas >> Sent: Thursday, November 21, 2019 4:06 AM >> To: devel@edk2.groups.io >> Cc: Justen, Jordan L ; Laszlo Ersek ; Ard Biesheuvel >> ; Kinney, Michael D ; Gao, Liming ; Dong, >> Eric ; Ni, Ray ; Brijesh Singh ; Wang, Jian J >> ; Wu, Hao A ; Bi, Dandan >> Subject: [edk2-devel] [RFC PATCH v3 04/43] MdeModulePkg/DxeIplPeim: Support GHCB pages when creating page tables >> >> BZ: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2198&data=02%7C01%7Cthomas.lendacky%40amd.com%7C46d86f04a1a048b7b77508d77ed015d7%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637117304489595635&sdata=Lcco5pprtKfjuAwDFxDJy4b%2B0bcWabyG2F0Z5wmGGAs%3D&reserved=0 >> >> GHCB pages must be mapped as shared pages, so modify the process of >> creating identity mapped pagetable entries so that GHCB entries are >> created without the encryption bit set. >> >> Cc: Jian J Wang >> Cc: Hao A Wu >> Cc: Dandan Bi >> Cc: Liming Gao >> Signed-off-by: Tom Lendacky >> --- >> MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf | 2 + >> .../Core/DxeIplPeim/X64/VirtualMemory.h | 12 ++++- >> .../Core/DxeIplPeim/Ia32/DxeLoadFunc.c | 4 +- >> .../Core/DxeIplPeim/X64/DxeLoadFunc.c | 11 ++++- >> .../Core/DxeIplPeim/X64/VirtualMemory.c | 49 ++++++++++++++----- >> 5 files changed, 62 insertions(+), 16 deletions(-) >> >> diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf >> index 98bc17fc9d1f..5e6b78e295e6 100644 >> --- a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf >> +++ b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf >> @@ -111,6 +111,8 @@ [Pcd.IA32,Pcd.X64] >> gEfiMdeModulePkgTokenSpaceGuid.PcdHeapGuardPropertyMask ## CONSUMES >> gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard ## CONSUMES >> gEfiMdeModulePkgTokenSpaceGuid.PcdUse5LevelPageTable ## SOMETIMES_CONSUMES >> + gEfiMdeModulePkgTokenSpaceGuid.PcdGhcbBase ## CONSUMES >> + gEfiMdeModulePkgTokenSpaceGuid.PcdGhcbSize ## CONSUMES >> >> [Pcd.IA32,Pcd.X64,Pcd.ARM,Pcd.AARCH64] >> gEfiMdeModulePkgTokenSpaceGuid.PcdSetNxForStack ## SOMETIMES_CONSUMES >> diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.h >> b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.h >> index 2d0493f109e8..6b7c38a441d6 100644 >> --- a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.h >> +++ b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.h >> @@ -201,6 +201,8 @@ EnableExecuteDisableBit ( >> @param[in, out] PageEntry2M Pointer to 2M page entry. >> @param[in] StackBase Stack base address. >> @param[in] StackSize Stack size. >> + @param[in] GhcbBase GHCB page area base address. >> + @param[in] GhcbSize GHCB page area size. >> >> **/ >> VOID >> @@ -208,7 +210,9 @@ Split2MPageTo4K ( >> IN EFI_PHYSICAL_ADDRESS PhysicalAddress, >> IN OUT UINT64 *PageEntry2M, >> IN EFI_PHYSICAL_ADDRESS StackBase, >> - IN UINTN StackSize >> + IN UINTN StackSize, >> + IN EFI_PHYSICAL_ADDRESS GhcbBase, >> + IN UINTN GhcbSize >> ); >> >> /** >> @@ -217,6 +221,8 @@ Split2MPageTo4K ( >> >> @param[in] StackBase Stack base address. >> @param[in] StackSize Stack size. >> + @param[in] GhcbBase GHCB page area base address. >> + @param[in] GhcbSize GHCB page area size. >> >> @return The address of 4 level page map. >> >> @@ -224,7 +230,9 @@ Split2MPageTo4K ( >> UINTN >> CreateIdentityMappingPageTables ( >> IN EFI_PHYSICAL_ADDRESS StackBase, >> - IN UINTN StackSize >> + IN UINTN StackSize, >> + IN EFI_PHYSICAL_ADDRESS GhcbBase, >> + IN UINTN GhcbkSize >> ); >> >> >> diff --git a/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c b/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c >> index 6e8ca824d469..284b34818ca7 100644 >> --- a/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c >> +++ b/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c >> @@ -123,7 +123,7 @@ Create4GPageTablesIa32Pae ( >> // >> // Need to split this 2M page that covers stack range. >> // >> - Split2MPageTo4K (PhysicalAddress, (UINT64 *) PageDirectoryEntry, StackBase, StackSize); >> + Split2MPageTo4K (PhysicalAddress, (UINT64 *) PageDirectoryEntry, StackBase, StackSize, 0, 0); >> } else { >> // >> // Fill in the Page Directory entries >> @@ -282,7 +282,7 @@ HandOffToDxeCore ( >> // >> // Create page table and save PageMapLevel4 to CR3 >> // >> - PageTables = CreateIdentityMappingPageTables (BaseOfStack, STACK_SIZE); >> + PageTables = CreateIdentityMappingPageTables (BaseOfStack, STACK_SIZE, 0, 0); >> >> // >> // End of PEI phase signal >> diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c b/MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c >> index f465eb1d8ac4..156a477d8467 100644 >> --- a/MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c >> +++ b/MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c >> @@ -35,6 +35,8 @@ HandOffToDxeCore ( >> UINT32 Index; >> EFI_VECTOR_HANDOFF_INFO *VectorInfo; >> EFI_PEI_VECTOR_HANDOFF_INFO_PPI *VectorHandoffInfoPpi; >> + VOID *GhcbBase; >> + UINTN GhcbSize; >> >> // >> // Clear page 0 and mark it as allocated if NULL pointer detection is enabled. >> @@ -81,12 +83,19 @@ HandOffToDxeCore ( >> TopOfStack = (VOID *) ((UINTN) BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SIZE) * EFI_PAGE_SIZE - >> CPU_STACK_ALIGNMENT); >> TopOfStack = ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT); >> >> + // >> + // Get the address and size of the GHCB pages >> + // >> + GhcbBase = (VOID *) PcdGet64 (PcdGhcbBase); >> + GhcbSize = PcdGet64 (PcdGhcbSize); >> + >> PageTables = 0; >> if (FeaturePcdGet (PcdDxeIplBuildPageTables)) { >> // >> // Create page table and save PageMapLevel4 to CR3 >> // >> - PageTables = CreateIdentityMappingPageTables ((EFI_PHYSICAL_ADDRESS) (UINTN) BaseOfStack, STACK_SIZE); >> + PageTables = CreateIdentityMappingPageTables ((EFI_PHYSICAL_ADDRESS) (UINTN) BaseOfStack, STACK_SIZE, >> + (EFI_PHYSICAL_ADDRESS) (UINTN) GhcbBase, GhcbSize); >> } else { >> // >> // Set NX for stack feature also require PcdDxeIplBuildPageTables be TRUE >> diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c >> b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c >> index 516cf908bc88..32a81d1f3c21 100644 >> --- a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c >> +++ b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c >> @@ -181,6 +181,8 @@ EnableExecuteDisableBit ( >> @param Size Size of the given physical memory. >> @param StackBase Base address of stack. >> @param StackSize Size of stack. >> + @param GhcbBase Base address of GHCB pages. >> + @param GhcbSize Size of GHCB area. >> >> @retval TRUE Page table should be split. >> @retval FALSE Page table should not be split. >> @@ -190,7 +192,9 @@ ToSplitPageTable ( >> IN EFI_PHYSICAL_ADDRESS Address, >> IN UINTN Size, >> IN EFI_PHYSICAL_ADDRESS StackBase, >> - IN UINTN StackSize >> + IN UINTN StackSize, >> + IN EFI_PHYSICAL_ADDRESS GhcbBase, >> + IN UINTN GhcbSize >> ) >> { >> if (IsNullDetectionEnabled () && Address == 0) { >> @@ -209,6 +213,12 @@ ToSplitPageTable ( >> } >> } >> >> + if (GhcbBase) { >> + if ((Address < GhcbBase + GhcbSize) && ((Address + Size) > GhcbBase)) { >> + return TRUE; >> + } >> + } >> + >> return FALSE; >> } >> /** >> @@ -322,6 +332,8 @@ AllocatePageTableMemory ( >> @param[in, out] PageEntry2M Pointer to 2M page entry. >> @param[in] StackBase Stack base address. >> @param[in] StackSize Stack size. >> + @param[in] GhcbBase GHCB page area base address. >> + @param[in] GhcbSize GHCB page area size. >> >> **/ >> VOID >> @@ -329,7 +341,9 @@ Split2MPageTo4K ( >> IN EFI_PHYSICAL_ADDRESS PhysicalAddress, >> IN OUT UINT64 *PageEntry2M, >> IN EFI_PHYSICAL_ADDRESS StackBase, >> - IN UINTN StackSize >> + IN UINTN StackSize, >> + IN EFI_PHYSICAL_ADDRESS GhcbBase, >> + IN UINTN GhcbSize >> ) >> { >> EFI_PHYSICAL_ADDRESS PhysicalAddress4K; >> @@ -355,7 +369,12 @@ Split2MPageTo4K ( >> // >> // Fill in the Page Table entries >> // >> - PageTableEntry->Uint64 = (UINT64) PhysicalAddress4K | AddressEncMask; >> + PageTableEntry->Uint64 = (UINT64) PhysicalAddress4K; >> + if (!GhcbBase >> + || (PhysicalAddress4K < GhcbBase) >> + || (PhysicalAddress4K >= GhcbBase + GhcbSize)) { >> + PageTableEntry->Uint64 |= AddressEncMask; >> + } >> PageTableEntry->Bits.ReadWrite = 1; >> >> if ((IsNullDetectionEnabled () && PhysicalAddress4K == 0) || >> @@ -383,6 +402,8 @@ Split2MPageTo4K ( >> @param[in, out] PageEntry1G Pointer to 1G page entry. >> @param[in] StackBase Stack base address. >> @param[in] StackSize Stack size. >> + @param[in] GhcbBase GHCB page area base address. >> + @param[in] GhcbSize GHCB page area size. >> >> **/ >> VOID >> @@ -390,7 +411,9 @@ Split1GPageTo2M ( >> IN EFI_PHYSICAL_ADDRESS PhysicalAddress, >> IN OUT UINT64 *PageEntry1G, >> IN EFI_PHYSICAL_ADDRESS StackBase, >> - IN UINTN StackSize >> + IN UINTN StackSize, >> + IN EFI_PHYSICAL_ADDRESS GhcbBase, >> + IN UINTN GhcbSize >> ) >> { >> EFI_PHYSICAL_ADDRESS PhysicalAddress2M; >> @@ -413,11 +436,11 @@ Split1GPageTo2M ( >> >> PhysicalAddress2M = PhysicalAddress; >> for (IndexOfPageDirectoryEntries = 0; IndexOfPageDirectoryEntries < 512; IndexOfPageDirectoryEntries++, >> PageDirectoryEntry++, PhysicalAddress2M += SIZE_2MB) { >> - if (ToSplitPageTable (PhysicalAddress2M, SIZE_2MB, StackBase, StackSize)) { >> + if (ToSplitPageTable (PhysicalAddress2M, SIZE_2MB, StackBase, StackSize, GhcbBase, GhcbSize)) { >> // >> // Need to split this 2M page that covers NULL or stack range. >> // >> - Split2MPageTo4K (PhysicalAddress2M, (UINT64 *) PageDirectoryEntry, StackBase, StackSize); >> + Split2MPageTo4K (PhysicalAddress2M, (UINT64 *) PageDirectoryEntry, StackBase, StackSize, GhcbBase, GhcbSize); >> } else { >> // >> // Fill in the Page Directory entries >> @@ -616,6 +639,8 @@ EnablePageTableProtection ( >> >> @param[in] StackBase Stack base address. >> @param[in] StackSize Stack size. >> + @param[in] GhcbBase GHCB base address. >> + @param[in] GhcbSize GHCB size. >> >> @return The address of 4 level page map. >> >> @@ -623,7 +648,9 @@ EnablePageTableProtection ( >> UINTN >> CreateIdentityMappingPageTables ( >> IN EFI_PHYSICAL_ADDRESS StackBase, >> - IN UINTN StackSize >> + IN UINTN StackSize, >> + IN EFI_PHYSICAL_ADDRESS GhcbBase, >> + IN UINTN GhcbSize >> ) >> { >> UINT32 RegEax; >> @@ -809,8 +836,8 @@ CreateIdentityMappingPageTables ( >> PageDirectory1GEntry = (VOID *) PageDirectoryPointerEntry; >> >> for (IndexOfPageDirectoryEntries = 0; IndexOfPageDirectoryEntries < 512; IndexOfPageDirectoryEntries++, >> PageDirectory1GEntry++, PageAddress += SIZE_1GB) { >> - if (ToSplitPageTable (PageAddress, SIZE_1GB, StackBase, StackSize)) { >> - Split1GPageTo2M (PageAddress, (UINT64 *) PageDirectory1GEntry, StackBase, StackSize); >> + if (ToSplitPageTable (PageAddress, SIZE_1GB, StackBase, StackSize, GhcbBase, GhcbSize)) { >> + Split1GPageTo2M (PageAddress, (UINT64 *) PageDirectory1GEntry, StackBase, StackSize, GhcbBase, GhcbSize); >> } else { >> // >> // Fill in the Page Directory entries >> @@ -840,11 +867,11 @@ CreateIdentityMappingPageTables ( >> PageDirectoryPointerEntry->Bits.Present = 1; >> >> for (IndexOfPageDirectoryEntries = 0; IndexOfPageDirectoryEntries < 512; IndexOfPageDirectoryEntries++, >> PageDirectoryEntry++, PageAddress += SIZE_2MB) { >> - if (ToSplitPageTable (PageAddress, SIZE_2MB, StackBase, StackSize)) { >> + if (ToSplitPageTable (PageAddress, SIZE_2MB, StackBase, StackSize, GhcbBase, GhcbSize)) { >> // >> // Need to split this 2M page that covers NULL or stack range. >> // >> - Split2MPageTo4K (PageAddress, (UINT64 *) PageDirectoryEntry, StackBase, StackSize); >> + Split2MPageTo4K (PageAddress, (UINT64 *) PageDirectoryEntry, StackBase, StackSize, GhcbBase, GhcbSize); >> } else { >> // >> // Fill in the Page Directory entries >> -- >> 2.17.1 >> >> >> >