From nobody Sat Nov 23 23:05:05 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1730754841; cv=none; d=zohomail.com; s=zohoarc; b=T8vQ8Zyz2pyoeDtREQdWq+0oOMzCEzaMXQOJh9/W13N8YBcb3utOlSjjKUbbkvgIr7vF4hyKYhYvwLTMx897VT/+nPY3Yc7yyZGMKGEcMFPH6P2EByPmDLDsGguv+UlaU1woEnyM9715IN5pcKN3hqWGpkBTypnSLV+c4uPs/aI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1730754841; 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=LphtSZRM9Hmq0/3hV/+VD4mIq6AHbSOEG0NTeD+XVjw=; b=e45XiOrU6Sl8NNxRbO5CtCRKHggOFJkFzyCw5ft9MBYdOQIx+LJ84dsSk/2ROt2pccyO4qJWO2EwrY2kKuhsNXz9uoRvDGif98hfJscpyWyAR+DiJnX0EzOsnK3zrGEv2jKx0+bmqpsptWeRTp+VBhyZxli5BJ9aW8VC6NfbbQQ= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1730754841708717.1974152393389; Mon, 4 Nov 2024 13:14:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t84JA-0003Se-BO; Mon, 04 Nov 2024 16:08:20 -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 1t84J4-00034h-Bc for qemu-devel@nongnu.org; Mon, 04 Nov 2024 16:08:15 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t84J2-0005SR-Sd for qemu-devel@nongnu.org; Mon, 04 Nov 2024 16:08:14 -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-341-mJaWzp0qNsmanZB452TOvg-1; Mon, 04 Nov 2024 16:08:10 -0500 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-43157cff1d1so34460275e9.2 for ; Mon, 04 Nov 2024 13:08:10 -0800 (PST) Received: from redhat.com ([2.52.14.134]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381c10d42adsm14083391f8f.40.2024.11.04.13.08.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2024 13:08:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730754491; 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=LphtSZRM9Hmq0/3hV/+VD4mIq6AHbSOEG0NTeD+XVjw=; b=Ag9LrUE/guM/U5RaK5ROVL6j+zSXIq+jjZTj0TjAAs8d+mDgEjVrHD9owaVqKYoZgfdCKp eu8Le+UHc+N2P2jnY1iRA5auj1oto/pJW9Ybzf+xk1tnOLg4IkNJwbW1Pnr3Z4bNjZQYh/ uqWiZxBsAT/F7n/Xadbxnjx/z9dIvxg= X-MC-Unique: mJaWzp0qNsmanZB452TOvg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730754489; x=1731359289; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=LphtSZRM9Hmq0/3hV/+VD4mIq6AHbSOEG0NTeD+XVjw=; b=Q1G+FR6wl+kY7WIWJNnwTvowD7hXEp3sE+Mckp/up9eKVItawv1vMltKN08SlQr+SP Gqb6kdKKfeNWXFRnOJkI/o3aFw/8pBDr85U3zj47bY4T8uym8hbQW7ZHQVHN72cqfqxr HbtJtlsjf+aeLib5p3S9720mLK+P+xigEIbJ/ojORD5Fff9LaYxXF+J9eNbvtsLrcYQV glPBz1s5a+k/ZVVehDTEk+w/xdEYzbunzVXJhUEt30zUUE4FubJddBzujz/OPQP/veKa SHVaonUVjZ4nzp2BsJw8HinU0tZlXMamzyZlQS6QLGWJdw89PuKY3j2JeIWe9ULklSWr D1SQ== X-Gm-Message-State: AOJu0Yz+1U0JSwM9YVtgV/rNYMUSSYgbr0LcQVNW7WlFOcaUUGxKuiIs UEjYoPPayBdoiW/KVLYr3B7XCAY5jGj85RYBRaC9gTWgSxe5J8L/88ji4dIRcyIV8RYutaJcMe/ luxDxPpa8SQh+PDbp9iW9yEBpItZMvSmEGZp38GQw7HH0JdY2+skEmRlV0qvNET8hWFArnLfCWm PmgaV2FLTM9m6Chk7VPKlxPRjqsRui4w== X-Received: by 2002:a5d:5988:0:b0:37d:30e7:3865 with SMTP id ffacd0b85a97d-381be7d63e0mr13752497f8f.34.1730754489001; Mon, 04 Nov 2024 13:08:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHse1DTdtj6DQWEZkiG7Juxs1RZjnkGxjXTOl9gxl2FH1oBeQKwEbrS3o8Qe1YD7Wly7WnjLA== X-Received: by 2002:a5d:5988:0:b0:37d:30e7:3865 with SMTP id ffacd0b85a97d-381be7d63e0mr13752459f8f.34.1730754488530; Mon, 04 Nov 2024 13:08:08 -0800 (PST) Date: Mon, 4 Nov 2024 16:08:05 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Fan Ni , Jonathan Cameron Subject: [PULL 38/65] hw/mem/cxl_type3: Fix More flag setting for dynamic capacity event records Message-ID: <80ee960f8d646505385bce8ed143a9bb8ea36d1d.1730754238.git.mst@redhat.com> 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.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.34, 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_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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: , 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: 1730754842910116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Fan Ni 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 dyna= mic capacity extents") Signed-off-by: Fan Ni Link: https://lore.kernel.org/r/20240827164304.88876-2-nifan.cxl@gmail.com Signed-off-by: Jonathan Cameron Message-Id: <20241014121902.2146424-5-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- 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_prescr= iptive(const char *path, stw_le_p(&dCap.host_id, hid); /* only valid for DC_REGION_CONFIG_UPDATED event */ dCap.updated_region_id =3D 0; - dCap.flags =3D 0; for (i =3D 0; i < num_extents; i++) { memcpy(&dCap.dynamic_capacity_extent, &extents[i], sizeof(CXLDCExtentRaw)); =20 + dCap.flags =3D 0; if (i < num_extents - 1) { /* Set "More" flag */ dCap.flags |=3D BIT(0); --=20 MST