From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B513163 for ; Fri, 14 Nov 2025 00:40:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763080816; cv=none; b=FwE7UT9iuBEJ0dbh82Nq/BCEiHqSqaeKypCcJGMDs73p0T8/GYeW2eN+Fx0V3GCpFDX88uOiRJ2wfqGj3Qj4vUWt+tldkS8bszUmrREfxGkjcyC+iOGHwkX0pLAOU5zxv9sOWPwjuz0hVm9B7MgDq9dXMGlYc3SxtxtoYDx013g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763080816; c=relaxed/simple; bh=fC6Lfx89Q6A/ILnNoADOpFsvqh5jt+8wGqirTtaveQo=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=LmzBddGxrc63R/wqfG76oEIY+qUGJFcFI0obR3ZgjH9fa1i/7oo2D3KYrh6hpiIOwKNvVZzbSyDUb3TZWVsxSxhnMSbryO25Fq3vTo3cew5sIoCXvsDegauiunJsTMxCWgjUlqAgb/Qz4+1a4fcTA6w5C2ZZojGQU8fhBcXhuc4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=psJWUf3g; arc=none smtp.client-ip=209.85.210.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="psJWUf3g" Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-7b8ed43cd00so1789495b3a.2 for ; Thu, 13 Nov 2025 16:40:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1763080815; x=1763685615; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=eCrzPbEJP0qvYkIYVG+EVFzb74TW2BhSX0GpAn9qGqc=; b=psJWUf3grCCHUpUsXdmJ0HhSt4EhkYduZRsHViv6tExy/k78CzlDPqqORMIS1WSOiR N0fpw1Rjp0+OUktGzn/Xu7DWprHCPLptM624THX4xy/f4kS1U43SyLFR8f4aKngT5WJu y06frtKfU+rCV9Sb34KDaHxjHHy6czB//UmOqbsbH/Yx33mx9ZrGqnXr9qUAvWcH5Tfw yQGew7tjemM+nsnsCfzPHoQacxe/u6RZ71YaICpgBeJT0MhJ1xMVaiCClc3XTfOXeBdp /uwFxRegBKEMIIC/3DFajrsV+mJIv0mYHEAZYkw+uke7rZ77myWvLzK4zdYjtCjHbeFu ykqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763080815; x=1763685615; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eCrzPbEJP0qvYkIYVG+EVFzb74TW2BhSX0GpAn9qGqc=; b=s4KHj9ajiMjMy3mMz6PhawbHs2q3EiLz5Y3VxLIQrysHDCDoUx3eN90xa0ltjWSnA3 kbNy2rXzgweRtOsP8SHO2zos3iVyhFaYaOgzcLo/C6i4NhYRiEmCM0IHZUstlZ5tISec u+F3sLomDWLyOle08RBpiuMiIkrkwzkiCkucNWV/luULx7dbJ/oMtm4B+C1a0NXRykT4 iy82PICPB4Wdex8uJyDLIYNbWdBI+OdLLm/huPsn9TGTH642aPqa0AMH2uE0tdBiIz8D 9frIH5z+Eh/deDq2HaDCbmNl2uzf9l6ark4ZmwypQsL4av2S7ecFh1N1XoVV4WfN5spl 2YHQ== X-Forwarded-Encrypted: i=1; AJvYcCX+butXGcVOzO1MNEP7Elyr8Bkuw5dZ+hxOh2PSAfiDMR0jy8TtmEZuoW2ct/qMunxPP2Nz4fE9791QCM0=@vger.kernel.org X-Gm-Message-State: AOJu0YwfrPcJ6d0dBW5Pz8Q6iM6yd2+DPq0/Yfxu2BWmQeE/j4+P1PjE 4WRwRDoE2ZsmT80DvP6unXzcrEAuRNbdsaOpjof8syHzzeGOwaqYATpO5VriqMzIwXrPs/sCpkv Dd04JHw== X-Google-Smtp-Source: AGHT+IHMUlT1trG7JPmyoJUWFnhHl2vLDOJ0OhAxADq01bwhnLfSA84iHljh7zSoTbkrtf907lwT8IEd9LU= X-Received: from pgbda8.prod.google.com ([2002:a05:6a02:2388:b0:bc5:a3fa:e028]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:6d85:b0:334:95d7:3305 with SMTP id adf61e73a8af0-35ba22a4e5cmr2028188637.28.1763080814498; Thu, 13 Nov 2025 16:40:14 -0800 (PST) Date: Thu, 13 Nov 2025 16:40:12 -0800 In-Reply-To: <20251110232642.633672-3-yosry.ahmed@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251110232642.633672-1-yosry.ahmed@linux.dev> <20251110232642.633672-3-yosry.ahmed@linux.dev> Message-ID: Subject: Re: [PATCH v3 02/14] x86/vmx: Skip vmx_pf_exception_test_fep early if FEP is not available From: Sean Christopherson To: Yosry Ahmed Cc: Paolo Bonzini , Kevin Cheng , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" 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 > --- > 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 () { return; } 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.