mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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>
This commit is contained in:
1 parent
3bdec530a5
commit
66b245d9ea
1 file changed
+5
-3
@@ -43,7 +43,7 @@ ENTRY(svm_asm_do_resume)
|
|||||||
lea irq_stat+IRQSTAT_softirq_pending(%rip),%rdx
|
lea irq_stat+IRQSTAT_softirq_pending(%rip),%rdx
|
||||||
xor %ecx,%ecx
|
xor %ecx,%ecx
|
||||||
shl $IRQSTAT_shift,%eax
|
shl $IRQSTAT_shift,%eax
|
||||||
CLGI
|
cli
|
||||||
cmp %ecx,(%rdx,%rax,1)
|
cmp %ecx,(%rdx,%rax,1)
|
||||||
jne .Lsvm_process_softirqs
|
jne .Lsvm_process_softirqs
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ UNLIKELY_START(ne, nsvm_hap)
|
|||||||
* Someone shot down our nested p2m table; go round again
|
* Someone shot down our nested p2m table; go round again
|
||||||
* and nsvm_vcpu_switch() will fix it for us.
|
* and nsvm_vcpu_switch() will fix it for us.
|
||||||
*/
|
*/
|
||||||
STGI
|
sti
|
||||||
jmp .Lsvm_do_resume
|
jmp .Lsvm_do_resume
|
||||||
__UNLIKELY_END(nsvm_hap)
|
__UNLIKELY_END(nsvm_hap)
|
||||||
|
|
||||||
@@ -87,6 +87,8 @@ __UNLIKELY_END(nsvm_hap)
|
|||||||
pop %rsi
|
pop %rsi
|
||||||
pop %rdi
|
pop %rdi
|
||||||
|
|
||||||
|
CLGI
|
||||||
|
sti
|
||||||
VMRUN
|
VMRUN
|
||||||
|
|
||||||
SAVE_ALL
|
SAVE_ALL
|
||||||
@@ -103,6 +105,6 @@ GLOBAL(svm_stgi_label)
|
|||||||
jmp .Lsvm_do_resume
|
jmp .Lsvm_do_resume
|
||||||
|
|
||||||
.Lsvm_process_softirqs:
|
.Lsvm_process_softirqs:
|
||||||
STGI
|
sti
|
||||||
call do_softirq
|
call do_softirq
|
||||||
jmp .Lsvm_do_resume
|
jmp .Lsvm_do_resume
|
||||||