RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 Add macros CC_GUEST_IS_SEV / CC_GUEST_IS_TDX to check SEV / TDX guest. Cc: Michael Roth <michael.roth@amd.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Min Xu <min.m.xu@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Erdem Aktas <erdemaktas@google.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Min Xu <min.m.xu@intel.com>
		
			
				
	
	
		
			29 lines
		
	
	
		
			834 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			834 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /** @file
 | |
| Definitions for Confidential Computing Attribute
 | |
| 
 | |
| Copyright (c) 2021 AMD Inc. All rights reserved.<BR>
 | |
| 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;
 | |
| 
 | |
| #define CC_GUEST_IS_TDX(x)  ((x) == CCAttrIntelTdx)
 | |
| #define CC_GUEST_IS_SEV(x)  ((x) == CCAttrAmdSev || (x) == CCAttrAmdSevEs || (x) == CCAttrAmdSevSnp)
 | |
| 
 | |
| #endif
 |