From mboxrd@z Thu Jan 1 00:00:00 1970 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 8268DD1812F for ; Mon, 14 Oct 2024 16:23:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1C5CC6B0085; Mon, 14 Oct 2024 12:23:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 176856B0088; Mon, 14 Oct 2024 12:23:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 014C56B0089; Mon, 14 Oct 2024 12:23:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id D646F6B0085 for ; Mon, 14 Oct 2024 12:23:21 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 040D4C10C5 for ; Mon, 14 Oct 2024 16:23:12 +0000 (UTC) X-FDA: 82672727676.15.6FAE0A1 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by imf16.hostedemail.com (Postfix) with ESMTP id A3B5318000E for ; Mon, 14 Oct 2024 16:23:12 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf16.hostedemail.com: domain of jonathan.cameron@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=jonathan.cameron@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1728922884; a=rsa-sha256; cv=none; b=U93sd/lj+AursK9gOSaV6rsBUoJa9VJwggvdP2s+iUgf46oaNpt3MoT4xjRgPFhos1k4xK izk99vJfzXgSHH/stXsaN0rb3uz0W4bM5dAbMBLH7U6+l4w44vt4LivjejIYRFdXGwyeEy BL/svvr1fo45lmqX/Yddpj33yxsM7tM= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf16.hostedemail.com: domain of jonathan.cameron@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=jonathan.cameron@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1728922884; 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:in-reply-to:references:references; bh=TGzDl5Ou6BVdOQPxg6KHQwHde51VcT8qhqN5jtfkucI=; b=Q4ea6opBG7dRX5IsWUaPM0oZD51WSAM7wJ0XEQhwThQMyKEntVBF8eeGaX5msXZ2mS5pNS sWHsQKB6tLfdxo/ubGUbRp57v1tpRofEsPM2Lcpjr8hghZesMCBkmAsejGip3pB5vhkP3K i8Iy3FsoCfW1h98W/218uvR6AAal29Q= Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4XS2ZW3DWfz6HJp7; Tue, 15 Oct 2024 00:22:43 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id 95297140B55; Tue, 15 Oct 2024 00:23:15 +0800 (CST) Received: from localhost (10.203.177.66) 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 Oct 2024 18:23:14 +0200 Date: Mon, 14 Oct 2024 17:23:12 +0100 From: Jonathan Cameron To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v13 15/18] EDAC: Add memory repair control feature Message-ID: <20241014172312.00007034@Huawei.com> In-Reply-To: <20241009124120.1124-16-shiju.jose@huawei.com> References: <20241009124120.1124-1-shiju.jose@huawei.com> <20241009124120.1124-16-shiju.jose@huawei.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.203.177.66] X-ClientProxiedBy: lhrpeml500003.china.huawei.com (7.191.162.67) To frapeml500008.china.huawei.com (7.182.85.71) X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: A3B5318000E X-Stat-Signature: fzj9yz5h4emuqw39c9wq7y3hwbnjinr3 X-Rspam-User: X-HE-Tag: 1728922992-248931 X-HE-Meta: U2FsdGVkX1/yD9Mmu+GtFSkH0VbTo92jeiNBltEMEE9PZ0DdJu2awVipMBhBbXOD+lkC1Bbv1SJQTbFexbDhsc62NSBU8fD14juVo/feWGDsKXRUv9y+NYxBUG9jhsRKaEb5h28E+9LfIQvhRAnSi75CfsL9vOXgKOtaiLEMsdsO6H5eqJYQsLJCd1yGqateKmIjU6ygjhUaAigPS6OEM/KY30ARUcHfYex1p4/Fm1klAfuNNp6WOe3M3EotPKT9LOmSX/P+lgg16Ijf/sk+DAh0Ab85S14BQXn1ngfidZiFKVWMTd6kMa2Q+RZvCK0J2aHNbuy4TWeDuJ7+W2Exf8La38b1m7GHKK4oATAnmw36H7Lz57zAPlgTdlVGYyxBFgrVP+oy/HSt3QDAEQUUPtTj762RbVbl56dzDydKSrGWQjKd59Ert69JcDtnIYUp4FMR3+siBYSKgjRtMbwL8aRfxzGKY5cqRpGBAX3dQhZoYNEclTCJhBndWdtKZKue7/70H6MMAU6bTOXKuTVjd0bVhWTWWGPSan8B5I+a3C7qtEBP+5+Cc/Pjlw98XGG+oDYLDXrFsrrIaBIAsfriD5tNDa95V2hZ8JXu1PImnchgAKDE0DUGoroyc7woiaUKCTiNwY0/11IL+Vvs+dsTBuYKmWArWXZrBQ072aB7P8fIv+Ke//GOzgqwpFQIhHGrt02XkxCRHVvsSEDz/sOT9kSnzPzJhw/Z5JJBytHiocPPT4b5FSK19DLnBheSzTfb4QNEF6o5r3EO4Z3+b3r7nE5+adoDhCokx36nR3gyQZnUCnpqhP8kId/991Qx/G2XH6VlCxtTZRGK+PbV1DLTlwY9tQYfI7Kf/KSgm7kQraUEFMASEknGbsyOH7eYLto/u9MVTN86INl8aZ66r9QMRbsCMJsHeZczsXoXpZPM6+IHChvBgm5rZ5n/rDyxwZuqcRnVUgQWCkOYM+uLfMS SOaZIvv4 IOQvDLg14qLx6+1W9JnyyjzMRRLhL4Js5G0rIlPuLDHviEAYw1IKk3l2xJ4VBx7KivdloOI49WT0daIIsjiOKT4jiNEQ0cvgFscjUDlZuptDCcRUcGecmAAiWSgOm+lOQRA72F/Vxv8p4ntZancM0O0wCMJh1sjuLOpxXZalbnxLTvksHnLnu0HeymSqgvuopoYohS02Cu1ZE1fV2zsLm3I55YcCBiB6MgqXd6e1aKs7prdGjKbt55bhE7UYE2wl7ZbGfjZx1H1EgoTrTBxLO6GSwCuB+04sOvJuBiTPvWoZzU5efuL9xdq37Ll4RbJxqwfch 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: On Wed, 9 Oct 2024 13:41:16 +0100 wrote: > From: Shiju Jose > > Add generic EDAC memory repair control, eg. PPR(Post Package Repair), > memory sparing etc, control driver in order to control memory repairs > in the system. Supports sPPR(soft PPR), hPPR(hard PPR), soft/hard memory > sparing, memory sparing at cacheline/row/bank/rank granularity etc. > Device with memory repair features registers with EDAC device driver, > which retrieves memory repair descriptor from EDAC memory repair driver and > exposes the sysfs repair control attributes to userspace in > /sys/bus/edac/devices//mem_repairX/. > > The common memory repair control interface abstracts the control of an > arbitrary memory repair functionality to a common set of functions. > The sysfs memory repair attribute nodes would be present only if the client > driver has implemented the corresponding attribute callback function and > passed in ops to the EDAC device driver during registration. > > Signed-off-by: Shiju Jose The question inline that we discussed offlist. Whether it makes sense to potentially have one device provide several mem_repairX differing in granularity (and may type) of repair, or one mem_repairX that has a control over granularity? The CXL spec has it designed as separate control interfaces but I'm not sure if we should follow that precedence or not. > --- > .../ABI/testing/sysfs-edac-mem-repair | 152 +++++++++ > drivers/edac/Makefile | 2 +- > drivers/edac/edac_device.c | 31 ++ > drivers/edac/mem_repair.c | 317 ++++++++++++++++++ > include/linux/edac.h | 67 ++++ > 5 files changed, 568 insertions(+), 1 deletion(-) > create mode 100644 Documentation/ABI/testing/sysfs-edac-mem-repair > create mode 100755 drivers/edac/mem_repair.c > > diff --git a/Documentation/ABI/testing/sysfs-edac-mem-repair b/Documentation/ABI/testing/sysfs-edac-mem-repair > new file mode 100644 > index 000000000000..9a8712ed9d47 > --- /dev/null > +++ b/Documentation/ABI/testing/sysfs-edac-mem-repair > @@ -0,0 +1,152 @@ > +What: /sys/bus/edac/devices//mem_repairX > +Date: Oct 2024 > +KernelVersion: 6.12 > +Contact: linux-edac@vger.kernel.org > +Description: > + The sysfs EDAC bus devices //mem_repairX subdirectory > + belongs to the memory media repair features control, such as > + PPR (Post Package Repair), memory sparing etc, where > + directory corresponds to a device registered with the EDAC > + device driver for the memory repair features. > + /mem_repairX belongs to either sPPR (Soft PPR) or hPPR (Hard PPR) > + feature of PPR feature, hard or soft memory sparing etc. The memory > + sparing is a repair function that replaces a portion of memory > + (spared memory) with a portion of functional memory. The memory > + sparing has cacheline/row/bank/rank sparing granularities. > + The sysfs memory repair attr nodes would be only present if a > + memory repair feature is supported. > + > +What: /sys/bus/edac/devices//mem_repairX/repair_type > +Date: Oct 2024 > +KernelVersion: 6.12 > +Contact: linux-edac@vger.kernel.org > +Description: > + (RO) Type of the repair instance. For eg. sPPR, hPPR, cacheline/ > + row/bank/rank memory sparing etc. So this is the open question for me with this feature. Do we do a monolithic 'device' that does all repair types for which we pick a mode or do we (as here) allow for one mem_repairX for each supported type? I don't particularly mind but it is a design question I'd like input on from a wider audience. > + > +What: /sys/bus/edac/devices//mem_repairX/hpa > +Date: Oct 2024 > +KernelVersion: 6.12 > +Contact: linux-edac@vger.kernel.org > +Description: > + (WO) Set HPA (Host Physical Address) for memory repair. Can we not just read back what was written? Seems like userspace might expect that?