x86/hyperv: Add Write/Read MSR registers via ghcb page
authorTianyu Lan <Tianyu.Lan@microsoft.com>
Mon, 25 Oct 2021 12:21:11 +0000 (08:21 -0400)
committerWei Liu <wei.liu@kernel.org>
Thu, 28 Oct 2021 11:22:38 +0000 (11:22 +0000)
commitfaff44069ff538ccdfef187c4d7ec83d22dfb3a4
tree4415d6bf06a55ca93a98e47041c00ac154ead109
parentd4dccf353db80e209f262e3973c834e6e48ba9a9
x86/hyperv: Add Write/Read MSR registers via ghcb page

Hyperv provides GHCB protocol to write Synthetic Interrupt
Controller MSR registers in Isolation VM with AMD SEV SNP
and these registers are emulated by hypervisor directly.
Hyperv requires to write SINTx MSR registers twice. First
writes MSR via GHCB page to communicate with hypervisor
and then writes wrmsr instruction to talk with paravisor
which runs in VMPL0. Guest OS ID MSR also needs to be set
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-7-ltykernel@gmail.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
arch/x86/hyperv/hv_init.c
arch/x86/hyperv/ivm.c
arch/x86/include/asm/mshyperv.h
drivers/hv/hv.c
drivers/hv/hv_common.c
include/asm-generic/mshyperv.h