summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/sev-es.h
diff options
context:
space:
mode:
authorTom Lendacky <thomas.lendacky@amd.com>2020-09-07 15:16:07 +0200
committerBorislav Petkov <bp@suse.de>2020-09-09 11:33:20 +0200
commit8940ac9ced8bc1c48c4e28b0784e3234c9d14469 (patch)
treee6885314b81546eaa88a03ca890a09a986175b92 /arch/x86/include/asm/sev-es.h
parentx86/realmode: Add SEV-ES specific trampoline entry point (diff)
downloadlinux-8940ac9ced8bc1c48c4e28b0784e3234c9d14469.tar.xz
linux-8940ac9ced8bc1c48c4e28b0784e3234c9d14469.zip
x86/realmode: Setup AP jump table
As part of the GHCB specification, the booting of APs under SEV-ES requires an AP jump table when transitioning from one layer of code to another (e.g. when going from UEFI to the OS). As a result, each layer that parks an AP must provide the physical address of an AP jump table to the next layer via the hypervisor. Upon booting of the kernel, read the AP jump table address from the hypervisor. Under SEV-ES, APs are started using the INIT-SIPI-SIPI sequence. Before issuing the first SIPI request for an AP, the start CS and IP is programmed into the AP jump table. Upon issuing the SIPI request, the AP will awaken and jump to that start CS:IP address. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> [ jroedel@suse.de: - Adapted to different code base - Moved AP table setup from SIPI sending path to real-mode setup code - Fix sparse warnings ] Co-developed-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/20200907131613.12703-67-joro@8bytes.org
Diffstat (limited to 'arch/x86/include/asm/sev-es.h')
-rw-r--r--arch/x86/include/asm/sev-es.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/include/asm/sev-es.h b/arch/x86/include/asm/sev-es.h
index 59176e8c6b81..db88e1c3442d 100644
--- a/arch/x86/include/asm/sev-es.h
+++ b/arch/x86/include/asm/sev-es.h
@@ -73,6 +73,9 @@ static inline u64 lower_bits(u64 val, unsigned int bits)
return (val & mask);
}
+struct real_mode_header;
+enum stack_type;
+
/* Early IDT entry points for #VC handler */
extern void vc_no_ghcb(void);
extern void vc_boot_ghcb(void);
@@ -92,9 +95,11 @@ static __always_inline void sev_es_ist_exit(void)
if (static_branch_unlikely(&sev_es_enable_key))
__sev_es_ist_exit();
}
+extern int sev_es_setup_ap_jump_table(struct real_mode_header *rmh);
#else
static inline void sev_es_ist_enter(struct pt_regs *regs) { }
static inline void sev_es_ist_exit(void) { }
+static inline int sev_es_setup_ap_jump_table(struct real_mode_header *rmh) { return 0; }
#endif
#endif