All of lore.kernel.org
 help / color / mirror / Atom feed
From: Drew Fustini <fustini@kernel.org>
To: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
Cc: qemu-devel@nongnu.org, qemu-riscv@nongnu.org,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Alistair Francis" <alistair.francis@wdc.com>,
	"Sunil V L" <sunilvl@oss.qualcomm.com>,
	"Anup Patel" <anup.patel@oss.qualcomm.com>,
	"Weiwei Li" <liwei1518@gmail.com>,
	"Liu Zhiwei" <zhiwei_liu@linux.alibaba.com>,
	"Chao Liu" <chao.liu@processmission.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Nicolas Pitre" <npitre@baylibre.com>,
	"Kornel Dulęba" <mindal@semihalf.com>,
	"Atish Patra" <atish.patra@linux.dev>,
	"Radim Krčmář" <radim.krcmar@oss.qualcomm.com>,
	"yunhui cui" <cuiyunhui@bytedance.com>,
	"Chen Pei" <cp0613@linux.alibaba.com>,
	guo.wenjia23@zte.com.cn, liu.qingtao2@zte.com.cn,
	"Jinjie Ruan" <ruanjinjie@huawei.com>,
	"Jinjie Ruan" <2118537295@qq.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Ani Sinha" <anisinha@redhat.com>,
	"Vasudevan Srinivasan" <vasu@rivosinc.com>
Subject: Re: [PATCH v2 2/2] hw/riscv: add support for ACPI RQSC table
Date: Mon, 23 Nov 2026 11:01:28 -0800	[thread overview]
Message-ID: <awSNiOvvKuSM807q@thelio> (raw)
In-Reply-To: <bd116e02-a7b2-4b90-bbee-b855111d2411@oss.qualcomm.com>

On Mon, Nov 23, 2026 at 11:15:38AM -0300, Daniel Henrique Barboza wrote:
> On 11/13/2026 8:12 PM, Drew Fustini wrote:
> > Build the ACPI RISC-V Quality of Service Controllers (RQSC) table for
> > the virt machine when CBQRI controllers are present. A capacity
> > controller is described by the PPTT Cache ID of the cache it backs and
> > a bandwidth controller by the SRAT proximity domain of its NUMA node.
> > 
> > Make RISCV_VIRT select RISCV_CBQRI as the table code calls into the
> > CBQRI devices.
> > 
> > Link: https://github.com/riscv-non-isa/riscv-rqsc/releases/tag/v1.0.0
> > Co-developed-by: Vasudevan Srinivasan <vasu@rivosinc.com>
> > Signed-off-by: Vasudevan Srinivasan <vasu@rivosinc.com>
> > Signed-off-by: Drew Fustini <fustini@kernel.org>
> > ---
> >   hw/riscv/Kconfig           |   2 +-
> >   hw/riscv/cbqri_bandwidth.c |  13 ++
> >   hw/riscv/cbqri_capacity.c  |  13 ++
> >   hw/riscv/virt-acpi-build.c | 298 ++++++++++++++++++++++++++++++++++++++++++++-
> >   include/hw/riscv/cbqri.h   |  20 +++
> >   5 files changed, 344 insertions(+), 2 deletions(-)
> > 
> > diff --git a/hw/riscv/Kconfig b/hw/riscv/Kconfig
> > index 98bdebb4b814..47dda3e52d20 100644
> > --- a/hw/riscv/Kconfig
> > +++ b/hw/riscv/Kconfig
> > @@ -71,7 +71,7 @@ config RISCV_VIRT
> >       select PLATFORM_BUS
> >       select ACPI
> >       select ACPI_PCI
> > -    imply RISCV_CBQRI
> > +    select RISCV_CBQRI
> >   config RISCV_SERVER_PLATFORM_REF
> >       bool
> > diff --git a/hw/riscv/cbqri_bandwidth.c b/hw/riscv/cbqri_bandwidth.c
> > index 6c33d1738d27..c55709d662f2 100644
> > --- a/hw/riscv/cbqri_bandwidth.c
> > +++ b/hw/riscv/cbqri_bandwidth.c
> > @@ -760,4 +760,17 @@ DeviceState *riscv_cbqri_bc_create(hwaddr addr,
> >       return dev;
> >   }
> > +void riscv_cbqri_bc_get_details(DeviceState *ds, const char *type,
> > +                                RqscController *rqsc)
> > +{
> > +    if (strcmp(type, TYPE_RISCV_CBQRI_BC) == 0) {
> 
> The only existing caller for riscv_cbqri_bc_get_details() is already doing this
> check:
> 
> 
> > +        bool is_bc = !strcmp(type, TYPE_RISCV_CBQRI_BC);
> 
> (...)
> 
> > +        if (is_bc) {
> > +            riscv_cbqri_bc_get_details(kid->child, type, &rqsc[count]);
> > +        }
> 
> 
> Unless there are plans to add new callers that will unsafely call the function
> without guaranteeing that the device type is correct, I suggest removing the
> redundant strcmp().
> 
> Same thing with riscv_cbqri_cc_get_details() below.

Good point, I'll remove the redundant checks.

> Otherwise LGTM.  Thanks,
> Daniel

Thanks for reviewing!

Drew


      reply	other threads:[~2026-11-23 19:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 23:12 [PATCH v2 0/2] RISC-V: Add support for ACPI RQSC table Drew Fustini
2026-11-13 23:12 ` [PATCH v2 1/2] hw/riscv: add cache_level and node properties to CBQRI controllers Drew Fustini
2026-11-23 14:03   ` Daniel Henrique Barboza
2026-11-23 19:19     ` Drew Fustini
2026-11-13 23:12 ` [PATCH v2 2/2] hw/riscv: add support for ACPI RQSC table Drew Fustini
2026-11-23 14:15   ` Daniel Henrique Barboza
2026-11-23 19:01     ` Drew Fustini [this message]

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=awSNiOvvKuSM807q@thelio \
    --to=fustini@kernel.org \
    --cc=2118537295@qq.com \
    --cc=alistair.francis@wdc.com \
    --cc=anisinha@redhat.com \
    --cc=anup.patel@oss.qualcomm.com \
    --cc=atish.patra@linux.dev \
    --cc=chao.liu@processmission.com \
    --cc=cp0613@linux.alibaba.com \
    --cc=cuiyunhui@bytedance.com \
    --cc=daniel.barboza@oss.qualcomm.com \
    --cc=guo.wenjia23@zte.com.cn \
    --cc=imammedo@redhat.com \
    --cc=liu.qingtao2@zte.com.cn \
    --cc=liwei1518@gmail.com \
    --cc=mindal@semihalf.com \
    --cc=mst@redhat.com \
    --cc=npitre@baylibre.com \
    --cc=palmer@dabbelt.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=radim.krcmar@oss.qualcomm.com \
    --cc=ruanjinjie@huawei.com \
    --cc=sunilvl@oss.qualcomm.com \
    --cc=vasu@rivosinc.com \
    --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.