All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Liu via <qemu-riscv@nongnu.org>
To: Joel Stanley <joel@jms.id.au>
Cc: "Alistair Francis" <alistair.francis@wdc.com>,
	"Daniel Henrique Barboza" <daniel.barboza@oss.qualcomm.com>,
	"Weiwei Li" <liwei1518@gmail.com>,
	"Liu Zhiwei" <zhiwei_liu@linux.alibaba.com>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Anirudh Srinivasan" <asrinivasan@oss.tenstorrent.com>,
	"Michael Ellerman" <mpe@kernel.org>,
	"Portia Stephens" <portias@oss.tenstorrent.com>,
	"Cédric Le Goater" <clg@kaod.org>,
	qemu-riscv@nongnu.org, qemu-devel@nongnu.org,
	"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
Subject: Re: [PATCH v3 01/16] hw/riscv/aia: Take a MemoryRegion for the created devices
Date: Thu, 3 Sep 2026 14:06:32 +0800	[thread overview]
Message-ID: <apkOXiEq1Sh4HSwZ@ChaodeMacBook-Pro.local> (raw)
In-Reply-To: <20260903055131.257903-2-joel@jms.id.au>

On Thu, Sep 03, 2026 at 03:21:15PM +0800, Joel Stanley wrote:
> Add a MemoryRegion parameter to riscv_create_aia(), to be passed on to
> the IMSIC and APLIC helpers so a SoC can have the controllers mapped
> into its own memory container. Both callers pass system_memory, so there
> is no change in behaviour.
> 
> As the controllers don't yet take a MemoryRegion the parameter is not
> yet passed on. Changing riscv_create_aia first avoids churn in the
> intermediate commits.
> 
> Reviewed-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Chao Liu <chao.liu@processmission.com>

Thanks,
Chao

