From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 59E05AC1BB7 for ; Tue, 23 Apr 2024 21:01:17 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=PUc+B0zAC1jCtl4PvqroyCQvkQWAtsMhYH88lUT0RNs=; c=relaxed/simple; d=groups.io; h=Received-SPF:From:To:CC:Subject:Date:Message-ID:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20240206; t=1713906076; v=1; b=I5lAJDyEiXnxJrcoF4J7KlluGrIFrjCgDS7TQnazXMDQAcTXogcnYqc7HRENCv7RGMzv9tyr V0b5YrUhZ5tc5KBpiN+/hQ1BcwI3IdRNVmkByqUYAJL1tXffCsSddNS3O6Kox1GpIq+C60WpYLT e8a7ZbARjgct8Eofn8MSxbcGQWKnlGp78kgvQImAsV9K5DChWANRWPbhYXqHk3Z7DrT0AyAbODw ZN2HPQVttZyEq1XGX0DmoHRuZ/EqM31k6D0r0jM1+WidtWoiRhioAJMfJcH+ehQfDtttUOwft4s iKqlRL0c4CSuzdclgHAs1wPk4P+iZ+Y4JAndMbeF46VMA== X-Received: by 127.0.0.2 with SMTP id GcuaYY7687511xIyac3C2cTS; Tue, 23 Apr 2024 14:01:16 -0700 X-Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.81]) by mx.groups.io with SMTP id smtpd.web10.1174.1713906075051858223 for ; Tue, 23 Apr 2024 14:01:15 -0700 X-Received: from DM6PR11CA0057.namprd11.prod.outlook.com (2603:10b6:5:14c::34) by IA1PR12MB8465.namprd12.prod.outlook.com (2603:10b6:208:457::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Tue, 23 Apr 2024 21:01:11 +0000 X-Received: from DS1PEPF00017090.namprd03.prod.outlook.com (2603:10b6:5:14c:cafe::44) by DM6PR11CA0057.outlook.office365.com (2603:10b6:5:14c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.34 via Frontend Transport; Tue, 23 Apr 2024 21:01:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF00017090.mail.protection.outlook.com (10.167.17.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7519.19 via Frontend Transport; Tue, 23 Apr 2024 21:01:09 +0000 X-Received: from localhost (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 23 Apr 2024 16:01:09 -0500 From: "Roth, Michael via groups.io" To: CC: Tom Lendacky , Ard Biesheuvel , Gerd Hoffmann , Erdem Aktas , Jiewen Yao , Min Xu , Jianyong Wu , Anatol Belski Subject: [edk2-devel] [PATCH] OvmfPkg: Don't make APIC MMIO accesses with encryption bit set Date: Tue, 23 Apr 2024 15:59:58 -0500 Message-ID: <20240423205958.1791780-1-michael.roth@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017090:EE_|IA1PR12MB8465:EE_ X-MS-Office365-Filtering-Correlation-Id: a0d6a2e3-b700-4b8f-8cfc-08dc63d88061 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?WT0bvXPsXKaqvDlRu0FznjK5GDFYi3JFzcx3qyPt9ytdP58Zh2Cn5YSgktkP?= =?us-ascii?Q?RYqEcN9RAZZIksiKaq7RjaCNMiWt4Hk5TPgpfGXR3P3pfuUdsOlE6N3pk0kl?= =?us-ascii?Q?NPXY5V4buQwCO67U1NWqfueSdbrDtGfqf6/rOgSVQM0SZvVyVvKMbQLfzBSF?= =?us-ascii?Q?yoLPprmXfnYwVWLheBJYETdVLSS2kinOrkoprBcjDjjwPsUPUg75zVI4Q8Pl?= =?us-ascii?Q?SAqNNEfYpOX4HC96GQXOhis+UxksRoFALsNITVDckUK8oDcaRUhb9nqcuzQ1?= =?us-ascii?Q?Z6C3ifDlaEi6zrQcL2Taxt1mUnITdYOGpGZ5dsLeMYD6hVljxJ2EvDGUprcO?= =?us-ascii?Q?Hsl83yp3Kjz3tFJSqhBqLK54JkAqSyiMychElfzgwkYYRFrXqTIBB0RqAYlw?= =?us-ascii?Q?kPae0Nqh22Hn2ceGqhPuhQyh3rhGZ8OlaTBMaZlCs4reeYA/QVguHxYDNRov?= =?us-ascii?Q?09gOFn5X2HsRUvOVrHdp5DXYWSo95iAeQsBp/EcoHBDmAsvTwX5rpbusgQ6N?= =?us-ascii?Q?fuNuxf0GuCUMubTuAHS8538LDNkSstgdv9hZpNS9yBm8PvnZIL44wsO9cXdP?= =?us-ascii?Q?AS8Io++ozTP+L5n5GWzTaw9v8HnJoNYMY60+/mDq6WGv4dPoX2FUJNcZncOy?= =?us-ascii?Q?tQl+WHq7HNj9iXwuh/RhQcx7XbvVs7IWdK8Www7z3/2ly6NXAF2Viq2+lLok?= =?us-ascii?Q?MdZComskm5f78inGa13EE3BRQhrRCYBXYbDZCc2Zxi7o00yTZFbKAeUu2JQR?= =?us-ascii?Q?ZW6HP9bPLIqdRjTMdE1kxh6B5XCEwX9u6TPmzd7vEE74jswxEkX28Rhp2Ajt?= =?us-ascii?Q?80Cb3GKhLY8k52ymtaClJcRwDSfJIQCRgiGwMNSjc64N0GYIp4zS//r4kDVX?= =?us-ascii?Q?EqPJtLE1/dZjxdLrhRJQzNS8n5DBtth7v4z5PDlRw7lyCsjsphHLFeZXN11e?= =?us-ascii?Q?jb+TIUWETfEhV+gNEj6OJTNsslZJWC7kgkjhMVx03AAI9riGut+x9TXib/AE?= =?us-ascii?Q?zB3g1chNFp5fwSVU6Xmd9jqE55FxbZxHUdOvOyTrvAYjePFAMQfMnrZn6f4g?= =?us-ascii?Q?rNVLpd0iJKC6SdcDTG6z6fYwutZqrOa7takHGx5ldMDwrBSaqveUnNmwHbNa?= =?us-ascii?Q?dGQWjqbzmO8Dp06r9FfMrGbN4VsGHFAdAV0xo0QrhzO9KOZ4OhqRkONuIvsq?= =?us-ascii?Q?KMlciiQOuK7wIevpEwk3Kmlomb/ENlsTB7OPk3x6E/tClgeTIY84fQsT5q6v?= =?us-ascii?Q?XtMwF1r+TKxzGO+xRcHU0FmrU3U8tC38ch0i+Lz1QLCpWeIpCzYUvAKDeByA?= =?us-ascii?Q?zfnwTcmBOJL3Pwc+hYaVbPj6?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2024 21:01:09.6792 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a0d6a2e3-b700-4b8f-8cfc-08dc63d88061 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017090.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8465 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 Resent-Date: Tue, 23 Apr 2024 14:01:15 -0700 Resent-From: Michael.Roth@amd.com Reply-To: devel@edk2.groups.io,Michael.Roth@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 5GtRsH6ya8LXicJNrVlmVE36x7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=I5lAJDyE; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io For the most part, OVMF will clear the encryption bit for MMIO regions, but there is currently one known exception during SEC when the APIC base address is accessed via MMIO with the encryption bit set for SEV-ES/SEV-SNP guests. In the case of SEV-SNP, this requires special handling on the hypervisor side which may not be available in the future[1], so make the necessary changes in the SEC-configured page table to clear the encryption bit for 4K region containing the APIC base address. While here, drop special handling for the APIC base address in the SEV-ES/SNP #VC handler. [1] https://lore.kernel.org/lkml/20240208002420.34mvemnzrwwsaesw@amd.com/#t Suggested-by: Tom Lendacky Cc: Ard Biesheuvel Cc: Gerd Hoffmann Cc: Erdem Aktas Cc: Jiewen Yao Cc: Min Xu Cc: Tom Lendacky Cc: Jianyong Wu Cc: Anatol Belski Signed-off-by: Michael Roth --- OvmfPkg/AmdSev/AmdSevX64.fdf | 5 +- OvmfPkg/CloudHv/CloudHvX64.fdf | 5 +- OvmfPkg/Library/CcExitLib/CcExitVcHandler.c | 12 +--- OvmfPkg/Microvm/MicrovmX64.fdf | 3 + OvmfPkg/OvmfPkg.dec | 5 ++ OvmfPkg/OvmfPkgX64.fdf | 5 +- OvmfPkg/Sec/AmdSev.c | 71 +++++++++++++++++++++ OvmfPkg/Sec/AmdSev.h | 14 ++++ OvmfPkg/Sec/SecMain.c | 1 + OvmfPkg/Sec/SecMain.inf | 2 + 10 files changed, 109 insertions(+), 14 deletions(-) diff --git a/OvmfPkg/AmdSev/AmdSevX64.fdf b/OvmfPkg/AmdSev/AmdSevX64.fdf index d49555c6c8..595945181c 100644 --- a/OvmfPkg/AmdSev/AmdSevX64.fdf +++ b/OvmfPkg/AmdSev/AmdSevX64.fdf @@ -77,7 +77,10 @@ gUefiOvmfPkgTokenSpaceGuid.PcdSevLaunchSecretBase|gUefiO= vmfPkgTokenSpaceGuid.Pcd 0x010C00|0x000400 gUefiOvmfPkgTokenSpaceGuid.PcdQemuHashTableBase|gUefiOvmfPkgTokenSpaceGuid= .PcdQemuHashTableSize =20 -0x011000|0x00F000 +0x011000|0x001000 +gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecApicPageTableBase|gUefiOvmfPkgTokenSp= aceGuid.PcdOvmfSecApicPageTableSize + +0x012000|0x00E000 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpace= Guid.PcdOvmfSecPeiTempRamSize =20 0x020000|0x0E0000 diff --git a/OvmfPkg/CloudHv/CloudHvX64.fdf b/OvmfPkg/CloudHv/CloudHvX64.fd= f index eae3ada191..3e6688b103 100644 --- a/OvmfPkg/CloudHv/CloudHvX64.fdf +++ b/OvmfPkg/CloudHv/CloudHvX64.fdf @@ -76,7 +76,10 @@ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfCpuidBase|gUefiOvmfPkg= TokenSpaceGuid.PcdOvmfCp 0x00F000|0x001000 gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtr|gUefiOvmfPkgTokenS= paceGuid.PcdXenPvhStartOfDayStructPtrSize =20 -0x010000|0x010000 +0x010000|0x001000 +gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecApicPageTableBase|gUefiOvmfPkgTokenSp= aceGuid.PcdOvmfSecApicPageTableSize + +0x011000|0x00F000 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpace= Guid.PcdOvmfSecPeiTempRamSize =20 0x020000|0x0E0000 diff --git a/OvmfPkg/Library/CcExitLib/CcExitVcHandler.c b/OvmfPkg/Library/= CcExitLib/CcExitVcHandler.c index 549375dfed..da8f1e5db9 100644 --- a/OvmfPkg/Library/CcExitLib/CcExitVcHandler.c +++ b/OvmfPkg/Library/CcExitLib/CcExitVcHandler.c @@ -98,7 +98,7 @@ UnsupportedExit ( Validate that the MMIO memory access is not to encrypted memory. =20 Examine the pagetable entry for the memory specified. MMIO should not be - performed against encrypted memory. MMIO to the APIC page is always allo= wed. + performed against encrypted memory. =20 @param[in] Ghcb Pointer to the Guest-Hypervisor Communication = Block @param[in] MemoryAddress Memory address to validate @@ -118,16 +118,6 @@ ValidateMmioMemory ( { MEM_ENCRYPT_SEV_ADDRESS_RANGE_STATE State; GHCB_EVENT_INJECTION GpEvent; - UINTN Address; - - // - // Allow APIC accesses (which will have the encryption bit set during - // SEC and PEI phases). - // - Address =3D MemoryAddress & ~(SIZE_4KB - 1); - if (Address =3D=3D GetLocalApicBaseAddress ()) { - return 0; - } =20 State =3D MemEncryptSevGetAddressRangeState ( 0, diff --git a/OvmfPkg/Microvm/MicrovmX64.fdf b/OvmfPkg/Microvm/MicrovmX64.fd= f index 825bf9f5e4..055e659a35 100644 --- a/OvmfPkg/Microvm/MicrovmX64.fdf +++ b/OvmfPkg/Microvm/MicrovmX64.fdf @@ -62,6 +62,9 @@ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase|gUefiOvmfP= kgTokenSpaceGuid.PcdOvm 0x00C000|0x001000 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecGhcbBackupBase|gUefiOvmfPkgTokenSpace= Guid.PcdOvmfSecGhcbBackupSize =20 +0x00D000|0x001000 +gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecApicPageTableBase|gUefiOvmfPkgTokenSp= aceGuid.PcdOvmfSecApicPageTableSize + 0x010000|0x010000 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpace= Guid.PcdOvmfSecPeiTempRamSize =20 diff --git a/OvmfPkg/OvmfPkg.dec b/OvmfPkg/OvmfPkg.dec index 2f7bded926..b23219ebd4 100644 --- a/OvmfPkg/OvmfPkg.dec +++ b/OvmfPkg/OvmfPkg.dec @@ -277,6 +277,11 @@ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecGhcbBackupBase|0|UINT32|0x44 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecGhcbBackupSize|0|UINT32|0x45 =20 + ## Specify the extra page table needed to mark the APIC MMIO range as un= encrypted. + # The value should be a multiple of 4KB for each. + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecApicPageTableBase|0x0|UINT32|0x72 + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecApicPageTableSize|0x0|UINT32|0x73 + ## The base address and size of the SEV Launch Secret Area provisioned # after remote attestation. If this is set in the .fdf, the platform # is responsible for protecting the area from DXE phase overwrites. diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf index c2d3cc901e..b6e8f43566 100644 --- a/OvmfPkg/OvmfPkgX64.fdf +++ b/OvmfPkg/OvmfPkgX64.fdf @@ -97,7 +97,10 @@ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfCpuidBase|gUefiOvmfPkg= TokenSpaceGuid.PcdOvmfCp 0x00F000|0x001000 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecSvsmCaaBase|gUefiOvmfPkgTokenSpaceGui= d.PcdOvmfSecSvsmCaaSize =20 -0x010000|0x010000 +0x010000|0x001000 +gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecApicPageTableBase|gUefiOvmfPkgTokenSp= aceGuid.PcdOvmfSecApicPageTableSize + +0x011000|0x00F000 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpace= Guid.PcdOvmfSecPeiTempRamSize =20 0x020000|0x0E0000 diff --git a/OvmfPkg/Sec/AmdSev.c b/OvmfPkg/Sec/AmdSev.c index 520b125132..cff2ecbb8c 100644 --- a/OvmfPkg/Sec/AmdSev.c +++ b/OvmfPkg/Sec/AmdSev.c @@ -8,11 +8,15 @@ **/ =20 #include +#include #include +#include #include #include #include #include +#include +#include =20 #include "AmdSev.h" =20 @@ -301,3 +305,70 @@ SecValidateSystemRam ( MemEncryptSevSnpPreValidateSystemRam (Start, EFI_SIZE_TO_PAGES ((UINTN= )(End - Start))); } } + +/** + Map known MMIO regions unencrypted if SEV-ES is active. + + During early booting, page table entries default to having the encryptio= n bit + set for SEV-ES/SEV-SNP guests. In cases where there is MMIO to an addres= s, the + encryption bit should be cleared. Clear it here for any known MMIO acces= ses + during SEC, which is currently just the APIC base address. + +**/ +VOID +SecMapApicBaseUnencrypted ( + VOID + ) +{ + PAGE_MAP_AND_DIRECTORY_POINTER *Level4Entry; + PAGE_MAP_AND_DIRECTORY_POINTER *Level3Entry; + PAGE_MAP_AND_DIRECTORY_POINTER *Level2Entry; + PAGE_TABLE_4K_ENTRY *Level1Entry; + SEC_SEV_ES_WORK_AREA *SevEsWorkArea; + PHYSICAL_ADDRESS Cr3; + UINT64 ApicAddress; + UINT64 PgTableMask; + UINT32 Level1Page; + UINT64 Level1Address; + UINT64 Level1Flags; + UINTN PteIndex; + + if (!SevEsIsEnabled ()) { + return; + } + + SevEsWorkArea =3D (SEC_SEV_ES_WORK_AREA *)FixedPcdGet32 (PcdSevEsWorkAre= aBase); + ApicAddress =3D (UINT64)GetLocalApicBaseAddress (); + Level1Page =3D FixedPcdGet32 (PcdOvmfSecApicPageTableBase); + PgTableMask =3D PAGING_4K_ADDRESS_MASK_64; + PgTableMask &=3D ~SevEsWorkArea->EncryptionMask; + + Cr3 =3D AsmReadCr3 (); + Level4Entry =3D (VOID *)(UINTN)(Cr3 & PgTableMask); + Level4Entry +=3D (UINTN)BitFieldRead64 (ApicAddress, 39, 47); + + Level3Entry =3D (VOID *)(UINTN)(Level4Entry->Uint64 & PgTableMask); + Level3Entry +=3D (UINTN)BitFieldRead64 (ApicAddress, 30, 38); + + Level2Entry =3D (VOID *)(UINTN)(Level3Entry->Uint64 & PgTableMask); + Level2Entry +=3D (UINTN)BitFieldRead64 (ApicAddress, 21, 29); + + // + // Get memory address including encryption bit + // + Level1Address =3D Level2Entry->Uint64 & PgTableMask; + Level1Entry =3D (VOID *)(UINTN)Level1Page; + Level1Flags =3D BitFieldRead64 (Level2Entry->Uint64, 0, 11); + Level1Flags &=3D IA32_PG_P | IA32_PG_RW; + for (PteIndex =3D 0; PteIndex < 512; PteIndex++, Level1Entry++, Level1Ad= dress +=3D SIZE_4KB) { + Level1Entry->Uint64 =3D Level1Address | Level1Flags; + + if (Level1Address !=3D ApicAddress) { + Level1Entry->Uint64 |=3D SevEsWorkArea->EncryptionMask; + } + } + + Level2Entry->Uint64 =3D (UINT64)(UINTN)Level1Page | IA32_PG_P | IA32_PG_= RW; + + CpuFlushTlb (); +} diff --git a/OvmfPkg/Sec/AmdSev.h b/OvmfPkg/Sec/AmdSev.h index f75877096e..c5ab0d5a0b 100644 --- a/OvmfPkg/Sec/AmdSev.h +++ b/OvmfPkg/Sec/AmdSev.h @@ -91,4 +91,18 @@ SevSnpIsEnabled ( VOID ); =20 +/** + Map MMIO regions unencrypted if SEV-ES is active. + + During early booting, page table entries default to having the encryptio= n bit + set for SEV-ES/SEV-SNP guests. In cases where there is MMIO to an addres= s, the + encryption bit should be cleared. Clear it here for any known MMIO acces= ses + during SEC, which is currently just the APIC base address. + +**/ +VOID +SecMapApicBaseUnencrypted ( + VOID + ); + #endif diff --git a/OvmfPkg/Sec/SecMain.c b/OvmfPkg/Sec/SecMain.c index a30d4ce09e..60dfa61842 100644 --- a/OvmfPkg/Sec/SecMain.c +++ b/OvmfPkg/Sec/SecMain.c @@ -938,6 +938,7 @@ SecCoreStartupWithStack ( // interrupts before initializing the Debug Agent and the debug timer is // enabled. // + SecMapApicBaseUnencrypted (); InitializeApicTimer (0, MAX_UINT32, TRUE, 5); DisableApicTimerInterrupt (); =20 diff --git a/OvmfPkg/Sec/SecMain.inf b/OvmfPkg/Sec/SecMain.inf index dca932a474..7b93b4e7d0 100644 --- a/OvmfPkg/Sec/SecMain.inf +++ b/OvmfPkg/Sec/SecMain.inf @@ -83,6 +83,8 @@ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecGhcbBackupBase gUefiOvmfPkgTokenSpaceGuid.PcdTdxAcceptPageSize gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecApicPageTableBase + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecApicPageTableSize =20 [FeaturePcd] gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire --=20 2.25.1 -=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 (#118176): https://edk2.groups.io/g/devel/message/118176 Mute This Topic: https://groups.io/mt/105698125/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-