linux/arch/x86/hyperv
Dexuan Cui b9b4fe3a72 x86/hyperv: Use TDX GHCI to access some MSRs in a TDX VM with the paravisor
When the paravisor is present, a SNP VM must use GHCB to access some
special MSRs, including HV_X64_MSR_GUEST_OS_ID and some SynIC MSRs.

Similarly, when the paravisor is present, a TDX VM must use TDX GHCI
to access the same MSRs.

Implement hv_tdx_msr_write() and hv_tdx_msr_read(), and use the helper
functions hv_ivm_msr_read() and hv_ivm_msr_write() to access the MSRs
in a unified way for SNP/TDX VMs with the paravisor.

Do not export hv_tdx_msr_write() and hv_tdx_msr_read(), because we never
really used hv_ghcb_msr_write() and hv_ghcb_msr_read() in any module.

Update arch/x86/include/asm/mshyperv.h so that the kernel can still build
if CONFIG_AMD_MEM_ENCRYPT or CONFIG_INTEL_TDX_GUEST is not set, or
neither is set.

Signed-off-by: Dexuan Cui <decui@microsoft.com>
Reviewed-by: Tianyu Lan <tiala@microsoft.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Link: https://lore.kernel.org/r/20230824080712.30327-9-decui@microsoft.com
2023-08-25 00:04:57 +00:00
..
hv_apic.c Drivers: hv: vmbus: Support fully enlightened TDX guests 2023-08-25 00:04:56 +00:00
hv_init.c x86/hyperv: Use TDX GHCI to access some MSRs in a TDX VM with the paravisor 2023-08-25 00:04:57 +00:00
hv_proc.c drivers: hv: Create a consistent pattern for checking Hyper-V hypercall status 2021-04-21 09:49:19 +00:00
hv_spinlock.c x86/hyperv: Fix unused variable 'msr_val' warning in hv_qlock_wait 2021-03-24 11:31:04 +00:00
hv_vtl.c x86/hyperv/vtl: Add noop for realmode pointers 2023-05-08 16:46:43 +00:00
irqdomain.c genirq: Return a const cpumask from irq_data_get_affinity_mask 2022-07-07 09:38:04 +01:00
ivm.c x86/hyperv: Use TDX GHCI to access some MSRs in a TDX VM with the paravisor 2023-08-25 00:04:57 +00:00
Makefile x86/hyperv: VTL support for Hyper-V 2023-04-18 17:29:52 +00:00
mmu.c x86/hyperv: Exclude lazy TLB mode CPUs from enlightened TLB flushes 2023-04-17 19:19:05 +00:00
nested.c drivers: hv: Create a consistent pattern for checking Hyper-V hypercall status 2021-04-21 09:49:19 +00:00