From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67729218821 for ; Wed, 6 Aug 2025 07:45:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754466328; cv=none; b=U1hsyRtlhbxT95ixZatna+PLPuPdRRuRRL+VtQRXqWC9oCsgm7+HUVEM+nh6hsvMTB7CpVegDUDiUZjcY64RopZKHQ1UflGW5QYW1G72V1+p6nFjUcaqHNbZ1s3bMipsFJu8QrEQY52YyH5x3kyEqZUbAb7eSub1R/KCUZM6f2Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754466328; c=relaxed/simple; bh=RQQZCwrQ1fiKTnFzdS1YJ0uQn6ZEyvlCnnEpbtjIIG4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=mMDAzw54WYlLtWAQoxaLoT0/CDpp9P6aJ7iGz4np/II2BBeY/mC6w/onWOokfx3J2UWX5vL779rHIxxtD+42tjo/Lc82FuKH1bsjkd5W5vnQWKiCmrD1QHgpdKNEvw4KbBmr2MzPFYjNqO1R+QveSR4Y3UyzyA32y+ubd4aj5Q8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=G0COBkz/; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="G0COBkz/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754466323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sooN8WuM7O2jbxqRcl8D98tGoqGYnTOOmDPteNfeR3U=; b=G0COBkz/zTukNmeNZY/ULwjztKYfXm+jCVnbMUR3FbkoZJj/GihBjav2x8EebyJJUPxByK gXi0k56H5fdT8aknWwf14Qt+VRHjSZHyIsHDzvlrutoSBx0FxQOEFg/lBLmHZX0lvu3i4O VxZ7FqL01uA95902k6tf+XENvW2l6rA= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-404-tsJbwsEHNdaVTIU50_YHHg-1; Wed, 06 Aug 2025 03:45:18 -0400 X-MC-Unique: tsJbwsEHNdaVTIU50_YHHg-1 X-Mimecast-MFC-AGG-ID: tsJbwsEHNdaVTIU50_YHHg_1754466317 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8B4AD195608A; Wed, 6 Aug 2025 07:45:16 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.18]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4EA191800447; Wed, 6 Aug 2025 07:45:15 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 79AE921E6A27; Wed, 06 Aug 2025 09:45:12 +0200 (CEST) From: Markus Armbruster To: shiju.jose--- via Cc: , , , , , Subject: Re: [PATCH qemu v4 1/7] hw/cxl/events: Update for rev3.2 common event record format In-Reply-To: <20250721172228.2118-2-shiju.jose@huawei.com> (shiju jose's message of "Mon, 21 Jul 2025 18:22:22 +0100") References: <20250721172228.2118-1-shiju.jose@huawei.com> <20250721172228.2118-2-shiju.jose@huawei.com> Date: Wed, 06 Aug 2025 09:45:12 +0200 Message-ID: <87wm7gq4fr.fsf@pond.sub.org> User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 shiju.jose--- via writes: > From: Shiju Jose > > 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 > Signed-off-by: Shiju Jose [...] > 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.