From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796125817; b=qpGwG51v4BZy35bGLvbVisYFU71DWs2SyqzSEO8XNEnmgrv6Q8sBFEzzCGU7EF9eZj1h k5jxKzCotv6kvFtr9slQG4FfOZJ/zVl6I58CVJtd3CgsqxTh5azUWPuXoKY8sPyOb+Ir7 /emobF5P6i3fKc43Fke9zZ/wYmLyAE74q1du8Y2EEDutOwF9zTtp8piMHOA4BA85Z7+K4 1KB51STDdsCer26TCz8Cfg6qj0D5nPejndNu16rHH+GShgNHin4diuDEToLLmKAD3R7/z iauyw5pvXCyu+vW4BEiHhs4k97Iu9uTy0vxSM4+ViaWQSDlVoEY1pfc4/bfyQcP1OKw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796125817; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=qIP3zP+jilesYc1/TfyCVaJ44/mCfOtjdWL1wLlwsyc=; b=Qp3aXVacecD4QUwh8KIDUooiroqJAmlAifD1n8FGHUeRCSuwmt+MGdwGFCVKzNLhG11I wigI66F8hR29LC+tDOY+yiMG9y5DGSxQ2hVyk5CiW1hxeJYp44ZMOiClCnG52KIVS+Gzk 4FPHhAC9Wdnfk/poZbLx4DiMz+n+CJW5r5U3JqN1LLpbmWZDCNhFfU3NGDU+yvto0tzxp suQJBzbTwoqNpPDz7jUWj0ZraTn7UbkUvBo83kCemT3Aa0h44knjPZK+LmtoqjE4iIAjL GW8Oa2lHjmuuUezaBu6NWJFLbqcNkkJF4m5T+YpKmDzuiDUOYaSQumYrHrGtsR6oYQg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dS8sR6tJ; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 525B6606A31A for ; Tue, 1 Dec 2026 11:50:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dS8sR6tJ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 118361F00893; Tue, 1 Dec 2026 11:50:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796125816; bh=qIP3zP+jilesYc1/TfyCVaJ44/mCfOtjdWL1wLlwsyc=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=dS8sR6tJpynxx1EITXzaVNTnQxdLQfiqo3YUpTsgloRTNRTqmxU3QTg9I+W7gkrId M2uZ4qMEZo4fjPDN4MfLa80/IqrvnL4+uQ93SXhXpI6O9dP2C0NPzMOslpfdoI53QO GOM3xdc/d11oBXcEvo1p/cplDNLovoe/DEyLUmFrIIRY0/nUtDSIW47uteyiw+HpSj pgMz0tb/CFrJdjBZgUaz96jo0Nh752Gf0lClWpR4mk39MjaYcEmcgxpa8x6V3g37tx jxe6tH+hpoEBOgh8+PhznGwggNuHzvgal7mXjwN2dx8Sw+Yg9CynI78hdBrUdT6Ivu h4KNX7Syvf+Ww== Date: Tue, 1 Dec 2026 13:50:09 +0200 From: Mike Rapoport To: "Edgecombe, Rick P" Cc: "luto@kernel.org" , "x86@kernel.org" , "dave.hansen@linux.intel.com" , "peterz@infradead.org" , "hpa@zytor.com" , "mingo@redhat.com" , "thomas.lendacky@amd.com" , "bp@alien8.de" , "tglx@kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 1/9] x86/mm/pat: flush the TLB when only an alias mapping changed Message-ID: References: <20261112-fixes-x86-v1-0-791adb8d6670@kernel.org> <20261112-fixes-x86-v1-1-791adb8d6670@kernel.org> <6b5c846e80f8bc0f8239a553caad57bcf9b7117d.camel@intel.com> <140c921f0582728b590ded89772a6bc55ca42058.camel@intel.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <140c921f0582728b590ded89772a6bc55ca42058.camel@intel.com> On Mon, Nov 30, 2026 at 10:55:14PM +0000, Edgecombe, Rick P wrote: > On Thu, 2026-11-26 at 09:34 +0200, Mike Rapoport wrote: > > On Wed, Nov 25, 2026 at 08:38:18PM +0000, Edgecombe, Rick P wrote: > > > On Wed, 2026-11-25 at 10:59 +0200, Mike Rapoport wrote: > > > > Like the cover letter said it's "unlikely to happen in practice" :) > > > > > > > > Currently there are no callers in the tree that could trigger that. > > > > > > > > I'm working the generic set_memory_core [1] and the bots keep yelling at me > > > > whenever I touch anything around. > > > > > > > > So while is a defense against potential future issues, the change is simple > > > > and I think it's better to have it. > > > > > > > > Might also save us from reviewing several LLM generated reports that would > > > > find the same thing ;-) > > > > > > Yea duplicates and AI false positives are a problem. But changing the code to > > > prevent the reports seems backwards. Though I don't have any other solution then > > > just drown in things to check. > > > > The change is more to prevent a potential future issue than to stop AI > > reports. > >   > > With more and more use cases using set_memory, adding code that ensures > > there is no missing flush now is better than hunting it down when some new > > caller hits it :) > > > > > > [1] > > > > https://lore.kernel.org/all/20260721-generic-set-memory-v0-1-v1-0-2c1fc62306b3@kernel.org > > > > > > Neat... But I think set_memory() was never the ideal interface for kernel memory > > > management. Maybe this is step towards that? > > > > The very first one, yes. > > Cool. > > > > > Right now it's a total mess: > > > > https://docs.kernel.org/mm/kernel-page-tables.html > > Ha! Yes. > > > > > and the first step I'm working on is at least to make all architectures > > behave consistently. > > It will be tricky. I'd think to stick to just unifying the virtual memory > permissions. The cache property stuff gets very x86 specific. MTRRs, etc. Cache properties stuff is not the only very x86 specific thing :) > What is the intended scope? Depending, it may be better to build a new thing and > then unify it, rather than unify the old implementations only to rebuild it. The goal is to have a common page table walk, the same decisions about splitting and collapsing (whenever supported) and the same locking model for all architectures. Than the very first thing that I consider a must is to make permission updates follow all-or-nothing, in the sense that either all or none of the permissions are updated. I considered creating a new common core from scratch and than switching architectures to it, but then I decided that adopting x86's implementation is safer and easier to reason about. -- Sincerely yours, Mike.