From nobody Thu Oct 2 12:05:11 2025 Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) (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 D59543195FB for ; Wed, 17 Sep 2025 13:30:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.25 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758115844; cv=none; b=LNuLHE0GRB+sTcxTf24cV6evFpOA9leyLt7BrH7W330IWkELqWMyzQsqyPf4tqsDDbqwgXTIG7Db6Hs5OhEoeUjtC7KEKxEtmH/TOJ/7aNVAhXt+dTpGUAaGbMxKwEWUEJYvF9/YsofzkLRuAdmmkfXptO/+/Re0fSbMvaIBGZM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758115844; c=relaxed/simple; bh=RkAsuDKxc8445mRlXvsnxqnd4Yo1V+gjETT/kjelF7E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=oFpTwqiEnRAoi+DuBatFZrFSeJUA0yCLqiVxqSr+58eiDZQjFNUCJ87CvtMqqDfSQ/wQZEwoaebbE6kcfbhgla09UOlNNJ5QpvKe+8KGlPGws5hJMYVq5Bv2BwpPcp/4N1Lq6mobvj8NtlkdixohM16SIJPeqer89znI6Kp4Yvk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=UTKGaDJw; arc=none smtp.client-ip=203.254.224.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="UTKGaDJw" Received: from epcas5p3.samsung.com (unknown [182.195.41.41]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20250917133039epoutp02d05583cd83c98e8353d2b7bda8a72881~mFQqfgsvF0519205192epoutp02X for ; Wed, 17 Sep 2025 13:30:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20250917133039epoutp02d05583cd83c98e8353d2b7bda8a72881~mFQqfgsvF0519205192epoutp02X DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1758115839; bh=L8I4pczPLL+3fGYbV4VkM8e4qH7d3Y7IhMKieoHkqSY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UTKGaDJwo6oD7oaol5OXUqHLXJQiRQ4zrE+S5NQnJL3PUlWS+uPR1wFk2dWu5lVbO 1MlWw7mlg+wffKsbznF3pWGeg97Go4SNlzZBjk+z06vt3fNR5KTppIcLtE1UIN8FjP W1HUweeazn+07HSgPQhWRfj7VVgmSbYdz9/4FA+8= Received: from epsnrtp01.localdomain (unknown [182.195.42.153]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPS id 20250917133039epcas5p11360ebf8a46a222e314ef3069f83145d~mFQp6BH5V0664606646epcas5p14; Wed, 17 Sep 2025 13:30:39 +0000 (GMT) Received: from epcas5p3.samsung.com (unknown [182.195.38.94]) by epsnrtp01.localdomain (Postfix) with ESMTP id 4cRfly2D12z6B9m5; Wed, 17 Sep 2025 13:30:38 +0000 (GMT) Received: from epsmtip1.samsung.com (unknown [182.195.34.30]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20250917133037epcas5p3c0681f2c381334fc70574a40250a8490~mFQoPPnev3265832658epcas5p3H; Wed, 17 Sep 2025 13:30:37 +0000 (GMT) Received: from test-PowerEdge-R740xd.samsungds.net (unknown [107.99.41.79]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20250917133034epsmtip19dfb297d6ecf5f484acf96743154c98c~mFQlv8Qq60457804578epsmtip1T; Wed, 17 Sep 2025 13:30:34 +0000 (GMT) From: Neeraj Kumar To: linux-cxl@vger.kernel.org, nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org, gost.dev@samsung.com Cc: a.manzanares@samsung.com, vishak.g@samsung.com, neeraj.kernel@gmail.com, Neeraj Kumar Subject: [PATCH V3 05/20] nvdimm/namespace_label: Add namespace label changes as per CXL LSA v2.1 Date: Wed, 17 Sep 2025 18:59:25 +0530 Message-Id: <20250917132940.1566437-6-s.neeraj@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250917132940.1566437-1-s.neeraj@samsung.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CMS-MailID: 20250917133037epcas5p3c0681f2c381334fc70574a40250a8490 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 105P cpgsPolicy: CPGSC10-542,Y X-CFilter-Loop: Reflected X-CMS-RootMailID: 20250917133037epcas5p3c0681f2c381334fc70574a40250a8490 References: <20250917132940.1566437-1-s.neeraj@samsung.com> CXL 3.2 Spec mentions CXL LSA 2.1 Namespace Labels at section 9.13.2.5 Modified __pmem_label_update function using setter functions to update namespace label as per CXL LSA 2.1 Signed-off-by: Neeraj Kumar --- drivers/nvdimm/label.c | 3 +++ drivers/nvdimm/nd.h | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/drivers/nvdimm/label.c b/drivers/nvdimm/label.c index 3235562d0e1c..182f8c9a01bf 100644 --- a/drivers/nvdimm/label.c +++ b/drivers/nvdimm/label.c @@ -924,6 +924,7 @@ static int __pmem_label_update(struct nd_region *nd_reg= ion, =20 nd_label =3D to_label(ndd, slot); memset(nd_label, 0, sizeof_namespace_label(ndd)); + nsl_set_type(ndd, nd_label); nsl_set_uuid(ndd, nd_label, nspm->uuid); nsl_set_name(ndd, nd_label, nspm->alt_name); nsl_set_flags(ndd, nd_label, flags); @@ -935,7 +936,9 @@ static int __pmem_label_update(struct nd_region *nd_reg= ion, nsl_set_lbasize(ndd, nd_label, nspm->lbasize); nsl_set_dpa(ndd, nd_label, res->start); nsl_set_slot(ndd, nd_label, slot); + nsl_set_alignment(ndd, nd_label, 0); nsl_set_type_guid(ndd, nd_label, &nd_set->type_guid); + nsl_set_region_uuid(ndd, nd_label, NULL); nsl_set_claim_class(ndd, nd_label, ndns->claim_class); nsl_calculate_checksum(ndd, nd_label); nd_dbg_dpa(nd_region, ndd, res, "\n"); diff --git a/drivers/nvdimm/nd.h b/drivers/nvdimm/nd.h index 158809c2be9e..e362611d82cc 100644 --- a/drivers/nvdimm/nd.h +++ b/drivers/nvdimm/nd.h @@ -295,6 +295,29 @@ static inline const u8 *nsl_uuid_raw(struct nvdimm_drv= data *ndd, return nd_label->efi.uuid; } =20 +static inline void nsl_set_type(struct nvdimm_drvdata *ndd, + struct nd_namespace_label *ns_label) +{ + if (ndd->cxl && ns_label) + uuid_parse(CXL_NAMESPACE_UUID, (uuid_t *) ns_label->cxl.type); +} + +static inline void nsl_set_alignment(struct nvdimm_drvdata *ndd, + struct nd_namespace_label *ns_label, + u32 align) +{ + if (ndd->cxl) + ns_label->cxl.align =3D __cpu_to_le32(align); +} + +static inline void nsl_set_region_uuid(struct nvdimm_drvdata *ndd, + struct nd_namespace_label *ns_label, + const uuid_t *uuid) +{ + if (ndd->cxl && uuid) + export_uuid(ns_label->cxl.region_uuid, uuid); +} + bool nsl_validate_type_guid(struct nvdimm_drvdata *ndd, struct nd_namespace_label *nd_label, guid_t *guid); enum nvdimm_claim_class nsl_get_claim_class(struct nvdimm_drvdata *ndd, --=20 2.34.1