From nobody Sat Nov 15 01:19:17 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1758118498; cv=none; d=zohomail.com; s=zohoarc; b=AfuoaDdIoVF8N5qTTG/MafISlTN8Y0bI3E96hpMmnEwnzRv1g3yvlRppx/KmiaJfbEzYzYmbJgIMi6DQN/+1nhM72/7qcBtMu62rzLW5lHnwQbQE9ZwqRQZhiyfN7sVQ0gmvLELaIz2xgZ8Mp9+p6fIQ3F1877+rtkTzFjF+wrM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758118498; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=bjaTTmj0Ac+qp/2BmnrPmsVq3fFs1dwMC6aAdlfZcWM=; b=kVKKuE5S78QYpaNVbcPvW/TKQNUTGYE8blw4fyGOjBEKmdI2mPuswAxGQeLSWPWIrJqvAp3H/G/o/+0+tol+N6AOU7hLnawzxpIgvpZBHWq+uNO9Mht5dhsOzIbiei064K2+ogvrnyi/MpGC1ExeHhO7KPfAorM1KdZZpdW7Fi0= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758118498044680.3522394632159; Wed, 17 Sep 2025 07:14:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uysvb-0007K9-3u; Wed, 17 Sep 2025 10:14:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uysvZ-0007JY-Dd for qemu-devel@nongnu.org; Wed, 17 Sep 2025 10:14:33 -0400 Received: from [185.176.79.56] (helo=frasgout.his.huawei.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uysvW-00006Z-LO for qemu-devel@nongnu.org; Wed, 17 Sep 2025 10:14:33 -0400 Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4cRgdH6R3Dz6L5Jd; Wed, 17 Sep 2025 22:09:55 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id 5DC881402EC; Wed, 17 Sep 2025 22:14:28 +0800 (CST) Received: from SecurePC-101-06.huawei.com (10.122.19.247) by frapeml500008.china.huawei.com (7.182.85.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 17 Sep 2025 16:14:27 +0200 To: Michael Tsirkin , , CC: , Fan Ni , , , Ravi Shankar Subject: [PATCH qemu for 10.2 1/5] qapi: cxl: Refactor CXL event injection for common commands arguments Date: Wed, 17 Sep 2025 15:13:51 +0100 Message-ID: <20250917141355.293217-2-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250917141355.293217-1-Jonathan.Cameron@huawei.com> References: <20250917141355.293217-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.122.19.247] X-ClientProxiedBy: lhrpeml100003.china.huawei.com (7.191.160.210) To frapeml500008.china.huawei.com (7.182.85.71) X-Host-Lookup-Failed: Reverse DNS lookup failed for 185.176.79.56 (deferred) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=185.176.79.56; envelope-from=jonathan.cameron@huawei.com; helo=frasgout.his.huawei.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Jonathan Cameron From: Jonathan Cameron via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1758118501248116600 Content-Type: text/plain; charset="utf-8" From: Shiju Jose Refactor CXL event injection to use struct for common command arguments. Suggested-by: Markus Armbruster Signed-off-by: Shiju Jose Signed-off-by: Jonathan Cameron --- qapi/cxl.json | 89 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 58 insertions(+), 31 deletions(-) diff --git a/qapi/cxl.json b/qapi/cxl.json index 52cc5d4f33..e8c5387cfd 100644 --- a/qapi/cxl.json +++ b/qapi/cxl.json @@ -31,11 +31,10 @@ } =20 ## -# @cxl-inject-general-media-event: +# @CXLCommonEventBase: # -# Inject an event record for a General Media Event (CXL r3.0 -# 8.2.9.2.1.1). This event type is reported via one of the event logs -# specified via the log parameter. +# Common event base for a CXL Event (CXL r3.0 8.2.9.2.1 +# Table 8-42 Common Event Record Format). # # @path: CXL type 3 device canonical QOM path # @@ -44,6 +43,16 @@ # @flags: Event Record Flags. See CXL r3.0 Table 8-42 Common Event # Record Format, Event Record Flags for subfield definitions. # +# Since: 8.1 +## +{ 'struct': 'CXLCommonEventBase', + 'data': { 'path': 'str', 'log': 'CxlEventLog', 'flags': 'uint8' } } + +## +# @CXLGeneralMediaEvent: +# +# Event record for a General Media Event (CXL r3.0 8.2.9.2.1.1). +# # @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. @@ -74,26 +83,29 @@ # # Since: 8.1 ## -{ 'command': 'cxl-inject-general-media-event', - 'data': { 'path': 'str', 'log': 'CxlEventLog', 'flags': 'uint8', - 'dpa': 'uint64', 'descriptor': 'uint8', +{ 'struct': 'CXLGeneralMediaEvent', + 'base': 'CXLCommonEventBase', + 'data': { 'dpa': 'uint64', 'descriptor': 'uint8', 'type': 'uint8', 'transaction-type': 'uint8', '*channel': 'uint8', '*rank': 'uint8', '*device': 'uint32', '*component-id': 'str' } } =20 ## -# @cxl-inject-dram-event: -# -# Inject an event record for a DRAM Event (CXL r3.0 8.2.9.2.1.2). -# This event type is reported via one of the event logs specified via -# the log parameter. +# @cxl-inject-general-media-event: # -# @path: CXL type 3 device canonical QOM path +# Inject an event record for a General Media Event (CXL r3.0 +# 8.2.9.2.1.1). This event type is reported via one of the event +# logs specified via the log parameter. # -# @log: Event log to add the event to +# Since: 8.1 +## +{ 'command': 'cxl-inject-general-media-event', + 'data': 'CXLGeneralMediaEvent' } + +## +# @CXLDRAMEvent: # -# @flags: Event Record Flags. See CXL r3.0 Table 8-42 Common Event -# Record Format, Event Record Flags for subfield definitions. +# Event record for a DRAM Event (CXL r3.0 8.2.9.2.1.2). # # @dpa: Device Physical Address (relative to @path device). Note # lower bits include some flags. See CXL r3.0 Table 8-44 DRAM @@ -133,9 +145,9 @@ # # Since: 8.1 ## -{ 'command': 'cxl-inject-dram-event', - 'data': { 'path': 'str', 'log': 'CxlEventLog', 'flags': 'uint8', - 'dpa': 'uint64', 'descriptor': 'uint8', +{ 'struct': 'CXLDRAMEvent', + 'base': 'CXLCommonEventBase', + 'data': { 'dpa': 'uint64', 'descriptor': 'uint8', 'type': 'uint8', 'transaction-type': 'uint8', '*channel': 'uint8', '*rank': 'uint8', '*nibble-mask': 'uint32= ', '*bank-group': 'uint8', '*bank': 'uint8', '*row': 'uint32', @@ -143,18 +155,21 @@ }} =20 ## -# @cxl-inject-memory-module-event: +# @cxl-inject-dram-event: # -# Inject an event record for a Memory Module Event (CXL r3.0 -# 8.2.9.2.1.3). This event includes a copy of the Device Health info -# at the time of the event. +# Inject an event record for a DRAM Event (CXL r3.0 8.2.9.2.1.2). +# This event type is reported via one of the event logs +# specified via the log parameter. # -# @path: CXL type 3 device canonical QOM path +# Since: 8.1 +## +{ 'command': 'cxl-inject-dram-event', + 'data': 'CXLDRAMEvent' } + +## +# @CXLMemModuleEvent: # -# @log: Event Log to add the event to -# -# @flags: Event Record Flags. See CXL r3.0 Table 8-42 Common Event -# Record Format, Event Record Flags for subfield definitions. +# Event record for a Memory Module Event (CXL r3.0 8.2.9.2.1.3). # # @type: Device Event Type. See CXL r3.0 Table 8-45 Memory Module # Event Record for bit definitions for bit definiions. @@ -185,9 +200,9 @@ # # Since: 8.1 ## -{ 'command': 'cxl-inject-memory-module-event', - 'data': { 'path': 'str', 'log': 'CxlEventLog', 'flags' : 'uint8', - 'type': 'uint8', 'health-status': 'uint8', +{ 'struct': 'CXLMemModuleEvent', + 'base': 'CXLCommonEventBase', + 'data': { 'type': 'uint8', 'health-status': 'uint8', 'media-status': 'uint8', 'additional-status': 'uint8', 'life-used': 'uint8', 'temperature' : 'int16', 'dirty-shutdown-count': 'uint32', @@ -195,6 +210,18 @@ 'corrected-persistent-error-count': 'uint32' }} =20 +## +# @cxl-inject-memory-module-event: +# +# Inject an event record for a DRAM Event (CXL r3.0 8.2.9.2.1.3) +# This event type is reported via one of the event logs +# specified via the log parameter. +# +# Since: 8.1 +## +{ 'command': 'cxl-inject-memory-module-event', + 'data': 'CXLMemModuleEvent' } + ## # @cxl-inject-poison: # --=20 2.48.1