All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: Anup Patel <anup@brainfault.org>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	"open list:RISC-V" <qemu-riscv@nongnu.org>,
	Sagar Karandikar <sagark@eecs.berkeley.edu>,
	Anup Patel <anup.patel@wdc.com>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	Atish Patra <atish.patra@wdc.com>,
	Alistair Francis <Alistair.Francis@wdc.com>,
	Palmer Dabbelt <palmer@dabbelt.com>
Subject: Re: [PATCH v1 3/3] hw/riscv: virt: Add optional ACLINT support to virt machine
Date: Tue, 13 Jul 2021 07:05:25 +0800	[thread overview]
Message-ID: <CAEUhbmWgmu3UKfAtq31E=BrBhJeWUSC+KhQ2FTCD2PBqnact_g@mail.gmail.com> (raw)
In-Reply-To: <CAAhSdy195JTXoZsk=XOZmQog2X4ZP2Npty-74SvorC8Kjjdm9g@mail.gmail.com>

On Mon, Jul 12, 2021 at 11:03 PM Anup Patel <anup@brainfault.org> wrote:
>
> On Mon, Jul 12, 2021 at 6:41 PM Bin Meng <bmeng.cn@gmail.com> wrote:
> >
> > On Mon, Jul 12, 2021 at 6:54 PM Anup Patel <anup@brainfault.org> wrote:
> > >
> > > On Mon, Jul 12, 2021 at 11:45 AM Bin Meng <bmeng.cn@gmail.com> wrote:
> > > >
> > > > On Mon, Jul 12, 2021 at 1:39 PM Anup Patel <anup@brainfault.org> wrote:
> > > > >
> > > > > On Mon, Jun 14, 2021 at 5:52 PM Bin Meng <bmeng.cn@gmail.com> wrote:
> > > > > >
> > > > > > On Sun, Jun 13, 2021 at 12:14 AM Anup Patel <anup.patel@wdc.com> wrote:
> > > > > > >
> > > > > > > We extend virt machine to emulate ACLINT devices only when "aclint=on"
> > > > > > > parameter is passed along with machine name in QEMU command-line.
> > > > > > >
> > > > > > > Signed-off-by: Anup Patel <anup.patel@wdc.com>
> > > > > > > ---
> > > > > > >  hw/riscv/virt.c         | 110 +++++++++++++++++++++++++++++++++++++++-
> > > > > > >  include/hw/riscv/virt.h |   2 +
> > > > > > >  2 files changed, 111 insertions(+), 1 deletion(-)
> > > > > > >
> > > > > > > diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
> > > > > > > index 977d699753..a35f66af13 100644
> > > > > > > --- a/hw/riscv/virt.c
> > > > > > > +++ b/hw/riscv/virt.c
> > > > > > > @@ -50,6 +50,7 @@ static const MemMapEntry virt_memmap[] = {
> > > > > > >      [VIRT_TEST] =        {   0x100000,        0x1000 },
> > > > > > >      [VIRT_RTC] =         {   0x101000,        0x1000 },
> > > > > > >      [VIRT_CLINT] =       {  0x2000000,       0x10000 },
> > > > > > > +    [VIRT_ACLINT_SSWI] = {  0x2F00000,        0x4000 },
> > > > > >
> > > > > > How about we reuse the same register space to support both CLINT and
> > > > > > ACLINT? This saves some register space for future extension.
> > > > >
> > > > > The intention of placing ACLINT SSWI separate from ACLINT MTIMER and
> > > > > MSWI is to minimize PMP region usage.
> > > >
> > > > Okay, so this leaves spaces for 240 ACLINT MTIMER and MSWI devices in
> > > > total, if we put ACLINT SSWI at 0x2F00000, and we still have spaces
> > > > for 64 ACLINT SSWI devices. Is this enough?
> > >
> > > We just need one instance of MTIMER, MSWI, and SSWI per-socket.
> > > Current limit of max sockets in RISC-V virt machine is 8. We will be
> > > reducing this to 4 due space required by IMSICs. This means no matter
> > > what 8 instances of each MTIMER, MSWI, and SSWI is the max we
> > > can go for RISC-V virt machine. This limits are due to the fact that
> > > we want to fit devices in first 2GB space.
> > >
> >
> > Can you list the maximum ACLINT devices and their memory map we intend
> > to support and with that we can see how many PMP is used?
>
> For 4 sockets, we will have following layout:
> 0x2000000-0x200FFFF (Socket0 MTIMER and MSWI)
> 0x2010000-0x201FFFF (Socket1 MTIMER and MSWI)
> 0x2020000-0x202FFFF (Socket2 MTIMER and MSWI)
> 0x2030000-0x203FFFF (Socket3 MTIMER and MSWI)
> 0x2F00000-0x2F03FFF (Socket0 SSWI)
> 0x2F04000-0x2F07FFF (Socket1 SSWI)
> 0x2F08000-0x2F0bFFF (Socket2 SSWI)
> 0x2F0C000-0x2F0FFFF (Socket3 SSWI)
>
> OpenSBI will create one PMP region to protect all
> MTIMERs and MSWIs which is:
> 0x2000000-0x203FFFF

Thanks! This makes sense.

Regards,
Bin


WARNING: multiple messages have this Message-ID (diff)
From: Bin Meng <bmeng.cn@gmail.com>
To: Anup Patel <anup@brainfault.org>
Cc: Anup Patel <anup.patel@wdc.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	 Palmer Dabbelt <palmer@dabbelt.com>,
	Alistair Francis <Alistair.Francis@wdc.com>,
	 Sagar Karandikar <sagark@eecs.berkeley.edu>,
	Atish Patra <atish.patra@wdc.com>,
	"open list:RISC-V" <qemu-riscv@nongnu.org>,
	 "qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>
Subject: Re: [PATCH v1 3/3] hw/riscv: virt: Add optional ACLINT support to virt machine
Date: Tue, 13 Jul 2021 07:05:25 +0800	[thread overview]
Message-ID: <CAEUhbmWgmu3UKfAtq31E=BrBhJeWUSC+KhQ2FTCD2PBqnact_g@mail.gmail.com> (raw)
In-Reply-To: <CAAhSdy195JTXoZsk=XOZmQog2X4ZP2Npty-74SvorC8Kjjdm9g@mail.gmail.com>

On Mon, Jul 12, 2021 at 11:03 PM Anup Patel <anup@brainfault.org> wrote:
>
> On Mon, Jul 12, 2021 at 6:41 PM Bin Meng <bmeng.cn@gmail.com> wrote:
> >
> > On Mon, Jul 12, 2021 at 6:54 PM Anup Patel <anup@brainfault.org> wrote:
> > >
> > > On Mon, Jul 12, 2021 at 11:45 AM Bin Meng <bmeng.cn@gmail.com> wrote:
> > > >
> > > > On Mon, Jul 12, 2021 at 1:39 PM Anup Patel <anup@brainfault.org> wrote:
> > > > >
> > > > > On Mon, Jun 14, 2021 at 5:52 PM Bin Meng <bmeng.cn@gmail.com> wrote:
> > > > > >
> > > > > > On Sun, Jun 13, 2021 at 12:14 AM Anup Patel <anup.patel@wdc.com> wrote:
> > > > > > >
> > > > > > > We extend virt machine to emulate ACLINT devices only when "aclint=on"
> > > > > > > parameter is passed along with machine name in QEMU command-line.
> > > > > > >
> > > > > > > Signed-off-by: Anup Patel <anup.patel@wdc.com>
> > > > > > > ---
> > > > > > >  hw/riscv/virt.c         | 110 +++++++++++++++++++++++++++++++++++++++-
> > > > > > >  include/hw/riscv/virt.h |   2 +
> > > > > > >  2 files changed, 111 insertions(+), 1 deletion(-)
> > > > > > >
> > > > > > > diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
> > > > > > > index 977d699753..a35f66af13 100644
> > > > > > > --- a/hw/riscv/virt.c
> > > > > > > +++ b/hw/riscv/virt.c
> > > > > > > @@ -50,6 +50,7 @@ static const MemMapEntry virt_memmap[] = {
> > > > > > >      [VIRT_TEST] =        {   0x100000,        0x1000 },
> > > > > > >      [VIRT_RTC] =         {   0x101000,        0x1000 },
> > > > > > >      [VIRT_CLINT] =       {  0x2000000,       0x10000 },
> > > > > > > +    [VIRT_ACLINT_SSWI] = {  0x2F00000,        0x4000 },
> > > > > >
> > > > > > How about we reuse the same register space to support both CLINT and
> > > > > > ACLINT? This saves some register space for future extension.
> > > > >
> > > > > The intention of placing ACLINT SSWI separate from ACLINT MTIMER and
> > > > > MSWI is to minimize PMP region usage.
> > > >
> > > > Okay, so this leaves spaces for 240 ACLINT MTIMER and MSWI devices in
> > > > total, if we put ACLINT SSWI at 0x2F00000, and we still have spaces
> > > > for 64 ACLINT SSWI devices. Is this enough?
> > >
> > > We just need one instance of MTIMER, MSWI, and SSWI per-socket.
> > > Current limit of max sockets in RISC-V virt machine is 8. We will be
> > > reducing this to 4 due space required by IMSICs. This means no matter
> > > what 8 instances of each MTIMER, MSWI, and SSWI is the max we
> > > can go for RISC-V virt machine. This limits are due to the fact that
> > > we want to fit devices in first 2GB space.
> > >
> >
> > Can you list the maximum ACLINT devices and their memory map we intend
> > to support and with that we can see how many PMP is used?
>
> For 4 sockets, we will have following layout:
> 0x2000000-0x200FFFF (Socket0 MTIMER and MSWI)
> 0x2010000-0x201FFFF (Socket1 MTIMER and MSWI)
> 0x2020000-0x202FFFF (Socket2 MTIMER and MSWI)
> 0x2030000-0x203FFFF (Socket3 MTIMER and MSWI)
> 0x2F00000-0x2F03FFF (Socket0 SSWI)
> 0x2F04000-0x2F07FFF (Socket1 SSWI)
> 0x2F08000-0x2F0bFFF (Socket2 SSWI)
> 0x2F0C000-0x2F0FFFF (Socket3 SSWI)
>
> OpenSBI will create one PMP region to protect all
> MTIMERs and MSWIs which is:
> 0x2000000-0x203FFFF

Thanks! This makes sense.

Regards,
Bin


  reply	other threads:[~2021-07-12 23:06 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-12 16:06 [PATCH v1 0/3] RISC-V ACLINT Support Anup Patel
2021-06-12 16:06 ` Anup Patel
2021-06-12 16:06 ` [PATCH v1 1/3] hw/intc: Upgrade the SiFive CLINT implementation to RISC-V ACLINT Anup Patel
2021-06-12 16:06   ` Anup Patel
2021-06-14 12:22   ` Bin Meng
2021-06-14 12:22     ` Bin Meng
2021-07-12  5:00     ` Anup Patel
2021-07-12  5:00       ` Anup Patel
2021-06-18  6:50   ` Alistair Francis
2021-06-18  6:50     ` Alistair Francis
2021-07-12  5:32     ` Anup Patel
2021-07-12  5:32       ` Anup Patel
2021-06-12 16:06 ` [PATCH v1 2/3] hw/riscv: virt: Re-factor FDT generation Anup Patel
2021-06-12 16:06   ` Anup Patel
2021-06-14 12:22   ` Bin Meng
2021-06-14 12:22     ` Bin Meng
2021-07-12  5:40     ` Anup Patel
2021-07-12  5:40       ` Anup Patel
2021-06-12 16:06 ` [PATCH v1 3/3] hw/riscv: virt: Add optional ACLINT support to virt machine Anup Patel
2021-06-12 16:06   ` Anup Patel
2021-06-14 12:22   ` Bin Meng
2021-06-14 12:22     ` Bin Meng
2021-07-12  5:38     ` Anup Patel
2021-07-12  5:38       ` Anup Patel
2021-07-12  6:15       ` Bin Meng
2021-07-12  6:15         ` Bin Meng
2021-07-12 10:53         ` Anup Patel
2021-07-12 10:53           ` Anup Patel
2021-07-12 13:11           ` Bin Meng
2021-07-12 13:11             ` Bin Meng
2021-07-12 15:02             ` Anup Patel
2021-07-12 15:02               ` Anup Patel
2021-07-12 23:05               ` Bin Meng [this message]
2021-07-12 23:05                 ` Bin Meng

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='CAEUhbmWgmu3UKfAtq31E=BrBhJeWUSC+KhQ2FTCD2PBqnact_g@mail.gmail.com' \
    --to=bmeng.cn@gmail.com \
    --cc=Alistair.Francis@wdc.com \
    --cc=anup.patel@wdc.com \
    --cc=anup@brainfault.org \
    --cc=atish.patra@wdc.com \
    --cc=palmer@dabbelt.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=sagark@eecs.berkeley.edu \
    /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.