From nobody Tue Nov 26 22:26:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+46097+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 15663011663351018.8188840084395; Tue, 20 Aug 2019 04:39:26 -0700 (PDT) Return-Path: X-Received: from NAM02-SN1-obe.outbound.protection.outlook.com (NAM02-SN1-obe.outbound.protection.outlook.com [40.107.77.57]) by groups.io with SMTP; Mon, 19 Aug 2019 14:35:56 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hQhEMCjqeh3KQnzhwOlVAIkNLA1Owdb0f4d4XxzbGcw+sIX0M38Wq3cc3IaZ4cu1fgr13zCbPfHDGGLA+rq4IdptMp38l+Vn4K10+R48HjYhqzkZNRyiemY/G32+E5P+KmZOMo9UyaRDwdwUx/dGQ3LYiPEjgIUXXErVJgIPcz/TmEkzl8b/WzJ/zx1pqTmwNO59s4IyvavRCSsmcAJh5p164g4H7uf2s3zlGKZwFf7hcDqRp/CdNnYP9dn6tMbAls9bd/bA0F2wiks7lDtlI3xiEXlkWEDbxViYxgB0UDEmxicVmTag65iTrE2z0qxlIa6SNTDGiyeWEI801+mPmQ== 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=MyRetcf+yn/3HCLYTXVf4pHQiKU4YRETo3ZN5m9cPxg=; b=JBXwIlJngVpdR6LeKUz/nQh8TU8yjlKWhCRC7WkFeq+mEMla1J5icgcn4MFwncuQoboqaN4THHxTIem9Ekg2xYMlKhqQzfiZHForAc5BQiBPkkc3jk20++Bk7OfYAVUaR3nIunGyCxWOHjZqFoYr0wSLjTEdKmu2HYUcHmErk/LfBuJcI0Q1GX7cgjkSKBJP/tHIZl7cwe8/hVh9ivYCnXXklUnldr6HyHo+86l7u9T0rXd1cQTL4TYJBcutaZ5vpX/BNRNftKUwSQuolQwnBHry9p05dZFxFXSTlfMR9i4jRH+kIevmSE/XnIugB/nUXPAl9daDidpjK9ZikUgaMw== 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 BYAPR12MB3158.namprd12.prod.outlook.com (20.179.92.19) by BYAPR12MB2965.namprd12.prod.outlook.com (20.178.52.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.18; Mon, 19 Aug 2019 21:35:54 +0000 X-Received: from BYAPR12MB3158.namprd12.prod.outlook.com ([fe80::39b9:76bd:a491:1f27]) by BYAPR12MB3158.namprd12.prod.outlook.com ([fe80::39b9:76bd:a491:1f27%6]) with mapi id 15.20.2157.022; Mon, 19 Aug 2019 21:35:54 +0000 From: "Lendacky, Thomas" To: "devel@edk2.groups.io" CC: Jordan Justen , Laszlo Ersek , Ard Biesheuvel , Michael D Kinney , Liming Gao , Eric Dong , Ray Ni , "Singh, Brijesh" Subject: [edk2-devel] [RFC PATCH 06/28] OvmfPkg: A per-CPU variable area for #VC usage Thread-Topic: [RFC PATCH 06/28] OvmfPkg: A per-CPU variable area for #VC usage Thread-Index: AQHVVtYUanvxBD+q6E2MuwUQV/mnvg== Date: Mon, 19 Aug 2019 21:35:54 +0000 Message-ID: <1f3b874316842a078338be79d246e5fcafc40bd4.1566250534.git.thomas.lendacky@amd.com> References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SN2PR01CA0031.prod.exchangelabs.com (2603:10b6:804:2::41) To BYAPR12MB3158.namprd12.prod.outlook.com (2603:10b6:a03:132::19) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [165.204.77.1] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 85d61f24-4b98-4dc6-9b58-08d724ed36c1 x-ms-office365-filtering-ht: Tenant x-ms-traffictypediagnostic: BYAPR12MB2965: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+46097+1787277+3901457@groups.io; helo=web01.groups.io; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: E40UVJraVvi+E1SZrDHUHPfv7ZN9mOxwillcN7KShSVVCOOG9BGXT8TqEvAIcdVM3Cv37ZRI8cuRDGirHSWsiNxGcSQVMWDSj0GRP2bNyO0tbe3/zwRWbnhw8K4w+1HZs/gc0wYTdeUT4Ndkgc+6398EjJuqSKxsoMQosB6WiG8dZuFxuIy760ZOHqq419Aaaw8OdNjdp5fzf0gJjonCpvNSxnOypgEFVZChErBg6Cg6G0+Z3qIbgKRwHZIuMcY/HA56OQ3uMDR7cL//CM7rOazLnjX13R30t+LVDQdV94jrIVaxkszxdsUPYUPnwGdFOQG83i7x65yUJKU9GO69c89Rt5dMaMDy9LcAzUr2Q8/YqPWU+Qk3mVEOoqVbELkRX3mGC0aZnW532gbFCfb9BWBH00jZfhNjOQjnk8WUnPg= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 85d61f24-4b98-4dc6-9b58-08d724ed36c1 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Aug 2019 21:35:54.3959 (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: nHFJQYlVD9Zu8Xk05m3L7nke5Zl8OBGJtnepBCDHHNdeW0b0yTwoG8XzK1iOSnxWrUV4KLpGWz5KlCyfaZPBGw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2965 Precedence: Bulk List-Unsubscribe: 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 Content-Language: en-US Content-ID: Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1566301166; bh=TAP9YUF3KCFZM4WSRixG+2ZwPiAFMIqSWWsjkV7bTXo=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=IKu5YszBm1V77lUv0qgBe2XPjlHBpkAj96d5IB0ZHBPsrWvmGyO5NVBecznT5+yhfcq bvi9uUXAEsWeq2opLP6GpXAbRyN7HxUrGnQ9WJqo8nXBWPqO5Xt8LBHUYd6L8ck8zekwn Db3OmIFNya5thjQW2OVnufa1rT0sR8uVCOU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Tom Lendacky A per-CPU implementation for holding values specific to a CPU when running as an SEV-ES guest, specifically to hold the Debug Register value. Allocate an extra page immediately after the GHCB page for each AP. Using the page after the GHCB ensures that it is unique per AP. But, it also ends up being marked shared/unencrypted when it doesn't need to be. It is possible, during PEI, to mark only the GHCB pages as shared, but DXE is not as easy. There needs to be a way to change the pagetables created for DXE using CreateIdentityMappingPageTables() before switching to them. Signed-off-by: Tom Lendacky --- OvmfPkg/OvmfPkgX64.fdf | 8 ++++---- OvmfPkg/PlatformPei/AmdSev.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf index 2a2427092382..3ba3d7384745 100644 --- a/OvmfPkg/OvmfPkgX64.fdf +++ b/OvmfPkg/OvmfPkgX64.fdf @@ -70,13 +70,13 @@ [FD.MEMFD] 0x000000|0x007000 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesBase|gUefiOvmfPkgTokenSpace= Guid.PcdOvmfSecPageTablesSize =20 -0x007000|0x001000 +0x007000|0x002000 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecGhcbBase|gUefiOvmfPkgTokenSpaceGuid.P= cdOvmfSecGhcbSize =20 -0x008000|0x001000 -gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageBase|gUefiOvmfPkgTokenSpac= eGuid.PcdOvmfLockBoxStorageSize - 0x009000|0x001000 +gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageBase|gUefiOvmfPkgTokenSpac= eGuid.PcdOvmfLockBoxStorageSize + +0x00A000|0x001000 gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|gUefiOvmfPkgT= okenSpaceGuid.PcdGuidedExtractHandlerTableSize =20 0x010000|0x010000 diff --git a/OvmfPkg/PlatformPei/AmdSev.c b/OvmfPkg/PlatformPei/AmdSev.c index 84896d4681f9..87ac842a1590 100644 --- a/OvmfPkg/PlatformPei/AmdSev.c +++ b/OvmfPkg/PlatformPei/AmdSev.c @@ -42,7 +42,7 @@ AmdSevEsInitialize ( return; } =20 - GhcbPageCount =3D mMaxCpuCount; + GhcbPageCount =3D mMaxCpuCount * 2; =20 // // Allocate GHCB pages. --=20 2.17.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 (#46097): https://edk2.groups.io/g/devel/message/46097 Mute This Topic: https://groups.io/mt/32966269/1787277 Mute #vc: https://groups.io/mk?hashtag=3Dvc&subid=3D3901457 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-