> ---
>  hw/riscv/aia.h         | 3 ++-
>  hw/riscv/aia.c         | 3 ++-
>  hw/riscv/tt_atlantis.c | 3 ++-
>  hw/riscv/virt.c        | 3 ++-
>  4 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/riscv/aia.h b/hw/riscv/aia.h
> index 3b6d7f962506..5df3292610e9 100644
> --- a/hw/riscv/aia.h
> +++ b/hw/riscv/aia.h
> @@ -13,7 +13,8 @@
>  
>  uint32_t imsic_num_bits(uint32_t count);
>  
> -DeviceState *riscv_create_aia(bool msimode, int aia_guests,
> +DeviceState *riscv_create_aia(MemoryRegion *container,
> +                             bool msimode, int aia_guests,
>                               uint32_t m_imsic_stride,
>                               uint32_t s_imsic_stride,
>                               uint16_t num_sources,
> diff --git a/hw/riscv/aia.c b/hw/riscv/aia.c
> index c1a5982856c5..e11382e512da 100644
> --- a/hw/riscv/aia.c
> +++ b/hw/riscv/aia.c
> @@ -24,7 +24,8 @@ uint32_t imsic_num_bits(uint32_t count)
>      return ret;
>  }
>  
> -DeviceState *riscv_create_aia(bool msimode, int aia_guests,
> +DeviceState *riscv_create_aia(MemoryRegion *container,
> +                             bool msimode, int aia_guests,
>                               uint32_t m_imsic_stride,
>                               uint32_t s_imsic_stride,
>                               uint16_t num_sources,
> diff --git a/hw/riscv/tt_atlantis.c b/hw/riscv/tt_atlantis.c
> index 812051a11fd4..f395236d88ab 100644
> --- a/hw/riscv/tt_atlantis.c
> +++ b/hw/riscv/tt_atlantis.c
> @@ -498,7 +498,8 @@ static void tt_atlantis_machine_init(MachineState *machine)
>                              &error_abort);
>      sysbus_realize(SYS_BUS_DEVICE(&s->soc), &error_fatal);
>  
> -    s->irqchip = riscv_create_aia(true, TT_IMSIC_GUESTS,
> +    s->irqchip = riscv_create_aia(system_memory,
> +                                  true, TT_IMSIC_GUESTS,
>                                    TT_IMSIC_STRIDE,
>                                    TT_IMSIC_STRIDE,
>                                    TT_IRQCHIP_NUM_SOURCES,
> diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
> index de7b99c6a51e..6480a3f0a9c0 100644
> --- a/hw/riscv/virt.c
> +++ b/hw/riscv/virt.c
> @@ -809,8 +809,9 @@ static void virt_machine_init(MachineState *machine)
>              s->irqchip[i] = virt_create_plic(s->memmap, i,
>                                               base_hartid, hart_count);
>          } else {
> +            bool msimode = s->aia_type == VIRT_AIA_TYPE_APLIC_IMSIC;
>              int imsic_bits = imsic_num_bits(s->aia_guests + 1);
> -            s->irqchip[i] = riscv_create_aia(s->aia_type == VIRT_AIA_TYPE_APLIC_IMSIC,
> +            s->irqchip[i] = riscv_create_aia(system_memory, msimode,
>                                               s->aia_guests,
>                                               IMSIC_HART_SIZE(0),
>                                               IMSIC_HART_SIZE(imsic_bits),
> -- 
> 2.47.3
> 


WARNING: multiple messages have this Message-ID (diff)
From: Chao Liu via qemu development <qemu-devel@nongnu.org>
To: Joel Stanley <joel@jms.id.au>
Cc: "Alistair Francis" <alistair.francis@wdc.com>,
	"Daniel Henrique Barboza" <daniel.barboza@oss.qualcomm.com>,
	"Weiwei Li" <liwei1518@gmail.com>,
	"Liu Zhiwei" <zhiwei_liu@linux.alibaba.com>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Anirudh Srinivasan" <asrinivasan@oss.tenstorrent.com>,
	"Michael Ellerman" <mpe@kernel.org>,
	"Portia Stephens" <portias@oss.tenstorrent.com>,
	"Cédric Le Goater" <clg@kaod.org>,
	qemu-riscv@nongnu.org, qemu-devel@nongnu.org,
	"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
Subject: Re: [PATCH v3 01/16] hw/riscv/aia: Take a MemoryRegion for the created devices
Date: Thu, 3 Sep 2026 14:06:32 +0800	[thread overview]
Message-ID: <apkOXiEq1Sh4HSwZ@ChaodeMacBook-Pro.local> (raw)
In-Reply-To: <20260903055131.257903-2-joel@jms.id.au>

On Thu, Sep 03, 2026 at 03:21:15PM +0800, Joel Stanley wrote:
> Add a MemoryRegion parameter to riscv_create_aia(), to be passed on to
> the IMSIC and APLIC helpers so a SoC can have the controllers mapped
> into its own memory container. Both callers pass system_memory, so there
> is no change in behaviour.
> 
> As the controllers don't yet take a MemoryRegion the parameter is not
> yet passed on. Changing riscv_create_aia first avoids churn in the
> intermediate commits.
> 
> Reviewed-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Chao Liu <chao.liu@processmission.com>

Thanks,
Chao

> ---
>  hw/riscv/aia.h         | 3 ++-
>  hw/riscv/aia.c         | 3 ++-
>  hw/riscv/tt_atlantis.c | 3 ++-
>  hw/riscv/virt.c        | 3 ++-
>  4 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/riscv/aia.h b/hw/riscv/aia.h
> index 3b6d7f962506..5df3292610e9 100644
> --- a/hw/riscv/aia.h
> +++ b/hw/riscv/aia.h
> @@ -13,7 +13,8 @@
>  
>  uint32_t imsic_num_bits(uint32_t count);
>  
> -DeviceState *riscv_create_aia(bool msimode, int aia_guests,
> +DeviceState *riscv_create_aia(MemoryRegion *container,
> +                             bool msimode, int aia_guests,
>                               uint32_t m_imsic_stride,
>                               uint32_t s_imsic_stride,
>                               uint16_t num_sources,
> diff --git a/hw/riscv/aia.c b/hw/riscv/aia.c
> index c1a5982856c5..e11382e512da 100644
> --- a/hw/riscv/aia.c
> +++ b/hw/riscv/aia.c
> @@ -24,7 +24,8 @@ uint32_t imsic_num_bits(uint32_t count)
>      return ret;
>  }
>  
> -DeviceState *riscv_create_aia(bool msimode, int aia_guests,
> +DeviceState *riscv_create_aia(MemoryRegion *container,
> +                             bool msimode, int aia_guests,
>                               uint32_t m_imsic_stride,
>                               uint32_t s_imsic_stride,
>                               uint16_t num_sources,
> diff --git a/hw/riscv/tt_atlantis.c b/hw/riscv/tt_atlantis.c
> index 812051a11fd4..f395236d88ab 100644
> --- a/hw/riscv/tt_atlantis.c
> +++ b/hw/riscv/tt_atlantis.c
> @@ -498,7 +498,8 @@ static void tt_atlantis_machine_init(MachineState *machine)
>                              &error_abort);
>      sysbus_realize(SYS_BUS_DEVICE(&s->soc), &error_fatal);
>  
> -    s->irqchip = riscv_create_aia(true, TT_IMSIC_GUESTS,
> +    s->irqchip = riscv_create_aia(system_memory,
> +                                  true, TT_IMSIC_GUESTS,
>                                    TT_IMSIC_STRIDE,
>                                    TT_IMSIC_STRIDE,
>                                    TT_IRQCHIP_NUM_SOURCES,
> diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
> index de7b99c6a51e..6480a3f0a9c0 100644
> --- a/hw/riscv/virt.c
> +++ b/hw/riscv/virt.c
> @@ -809,8 +809,9 @@ static void virt_machine_init(MachineState *machine)
>              s->irqchip[i] = virt_create_plic(s->memmap, i,
>                                               base_hartid, hart_count);
>          } else {
> +            bool msimode = s->aia_type == VIRT_AIA_TYPE_APLIC_IMSIC;
>              int imsic_bits = imsic_num_bits(s->aia_guests + 1);
> -            s->irqchip[i] = riscv_create_aia(s->aia_type == VIRT_AIA_TYPE_APLIC_IMSIC,
> +            s->irqchip[i] = riscv_create_aia(system_memory, msimode,
>                                               s->aia_guests,
>                                               IMSIC_HART_SIZE(0),
>                                               IMSIC_HART_SIZE(imsic_bits),
> -- 
> 2.47.3
> 


  reply	other threads:[~2026-09-03  6:07 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-03  5:51 [PATCH v3 00/16] hw/riscv: Socify Atlantis Joel Stanley
2026-09-03  5:51 ` [PATCH v3 01/16] hw/riscv/aia: Take a MemoryRegion for the created devices Joel Stanley
2026-09-03  6:06   ` Chao Liu via [this message]
2026-09-03  6:06     ` Chao Liu via qemu development
2026-09-03  5:51 ` [PATCH v3 02/16] hw/intc/riscv_aclint: " Joel Stanley
2026-09-03  5:51 ` [PATCH v3 03/16] hw/intc/riscv_imsic: Take a MemoryRegion for the created device Joel Stanley
2026-09-03  5:51 ` [PATCH v3 04/16] hw/intc/riscv_aplic: " Joel Stanley
2026-09-03  5:51 ` [PATCH v3 05/16] hw/intc/sifive_plic: " Joel Stanley
2026-09-03  6:07   ` Chao Liu via qemu development
2026-09-03  6:07     ` Chao Liu via
2026-09-03  5:51 ` [PATCH v3 06/16] hw/riscv/cps: Map interrupt controllers in SoC container Joel Stanley
2026-09-03  5:51 ` [PATCH v3 07/16] hw/riscv/atlantis: Make UART unimp region a SoC device Joel Stanley
2026-09-03  5:51 ` [PATCH v3 08/16] hw/riscv/atlantis: Remove unused fdt_size Joel Stanley
2026-09-03  5:51 ` [PATCH v3 09/16] hw/riscv/atlantis: Rename hart array 'soc' to 'cpus' Joel Stanley
2026-09-03  5:51 ` [PATCH v3 10/16] hw/riscv/atlantis: Rework device tree creation Joel Stanley
2026-09-03  5:51 ` [PATCH v3 11/16] hw/riscv/atlantis: Use local reference for system memory Joel Stanley
2026-09-03  5:51 ` [PATCH v3 12/16] hw/riscv/atlantis: Decouple RAM size from MachineState Joel Stanley
2026-09-03  5:51 ` [PATCH v3 13/16] hw/riscv/atlantis: Make TTAtlantisState own memory containers Joel Stanley
2026-09-03  5:51 ` [PATCH v3 14/16] hw/riscv: Add property to hart array to allow private memory Joel Stanley
2026-09-04 10:42   ` Philippe Mathieu-Daudé
2026-09-07  7:27     ` Joel Stanley
2026-09-03  5:51 ` [PATCH v3 15/16] hw/riscv/atlantis: Extract an Atlantis SoC device Joel Stanley
2026-09-04 10:47   ` Philippe Mathieu-Daudé
2026-09-04 10:48     ` Philippe Mathieu-Daudé
2026-09-07  7:16     ` Joel Stanley
2026-09-03  5:51 ` [PATCH v3 16/16] hw/riscv/atlantis: Map the SoC through a memory container Joel Stanley
2026-09-03 23:35 ` [PATCH v3 00/16] hw/riscv: Socify Atlantis Alistair Francis
2026-09-04 10:49   ` Philippe Mathieu-Daudé

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=apkOXiEq1Sh4HSwZ@ChaodeMacBook-Pro.local \
    --to=qemu-riscv@nongnu.org \
    --cc=alistair.francis@wdc.com \
    --cc=asrinivasan@oss.tenstorrent.com \
    --cc=chao.liu@processmission.com \
    --cc=clg@kaod.org \
    --cc=daniel.barboza@oss.qualcomm.com \
    --cc=joel@jms.id.au \
    --cc=liwei1518@gmail.com \
    --cc=mpe@kernel.org \
    --cc=npiggin@gmail.com \
    --cc=philmd@oss.qualcomm.com \
    --cc=portias@oss.tenstorrent.com \
    --cc=qemu-devel@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.