]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: SVM: Add required changes to support intercepts under SEV-ES
authorTom Lendacky <thomas.lendacky@amd.com>
Mon, 14 Dec 2020 15:29:50 +0000 (10:29 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 15 Dec 2020 10:20:45 +0000 (05:20 -0500)
commit1eef9a70a655d0652e6c83dcab986569b1431b6f
treeeda322c44c3f1a8488c1f7110b231743eaab2864
parent829bd88ca01ecd41eab812c84d19d96a32f2dc1e
KVM: SVM: Add required changes to support intercepts under SEV-ES

When a guest is running under SEV-ES, the hypervisor cannot access the
guest register state. There are numerous places in the KVM code where
certain registers are accessed that are not allowed to be accessed (e.g.
RIP, CR0, etc). Add checks to prevent register accesses and add intercept
update support at various points within the KVM code.

Also, when handling a VMGEXIT, exceptions are passed back through the
GHCB. Since the RDMSR/WRMSR intercepts (may) inject a #GP on error,
update the SVM intercepts to handle this for SEV-ES guests.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
[Redo MSR part using the .complete_emulated_msr callback. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/svm.h
arch/x86/kvm/svm/svm.c
arch/x86/kvm/x86.c