@@ -3141,8 +3141,7 @@ static void svm_intr_intercept_mix_if_guest(struct svm_test *test)
{
asm volatile("nop;nop;nop;nop");
report(!dummy_isr_recevied, "No interrupt expected");
- sti();
- asm volatile("nop");
+ irq_enable();
report(0, "must not reach here");
}
@@ -3172,12 +3171,10 @@ static void svm_intr_intercept_mix_gif_guest(struct svm_test *test)
// clear GIF and enable IF
// that should still not cause VM exit
clgi();
- sti();
- asm volatile("nop");
+ irq_enable();
report(!dummy_isr_recevied, "No interrupt expected");
stgi();
- asm volatile("nop");
report(0, "must not reach here");
}
@@ -3207,7 +3204,6 @@ static void svm_intr_intercept_mix_gif_guest2(struct svm_test *test)
report(!dummy_isr_recevied, "No interrupt expected");
stgi();
- asm volatile("nop");
report(0, "must not reach here");
}
@@ -3232,14 +3228,11 @@ static void svm_intr_intercept_mix_nmi_guest(struct svm_test *test)
cli(); // should have no effect
clgi();
- asm volatile("nop");
apic_icr_write(APIC_DEST_SELF | APIC_DEST_PHYSICAL | APIC_DM_NMI, 0);
- sti(); // should have no effect
- asm volatile("nop");
+ irq_enable();
report(!nmi_recevied, "No NMI expected");
stgi();
- asm volatile("nop");
report(0, "must not reach here");
}
@@ -3263,12 +3256,9 @@ static void svm_intr_intercept_mix_smi_guest(struct svm_test *test)
asm volatile("nop;nop;nop;nop");
clgi();
- asm volatile("nop");
apic_icr_write(APIC_DEST_SELF | APIC_DEST_PHYSICAL | APIC_DM_SMI, 0);
- sti(); // should have no effect
- asm volatile("nop");
+ irq_enable();
stgi();
- asm volatile("nop");
report(0, "must not reach here");
}
Use irq_enable instead of open coded sti;nop also while at it, remove nop after stgi/clgi - these instructions don't have an interrupt window. Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> --- x86/svm_tests.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-)