]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: SVM: Add emulation support for #GP triggered by SVM instructions
authorBandan Das <bsd@redhat.com>
Tue, 26 Jan 2021 08:18:29 +0000 (03:18 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 4 Feb 2021 10:27:28 +0000 (05:27 -0500)
commit99d9f6552bc0d6a8c25b03a8d66b91e587957c3b
tree3afb28bded821eb651fa50340c3bccc4afe609d3
parent16822ce7b8412e37ae5b63de0391e3d53c88f771
KVM: SVM: Add emulation support for #GP triggered by SVM instructions

While running SVM related instructions (VMRUN/VMSAVE/VMLOAD), some AMD
CPUs check EAX against reserved memory regions (e.g. SMM memory on host)
before checking VMCB's instruction intercept. If EAX falls into such
memory areas, #GP is triggered before VMEXIT. This causes problem under
nested virtualization. To solve this problem, KVM needs to trap #GP and
check the instructions triggering #GP. For VM execution instructions,
KVM emulates these instructions.

Co-developed-by: Wei Huang <wei.huang2@amd.com>
Signed-off-by: Wei Huang <wei.huang2@amd.com>
Signed-off-by: Bandan Das <bsd@redhat.com>
Message-Id: <20210126081831.570253-3-wei.huang2@amd.com>
[Conditionally enable #GP intercept. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/svm.c