From: Stefano Stabellini <sstabellini@kernel.org>
To: Denis Mukhin <dmukhin@ford.com>
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()
Date: Wed, 2 Dec 2026 16:21:34 -0800 (PST) [thread overview]
Message-ID: <38bac34d-4fe2-30b8-947e-dc62f4f9b130@kernel.org> (raw)
In-Reply-To: <20261111195109.1070169-4-dmukhin@ford.com>
On Wed, 11 Nov 2026, dmukhin@ford.com wrote:
> From: Denis Mukhin <dmukhin@ford.com>
>
> 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 <dmukhin@ford.com>
> ---
> 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
>
next prev parent reply other threads:[~2026-12-03 0:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 19:51 [XTF PATCH v1 0/6] x86: add NS16550-compatible UART emulator test dmukhin
2026-11-11 19:51 ` [XTF PATCH v1 1/6] .gitignore: exclude tags dmukhin
2026-12-03 0:12 ` Stefano Stabellini
2026-11-11 19:51 ` [XTF PATCH v1 2/6] x86: introduce cpu_relax() dmukhin
2026-12-03 0:13 ` Stefano Stabellini
2026-11-11 19:51 ` [XTF PATCH v1 3/6] x86: isolate FEP in setup_fep() dmukhin
2026-12-03 0:21 ` Stefano Stabellini [this message]
2026-11-11 19:51 ` [XTF PATCH v1 4/6] x86: skip registering unavailable Xen console dmukhin
2026-12-03 0:14 ` Stefano Stabellini
2026-11-11 19:51 ` [XTF PATCH v1 5/6] common: add simplistic NS16550-compatible UART driver dmukhin
2026-12-03 0:25 ` Stefano Stabellini
2026-11-11 19:51 ` [XTF PATCH v1 6/6] x86: add NS16550-compatible emulator test dmukhin
2026-12-03 0:35 ` Stefano Stabellini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=38bac34d-4fe2-30b8-947e-dc62f4f9b130@kernel.org \
--to=sstabellini@kernel.org \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=dmukhin@ford.com \
--cc=dmukhin@xen.org \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger@xenproject.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.