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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 BB2D0D1CA09 for ; Mon, 4 Nov 2024 23:27:56 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Xj71Q6fszz2xdg; Tue, 5 Nov 2024 10:27:54 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=147.75.193.91 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1730762874; cv=none; b=EAOeWb+iCtpVZnMS0BjKq2W+wAgQyVsFPYeUS/vPzHfB0UDmlSZn3SBXJKKFAUdUmyEpIFCDp7hq6xgm1WbqqdRnzd+cNUhpMsKFibrE2JHzsufwsZnXLJXvfmTTJesnXnffC1T1O2+dK9lHeg+h077Z8pcQcGNefajire49JoALTu6yyJF5qn1FJu+OIxwFilq0/kiqtIqdH+d6iEcnq2zufEkUv7Pxm48dMkbauUuSJV9FFgpQz5U/RG263y+HG2nTOA666S6F06Y9kyMGY/2tF53dmUa2oMOxPxMdxF9VXVHhIn8Y6tk8NM8k51DIjODCk2/t2w739YajLI26rw== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1730762874; c=relaxed/relaxed; bh=Q2NDL0EIuphmCCwbl0Vy6MrgKt/ZIc9Yf0NK3jfYrbk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EGzlHb3TjagYEq2u8PV9Uo989J+aJEQTetboXkkaRwHj36gC7ph4oQVpPckszgNd6i8hYgm10CUIjYXljffX1bJ3EBmHLPueQDptQQitZ/dD5TZ7lFuo5DF4aoMpzJ1wAiwObRxAkozLuaQ9uHms9blg/I7s6P1+JpOuO3YekV/4m6poLcnp4bLRTH2JixfZDfL04kHkjsKRuFih9pRyBD6kpvuxVCtwbB+/6XID9nnTfj+mzoT5X/y5DiiFIYTvePT78+5lK1MXKefM5ZnmzPFiLYadofml2DvkCr6ItGXXszFG2bGEEyNJ+Chj0vOD6LIMHS8GxnRE2szBcBvPyA== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=uD6aQVKZ; dkim-atps=neutral; spf=pass (client-ip=147.75.193.91; helo=nyc.source.kernel.org; envelope-from=nathan@kernel.org; receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=uD6aQVKZ; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=147.75.193.91; helo=nyc.source.kernel.org; envelope-from=nathan@kernel.org; receiver=lists.ozlabs.org) Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Xj71M3t0Bz2xYs for ; Tue, 5 Nov 2024 10:27:51 +1100 (AEDT) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 8521EA41B3D; Mon, 4 Nov 2024 23:25:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB3A7C4CECE; Mon, 4 Nov 2024 23:27:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730762866; bh=G7tF/ZaqXBtDJLMTb97Oc+SktZk//Kx3oRVjwm2Gkec=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uD6aQVKZ8xYi+PTTwYupZ6PGdQoZjGxor3CJ6T/KZlWjFxurKitUGg4OsLqeVl22R oTMAQXmWqXP0EO6JaBIYZ9VEqoL35XGUitRTwgi+bJtDhjSL6UuAIcLW7XMfz2tbvE x3MFVpG1yHfJRXfsS6NaRprs6A1rIqEf/OZ8jX2sy+DwUFdsMetTULRZ3iOQoxlOsn 5JoGBx6K0BrtfF9Z0+hxFGtNMWymLR+Dppngi0NxeJnTpYgOWeDN7FHowhaRXk3khA u6nha7LupF4lzkb6ryYEoHDIxLmpv0DY+XiF9diWn7xWUzJjMMZ/7hbbF3UF0ISQXS B++nhrf0RE3MQ== Date: Mon, 4 Nov 2024 16:27:41 -0700 From: Nathan Chancellor To: Mike Rapoport Cc: Andrew Morton , Luis Chamberlain , Andreas Larsson , Andy Lutomirski , Ard Biesheuvel , Arnd Bergmann , Borislav Petkov , Brian Cain , Catalin Marinas , Christoph Hellwig , Christophe Leroy , Dave Hansen , Dinh Nguyen , Geert Uytterhoeven , Guo Ren , Helge Deller , Huacai Chen , Ingo Molnar , Johannes Berg , John Paul Adrian Glaubitz , Kent Overstreet , "Liam R. Howlett" , Mark Rutland , Masami Hiramatsu , Matt Turner , Max Filippov , Michael Ellerman , Michal Simek , Oleg Nesterov , Palmer Dabbelt , Peter Zijlstra , Richard Weinberger , Russell King , Song Liu , Stafford Horne , Steven Rostedt , Suren Baghdasaryan , Thomas Bogendoerfer , Thomas Gleixner , Uladzislau Rezki , Vineet Gupta , Will Deacon , bpf@vger.kernel.org, linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, linux-openrisc@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-trace-kernel@vger.kernel.org, linux-um@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, sparclinux@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH v7 6/8] x86/module: prepare module loading for ROX allocations of text Message-ID: <20241104232741.GA3843610@thelio-3990X> References: <20241023162711.2579610-1-rppt@kernel.org> <20241023162711.2579610-7-rppt@kernel.org> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241023162711.2579610-7-rppt@kernel.org> Hi Mike, On Wed, Oct 23, 2024 at 07:27:09PM +0300, Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > When module text memory will be allocated with ROX permissions, the > memory at the actual address where the module will live will contain > invalid instructions and there will be a writable copy that contains the > actual module code. > > Update relocations and alternatives patching to deal with it. > > Signed-off-by: Mike Rapoport (Microsoft) > Tested-by: kdevops Hopefully the last time you have to hear from me, as I am only experiencing issues with only one of my test machines at this point and it is my only machine that supports IBT, so it seems to point to something specific with the IBT part of the FineIBT support. I notice either a boot hang or an almost immediate reboot (triple fault?). I guess this is how I missed reporting this earlier, as my machine was falling back to the default distribution kernel after the restart and I did not notice I was not actually testing a -next kernel. Checking out the version of this change that is in next-20241104, commit 7ca6ed09db62 ("x86/module: prepare module loading for ROX allocations of text"), it boots with either 'cfi=off' or 'cfi=kcfi' but it exhibits the issues noted above with 'cfi=fineibt'. At the immediate parent, commit b575d981092f ("arch: introduce set_direct_map_valid_noflush()"), all three combinations boot fine. $ uname -r; tr ' ' '\n'