From: Andrew Jones <ajones@ventanamicro.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-doc@vger.kernel.org, paul.walmsley@sifive.com,
palmer@dabbelt.com, charlie@rivosinc.com, cleger@rivosinc.com,
alex@ghiti.fr, Anup Patel <apatel@ventanamicro.com>,
corbet@lwn.net
Subject: Re: [PATCH v3 7/8] riscv: Add parameter for skipping access speed tests
Date: Mon, 7 Apr 2025 15:45:52 +0200 [thread overview]
Message-ID: <20250407-63092ceb505ad536d8f1394e@orel> (raw)
In-Reply-To: <CAMuHMdVEp2_ho51gkpLLJG2HimqZ1gZ0fa=JA4uNNZjFFqaPMg@mail.gmail.com>
Hi Geert,
On Mon, Apr 07, 2025 at 11:49:59AM +0200, Geert Uytterhoeven wrote:
> Hi Andrew,
>
> On Tue, 4 Mar 2025 at 13:02, Andrew Jones <ajones@ventanamicro.com> wrote:
> > Allow skipping scalar and vector unaligned access speed tests. This
> > is useful for testing alternative code paths and to skip the tests in
> > environments where they run too slowly. All CPUs must have the same
> > unaligned access speed.
> >
> > The code movement is because we now need the scalar cpu hotplug
> > callback to always run, so we need to bring it and its supporting
> > functions out of CONFIG_RISCV_PROBE_UNALIGNED_ACCESS.
> >
> > Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
>
> Thanks for your patch, which is now commit aecb09e091dc1433
> ("riscv: Add parameter for skipping access speed tests") in
> v6.15-rc1.
>
> > --- a/arch/riscv/kernel/unaligned_access_speed.c
> > +++ b/arch/riscv/kernel/unaligned_access_speed.c
>
> > static int __init check_unaligned_access_all_cpus(void)
> > {
> > int cpu;
> >
> > - if (!check_unaligned_access_emulated_all_cpus())
> > + if (unaligned_scalar_speed_param == RISCV_HWPROBE_MISALIGNED_SCALAR_UNKNOWN &&
> > + !check_unaligned_access_emulated_all_cpus()) {
> > check_unaligned_access_speed_all_cpus();
> > -
> > - if (!has_vector()) {
> > + } else {
> > + pr_info("scalar unaligned access speed set to '%s' by command line\n",
> > + speed_str[unaligned_scalar_speed_param]);
> > for_each_online_cpu(cpu)
> > - per_cpu(vector_misaligned_access, cpu) = RISCV_HWPROBE_MISALIGNED_VECTOR_UNSUPPORTED;
> > - } else if (!check_vector_unaligned_access_emulated_all_cpus() &&
> > - IS_ENABLED(CONFIG_RISCV_PROBE_VECTOR_UNALIGNED_ACCESS)) {
> > + per_cpu(misaligned_access_speed, cpu) = unaligned_scalar_speed_param;
> > + }
> > +
> > + if (!has_vector())
> > + unaligned_vector_speed_param = RISCV_HWPROBE_MISALIGNED_VECTOR_UNSUPPORTED;
> > +
> > + if (unaligned_vector_speed_param == RISCV_HWPROBE_MISALIGNED_VECTOR_UNKNOWN &&
> > + !check_vector_unaligned_access_emulated_all_cpus() &&
> > + IS_ENABLED(CONFIG_RISCV_PROBE_VECTOR_UNALIGNED_ACCESS)) {
> > kthread_run(vec_check_unaligned_access_speed_all_cpus,
> > NULL, "vec_check_unaligned_access_speed_all_cpus");
> > + } else {
> > + pr_info("vector unaligned access speed set to '%s' by command line\n",
> > + speed_str[unaligned_vector_speed_param]);
> > + for_each_online_cpu(cpu)
> > + per_cpu(vector_misaligned_access, cpu) = unaligned_vector_speed_param;
> > }
>
> On RZ/Five:
>
> vector unaligned access speed set to 'unsupported' by command line
>
> However, this is not set on my command line?
>
> Apparently this can be set using three different methods:
> 1. It is the default value in the declaration of vector_misaligned_access,
> 2. From the handle_vector_misaligned_load() exception handler,
> 3. From the command line.
> Hence the current kernel message is rather confusing...
Thanks for the report.
The three ways above are OK, since (1) sets it to 'unknown' which means
"not yet set" (by command line or otherwise), (2) doesn't actually touch
unaligned_vector_speed_param, just its per-cpu counterpart. And the
message applies to (3). However, there's a (4) which I added without
considering the message and that's the 'if (!has_vector())' part of the
hunk above, which sets 'unsupported', as you're seeing, when vector is
not present.
I'll send a patch that ensures we only get the message for truly command
line set states.
Thanks,
drew
next prev parent reply other threads:[~2025-04-07 13:45 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-04 12:00 [PATCH v3 0/8] riscv: Unaligned access speed probing fixes and skipping Andrew Jones
2025-03-04 12:00 ` [PATCH v3 1/8] riscv: Annotate unaligned access init functions Andrew Jones
2025-03-04 12:00 ` [PATCH v3 2/8] riscv: Fix riscv_online_cpu_vec Andrew Jones
2025-03-04 12:00 ` [PATCH v3 3/8] riscv: Fix check_unaligned_access_all_cpus Andrew Jones
2025-03-04 12:00 ` [PATCH v3 4/8] riscv: Change check_unaligned_access_speed_all_cpus to void Andrew Jones
2025-03-04 12:00 ` [PATCH v3 5/8] riscv: Fix set up of cpu hotplug callbacks Andrew Jones
2025-03-04 12:00 ` [PATCH v3 6/8] riscv: Fix set up of vector cpu hotplug callback Andrew Jones
2025-03-04 12:00 ` [PATCH v3 7/8] riscv: Add parameter for skipping access speed tests Andrew Jones
2025-03-17 14:39 ` Alexandre Ghiti
2025-03-18 8:48 ` Andrew Jones
2025-03-18 9:00 ` Andrew Jones
2025-03-18 14:09 ` Clément Léger
2025-03-18 14:57 ` Andrew Jones
2025-03-18 12:13 ` Alexandre Ghiti
2025-03-18 12:45 ` Andrew Jones
2025-03-18 12:58 ` Alexandre Ghiti
2025-03-18 13:04 ` Andrew Jones
2025-03-18 14:09 ` Alexandre Ghiti
2025-03-18 14:22 ` Clément Léger
2025-03-18 15:09 ` Andrew Jones
2025-03-18 15:40 ` Anup Patel
2025-04-07 9:49 ` Geert Uytterhoeven
2025-04-07 13:45 ` Andrew Jones [this message]
2025-04-08 12:25 ` Geert Uytterhoeven
2025-04-08 13:03 ` Andrew Jones
2025-04-08 15:32 ` Geert Uytterhoeven
2025-03-04 12:00 ` [PATCH v3 8/8] Documentation/kernel-parameters: Add riscv unaligned speed parameters Andrew Jones
2025-03-05 22:48 ` [PATCH v3 0/8] riscv: Unaligned access speed probing fixes and skipping Charlie Jenkins
2025-03-06 8:13 ` Andrew Jones
2025-03-27 3:24 ` patchwork-bot+linux-riscv
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=20250407-63092ceb505ad536d8f1394e@orel \
--to=ajones@ventanamicro.com \
--cc=alex@ghiti.fr \
--cc=apatel@ventanamicro.com \
--cc=charlie@rivosinc.com \
--cc=cleger@rivosinc.com \
--cc=corbet@lwn.net \
--cc=geert@linux-m68k.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox