From 26210f9436d82174fa03d1c43b58a63c2fa2c176 Mon Sep 17 00:00:00 2001 From: "Brijesh Singh via groups.io" Date: Thu, 9 Dec 2021 11:27:48 +0800 Subject: MdePkg: Define ConfidentialComputingGuestAttr BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3275 While initializing APs, the MpInitLib may need to know whether the guest is running with active AMD SEV or Intel TDX memory encryption. Add a new ConfidentialComputingGuestAttr PCD that can be used to query the memory encryption attribute. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Michael Roth Cc: Ray Ni Cc: Rahul Kumar Cc: Eric Dong Cc: James Bottomley Cc: Min Xu Cc: Jiewen Yao Cc: Tom Lendacky Cc: Jordan Justen Cc: Ard Biesheuvel Cc: Erdem Aktas Cc: Gerd Hoffmann Acked-by: Ray Ni Suggested-by: Jiewen Yao Acked-by: Gerd Hoffmann Signed-off-by: Brijesh Singh --- MdePkg/Include/ConfidentialComputingGuestAttr.h | 25 +++++++++++++++++++++++++ MdePkg/MdePkg.dec | 4 ++++ 2 files changed, 29 insertions(+) create mode 100644 MdePkg/Include/ConfidentialComputingGuestAttr.h (limited to 'MdePkg') diff --git a/MdePkg/Include/ConfidentialComputingGuestAttr.h b/MdePkg/Include/ConfidentialComputingGuestAttr.h new file mode 100644 index 0000000..6a13018 --- /dev/null +++ b/MdePkg/Include/ConfidentialComputingGuestAttr.h @@ -0,0 +1,25 @@ +/** @file +Definitions for Confidential Computing Attribute + +Copyright (c) 2021 AMD Inc. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef CONFIDENTIAL_COMPUTING_GUEST_ATTR_H_ +#define CONFIDENTIAL_COMPUTING_GUEST_ATTR_H_ + +typedef enum { + /* The guest is running with memory encryption disabled. */ + CCAttrNotEncrypted = 0, + + /* The guest is running with AMD SEV memory encryption enabled. */ + CCAttrAmdSev = 0x100, + CCAttrAmdSevEs = 0x101, + CCAttrAmdSevSnp = 0x102, + + /* The guest is running with Intel TDX memory encryption enabled. */ + CCAttrIntelTdx = 0x200, +} CONFIDENTIAL_COMPUTING_GUEST_ATTR; + +#endif diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 8b18415..cd903c3 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -2396,5 +2396,9 @@ # @Prompt FSB Clock. gEfiMdePkgTokenSpaceGuid.PcdFSBClock|200000000|UINT32|0x0000000c + ## This dynamic PCD indicates the memory encryption attribute of the guest. + # @Prompt Memory encryption attribute + gEfiMdePkgTokenSpaceGuid.PcdConfidentialComputingGuestAttr|0|UINT64|0x0000002e + [UserExtensions.TianoCore."ExtraFiles"] MdePkgExtra.uni -- cgit v1.1