From: Paul Walmsley <pjw@kernel.org>
To: Andy Chiu <tchiu@tenstorrent.com>
Cc: "Paul Walmsley" <pjw@kernel.org>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Alexandre Ghiti" <alex@ghiti.fr>,
"Evan Green" <evan@rivosinc.com>,
"Charlie Jenkins" <charlie@rivosinc.com>,
linux-riscv@lists.infradead.org, bergner@tenstorrent.com,
kito.cheng@sifive.com, dfustini@oss.tenstorrent.com,
greentime.hu@sifive.com,
"Andrew Jones" <andrew.jones@oss.qualcomm.com>,
"Deepak Gupta" <debug@rivosinc.com>,
"Xu Lu" <luxu.kernel@bytedance.com>,
"Yao Zihong" <zihong.plct@isrc.iscas.ac.cn>,
"Jingwei Wang" <wangjingwei@iscas.ac.cn>,
"Clément Léger" <cleger@rivosinc.com>
Subject: Re: [PATCH v3 1/3] riscv: hwprobe: initialize pair->value in hwprobe_one_pair()
Date: Thu, 20 Aug 2026 20:11:37 -0600 (MDT) [thread overview]
Message-ID: <48f9d505-b80c-e6c7-1623-b86822393dd1@kernel.org> (raw)
In-Reply-To: <20260725001614.2578617-2-tchiu@tenstorrent.com>
Hi Andy,
On Fri, 24 Jul 2026, Andy Chiu wrote:
> The vendor-extension handlers reached from hwprobe_one_pair()
> (hwprobe_isa_vendor_ext_thead_0() and friends) only OR the present bits
> into pair->value via VENDOR_EXTENSION_SUPPORTED() and clear their own
> missing bits; they assume the caller has already zeroed pair->value.
>
> That holds for hwprobe_get_values() (it zeroes each pair) and
> hwprobe_get_cpus() (it re-initializes its scratch pair per key), but not
> for complete_hwprobe_vdso_data(), which reuses a single pair across all
> keys without re-zeroing. A vendor key therefore inherits stale bits from
> the previously probed key, and the wrong value is cached in the vDSO
> all_cpu_hwprobe_values[] and handed to userspace on the fast patih.
>
> Zero pair->value once at the top of hwprobe_one_pair() so every handler
> starts from a clean value regardless of the caller, and drop the now
> redundant zeroing in the *_BLOCK_SIZE cases. hwprobe_isa_ext0() keeps its
> own zeroing because hwprobe_ext0_has() calls it directly, bypassing
> hwprobe_one_pair().
>
> Fixes: a5ea53da65c5 ("riscv: hwprobe: Add thead vendor extension probing")
> Signed-off-by: Andy Chiu <tchiu@tenstorrent.com>
Thanks, queued for v7.3-rc.
- Paul
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2026-08-21 2:11 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-25 0:15 [PATCH v3 0/3] riscv: hwprobe: report per-process extension availability Andy Chiu
2026-07-25 0:15 ` Andy Chiu
2026-07-25 0:15 ` [PATCH v3 1/3] riscv: hwprobe: initialize pair->value in hwprobe_one_pair() Andy Chiu
2026-08-05 16:56 ` Jesse Taube
2026-08-21 2:11 ` Paul Walmsley [this message]
2026-07-25 0:15 ` [PATCH v3 2/3] riscv: hwprobe: export the availability of vector to user Andy Chiu
2026-07-25 0:15 ` Andy Chiu
2026-08-05 17:38 ` Jesse Taube
2026-08-05 17:38 ` Jesse Taube
2026-08-13 23:38 ` Mark Harris
2026-08-13 23:38 ` Mark Harris
2026-08-28 16:00 ` Andy Chiu
2026-08-28 16:00 ` Andy Chiu
2026-07-25 0:15 ` [PATCH v3 3/3] selftests: riscv: hwprobe: test the RISCV_HWPROBE_KEY_EXT_ENABLED modifier Andy Chiu
2026-07-25 0:15 ` Andy Chiu
2026-08-05 19:20 ` Jesse Taube
2026-08-05 19:20 ` Jesse Taube
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=48f9d505-b80c-e6c7-1623-b86822393dd1@kernel.org \
--to=pjw@kernel.org \
--cc=alex@ghiti.fr \
--cc=andrew.jones@oss.qualcomm.com \
--cc=aou@eecs.berkeley.edu \
--cc=bergner@tenstorrent.com \
--cc=charlie@rivosinc.com \
--cc=cleger@rivosinc.com \
--cc=debug@rivosinc.com \
--cc=dfustini@oss.tenstorrent.com \
--cc=evan@rivosinc.com \
--cc=greentime.hu@sifive.com \
--cc=kito.cheng@sifive.com \
--cc=linux-riscv@lists.infradead.org \
--cc=luxu.kernel@bytedance.com \
--cc=palmer@dabbelt.com \
--cc=tchiu@tenstorrent.com \
--cc=wangjingwei@iscas.ac.cn \
--cc=zihong.plct@isrc.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 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.