From patchwork Thu Feb 15 11:14:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiju Jose X-Patchwork-Id: 13558137 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 C8E2CC48BEB for ; Thu, 15 Feb 2024 11:15:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 523DD8D0001; Thu, 15 Feb 2024 06:15:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4AC376B0096; Thu, 15 Feb 2024 06:15:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 23B9A6B009B; Thu, 15 Feb 2024 06:15:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 0C3286B0096 for ; Thu, 15 Feb 2024 06:15:12 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id DD5FF1A03B0 for ; Thu, 15 Feb 2024 11:15:11 +0000 (UTC) X-FDA: 81793781622.01.07531DC Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by imf04.hostedemail.com (Postfix) with ESMTP id 4DEE34001C for ; Thu, 15 Feb 2024 11:15:09 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; spf=pass (imf04.hostedemail.com: domain of shiju.jose@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=shiju.jose@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707995710; 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=zFvwzchR1AVApumbxtZH7qW91oPppWL+1U10+KNtvx4=; b=nckAyYCvUq6UHqT6S5RWvx6Bm14hD0pmE2ToF3Zz9No6o4tWmVTN4nrCMJAdsbnIlDnOrO cZtkUUbx2DEWK7jtEfd0ccPVKJiJVLd0Ip/dPjOt53KXbgcW8RsGuF9TJ+YksEiZvaujGQ fWKF70ZWuw1MAt8hjSPsFmIqtwiFy/s= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707995710; a=rsa-sha256; cv=none; b=zP8gDSDjDgMq2FLte4K8O4oSEyn3vhMuKuNUCeHNNdvTA/JYlkzGBYpfNu4cZ1VHB5XmNX 0+E3e/NMGA802H9YKcaqi8ekquLNuN78HvXC0PZbEVDi0RyRcNx7Nf/kAh5D4rJcNWBkuo nnn0VCCBh0UtCDVCFrz/OztOflyi1Uw= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; spf=pass (imf04.hostedemail.com: domain of shiju.jose@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=shiju.jose@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4TbC7F0vHBz6K8wc; Thu, 15 Feb 2024 19:11:37 +0800 (CST) Received: from lhrpeml500006.china.huawei.com (unknown [7.191.161.198]) by mail.maildlp.com (Postfix) with ESMTPS id A3BF5140B55; Thu, 15 Feb 2024 19:15:04 +0800 (CST) Received: from SecurePC30232.china.huawei.com (10.122.247.234) by lhrpeml500006.china.huawei.com (7.191.161.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 15 Feb 2024 11:15:03 +0000 From: To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH v6 00/12] cxl: Add support for CXL feature commands, CXL device patrol scrub control and DDR5 ECS control features Date: Thu, 15 Feb 2024 19:14:42 +0800 Message-ID: <20240215111455.1462-1-shiju.jose@huawei.com> X-Mailer: git-send-email 2.35.1.windows.2 MIME-Version: 1.0 X-Originating-IP: [10.122.247.234] X-ClientProxiedBy: lhrpeml100001.china.huawei.com (7.191.160.183) To lhrpeml500006.china.huawei.com (7.191.161.198) X-Rspamd-Queue-Id: 4DEE34001C X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: 6r3fyuq93j9hejcntwhao9woks6pu3s8 X-HE-Tag: 1707995709-3991 X-HE-Meta: U2FsdGVkX1/u7r/WSIVvqoRB+B9IABzwRV9+ip8OHW7rKYc/DRTPhBq6EedQTa6u6+r6RRhF1NOqsaOkZBbKRgnvc2fscXdxGxyNMZMffevmfT1Zl8iAt3z02QhherwBcJW6AGcxs4yhBNqOVlSAv/wHa5/co72+7LdlaRroAy9CKgApg0kfZ61kvSTxBwgmA3HGD27+6KfzCx+lpH8Ks/tUFiep3J5/V/3BulYzix+67dXRy1cNeULIlBcfU2WAViHwz4jzFy6K1/GTgyu/9rjhWOBFFENED4o79mbNXn5w6aAhk4uxTrx6wOS8joFp1Jri18vx8gHZKAw+yIOujQUK2A//cumL0zwvd+jDXzoDjg7BvNmOFbVyPxuXJ+faNcrgi7gnuGZzlA2qRZZqBPOiFxTJxVfzoN8orXeiLjRGe+/ftlQZG81DdgGbXUC4DvfZMvAC7T0ecy30+lg6sADKuk5UK93tpdA/Qssr4RbEAarpwaJhpNkooNXU0O+9MROnRkCggNPAiv++fBpo/ARWRa6ZkTjSjn/GPg/8N6m4KLgIbchcb+Hze/qT7B9lNeEZ/iYSL3GgT5Ikr0Fl12Nz1Byr69ktyyGMQQXMKmZyDoP7oPWts67hoSBGiVZ8qWw6G8I3D8HoUVzGVVghOIJqIiMsQOG61mcbdfeGo5ePfoQqnha8pexvXC9wYZkdUL0Ixj/3zEE7JXbYOQFAegMELHT3+WPrI5IVVNNBwDGlls+psKj6h/58esfrO4637Nc4lPQ847+Nq1Uvv9Kz/8ASuHUpX0OnRbyr+bsH36A1zaGd/BmNlymBXzTRC4+q8GVBh0sqhSKxVVOgpehTQwK+K1y6Edyn6akicfl81xQi7/fX3uxAkKqm97E8h9Ucl1B/LeutepGsA6QcHxQqcvrucMSgsAfgfvAEkzipswWjikZ9Ol95b6bL6xwadHV9T8dhx2ZkQlVLKHwOg6K SMMDlONH vEE5kY5txA2sNzDHkhXi9kDMN9oiaeqRE/B58m68ldi9s1Er7+WZ/Cz4CgYH32QxrCociIEOywXCcDLoDjauxgsNWxiVQvOXVkcv4r65pgJwWficwQUxs9BUkgXnHe9bxho9vYWWZsmDtA6rgJoZXhJ/FzPb4Nf36V0igFDK4eJLsTYYdhcK71jPlICrDrYQTvqJgZykzttQ1N46oqnutlOnVkmxcjYLF0kbC8fav0Cw8QDehgXluGZTGyp5sCml6SC1B 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 1. Add support for CXL feature mailbox commands. 2. Add CXL device scrub driver supporting patrol scrub control and ECS control features. 3. Add scrub subsystem driver supports configuring memory scrubs in the system. 4. Register CXL device patrol scrub and ECS with scrub subsystem. 5. Add common library for RASF and RAS2 PCC interfaces. 6. Add driver for ACPI RAS2 feature table (RAS2). 7. Add memory RAS2 driver and register with scrub subsystem. The QEMU series to support the CXL specific features is available here, https://lore.kernel.org/qemu-devel/20240215110146.1444-1-shiju.jose@huawei.com/T/#t Changes v5 -> v6: 1. Changes for comments from Davidlohr, Thanks. - Update CXL feature code based on spec 3.1. - Rename attrb -> attr - Use enums with default counting. 2. Rebased to the recent kernel. v4 -> v5: 1. Following are the main changes made based on the feedback from Dan Williams on v4. 1.1. In the scrub subsystem the common scrub control attributes are statically defined instead of dynamically created. 1.2. Add scrub subsystem support externally defined attribute group. Add CXL ECS driver define ECS specific attribute group and pass to the scrub subsystem. 1.3. Move cxl_mem_ecs_init() to cxl/core/region.c so that the CXL region_id is used in the registration with the scrub subsystem. 1.4. Add previously posted RASF common and RAS2 patches to this scrub series. 2. Add support for the 'enable_background_scrub' attribute for RAS2, on request from Bill Schwartz(wschwartz@amperecomputing.com). v3 -> v4: 1. Fixes for the warnings/errors reported by kernel test robot. 2. Add support for reading the 'enable' attribute of CXL patrol scrub. Changes v2 -> v3: 1. Changes for comments from Davidlohr, Thanks. - Updated cxl scrub kconfig - removed usage of the flag is_support_feature from the function cxl_mem_get_supported_feature_entry(). - corrected spelling error. - removed unnecessary debug message. - removed export feature commands to the userspace. 2. Possible fix for the warnings/errors reported by kernel test robot. 3. Add documentation for the common scrub configure atrributes. v1 -> v2: 1. Changes for comments from Dave Jiang, Thanks. - Split patches. - reversed xmas tree declarations. - declared flags as enums. - removed few unnecessary variable initializations. - replaced PTR_ERR_OR_ZERO() with IS_ERR() and PTR_ERR(). - add auto clean declarations. - replaced while loop with for loop. - Removed allocation from cxl_get_supported_features() and cxl_get_feature() and make change to take allocated memory pointer from the caller. - replaced if/else with switch case. - replaced sprintf() with sysfs_emit() in 2 places. - replaced goto label with return in few functions. 2. removed unused code for supported attributes from ecs. 3. Included following common patch for scrub configure driver to this series. "memory: scrub: Add scrub driver supports configuring memory scrubbers in the system" A Somasundaram (1): ACPI:RASF: Add common library for RASF and RAS2 PCC interfaces Shiju Jose (11): cxl/mbox: Add GET_SUPPORTED_FEATURES mailbox command cxl/mbox: Add GET_FEATURE mailbox command cxl/mbox: Add SET_FEATURE mailbox command cxl/memscrub: Add CXL device patrol scrub control feature cxl/memscrub: Add CXL device ECS control feature memory: scrub: Add scrub subsystem driver supports configuring memory scrubs in the system cxl/memscrub: Register CXL device patrol scrub with scrub configure driver cxl/memscrub: Register CXL device ECS with scrub configure driver ACPICA: ACPI 6.5: Add support for RAS2 table ACPI:RAS2: Add driver for ACPI RAS2 feature table (RAS2) memory: RAS2: Add memory RAS2 driver .../ABI/testing/sysfs-class-scrub-configure | 91 ++ drivers/acpi/Kconfig | 15 + drivers/acpi/Makefile | 1 + drivers/acpi/ras2_acpi.c | 97 ++ drivers/acpi/rasf_acpi_common.c | 272 +++++ drivers/cxl/Kconfig | 23 + drivers/cxl/core/Makefile | 1 + drivers/cxl/core/mbox.c | 59 + drivers/cxl/core/memscrub.c | 1009 +++++++++++++++++ drivers/cxl/core/region.c | 1 + drivers/cxl/cxlmem.h | 123 ++ drivers/cxl/pci.c | 5 + drivers/memory/Kconfig | 15 + drivers/memory/Makefile | 3 + drivers/memory/ras2.c | 354 ++++++ drivers/memory/rasf_common.c | 269 +++++ drivers/memory/scrub/Kconfig | 11 + drivers/memory/scrub/Makefile | 6 + drivers/memory/scrub/memory-scrub.c | 367 ++++++ include/acpi/actbl2.h | 137 +++ include/acpi/rasf_acpi.h | 58 + include/memory/memory-scrub.h | 78 ++ include/memory/rasf.h | 88 ++ 23 files changed, 3083 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-class-scrub-configure create mode 100755 drivers/acpi/ras2_acpi.c create mode 100755 drivers/acpi/rasf_acpi_common.c create mode 100644 drivers/cxl/core/memscrub.c create mode 100644 drivers/memory/ras2.c create mode 100644 drivers/memory/rasf_common.c create mode 100644 drivers/memory/scrub/Kconfig create mode 100644 drivers/memory/scrub/Makefile create mode 100755 drivers/memory/scrub/memory-scrub.c create mode 100644 include/acpi/rasf_acpi.h create mode 100755 include/memory/memory-scrub.h create mode 100755 include/memory/rasf.h