Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1215461rwd; Thu, 1 Jun 2023 12:05:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5NfQpls6CSKVqkQpeik3uJlTdf05kz7XR50MP/80SEFrp1pCiJVbROGHzHuKkSXHOO8VlZ X-Received: by 2002:a05:6a00:14cc:b0:647:e6d9:88c2 with SMTP id w12-20020a056a0014cc00b00647e6d988c2mr9521147pfu.0.1685646337846; Thu, 01 Jun 2023 12:05:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685646337; cv=none; d=google.com; s=arc-20160816; b=nh1c5E+vAugsJEbl2ZiUpkXGkL7Wkni469JFR8d++q3WgPKh5WoqhX72QzIU2KTgRh DjBKqratzo2+4RtdfW5MB5cEqgiBgN8CH3rm1UVrOUL6+aGYMLRK0R3WtWtXtDzVmmAs +Q8JEHOsrGszsT8NiGyEmfe21F960ZAalJOBNAZSHdJG1oB1VuxC12SvJ8pYNunJtj9k 0LUj3aKLECoqE8LOOibWrkChSCH4guxi7U8gX4+XaV+wu8+7b/H8LO/0SBeBujq+SggW Q58q5yPxl4tkNPhHJh78+Hc9TjdIOhDCg0y8oMDJM4TIVtIRDBMXSjzh3OtE2Mp4tEop xvsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=vE5M38dfe56E8s/vH4SQoCtLt0IZYGAsgOXKDjVTLRk=; b=dsMwsU3qtdfhpBS8K4GxNMo4Vn3rzLRN8bvINHUpMWn1S2WtwpuTG4/ZCbMAQK/y8M 85Z8lqxhXEsuiWh7JkW2uvUI3Ya7dKP6iwqRy/ifABm2ZWGzvAf5Gk8tv8bcQ5FuLNQ6 aDtHaaxCcPmZKJ1GD6bC8KeX1AUhYh3W0VGUFQONeycOlh+jtxFfMyithn/63B0vmOJs HiS8NG49+OusLEy8ue9w5q3z7K4UT7+yDsfT7D98aORiGrj1aj5/UoCGXgpJq6OSi8f/ VVm0f4yDwdgt0t6qjSv3QDzOk6ILJP/VsEKJ1vcdnX/OC1IJ0qzdGwT/RIEqNwMhhpTc PBYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=WcebRBX9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a129-20020a624d87000000b00643ae7da34bsi5901815pfb.221.2023.06.01.12.05.24; Thu, 01 Jun 2023 12:05:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=WcebRBX9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232466AbjFASiR (ORCPT + 99 others); Thu, 1 Jun 2023 14:38:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232344AbjFASiO (ORCPT ); Thu, 1 Jun 2023 14:38:14 -0400 Received: from out-14.mta1.migadu.com (out-14.mta1.migadu.com [IPv6:2001:41d0:203:375::e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20F30196 for ; Thu, 1 Jun 2023 11:38:12 -0700 (PDT) Date: Thu, 1 Jun 2023 14:38:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1685644690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vE5M38dfe56E8s/vH4SQoCtLt0IZYGAsgOXKDjVTLRk=; b=WcebRBX9N7xDfAOhJQCDt0Brku79Lkj1MR87hiRp7qhEDbQiQDjnDqE0iVy5Kc4E8ADGNa mXKEmKqKwoHkFh7QINhK9dRhKouPQW/ELmG9UtD3LNTa1N16g/g9fLkjUa8jbnd9gCmrO/ 7957lwgmB5RqAKvocMdeApF9dZOlVqo= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: "Edgecombe, Rick P" Cc: "tglx@linutronix.de" , "mcgrof@kernel.org" , "deller@gmx.de" , "netdev@vger.kernel.org" , "davem@davemloft.net" , "linux@armlinux.org.uk" , "linux-mips@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "hca@linux.ibm.com" , "catalin.marinas@arm.com" , "linux-kernel@vger.kernel.org" , "linux-riscv@lists.infradead.org" , "palmer@dabbelt.com" , "x86@kernel.org" , "chenhuacai@kernel.org" , "tsbogend@alpha.franken.de" , "linux-trace-kernel@vger.kernel.org" , "linux-parisc@vger.kernel.org" , "rppt@kernel.org" , "mpe@ellerman.id.au" , "linux-s390@vger.kernel.org" , "christophe.leroy@csgroup.eu" , "rostedt@goodmis.org" , "will@kernel.org" , "dinguyen@kernel.org" , "naveen.n.rao@linux.ibm.com" , "sparclinux@vger.kernel.org" , "linux-modules@vger.kernel.org" , "bpf@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "song@kernel.org" , "linux-mm@kvack.org" , "loongarch@lists.linux.dev" , "akpm@linux-foundation.org" Subject: Re: [PATCH 12/13] x86/jitalloc: prepare to allocate exectuatble memory as ROX Message-ID: References: <20230601101257.530867-1-rppt@kernel.org> <20230601101257.530867-13-rppt@kernel.org> <0f50ac52a5280d924beeb131e6e4717b6ad9fdf7.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 01, 2023 at 06:13:44PM +0000, Edgecombe, Rick P wrote: > > text_poke() _does_ create a separate RW mapping. > > Sorry, I meant a separate RW allocation. Ah yes, that makes sense > > > > > The thing that sucks about text_poke() is that it always does a full > > TLB > > flush, and AFAICT that's not remotely needed. What it really wants to > > be > > doing is conceptually just > > > > kmap_local() > > mempcy() > > kunmap_loca() > > flush_icache(); > > > > ...except that kmap_local() won't actually create a new mapping on > > non-highmem architectures, so text_poke() open codes it. > > Text poke creates only a local CPU RW mapping. It's more secure because > other threads can't write to it. *nod*, same as kmap_local > It also only needs to flush the local core when it's done since it's > not using a shared MM. Ahh! Thanks for that; perhaps the comment in text_poke() about IPIs could be a bit clearer. What is it (if anything) you don't like about text_poke() then? It looks like it's doing broadly similar things to kmap_local(), so should be in the same ballpark from a performance POV?