]> git.baikalelectronics.ru Git - kernel.git/commit
x86/Hyper-V: Add SEV negotiate protocol support in Isolation VM
authorTianyu Lan <Tianyu.Lan@microsoft.com>
Tue, 14 Jun 2022 01:45:53 +0000 (21:45 -0400)
committerWei Liu <wei.liu@kernel.org>
Wed, 15 Jun 2022 18:27:40 +0000 (18:27 +0000)
commit2e2da1bc8378dc44b5452a0d719bd6b1ca528cc9
tree7ba8b165b8df0303ab511ccd2ba08be5047853e1
parente2c9e0c4aa20a89d5bd331bdb4049562705efbb7
x86/Hyper-V: Add SEV negotiate protocol support in Isolation VM

Hyper-V Isolation VM current code uses sev_es_ghcb_hv_call()
to read/write MSR via GHCB page and depends on the sev code.
This may cause regression when sev code changes interface
design.

The latest SEV-ES code requires to negotiate GHCB version before
reading/writing MSR via GHCB page and sev_es_ghcb_hv_call() doesn't
work for Hyper-V Isolation VM. Add Hyper-V ghcb related implementation
to decouple SEV and Hyper-V code. Negotiate GHCB version in the
hyperv_init() and use the version to communicate with Hyper-V
in the ghcb hv call function.

Fixes: 8b389c85889c ("x86/sev: Save the negotiated GHCB version")
Signed-off-by: Tianyu Lan <Tianyu.Lan@microsoft.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/20220614014553.1915929-1-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