On Mon, May 4, 2026 at 4:04 AM Mohamed Ayman
<mohamedaymanworkspace@gmail.com> wrote:
>
> Use a pointer to the hart instead of copying RISCVCPU when
> passing pmu_avail_ctrs to riscv_pmu_generate_fdt_node().
>
> Signed-off-by: Mohamed Ayman <mohamedaymanworkspace@gmail.com>
Thanks!
Applied to riscv-to-apply.next
Alistair
> ---
> hw/riscv/virt.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
> index a1c323e66d..085971eedc 100644
> --- a/hw/riscv/virt.c
> +++ b/hw/riscv/virt.c
> @@ -722,11 +722,11 @@ static void create_fdt_pmu(RISCVVirtState *s)
> {
> g_autofree char *pmu_name = g_strdup_printf("/pmu");
> MachineState *ms = MACHINE(s);
> - RISCVCPU hart = s->soc[0].harts[0];
> + RISCVCPU *hart = &s->soc[0].harts[0];
>
> qemu_fdt_add_subnode(ms->fdt, pmu_name);
> qemu_fdt_setprop_string(ms->fdt, pmu_name, "compatible", "riscv,pmu");
> - riscv_pmu_generate_fdt_node(ms->fdt, hart.pmu_avail_ctrs, pmu_name);
> + riscv_pmu_generate_fdt_node(ms->fdt, hart->pmu_avail_ctrs, pmu_name);
> }
>
> static void create_fdt_sockets(RISCVVirtState *s,
> --
> 2.34.1
>
>