From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 86F14285CA7; Mon, 5 Jan 2026 21:15:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767647746; cv=none; b=T6WQKqcaP29mLFhCrU3btpntRltCylKgghA2j1p+ECs2IXIzgHP5SIRw+an5uYIkenhrLAN/S3IEUZ4I/hldjJoh+gAyxx+YC0alU+wxa/MS5kaOvPvGpK/taCALKlODN6vObXFLRsSyx7NvWEgDfEeZ0Rpkw7+Og/QtRPmKaHI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767647746; c=relaxed/simple; bh=IM2DuJa9reEiCLBZk8E9Dct8k60mL22ZGzV0MUiRdLw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SCwyxLTv7yG1YeTtcSLwgFevIy9/b6Xc9Hd/Ls4Jc2rQGCLzinXkQW+/Y6cEQJQAP1ZiAAx4bpunvi0QgVTnzjW7IrIVUPN7V1wXDKKpWjHDklGMqTskuHjmcdRzMQwKuZ0Zvfpd8m8y65oJnygPL/wCPZONesGTtYaoFGKjcqE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=El51bi7+; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="El51bi7+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98D92C116D0; Mon, 5 Jan 2026 21:15:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1767647746; bh=IM2DuJa9reEiCLBZk8E9Dct8k60mL22ZGzV0MUiRdLw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=El51bi7+imH1giJ9Ep7MrHAH2+KZ4vdS0Xc4iaeVVVorQyVRxjbDjwfylCWGA24M2 pQWhRim60LLFJZimahW/BvYZ/panBYw3o1W99hKzDBSrDcVnvSNLADmXQ5ICCL5fIZ IAoA67GeM65lzXWBH2OtCgbvCPvke7mGAUYM4e9wZsqy9BGJ7+WyhHa0FgdtTcE37s RzK7G/zlLiGfFW/5pAT6jMcgu2T1jI610MpQZ3gjF2c/UBhzw4gB/xCQuQWfekMDYb aIo5RrU3Ne8S5jJQJk+s9IVIQCrZTgDm9ULPpDbFgBN6QvnY+CkqJQ+oEWXmLv+V13 Z0rz2XAhrxriA== Date: Mon, 5 Jan 2026 21:15:40 +0000 From: Will Deacon To: Breno Leitao Cc: Catalin Marinas , Mark Rutland , Laura Abbott , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Steven Rostedt , Masami Hiramatsu , puranjay@kernel.org, usamaarif642@gmail.com, kernel-team@meta.com, stable@vger.kernel.org Subject: Re: [PATCH] arm64/mm: Fix annotated branch unbootable kernel Message-ID: References: <20251231-annotated-v1-1-9db1c0d03062@debian.org> Precedence: bulk X-Mailing-List: linux-trace-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: <20251231-annotated-v1-1-9db1c0d03062@debian.org> On Wed, Dec 31, 2025 at 04:44:05AM -0800, Breno Leitao wrote: > The arm64 kernel doesn't boot with annotated branches > (PROFILE_ANNOTATED_BRANCHES) enabled and CONFIG_DEBUG_VIRTUAL together. > > Bisecting it, I found that disabling branch profiling in arch/arm64/mm > solved the problem. Narrowing down a bit further, I found that > physaddr.c is the file that needs to have branch profiling disabled to > get the machine to boot. > > I suspect that it might invoke some ftrace helper very early in the boot > process and ftrace is still not enabled(!?). > > Disable branch profiling for physaddr.o to allow booting an arm64 > machine with CONFIG_PROFILE_ANNOTATED_BRANCHES and > CONFIG_DEBUG_VIRTUAL together. > > Cc: stable@vger.kernel.org > Fixes: ec6d06efb0bac ("arm64: Add support for CONFIG_DEBUG_VIRTUAL") > Signed-off-by: Breno Leitao > --- > Another approach is to disable profiling on all arch/arm64 code, similarly to > x86, where DISABLE_BRANCH_PROFILING is called for all arch/x86 code. See > commit 2cbb20b008dba ("tracing: Disable branch profiling in noinstr > code"). Yes, let's start with arch/arm64/. We know that's safe and then if somebody wants to make it finer-grained, it's on them to figure out a way to do it without playing whack-a-mole. Will