All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Liu <chao.liu.zevorn@gmail.com>
To: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
Cc: qemu-devel@nongnu.org, qemu-riscv@nongnu.org,
	alistair.francis@wdc.com,  liwei1518@gmail.com,
	zhiwei_liu@linux.alibaba.com,
	 Palmer Dabbelt <palmer@dabbelt.com>
Subject: Re: [PATCH 2/5] hw/riscv/sifive_u.c: use intc_phandle in plic creation
Date: Tue, 23 Jun 2026 12:14:09 +0800	[thread overview]
Message-ID: <ajoHzy3dYz6-cC0c@ChaodeMacBook-Pro.local> (raw)
In-Reply-To: <20260616235939.1358663-3-daniel.barboza@oss.qualcomm.com>

On Tue, Jun 16, 2026 at 08:59:36PM +0800, Daniel Henrique Barboza wrote:
> The info about intc_phandles for each CPU is already stored in the
> intc_phandles array.  We don't need to fetch them again using
> qemu_fdt_get_phandle().
> 
> Signed-off-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
Reviewed-by: Chao Liu <chao.liu.zevorn@gmail.com>

Thanks,
Chao
> ---
>  hw/riscv/sifive_u.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
> index fda9a09f06..b3468254f5 100644
> --- a/hw/riscv/sifive_u.c
> +++ b/hw/riscv/sifive_u.c
> @@ -199,20 +199,16 @@ static void create_fdt(SiFiveUState *s, const MemMapEntry *memmap,
>      plic_phandle = phandle++;
>      cells =  g_new0(uint32_t, ms->smp.cpus * 4 - 2);
>      for (cpu = 0; cpu < ms->smp.cpus; cpu++) {
> -        nodename =
> -            g_strdup_printf("/cpus/cpu@%d/interrupt-controller", cpu);
> -        uint32_t intc_phandle = qemu_fdt_get_phandle(fdt, nodename);
>          /* cpu 0 is the management hart that does not have S-mode */
>          if (cpu == 0) {
> -            cells[0] = cpu_to_be32(intc_phandle);
> +            cells[0] = cpu_to_be32(intc_phandles[cpu]);
>              cells[1] = cpu_to_be32(IRQ_M_EXT);
>          } else {
> -            cells[cpu * 4 - 2] = cpu_to_be32(intc_phandle);
> +            cells[cpu * 4 - 2] = cpu_to_be32(intc_phandles[cpu]);
>              cells[cpu * 4 - 1] = cpu_to_be32(IRQ_M_EXT);
> -            cells[cpu * 4 + 0] = cpu_to_be32(intc_phandle);
> +            cells[cpu * 4 + 0] = cpu_to_be32(intc_phandles[cpu]);
>              cells[cpu * 4 + 1] = cpu_to_be32(IRQ_S_EXT);
>          }
> -        g_free(nodename);
>      }
>      nodename = g_strdup_printf("/soc/interrupt-controller@%lx",
>          (long)memmap[SIFIVE_U_DEV_PLIC].base);
> -- 
> 2.43.0
> 


  parent reply	other threads:[~2026-06-23  4:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-16 23:59 [PATCH 0/5] hw/riscv: more FDT cleanups (PLIC) Daniel Henrique Barboza
2026-06-16 23:59 ` [PATCH 1/5] hw/riscv/sifive_u.c: remove unneeded qemu_fdt_get_phandle() call Daniel Henrique Barboza
2026-06-22  4:56   ` Alistair Francis
2026-06-23  4:12   ` Chao Liu
2026-06-16 23:59 ` [PATCH 2/5] hw/riscv/sifive_u.c: use intc_phandle in plic creation Daniel Henrique Barboza
2026-06-22  4:57   ` Alistair Francis
2026-06-23  4:14   ` Chao Liu [this message]
2026-06-16 23:59 ` [PATCH 3/5] hw/riscv/sifive_u: add #address-cells in PLIC FDT Daniel Henrique Barboza
2026-06-22  4:59   ` Alistair Francis
2026-06-23  4:14   ` Chao Liu
2026-06-16 23:59 ` [PATCH 4/5] hw/riscv/virt.c: change 'plic' nodename to 'interrupt-controller' Daniel Henrique Barboza
2026-06-22  5:00   ` Alistair Francis
2026-06-23  4:15   ` Chao Liu
2026-06-16 23:59 ` [PATCH 5/5] hw/riscv: add create_fdt_plic() helper Daniel Henrique Barboza
2026-06-22  5:02   ` Alistair Francis
2026-06-23  4:16   ` Chao Liu
2026-06-22 23:09 ` [PATCH 0/5] hw/riscv: more FDT cleanups (PLIC) Alistair Francis

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=ajoHzy3dYz6-cC0c@ChaodeMacBook-Pro.local \
    --to=chao.liu.zevorn@gmail.com \
    --cc=alistair.francis@wdc.com \
    --cc=daniel.barboza@oss.qualcomm.com \
    --cc=liwei1518@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=zhiwei_liu@linux.alibaba.com \
    /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.