Linux-RISC-V Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nam Cao <namcao@linutronix.de>
To: Rui Qi <qirui.001@bytedance.com>, linux-riscv@lists.infradead.org
Cc: Rui Qi <qirui.001@bytedance.com>, Paul Walmsley <pjw@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Alexandre Ghiti <alex@ghiti.fr>, Kees Cook <kees@kernel.org>,
	Jingwei Wang <wangjingwei@iscas.ac.cn>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] riscv: hwprobe: Register unaligned probes before usermode
Date: Wed, 22 Jul 2026 09:52:32 +0200	[thread overview]
Message-ID: <87a4rja2bj.fsf@yellow.woof> (raw)
In-Reply-To: <20260721150511.1607105-1-qirui.001@bytedance.com>

"Rui Qi" <qirui.001@bytedance.com> writes:
> The hwprobe vDSO data is populated by the first riscv_hwprobe syscall.
> Some values, such as MISALIGNED_VECTOR_PERF, may depend on the async
> vector unaligned access speed probe registered by
> check_unaligned_access_all_cpus().
>
> That initcall currently runs at late_initcall level. However,
> rootfs_initcall enables usermode helpers before late initcalls run, so an
> early helper can execute userspace and call riscv_hwprobe first.
>
> In that case complete_hwprobe_vdso_data() consumes the initial
> pending_boot_probes reference, populates the vDSO cache, and marks it
> ready before the later async probe is registered. The eventual probe
> result then cannot update the already-ready cache.
>
> Move check_unaligned_access_all_cpus() to fs_initcall_sync. This still
> runs after clocksource_done_booting(), so the ktime_get_mono_fast_ns()
> benchmark uses a stable clocksource, but it runs before rootfs_initcall
> enables usermode helpers.
>
> Any async hwprobe probe is therefore registered before userspace can
> trigger the one-time vDSO cache population.
>
> Fixes: 6455c6c11827 ("riscv: Clean up & optimize unaligned scalar access probe")
> Signed-off-by: Rui Qi <qirui.001@bytedance.com>

Sounds reasonable.

Reviewed-by: Nam Cao <namcao@linutronix.de>

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

      reply	other threads:[~2026-07-22  7:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-21 15:05 [PATCH] riscv: hwprobe: Register unaligned probes before usermode Rui Qi
2026-07-22  7:52 ` Nam Cao [this message]

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=87a4rja2bj.fsf@yellow.woof \
    --to=namcao@linutronix.de \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=qirui.001@bytedance.com \
    --cc=wangjingwei@iscas.ac.cn \
    /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