bt eax, 0\r
jnc NoSev\r
\r
+ ; Set the work area header to indicate that the SEV is enabled\r
+ mov byte[WORK_AREA_GUEST_TYPE], 1\r
+\r
; Check for SEV-ES memory encryption feature:\r
; CPUID Fn8000_001F[EAX] - Bit 3\r
; CPUID raises a #VC exception if running as an SEV-ES guest\r
IsSevEsEnabled:\r
xor eax, eax\r
\r
+ ; During CheckSevFeatures, the WORK_AREA_GUEST_TYPE is set\r
+ ; to 1 if SEV is enabled.\r
+ cmp byte[WORK_AREA_GUEST_TYPE], 1\r
+ jne SevEsDisabled\r
+\r
; During CheckSevFeatures, the SEV_ES_WORK_AREA was set to 1 if\r
; SEV-ES is enabled.\r
cmp byte[SEV_ES_WORK_AREA], 1\r