Skip to content
Commit 1b385cbd authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

kvm, vmx: Really fix lazy FPU on nested guest



Commit e504c909 (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: e504c909
Reported-by: default avatarKashyap Chamarty <kchamart@redhat.com>
Reported-by: default avatarStefan Bader <stefan.bader@canonical.com>
Tested-by: default avatarKashyap Chamarty <kchamart@redhat.com>
Tested-by: default avatarAnthoine Bourgeois <bourgeois@bertin.fr>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent a08d3b3b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment