All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Liu <chao.liu@processmission.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, qemu-stable@nongnu.org,
	 Palmer Dabbelt <palmer@dabbelt.com>
Subject: Re: [PATCH v5 08/15] hw/riscv/virt.c: fix aclint soc/mtimer nodename
Date: Sat, 29 Aug 2026 11:10:11 +0800	[thread overview]
Message-ID: <apJNiclKVDKkNmEI@ChaodeMacBook-Pro.local> (raw)
In-Reply-To: <20260828203918.350131-9-daniel.barboza@oss.qualcomm.com>

On Fri, Aug 28, 2026 at 05:39:10PM +0800, Daniel Henrique Barboza wrote:
> Running 'dtc' to generate a readable fdt for the virt machine produce
> warnings:
> 
>  $ dtc -I dtb -O dts virt.dtb > virt.dts
> <stdout>: Warning (simple_bus_reg): /soc/mtimer@2000000: simple-bus unit address format error, expected "2007ff8"
> <stdout>: Warning (simple_bus_reg): /soc/mtimer@2008000: simple-bus unit address format error, expected "200fff8"
> 
> This happens because the 'reg' field does not match the address in the
> nodename.  The right fix, pointed out by Chao in [1], is to make the
> nodename match the reg value:
> 
> "In the current QEMU implement, `addr` is the MTIMECMP base address,
> while the MTIME register is located at addr + RISCV_ACLINT_DEFAULT_MTIME."
> 
> In other words, the 'reg' value is correct but the nodename isn't.
> 
> We'll make the fix now, allowing the next patch to move the fixed version
> of aclint FDT to fdt-common.
> 
> [1] https://lore.kernel.org/qemu-devel/apHH1upnh8udUUT-@ChaodeMacBook-Pro.local/
> 
> Cc: qemu-stable@nongnu.org
> Suggested-by: Chao Liu <chao.liu@processmission.com>
> Fixes: 954886ea6d ("hw/riscv: virt: Add optional ACLINT support to virt machine")
> Signed-off-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
Reviewed-by: Chao Liu <chao.liu@processmission.com>

Thanks,
Chao

> ---
>  hw/riscv/virt.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
> index a6ec9def16..83a4b7710d 100644
> --- a/hw/riscv/virt.c
> +++ b/hw/riscv/virt.c
> @@ -234,7 +234,8 @@ static void create_fdt_socket_aclint(RISCVVirtState *s,
>                 (s->memmap[VIRT_CLINT].size * socket);
>          size = s->memmap[VIRT_CLINT].size - RISCV_ACLINT_SWI_SIZE;
>      }
> -    name = g_strdup_printf("/soc/mtimer@%lx", addr);
> +    name = g_strdup_printf("/soc/mtimer@%"HWADDR_PRIx,
> +                           addr + RISCV_ACLINT_DEFAULT_MTIME);
>      qemu_fdt_add_subnode(ms->fdt, name);
>      qemu_fdt_setprop_string(ms->fdt, name, "compatible",
>          "riscv,aclint-mtimer");
> -- 
> 2.43.0
> 


  reply	other threads:[~2026-08-29  3:10 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28 20:39 [PATCH v5 00/15] hw/riscv: trivial code dup work (riscv-server-ref prep) Daniel Henrique Barboza
2026-08-28 20:39 ` [PATCH v5 01/15] hw/riscv/fdt-common: prepend helpers with "riscv_" Daniel Henrique Barboza
2026-09-01  4:42   ` Alistair Francis
2026-09-02 16:24   ` Philippe Mathieu-Daudé
2026-09-02 16:38     ` Daniel Henrique Barboza
2026-08-28 20:39 ` [PATCH v5 02/15] hw/riscv/fdt-common, virt.c: add riscv_create_fdt_flash() Daniel Henrique Barboza
2026-09-01  4:45   ` Alistair Francis
2026-08-28 20:39 ` [PATCH v5 03/15] hw/riscv/fdt-common, virt.c: add riscv_create_fdt_syscon() Daniel Henrique Barboza
2026-09-01  4:45   ` Alistair Francis
2026-08-28 20:39 ` [PATCH v5 04/15] hw/riscv/fdt-common, virt.c: add riscv_create_fdt_riscv_iommu_sys() Daniel Henrique Barboza
2026-09-01  4:47   ` Alistair Francis
2026-08-28 20:39 ` [PATCH v5 05/15] hw/riscv/fdt_common, virt.c: add riscv_create_fdt_pcie() Daniel Henrique Barboza
2026-08-29  3:08   ` Chao Liu via
2026-08-29  3:08     ` Chao Liu via qemu development
2026-09-01  4:49   ` Alistair Francis
2026-08-28 20:39 ` [PATCH v5 06/15] hw/riscv/fdt_common, virt.c: add riscv_create_fdt_imsic() Daniel Henrique Barboza
2026-08-29  3:08   ` Chao Liu via
2026-08-29  3:08     ` Chao Liu via qemu development
2026-09-01  4:51   ` Alistair Francis
2026-08-28 20:39 ` [PATCH v5 07/15] hw/riscv/fdt_common, virt.c: add riscv_create_fdt_socket_aplic() Daniel Henrique Barboza
2026-08-29  3:09   ` Chao Liu via
2026-08-29  3:09     ` Chao Liu via qemu development
2026-09-01  5:14   ` Alistair Francis
2026-08-28 20:39 ` [PATCH v5 08/15] hw/riscv/virt.c: fix aclint soc/mtimer nodename Daniel Henrique Barboza
2026-08-29  3:10   ` Chao Liu [this message]
2026-09-01  5:15   ` Alistair Francis
2026-08-28 20:39 ` [PATCH v5 09/15] hw/riscv/fdt-common, virt.c: add riscv_create_fdt_socket_aclint() Daniel Henrique Barboza
2026-08-29  3:10   ` Chao Liu via
2026-08-29  3:10     ` Chao Liu via qemu development
2026-09-01  5:17   ` Alistair Francis
2026-08-28 20:39 ` [PATCH v5 10/15] hw/riscv/fdt-common, virt.c: add riscv_create_fdt_uart() Daniel Henrique Barboza
2026-08-29  3:11   ` Chao Liu via qemu development
2026-08-29  3:11     ` Chao Liu via
2026-09-01  5:23   ` Alistair Francis
2026-08-28 20:39 ` [PATCH v5 11/15] hw/riscv/fdt-common, virt.c: add riscv_create_fdt_rtc() Daniel Henrique Barboza
2026-08-29  3:12   ` Chao Liu via qemu development
2026-08-29  3:12     ` Chao Liu via
2026-09-01  5:23   ` Alistair Francis
2026-08-28 20:39 ` [PATCH v5 12/15] hw/riscv/device-common, virt.c: add riscv_create_platform_bus() Daniel Henrique Barboza
2026-08-29  3:12   ` Chao Liu via
2026-08-29  3:12     ` Chao Liu via qemu development
2026-09-01  5:24   ` Alistair Francis
2026-08-28 20:39 ` [PATCH v5 13/15] hw/riscv/device-common, virt.c: add flash helpers Daniel Henrique Barboza
2026-08-29  3:12   ` Chao Liu via qemu development
2026-08-29  3:12     ` Chao Liu via
2026-09-01  5:28   ` Alistair Francis
2026-08-28 20:39 ` [PATCH v5 14/15] hw/riscv/device-common, virt.c: add riscv_gpex_pcie_init() Daniel Henrique Barboza
2026-08-29  3:13   ` Chao Liu via
2026-08-29  3:13     ` Chao Liu via qemu development
2026-09-01  5:28   ` Alistair Francis
2026-08-28 20:39 ` [PATCH v5 15/15] hw/riscv/riscv-iommu-sys.c, virt.c: add riscv_create_iommu_sys() Daniel Henrique Barboza
2026-08-29  3:13   ` Chao Liu via qemu development
2026-08-29  3:13     ` Chao Liu via
2026-09-01  5:28   ` Alistair Francis
2026-09-01  5:32 ` [PATCH v5 00/15] hw/riscv: trivial code dup work (riscv-server-ref prep) 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=apJNiclKVDKkNmEI@ChaodeMacBook-Pro.local \
    --to=chao.liu@processmission.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=qemu-stable@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.