From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 A53D424DCF6 for ; Thu, 13 Aug 2026 02:25:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786587935; cv=none; b=rOm7kEG+JdgxRzVYFU6Zxh16FYOXhF402kLF1MM5rVLRfDvMAeytdPY0p89gqDI29BkSqI4g6o3VoCLh7qAeR5meg32f9ZM0EmXQf+4m9g5DzDuNbWblntlBnBKthrh6aSR4R0OSQ/mEtLM00BIEUFPDDcuBdMZVEf2JSyaXnCM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786587935; c=relaxed/simple; bh=0zlvBm07D7zma1OrJsZd6BZb5hP9JB/aYZeKCT8tVc8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HpIkIo+rxLmTyTkqxS6Z9cdUN3y39bARyqDhU724dVtDwlrOCJbKU8LwsqrwFHVDwnVN0LAJIc1rBSJ6qMh8aQHqN7yHMUuqMh17OgxLstwMvv5L9kNgPL4wjKmTrfhgTkkpyTwwFWdnEekNaFlZgHlvOqImpHW/Cao1k6Nmm7g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GCuYUxX1; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GCuYUxX1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B49441F00A3D; Thu, 13 Aug 2026 02:25:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786587934; bh=1ED0aXaLuZYw1bazTncgWLLGV85AkjzKY6UwsXWsviE=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=GCuYUxX1LBIJtF0rjhD7pA/K48vn+4nr6n98j/0wrmzIoj45ryJrrXhYZDm8jQhTY 9JJNnXnvCp81XSALOsan2A/HSDfQkyikYtOkQw6JvxiyF1s9TsvauW62fHeKZRdNmq cDkBRWVkmCir4GdCUnrSimiO7f3nBosAbPlKxEt03bFJt0jlFsvXujNf157EVOYMxj qe6vbGG8Psw6coDcPty+nRP5nKzDmzxxQ0dvuH1csnLcr+09vN5/g42BIkylk+PlPP iRfrAq4HXjaeJ6MF5eimX8RJ1xs11BjFSL6ZlvUJ2StJcjUCvDtzdQuo1Ny6FU7mBY hrjosd1ONcquA== Date: Wed, 12 Aug 2026 19:25:32 -0700 From: Josh Poimboeuf To: Ard Biesheuvel Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com, Mark Brown , Nick Desaulniers Subject: Re: [PATCH 1/2] arm64: module: Emit BTI veneers for cross-section calls Message-ID: References: <20260812162058.612202-4-ardb@kernel.org> <20260812162058.612202-5-ardb@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=utf-8 Content-Disposition: inline In-Reply-To: On Wed, Aug 12, 2026 at 02:52:04PM -0700, Josh Poimboeuf wrote: > On Wed, Aug 12, 2026 at 06:21:00PM +0200, Ard Biesheuvel wrote: > > --- a/arch/arm64/Kconfig > > +++ b/arch/arm64/Kconfig > > @@ -2114,8 +2114,6 @@ config ARM64_BTI_KERNEL > > depends on CC_HAS_BRANCH_PROT_PAC_RET_BTI > > # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94697 > > depends on !CC_IS_GCC || GCC_VERSION >= 100100 > > - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106671 > > - depends on !CC_IS_GCC > > This doesn't work for livepatch though, and removing the "depends on > !CC_IS_GCC" is a livepatch regression as it broadly increases the > likelihood of ARM64_BTI_KERNEL (default y) getting enabled. > > So "livepatch broken on arm64 clang 21+" now becomes "livepatch broken on arm64". > > So either ARM64_BTI_KERNEL needs to depend on !LIVEPATCH (which will > keep BTI disabled for most distros), or we need a different approach > which uses __vmalloc_node_range() to allocate a veneer within 128MB of > the target. I can try to write that up. Hm, does the omitted BTI also break long intra-vmlinux branches for vmlinux text size > 128MB? The linker adds veneers for that case, but doesn't make them BTI-friendly unless GNU_PROPERTY_AARCH64_FEATURE_1_BTI is set on *all* .o files, which is not currently happening for .S files. And when I force that bit with "-z force-bti" on a 700MB text allyesconfig vmlinux with 22k linker-created veneers, it's crashes the GNU linker :-/ Seems kernel BTI is borked all around... -- Josh