From patchwork Thu Feb 27 22:38:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiju Jose X-Patchwork-Id: 13995263 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2785FC197BF for ; Thu, 27 Feb 2025 22:39:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 92B18280005; Thu, 27 Feb 2025 17:39:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8AEAF280001; Thu, 27 Feb 2025 17:39:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7749F280006; Thu, 27 Feb 2025 17:39:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 5A98B280001 for ; Thu, 27 Feb 2025 17:39:25 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 134CC121DB3 for ; Thu, 27 Feb 2025 22:39:25 +0000 (UTC) X-FDA: 83167192290.18.3441A05 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by imf25.hostedemail.com (Postfix) with ESMTP id 18412A000E for ; Thu, 27 Feb 2025 22:39:21 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf25.hostedemail.com: domain of shiju.jose@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=shiju.jose@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1740695963; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=w1tdlcV+A6+fWdGs75qbIOaAjb65Q4W4JnfuFlOmoGo=; b=ybmE7B/7wbc+A5HCYR9uR2rQOSF/sM75hklaVXQUe+3cVuO7L05Pp1mJTZAAbFvYpXdemr IWrbjEpxmcBciB2KFcsaB6bGfXYYi+vLPm3vqxGSEriD5i9iwIIEXtdTIP/toQC/G/g0hk z7J32EUF5k4yEWcTyKnOKFy8P6rulYE= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf25.hostedemail.com: domain of shiju.jose@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=shiju.jose@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740695963; a=rsa-sha256; cv=none; b=0hjMH3vINZeApd6DAUt8cIG9DrztHCxrPzuA1uJpyp2jKeUdmrYBBHYW7UImSrv2Dx/0pD y6afG/ybDEkrQTGB4UC8p9+/iApx5QlnDcv8kPbpQ1El3yUH2qzNt8JOATvrA/Ovs+Gi0k pNxcMrNloAGjthOQMgarI+rGbKHlyVU= Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Z3mRx1qTwz6K9HS; Fri, 28 Feb 2025 06:37:17 +0800 (CST) Received: from frapeml500007.china.huawei.com (unknown [7.182.85.172]) by mail.maildlp.com (Postfix) with ESMTPS id B10AF1400DA; Fri, 28 Feb 2025 06:39:16 +0800 (CST) Received: from P_UKIT01-A7bmah.china.huawei.com (10.48.149.240) by frapeml500007.china.huawei.com (7.182.85.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 27 Feb 2025 23:39:14 +0100 From: To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH 0/8] cxl: support CXL memory RAS features Date: Thu, 27 Feb 2025 22:38:07 +0000 Message-ID: <20250227223816.2036-1-shiju.jose@huawei.com> X-Mailer: git-send-email 2.43.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.48.149.240] X-ClientProxiedBy: lhrpeml500011.china.huawei.com (7.191.174.215) To frapeml500007.china.huawei.com (7.182.85.172) X-Stat-Signature: kqigjpqf3mhq46fespbj4oeaqfsgk1d7 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 18412A000E X-Rspam-User: X-HE-Tag: 1740695961-795984 X-HE-Meta: U2FsdGVkX19ZdQpRdl4b2rAaw3UAu5KDYQCjBNy71rmCPlJYpxSb2RpPy+Ac8FXk2Z4dyXOPyamtemgmoEcWy2iJDu0PMadVEuavofxLyTmRcZ6Df5K7GGTOqBojZQuUTqNuW68/ZxrXO0ZN4DGFcWrFXD31mygaVGV6iVDN//vNeYq3z34ReLJBmSstmPfVM7q8hBORblUWzAx6U9MLJ3ADcrF8s/1V+LfSTuXarivLjiUssi5x1W81djDOOFveSSZG4KcqeS4sji1+Di/j23gFT9Imt01nVVNOyLF/P2AMtakMW9x/UZ/89ONdQZUeWYBXXLBQ117ZR6TdQTglrAoMxPRdxSMK8o9egp2M+iOnmm6iNHikHmFf5gnTtb3V7MGZOpk0H1JG4t9Rca3eROUhS86Am2Poef1IOP4ZWUcUQoxIvsDeH08YDEIkMJHY/NtXW7m/4v+NsWtm6fFuQ/qAXEVtc3mpveb4M1JIcCp1Fqfyhm08F0QzdivQAbk1R7DJ6Soq1Nn2yEyUbj37CdCzWsWvE48Gtc1VWZo7py3f6gutyQvVBSZJaMeaqtO0TpGPD/xi0BEL/y9rl6bK8FfjKu4yksyEQlU0hiSU/P48WLHgHzl79HNznnOIwpV4/Sy/pp/WDWX3SX5GljETnp11FxTWzuIdj/QrCHXTS1JxZ3MOemuTKlctwj5+WoMzSdQrxH3OTm4c29m/pt1z7LP1uZppHukZGERHQ/rQ207Fiyl9PJfx13a3MZyxkygOn8D1BuZ74Zt/NwIR7JCoCI4RBhLMi5d+w0TA5tl4GsFzWXHkK4wlve2djrPKr59XqvHwdPHMVojFpjTeu2jZekFVMnqpGwxThaEwX+P9wHvJKrrSAg+9ntSfSQr5rI5ghDT+efOWV2DW131vfp8movik6WndK0/cVqpaycK5pXzSpaSMGui+BDhthuMTN0U/KOCSvhGyUH85aAFVHUE 8K7IiRrt EYUUMduyrb8ZA4nOLaLk89oYsaSQk2wL9V7VJIGXJYpYyq6doV5opzgoUui+QmdiWBOfL96m++luvCxojGNUJTenn2Zl7l//ggAB/7gqo0/ROSuu7oWBBevr44QkUBRrjZPj3YbufXqAluJQkBi/oNix2h6z6S2YVj8loIkoUZBrzMNaalTCgV+9luvcgP1g8HpCF3yCNU4BDANJrqO2o8gINTgF6a5MEB+9QFeMn/yVDGGs= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Shiju Jose Support for CXL memory RAS features: patrol scrub, ECS, soft-PPR and memory sparing. This CXL series was part of the EDAC series [1]. The code is based on cxl.git: next branch [2] merged with ras.git: edac-cxl branch [3]. 1. https://lore.kernel.org/linux-cxl/20250212143654.1893-1-shiju.jose@huawei.com/ 2. https://web.git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl.git/log/?h=next 3. https://web.git.kernel.org/pub/scm/linux/kernel/git/ras/ras.git/log/?h=edac-cxl Userspace code for CXL memory repair features [4] and sample boot-script for CXL memory repair [5]. [4]: https://lore.kernel.org/lkml/20250207143028.1865-1-shiju.jose@huawei.com/ [5]: https://lore.kernel.org/lkml/20250207143028.1865-5-shiju.jose@huawei.com/ Shiju Jose (8): cxl: Add helper function to retrieve a feature entry cxl/memfeature: Add CXL memory device patrol scrub control feature cxl/memfeature: Add CXL memory device ECS control feature cxl/mbox: Add support for PERFORM_MAINTENANCE mailbox command cxl/region: Add helper function to determine memory is online cxl: Support for finding memory operation attributes from the current boot cxl/memfeature: Add CXL memory device soft PPR control feature cxl/memfeature: Add CXL memory device memory sparing control feature Documentation/edac/memory_repair.rst | 103 ++ Documentation/edac/scrub.rst | 64 + drivers/cxl/Kconfig | 20 + drivers/cxl/core/Makefile | 1 + drivers/cxl/core/core.h | 11 + drivers/cxl/core/features.c | 20 + drivers/cxl/core/mbox.c | 45 +- drivers/cxl/core/memdev.c | 9 + drivers/cxl/core/memfeatures.c | 1728 ++++++++++++++++++++++++++ drivers/cxl/core/ras.c | 151 +++ drivers/cxl/core/region.c | 15 + drivers/cxl/cxlmem.h | 82 ++ drivers/cxl/mem.c | 4 + drivers/cxl/pci.c | 3 + drivers/edac/mem_repair.c | 9 + include/linux/edac.h | 7 + 16 files changed, 2270 insertions(+), 2 deletions(-) create mode 100644 drivers/cxl/core/memfeatures.c create mode 100644 drivers/cxl/core/ras.c