]> git.baikalelectronics.ru Git - kernel.git/commit
kvm, vmx: Really fix lazy FPU on nested guest
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 27 Feb 2014 21:54:11 +0000 (22:54 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 3 Mar 2014 11:49:42 +0000 (12:49 +0100)
commit395bc53023282ace781bef105371f219eb640713
treedee30cd06062315786557df30730a72eb5a32f3f
parenta75d8ccf4597b9b01d99c48f0e0d56f2cf74be42
kvm, vmx: Really fix lazy FPU on nested guest

Commit dcc1ab55a262 (kvm, vmx: Fix lazy FPU on nested guest, 2013-11-13)
highlighted a real problem, but the fix was subtly wrong.

nested_read_cr0 is the CR0 as read by L2, but here we want to look at
the CR0 value reflecting L1's setup.  In other words, L2 might think
that TS=0 (so nested_read_cr0 has the bit clear); but if L1 is actually
running it with TS=1, we should inject the fault into L1.

The effective value of CR0 in L2 is contained in vmcs12->guest_cr0, use
it.

Fixes: dcc1ab55a262e5aa3fd88bc68c19b9b3deaca6e0
Reported-by: Kashyap Chamarty <kchamart@redhat.com>
Reported-by: Stefan Bader <stefan.bader@canonical.com>
Tested-by: Kashyap Chamarty <kchamart@redhat.com>
Tested-by: Anthoine Bourgeois <bourgeois@bertin.fr>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx.c