aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/kernel/sev.c
diff options
context:
space:
mode:
authorGravatar Peter Gonda <pgonda@google.com> 2022-03-17 14:19:13 -0700
committerGravatar Borislav Petkov <bp@suse.de> 2022-04-08 10:57:35 +0200
commite720ea52e85c9d00cf8c5769795d0a3e585524f6 (patch)
tree058f0981e21d77e80f28c6d4d4c927036a01b309 /arch/x86/kernel/sev.c
parentvirt: sevguest: Add documentation for SEV-SNP CPUID Enforcement (diff)
downloadlinux-e720ea52e85c9d00cf8c5769795d0a3e585524f6.tar.gz
linux-e720ea52e85c9d00cf8c5769795d0a3e585524f6.tar.bz2
linux-e720ea52e85c9d00cf8c5769795d0a3e585524f6.zip
x86/sev-es: Replace open-coded hlt-loop with sev_es_terminate()
Replace the halt loop in handle_vc_boot_ghcb() with an sev_es_terminate(). The HLT gives the system no indication the guest is unhappy. The termination request will signal there was an error during VC handling during boot. [ bp: Update it to pass the reason set too. ] Signed-off-by: Peter Gonda <pgonda@google.com> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Joerg Roedel <jroedel@suse.de> Link: https://lore.kernel.org/r/20220317211913.1397427-1-pgonda@google.com
Diffstat (limited to 'arch/x86/kernel/sev.c')
-rw-r--r--arch/x86/kernel/sev.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/kernel/sev.c b/arch/x86/kernel/sev.c
index ace43e116b40..f01f4550e2c6 100644
--- a/arch/x86/kernel/sev.c
+++ b/arch/x86/kernel/sev.c
@@ -1982,8 +1982,7 @@ bool __init handle_vc_boot_ghcb(struct pt_regs *regs)
fail:
show_regs(regs);
- while (true)
- halt();
+ sev_es_terminate(SEV_TERM_SET_GEN, GHCB_SEV_ES_GEN_REQ);
}
/*