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 E2BC7E7C4E7 for ; Wed, 4 Oct 2023 17:52:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233852AbjJDRwd (ORCPT ); Wed, 4 Oct 2023 13:52:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233325AbjJDRwb (ORCPT ); Wed, 4 Oct 2023 13:52:31 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1C6EA6; Wed, 4 Oct 2023 10:52:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Content-ID:Content-Description; bh=mo3SyRE4KU0QzJxDQXUPBvxPA9G+jjLznhNMOrDLoDM=; b=3oPq2TOpYHgcYcsR7E5Nqtt1vb T+i6KveGE0ktmSIadiY0DVB5ch9450DddZ4PdOqS+iDOcflTW9MTdMbG2C9YxRpIRmujoHdyPPjPw /O7lOjglJY+zq6RK08F7n54ZIaftQQDDOhmMuhktVpOSRLs/VohqILMBaF0R4HUGqBdpq425dOOux XcqG4QYfjj+FqCZv8aoWbPJIRZuGxs9RefI/o/spj1wMzqg9Upun3oVoElRDgpRXva+S2VOR7lcA2 Igd0LyObVOa33uIY7JTQl0zRXQociPYtkdOH7Mzb0yKGkuv8jo4psZcwa8lreWLg8edPkVQmUa7Bq gKqQ9xFQ==; Received: from [50.53.46.231] (helo=[192.168.254.15]) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qo62q-000dsZ-24; Wed, 04 Oct 2023 17:52:24 +0000 Message-ID: <2d690a95-67c6-45cb-91a1-4fbac09e1224@infradead.org> Date: Wed, 4 Oct 2023 10:52:23 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/1] kernel/config: Introduce CONFIG_DEBUG_INFO_IKCONFIG Content-Language: en-US To: Stephen Brennan , Arnd Bergmann Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-debuggers@vger.kernel.org References: <20231004165804.659482-1-stephen.s.brennan@oracle.com> <20231004165804.659482-2-stephen.s.brennan@oracle.com> From: Randy Dunlap In-Reply-To: <20231004165804.659482-2-stephen.s.brennan@oracle.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 10/4/23 09:58, 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. x86_64 allmodconfig is 91 KB gzipped... oh well. Reviewed-by: Randy Dunlap > 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. > > Signed-off-by: Stephen Brennan > --- > include/asm-generic/vmlinux.lds.h | 3 ++- > kernel/Makefile | 1 + > kernel/configs-debug.S | 18 ++++++++++++++++++ > lib/Kconfig.debug | 14 ++++++++++++++ > 4 files changed, 35 insertions(+), 1 deletion(-) > create mode 100644 kernel/configs-debug.S -- ~Randy