From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-b2-smtp.messagingengine.com (fhigh-b2-smtp.messagingengine.com [202.12.124.153]) (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 45A42407594 for ; Thu, 5 Feb 2026 14:39:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.153 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770302342; cv=none; b=f0WyRU1+wqn9dHbvyrhphSOidWCKdrUuTiNSa9T38frRGRHIEJZDYIe7Ffe/GgKGGHc0qRw5BThzkuFzsnZwoeEUOEdO1Z0noTqgMRIbvlMTSpWtywkmusd1/J4NFgY2LJ/pn/1qbV6wHU495iQfh+NWAUxQXVgOBthGwiBSH5U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770302342; c=relaxed/simple; bh=1shgr5RbN0+EC6E04m9kvWhIyxdGojZ8lAfgpi0dMHM=; h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References: Subject:Content-Type; b=K0XwoOpE7sc7p5J+0evEPUYqhIperSOIcK3CUH42MkSHwV/ux18efi6WeMNUDspAtJMSdBGEVJhsvI5qv2eeTH/N8JETXm5SO6hRkDlkCxKiiLsvq/EhYxsA+3pRIxqkQcPv75zOjw8DxSpfVquEL6Fe4zelTjAuCpE60hzwW1A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=TX0kMBx4; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=NZOfl6+X; arc=none smtp.client-ip=202.12.124.153 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="TX0kMBx4"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="NZOfl6+X" Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.stl.internal (Postfix) with ESMTP id A6F417A01CE; Thu, 5 Feb 2026 09:39:00 -0500 (EST) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-04.internal (MEProxy); Thu, 05 Feb 2026 09:39:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1770302340; x=1770388740; bh=Ouxj0cE7fpHH9EPUJdEB+G+cq7B+TFlizDXr87xbB9M=; b= TX0kMBx4VH8a7ECFHP22e6QypFGEmXpaveQGItsxnapPTJ3j5Fx17LKi8BUCt8w7 qYEN3d+tuekKt7XU8nAxmHrO7nr6TvHSlv69S4+Z18qHkPOSUFjSGEFG1bIiWGt8 AF4M2hloojDgefAZ2YHY1irPKJ5kwW169MZgWhofRPwH5YIf9xl+3EVieXH102Es 1mcZZxK88CFzPJTIZQcwx4LCsOlAkSIp8j+hEIX5HAhn1WNv/dUgnlqToxdg0zdb 1par+t+ju4+Ev2E3hAC7BdgxumerHuWs84nko4Grr0R0QtkOEAFq6x2VezdoHP3K cNo5ug2DL/+lmvb+LOD1lw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1770302340; x= 1770388740; bh=Ouxj0cE7fpHH9EPUJdEB+G+cq7B+TFlizDXr87xbB9M=; b=N ZOfl6+XvwBadJ0syiqniIM1A1/D6cY13fzMYSBiDtrYRyFif9QclrGFOwVO1aFFv dv95RgKZB6ZbkcdfmAsqGmdtl+T3eMpZDBFWUvyGc72usBf2Za45v/GdeDfKZwuN EK8PYK1z+UNnX5Gh9cfmkUbLIPBiR6bLqcNlZBiswdHoJM4ocxHHcwWwEAd6XYa2 gJI7L/FkgT/WEe9+6GTsr99WVIB37BgyI+cSbETBbdCrs6dJ9z9w03BdvqsHmbvt S1iRNL+nbaJOiY3jhtvx1kenMmyhffCKcNFePRQUkM3dxNFXcTg1ayi2C/kvRec/ 3prCaJB0BmONAXKjnszdQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddukeehheeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvfevkfgjfhfutgfgsehtqhertdertdejnecuhfhrohhmpedftehrnhgu uceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrthhtvg hrnhepffdvjeejtdeggefhvddvhfethfdtkeeiffetgffgffetiedttdfguefhuefghfeh necuffhomhgrihhnpehkvghrnhgvlhdrohhrghdprghrmhdrtghomhenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrhhnugesrghrnhgusgdr uggvpdhnsggprhgtphhtthhopedvhedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoh epsggrsghurdhmohhgvghrsegrmhgurdgtohhmpdhrtghpthhtohepuggrvhgvrdhmrghr thhinhesrghrmhdrtghomhdprhgtphhtthhopegsvghnrdhhohhrghgrnhesrghrmhdrtg homhdprhgtphhtthhopehjrghmvghsrdhmohhrshgvsegrrhhmrdgtohhmpdhrtghpthht oheprghlvgigrghnughrvgdrsggvlhhlohhnihessghoohhtlhhinhdrtghomhdprhgtph htthhopehprhhimhgvrdiivghngheshhhishhilhhitghonhdrtghomhdprhgtphhtthho peifrghnghiihhhouhdusehhihhsihhlihgtohhnrdgtohhmpdhrtghpthhtohepgihufi gvihehsehhihhsihhlihgtohhnrdgtohhmpdhrtghpthhtohepfhgrnhhghhgrohduudes hhhurgifvghirdgtohhm X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 566C7700065; Thu, 5 Feb 2026 09:38:59 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ThreadId: AdHIckEZVcNF Date: Thu, 05 Feb 2026 15:38:15 +0100 From: "Arnd Bergmann" To: "Linus Walleij" , "Jonathan Cameron" Cc: "Yushan Wang" , "Alexandre Belloni" , "Drew Fustini" , "Krzysztof Kozlowski" , "Linus Walleij" , "Will Deacon" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, fanghao11@huawei.com, linuxarm@huawei.com, liuyonglong@huawei.com, prime.zeng@hisilicon.com, "Zhou Wang" , "Wei Xu" , linux-mm@vger.kernel.org, "SeongJae Park" , "Reinette Chatre" , "James Morse" , "Zeng Heng" , ben.horgan@arm.com, "Tony Luck" , "Dave Martin" , "Babu Moger" Message-Id: <0028a425-140d-4baa-b482-d6f2d349f8c2@app.fastmail.com> In-Reply-To: References: <20260203161843.649417-1-wangyushan12@huawei.com> <20260203161843.649417-2-wangyushan12@huawei.com> <20260204134020.00002393@huawei.com> <20260205101814.000072ec@huawei.com> Subject: Re: [PATCH 1/3] soc cache: L3 cache driver for HiSilicon SoC Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Thu, Feb 5, 2026, at 14:47, Linus Walleij wrote: > On Thu, Feb 5, 2026 at 11:18=E2=80=AFAM Jonathan Cameron > wrote: > >> Take the closest example to this which is resctl (mpam on arm). >> This actually has a feature that smells a bit like this. >> Pseudo-cache locking. >> >> https://docs.kernel.org/filesystems/resctrl.html#cache-pseudo-locking > > That was very interesting. And more than a little bit complex. > IIUC MPAM is mostly about requesting bandwidth to/from the > memory. > > But maybe cache lockdown can build on top? The CoreLink interconnect blocks also have a way to lock cache lines, e.g. for the CMN-600: https://developer.arm.com/documentation/100180/0200/SLC-Memory-System/So= ftware-configurable-memory-region-locking?lang=3Den These are fairly common, but so far we never had the need to expose this in a low-level driver. If we add driver interface for HiSilicon chips that use a custom interconnect, we should probably check at least that the user ABI would theoretically also work on Arm interconnects if one wrote a driver. Another similar technology is memory that has already been locked by firmware (or hardware design, i.e. not a cache), and there are a few I remember: - drivers/misc/sram.c exports sram from physical addresses to userspace. For a deeply embedded system with known amounts of locked-down L3 cache, the firmware could just pre-lock the cache and expose it to the kernel as an sram. - your own arch/arm/kernel/tcm.c, which does not currently have any upstream users. I don't remember if it ever had. - arch/sh/mm/numa.c supports locked SRAM through numactl, originally added by Paul Mundt. The idea of using numactl to move page cache pages is somwhat appealing, but it really messes with the assumptions about NUMA interfaces, and I think this is the only 32-bit target that exposes numactl. There are probably no applications left using this in modern kernels. - arch/arc/ had an elaborate downstream patch for wireless network SoCs from (IIRC) Quantenna that would link mark any performance-sensitive .text and .data parts of the network stack to be in on-chip SRAM, but no user interface. Arnd