From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on062a.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe45::62a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 95920820B9 for ; Wed, 8 Feb 2017 13:13:31 -0800 (PST) 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=VIWICYlwZEfzHmkep52E8sieNzWCvlyu+d5foU3gfLM=; b=SLvXN1XGUH3329bqjKc73++8Sto5cCGCg51TR8x+5QgJNcnSW6CTptqpC9NTalIHjbmPIsmvkFDj/28xHUx9ecpnVL1hfX1Pub2ZjUfzeIWBfCGZGp21xz/WDk3LV7mn0N1FffAoy3bhe1YuGMuxmYtZ5TCpVTmOyhkstz1M3jw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=leo.duran@amd.com; Received: from leduran-Precision-WorkStation-T5400.amd.com (165.204.77.1) by MWHPR12MB1247.namprd12.prod.outlook.com (10.169.205.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Wed, 8 Feb 2017 21:13:27 +0000 From: Leo Duran To: CC: Leo Duran , Jeff Fan , Feng Tian , Star Zeng , Laszlo Ersek , Brijesh Singh Date: Wed, 8 Feb 2017 15:13:06 -0600 Message-ID: <1486588386-2146-4-git-send-email-leo.duran@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1486588386-2146-1-git-send-email-leo.duran@amd.com> References: <1486588386-2146-1-git-send-email-leo.duran@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: BN6PR17CA0001.namprd17.prod.outlook.com (10.173.147.11) To MWHPR12MB1247.namprd12.prod.outlook.com (10.169.205.7) X-MS-Office365-Filtering-Correlation-Id: 36b2d3f7-d06e-4b0d-8c1c-08d45067541e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:MWHPR12MB1247; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1247; 3:BHFJOeif2yXZE3czVmwn7U+ge8FQHlF5XoclMXwYk3beAVUOZ8BK8+qvzvdoPqXEPZiF2Y1OVQFeWgHsBlL7wIM+OAAMaeO7q1K7z1ND7wz+q4wVR5vc4x7Za1DNQpVlN9JS5WyKJaRL4ZMB9pbKGPPvmRM8nrE0W2T2zpkEY4j+SSJN311HIJW4Z++zzqRKwigpRqssJKJNE/laB7ObppWyTyEp0tXr5iG6Ogzydi4xrUfDyhpfG9dfhjJz8u8Iu+uBvr1mlKC+xDvBd07im/LV/Ix+qq9KeHV4lMDMiTc=; 25:Y+lvoV4VNd+1WLV5W2AjTNVNVKZsSf/88pKKPubAI0AfP/QTil3MD+jeY38vdY4zltqc0Dl8DzkutMLeA9nrEOcFMOhBVhp1vtL+FjMGjoRwcFkMLJomaaSN1zCVJX8sofvGLMSyWQokx+64a/qOQUEebXRp3kYXNduZ7XoqGocyRasHf4HEmUSRmLh+X0tv3PfaR0d3r72pakGFx7ROrVnNTU+Qph1liXZH6U9PwJ/d9jCmjIgT/rk8lTGzF7M8+bEhd80B4C1gZEg0IaubxwLHnn8vP1sURxFm8NkxQLfPmHhdJ6JmsH/u4Z7T3a8Upd5LcXSlBqRz8MU//U0ZXvXmUYitd5n0E8njZHtcbX0WvQa6+LoWBsdaxTkr8BBwDGAWDkunj3CGCXsmUw6/SkFi4RpyQdgwL1wDF7i9SGqpYCqlZ67H560rP+1MPIERaiuSIGwL3XqIt+X7kctfyg== X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1247; 31:5OQcJF33NSDr3g1e8f/AQI+5vpjrwjFoEAjjOIiaaLd6shuYIKwaLXBaRLTP0mITboHn1vJLkVvASYe6DfipMIiBNzIurCzCt6/PLYAvxhVaG6wj1CmcnNLoVpIwIDtHEvX0I8reK9x9nhSqgXMUphOM3ni/LxNDFhZIfQPDGD2PmgJ3a3YEIJkJfO1aWEXP3iIBBNcaWHgBeB6ydPWMBtV4M8ymPlzR6uXelepINv5XDmM6CBSPtNCbCdMVNYge; 20:bSkr4rAAHO2vcxtY/7MzOiqBcHLx11dJ+i7V47O75lI7OopKKdjVepEPzbiBFqag7cKWvvS2h5S24UAOxAZHcjc4VCNZviQ97pcPvNUYnh6akY6K+hbMxiJFbwNnc1fne8xVWY0HW8ZgUrl2pXvDOOTmoZtW1OyzhhTiXcqBkKESrUZOxK/Odxoy5jnOPwtvWz+0xztiLHUFLjw8mSMrOayUaRWawyD/bhWSPWewiQQYNMlo3uMBCm7Xgww29jwUYmaqMtzkQenp3CI9MTD4T7yuc4a2+d1ws+/YXtmkRLF1gTZX7aJdxwnpsOs8Jk1IW2dYyBm6/fIyp+crFl/5KOwcusVpd/Ah8dw7UzmKM+jpMbAMBHyDumGDANbmDQd9b/nu8zRA4e1XG6L/KNOCYGuG7LZ23TgV6pRH6jfzUaPx6pPHt4CZLeMgqznAnrDhOSxCv9f1sYnvAHqBCIqIUENOkJDCxS/iROpZ4Rq8OnkhORWbaLR7CMtRxkcP5+3u X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(2017020702029)(20170203043)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123564025)(20161123555025)(20161123558025)(20161123560025)(6072148); SRVR:MWHPR12MB1247; BCL:0; PCL:0; RULEID:; SRVR:MWHPR12MB1247; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1247; 4:kmdaVNzUqkSE21A+MkmyQYl7UM5ujssKFVKzNcxEPwfrhRwKF5FQldvBWTyqFnGIF2ETpwIx2P5IFk6hELNr3l+OP2hk9cFHs1UGtuyjSanO2t5Ej/HSmERnW7/kQaEtrCLhbqJRDrpUiZn+IClom8CK0WxM94ka3bBE70aR3ReBcRtqhu3o1rpKiUUj0Iuvn/yRU57RNeSWhn8DrmHpbNRSI79+Nih2aaS7uCjyHg86itwT+Xr8UlyPXh0zomi2dxUuRAaHGfYxv5IVrQueJVbF2ZOpicbD+5DFYJGVEtXJJQLJVVOrWs/7CWEp36x/LC1WDWnYqBPdjx45hJSVbHbwxnLHeu947GNIIhuS+GWdyzORrN0KgQNBUCCnFoy8VT2L1WZJYFzVSacnmCEVCRMxUP66gFM/dVj5AInDDuHhhRWhOH9QdUvOqiW/zIYxJvXetEm42SbqHpqc6XvGxtbWTTsf2wSbdN+QblTx+XiWKFVkIqxUioPXCGtVLnKaxLXEcmLTjS72y3HdPFIusQ4UiUe5yxKFfsjtijWYz6THlydQwNZ35l8Zm/S6Ye9EZAdUkgN9EJ6L0i9rSRpO3YSL42f9q1p/kn4Y/bHDKyDjz1KAxroE4lN5z8CMCa3Bh2Jtt3XEBlNvT4lZxIRutWHo2Pf4VksIzNFa1y89RIAiIh8v0ZwTlEXeNgXxlUziZfzpHyS1V8EhrCyWduPX2qCnbDQuLhTPkTZn/+sbla+dl+bYupvRhKaQkQ/lLmPS X-Forefront-PRVS: 0212BDE3BE X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6029001)(7916002)(39850400002)(39410400002)(39860400002)(39840400002)(39450400003)(189002)(199003)(5003940100001)(68736007)(42186005)(50986999)(54906002)(76176999)(50226002)(2351001)(8676002)(81166006)(3846002)(81156014)(6486002)(53416004)(66066001)(101416001)(92566002)(47776003)(106356001)(6116002)(25786008)(2906002)(2950100002)(105586002)(38730400002)(33646002)(6666003)(36756003)(305945005)(48376002)(7736002)(53936002)(110136004)(97736004)(86362001)(50466002)(4326007)(6916009)(189998001)(5660300001)(213903007)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1247; H:leduran-Precision-WorkStation-T5400.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; MWHPR12MB1247; 23:5s8WAQL5fCk5c4kvAPv3V2i2xZdYveKaZMYUsVOiX?= =?us-ascii?Q?i1LKT2oSqIf0N281qJ/hOlNx7rS9vw/2BCWlCQE2MvC8EkZf0/hu3mMkSe+h?= =?us-ascii?Q?uQmWYb+tynDZChEeTngO6slIqIjXp76Xg+jLgGTnxSgJKsWDwvW7OGBSXubW?= =?us-ascii?Q?PiuZxBUF28xmoHQ+1o24EUlA6YbiAowpsBYJaoi8lzb/HahEPCJ41DLIno58?= =?us-ascii?Q?X9J5hgvCL8PzNzWpu5r5GKHT1CA+fk3bnkUdQ0lyVDrRyfAW/CSCEVv6G8Bp?= =?us-ascii?Q?/gVDm46gH1DYfDfJmu5qVtKrUwhcxraB3HKYSfEoKjaU3d4ugoEzuXJPOs65?= =?us-ascii?Q?/Cj9rcNpdUBEbl/lnBuKvMDXsidWi0x+vlWNz4/AXpejyK50R7JD1RAEcPeG?= =?us-ascii?Q?eLsE8TR56i3lEQj12RcWjwGkyJR31zaXGafrE5DGXRK8clw6grNbYTJlnHjt?= =?us-ascii?Q?8c30dmJ+ytqwHGTgNAqU674tObJfCDKLX3oh+wHkl98/rm4RQltwck6y1RIo?= =?us-ascii?Q?MVCOAV1RWLC4Qm/vC3A1tEfZvVYeVmAJU6SE4f0NYBRwx2OzEBtqASbg9QIP?= =?us-ascii?Q?2IR/ajgIDjQqKXt9mKsz5Ot3KNh8BIpv7mcvEuHWSUvqHhy+GdtDt6vUWORj?= =?us-ascii?Q?stlm67Pt3+kgIOxG1KubwXDgE+IxRjbXadHbLEuvp2fL0pC2E9dUFxhBqmFX?= =?us-ascii?Q?OhEcrpZoEeDORGe1STalOx4AO638OS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YhJp6x4wFHXZzdEBT3gBfm+sygVwcdTGGmaugusW3lENMxNmpCqnp6SWAeemFoCQKsuofI3qRuW0cyePGv+vHHGJ06dnUbmVPnyaJo9wGT+21LokF8pLL8PCEFpYC8aiPXh+hTczuvHuxe/y2FeoAiznE X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2017 21:13:27.8485 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1247 Subject: [PATCH 3/3] UefiCpuPkg/Universal/Acpi/S3Resume2Pei: Add support for PCD PcdPteMemoryEncryptionAddressOrMask X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2017 21:13:31 -0000 Content-Type: text/plain This PCD holds the address mask for page table entries when memory encryption is enabled on AMD processors supporting the Secure Encrypted Virtualization (SEV) feature. The mask is applied when page tables are created (S3Resume.c). CC: Jeff Fan Cc: Feng Tian Cc: Star Zeng Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brijesh Singh Signed-off-by: Leo Duran --- UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c | 9 +++++---- UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c index d306fba..ee1e2cd 100644 --- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c +++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c @@ -5,6 +5,7 @@ control is passed to OS waking up handler. Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2017, AMD Incorporated. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions @@ -696,7 +697,7 @@ RestoreS3PageTables ( // // Make a PML4 Entry // - PageMapLevel4Entry->Uint64 = (UINT64)(UINTN)PageDirectoryPointerEntry; + PageMapLevel4Entry->Uint64 = (UINT64)(UINTN)PageDirectoryPointerEntry | PcdGet64 (PcdPteMemoryEncryptionAddressOrMask); PageMapLevel4Entry->Bits.ReadWrite = 1; PageMapLevel4Entry->Bits.Present = 1; @@ -707,7 +708,7 @@ RestoreS3PageTables ( // // Fill in the Page Directory entries // - PageDirectory1GEntry->Uint64 = (UINT64)PageAddress; + PageDirectory1GEntry->Uint64 = (UINT64)PageAddress | PcdGet64 (PcdPteMemoryEncryptionAddressOrMask); PageDirectory1GEntry->Bits.ReadWrite = 1; PageDirectory1GEntry->Bits.Present = 1; PageDirectory1GEntry->Bits.MustBe1 = 1; @@ -724,7 +725,7 @@ RestoreS3PageTables ( // // Fill in a Page Directory Pointer Entries // - PageDirectoryPointerEntry->Uint64 = (UINT64)(UINTN)PageDirectoryEntry; + PageDirectoryPointerEntry->Uint64 = (UINT64)(UINTN)PageDirectoryEntry | PcdGet64 (PcdPteMemoryEncryptionAddressOrMask); PageDirectoryPointerEntry->Bits.ReadWrite = 1; PageDirectoryPointerEntry->Bits.Present = 1; @@ -732,7 +733,7 @@ RestoreS3PageTables ( // // Fill in the Page Directory entries // - PageDirectoryEntry->Uint64 = (UINT64)PageAddress; + PageDirectoryEntry->Uint64 = (UINT64)PageAddress | PcdGet64 (PcdPteMemoryEncryptionAddressOrMask); PageDirectoryEntry->Bits.ReadWrite = 1; PageDirectoryEntry->Bits.Present = 1; PageDirectoryEntry->Bits.MustBe1 = 1; diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf index 73aeca3..d514523 100644 --- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf +++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf @@ -6,6 +6,7 @@ # control is passed to OS waking up handler. # # Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2017, AMD Incorporated. All rights reserved.
# # This program and the accompanying materials are # licensed and made available under the terms and conditions of the BSD License @@ -91,6 +92,7 @@ [FeaturePcd] [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable ## SOMETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask ## CONSUMES [Depex] TRUE -- 1.9.1