From nobody Mon Dec 23 05:06:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1519834530366698.662669017298; Wed, 28 Feb 2018 08:15:30 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7493422402E1E; Wed, 28 Feb 2018 08:09:22 -0800 (PST) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0088.outbound.protection.outlook.com [104.47.40.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 152AA22402E15 for ; Wed, 28 Feb 2018 08:09:19 -0800 (PST) Received: from wsp141597wss.amd.com (165.204.78.1) by SN1PR12MB0158.namprd12.prod.outlook.com (2a01:111:e400:5144::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.527.15; Wed, 28 Feb 2018 16:15:24 +0000 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=helo; client-ip=104.47.40.88; helo=nam03-co1-obe.outbound.protection.outlook.com; envelope-from=brijesh.singh@amd.com; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=yURHsDAx8dOWYSuAfmBoXtN+Etq35fIou3E1iBzbCCQ=; b=JzPLYIaL+AEtBffXd0MZe08hMBjy97EGajALCxP/2v01tDFs0i4vxRJ7bUfDYpMFvB1VlvIvtZ3+Mvaql213GLs194lRYRvu0s/RnbGVanLC1RSpvBeDB+ZQvEEbI2d/ECQsb8xD2YmDVsogdsG6Rw9lzT4mUlU4q2W2qgw5BQ4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; From: Brijesh Singh To: edk2-devel@lists.01.org Date: Wed, 28 Feb 2018 10:14:14 -0600 Message-Id: <20180228161415.28723-2-brijesh.singh@amd.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180228161415.28723-1-brijesh.singh@amd.com> References: <20180228161415.28723-1-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: SN4PR0501CA0079.namprd05.prod.outlook.com (2603:10b6:803:22::17) To SN1PR12MB0158.namprd12.prod.outlook.com (2a01:111:e400:5144::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 05775671-5e73-49fb-c6af-08d57ec67981 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:SN1PR12MB0158; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 3:UJn2PPYm1hr3p8MdAK5npwJFNfuhtDEPRUQyX+cyaDYSkoewYPZuMbirh9SdE2ju/6Xu7O1dWKZ46fgeUC1Y+Uf1JDpl8VACQ/vmLQO4UvxCDXZ1AyLjEYqH2Z6/DTKBz3bxAMjHu+ZjMiCkv5vdzQugvMdoKFFJ5l1RZ3NG6YlqLgYTRe09qJ6rR2eaPw/itz3sCqPuN5sFY2ScsnRNjj7q9n8dJ31+TsgohuIZx3xidnYTboazLzI3BlzTnP2T; 25:2rWoZdJTqKS+hKmfqKmiYu6GiS8V2d+AZ+XaB7DxjE874SWUQ5rGNohZdVBy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Y9KBqZY6l/hWtWDJFX1jhu7KF2rAazb0W; 4:0u/FeJX4VIUbL+tQFEEoFwjRmGqmsiaCpIGnB+MycoWZmgYtV6yTcO3dWUj1EXaylTCOQxQyri3Hf7BMPMDp8WmOPDnCB35PXhkdmYDhLYTNjmxS4tRYta1oOKjTCfDuWZb1QW5m1qTwPTGiYvAgHuGBNGPA/Mt6NWOxHYbgNfGm6EXR5KLa0bO/95AO8NywOfmZ+hTQBdMA9aranUjIFLoIUbg9ZtUBgs9q/u1A/0XxHO+yhMxGfjtey7Rwry2kPYxdrwEHBuyofx0amz/7KLHkpmGn2xZeXPOYG38MYzVUGtjT6FY3LjFKrmgNBHRXuivQTD2lWtRwLSxmYYyxP5P2PU/U6cfnU4h28xpwVw4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040501)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231220)(944501161)(52105095)(10201501046)(6055026)(6041288)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123560045)(6072148)(201708071742011); SRVR:SN1PR12MB0158; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0158; X-Forefront-PRVS: 0597911EE1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(396003)(376002)(366004)(39860400002)(346002)(199004)(189003)(53416004)(25786009)(3846002)(305945005)(47776003)(386003)(26005)(8936002)(8676002)(106356001)(2361001)(7736002)(2351001)(81166006)(66066001)(81156014)(59450400001)(50226002)(16526019)(54906003)(316002)(16586007)(86362001)(6116002)(4326008)(1076002)(186003)(2906002)(53936002)(6486002)(97736004)(2950100002)(6916009)(6666003)(50466002)(76176011)(7696005)(52116002)(478600001)(36756003)(48376002)(51416003)(68736007)(105586002)(5660300001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0158; H:wsp141597wss.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB0158; 23:ibqN3UAdHhJpSPwi0/l+VvjA4RCu5C9b7dN2DR0D6?= =?us-ascii?Q?T0cbRORjVfczggZXvUXFLpPJ4mdKg/Bv8kMED8Kw6RR8vgvuhv31xAJjCzam?= =?us-ascii?Q?SYc23dGnKzDUYbFM+9P2Ngr2ozJJlsGTAg+Iao/ubHBpbJz63WbJcNrG8TOC?= =?us-ascii?Q?FwGC8G2cCT5KXhRMbiGIMYJdYYjw8wPNSre7UP5x+Q5Pn4RTrLkwv9UcPEWq?= =?us-ascii?Q?a+k9pj7+jdrypXJTAJRmcDsLhAwlXvGWVPE8cKfQGkvTb3AbSYFGgdXsLSF7?= =?us-ascii?Q?8rWa+92DsozsJgxJGTHnZ+uYjDQi7C7Zc4X0Thjhm1yVbxnNiAR5spOfRebq?= =?us-ascii?Q?Ba34wRzLtqBbZhwMgs8T4M4TR/Z+9xYp/DrxSCEuLbe1vNCqSbhIZCLSW95T?= =?us-ascii?Q?Z6QqP/Y5OO2leWLstheMrRJjqxq5z7lUyASqiUKoIpOdWc2k5SloreIfwhsc?= =?us-ascii?Q?Qg8+SLAFGi9lh9iVKr1ktvFsT3rk0Ep6YhjgDeDgWfRi0R/4wT//ooyfmX+Q?= =?us-ascii?Q?UUG2IP6LWJirV4AYBRnDM83D+/d7YTm5oQL3e/B4EtdARKhALy4GrJTlUKfu?= =?us-ascii?Q?uSoJ9OK0WhkNldPwDhc+ZmQGSjT+1KQa/+Z4NOZeRb402f0IhcTLP6f+yC3B?= =?us-ascii?Q?BOLOZiYB80LEX+qbxUHzY2Zh29KEAzgGu8gPKY+/5y4rzMhXlK989PxcUY/N?= =?us-ascii?Q?VS12dHRkjSyyZBie+6OeVMIFvrhnttL7h2zspc73Oxfby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TcEoFkftMaP+wE0RyS4YwH/gOTMHqRn2PGPJjE//WXWe2X7Z7bkA6t4WHPhMHC5MOsxdnShZWW/TOGTKnUE73GgGxVrm28PcI=; 24:BisVD+gLay9z++EzmqWC7qq041xQwIOl/sBAQEipfuUgIciRYDwTXxtB1fIOxr13ZpfmbNg//kDKEFuhzTdIVApi6b3frVT5diHv2A48IbQ=; 7:nsQdAwaI3tCVA2O3Sa3bKFNsIy41ittc/etlXfg+zg1gQH3MJZ6qE+QvDBksYzXXxrk0E5tkud8y2jvH9E7dGx64rpVVfzXJIGxGwJJypDWjVH4J0tat7BpxdPjFAnEtUvjC+NIjN+3ey/0HYPK53BRoS8NNxhKpx+Vxj137LBdkECxUzYM2FJ0AgKSKzydcCpxgYTNBowK7KSvwQVNIwd6pVWtRjbrjLkMwQg/u//GqynAS32mXF7hfGdGqeJeP SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 20:l6492QY3qK8OSrp3WhskJVzYC/fHey6FTvsK6A7RUOkHmpzzPizpaN/oZm9RJMMyL3K+QsNNI2k7Pqgnis2epX5AehTHRzVsPk269m76qCr0wChjcM5Eul3kiN+gZTrrHlmsn0IFoHa+DWvNdKLu/h9YyUkYwzM9xeAKGrLMMvAE4btNkW5obB37RJRSa7wHQNIxj7vGX+9Mqg5Il+CBMfj+NSV5yZDhlbjuBc0JUx2WYwWlNRisPXruqaznwpCF X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2018 16:15:24.7778 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 05775671-5e73-49fb-c6af-08d57ec67981 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0158 Subject: [edk2] [PATCH v2 1/2] OvmfPkg/AmdSevDxe: Clear the C-bit from SMM Saved State X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tom Lendacky , Brijesh Singh , Ard Biesheuvel , Jordan Justen , Michael Kinney , Paolo Bonzini , Laszlo Ersek Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When OVMF is built with SMM, SMMSaved State area (SMM_DEFAULT_SMBASE + SMRAM_SAVE_STATE_MAP_OFFSET) contains data which need to be accessed by both guest and hypervisor. Since the data need to be accessed by both hence we must map the SMMSaved State area as unencrypted (i.e C-bit cleared). This patch clears the SavedStateArea address before SMBASE relocation. Currently, we do not clear the SavedStateArea address after SMBASE is relocated due to the following reasons: 1) Guest BIOS never access the relocated SavedStateArea. 2) The C-bit works on page-aligned address, but the SavedStateArea address is not a page-aligned. Theoretically, we could roundup the address and clear the C-bit of aligned address but looking carefully we found that some portion of the page contains code -- which will causes a bigger issue for the SEV guest. When SEV is enabled, all the code must be encrypted otherwise hardware will cause trap. Cc: Jordan Justen Cc: Laszlo Ersek Cc: Ard Biesheuvel Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Brijesh Singh --- OvmfPkg/AmdSevDxe/AmdSevDxe.inf | 4 +++ OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf | 1 + OvmfPkg/AmdSevDxe/AmdSevDxe.c | 35 +++++++++++++= +++++++ OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c | 21 ++++++++++++ 4 files changed, 61 insertions(+) diff --git a/OvmfPkg/AmdSevDxe/AmdSevDxe.inf b/OvmfPkg/AmdSevDxe/AmdSevDxe.= inf index 41635a57a454..162ed98a2fbe 100644 --- a/OvmfPkg/AmdSevDxe/AmdSevDxe.inf +++ b/OvmfPkg/AmdSevDxe/AmdSevDxe.inf @@ -29,6 +29,7 @@ [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec OvmfPkg/OvmfPkg.dec + UefiCpuPkg/UefiCpuPkg.dec =20 [LibraryClasses] BaseLib @@ -41,3 +42,6 @@ [LibraryClasses] =20 [Depex] TRUE + +[FeaturePcd] + gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire diff --git a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf b/Ovmf= Pkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf index 31edf3a9c1fd..ba564abb787b 100644 --- a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf +++ b/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf @@ -36,3 +36,4 @@ [LibraryClasses] PcdLib DebugLib SmmServicesTableLib + MemEncryptSevLib diff --git a/OvmfPkg/AmdSevDxe/AmdSevDxe.c b/OvmfPkg/AmdSevDxe/AmdSevDxe.c index e472096320ea..5803e8655049 100644 --- a/OvmfPkg/AmdSevDxe/AmdSevDxe.c +++ b/OvmfPkg/AmdSevDxe/AmdSevDxe.c @@ -25,6 +25,8 @@ #include #include #include +#include +#include =20 EFI_STATUS EFIAPI @@ -71,5 +73,38 @@ AmdSevDxeEntryPoint ( FreePool (AllDescMap); } =20 + // + // When SMM is enabled, clear the C-bit from SMM Saved State Area + // + // NOTES: The SavedStateArea address cleared here is before SMBASE + // relocation. Currently, we do not clear the SavedStateArea address aft= er + // SMBASE is relocated due to the following reasons: + // + // 1) Guest BIOS never access the relocated SavedStateArea. + // + // 2) The C-bit works on page-aligned address, but the SavedStateArea + // address is not a page-aligned. Theoretically, we could roundup the ad= dress + // and clear the C-bit of aligned address but looking carefully we found + // that some portion of the page contains code -- which will causes a bi= gger + // issues for SEV guest. When SEV is enabled, all the code must be encry= pted + // otherwise hardware will cause trap. + // + // We restore the C-bit for this SMM Saved State Area after SMBASE reloc= ation + // is completed (See OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib= .c). + // + if (FeaturePcdGet (PcdSmmSmramRequire)) { + EFI_PHYSICAL_ADDRESS SmmSavedStateAreaAddress; + + SmmSavedStateAreaAddress =3D SMM_DEFAULT_SMBASE + SMRAM_SAVE_STATE_MAP= _OFFSET; + + Status =3D MemEncryptSevClearPageEncMask ( + 0, + SmmSavedStateAreaAddress, + EFI_SIZE_TO_PAGES (sizeof(QEMU_SMRAM_SAVE_STATE_MAP)), + FALSE + ); + ASSERT_EFI_ERROR (Status); + } + return EFI_SUCCESS; } diff --git a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c b/OvmfPk= g/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c index a307f64c9c61..946294701c62 100644 --- a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c +++ b/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c @@ -20,6 +20,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER= EXPRESS OR IMPLIED. #include #include #include +#include #include =20 // @@ -183,6 +184,26 @@ SmmCpuFeaturesSmmRelocationComplete ( VOID ) { + EFI_STATUS Status; + EFI_PHYSICAL_ADDRESS SmmSavedStateAreaAddress; + + // + // When SEV is enabled, the SMM SavedState is mapped with C=3D0 + // (See OvmfPkg/AmdSevDxe/AmdSevDxe.c). Now the SMBASE is relocated henc= e we + // remap the address with C=3D1. + // + if (!MemEncryptSevIsEnabled ()) { + return; + } + + SmmSavedStateAreaAddress =3D SMM_DEFAULT_SMBASE + SMRAM_SAVE_STATE_MAP_O= FFSET; + Status =3D MemEncryptSevSetPageEncMask ( + 0, + SmmSavedStateAreaAddress, + EFI_SIZE_TO_PAGES (sizeof(QEMU_SMRAM_SAVE_STATE_MAP)), + FALSE + ); + ASSERT_EFI_ERROR (Status); } =20 /** --=20 2.14.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Mon Dec 23 05:06:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1519834532683545.7428684915131; Wed, 28 Feb 2018 08:15:32 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id D9D162034D8C8; Wed, 28 Feb 2018 08:09:22 -0800 (PST) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0088.outbound.protection.outlook.com [104.47.40.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4223F22402E18 for ; Wed, 28 Feb 2018 08:09:19 -0800 (PST) Received: from wsp141597wss.amd.com (165.204.78.1) by SN1PR12MB0158.namprd12.prod.outlook.com (2a01:111:e400:5144::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.527.15; Wed, 28 Feb 2018 16:15:25 +0000 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=helo; client-ip=104.47.40.88; helo=nam03-co1-obe.outbound.protection.outlook.com; envelope-from=brijesh.singh@amd.com; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=vap63n8QP9GZFrCj1aLHvpKAUhXmYXuvrAh4430zm28=; b=g8Ua7sDggp6bzPWL1H8WNAR985RJSqrIQDfyesM1jU0KWyYcOCiw/VcA++WshElFV67aGTs6meW2uczExBAOIbmqNV1F+/th75S5E/pfOU4osCVZGWdmzfOa0YygdTOr3y7+lkMIZs/7N48sTjwM1REi8o3UClDURDaeCPR5bK0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; From: Brijesh Singh To: edk2-devel@lists.01.org Date: Wed, 28 Feb 2018 10:14:15 -0600 Message-Id: <20180228161415.28723-3-brijesh.singh@amd.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180228161415.28723-1-brijesh.singh@amd.com> References: <20180228161415.28723-1-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: SN4PR0501CA0079.namprd05.prod.outlook.com (2603:10b6:803:22::17) To SN1PR12MB0158.namprd12.prod.outlook.com (2a01:111:e400:5144::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 75fa38a6-cced-43a9-7400-08d57ec679d0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:SN1PR12MB0158; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 3:j+8ReqT80eopGTGibo6Xxa1H3EZkxb/ff6JfIEeIziMaU59o9WzaDI/1Nby86dsIUSlgV+T0Pa5MLHaDJFiJDINrUCg36VmnsojJHSN3RtY7g0cQgWjnbQepGH0KgWnIUCgTpybZs5f9BgxcWs9E2Jex8jOqJrgag6xjuBwf7GqIK6K7VTOLioSBFz4+U37rBktC4MnAaMK/ZAT9bWhSp3+ugKZYIW29VM7AloxeiPe1JQmKaSujzK15Fr91UjH6; 25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AJxFaydf4+9VyjE+KSw/nS6IVinOyziSSQpsNyo673mfPocuWdYig/EoUAsDWkFXM5Ew5WWOHD2aG8w62ZCPime; 4:zOkn7JpXBHNtqnJj5Apj5Y0r8LhwTHo44GEE4YsbuHi7kw4TPOUj8gXpFHjZ93VSbnbGJL5unmYxFovEOT2X90I1hSoERDIx3dLF22DqL1VRIQ07RaPUzPz+jlLinLQFw9vDpuPqTZ7y4pPo/xZCR5abE87GGIZckbeDcAVDI9EH+NDxXxiPiXNQIwN63IVOH2NLxLYo/aA1pR2BQINQYE+TxlYAv+zEozhuqLik4zDzoMh6ksPRrl30G6Nu6rQFTYgnD+T6UFyJx7xRkwPyB71SyYYjuyZKTCHSD+79BfV3p3Jfsp0ujIj5sC/0Ft449OSuyG/FNzTeJJsFiKxtWg6Z+Bvwdac3PusRwvlpMlc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040501)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231220)(944501161)(52105095)(10201501046)(6055026)(6041288)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123560045)(6072148)(201708071742011); SRVR:SN1PR12MB0158; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0158; X-Forefront-PRVS: 0597911EE1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(396003)(376002)(366004)(39860400002)(346002)(199004)(189003)(53416004)(25786009)(3846002)(305945005)(47776003)(386003)(26005)(8936002)(8676002)(106356001)(2361001)(7736002)(2351001)(81166006)(66066001)(81156014)(59450400001)(50226002)(16526019)(54906003)(316002)(16586007)(86362001)(6116002)(4326008)(1076002)(186003)(2906002)(53936002)(6486002)(97736004)(2950100002)(6916009)(6666003)(50466002)(76176011)(7696005)(52116002)(478600001)(36756003)(48376002)(51416003)(68736007)(105586002)(5660300001)(213903007); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0158; H:wsp141597wss.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB0158; 23:c0m1wUhqBZyGASDvL0hFj9C4JBEuQggxTq00Sy57r?= =?us-ascii?Q?3jb0G/3/f2wxUtZT/JIqlSUVwHSSJCFUCypG7LT3SavY1FjhwbZXobcDbVox?= =?us-ascii?Q?xxrmtymkaz8v60qJ7qpmEIn2aIv+kYRp1SIzCVc7ZW4j6bqy1vKSYoHOZ9zO?= =?us-ascii?Q?lum02HBhwKoAa8oxx3QoU6qKHNzJEpNViweA/URlWANjPkPA3UZtCeTXATpf?= =?us-ascii?Q?7xv3acGwQ3q68eGo9jqK3QS3pnB9AoEOvndUHhdnwp1IiUg3WmnNOVtU30+S?= =?us-ascii?Q?CCRnEay6lzQvB52io1nXTJ1G3ebRwSWdB3b3c5f4rrVgKrJgKjbQe9vBk2DE?= =?us-ascii?Q?AcD7vUbwZLlvFUtukm7hFzWtdtNLHpmGNiFZXHlN4j3Leb17ihMIic8lBSgv?= =?us-ascii?Q?f5WtIKaAz+D5zM/rZRJI3ChhZhFAd3aIdHApZogSxqPsqgqFJfqNvP3YiG/Q?= =?us-ascii?Q?Ygp6OAZqyStPuwsOY04AjT97ZOsWvTCLdMEKOnp6Zmkxcu0waLx7GwCMXUY6?= =?us-ascii?Q?4/qgrq65Lrv/jVOYi9NTyrAgrPR5Qtk3TVhZ7IbQb2R7m/ZJSLEjQl39FIbl?= =?us-ascii?Q?2Ob7CnLJDn634WCYBB1oK6/5nNZKiNzlhYbIdOTnn/SSA8JjpVRd7/JXMP0z?= =?us-ascii?Q?BcAEJBOjQpJ0wvAcj+rpoffv8hG9GGswJ9qKnVN7I0ghqznTpl6FMNLcuIc4?= =?us-ascii?Q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wzj2Ca6P/mnEVJHQGiQ+J2hoHaSNBsz5ZHipaEtcQh7F3IyAqz5Xgd8YBcinrOHgNNmGVequasIYRVLXGeDlYba2sEKcDSCK2UwI4lN2j12aqhEZHMwQ0pXpcBTJTN7nXQDOrW8NSw4Dpm1TPBy19JMRQtKY8dkwNLweY=; 24:/ot9C53MiZvGs3QhZHI3HnThrqb+XqrgeUaFMP8NmlpipzxG3HMbjT8RAh6q1lBvaI5Gpsc1jXG94qFzEIW6NaukrrezbzGXmUnTRKRLBu4=; 7:SX/c724Mo8jFx1iCWg6e8J6MtoD4fssf6J8OHIRy73hngKc7h5fGYEBU/cOIhz6XvuMsYOLuGDmbvGTxjZBLqbg0tO6n0GCdu6CSWd9WhPjChLI4Z66UTsqCuvRcPzIahx12HFzPGvhKeriCy499eFLSdSeSPr6c2XluWpebrzFCXwq6D6Dix4n2FT0f79Xvwkta4JUzge7UD/toWQ67Cg2jtYAGbN8JyGm1yLPFEr45MjqkKRhwDo2RWHFvhJ7i SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 20:1B2eZmLV+JHySVILEmwkJdoUstDQyuG5eAAVFLEnMRiIArPvkMBQx4v7ipnEDD2nTe/FuiUT80hU8ENe7whw8GxHPy4Ma8S38MNaN7w1+I94SUb8JMYv3sXLtcWF6Hn5SxfuzRf+2Qo+0or/SrgeMuH6iLpNN+VPmX2jIOKVRK7pQjMhwuECnCx5TN4yUpPfa82b04F2vzhMpMtpvpmeR8SCd+w7axOam6nd0YL/ezuqsss9vuI5do4kCnLcPluq X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2018 16:15:25.2934 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 75fa38a6-cced-43a9-7400-08d57ec679d0 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0158 Subject: [edk2] [PATCH v2 2/2] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Clear C-bit when SEV is active X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tom Lendacky , Brijesh Singh , Ard Biesheuvel , Jordan Justen , Michael Kinney , Paolo Bonzini , Laszlo Ersek Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Commit:24e4ad7 (OvmfPkg: Add AmdSevDxe driver) added a driver which runs early in DXE phase and clears the C-bit from all MMIO regions (including Qemu Flash). When SMM is enabled, we build two sets of page tables; first page table is used when executing code in non SMM mode (SMM-less-pgtable) and second page table is used when we are executing code in SMM mode (SMM-pgtable). During boot time, AmdSevDxe driver clears the C-bit from the SMM-less-pgtable. But when SMM is enabled, Qemu Flash services are used from SMM mode. In this patch we explicitly clear the C-bit from Qemu flash MMIO range before we probe the flash. When OVMF is built with SMM_REQUIRE then call to initialize the flash services happen after the SMM-pgtable is created and processor is serving the first SMI. At this time we will have access to the SMM-pgtable. Cc: Jordan Justen Cc: Laszlo Ersek Cc: Ard Biesheuvel Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Brijesh Singh --- OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf | 1 + OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h | 7 +++++ OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceDxe.c | 12 +++++++ OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceSmm.c | 33 ++++++++++= ++++++++++ OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c | 6 ++++ 5 files changed, 59 insertions(+) diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf b/Ov= mfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf index ba2d3679a46d..d365e27cbe59 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf @@ -53,6 +53,7 @@ [LibraryClasses] DevicePathLib DxeServicesTableLib MemoryAllocationLib + MemEncryptSevLib PcdLib SmmServicesTableLib UefiBootServicesTableLib diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h b/OvmfPkg/Q= emuFlashFvbServicesRuntimeDxe/QemuFlash.h index 8d83dca7a52c..6c4099c140e8 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h @@ -88,5 +88,12 @@ QemuFlashConvertPointers ( VOID ); =20 +VOID +BeforeFlashProbe ( + EFI_PHYSICAL_ADDRESS BaseAddress, + UINTN FdBlockSize, + UINTN FdBlockCount + ); + #endif =20 diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceDxe.c b/O= vmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceDxe.c index 63b308658e36..a4614de3c901 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceDxe.c +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceDxe.c @@ -155,3 +155,15 @@ InstallVirtualAddressChangeHandler ( ); ASSERT_EFI_ERROR (Status); } + +VOID +BeforeFlashProbe ( + EFI_PHYSICAL_ADDRESS BaseAddress, + UINTN FdBlockSize, + UINTN FdBlockCount + ) +{ + // + // Do nothing + // +} diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceSmm.c b/O= vmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceSmm.c index e0617f2503a2..a6cad5af223b 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceSmm.c +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceSmm.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include =20 @@ -67,3 +68,35 @@ InstallVirtualAddressChangeHandler ( // Nothing. // } + +VOID +BeforeFlashProbe ( + EFI_PHYSICAL_ADDRESS BaseAddress, + UINTN FdBlockSize, + UINTN FdBlockCount + ) +{ + EFI_STATUS Status; + + ASSERT (FeaturePcdGet (PcdSmmSmramRequire)); + + if (!MemEncryptSevIsEnabled()) { + return; + } + + // + // When SEV is enabled, AmdSevDxe runs early in DXE phase and clears the= C-bit + // from the MMIO space (including flash ranges) but the driver runs in n= on SMM + // context hence it cleared the flash ranges from non SMM page table. + // When SMM is enabled, the flash services are accessed from the SMM mode + // hence we explicitly clear the C-bit on flash ranges from SMM page tab= le. + // + + Status =3D MemEncryptSevClearPageEncMask ( + 0, + BaseAddress, + EFI_SIZE_TO_PAGES (FdBlockSize * FdBlockCount), + FALSE + ); + ASSERT_EFI_ERROR (Status); +} diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c b/OvmfPkg/Q= emuFlashFvbServicesRuntimeDxe/QemuFlash.c index 5677b5ee119c..f63e11723415 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c @@ -244,6 +244,12 @@ QemuFlashInitialize ( ASSERT(PcdGet32 (PcdOvmfFirmwareFdSize) % mFdBlockSize =3D=3D 0); mFdBlockCount =3D PcdGet32 (PcdOvmfFirmwareFdSize) / mFdBlockSize; =20 + // + // execute platform specific hooks before probing the flash + // + BeforeFlashProbe ((EFI_PHYSICAL_ADDRESS)(UINTN) mFlashBase, + mFdBlockSize, mFdBlockCount); + if (!QemuFlashDetected ()) { ASSERT (!FeaturePcdGet (PcdSmmSmramRequire)); return EFI_WRITE_PROTECTED; --=20 2.14.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel