From: Markus Armbruster <armbru@redhat.com>
To: Jinjie Ruan <2118537295@qq.com>
Cc: anisinha@redhat.com, eblake@redhat.com, imammedo@redhat.com,
michael.roth@amd.com, mst@redhat.com, pbonzini@redhat.com,
peter.maydell@linaro.org, qemu-devel@nongnu.org,
qemu-arm@nongnu.org, ruanjinjie@huawei.com
Subject: Re: [PATCH 36/37] qapi: Add MPAM cache introspection schema and stub
Date: Mon, 26 Oct 2026 14:05:49 +0100 [thread overview]
Message-ID: <87fqxs1uj6.fsf@pond.sub.org> (raw)
In-Reply-To: <tencent_E9186FE529AD6EC21F51EF364CEA6426EF05@qq.com> (Jinjie Ruan's message of "Fri, 16 Oct 2026 18:10:56 +0800")
Jinjie Ruan <2118537295@qq.com> writes:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> Add the query-mpam-cache QMP command schema: the MpamBm bitmap
> type, the per-RIS MpamRegs state and the MpamCacheInfo summary of
> a cache MSC, plus an optional cache level filter. The command is
> stubbed to return NULL so the generated marshal links; the real
> implementation walks the device tree in the next patch.
>
> Based on an RFC series by Jonathan Cameron, adapted to the current
> qapi documentation rules.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
[...]
> diff --git a/qapi/meson.build b/qapi/meson.build
> index a46269b..c6663e5 100644
> --- a/qapi/meson.build
> +++ b/qapi/meson.build
> @@ -42,6 +42,7 @@ qapi_all_modules = [
> 'machine-s390x',
> 'migration',
> 'misc',
> + 'mpam',
> 'net',
> 'pragma',
> 'qom',
> diff --git a/qapi/mpam.json b/qapi/mpam.json
> new file mode 100644
> index 0000000..ff476a1
> --- /dev/null
> +++ b/qapi/mpam.json
> @@ -0,0 +1,120 @@
> +# -*- Mode: Python -*-
> +# vim: filetype=python
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +
> +##
> +# = ARM MPAM State Introspection
> +##
Special QAPI doc markup that hasn't been recognized in more than a year.
Please build with --enable-docs, and examine
docs/manual/interop/qemu-qmp-ref.html to guard against such mishaps.
Use standard reST markup instead:
##
# ****************************
# ARM MPAM State Introspection
# ****************************
##
Are you *sure* this ought to be between "Miscellanea" and "Audio" and at
the same heading level? Or should it be deeper and/or elsewhere?
> +
> +##
> +# @MpamBm:
> +#
> +# A bitmap control value, as used by MPAM cache-portion (CPBM) and
> +# memory-bandwidth-portion (MBW_PBM) controls. The value is
> +# carried as an array of 32-bit words, least significant first.
> +#
Anti-pattern: the introduction (above) discusses the value of a member
(below).
> +# @words: The bitmap, one element per 32-bits of the control
> +#
> +# Since: 10.1
11.2 now. Same elsewhere, not noting it again.
> +##
> +{ 'struct': 'MpamBm',
> + 'data' : { 'words' : [ 'int' ]
The description says it's 32 bit words. Shouldn't you use 'uint32'
then?
> + }
> +}
> +
> +##
> +# @MpamRegs:
> +#
> +# Per RIS register state of an emulated MPAM Memory System Component.
Please use the current syntax for introductions:
##
# @name: introduction, best to keep it brief, but you may continue it
# like this if necessary. If your text need to refer to
# arguments, it's almost certainly not brief introduction
# anymore.
Same elsewhere, not noting it again.
> +#
> +# @idr: MPAMF_IDR, the MPAM features identification register
> +#
> +# @iidr: MPAMF_IIDR, the MPAM implementer identification register
> +#
> +# @aidr: MPAMF_AIDR, the MPAM architecture identification register
> +#
> +# @cpor-idr: MPAMF_CPOR_IDR, cache-portion feature register
> +#
> +# @ccap-idr: MPAMF_CCAP_IDR, cache-capacity feature register
> +#
> +# @mbw-idr: MPAMF_MBW_IDR, memory-bandwidth feature register
> +#
> +# @pri-idr: MPAMF_PRI_IDR, priority feature register
> +#
> +# @partid-nrw-idr: MPAMF_PARTID_NRW_IDR, PARTID narrowing register
> +#
> +# @msmon-idr: MPAMF_MSMON_IDR, monitor feature register
> +#
> +# @csumon-idr: MPAMF_CSUMON_IDR, cache-usage monitor register
> +#
> +# @mbwumon-idr: MPAMF_MBWUMON_IDR, memory-bandwidth monitor register
> +#
> +# @ecr: MPAMF_ECR, the error control register
> +#
> +# @esr: MPAMF_ESR, the error status register
> +#
> +# @cfg-part-sel: MPAMCFG_PART_SEL, the partition-selection register
> +#
> +# @cfg-cpbm: The configured cache-portion bitmaps, one per
> +# internal PARTID
> +#
> +# Since: 10.1
> +##
> +{ 'struct' : 'MpamRegs',
> + 'data' : { 'idr' : 'int',
> + 'iidr' : 'int',
> + 'aidr' : 'int',
> + 'cpor-idr': 'int',
> + 'ccap-idr': 'int',
> + 'mbw-idr': 'int',
> + 'pri-idr': 'int',
> + 'partid-nrw-idr': 'int',
> + 'msmon-idr': 'int',
> + 'csumon-idr': 'int',
> + 'mbwumon-idr': 'int',
> + 'ecr': 'int',
> + 'esr': 'int',
> + 'cfg-part-sel': 'int',
> + 'cfg-cpbm': ['MpamBm']#lazy
Is the comment an accident?
How wide are these registers? Is 'int' the appropriate type?
> + }
> +}
> +
> +##
> +# @MpamCacheInfo:
> +#
> +# Information about an MPAM cache Memory System Component.
> +#
> +# @cpu: First CPU of the set associated with the cache
> +#
> +# @level: Level of cache
> +#
> +# @type: Type of cache
> +#
> +# @regs: The per RIS register state
> +#
> +# Since: 10.1
> +##
> +{ 'struct': 'MpamCacheInfo',
> + 'data' : { 'cpu' : 'int',
> + 'level' : 'int',
> + 'type' : 'int',
> + 'regs' : ['MpamRegs']
> + }
> +}
> +
> +##
> +# @query-mpam-cache:
> +#
> +# Get a list of MpamCacheInfo for all Cache related MSC
> +#
> +# @level: Provide a cache level to filter against
What exactly does this argument filter out?
Is it really needed? How large can unfiltered output become?
> +#
> +# Returns: a list of @MpamCacheInfo describing all
> +# the MPAM cache MSC instances
This gets rendered like
Return: [MpamCacheInfo] – a list of MpamCacheInfo describing all the
MPAM cache MSC instances
As is, the description is mostly redundant. Do you need a description?
Try building without it, and see how it comes out.
> +#
> +# Since: 10.1
> +##
> +{ 'command': 'query-mpam-cache',
> + 'data': { '*level': 'int' },
> + 'returns' : ['MpamCacheInfo'],
> + 'allow-preconfig': true }
> diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json
> index b93dd68..cef175d 100644
> --- a/qapi/qapi-schema.json
> +++ b/qapi/qapi-schema.json
> @@ -64,6 +64,7 @@
> { 'include': 'replay.json' }
> { 'include': 'yank.json' }
> { 'include': 'misc.json' }
> +{ 'include': 'mpam.json' }
> { 'include': 'misc-arm.json' }
> { 'include': 'misc-i386.json' }
> { 'include': 'audio.json' }
next prev parent reply other threads:[~2026-10-26 13:06 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20261016101058.1900808-1-2118537295@qq.com>
2026-10-16 10:10 ` [PATCH 18/37] hw/arm/virt: Reserve the MPAM MSC MMIO window Jinjie Ruan
2026-10-16 10:10 ` [PATCH 17/37] hw/arm/virt: Add mpam and mpam-min-msc machine properties Jinjie Ruan
2026-10-16 10:10 ` [PATCH 18/37] hw/arm/virt: Reserve the MPAM MSC MMIO window Jinjie Ruan
2026-10-16 10:10 ` [PATCH 19/37] hw/arm/mpam: Add node and interrupt GSIV properties Jinjie Ruan
2026-10-16 10:10 ` [PATCH 20/37] hw/arm/virt: Create memory-side MPAM MSCs Jinjie Ruan
2026-10-16 10:10 ` [PATCH 21/37] hw/arm/virt: Create L2/L3 cache " Jinjie Ruan
2026-10-16 10:10 ` [PATCH 22/37] hw/acpi: Add MPAM table MSC node builders Jinjie Ruan
2026-10-16 10:10 ` [PATCH 23/37] hw/acpi: Build the MPAM ACPI table Jinjie Ruan
2026-10-16 10:10 ` [PATCH 24/37] hw/arm/mpam: Add MSMON monitor selection and window configuration Jinjie Ruan
2026-10-16 10:10 ` [PATCH 25/37] hw/arm/mpam: Emulate MBWU bandwidth monitoring Jinjie Ruan
2026-10-16 10:10 ` [PATCH 26/37] hw/arm/mpam: Implement CMIN/CASSOC storage Jinjie Ruan
2026-10-16 10:10 ` [PATCH 27/37] hw/arm/mpam: Advertise PRI on memory-side MSCs Jinjie Ruan
2026-10-16 10:10 ` [PATCH 28/37] hw/arm/mpam: Emulate CSU cache-usage monitoring Jinjie Ruan
2026-10-16 10:10 ` [PATCH 29/37] hw/arm/virt: Size the cache MSC occupancy model by level Jinjie Ruan
2026-10-16 10:10 ` [PATCH 30/37] hw/arm/mpam: Handle ECR/ESR as MSC-global registers Jinjie Ruan
2026-10-16 10:10 ` [PATCH 31/37] hw/arm/mpam: Add device reset and power-on state initialisation Jinjie Ruan
2026-10-16 10:10 ` [PATCH 32/37] hw/arm/mpam: Add error and overflow interrupt outputs Jinjie Ruan
2026-10-16 10:10 ` [PATCH 33/37] hw/arm/mpam: Record errors and reject invalid configuration writes Jinjie Ruan
2026-10-16 10:10 ` [PATCH 34/37] hw/arm/virt: Wire MSC error and overflow interrupts to the GIC Jinjie Ruan
2026-10-16 10:10 ` [PATCH 35/37] hw/arm/virt: Default to implicit node 0 for MPAM without -numa Jinjie Ruan
2026-10-16 10:10 ` [PATCH 36/37] qapi: Add MPAM cache introspection schema and stub Jinjie Ruan
2026-10-26 13:05 ` Markus Armbruster [this message]
2026-10-27 7:20 ` Jinjie Ruan
2026-10-16 10:10 ` [PATCH 37/37] hw/arm/mpam: Implement query-mpam-cache Jinjie Ruan
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=87fqxs1uj6.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=2118537295@qq.com \
--cc=anisinha@redhat.com \
--cc=eblake@redhat.com \
--cc=imammedo@redhat.com \
--cc=michael.roth@amd.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=ruanjinjie@huawei.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.