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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 910D2C4167B for ; Tue, 7 Nov 2023 10:45:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+4cnv5x7irIDutRJrscKtVoIM/ONqSANCD6iLpm0bYA=; b=q8PbeZvc4i9Ho1 6Pi9Ch6M13tV56eeRwIHBihV55zQzU3Yo3D43ITUCSB9JX+PxoRlxJ/c4P+zeohkOqZc5H2YvjCzS FVVBEzsZnPjRTz2OQg49ijrFCxj8fSbiedkMscgopKghgWPKJW2E1ztYGPF+vwWt8UW866gNfRu+x 523wRFQZadIKn2jMg+0pqOgt5Ji7ub3kLlidmSEG1XqV1RNcMRyHblG0RmRrAZo2xexjg25u7kr2Z HnDcKfxDgNqOrxXPSaieGDTX34S3L6rI0tTZJW1O2/9RVrW8MTs81UtsAmlAaJEFNn0hkp1um9Ix2 VSBT32w3+E1yS41pxvMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r0JZt-0017fc-06; Tue, 07 Nov 2023 10:45:01 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r0JZp-0017e2-2q; Tue, 07 Nov 2023 10:44:59 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 3E35061161; Tue, 7 Nov 2023 10:44:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6AF0EC433C7; Tue, 7 Nov 2023 10:44:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699353896; bh=6KvSSAyHzV1t/xzun1oJg0AqCmYPNZNoG1yjrk+2N5g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EfHMKmIUi7LClGqSTR82uTGSALdsGhooGkAQNBOKzdAx9XrKCS32CwP6rRNlINeJp fTBcOh2CbrNgz5T9wN8X4IfDIz30xCLXq2htrhQAdC3JQhS9flLyk/+pf5MtKIc1uc JGySGdYEdfIvLpVTQJXhgpJr9YrJTitMM+csMdn+xILBQI2oGOVjB/sYO87FSSlzde FSNahA1CtFFCQyIxON1Z1I4OewRIeg1rULpA/yqisw7axPef9I0RY6dTvW/rbObEf0 ODLYbBKyXYy654yF6yL9+/nSFia7MKf5WBhUfT/JXvT2gH/1if2QXy5oq+hmLNVTje IOMZOtUYIwdeQ== Date: Tue, 7 Nov 2023 10:44:47 +0000 From: Will Deacon To: Mike Rapoport Cc: linux-kernel@vger.kernel.org, Andrew Morton , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , Catalin Marinas , Christophe Leroy , "David S. Miller" , Dinh Nguyen , Heiko Carstens , Helge Deller , Huacai Chen , Kent Overstreet , Luis Chamberlain , Mark Rutland , Michael Ellerman , Nadav Amit , "Naveen N. Rao" , Palmer Dabbelt , Puranjay Mohan , Rick Edgecombe , Russell King , Song Liu , Steven Rostedt , Thomas Bogendoerfer , Thomas Gleixner , bpf@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 v3 04/13] mm/execmem, arch: convert remaining overrides of module_alloc to execmem Message-ID: <20231107104446.GA19133@willie-the-truck> References: <20230918072955.2507221-1-rppt@kernel.org> <20230918072955.2507221-5-rppt@kernel.org> <20231023171420.GA4041@willie-the-truck> <20231026085800.GK2824@kernel.org> <20231026102438.GA6924@willie-the-truck> <20231030070053.GL2824@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231030070053.GL2824@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231107_024458_004524_8A54C914 X-CRM114-Status: GOOD ( 27.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Oct 30, 2023 at 09:00:53AM +0200, Mike Rapoport wrote: > On Thu, Oct 26, 2023 at 11:24:39AM +0100, Will Deacon wrote: > > On Thu, Oct 26, 2023 at 11:58:00AM +0300, Mike Rapoport wrote: > > > On Mon, Oct 23, 2023 at 06:14:20PM +0100, Will Deacon wrote: > > > > On Mon, Sep 18, 2023 at 10:29:46AM +0300, Mike Rapoport wrote: > > > > > diff --git a/arch/arm64/kernel/module.c b/arch/arm64/kernel/module.c > > > > > index dd851297596e..cd6320de1c54 100644 > > > > > --- a/arch/arm64/kernel/module.c > > > > > +++ b/arch/arm64/kernel/module.c > > ... > > > > > > - if (module_direct_base) { > > > > > - p = __vmalloc_node_range(size, MODULE_ALIGN, > > > > > - module_direct_base, > > > > > - module_direct_base + SZ_128M, > > > > > - GFP_KERNEL | __GFP_NOWARN, > > > > > - PAGE_KERNEL, 0, NUMA_NO_NODE, > > > > > - __builtin_return_address(0)); > > > > > - } > > > > > + module_init_limits(); > > > > > > > > Hmm, this used to be run from subsys_initcall(), but now you're running > > > > it _really_ early, before random_init(), so randomization of the module > > > > space is no longer going to be very random if we don't have early entropy > > > > from the firmware or the CPU, which is likely to be the case on most SoCs. > > > > > > Well, it will be as random as KASLR. Won't that be enough? > > > > I don't think that's true -- we have the 'kaslr-seed' property for KASLR, > > but I'm not seeing anything like that for the module randomisation and I > > also don't see why we need to set these limits so early. > > x86 needs execmem initialized before ftrace_init() so I thought it would be > best to setup execmem along with most of MM in mm_core_init(). > > I'll move execmem initialization for !x86 to a later point, say > core_initcall. Thanks, Mike. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel