From: Markus Armbruster <armbru@redhat.com>
To: shiju.jose--- via <qemu-devel@nongnu.org>
Cc: <linux-cxl@vger.kernel.org>, <jonathan.cameron@huawei.com>,
<fan.ni@samsung.com>, <dave@stgolabs.net>,
<shiju.jose@huawei.com>, <linuxarm@huawei.com>
Subject: Re: [PATCH qemu v4 1/7] hw/cxl/events: Update for rev3.2 common event record format
Date: Wed, 06 Aug 2025 09:45:12 +0200 [thread overview]
Message-ID: <87wm7gq4fr.fsf@pond.sub.org> (raw)
In-Reply-To: <20250721172228.2118-2-shiju.jose@huawei.com> (shiju jose's message of "Mon, 21 Jul 2025 18:22:22 +0100")
shiju.jose--- via <qemu-devel@nongnu.org> writes:
> From: Shiju Jose <shiju.jose@huawei.com>
>
> CXL spec 3.2 section 8.2.9.2.1 Table 8-55, Common Event Record
> format has updated with optional Maintenance Operation Subclass,
> LD ID and ID of the device head information.
>
> Add updates for the above optional parameters in the related
> CXL events reporting and in the QMP commands to inject CXL events.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
[...]
> diff --git a/qapi/cxl.json b/qapi/cxl.json
> index 8f2e9237b1..c1fe8319c8 100644
> --- a/qapi/cxl.json
> +++ b/qapi/cxl.json
> @@ -42,6 +42,18 @@
> # @flags: Event Record Flags. See CXL r3.0 Table 8-42 Common Event
> # Record Format, Event Record Flags for subfield definitions.
> #
> +# @maint-op-class: Maintenance operation class the device requests to initiate.
> +# See CXL r3.2 Table 8-55 Common Event Record Format.
> +#
> +# @maint-op-subclass: Maintenance operation subclass the device requests to
> +# initiate. See CXL r3.2 Table 8-55 Common Event Record Format.
> +#
> +# @ld-id: LD ID of LD from where the event originated.
> +# See CXL r3.2 Table 8-55 Common Event Record Format.
> +#
> +# @head-id: ID of the device head from where the event originated.
> +# See CXL r3.2 Table 8-55 Common Event Record Format.
> +#
> # @dpa: Device Physical Address (relative to @path device). Note
> # lower bits include some flags. See CXL r3.0 Table 8-43 General
> # Media Event Record, Physical Address.
From docs/devel/qapi-code-gen.rst:
For legibility, wrap text paragraphs so every line is at most 70
characters long.
Separate sentences with two spaces.
> @@ -73,7 +85,9 @@
> # Since: 8.1
> ##
> { 'command': 'cxl-inject-general-media-event',
> - 'data': { 'path': 'str', 'log': 'CxlEventLog', 'flags': 'uint8',
> + 'data': { 'path': 'str', 'log': 'CxlEventLog', 'flags': 'uint32',
> + '*maint-op-class':'uint8', '*maint-op-subclass':'uint8',
> + '*ld-id':'uint16', '*head-id':'uint8',
> 'dpa': 'uint64', 'descriptor': 'uint8',
> 'type': 'uint8', 'transaction-type': 'uint8',
> '*channel': 'uint8', '*rank': 'uint8',
> @@ -93,6 +107,18 @@
> # @flags: Event Record Flags. See CXL r3.0 Table 8-42 Common Event
> # Record Format, Event Record Flags for subfield definitions.
> #
> +# @maint-op-class: Maintenance operation class the device requests to initiate.
> +# See CXL r3.2 Table 8-55 Common Event Record Format.
> +#
> +# @maint-op-subclass: Maintenance operation subclass the device requests to
> +# initiate. See CXL r3.2 Table 8-55 Common Event Record Format.
> +#
> +# @ld-id: LD ID of LD from where the event originated.
> +# See CXL r3.2 Table 8-55 Common Event Record Format.
> +#
> +# @head-id: ID of the device head from where the event originated.
> +# See CXL r3.2 Table 8-55 Common Event Record Format.
> +#
> # @dpa: Device Physical Address (relative to @path device). Note
> # lower bits include some flags. See CXL r3.0 Table 8-44 DRAM
> # Event Record, Physical Address.
> @@ -132,7 +158,9 @@
> # Since: 8.1
> ##
> { 'command': 'cxl-inject-dram-event',
> - 'data': { 'path': 'str', 'log': 'CxlEventLog', 'flags': 'uint8',
> + 'data': { 'path': 'str', 'log': 'CxlEventLog', 'flags': 'uint32',
> + '*maint-op-class':'uint8', '*maint-op-subclass':'uint8',
> + '*ld-id':'uint16', '*head-id':'uint8',
> 'dpa': 'uint64', 'descriptor': 'uint8',
> 'type': 'uint8', 'transaction-type': 'uint8',
> '*channel': 'uint8', '*rank': 'uint8', '*nibble-mask': 'uint32',
> @@ -154,6 +182,18 @@
> # @flags: Event Record Flags. See CXL r3.0 Table 8-42 Common Event
> # Record Format, Event Record Flags for subfield definitions.
> #
> +# @maint-op-class: Maintenance operation class the device requests to initiate.
> +# See CXL r3.2 Table 8-55 Common Event Record Format.
> +#
> +# @maint-op-subclass: Maintenance operation subclass the device requests to
> +# initiate. See CXL r3.2 Table 8-55 Common Event Record Format.
> +#
> +# @ld-id: LD ID of LD from where the event originated.
> +# See CXL r3.2 Table 8-55 Common Event Record Format.
> +#
> +# @head-id: ID of the device head from where the event originated.
> +# See CXL r3.2 Table 8-55 Common Event Record Format.
> +#
> # @type: Device Event Type. See CXL r3.0 Table 8-45 Memory Module
> # Event Record for bit definitions for bit definiions.
> #
> @@ -184,7 +224,9 @@
> # Since: 8.1
> ##
> { 'command': 'cxl-inject-memory-module-event',
> - 'data': { 'path': 'str', 'log': 'CxlEventLog', 'flags' : 'uint8',
> + 'data': { 'path': 'str', 'log': 'CxlEventLog', 'flags' : 'uint32',
> + '*maint-op-class':'uint8', '*maint-op-subclass':'uint8',
> + '*ld-id':'uint16', '*head-id':'uint8',
> 'type': 'uint8', 'health-status': 'uint8',
> 'media-status': 'uint8', 'additional-status': 'uint8',
> 'life-used': 'uint8', 'temperature' : 'int16',
This adds identical copies to three commands.
You can factor out common command arguments as follows.
1. Switch commands from implicit to explicit argument type.
{ 'command': 'cmd1', 'data': { ARGS1... } ... }
becomes
{ 'struct': 'Args1', 'data': { ARGS1... } }
{ 'command': 'cmd1', 'data': 'Args1' ... }
2. Factor common base out of the argument types.
{ 'struct': 'Args1', 'data': { COMMON-ARGS..., SPECIAL-ARGS1... } }
becomes
{ 'struct': 'Base, 'data': { COMMON-ARGS... } }
{ 'struct': 'Args1', 'base': 'Base', 'data': { SPECIAL-ARGS1... } }
3. Maybe use 'boxed': true with commands.
The C function generated for a command with many arguments can be
rather unwieldy. 'boxed': true makes it take the arguments as a
single struct type instead.
This is not a demand. Just give it a thought.
next prev parent reply other threads:[~2025-08-06 7:45 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-21 17:22 [PATCH qemu v4 0/7] hw/cxl: Update CXL events to rev3.2 and add maintenance support for memory repair features shiju.jose
2025-07-21 17:22 ` shiju.jose--- via
2025-07-21 17:22 ` [PATCH qemu v4 1/7] hw/cxl/events: Update for rev3.2 common event record format shiju.jose
2025-07-21 17:22 ` shiju.jose--- via
2025-07-25 12:45 ` Jonathan Cameron
2025-07-25 12:45 ` Jonathan Cameron via
2025-08-06 7:45 ` Markus Armbruster [this message]
2025-07-21 17:22 ` [PATCH qemu v4 2/7] hw/cxl/events: Updates for rev3.2 general media event record shiju.jose
2025-07-21 17:22 ` shiju.jose--- via
2025-08-06 7:57 ` Markus Armbruster
2025-08-06 9:21 ` Shiju Jose
2025-08-06 9:21 ` Shiju Jose via
2025-08-06 10:23 ` Markus Armbruster
2025-07-21 17:22 ` [PATCH qemu v4 3/7] hw/cxl/events: Updates for rev3.2 DRAM " shiju.jose
2025-07-21 17:22 ` shiju.jose--- via
2025-08-06 8:05 ` Markus Armbruster
2025-07-21 17:22 ` [PATCH qemu v4 4/7] hw/cxl/events: Updates for rev3.2 memory module " shiju.jose
2025-07-21 17:22 ` shiju.jose--- via
2025-08-06 8:08 ` Markus Armbruster
2025-07-21 17:22 ` [PATCH qemu v4 5/7] hw/cxl/cxl-mailbox-utils: Move declaration of scrub and ECS feature attributes in cmd_features_set_feature() shiju.jose
2025-07-21 17:22 ` shiju.jose--- via
2025-07-21 17:22 ` [PATCH qemu v4 6/7] hw/cxl: Add Maintenance support shiju.jose
2025-07-21 17:22 ` shiju.jose--- via
2025-07-25 13:26 ` Jonathan Cameron
2025-07-25 13:26 ` Jonathan Cameron via
2025-07-21 17:22 ` [PATCH qemu v4 7/7] hw/cxl: Add emulation for memory sparing control feature shiju.jose
2025-07-21 17:22 ` shiju.jose--- via
2025-07-25 13:31 ` Jonathan Cameron
2025-07-25 13:31 ` Jonathan Cameron via
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=87wm7gq4fr.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=dave@stgolabs.net \
--cc=fan.ni@samsung.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=qemu-devel@nongnu.org \
--cc=shiju.jose@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.