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
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 <[hidden email]>
Signed-off-by: Jan Beulich <[hidden email]>
Reviewed-by: Boris Ostrovsky <[hidden email]>
xen/arch/x86/hvm/svm/entry.S | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
@@ -57,7 +57,7 @@ UNLIKELY_START(ne, nsvm_hap)
* Someone shot down our nested p2m table; go round again
* and nsvm_vcpu_switch() will fix it for us.
@@ -87,6 +87,8 @@ __UNLIKELY_END(nsvm_hap)