From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8EC96606A322 for ; Thu, 3 Dec 2026 00:22:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=OII7KK10 Received: from list by lists.xenproject.org with outflank-mailman.1511299.1703753 (Exim 4.92) (envelope-from ) id 1xYuZx-00037j-6i; Thu, 03 Dec 2026 00:21:41 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1511299.1703753; Thu, 03 Dec 2026 00:21:41 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xYuZx-00037c-3j; Thu, 03 Dec 2026 00:21:41 +0000 Received: by outflank-mailman (input) for mailman id 1511299; Thu, 03 Dec 2026 00:21:39 +0000 Received: from mx.expurgate.net ([195.190.135.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xYuZv-00037T-OI for xen-devel@lists.xenproject.org; Thu, 03 Dec 2026 00:21:39 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xYuZv-00Cxw6-4u for xen-devel@lists.xenproject.org; Thu, 03 Dec 2026 01:21:39 +0100 Received: from [10.42.69.10] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6b10b5cd-2eae-0a2a0a5409dd-0a2a450adc18-48 for ; Thu, 03 Dec 2026 01:21:39 +0100 Received: from [172.105.4.254] (helo=tor.source.kernel.org) by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6b10b611-f2d2-0a2a450a0019-ac6904fe8b40-3 for ; Thu, 03 Dec 2026 01:21:38 +0100 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 3D2296022A; Thu, 3 Dec 2026 00:21:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E7A31F000C1; Thu, 3 Dec 2026 00:21:35 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Post: List-Help: List-Subscribe: , Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:cc:Subject:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796257297; bh=Q4H6RVZDDw9P4MrK6eOb29FDyXaReQamNRs/pe2hWr4=; h=Date:From:To:cc:Subject:In-Reply-To:References; b=OII7KK106Pcqnp2PVQAqTvY75PApdi8iKNazB6+6Jq8jITecIe85iHmxuxrM4k25H 41DKdCgD+tuGLj45o83LT0iamkadkjP1NnSbZYFi9SZCz40NC6Y5WePYZ/w6wmSlY2 06Dxe8XgjOCOuXjOwn3TvHWZozgvX6UEVSMhgNzp1NEWTbXNMOwGZ/RsGUHzQOOUV5 li6qrFIt+2v+IUu5C4K7Ov+eQd9S3DSS4cl6ZA1+H2ZFJnkcreb7pjDjn6OkQRX60w J8kYrRurEG1fgX7/ruJ2LLvEAWQHYlgbFlcfnS71EcYtme6rzvdujRzCH7UUr3iqYM ADJRum32b76ng== Date: Wed, 2 Dec 2026 16:21:34 -0800 (PST) From: Stefano Stabellini To: Denis Mukhin cc: xen-devel@lists.xenproject.org, andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com, julien@xen.org, michal.orzel@amd.com, roger@xenproject.org, sstabellini@kernel.org, dmukhin@xen.org Subject: Re: [XTF PATCH v1 3/6] x86: isolate FEP in setup_fep() In-Reply-To: <20261111195109.1070169-4-dmukhin@ford.com> Message-ID: <38bac34d-4fe2-30b8-947e-dc62f4f9b130@kernel.org> References: <20261111195109.1070169-1-dmukhin@ford.com> <20261111195109.1070169-4-dmukhin@ford.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-purgate-ID: tlsNG-4011c0/1796257299-4B8D5CFC-36DDF172/0/0 X-purgate-type: clean X-purgate-size: 3968 X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Wed, 11 Nov 2026, dmukhin@ford.com wrote: > From: Denis Mukhin > > Keep weak symbol test_setup() for per-test definition. > > Isolate FEP into a new setup_fep() call which is executed on a common x86 > path. > > Signed-off-by: Denis Mukhin > --- > arch/x86/setup.c | 80 +++++++++++++++++++++++++----------------------- > 1 file changed, 41 insertions(+), 39 deletions(-) > > diff --git a/arch/x86/setup.c b/arch/x86/setup.c > index ba6f9c320843..8fea6495de1c 100644 > --- a/arch/x86/setup.c > +++ b/arch/x86/setup.c > @@ -253,6 +253,45 @@ static void xen_console_write(const char *buf, size_t len) > hypercall_console_write(buf, len); > } > > +/* > + * Common test setup: > + * > + * xtf_has_* indicates the availabiliy of options which require runtime > + * detection. > + */ > +bool xtf_has_fep = false; > + > +/* > + * Default weak settings. > + * > + * test_wants_* indicates default settings for the framework, which may be > + * overridden by individual tests by providing non-weak variables. > + * > + * test_needs_* indicates options required by the test, without which the test > + * isn't worth running. > + */ > +bool __weak test_needs_fep = false; > + > +static void setup_fep(void) > +{ > + /* > + * Attempt to use the forced emulation prefix to set the value of > + * xtf_has_fep to the value of 1. Use the exception table to compensate > + * for the #UD exception if FEP is not available. > + */ > + asm volatile ("1:" _ASM_XEN_FEP "mov $1, %[fep];" > + "2:" > + _ASM_EXTABLE(1b, 2b) > + : [fep] "=q" (xtf_has_fep) > + : "0" (false)); > + > + if ( test_needs_fep && !xtf_has_fep ) > + { > + printk("FEP unavailable, but needed by test. (Is Xen support\n"); > + return xtf_skip("compiled in, and booted with 'hvm_fep'?)\n"); > + } > +} > + > void arch_setup(void) > { > if ( IS_DEFINED(CONFIG_HVM) && !pvh_start_info ) > @@ -275,6 +314,8 @@ void arch_setup(void) > } > > map_shared_info(); > + > + setup_fep(); > } The FEP skip now happens in arch_setup(), before the banner, and xtf_main() still calls test_setup() unconditionally. So a test that needs FEP and has its own test_setup() runs that setup even after it's been skipped. If that setup fails, the SKIP turns into FAILURE. Maybe we should guard test_setup() with !xtf_status_reported() > int arch_get_domid(void) > @@ -293,45 +334,6 @@ int arch_get_domid(void) > return -1; > } > > -/* > - * Common test setup: > - * > - * xtf_has_* indicates the availabiliy of options which require runtime > - * detection. > - */ > -bool xtf_has_fep = false; > - > -/* > - * Default weak settings. > - * > - * test_wants_* indicates default settings for the framework, which may be > - * overridden by individual tests by providing non-weak variables. > - * > - * test_needs_* indicates options required by the test, without which the test > - * isn't worth running. > - */ > -bool __weak test_needs_fep = false; > - > -void test_setup(void) > -{ > - /* > - * Attempt to use the forced emulation prefix to set the value of > - * xtf_has_fep to the value of 1. Use the exception table to compensate > - * for the #UD exception if FEP is not available. > - */ > - asm volatile ("1:" _ASM_XEN_FEP "mov $1, %[fep];" > - "2:" > - _ASM_EXTABLE(1b, 2b) > - : [fep] "=q" (xtf_has_fep) > - : "0" (false)); > - > - if ( test_needs_fep && !xtf_has_fep ) > - { > - printk("FEP unavailable, but needed by test. (Is Xen support\n"); > - return xtf_skip("compiled in, and booted with 'hvm_fep'?)\n"); > - } > -} > - > /* > * Local variables: > * mode: C > -- > 2.56.0 >