lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <axcelxpkwmqht3lq7gpmp4idkcyujyr4jjtf5gh5usp7gxnl3v@rxckldu4iup7>
Date: Fri, 14 Nov 2025 00:47:19 +0000
From: Yosry Ahmed <yosry.ahmed@...ux.dev>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>, Kevin Cheng <chengkev@...gle.com>, 
	kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 02/14] x86/vmx: Skip vmx_pf_exception_test_fep early
 if FEP is not available

On Thu, Nov 13, 2025 at 04:40:12PM -0800, Sean Christopherson wrote:
> On Mon, Nov 10, 2025, Yosry Ahmed wrote:
> > 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@...ux.dev>
> > ---
> >  x86/vmx_tests.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
> > index 0b3cfe50c6142..4f214ebdbe1d9 100644
> > --- a/x86/vmx_tests.c
> > +++ b/x86/vmx_tests.c
> > @@ -10644,7 +10644,10 @@ static void vmx_pf_exception_test(void)
> >  
> >  static void vmx_pf_exception_forced_emulation_test(void)
> >  {
> > -	__vmx_pf_exception_test(NULL, NULL, vmx_pf_exception_forced_emulation_test_guest);
> > +	if (is_fep_available)
> > +		__vmx_pf_exception_test(NULL, NULL, vmx_pf_exception_forced_emulation_test_guest);
> > +	else
> > +		report_skip("Forced emulation prefix (FEP) not available\n");
> 
> To be consistent with other tests, and the kernel's general pattern of:
> 
> 	if (<error>) {
> 		<react>
> 		return;
> 	}
> 
> 	<do useful stuff>
> 
> I'll tweak this to
> 
> 	if (!is_fep_available) {
> 		report_skip("Forced emulation prefix (FEP) not available\n");
> 		return;
> 	}
> 
> 	__vmx_pf_exception_test(NULL, NULL, vmx_pf_exception_forced_emulation_test_guest);
> 
> when applying.

LGTM, thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