diff options
author | Tianyu Lan <Tianyu.Lan@microsoft.com> | 2021-10-25 14:21:06 +0200 |
---|---|---|
committer | Wei Liu <wei.liu@kernel.org> | 2021-10-28 12:47:52 +0200 |
commit | 0cc4f6d9f0b9f20f3f1e1149bdb6737c0b4e134a (patch) | |
tree | 6b38683b18f98bd2a5950149d5d2d29793833cdb /arch/x86/kernel/cpu/mshyperv.c | |
parent | Merge remote-tracking branch 'tip/x86/cc' into hyperv-next (diff) | |
download | linux-0cc4f6d9f0b9f20f3f1e1149bdb6737c0b4e134a.tar.xz linux-0cc4f6d9f0b9f20f3f1e1149bdb6737c0b4e134a.zip |
x86/hyperv: Initialize GHCB page in Isolation VM
Hyperv exposes GHCB page via SEV ES GHCB MSR for SNP guest
to communicate with hypervisor. Map GHCB page for all
cpus to read/write MSR register and submit hvcall request
via ghcb page.
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Tianyu Lan <Tianyu.Lan@microsoft.com>
Link: https://lore.kernel.org/r/20211025122116.264793-2-ltykernel@gmail.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Diffstat (limited to 'arch/x86/kernel/cpu/mshyperv.c')
-rw-r--r-- | arch/x86/kernel/cpu/mshyperv.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index e095c28d27ae..b09ade389040 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c @@ -316,6 +316,9 @@ static void __init ms_hyperv_init_platform(void) pr_info("Hyper-V: Isolation Config: Group A 0x%x, Group B 0x%x\n", ms_hyperv.isolation_config_a, ms_hyperv.isolation_config_b); + + if (hv_get_isolation_type() == HV_ISOLATION_TYPE_SNP) + static_branch_enable(&isolation_type_snp); } if (hv_max_functions_eax >= HYPERV_CPUID_NESTED_FEATURES) { |