From nobody Sat Nov 15 12:50:01 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=1752519572; cv=none; d=zohomail.com; s=zohoarc; b=FYZQy0rS9kVhofpsciyWBy23G+tmXoUxhS6jDwyXL22CtmBNMgzak9SV60PCYQcMKYwtq/fT8gquS4O+HEaydFifjt5fniYtCM0Oj7UNX4aRIUpbfK7XfQKbBHuOWAZ1MadfWj6qOJ+g97LDAYv1rzECyouP3gOhhB0pXic4jZQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752519572; 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=EEVbNzZ7BG2VttxalBIWYa1T4y1TUyLDSaOjU7j6vqU=; b=REOeU2zOoBM235oPYP/qvmpepOLwPg+ZMypiQ1WjT4GT49uHNimY4cN+M84MWNTlwwQpXbdU1TfN0N16rxA7YmViQPFOSubJjObWjj6x5VgVO46F7iWHHCn+nkKbuo4HgrPBqgdnoT4iEpIW0cvE4AfA5lMtx306cm/UfbDPjqE= 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 1752519572180903.4873363131273; Mon, 14 Jul 2025 11:59:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ubOOc-0000eR-JB; Mon, 14 Jul 2025 14:59:26 -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 1ubNGI-0001FT-Og for qemu-devel@nongnu.org; Mon, 14 Jul 2025 13:47:07 -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 1ubNGH-0007nD-09 for qemu-devel@nongnu.org; Mon, 14 Jul 2025 13:46:46 -0400 Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4bgqV96nBLz6L5Rg; Tue, 15 Jul 2025 01:45:37 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id 1ABC114033F; Tue, 15 Jul 2025 01:46:43 +0800 (CST) Received: from SecurePC-101-06.china.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; Mon, 14 Jul 2025 19:46:42 +0200 To: , Michael Tsirkin , Fan Ni , Anisa Su , Anisa Su CC: , Subject: [PATCH qemu v2 03/11] hw/mem: cxl_type3: Add dsmas_flags to CXLDCRegion struct Date: Mon, 14 Jul 2025 18:44:59 +0100 Message-ID: <20250714174509.1984430-4-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250714174509.1984430-1-Jonathan.Cameron@huawei.com> References: <20250714174509.1984430-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.122.19.247] X-ClientProxiedBy: lhrpeml100011.china.huawei.com (7.191.174.247) 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1752519572862116600 Content-Type: text/plain; charset="utf-8" From: Anisa Su Add booleans to DC Region struct to represent dsmas flags (defined in CDAT)= in preparation for the next command, which returns the flags in the next mailb= ox command 0x5601. Reviewed-by: Fan Ni Signed-off-by: Anisa Su Signed-off-by: Jonathan Cameron --- v2 for merge - Added some : inline with Fan's comments on a later patch. --- include/hw/cxl/cxl_device.h | 15 +++++++++++++++ hw/mem/cxl_type3.c | 8 +++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/include/hw/cxl/cxl_device.h b/include/hw/cxl/cxl_device.h index 7eade9cf8a..7e0a66906f 100644 --- a/include/hw/cxl/cxl_device.h +++ b/include/hw/cxl/cxl_device.h @@ -133,6 +133,15 @@ typedef enum { CXL_MBOX_MAX =3D 0x20 } CXLRetCode; =20 +/* r3.2 Section 7.6.7.6.2: Table 7-66: DSMAS Flags Bits */ +typedef enum { + CXL_DSMAS_FLAGS_NONVOLATILE =3D 2, + CXL_DSMAS_FLAGS_SHARABLE =3D 3, + CXL_DSMAS_FLAGS_HW_MANAGED_COHERENCY =3D 4, + CXL_DSMAS_FLAGS_IC_SPECIFIC_DC_MANAGEMENT =3D 5, + CXL_DSMAS_FLAGS_RDONLY =3D 6, +} CXLDSMASFlags; + typedef struct CXLCCI CXLCCI; typedef struct cxl_device_state CXLDeviceState; struct cxl_cmd; @@ -531,6 +540,12 @@ typedef struct CXLDCRegion { uint8_t flags; unsigned long *blk_bitmap; uint64_t supported_blk_size_bitmask; + /* Following bools make up dsmas flags, as defined in the CDAT */ + bool nonvolatile; + bool sharable; + bool hw_managed_coherency; + bool ic_specific_dc_management; + bool rdonly; } CXLDCRegion; =20 typedef struct CXLSetFeatureInfo { diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c index d898cfd617..6b0889c9ae 100644 --- a/hw/mem/cxl_type3.c +++ b/hw/mem/cxl_type3.c @@ -226,10 +226,16 @@ static int ct3_build_cdat_table(CDATSubHeader ***cdat= _table, void *priv) * future. */ for (i =3D 0; i < ct3d->dc.num_regions; i++) { + ct3d->dc.regions[i].nonvolatile =3D false; + ct3d->dc.regions[i].sharable =3D false; + ct3d->dc.regions[i].hw_managed_coherency =3D false; + ct3d->dc.regions[i].ic_specific_dc_management =3D false; + ct3d->dc.regions[i].rdonly =3D false; ct3_build_cdat_entries_for_mr(&(table[cur_ent]), dsmad_handle++, ct3d->dc.regions[i].len, - false, true, region_base); + ct3d->dc.regions[i].nonvolatile, + true, region_base); ct3d->dc.regions[i].dsmadhandle =3D dsmad_handle - 1; =20 cur_ent +=3D CT3_CDAT_NUM_ENTRIES; --=20 2.48.1