]> xenbits.xensource.com Git - xen.git/commit
x86/EFI: fix FPU state handling around runtime calls
authorJan Beulich <jbeulich@suse.com>
Wed, 4 Jul 2018 10:36:25 +0000 (12:36 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 4 Jul 2018 10:36:25 +0000 (12:36 +0200)
commite76d0f7c65d53ec6ed9b1fd8af9415efee1d14c1
tree5de23b0c9b3317c1ebca97d887c30f3c4dc8ad34
parent19f4f879d2c9bda5c052e47e80feadb09ccda4f0
x86/EFI: fix FPU state handling around runtime calls

There are two issues.  First, the nonlazy xstates were never restored
after returning from the runtime call.

Secondly, with the fully_eager_fpu mitigation for XSA-267 / LazyFPU, the
unilateral stts() is no longer correct, and hits an assertion later when
a lazy state restore tries to occur for a fully eager vcpu.

Fix both of these issues by calling vcpu_restore_fpu_eager().  As EFI
runtime services can be used in the idle context, the idle assertion
needs to move until after the fully_eager_fpu check.

Introduce a "curr" local variable and replace other uses of "current"
at the same time.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Tested-by: Juergen Gross <jgross@suse.com>
master commit: 437211cb696515ee5bd5dae0ab72866c9f382a33
master date: 2018-06-21 11:35:46 +0200
xen/arch/x86/i387.c
xen/common/efi/runtime.c