From nobody Sun Dec 29 01:21:52 2024 Delivered-To: importer@patchew.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; Authentication-Results: mx.zoho.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 1495809875169904.32570642044; Fri, 26 May 2017 07:44:35 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8C47821952CD9; Fri, 26 May 2017 07:44:30 -0700 (PDT) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0606.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe42::606]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C026221A0293B for ; Fri, 26 May 2017 07:44:28 -0700 (PDT) Received: from brijesh-build-machine.amd.com (165.204.77.1) by SN1PR12MB0158.namprd12.prod.outlook.com (10.162.3.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Fri, 26 May 2017 14:44:26 +0000 X-Original-To: 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=ta8MMW0FUhdmyHAd99zps1/E7rze3cmBQK4kHMijbHE=; b=P9ce39WarPp6ccH0i6zOas1TOg4FxTt0WBQ69d/my7CKRN4uKeu0r4qxWuW2K1WMyv2tr26zUCNXT9U+u6J/g4JToX51szoRvp+xsKHqxE58VPhgaT9imhdQBHE8nfeqinOcABYn4/I9GJ/FW/mq5SbBr1BqEW1LCx2MrSVPwzc= Authentication-Results: lists.01.org; dkim=none (message not signed) header.d=none;lists.01.org; dmarc=none action=none header.from=amd.com; From: Brijesh Singh To: Date: Fri, 26 May 2017 10:43:49 -0400 Message-ID: <1495809845-32472-2-git-send-email-brijesh.singh@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1495809845-32472-1-git-send-email-brijesh.singh@amd.com> References: <1495809845-32472-1-git-send-email-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: CY4PR16CA0024.namprd16.prod.outlook.com (10.172.173.34) To SN1PR12MB0158.namprd12.prod.outlook.com (10.162.3.145) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PR12MB0158: X-MS-Office365-Filtering-Correlation-Id: 26552154-3982-4a1b-888a-08d4a445b5b0 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:SN1PR12MB0158; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 3:+tExvLdDn3On+m/AwInPsUXCtf6I1c8Fh06QcAgfTITwrrVKonj50CFqeqoQfg/nzwlMVxAjyNWfmu9goWxsWcxiqKpXWZOtCn5ZATpJQb6P8NnQ2Nm2KVqq8VcFCWVp30UySpUutLm49V51VQDi3RVnZmPGXLPMgcrIRlUhqTN82kXrnBN/18r34CEcTYOdXZb43129zkysOQmJeXGWpp5/S3ZsGxhcpDU2K6BhsQdwtUrbkWBK9WqqPMsNMm2ikMEMue2N+w82by6pqPdrsjvO/Sui1spDRARbNMK3T5LsFBOUnsY0Solsp4WROc8ue9gKUHeaT1FO+gbRC5G7DrVPEYpf4opzN6xrlO1CrfY=; 25:lc+Wk0zhZSAt/GyoxlUr1exLngIBe99+b0mu8r1c3kDenNjczuT5Zi5UM34O5VgI71YFcqFU8ZUNJExMCUFqyStvONt29Xvm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emaZIghiWC/ct7CVeheU4YRIapbrUbHyaoPFaRAJ4fu4EPtAcgpjkCb5WijN1sRDtxiYBeGk+/YGLErp6bEqGXXxbKwzT88ga7GQoO38/cL9ws+ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148); SRVR:SN1PR12MB0158; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0158; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 4:c8r9vfjZZSKdf+l/5ojcYDuKy1J6tZEAZjUCVcC7Dc8TLH9/MYhk7CXjVA9gaFWJCsTwHmJimUw2nk2cosxo+x+l6Hdlx/vVX7kZHpd+FCynEgiFD49C0IT+mmrtQY5by6zQug3Q5e7CwmToWFSr3WKHOq226lj3+YaPedIVXHi4We/AcIG8b6JyMkKemZhGXqXKCDNuMV1rQS7Hfw3WvGAnAHMGM6MBK2yjYIp0+L97aWLox/we3HoN5jI3vAIYs+YKB7bQ7qcx81bav7+rO/4I23JdbRh2SAH1D+ne+lxiv6nS7LA38cFv/+FhYOqsx6AmHOXp6M6Kt/JInQ6fkgqp7p8l+APlbykWEtC13rxHRf1gGOhfXH4qXBKZzE13ZfLtZWkNUAFSWRcPC8xZyLxuVjKbHrviH4T/eArZKPMweTN/C6jpKOTh2+Z8iG4jsBHKahMO4w2J7l3d/T1uypiOuKHlYO4kpkm/Z0wfuQHLbDwhEscLM+kr+rUvP/X+x2Qmw2ssI7V3CRWzvZXi51sHVCB+TviLrn/stB1gm/ZtaeioTBy+xl1mWcrE0X86kye5avTl80mS5RoEajji6SzA3ihKVhFQnKHg7+OcAdWNo+3vGqIoRQoN8mDscH191pZAOxLkZTuPBpDmQcDTvO4dHVzt3rG1CxKBjfw5HdMBYNE9XoVRidTD4FticKuKSyzNGIqZFGuqpm8kuDL8ZE3+s/R3XtE+dgQLwue7rbSsmQyNyQJ8UkGb/V3Ix5a7ZuBOiqjmcpR6EbsA+17RYRVme1Nen+Jvfpg3HtRsyu5fuuSpFCpFlrKpuAN3RERXeeUP1DdQRcKq5VV5biUwBkJwjO4kqKb4yY0xbb9jPaGTIKuQJbIDM1ldfBj6woQ/ X-Forefront-PRVS: 031996B7EF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39410400002)(39840400002)(39860400002)(39400400002)(39850400002)(2950100002)(53376002)(6916009)(6666003)(38730400002)(110136004)(50226002)(6306002)(76176999)(36756003)(81166006)(8676002)(53936002)(16799955002)(86362001)(478600001)(48376002)(15188155005)(54906002)(25786009)(5660300001)(50986999)(189998001)(5003940100001)(33646002)(305945005)(6486002)(2906002)(53416004)(47776003)(2351001)(575784001)(42186005)(966005)(3846002)(6116002)(66066001)(4326008)(50466002)(7736002)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0158; H:brijesh-build-machine.amd.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB0158; 23:RXN8mb4eAdApYgHorJBawgqSgfAfJuODJpikiP3bq?= =?us-ascii?Q?+isnzgVd5xXhwBuEcEpM3YJhfXO4NSkLO9fXZL/0T/b3QsAg42ZMYO8g82dr?= =?us-ascii?Q?KkgmNcx3jNUGDJEfgSVFj0G7qQ2I4yMMTZ3HzapGCGjjULsYSRpy/SCBCZpj?= =?us-ascii?Q?w1whT6tXGDDTLwiQQlzly0EVBqLmIpXFB6jTeoL0Dd5K3r1S9RSA6JYf7+Pi?= =?us-ascii?Q?c3hdO7WIBVq17NG9ZtGCqByDtef0w8/TEpk7ZE/ReY2gQO69f/GUwZQ8aFo5?= =?us-ascii?Q?b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VsZ?= =?us-ascii?Q?El/hWQM+b2GpAT9Xb9XKC70x6CcV9xMB749KwwMdXEpM9wGmP9xqpnyMquSa?= =?us-ascii?Q?Z1RxlEyigAdQPLdovM=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 6:0vQqi2+Hj8wis5luGvzuCvJ6LmW41a16qgpcDKVjdhV03vsSAV9SN2nhx+8XpsPnl+T/CqE/LIy4N7YrDv0JkDTf4nIyGfPOF+aDCHda+FpY/ZdYL+j8QdMDNKz4gZp4fGCp8+9a76cc1QTfOheqSIXhmb2UBTbNghvykYMdYocXeS2GIei74W4eMG8RYv9WkxRBZ9Xlmt40Y+aLQhSSnNrAKaYzq8jtdsyDbndqHQ06TxKqzrukYF7ilSxlkMfVph36y8IloEetNOmC9fEHvyqz6wA1v12VNvL56p6R+bZjtcHrW4q1rprTDlLS1W70/L2VN0OSvjYONPd5V8YmnqlcuPyUNXSwrDZi2/lxaVXhEXqYD/V34KW08t3vn3haid9bpr9G9MOi2BrZCaQfTM0rC/Sb2wE5EqXB0XYfoXuQ87/PrZSiNpFY2bD0875vUGjbegndRXqZtBH8+ViwMdGTyrySkoToo9MJc7pW853pZu9GI16gPfjIaWz0yRqjVIwS0OWSybDK7b02O6AO/93NJnu+XM6K1hfp1427NMs=; 5:xtguV5rrzxaI04S9ekHEO2MwlUkWHJ7EW+TzHCKLcPKGcJ7oxGtyRgGLN/Bronkss12McXVRp5aLrTAwxz1/un+Bza6NLBs9wWF2Sv29NjDHrY3B8X1Kb0n12EiBsdnKMVdKzwMmBVDtIVLQJPa8Dw==; 24:rO15WKywSmJz59D0+p+1lWrcg70YOfuCbqh6dThBwAWz1roJr6v52WvxjfeNLVlrepqNeGar0NaiQoWF8EVN2cUf84EpZIubUo+OJCgjFtQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 7:U24noA6lXA7whDuxkcWMojMmOtKpVmOMQbQWe1VyeUIRS3NjqzuFG3UA/yZq4up4lpols8/yT0BkckgUbL6eoqTGZSQGwwit1cQTenaxYJ+KUZId7iAivjkMhASdwvawcV85bowEcCuAMrduYJzhx8Nnj81xrpK01LE9NO1p2It0bz1arkdoazeVDBYm99KTKUzGaXAi2BfKDA5FHP5N3Gg/kiINTBHH0GpsPEP3jDuJGj+A8ltWzlSo2ehHRcnlyy7VySw4JDFw4DBPWAADkLtVh5N80VWdqxFRrMjiZTP5SlMs6ZlL4gsss1oaGlZcM4B0fKbXtzNYpTdqAD5MUQ==; 20:NN+C2HxWfDTGtPzs/r2WTiDdea3MuMSxVTMTsNOsVH8gTlOlI8+aFCKYDdEHSUHbs8mvhbR+7W3/naWnNeb0fERlcR0DkuIdButYMwbMPPj+BV4KrJlJ64A66cMQALGCLLVlMjKjGvVwr76Hp6czjmxAmyME+cXqTAGsXG2EreGSNO5sWqjVsl+QEDQG2mnGuMgywyUqQl+Phtr55xJ268ZqIRIHf3uniFYPnIgdVxiYuC+VClBYqdRMxwG+bW9h X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2017 14:44:26.8192 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0158 Subject: [edk2] [PATCH v6 01/17] UefiCpuPkg: Define AMD Memory Encryption specific CPUID and MSR X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas.Lendacky@amd.com, Jordan Justen , Liming Gao , leo.duran@amd.com, Laszlo Ersek , Jeff Fan 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" The patch defines AMD's Memory Encryption Information CPUID leaf and SEV status MSR. The complete description for CPUID leaf is available in APM volume 2, Section 15.34. Cc: Jordan Justen Cc: Laszlo Ersek Cc: Jeff Fan Cc: Liming Gao Cc: Leo Duran Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brijesh Singh Reviewed-by: Jeff Fan --- UefiCpuPkg/Include/Register/Amd/Cpuid.h | 162 ++++++++++++++++++++ UefiCpuPkg/Include/Register/Amd/Fam17Msr.h | 62 ++++++++ UefiCpuPkg/Include/Register/Amd/Msr.h | 29 ++++ 3 files changed, 253 insertions(+) diff --git a/UefiCpuPkg/Include/Register/Amd/Cpuid.h b/UefiCpuPkg/Include/R= egister/Amd/Cpuid.h new file mode 100644 index 000000000000..5cd42667dc46 --- /dev/null +++ b/UefiCpuPkg/Include/Register/Amd/Cpuid.h @@ -0,0 +1,162 @@ +/** @file + CPUID leaf definitions. + + Provides defines for CPUID leaf indexes. Data structures are provided f= or + registers returned by a CPUID leaf that contain one or more bit fields. + If a register returned is a single 32-bit value, then a data structure is + not provided for that register. + + Copyright (c) 2017, Advanced Micro Devices. All rights reserved.
+ This program and the accompanying materials are licensed and made availa= ble + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + + @par Specification Reference: + AMD64 Architecture Programming Manaul volume 2, March 2017, Sections 15.= 34 + +**/ + +#ifndef __AMD_CPUID_H__ +#define __AMD_CPUID_H__ + +/** + + Memory Encryption Information + + @param EAX CPUID_MEMORY_ENCRYPTION_INFO (0x8000001F) + + @retval EAX Returns the memory encryption feature support status. + @retval EBX If memory encryption feature is present then return + the page table bit number used to enable memory encryption= support + and reducing of physical address space in bits. + @retval ECX Returns number of encrypted guest supported simultaneosuly. + @retval EDX Returns minimum SEV enabled and SEV disbled ASID.. + + Example usage + @code + UINT32 Eax; + UINT32 Ebx; + UINT32 Ecx; + UINT32 Edx; + + AsmCpuid (CPUID_MEMORY_ENCRYPTION_INFO, &Eax, &Ebx, &Ecx, &Edx); + @endcode +**/ + +#define CPUID_MEMORY_ENCRYPTION_INFO 0x8000001F + +/** + CPUID Memory Encryption support information EAX for CPUID leaf + #CPUID_MEMORY_ENCRYPTION_INFO. +**/ +typedef union { + /// + /// Individual bit fields + /// + struct { + /// + /// [Bit 0] Secure Memory Encryption (Sme) Support + /// + UINT32 SmeBit:1; + + /// + /// [Bit 1] Secure Encrypted Virtualization (Sev) Support + /// + UINT32 SevBit:1; + + /// + /// [Bit 2] Page flush MSR support + /// + UINT32 PageFlushMsrBit:1; + + /// + /// [Bit 3] Encrypted state support + /// + UINT32 SevEsBit:1; + + /// + /// [Bit 4:31] Reserved + /// + UINT32 ReservedBits:28; + } Bits; + /// + /// All bit fields as a 32-bit value + /// + UINT32 Uint32; +} CPUID_MEMORY_ENCRYPTION_INFO_EAX; + +/** + CPUID Memory Encryption support information EBX for CPUID leaf + #CPUID_MEMORY_ENCRYPTION_INFO. +**/ +typedef union { + /// + /// Individual bit fields + /// + struct { + /// + /// [Bit 0:5] Page table bit number used to enable memory encryption + /// + UINT32 PtePosBits:6; + + /// + /// [Bit 6:11] Reduction of system physical address space bits when me= mory encryption is enabled + /// + UINT32 ReducedPhysBits:5; + + /// + /// [Bit 12:31] Reserved + /// + UINT32 ReservedBits:21; + } Bits; + /// + /// All bit fields as a 32-bit value + /// + UINT32 Uint32; +} CPUID_MEMORY_ENCRYPTION_INFO_EBX; + +/** + CPUID Memory Encryption support information ECX for CPUID leaf + #CPUID_MEMORY_ENCRYPTION_INFO. +**/ +typedef union { + /// + /// Individual bit fields + /// + struct { + /// + /// [Bit 0:31] Number of encrypted guest supported simultaneously + /// + UINT32 NumGuests; + } Bits; + /// + /// All bit fields as a 32-bit value + /// + UINT32 Uint32; +} CPUID_MEMORY_ENCRYPTION_INFO_ECX; + +/** + CPUID Memory Encryption support information EDX for CPUID leaf + #CPUID_MEMORY_ENCRYPTION_INFO. +**/ +typedef union { + /// + /// Individual bit fields + /// + struct { + /// + /// [Bit 0:31] Minimum SEV enabled, SEV-ES disabled ASID + /// + UINT32 MinAsid; + } Bits; + /// + /// All bit fields as a 32-bit value + /// + UINT32 Uint32; +} CPUID_MEMORY_ENCRYPTION_INFO_EDX; + +#endif diff --git a/UefiCpuPkg/Include/Register/Amd/Fam17Msr.h b/UefiCpuPkg/Includ= e/Register/Amd/Fam17Msr.h new file mode 100644 index 000000000000..2c5d9738fae8 --- /dev/null +++ b/UefiCpuPkg/Include/Register/Amd/Fam17Msr.h @@ -0,0 +1,62 @@ +/** @file + MSR Definitions. + + Provides defines for Machine Specific Registers(MSR) indexes. Data struc= tures + are provided for MSRs that contain one or more bit fields. If the MSR v= alue + returned is a single 32-bit or 64-bit value, then a data structure is not + provided for that MSR. + + Copyright (c) 2017, Advanced Micro Devices. All rights reserved.
+ This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + + @par Specification Reference: + AMD64 Architecture Programming Manaul volume 2, March 2017, Sections 15.= 34 + +**/ + +#ifndef __FAM17_MSR_H +#define __FAM17_MSR_H + +/** + Secure Encrypted Virtualization (SEV) status register + +**/ +#define MSR_SEV_STATUS 0xc0010131 + +/** + MSR information returned for #MSR_SEV_STATUS +**/ +typedef union { + /// + /// Individual bit fields + /// + struct { + /// + /// [Bit 0] Secure Encrypted Virtualization (Sev) is enabled + /// + UINT32 SevBit:1; + + /// + /// [Bit 1] Secure Encrypted Virtualization Encrypted State (SevEs) is= enabled + /// + UINT32 SevEsBit:1; + + UINT32 Reserved:30; + } Bits; + /// + /// All bit fields as a 32-bit value + /// + UINT32 Uint32; + /// + /// All bit fields as a 64-bit value + /// + UINT64 Uint64; +} MSR_SEV_STATUS_REGISTER; + +#endif diff --git a/UefiCpuPkg/Include/Register/Amd/Msr.h b/UefiCpuPkg/Include/Reg= ister/Amd/Msr.h new file mode 100644 index 000000000000..bde830feb0c5 --- /dev/null +++ b/UefiCpuPkg/Include/Register/Amd/Msr.h @@ -0,0 +1,29 @@ +/** @file + MSR Definitions. + + Provides defines for Machine Specific Registers(MSR) indexes. Data struc= tures + are provided for MSRs that contain one or more bit fields. If the MSR v= alue + returned is a single 32-bit or 64-bit value, then a data structure is not + provided for that MSR. + + Copyright (c) 2017, Advanced Micro Devices. All rights reserved.
+ This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + + @par Specification Reference: + AMD64 Architecture Programming Manaul volume 2, March 2017, Sections 15.= 34 + +**/ + +#ifndef __AMD_MSR_H__ +#define __AMD_MSR_H__ + +#include +#include + +#endif --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel