Skip to content

Commit cab22b2

Browse files
yosrym93sean-jc
authored andcommitted
x86/vmx: Skip vmx_pf_exception_test_fep early if FEP is not available
The check to skip the test is currently performed in the guest code. There a few TEST_ASSERTs that happen before the guest is run, which internally call report_passed(). The latter increases the number of passed tests. Hence, when vmx_pf_exception_test_fep is run, report_summary() does not return a "skip" error code because the total number of tests is larger than the number of skipped tests. Skip early if FEP is not available, before any assertions, such that report_summary() finds exactly 1 skipped test and returns the appropriate error code. Signed-off-by: Yosry Ahmed <yosry.ahmed@linux.dev> Link: https://patch.msgid.link/20251110232642.633672-3-yosry.ahmed@linux.dev [sean: use early return instead of if-else] Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 1825b2d commit cab22b2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

x86/vmx_tests.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10644,6 +10644,11 @@ static void vmx_pf_exception_test(void)
1064410644

1064510645
static void vmx_pf_exception_forced_emulation_test(void)
1064610646
{
10647+
if (!is_fep_available) {
10648+
report_skip("Forced emulation prefix (FEP) not available\n");
10649+
return;
10650+
}
10651+
1064710652
__vmx_pf_exception_test(NULL, NULL, vmx_pf_exception_forced_emulation_test_guest);
1064810653
}
1064910654

0 commit comments

Comments
 (0)