Skip to content

Commit

Permalink
x86: nSVM: Remove nop after stgi/clgi
Browse files Browse the repository at this point in the history
Remove pointless nop after stgi/clgi - these instructions don't have an
interrupt window.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Link: https://lore.kernel.org/r/20221122161152.293072-5-mlevitsk@redhat.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
  • Loading branch information
Maxim Levitsky authored and sean-jc committed Jun 7, 2023
1 parent 7a507c9 commit 783f817
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions x86/svm_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -3044,7 +3044,7 @@ static void svm_intr_intercept_mix_run_guest(volatile int *counter, int expected
}


// subtest: test that enabling EFLAGS.IF is enought to trigger an interrupt
// subtest: test that enabling EFLAGS.IF is enough to trigger an interrupt
static void svm_intr_intercept_mix_if_guest(struct svm_test *test)
{
asm volatile("nop;nop;nop;nop");
Expand Down Expand Up @@ -3083,7 +3083,6 @@ static void svm_intr_intercept_mix_gif_guest(struct svm_test *test)
report(!dummy_isr_recevied, "No interrupt expected");

stgi();
asm volatile("nop");
report(0, "must not reach here");
}

Expand Down Expand Up @@ -3113,7 +3112,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");
}

Expand All @@ -3138,13 +3136,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_nop(); // should have no effect
report(!nmi_recevied, "No NMI expected");

stgi();
asm volatile("nop");
report(0, "must not reach here");
}

Expand All @@ -3168,11 +3164,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_nop(); // should have no effect
stgi();
asm volatile("nop");
report(0, "must not reach here");
}

Expand Down

0 comments on commit 783f817

Please sign in to comment.