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 1C6EF19D8AC for ; Sat, 22 Feb 2025 12:01:25 +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=1740225686; cv=none; b=FuNBkDHOuAdxFlk3Yhu5e8bP43AFWW0GxOzrhx5i++hbGxmQS1/o/2Uec+7Uf/1SN/U9uyQFLylG67iGIpGSTYd4SqahoQOWGu9mV3J+J1Nw+ITebNt9Gd1iAJhFRKm1ZMUFEnLGd2PR97e8rcQXhNtbeur/aDjxNO0aJ+Poep0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740225686; c=relaxed/simple; bh=ErxrHRxVNyRRSA+Zxcbq6GYeVi6K4zpGi+56cJ3AaWU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=k5nf5FliY1UF8Z52gfrQ2bwaaZUQddVdz6luVbtC35C81mhV70GP0TQESeXBl3LQferUnPjmoPb5UTqGO7gi0DTRXv2Up3HC6OcplSKTzWdQUPFnyN5ppdLydradKeaoWvp5M7zZ54449OBjVa64asE1R6cg1MCpgFCxLSgNUZc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oPHLYXVd; 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="oPHLYXVd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4CCDC4CED1; Sat, 22 Feb 2025 12:01:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740225685; bh=ErxrHRxVNyRRSA+Zxcbq6GYeVi6K4zpGi+56cJ3AaWU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oPHLYXVdRqgYLF4ormN6PLbgA2PbEEbbnCB4DXxAK2up9kHnFVLRi1RUwXqqeplPq bP+i28Xs+PtPYG9fWOHSMu2+vpDO/fWW+xXzeZDk0Dl45G0FTCInVPpVc3aB6iLS5f zfImTBXmZ2RTEg9/zt3saf7DEW+I0PXYTsiP7N+wdP9VuHAB5lzn8e0lq4RxL/uSnp M3qGlUFe4JNiMZZXjEX5cY3hxR51ADG9qa84p7W39QcmnWB4zZWIc/O2Roh8DceQaU uSS6aBw1GVj+7xflFzlXYcjyojPBDenTqRcCqTHXPiGBozPrMyN2Ev2fXjswjaTyCn Mngpe08GIMR1Q== Date: Sat, 22 Feb 2025 13:01:15 +0100 From: Ingo Molnar To: Ard Biesheuvel Cc: Linus Torvalds , Ard Biesheuvel , linux-kernel@vger.kernel.org, x86@kernel.org, Tom Lendacky , Nathan Chancellor Subject: Re: [RFC PATCH 1/2] x86/relocs: Improve diagnostic for rejected absolute references Message-ID: References: <20250127114334.1045857-4-ardb+git@google.com> <20250127114334.1045857-5-ardb+git@google.com> 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: * Ard Biesheuvel wrote: > On Mon, 3 Feb 2025 at 10:40, Ingo Molnar wrote: > > > > > > * Ard Biesheuvel wrote: > > > > > On Mon, 27 Jan 2025 at 17:57, Linus Torvalds > > > wrote: > > > > > > > > On Mon, 27 Jan 2025 at 03:43, Ard Biesheuvel wrote: > > > > > > > > > > Absolute reference to symbol '.rodata+0x180' detected in .head.text (0xffffffff820cb4ba). > > > > > > > > Do we have any symbol name lookup logic anywhere? > > > > > > > > > > I can look into that. In this particular case, though, there is no > > > symbol to look up as it is a anonymous jump table generated by the > > > compiler. And the function name would be inaccurate too, as > > > snp_cpuid_postprocess() got inlined into its caller. But I guess with > > > the right DWARF data, at least the call site could be narrowed down a > > > bit better. > > > > So patch #2 is now upstream, but should I apply this diagnostic patch > > as-is, or will there be a -v2? > > > > I'm looking into this. But give the points above, I'm reaching the > conclusion that producing a better diagnostic based solely on vmlinux > (which may be built without debug info) is intractable, and not even > the DWARF metadata will describe a compiler generated jump table using > a named ELF symbol. > > So I am also looking into isolating the startup code like I did for > arm64 (and which has been adopted by RISC-V as well), but this is > rather hairy on x86 so it will take some time. But once that lands, > this diagnostic can be removed. > > So I will leave it up to you to decide whether to merge this > improvement for now, or revert the diagnostic as you suggested before. > This code has already identified some issues that were subsequently > fixed, so it has already served its purpose. So after another 2 weeks there's been no new upstream regressions I'm aware of, so - knock on wood - it seems we can leave the die() in place? But could we perhaps make it more debuggable, should it trigger - such as not removing the relevant object file and improving the message? I.e. make the build failure experience Linus had somewhat more palatable... Thanks, Ingo