]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commit
x86/xstate: fix fault behavior on XRSTORS
authorJan Beulich <jbeulich@suse.com>
Mon, 1 Feb 2016 12:53:40 +0000 (13:53 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 1 Feb 2016 12:53:40 +0000 (13:53 +0100)
commit01493a3c572f1abe4c6357e3dd9e6942f338f595
tree3d991d94b0e173179fb77373082b871cde8f3945
parentb011a5bf41e3101a9f2108e6f25281f9279d9628
x86/xstate: fix fault behavior on XRSTORS

XRSTORS unconditionally faults when xcomp_bv has bit 63 clear. Instead
of just fixing this issue, overhaul the fault recovery code, which -
one of the many mistakes made when xstate support got introduced - was
blindly mirroring that accompanying FXRSTOR, neglecting the fact that
XRSTOR{,S} aren't all-or-nothing instructions. The new code, first of
all, does all the recovery actions in C, simplifying the inline
assembly used. And it does its work in a multi-stage fashion: Upon
first seeing a fault, state fixups get applied strictly based on what
architecturally may cause #GP. When seeing another fault despite the
fixups done, state gets fully reset. A third fault would then lead to
crashing the domain (instead of hanging the hypervisor in an infinite
loop of recurring faults).

Reported-by: Harmandeep Kaur <write.harmandeep@gmail.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/xstate.c