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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF8ECC25B47 for ; Fri, 27 Oct 2023 18:21:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232643AbjJ0SV2 (ORCPT ); Fri, 27 Oct 2023 14:21:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231594AbjJ0SV1 (ORCPT ); Fri, 27 Oct 2023 14:21:27 -0400 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C8D118A; Fri, 27 Oct 2023 11:21:25 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id BCAB23200991; Fri, 27 Oct 2023 14:21:20 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Fri, 27 Oct 2023 14:21:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1698430880; x=1698517280; bh=kq Kh9AT18iwbdinBisTYEW8NEyJ9dHdSrh4I4KDbbCg=; b=OlQzfTgaBznW8G1AAC 678uEBo1wcRy8QXbXPJrmd2Bhdt086OqcMMcQh7Py2+CiD9PZ2x7bF3WaGkCbEIF WX9kgWEShCOZSVOa7qeviHy3ycPdqga1yKkZheSo4xCh8URzm/n+UAWOMM640tYc WhDDkyapXXQs1o+vZG8t9LhcqwcdZeR6Ij5EDztNNfVh6ebw4F5rr4C2W4Wt1egH q+gSPHEzv4vHleEWvipbqLZmAFE3Q58Lsrk4P+SU4wGbtcoDnADuRpAtgnfsp4bb K0qoDbF28lQgjKplzbhM8ZFwirt7EYPjZtDWnmogBqFuErYYWFDu/i2xxO+b7ojR +ahw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1698430880; x=1698517280; bh=kqKh9AT18iwbd inBisTYEW8NEyJ9dHdSrh4I4KDbbCg=; b=Uu2eWeEtm12OFZkAgZtZwC05t0MFc D4hICCKxVhWGjGW6e8pov8z58/t34xXpNouDi4XeCQRJLSGTvMz07KKew7jrEnyY tWmAPX39D9l6nAAViIgihrgR99El5I5VMf3SPcl5oq2V5Vp+zrXXQMlR40WYzoye dx2BmoblD3x2hGiXobyQJwGP+i6UBfyDhWA7L7ppmWbjkihv9ygcRYMUs9kJhxNO a2UpdlTWiFNk6H6O9v8g1mVZzoeRSHOlrDQ5/P9pNWV6KeogheSlD8oxoky8DiLT MLtaB+n39kwt2h6KlnIjIdEXP6NFxIP/DKokj4HrTx55qtGchO5Fq1y7Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrleeggdduvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 2ABF6B60089; Fri, 27 Oct 2023 14:21:18 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1048-g9229b632c5-fm-20231019.001-g9229b632 MIME-Version: 1.0 Message-Id: In-Reply-To: <20231027171756.1241002-2-stephen.s.brennan@oracle.com> References: <20231027171756.1241002-1-stephen.s.brennan@oracle.com> <20231027171756.1241002-2-stephen.s.brennan@oracle.com> Date: Fri, 27 Oct 2023 20:20:56 +0200 From: "Arnd Bergmann" To: "Stephen Brennan" Cc: Linux-Arch , linux-kernel@vger.kernel.org, linux-debuggers@vger.kernel.org, "Mike Christie" , "Geert Uytterhoeven" , "Christian Brauner" , "Petr Mladek" , "Marco Elver" , "Randy Dunlap" , "Doug Anderson" , "Maninder Singh" , "Luis Chamberlain" , "Nick Desaulniers" , "Zhen Lei" , "Kees Cook" , "Zhaoyang Huang" , "Andrew Morton" , "Sami Tolvanen" Subject: Re: [PATCH v3 1/1] kernel/config: Introduce CONFIG_DEBUG_INFO_IKCONFIG Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-debuggers@vger.kernel.org On Fri, Oct 27, 2023, at 19:17, Stephen Brennan wrote: > The option CONFIG_IKCONFIG allows the gzip compressed kernel > configuration to be included into vmlinux or a module. In these cases, > debuggers can access the config data and use it to adjust their behavior > according to the configuration. However, distributions rarely enable > this, likely because it uses a fair bit of kernel memory which cannot be > swapped out. > > This means that in practice, the kernel configuration is rarely > available to debuggers. > > So, introduce an alternative, CONFIG_DEBUG_INFO_IKCONFIG. This strategy, > which is only available if IKCONFIG is not already built-in, adds a > section ".debug_linux_ikconfig", to the vmlinux ELF. It will be stripped > out of the final images, but will remain in the debuginfo files. So > debuggers which rely on vmlinux debuginfo can have access to the kernel > configuration, without incurring a cost to the kernel at runtime. > > The configuration is enabled whenever DEBUG_INFO=y and IKCONFIG!=y. The > added section is not large compared to debug info sizes. It won't affect > the runtime kernel at all, and this default will ensure that > distributions intending to create useful debuginfo will get this new > addition for kernel debuggers. > > Signed-off-by: Stephen Brennan > --- > include/asm-generic/vmlinux.lds.h | 3 ++- > kernel/Makefile | 2 ++ > kernel/configs-debug.S | 18 ++++++++++++++++++ > lib/Kconfig.debug | 15 +++++++++++++++ > 4 files changed, 37 insertions(+), 1 deletion(-) > create mode 100644 kernel/configs-debug.S For asm-generic: Acked-by: Arnd Bergmann