SVM: limit GIF=0 region
authorJan Beulich <jbeulich@suse.com>
Tue, 11 Sep 2018 09:06:41 +0000 (11:06 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 11 Sep 2018 09:06:41 +0000 (11:06 +0200)
commit66b245d9eaebfef710148d410ae97a2eaedc3170
treed9c18993cea53591971892bdc4e8cf4d3e8fcf0c
parent3bdec530a5f50b212aa5fd05d97e7349e8bdba82
SVM: limit GIF=0 region

Use EFLAGS.IF for most ordinary purposes; there's in particular no need
to unduly defer NMI/#MC. Clear GIF only immediately before VMRUN itself.
This has the additional advantage that svm_stgi_label now indeed marks
the only place where GIF gets set.

Note regarding the main STI placement: Quite counterintuitively the
host's EFLAGS.IF continues to have a meaning while the guest runs; see
PM Vol 2 section "Physical (INTR) Interrupt Masking in EFLAGS". Hence we
need to set the flag for the duration of time being in guest context.
However, SPEC_CTRL_ENTRY_FROM_HVM wants to be carried out with EFLAGS.IF
clear.

Note regarding the main STGI placement: It could be moved further up,
but at present SPEC_CTRL_EXIT_TO_HVM is not NMI/#MC-safe.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
xen/arch/x86/hvm/svm/entry.S