]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/ResetVector/Ia32/AmdSev.asm
OvmfPkg/ResetVector: update SEV support to use new work area format
[mirror_edk2.git] / OvmfPkg / ResetVector / Ia32 / AmdSev.asm
index aa95d06eaddb909207e50ebc755d22b62b0a166c..87d81b01e263806ea9bf5e679a3e9dc6b9e9442f 100644 (file)
@@ -171,6 +171,9 @@ CheckSevFeatures:
     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
@@ -257,6 +260,11 @@ SevExit:
 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