]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: nVMX: Fix handling of lmsw instruction
authorJan H. Schönherr <jschoenh@amazon.de>
Sat, 20 May 2017 11:22:56 +0000 (13:22 +0200)
committerSasha Levin <alexander.levin@microsoft.com>
Wed, 23 May 2018 01:36:26 +0000 (21:36 -0400)
commita2024abc9db975e8526a97bf91701bf5782039f8
treef586321c346d4a8c7e5bb86edca0d5614432c843
parentaabab30d35025ff01bf177b3db154fc7e022fbaa
KVM: nVMX: Fix handling of lmsw instruction

[ Upstream commit e1d39b17e044e8ae819827810d87d809ba5f58c0 ]

The decision whether or not to exit from L2 to L1 on an lmsw instruction is
based on bogus values: instead of using the information encoded within the
exit qualification, it uses the data also used for the mov-to-cr
instruction, which boils down to using whatever is in %eax at that point.

Use the correct values instead.

Without this fix, an L1 may not get notified when a 32-bit Linux L2
switches its secondary CPUs to protected mode; the L1 is only notified on
the next modification of CR0. This short time window poses a problem, when
there is some other reason to exit to L1 in between. Then, L2 will be
resumed in real mode and chaos ensues.

Signed-off-by: Jan H. Schönherr <jschoenh@amazon.de>
Reviewed-by: Wanpeng Li <wanpeng.li@hotmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
arch/x86/kvm/vmx.c