mirror of
https://github.com/xen-project/xen.git
synced 2026-10-30 03:00:05 +01:00
x86: guard against #NM
Just in case we still don't get CR0.TS handling right, prevent a host crash by honoring exception fixups in do_device_not_available(). This would in particular cover emulator stubs raising #NM. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
488efc29e4
commit
00cebd6f22
1 file changed
+15
-1
+15
-1
@@ -1749,7 +1749,21 @@ void do_device_not_available(struct cpu_user_regs *regs)
|
||||
{
|
||||
struct vcpu *curr = current;
|
||||
|
||||
BUG_ON(!guest_mode(regs));
|
||||
if ( !guest_mode(regs) )
|
||||
{
|
||||
unsigned long fixup = search_exception_table(regs);
|
||||
|
||||
gprintk(XENLOG_ERR, "#NM: %p [%ps] -> %p\n",
|
||||
_p(regs->rip), _p(regs->rip), _p(fixup));
|
||||
/*
|
||||
* We shouldn't be able to reach here, but for release builds have
|
||||
* the recovery logic in place nevertheless.
|
||||
*/
|
||||
ASSERT_UNREACHABLE();
|
||||
BUG_ON(!fixup);
|
||||
regs->rip = fixup;
|
||||
return;
|
||||
}
|
||||
|
||||
vcpu_restore_fpu_lazy(curr);
|
||||
|
||||
|
||||