[PATCH] riscv: cpu: Fix incorrect cached machine IDs on secondary harts
Troy Mitchell
troy at kernel.org
Tue Nov 17 22:50:26 PST 2026
On Wed Nov 18, 2026 at 3:04 AM GMT, Peixin Xie wrote:
> During early ISA-string parsing, the boot hart stores its mvendorid
> and marchid in riscv_cpuinfo. This happens before setup_per_cpu_areas(),
> which copies the static per-CPU data to each CPU's allocated area.
>
> When riscv_cpuinfo_starting() runs on the other harts, the copied IDs
> are already nonzero, so it skips reading their own IDs. As a result,
> secondary harts can retain the boot hart's IDs.
>
> Read mvendorid and marchid unconditionally on each hart, as already
> done for mimpid.
>
> Fixes: e482eab4d1eb ("riscv: cpufeature: Fix thead vector hwcap removal")
> Cc: stable at vger.kernel.org
> Signed-off-by: Peixin Xie <peixin.xie at linux.spacemit.com>
Reviewed-by: Troy Mitchell <troy at kernel.org>
--
Troy Mitchell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20261118/879915db/attachment.sig>
More information about the linux-riscv
mailing list