KVM: x86: nSVM: skip eax alignment check for non-SVM instructions
authorDenis Valeev <lemniscattaden@gmail.com>
Sat, 22 Jan 2022 20:13:57 +0000 (23:13 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Feb 2022 16:27:02 +0000 (17:27 +0100)
commit6f3e157e21b24d38c4a5d76cc40ddd4fdeb74d18
tree11c8bca42037986ceec46c777aea882075741087
parent575656560897a018de5bd4264f8ba49763be2376
KVM: x86: nSVM: skip eax alignment check for non-SVM instructions

commit 47c28d436f409f5b009dc82bd82d4971088aa391 upstream.

The bug occurs on #GP triggered by VMware backdoor when eax value is
unaligned. eax alignment check should not be applied to non-SVM
instructions because it leads to incorrect omission of the instructions
emulation.
Apply the alignment check only to SVM instructions to fix.

Fixes: d1cba6c92237 ("KVM: x86: nSVM: test eax for 4K alignment for GP errata workaround")
Signed-off-by: Denis Valeev <lemniscattaden@gmail.com>
Message-Id: <Yexlhaoe1Fscm59u@q>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/svm/svm.c