]> xenbits.xensource.com Git - xen.git/commit
x86/spec-ctrl: Issue VERW during IST exit to Xen
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 13 Sep 2023 12:53:33 +0000 (13:53 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 18 Sep 2023 15:43:01 +0000 (16:43 +0100)
commit3ee6066bcd737756b0990d417d94eddc0b0d2585
treeca0c34f6be7c880bf45b15954bf9239883ff50c7
parent21bdc25b05a0f8ab6bc73520a9ca01327360732c
x86/spec-ctrl: Issue VERW during IST exit to Xen

There is a corner case where e.g. an NMI hitting an exit-to-guest path after
SPEC_CTRL_EXIT_TO_* would have run the entire NMI handler *after* the VERW
flush to scrub potentially sensitive data from uarch buffers.

In order to compensate, issue VERW when exiting to Xen from an IST entry.

SPEC_CTRL_EXIT_TO_XEN already has two reads of spec_ctrl_flags off the stack,
and we're about to add a third.  Load the field into %ebx, and list the
register as clobbered.

%r12 has been arranged to be the ist_exit signal, so add this as an input
dependency and use it to identify when to issue a VERW.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/include/asm/spec_ctrl_asm.h
xen/arch/x86/x86_64/entry.S