Linux CXL
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: <mst@redhat.com>, <qemu-devel@nongnu.org>
Cc: Dmitry Frolov <frolov@swemel.ru>,
	Ajay Joshi <ajay.opensrc@micron.com>,
	Yao Xingtao <yaoxt.fnst@fujitsu.com>, Fan Ni <fan.ni@samsung.com>,
	Shiju Jose <shiju.jose@huawei.com>, <linux-cxl@vger.kernel.org>,
	<linuxarm@huawei.com>
Subject: [PATCH qemu 4/7] hw/mem/cxl_type3: Fix More flag setting for dynamic capacity event records
Date: Mon, 14 Oct 2024 13:18:59 +0100	[thread overview]
Message-ID: <20241014121902.2146424-5-Jonathan.Cameron@huawei.com> (raw)
In-Reply-To: <20241014121902.2146424-1-Jonathan.Cameron@huawei.com>

From: Fan Ni <fan.ni@samsung.com>

Per cxl spec r3.1, for multiple dynamic capacity event records grouped via
the More flag, the last record in the sequence should clear the More flag.

Before the change, the More flag of the event record is cleared before
the loop of inserting records into the event log, which will leave the flag
always set once it is set in the loop.

Fixes: d0b9b28a5b9f ("hw/cxl/events: Add qmp interfaces to add/release dynamic capacity extents")
Signed-off-by: Fan Ni <fan.ni@samsung.com>
Link: https://lore.kernel.org/r/20240827164304.88876-2-nifan.cxl@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 hw/mem/cxl_type3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c
index 16c60b9b0d..6911d13fe6 100644
--- a/hw/mem/cxl_type3.c
+++ b/hw/mem/cxl_type3.c
@@ -2064,11 +2064,11 @@ static void qmp_cxl_process_dynamic_capacity_prescriptive(const char *path,
     stw_le_p(&dCap.host_id, hid);
     /* only valid for DC_REGION_CONFIG_UPDATED event */
     dCap.updated_region_id = 0;
-    dCap.flags = 0;
     for (i = 0; i < num_extents; i++) {
         memcpy(&dCap.dynamic_capacity_extent, &extents[i],
                sizeof(CXLDCExtentRaw));
 
+        dCap.flags = 0;
         if (i < num_extents - 1) {
             /* Set "More" flag */
             dCap.flags |= BIT(0);
-- 
2.43.0


  parent reply	other threads:[~2024-10-14 12:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14 12:18 [PATCH 0/7] hw/cxl: Round up of fixes Jonathan Cameron
2024-10-14 12:18 ` [PATCH qemu 1/7] hw/cxl: Fix uint32 overflow cxl-mailbox-utils.c Jonathan Cameron
2024-10-14 12:18 ` [PATCH qemu 2/7] hw/cxl: Fix background completion percentage calculation Jonathan Cameron
2024-10-14 12:18 ` [PATCH qemu 3/7] mem/cxl_type3: Fix overlapping region validation error Jonathan Cameron
2024-10-14 12:18 ` Jonathan Cameron [this message]
2024-10-14 12:19 ` [PATCH qemu 5/7] hw/cxl/cxl-mailbox-utils: Fix for device DDR5 ECS control feature tables Jonathan Cameron
2024-10-14 12:19 ` [PATCH qemu 6/7] hw/cxl: Fix indent of structure member Jonathan Cameron
2024-10-14 12:19 ` [PATCH qemu 7/7] hw/pci-bridge: Make pxb_dev_realize_common() return if it succeeded Jonathan Cameron
2024-10-14 12:54 ` [PATCH 0/7] hw/cxl: Round up of fixes Jonathan Cameron
2024-11-06 19:57 ` Michael Tokarev

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=20241014121902.2146424-5-Jonathan.Cameron@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=ajay.opensrc@micron.com \
    --cc=fan.ni@samsung.com \
    --cc=frolov@swemel.ru \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=shiju.jose@huawei.com \
    --cc=yaoxt.fnst@fujitsu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox