/* * AMD SEV support in kvm-unit-tests * * Copyright (c) 2021, Google Inc * * Authors: * Zixuan Wang * * SPDX-License-Identifier: LGPL-2.0-or-later */ #ifndef _X86_AMD_SEV_H_ #define _X86_AMD_SEV_H_ #ifdef TARGET_EFI #include "libcflat.h" #include "desc.h" #include "asm/page.h" #include "efi.h" /* * AMD Programmer's Manual Volume 3 * - Section "Function 8000_0000h - Maximum Extended Function Number and Vendor String" * - Section "Function 8000_001Fh - Encrypted Memory Capabilities" */ #define CPUID_FN_LARGEST_EXT_FUNC_NUM 0x80000000 #define CPUID_FN_ENCRYPT_MEM_CAPAB 0x8000001f #define SEV_SUPPORT_MASK 0b10 /* * AMD Programmer's Manual Volume 2 * - Section "SEV_STATUS MSR" */ #define MSR_SEV_STATUS 0xc0010131 #define SEV_ENABLED_MASK 0b1 bool amd_sev_enabled(void); efi_status_t setup_amd_sev(void); unsigned long long get_amd_sev_c_bit_mask(void); #endif /* TARGET_EFI */ #endif /* _X86_AMD_SEV_H_ */