Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2770935rdb; Wed, 4 Oct 2023 10:52:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGFFBboX3UuqHEES9DODlneX8pE0pS2pHtIaQ+fMDotadLIO1w1djSVHbMBBQBCgOD2m8mc X-Received: by 2002:a17:903:1252:b0:1c6:d70:144d with SMTP id u18-20020a170903125200b001c60d70144dmr3526849plh.34.1696441961318; Wed, 04 Oct 2023 10:52:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696441961; cv=none; d=google.com; s=arc-20160816; b=HxuHJQpUPnJadS3QEsoQLDof891N5wMvGLIRNh9bG/2/jbi7CTw6py5ruhYm7W5Jcp GfG/02HGx0kgaTZoUkm5Lrkh/ik6u4/BbNfoIBPdhlNrOBvIRG0kXX1mFiDSybCv7m8x e8F/kPt+Zk/HY7cXzseul16U2Lt8wFxYWQ+q4udlkwfh/gkSIrdl0uJpoas3JMAnhvWv sTV2T+c7FxXj0DjyKlcm+FL3Dti05M1Ycbs2MEC+9Ta502nkNpBwLDXOy9Q5a+ncngzc n1U7NzyTgx4Z5j3NBWLurN8epiAl837f/yaeDeprrB8Wax3GJG8aevLcYiQSaR0bmFCF +nxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=mo3SyRE4KU0QzJxDQXUPBvxPA9G+jjLznhNMOrDLoDM=; fh=s8riaU3nZuw3gsPwx1gLD9TNKSRcjUSRBAsWKW6pNxs=; b=rqUkk70+dOP/V8PMng5W2dQzKs/uS/KYrr1qzF8h22bI0a3qu807NrG0PVWg2KlQWr lIlYiUqXIXTmlYZtzTID0fi0yqMZ5MaUNSvv4pBiMEfGHu7NQnsGGR1onLfYTzSPv8BP kbO8mzxyCC7QS1tHEUrcuT3ntdZ1X9YsMnE3+dVN9WKJzVzS5w1DAvhQwDSEcZxUhovG 2UgNlVM1dUE+Gq0IsDlcARGCneyneBggiVD4MIO/5z4/8pgr3sZ4az+3/MTvBAJS6hXS Vz+dIle3TapIyHI1e2Z5ihUONnALUt8afJJcZDlX8wjIeVfH8P7ZiTYtuKESr8zJwSft Gxcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=3oPq2TOp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id r10-20020a170903410a00b001b6788a54f4si3767206pld.191.2023.10.04.10.52.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 10:52:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=3oPq2TOp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 7545E8068956; Wed, 4 Oct 2023 10:52:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233541AbjJDRwc (ORCPT + 99 others); Wed, 4 Oct 2023 13:52:32 -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 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 04 Oct 2023 10:52:38 -0700 (PDT) X-Spam-Level: ** 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