All of lore.kernel.org
 help / color / mirror / Atom feed
From: Drew Fustini <fustini@kernel.org>
To: Radim Krcmar <rkrcmar@qti.qualcomm.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"qemu-riscv@nongnu.org" <qemu-riscv@nongnu.org>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Alistair Francis" <Alistair.Francis@wdc.com>,
	"Weiwei Li" <liwei1518@gmail.com>,
	"dbarboza@ventanamicro.com" <dbarboza@ventanamicro.com>,
	"Liu Zhiwei" <zhiwei_liu@linux.alibaba.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Nicolas Pitre" <npitre@baylibre.com>,
	"Kornel Dulęba" <mindal@semihalf.com>,
	"Atish Kumar Patra" <atishp@rivosinc.com>,
	"Atish Patra" <atish.patra@linux.dev>,
	"Vasudevan Srinivasan" <vasu@rivosinc.com>,
	"rkrcmar@ventanamicro.com" <rkrcmar@ventanamicro.com>,
	"yunhui cui" <cuiyunhui@bytedance.com>,
	"Chen Pei" <cp0613@linux.alibaba.com>,
	"guo.wenjia23@zte.com.cn" <guo.wenjia23@zte.com.cn>,
	"liu.qingtao2@zte.com.cn" <liu.qingtao2@zte.com.cn>,
	"qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org"
	<qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org>
Subject: Re: [PATCH v5 3/6] hw/riscv: implement CBQRI capacity controller
Date: Sun, 8 Mar 2026 09:35:47 -0700	[thread overview]
Message-ID: <aa2lYxv4jjPCJ0Tt@x1> (raw)
In-Reply-To: <DGSIOY06X4A5.1HW34JPQV2IGB@qti.qualcomm.com>

On Mon, Mar 02, 2026 at 06:44:59PM +0000, Radim Krcmar wrote:
> 2026-02-01T15:58:09-08:00, Drew Fustini <fustini@kernel.org>:
> > From: Nicolas Pitre <npitre@baylibre.com>
> >
> > Implement a capacity controller according to the Capacity and Bandwidth
> > QoS Register Interface (CBQRI) which supports these capabilities:
> >
> >   - Number of access types: 2 (code and data)
> >   - Usage monitoring operations: CONFIG_EVENT, READ_COUNTER
> >   - Event IDs supported: None, Occupancy
> >   - Capacity allocation ops: CONFIG_LIMIT, READ_LIMIT, FLUSH_RCID
> >
> > Link: https://github.com/riscv-non-isa/riscv-cbqri/releases/tag/v1.0
> > Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
> > [fustini: add fields introduced in the ratified spec: cunits, rpfx, p]
> > Signed-off-by: Drew Fustini <fustini@kernel.org>
> > ---
> > diff --git a/hw/riscv/cbqri_capacity.c b/hw/riscv/cbqri_capacity.c
> > @@ -0,0 +1,733 @@
> > [...]
> > +static void riscv_cbqri_cc_write_wrapper(void *opaque, hwaddr addr,
> > +                                             uint64_t value, unsigned size)
> > +{
> > +    if (size == 4) {
> > +        uint64_t reg = riscv_cbqri_cc_read(opaque, addr & ~0x7UL, 8);
> > +        if (addr & 0x7) {
> > +            value = value << 32 | (reg & 0xffffffff);
> > +        } else {
> > +            value = value | (reg & ~0xffffffffUL);
> > +        }
> > +    }
> > +    riscv_cbqri_cc_write(opaque, addr & ~0x7UL, value, 8);
> > +}
> 
> I know I wrote it like this, but I wonder if QEMU prefers ULL or even
> MAKE_64BIT_MASK?  UL shouldn't break unless we compile with MSVC,
> 
> Reviewed-by: Radim Krčmář <radim.krcmar@oss.qualcomm.com>

Thanks for the suggestion. I'll take a look at MAKE_64BIT_MASK.

Drew


  reply	other threads:[~2026-03-08 16:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-01 23:58 [PATCH v5 0/6] riscv: implement Ssqosid extension and CBQRI controllers Drew Fustini
2026-02-01 23:58 ` [PATCH v5 1/6] riscv: implement Ssqosid extension and srmcfg CSR Drew Fustini
2026-03-02 18:14   ` Radim Krcmar
2026-02-01 23:58 ` [PATCH v5 2/6] hw/riscv: define capabilities of CBQRI controllers Drew Fustini
2026-03-02 18:17   ` Radim Krcmar
2026-03-08 16:30     ` Drew Fustini
2026-02-01 23:58 ` [PATCH v5 3/6] hw/riscv: implement CBQRI capacity controller Drew Fustini
2026-03-02 18:44   ` Radim Krcmar
2026-03-08 16:35     ` Drew Fustini [this message]
2026-02-01 23:58 ` [PATCH v5 4/6] hw/riscv: implement CBQRI bandwidth controller Drew Fustini
2026-03-02 18:55   ` Radim Krcmar
2026-03-08 16:38     ` Drew Fustini
2026-02-01 23:58 ` [PATCH v5 5/6] hw/riscv: add CBQRI to Kconfig and build if enabled Drew Fustini
2026-02-01 23:58 ` [PATCH v5 6/6] hw/riscv: add CBQRI controllers to virt machine Drew Fustini

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=aa2lYxv4jjPCJ0Tt@x1 \
    --to=fustini@kernel.org \
    --cc=Alistair.Francis@wdc.com \
    --cc=atish.patra@linux.dev \
    --cc=atishp@rivosinc.com \
    --cc=cp0613@linux.alibaba.com \
    --cc=cuiyunhui@bytedance.com \
    --cc=dbarboza@ventanamicro.com \
    --cc=guo.wenjia23@zte.com.cn \
    --cc=liu.qingtao2@zte.com.cn \
    --cc=liwei1518@gmail.com \
    --cc=mindal@semihalf.com \
    --cc=npitre@baylibre.com \
    --cc=palmer@dabbelt.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=rkrcmar@qti.qualcomm.com \
    --cc=rkrcmar@ventanamicro.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.