From nobody Sun Apr 12 02:49:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1771770581; cv=none; d=zohomail.com; s=zohoarc; b=WlC9pqGc28FIklU5xPhqY9jSsQek3wieMi3rCn9qbcJjYQ/VUGDx8APSf1fjf2bknc12VxjZJNMTzqgPFTzqNl8mVjOHtypDYzrvjEY4O44YDlbxbNcrP8MXQmkhMTwZcRdu1UOxv30XN0FjQWI0mgxe7keQhD7CBLTPtv+IM/w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771770581; h=Content-Type: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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Lh5AtZWWoRDP1dtYN9KUI+XYGg3AtIkXQ6gc+MiG9fI=; b=G+B4PG7zvoSNnXGJSZRzak5kUETd5kuRMsvCYXaeMbJbmJtTmFfOi8plCsJmTVJfZF+DTuDum0Km3nESNLVXT+meUH50QNoz+1d5ZybhbrEGpNXki0mylezOhr/wMLLP6EAjVFj1rR+9AOXicJWWb+FA7C5tP5zH7bieFbut5vM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177177058189648.034671072432616; Sun, 22 Feb 2026 06:29:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vuASJ-000890-L8; Sun, 22 Feb 2026 09:29:07 -0500 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 1vuARt-0007zU-R4 for qemu-devel@nongnu.org; Sun, 22 Feb 2026 09:28:42 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vuARr-0006gC-L4 for qemu-devel@nongnu.org; Sun, 22 Feb 2026 09:28:41 -0500 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-126-BeDsRQxyMS-356V3o_4Ohg-1; Sun, 22 Feb 2026 09:28:37 -0500 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4837b9913c9so37782455e9.0 for ; Sun, 22 Feb 2026 06:28:36 -0800 (PST) Received: from redhat.com (IGLD-80-230-79-166.inter.net.il. [80.230.79.166]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483a4e869a3sm116744085e9.1.2026.02.22.06.28.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Feb 2026 06:28:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1771770519; 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=Lh5AtZWWoRDP1dtYN9KUI+XYGg3AtIkXQ6gc+MiG9fI=; b=JkkroC21P5Vfe6tfURzoA8/K/5+jBB+naSMF1HQkOCH+e+x2cpDmHOAHJ06HBUfrBUpknM qMxfMDzdWOO2H45VwuaLmUxT4Mis4w7lyC6FXS/klt4nHLIhAhFgG4ALqgRQdUIgzAqh/3 5L3P04gfDo1hbhDouugwJTR9O+NdQ0Y= X-MC-Unique: BeDsRQxyMS-356V3o_4Ohg-1 X-Mimecast-MFC-AGG-ID: BeDsRQxyMS-356V3o_4Ohg_1771770516 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1771770515; x=1772375315; darn=nongnu.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Lh5AtZWWoRDP1dtYN9KUI+XYGg3AtIkXQ6gc+MiG9fI=; b=oz1JQq2XAXgjNvePmD7jPjQJtX2XAIcz+pdUgEWiRJktUyFkB8sCAvhhnV7akfOuTQ QRjo5jO6FQzTj2nm5wVIvtjoaO1OhM6yYEtdg1hMc+z9rtoV1wk5bmfsZPio8UjCx6uT mJ+tbt5ytu39QGuv1TLT8FwlqIoUQERT1h3yA2PuPesGx+08x3yVxLLwkzJZ9gvug7r3 7MfGKhMal9eXx9me/npV2F0DKGpxHw07faD3RJ/+0Y4qcTpxx2BPtyMjtNJzZFYpQMy2 tX4RAwylGWPbv7VXR6tD+WEIIfe/56cpyzrnf91EC7jhJwObuq0+rXnppSgWXPj64VnT C5MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771770515; x=1772375315; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Lh5AtZWWoRDP1dtYN9KUI+XYGg3AtIkXQ6gc+MiG9fI=; b=LP1QOlQhmFhNJLY3umyyE8kZGaWT0Y+a7GBbiy58b3idRt0aJVTd8QLQKZ9XXRlqio F3uPRO3Kf/fw2B/U4rqWCOHNXmIWGNRtiCxXCvBFyaJEGMh42lBvwHwDj7Esqs4q0Ntv bMMHUVRdv56gzIdoXmaWg3qQqkicDmesmuCA72nGdNMIrQBYtA8hi7CF6qetToTU93yY waeyLfTI6ZQI/fN69iSq1fLZy6XGx0ioIRBY4HW+n2ccamdWPW8TrZ1QVWjz5h9YUrFU csVIOHPlbUQIeTkQVhPqJgl4/qf/6S2rmmLr11itqU0SiKVoQMdJ7dhnlXYCWo4rd3Ig CG+g== X-Gm-Message-State: AOJu0YwYGvZG6+NRO3jlVpIndipIIy1NorEUh184SSRZFSOrFIDd7BGZ S8B8j5M+H1Eg8IB3TwCvIL6n593LEDgK1qbKBTf1crWTfARRIyYtG7cJW1qlWblWqlegKy4TY5v jRCHcZIGqByb4UajHA1N5Wc85MzqanPT+fp4HMEYau4r7OA2sYRsz/5oxICu9v08L15n8nAvfPy I/mCGK5gPWnD6nhn1EgSSIJRS+wguoT5PR5Q== X-Gm-Gg: AZuq6aJetkJitVML5VKmTyhFUdfyt+PlW3XQXKaRS/aWIW011OnC+S/Cc+30ObP43AM QAIgiwXY0cAoSOUHE9++f9kEQAQVWykm+SWJNZBH3gGteudXMMJ189JwPpnz9RAuMzQztE/azGn IWj62gKkemRpQxVg4adnbQDQwtTVWNfBfwh1wGoukBjqkophs16qDtdcQ9locuEZ2AhclH+M3Wx XQ9zm3kSzKB3gHCIguuF1mdr6816b31k/Mc+VJVaSKHg2bl16OPYPmuykMaTH0R9HYt8aLC6pvv U8BtbYZttYhWj0ahMv14QZ3jc6CuR9UgcsiFeQu4fhFC/AFS2MchRohFYM7CGkNIPg+/PyaKHuJ qvhbh4RmcXUvNdlo0y/7BJYysxC/MSl4LfOIXIyyYu9UH1Q== X-Received: by 2002:a05:600c:1c22:b0:483:79ad:f3b9 with SMTP id 5b1f17b1804b1-483a95eada4mr99682655e9.28.1771770515276; Sun, 22 Feb 2026 06:28:35 -0800 (PST) X-Received: by 2002:a05:600c:1c22:b0:483:79ad:f3b9 with SMTP id 5b1f17b1804b1-483a95eada4mr99682025e9.28.1771770514716; Sun, 22 Feb 2026 06:28:34 -0800 (PST) Date: Sun, 22 Feb 2026 09:28:32 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Shiju Jose , Markus Armbruster , Ravi Jonnalagadda , Jonathan Cameron , Fan Ni , Eric Blake Subject: [PULL 08/33] hw/cxl/events: Update for rev3.2 common event record format Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.798, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.79, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1771770584856154100 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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. Update all related specification references to CXL r3.2 to ensure one consistent source. Signed-off-by: Shiju Jose Acked-by: Markus Armbruster Reviewed-by: Ravi Jonnalagadda Signed-off-by: Jonathan Cameron Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Message-Id: <20260205112350.60681-3-Jonathan.Cameron@huawei.com> --- hw/cxl/cxl-events.c | 3 +- hw/cxl/cxl-mailbox-utils.c | 3 +- hw/mem/cxl_type3.c | 70 ++++++++++++++++++++++++++++++++----- hw/mem/cxl_type3_stubs.c | 24 +++++++++++-- include/hw/cxl/cxl_device.h | 7 +++- include/hw/cxl/cxl_events.h | 15 ++++++-- qapi/cxl.json | 21 ++++++++--- 7 files changed, 122 insertions(+), 21 deletions(-) diff --git a/hw/cxl/cxl-events.c b/hw/cxl/cxl-events.c index 7583dd9162..5356dfb5b3 100644 --- a/hw/cxl/cxl-events.c +++ b/hw/cxl/cxl-events.c @@ -271,7 +271,8 @@ void cxl_create_dc_event_records_for_extents(CXLType3De= v *ct3d, &dynamic_capacity_uuid, (1 << CXL_EVENT_TYPE_INFO), sizeof(event_rec), - cxl_device_get_timestamp(&ct3d->cxl_dstate)); + cxl_device_get_timestamp(&ct3d->cxl_dstate), + 0, 0, 0, 0, 0, 0, 0, 0); event_rec.type =3D type; event_rec.validity_flags =3D 1; event_rec.host_id =3D 0; diff --git a/hw/cxl/cxl-mailbox-utils.c b/hw/cxl/cxl-mailbox-utils.c index 9b99d44a80..125f417aa4 100644 --- a/hw/cxl/cxl-mailbox-utils.c +++ b/hw/cxl/cxl-mailbox-utils.c @@ -3463,7 +3463,8 @@ static CXLRetCode cmd_fm_set_dc_region_config(const s= truct cxl_cmd *cmd, &dynamic_capacity_uuid, (1 << CXL_EVENT_TYPE_INFO), sizeof(dcEvent), - cxl_device_get_timestamp(&ct3d->cxl_dstate)); + cxl_device_get_timestamp(&ct3d->cxl_dstate), + 0, 0, 0, 0, 0, 0, 0, 0); dcEvent.type =3D DC_EVENT_REGION_CONFIG_UPDATED; dcEvent.validity_flags =3D 1; dcEvent.host_id =3D 0; diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c index 6eb20137a0..371bd4dc6a 100644 --- a/hw/mem/cxl_type3.c +++ b/hw/mem/cxl_type3.c @@ -1592,12 +1592,39 @@ void qmp_cxl_inject_correctable_error(const char *p= ath, CxlCorErrorType type, =20 void cxl_assign_event_header(CXLEventRecordHdr *hdr, const QemuUUID *uuid, uint32_t flags, - uint8_t length, uint64_t timestamp) + uint8_t length, uint64_t timestamp, + bool has_maint_op_class, uint8_t maint_op_cla= ss, + bool has_maint_op_subclass, + uint8_t maint_op_subclass, + bool has_ld_id, uint16_t ld_id, + bool has_head_id, uint8_t head_id) { - st24_le_p(&hdr->flags, flags); hdr->length =3D length; memcpy(&hdr->id, uuid, sizeof(hdr->id)); stq_le_p(&hdr->timestamp, timestamp); + + if (has_maint_op_class) { + hdr->maint_op_class =3D maint_op_class; + } else { + hdr->maint_op_class =3D 0; + } + + if (has_maint_op_subclass) { + flags |=3D CXL_EVENT_REC_FLAGS_MAINT_OP_SUBCLASS_VALID; + hdr->maint_op_subclass =3D maint_op_subclass; + } + + if (has_ld_id) { + flags |=3D CXL_EVENT_REC_FLAGS_LD_ID_VALID; + stw_le_p(&hdr->ld_id, ld_id); + } + + if (has_head_id) { + flags |=3D CXL_EVENT_REC_FLAGS_HEAD_ID_VALID; + hdr->head_id =3D head_id; + } + + st24_le_p(&hdr->flags, flags); } =20 static const QemuUUID gen_media_uuid =3D { @@ -1637,7 +1664,13 @@ static int ct3d_qmp_cxl_event_log_enc(CxlEventLog lo= g) } /* Component ID is device specific. Define this as a string. */ void qmp_cxl_inject_general_media_event(const char *path, CxlEventLog log, - uint8_t flags, uint64_t dpa, + uint32_t flags, bool has_maint_op_= class, + uint8_t maint_op_class, + bool has_maint_op_subclass, + uint8_t maint_op_subclass, + bool has_ld_id, uint16_t ld_id, + bool has_head_id, uint8_t head_id, + uint64_t dpa, uint8_t descriptor, uint8_t type, uint8_t transaction_type, bool has_channel, uint8_t channel, @@ -1675,7 +1708,10 @@ void qmp_cxl_inject_general_media_event(const char *= path, CxlEventLog log, =20 memset(&gem, 0, sizeof(gem)); cxl_assign_event_header(hdr, &gen_media_uuid, flags, sizeof(gem), - cxl_device_get_timestamp(&ct3d->cxl_dstate)); + cxl_device_get_timestamp(&ct3d->cxl_dstate), + has_maint_op_class, maint_op_class, + has_maint_op_subclass, maint_op_subclass, + has_ld_id, ld_id, has_head_id, head_id); =20 stq_le_p(&gem.phys_addr, dpa); gem.descriptor =3D descriptor; @@ -1719,7 +1755,13 @@ void qmp_cxl_inject_general_media_event(const char *= path, CxlEventLog log, #define CXL_DRAM_VALID_COLUMN BIT(6) #define CXL_DRAM_VALID_CORRECTION_MASK BIT(7) =20 -void qmp_cxl_inject_dram_event(const char *path, CxlEventLog log, uint8_t = flags, +void qmp_cxl_inject_dram_event(const char *path, CxlEventLog log, + uint32_t flags, + bool has_maint_op_class, uint8_t maint_op_c= lass, + bool has_maint_op_subclass, + uint8_t maint_op_subclass, + bool has_ld_id, uint16_t ld_id, + bool has_head_id, uint8_t head_id, uint64_t dpa, uint8_t descriptor, uint8_t type, uint8_t transaction_type, bool has_channel, uint8_t channel, @@ -1762,7 +1804,10 @@ void qmp_cxl_inject_dram_event(const char *path, Cxl= EventLog log, uint8_t flags, =20 memset(&dram, 0, sizeof(dram)); cxl_assign_event_header(hdr, &dram_uuid, flags, sizeof(dram), - cxl_device_get_timestamp(&ct3d->cxl_dstate)); + cxl_device_get_timestamp(&ct3d->cxl_dstate), + has_maint_op_class, maint_op_class, + has_maint_op_subclass, maint_op_subclass, + has_ld_id, ld_id, has_head_id, head_id); stq_le_p(&dram.phys_addr, dpa); dram.descriptor =3D descriptor; dram.type =3D type; @@ -1822,7 +1867,13 @@ void qmp_cxl_inject_dram_event(const char *path, Cxl= EventLog log, uint8_t flags, } =20 void qmp_cxl_inject_memory_module_event(const char *path, CxlEventLog log, - uint8_t flags, uint8_t type, + uint32_t flags, bool has_maint_op_= class, + uint8_t maint_op_class, + bool has_maint_op_subclass, + uint8_t maint_op_subclass, + bool has_ld_id, uint16_t ld_id, + bool has_head_id, uint8_t head_id, + uint8_t type, uint8_t health_status, uint8_t media_status, uint8_t additional_status, @@ -1861,7 +1912,10 @@ void qmp_cxl_inject_memory_module_event(const char *= path, CxlEventLog log, =20 memset(&module, 0, sizeof(module)); cxl_assign_event_header(hdr, &memory_module_uuid, flags, sizeof(module= ), - cxl_device_get_timestamp(&ct3d->cxl_dstate)); + cxl_device_get_timestamp(&ct3d->cxl_dstate), + has_maint_op_class, maint_op_class, + has_maint_op_subclass, maint_op_subclass, + has_ld_id, ld_id, has_head_id, head_id); =20 module.type =3D type; module.health_status =3D health_status; diff --git a/hw/mem/cxl_type3_stubs.c b/hw/mem/cxl_type3_stubs.c index c1a5e4a7c1..91b1478114 100644 --- a/hw/mem/cxl_type3_stubs.c +++ b/hw/mem/cxl_type3_stubs.c @@ -14,7 +14,13 @@ #include "qapi/qapi-commands-cxl.h" =20 void qmp_cxl_inject_general_media_event(const char *path, CxlEventLog log, - uint8_t flags, uint64_t dpa, + uint32_t flags, bool has_maint_op_= class, + uint8_t maint_op_class, + bool has_maint_op_subclass, + uint8_t maint_op_subclass, + bool has_ld_id, uint16_t ld_id, + bool has_head_id, uint8_t head_id, + uint64_t dpa, uint8_t descriptor, uint8_t type, uint8_t transaction_type, bool has_channel, uint8_t channel, @@ -23,7 +29,13 @@ void qmp_cxl_inject_general_media_event(const char *path= , CxlEventLog log, const char *component_id, Error **errp) {} =20 -void qmp_cxl_inject_dram_event(const char *path, CxlEventLog log, uint8_t = flags, +void qmp_cxl_inject_dram_event(const char *path, CxlEventLog log, + uint32_t flags, + bool has_maint_op_class, uint8_t maint_op_c= lass, + bool has_maint_op_subclass, + uint8_t maint_op_subclass, + bool has_ld_id, uint16_t ld_id, + bool has_head_id, uint8_t head_id, uint64_t dpa, uint8_t descriptor, uint8_t type, uint8_t transaction_type, bool has_channel, uint8_t channel, @@ -38,7 +50,13 @@ void qmp_cxl_inject_dram_event(const char *path, CxlEven= tLog log, uint8_t flags, Error **errp) {} =20 void qmp_cxl_inject_memory_module_event(const char *path, CxlEventLog log, - uint8_t flags, uint8_t type, + uint32_t flags, bool has_maint_op_= class, + uint8_t maint_op_class, + bool has_maint_op_subclass, + uint8_t maint_op_subclass, + bool has_ld_id, uint16_t ld_id, + bool has_head_id, uint8_t head_id, + uint8_t type, uint8_t health_status, uint8_t media_status, uint8_t additional_status, diff --git a/include/hw/cxl/cxl_device.h b/include/hw/cxl/cxl_device.h index 165355baf9..e461a824b6 100644 --- a/include/hw/cxl/cxl_device.h +++ b/include/hw/cxl/cxl_device.h @@ -723,7 +723,12 @@ bool ct3_test_region_block_backed(CXLType3Dev *ct3d, u= int64_t dpa, uint64_t len); void cxl_assign_event_header(CXLEventRecordHdr *hdr, const QemuUUID *uuid, uint32_t flags, - uint8_t length, uint64_t timestamp); + uint8_t length, uint64_t timestamp, + bool has_maint_op_class, uint8_t maint_op_cla= ss, + bool has_maint_op_subclass, + uint8_t maint_op_subclass, + bool has_ld_id, uint16_t ld_id, + bool has_head_id, uint8_t head_id); void cxl_create_dc_event_records_for_extents(CXLType3Dev *ct3d, CXLDCEventType type, CXLDCExtentRaw extents[], diff --git a/include/hw/cxl/cxl_events.h b/include/hw/cxl/cxl_events.h index 758b075a64..4d9cfdb621 100644 --- a/include/hw/cxl/cxl_events.h +++ b/include/hw/cxl/cxl_events.h @@ -29,9 +29,15 @@ typedef enum CXLEventLogType { =20 /* * Common Event Record Format - * CXL r3.1 section 8.2.9.2.1: Event Records; Table 8-43 + * CXL r3.2 section 8.2.10.2.1: Event Records; Table 8-55 */ -#define CXL_EVENT_REC_HDR_RES_LEN 0xf +#define CXL_EVENT_REC_FLAGS_PERMANENT_COND BIT(2) +#define CXL_EVENT_REC_FLAGS_MAINT_NEEDED BIT(3) +#define CXL_EVENT_REC_FLAGS_PERF_DEGRADED BIT(4) +#define CXL_EVENT_REC_FLAGS_HW_REPLACEMENT_NEEDED BIT(5) +#define CXL_EVENT_REC_FLAGS_MAINT_OP_SUBCLASS_VALID BIT(6) +#define CXL_EVENT_REC_FLAGS_LD_ID_VALID BIT(7) +#define CXL_EVENT_REC_FLAGS_HEAD_ID_VALID BIT(8) typedef struct CXLEventRecordHdr { QemuUUID id; uint8_t length; @@ -40,7 +46,10 @@ typedef struct CXLEventRecordHdr { uint16_t related_handle; uint64_t timestamp; uint8_t maint_op_class; - uint8_t reserved[CXL_EVENT_REC_HDR_RES_LEN]; + uint8_t maint_op_subclass; + uint16_t ld_id; + uint8_t head_id; + uint8_t reserved[0xb]; } QEMU_PACKED CXLEventRecordHdr; =20 #define CXL_EVENT_RECORD_DATA_LENGTH 0x50 diff --git a/qapi/cxl.json b/qapi/cxl.json index 55a088586e..82001c0591 100644 --- a/qapi/cxl.json +++ b/qapi/cxl.json @@ -33,20 +33,33 @@ ## # @CXLCommonEventBase: # -# Common event base for a CXL Event (CXL r3.0 8.2.9.2.1 -# Table 8-42 Common Event Record Format). +# Common event base for a CXL Event (CXL r3.2 8.2.10.2.1 +# Table 8-55 Common Event Record Format). # # @path: CXL type 3 device canonical QOM path # # @log: event log to add the event to # -# @flags: Event Record Flags. See CXL r3.0 Table 8-42 Common Event +# @flags: Event Record Flags. See CXL r3.2 Table 8-55 Common Event # Record Format, Event Record Flags for subfield definitions. # +# @maint-op-class: Maintenance operation class the device requests to +# initiate. +# +# @maint-op-subclass: Maintenance operation subclass the device +# requests to initiate. +# +# @ld-id: Logical Device (LD) ID of LD from where the event +# originated. +# +# @head-id: ID of the device head from where the event originated. +# # Since: 8.1 ## { 'struct': 'CXLCommonEventBase', - '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' } } =20 ## # @CXLGeneralMediaEvent: --=20 MST