From nobody Sat Nov 2 10:21:21 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 1494454187323911.4422597007227; Wed, 10 May 2017 15:09:47 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id D856921A0BA9D; Wed, 10 May 2017 15:09:45 -0700 (PDT) Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on061e.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe49::61e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5E56E21A0BA9A for ; Wed, 10 May 2017 15:09:42 -0700 (PDT) Received: from brijesh-build-machine.amd.com (165.204.77.1) by CY1PR12MB0149.namprd12.prod.outlook.com (10.161.173.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.11; Wed, 10 May 2017 22:09:40 +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=uZPVBLzHvoPeR+GUq0FamZVwnfihS2y55puijWP7ZwE=; b=X7zYL+QP/RuLwqYPqLE9HLH7Yo4SrCvAmx8H/fRdqnjdTGzuhKYo8EZ6H99oJc0HgePkZFKE1NOUecehP6dAk06dqgtFm46auN1/DnA+NxovHWuCY/Fx8sRsofFoFu/7tK2DC3cDaB6ePTHwiTydFPNO1b36Z38KaEHhW+j4vsA= 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: Wed, 10 May 2017 18:09:10 -0400 Message-ID: <1494454162-9940-2-git-send-email-brijesh.singh@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1494454162-9940-1-git-send-email-brijesh.singh@amd.com> References: <1494454162-9940-1-git-send-email-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: MWHPR21CA0051.namprd21.prod.outlook.com (10.172.93.141) To CY1PR12MB0149.namprd12.prod.outlook.com (10.161.173.19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c3b81af9-9150-497e-9835-08d497f141f3 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:CY1PR12MB0149; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0149; 3:nsrkU5G5+zcWIOJssN7xiW0GvDmdDBfn33Cc94iDrluPaZZ6XO1Dpv17mQ40194FEvbfZjLc5DTBWq+W/5d1dRP/y6Zp/kfXOVkpYrt30xhuzoL9OJJAN7LtdDunzpnEQ1v6J0iIXIMzZrUpVyzu0grEZZ4FsorqlrqM2NhYlYxBF4oQ5MMh4gecbeodsZHceaqMNynRpnMvM1ox9s5rQEoayVvEFiIdFec/pe9JjoiV8xFmNwzLZhx1zMRkxLM91LgS2lm6WERRENQIQRd/qvjTVUwS5VxgHUy4cauzYiwEfqJ/pQKAZKsXRIhk9PqJmWONTcrueLGtSnU3trFF4CSeSDzb25Cr7BFHaQ+qX3A=; 25:7IDjVDqxKZVWmrF2I0UAORrIFvyswdBtOryI7xJ1kimZyD5AVsY+m7goFg/+sBebLL0cpqJjuRbfBR02z3O7Nt336wRWvo2V4WisH6JuTTcq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NBzI6fZcJ+J6kjZCuWR7qluneH7sMg2sWHB9uG++0tcjD5nkBMRL9iZlKVMWapmPTMoVnirhNAf7TXQPRuO2qRh59z4lK 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)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123558100)(20161123560025)(20161123555025)(20161123564025)(6072148); SRVR:CY1PR12MB0149; BCL:0; PCL:0; RULEID:; SRVR:CY1PR12MB0149; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0149; 4:vBWukVeO9HVe/jBmmmVurJq996NEVGIVVjVlJBMfpDrsQ+q5UPrsg5FI9k2s94LSwsb1S21CLiuNFpx7fhK9BJBijmOfjuVh1FQrSLEjYYXVZAl55g0gWN4ZS8n5STr8IxAsTzdR0bRP7DYduufZBPxJoVhUmZwRnXs0/dKUDSfuJ9N2vlg8+3NogAgjfCBCVtQ+hAMZrEYFXxZe5invv0pxzZlSVuJaXioSXl7X8QdXNpuFLG2OyqTkOZ24ECMJHVZha5dFEUm4ZqBt8rEY9gYYlevHxMEAqAzVN6hwd2frg4w82QnVe4bIW7hy3Lk8N5hfYuBBEtY2192yLkYxTX4p3LeSnqdiX38ELEHKGGAbL+TKiJcGd26rJt8qzyqdriQtrjQEwI7CsJUYSEhxgFsBCs63KsXoG7YAFif7n0lUTgq2dhy/cTkwlcquNe0UroBW5sto6m8om1RZuAEVa74TLaIISxS7AKbVyRW8bMXA2ISbI61lwR9YNM5J5mArtioQMofctzYrAE1Dl5QIOBYnqI0Jbbn7TOcBTWTIHz25lX682VDvf5SpTQfUQN0RM3LNaw+bbV/6Sr9mBO5Xsm6pkyAIrtS1bOWps/DymHcbMFW3lunwZFvVIB7I4/3ZYVYiWXlPS8tvAJ5m8uftp78KzZumMlZqdJMNwfV1fNthp8m1whtL/8p4ve0VkH5fP+j6FjUni3WdiJKuCP5EocAnw8RRHp8/WV0L2JKOz6MC6GKd/HXO0WoQi0w61KHNhohSoSRYzahWJFxqoZWpKnI9fPH7XvNZeveCLF6D+f9jyZBiyPxxET8L22z0P2+s44IKra6yOdxz9SUzmKnllhYjQSP3wG91h7Bvr1cpm8vS+VV5OQO3FMmDPWlfg1xd X-Forefront-PRVS: 03030B9493 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39840400002)(39400400002)(39410400002)(39850400002)(50986999)(2950100002)(6666003)(6916009)(6486002)(76176999)(50466002)(33646002)(478600001)(86362001)(189998001)(48376002)(110136004)(8676002)(4326008)(2906002)(6306002)(54906002)(38730400002)(53376002)(53936002)(966004)(3846002)(6116002)(50226002)(25786009)(81166006)(575784001)(5003940100001)(5660300001)(53416004)(36756003)(42186005)(66066001)(7736002)(15188155005)(305945005)(2351001)(16799955002)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0149; H:brijesh-build-machine.amd.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR12MB0149; 23:xb8h3oEIb6WWlDc07pb24XbnxBpu6N+G7lv3osyZH?= =?us-ascii?Q?jcH3JrHPoIftcFQc9k3TvlzHM1R81I0ID9N6RklaNS5LHTWrybdRT7kaQW0n?= =?us-ascii?Q?a/nGKZXKXCZ0h4NrQUieSWdMJp7nOYD04EmJe7aI9DpvpHXyRSlto5DyzAWr?= =?us-ascii?Q?0GFANn8uwNzLOIkanEllcCaokEMYcH0gDB+rh4L9flvX1uT+5QtnKEqrbusX?= =?us-ascii?Q?1scE41eTDgSPVs6q5c7tujs/5icF+/dA+JZYBKiLjRR3IMOyIzNBqBtQIxfS?= =?us-ascii?Q?SjKQ5DDpouKjAJf7cnqjrD19mSpv8fYEXIC/Hl+Cyg1ckg4UrSFcinoJGfye?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PY3AB2mu4bdqrEg2bX9rWZMPCvBgLhnCQS18o5rIhQgkJsj9jlgqgeMXPBow9Wxqpb93kr0DcXMTDzEpSbMcHHJxJm2XFPpwLPrRk6f1ptcNJ7Ed+LJ4r3lZQdRQNmOc9/rUlSe0wLWOZLqGw4mKCEyRiCGDBKQ==; 20:w8xH3qs2Vazm9y/+9VAsU8f571OCVASNPZtRPRvQn8G4+FZxFQ8HkzAc+hU2hNWnWep0FGCelxl1F3UriUD62tID0XdmbjhyZ9/VGrcVWHqhJ3fQU5howMS86An2GQ2Dc4tqUUqTq+8R3aEutScCjFtokTK3Rq3INsoGHc8HxVVDbTt7SyMbyE0EzvgaLbc5j0eL8SOaCTZI3iVPrufzBZknGQ6boo2MbV+fZQAOv3yNIEk6zeYLRKdOiDeabaDa X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2017 22:09:40.7242 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0149 Subject: [edk2] [RFC v4 01/13] 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