summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/cpu/common.c
diff options
context:
space:
mode:
authorBrijesh Singh <brijesh.singh@amd.com>2022-02-09 12:10:11 -0600
committerBorislav Petkov <bp@suse.de>2022-04-06 13:16:58 +0200
commit95d33bfaa3e169cfec1926e0d0f0c6b0ea75d763 (patch)
tree42be2b1c8f9cb14f8a690f5be725dbc0511a6fc3 /arch/x86/kernel/cpu/common.c
parent87294bdb7b4b73555b0fba45da1cdecdc6a0d5a8 (diff)
downloadlinux-95d33bfaa3e169cfec1926e0d0f0c6b0ea75d763.tar.gz
linux-95d33bfaa3e169cfec1926e0d0f0c6b0ea75d763.tar.bz2
linux-95d33bfaa3e169cfec1926e0d0f0c6b0ea75d763.zip
x86/sev: Register GHCB memory when SEV-SNP is active
The SEV-SNP guest is required by the GHCB spec to register the GHCB's Guest Physical Address (GPA). This is because the hypervisor may prefer that a guest uses a consistent and/or specific GPA for the GHCB associated with a vCPU. For more information, see the GHCB specification section "GHCB GPA Registration". [ bp: Cleanup comments. ] Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lore.kernel.org/r/20220307213356.2797205-18-brijesh.singh@amd.com
Diffstat (limited to 'arch/x86/kernel/cpu/common.c')
-rw-r--r--arch/x86/kernel/cpu/common.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index ed4417500700..9e4552133872 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -60,6 +60,7 @@
#include <asm/uv/uv.h>
#include <asm/sigframe.h>
#include <asm/traps.h>
+#include <asm/sev.h>
#include "cpu.h"
@@ -2124,6 +2125,9 @@ void cpu_init_exception_handling(void)
load_TR_desc();
+ /* GHCB needs to be setup to handle #VC. */
+ setup_ghcb();
+
/* Finally load the IDT */
load_current_idt();
}