x86: refine guest_mode()
authorJan Beulich <jbeulich@suse.com>
Fri, 9 Apr 2021 07:12:51 +0000 (09:12 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 9 Apr 2021 07:12:51 +0000 (09:12 +0200)
commitdfcf494f96671a9d3ee2fed70250ef1eedc1c00e
tree9de3ca15221f4a8f18424cc84a1a7dc38ce94603
parent025eacc13f6147ffa99da5ecee4ed96e7fe8e887
x86: refine guest_mode()

The 2nd of the assertions as well as the macro's return value have been
assuming we're on the primary stack. While for most IST exceptions we
switch back to the main one when user mode was interrupted, for #DF we
intentionally never do, and hence a #DF actually triggering on a user
mode insn (which then is still a Xen bug) would in turn trigger this
assertion, rather than cleanly logging state.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/include/asm-x86/regs.h