Re: [PATCH] riscv: cpu: Fix incorrect cached machine IDs on secondary harts
From: Troy Mitchell
Date: Wed Nov 18 2026 - 01:50:35 EST
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@xxxxxxxxxxxxxxx
> Signed-off-by: Peixin Xie <peixin.xie@xxxxxxxxxxxxxxxxxx>
Reviewed-by: Troy Mitchell <troy@xxxxxxxxxx>
--
Troy Mitchell
Attachment:
signature.asc
Description: PGP signature