From patchwork Thu Jan 11 13:17:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiju Jose X-Patchwork-Id: 13517386 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 02509C47077 for ; Thu, 11 Jan 2024 13:18:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 718436B0095; Thu, 11 Jan 2024 08:18:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6A0EF6B0098; Thu, 11 Jan 2024 08:18:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 51A766B00A8; Thu, 11 Jan 2024 08:18:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 3BCF86B0095 for ; Thu, 11 Jan 2024 08:18:08 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 19B6F8050D for ; Thu, 11 Jan 2024 13:18:08 +0000 (UTC) X-FDA: 81667083456.13.61152CA Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by imf02.hostedemail.com (Postfix) with ESMTP id C235480013 for ; Thu, 11 Jan 2024 13:18:05 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf02.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=1704979086; 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=TQ1yNVGwL0FfY0bB8WdSrI6M9TWNGKvIIyEflhWy6aU=; b=G8Nfi3hwmRLZIUtT8IgzjVTsyO9p9+k/i8Vl8TetNQuQdktlsIr3UzLEYfif6fPRoVZeaw bWgF8fGXztAAwiwdM6P72HzicpeYpVkR6T5D1THqcWZ4cjkF/LJDFo2KiOPoDe77JMGPAp 4d3csZUG3/6ar/AzayraCVaQJ/Y6EWU= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf02.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=1704979086; a=rsa-sha256; cv=none; b=k3Fg2NzKWjsx31khU6peSDfZhVNH6Iemngha3rgwlwFw/1XTJeTeEwZ6pYw5HEdj8qxrG1 hPRP3HDMy62cBkzA7OCE6G02JgYhLb100P6myp1NnAP9CBflHkTAsCxB10AXqq3YE9cy3T WF+7vfnsIeuWFtLraLgbDqN3ttCtyho= Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4T9lXD0cr1z6K8wp; Thu, 11 Jan 2024 21:15:24 +0800 (CST) Received: from lhrpeml500006.china.huawei.com (unknown [7.191.161.198]) by mail.maildlp.com (Postfix) with ESMTPS id 53AB4140CB9; Thu, 11 Jan 2024 21:18:01 +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, 11 Jan 2024 13:18:00 +0000 From: To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH v5 00/12] cxl: Add support for CXL feature commands, CXL device patrol scrub control and DDR5 ECS control features Date: Thu, 11 Jan 2024 21:17:29 +0800 Message-ID: <20240111131741.1356-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: lhrpeml500004.china.huawei.com (7.191.163.9) To lhrpeml500006.china.huawei.com (7.191.161.198) X-Rspam-User: X-Stat-Signature: m49fo1f5c8czefbw3y1g7nxr9yqrhs6f X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: C235480013 X-HE-Tag: 1704979085-148007 X-HE-Meta: U2FsdGVkX18NLhVMsQqz3SXof98d163jI1YBVg3W/2tX3IoZrrV/cAw5L9g8RMG0DGWZmxjdoTJMV6B2Ho4pV39Z3wuC5xWTQB8i4HrFBW13IW/Xv6+vl8tbgG3Az7T9YFhBz4GkBC4ycot7W3/670Oa9KNQcsGjAyC2J0oPLDYxSDO7WZA8lXHnVIUc+6y8vVbXKJ16Fbdq3IHpo5tyAGy/vavy/9K7wr6e9Z0QS0T8yYSM9ebAw/CJLzyawtv4xlS02Qp2oX2UOJGMw5GQuVOrjVCEvutpE9lz0nnNnN4XQBzvrTy2RSeqXDfxx12sXbsZHgl6xQDbLiJPFU38RE3QmCGiXVe6pZAUoRqevoicRVHCUEg5Fa/NN/V9npNbCK0+NvHQ3flgzY89rdlARxshKllu8Fey6x2dVaOwc4aEC6oEcT8SMAI5oQBdRWrVvrVtBM/mcpR8wJ3ZjbO9MPid3c2iBMY1uU4nOyjTXb3s705jWtLclnW0fvTHLMNFzrNJu/uAKS/z4yDra5H1pkr4DjUy3NnbbASqfcVo8CIClefDjNZWGb1xnObhacO8hjZLSn4PHbcUY5nj670K/wFQ5sC0TNsc/rK42szeKuI0WWQvUgsDY8osUmhY5L3MFt6/ipiMwv+OEikc/CTGFlA2MCAV6AKz45uRHTu0xACLqspRDgbM6SSNAMQEnPWeVbaj0o0PCVItc7+sQ1/24p47GZS8GKdeg9WunZxQf1UGkQI76A+bekSdSH5BnsyJLmy2EcY7Q5tDVNiMsXfLFi14xcsNn42x6pVXtpJJoAsSw4XGRmX8hTlmTY+7hfClIECZP50mYi6kLApVikeic02QEbzRy1yRUwYo+ufP4GwbR+5OD1tkjmeeoi12ZypdMPI+HrnLjOBHV9LCoY6QX55bJvOApsULwKUb5ieir8MIWtkd/KZgM9KXLSZrZlBx+mx1MzBZA/nkG9MOr9A yLWPnDRc a0ANqvqmrHKugQDfT6GbH4sVzxWJECPilfN+6GyiOP5admhUUjIwu4Y6mcTdEdrOJTCBUr+mLdJq3kxDIFzw9UN6njNoQOBevS3NHx0uVcJ4HSfuDJq9ChjfZVsljg9CWKIGxLyy8fX0XonjRUTjZ8ohg36VycywYJgDt8/1fMwE9sthWFd7lFVaR8/8j5ysz/8FwfVlXs0Cr7BscTnSDMewz3yszPphNmTVdNKt9HB2aI06gfD+Rp4AGbha8zQKQ1R0b 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/20231124135338.1191-1-shiju.jose@huawei.com/ Changes 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 | 120 ++ 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, 3080 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