Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1381059lqp; Mon, 15 Apr 2024 05:06:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWozTO7/5fGS/6zJWN8AD4KXVJOWl3WDPMMjvltQ9VpwODMmK7gtLREmZ9UfY5rVaArb49DlykzogeYPFRVJMcnafExV2DKosUaj70/qA== X-Google-Smtp-Source: AGHT+IFKbIwzaTvmFjSz5zLY9vNPkIp1qi/tSh7CciXDdwjEoQ4IbVjjs4032HNN/DGxUQdQE2u+ X-Received: by 2002:a9d:61c6:0:b0:6eb:7d1a:a48d with SMTP id h6-20020a9d61c6000000b006eb7d1aa48dmr3231462otk.10.1713182801790; Mon, 15 Apr 2024 05:06:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713182801; cv=pass; d=google.com; s=arc-20160816; b=aMH4fu8Txcgo+4l+zlFTzYMEd0pbmjvSU+xkSc4qS6PZ4uf1ARjLKR/lED3Q1//RgS HcPjdZ86zb7W4xQTWbmRg7QqeAJFuaIoSfTFP1491wG4XiYxn34oIspHpGi4Odx4VE40 yJiGrkC7Y7IjTh8IxDiWCOkVw5O/3fSB1XBjZUSvIlCYV0uwpgdGJnjS3iu4qxoNwOt/ q1Z6cvuwNTNEf2+Rb9xIFSAnntvpgwLS61vG7jzSfvcB4zPHulUGspz5BSFeTDEoiFPb NP5++DdfzMqWf7O7CTTF2SB9+h63spUVkQEbwPIOhXtjF1W9iEOxM11gz5tRtS2BsCz3 fRhg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=gJURSN8ZhZs54MX6UPe8WS991KHmcU3CMSr/wsPBYas=; fh=tROHmlDfjfg1+6mmbznJmnGY/ElJJ4kXP2rXhFrxSAI=; b=L4ZGKMH0N+X1Bqt3HKZ6lV8IuX10pt4+6lGzk5WDU8at4QSUyiNl5qLNcEU5n8UcY/ ksa9KWy2v+SE6ffQDusrzn7O95ER0yyEaK7/XUHClWcRtNhh9H57meVg0+jcuI/qYbZU L0rSefzlJeclS32B7JenTzJZYCOH5gziJp1pjYurYnVyEV4TSxOq7ataMbT/dz/lFlH2 YzgVRQ5aTSHg3TZQZeoNiJDWyQSt8Bp2UHOvKVcZbayKWFAtmaDIz49UqH0P93qrRf0I gjUA6TJ68g3ZkYISwDnmZj+8E2p4Rd6FFP+8o5wRE2Mdavsq3/pr6az9NIqU+dtW4iLJ qvEg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=WL3mGK96; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-144844-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144844-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id l4-20020a67ed04000000b00479eb88c4e2si1170389vsp.628.2024.04.15.05.06.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 05:06:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-144844-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=WL3mGK96; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-144844-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144844-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2C2E01C21E24 for ; Mon, 15 Apr 2024 09:38:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E878650A98; Mon, 15 Apr 2024 09:37:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="WL3mGK96" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 A54164F5F8; Mon, 15 Apr 2024 09:37:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713173842; cv=none; b=pbQqkCTcje0HWDFhbzBqrEPHQx2b6HeINO5CanXLwM1bWOq8S/AnvHg5BTywTq4oVZIuv+g0aAFyPgGm1ErLhRzdEm94U+Ul/rOa5tgZ6AN6nuIdm1RQ4edWwkTcKC3acHEGvQH6tctxRJuQeFS9aX2K8LCuDJ1qnv/+zJYjQHo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713173842; c=relaxed/simple; bh=iWSAcKBzCT/GfR3CUsNAvXWE2GqvA4i8aFyoJ/HJFOE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=q2lNb9r/DxUP93+ofQORD7YKXJKeRsJoE/3dIqBgHS5rsnw59UpuUAiIXByBpnqgJJMx/UNjjt62ks4laRvVeCLv82IiHSQ4JB5dYZ8nLxD0+Up5pAjZ/soNov6lJiecpVMDpS8YICWGIy2cEgqWycZTJy7RywZeMzDIt2RR+4s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=WL3mGK96; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=gJURSN8ZhZs54MX6UPe8WS991KHmcU3CMSr/wsPBYas=; b=WL3mGK96b4dqocWg2WT6S+o3Lh 6R4hcBA6RfcHuQQK7isTyMyXCwDos8Q1HdHKBvnc80dazhTsMKZZh+HOA+2p3MytoMgm0z79fe1lO 6VNzmYAbfQ0K4rY/gTJDrpu5Cj+twK8P8H6r2xTaYF5wANkZ19gJAqZM8x7uwfcFkyoEWlipCNTWk 6fylSl1gmglon4eNg+zb/yC04zTO/2Lfq8d+LNZPMMi03er3jB/2uzdVHk4Db9ls69FN+sjSeErGv ir1OIAWRPD8gvlVd9eQwbdsiTncbhidLvva928W/3FSV8BR+sXBV2NxpcV2Vc46i56RkcJA4zwnpr gpLaCNRw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwIlk-0000000FOjV-0IDN; Mon, 15 Apr 2024 09:36:56 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id B1DC030040C; Mon, 15 Apr 2024 11:36:55 +0200 (CEST) Date: Mon, 15 Apr 2024 11:36:55 +0200 From: Peter Zijlstra To: Mike Rapoport Cc: linux-kernel@vger.kernel.org, Alexandre Ghiti , Andrew Morton , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , Catalin Marinas , Christophe Leroy , "David S. Miller" , Dinh Nguyen , Donald Dutile , Eric Chanudet , Heiko Carstens , Helge Deller , Huacai Chen , Kent Overstreet , Luis Chamberlain , Mark Rutland , Michael Ellerman , Nadav Amit , Palmer Dabbelt , Puranjay Mohan , Rick Edgecombe , Russell King , Song Liu , Steven Rostedt , Thomas Bogendoerfer , Thomas Gleixner , Will Deacon , bpf@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, netdev@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH v4 07/15] mm/execmem, arch: convert remaining overrides of module_alloc to execmem Message-ID: <20240415093655.GH40213@noisy.programming.kicks-ass.net> References: <20240411160051.2093261-1-rppt@kernel.org> <20240411160051.2093261-8-rppt@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240411160051.2093261-8-rppt@kernel.org> On Thu, Apr 11, 2024 at 07:00:43PM +0300, Mike Rapoport wrote: > +static struct execmem_info execmem_info __ro_after_init = { > + .ranges = { > + [EXECMEM_DEFAULT] = { > + .flags = EXECMEM_KASAN_SHADOW, > + .alignment = MODULE_ALIGN, > + }, > + }, > +}; > > +struct execmem_info __init *execmem_arch_setup(void) > { > + unsigned long start, offset = 0; > > + if (kaslr_enabled()) > + offset = get_random_u32_inclusive(1, 1024) * PAGE_SIZE; > > + start = MODULES_VADDR + offset; > + execmem_info.ranges[EXECMEM_DEFAULT].start = start; > + execmem_info.ranges[EXECMEM_DEFAULT].end = MODULES_END; > + execmem_info.ranges[EXECMEM_DEFAULT].pgprot = PAGE_KERNEL; > > + return &execmem_info; > } struct execmem_info __init *execmem_arch_setup(void) { unsigned long offset = 0; if (kaslr_enabled()) offset = get_random_u32_inclusive(1, 1024) * PAGE_SIZE; execmem_info = (struct execmem_info){ .ranges = { [EXECMEM_DEFAULT] = { .start = MODULES_VADDR + offset, .end = MODULES_END, .pgprot = PAGE_KERNEL, .flags = EXECMEM_KASAN_SHADOW, .alignment = 1, }, }, }; return &execmem_info; }