Linux debuggers
 help / color / mirror / Atom feed
From: Stephen Brennan <stephen.s.brennan@oracle.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-debuggers@vger.kernel.org,
	Mike Christie <michael.christie@oracle.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	"Christian Brauner (Microsoft)" <brauner@kernel.org>,
	Petr Mladek <pmladek@suse.com>, Marco Elver <elver@google.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Douglas Anderson <dianders@chromium.org>,
	Maninder Singh <maninder1.s@samsung.com>,
	Luis Chamberlain <mcgrof@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Zhen Lei <thunder.leizhen@huawei.com>,
	Kees Cook <keescook@chromium.org>,
	Zhaoyang Huang <zhaoyang.huang@unisoc.com>,
	Stephen Brennan <stephen.s.brennan@oracle.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Sami Tolvanen <samitolvanen@google.com>
Subject: [PATCH v3 0/1] Introduce CONFIG_DEBUG_INFO_IKCONFIG
Date: Fri, 27 Oct 2023 10:17:55 -0700	[thread overview]
Message-ID: <20231027171756.1241002-1-stephen.s.brennan@oracle.com> (raw)

Hello All,

This adds an alternative for CONFIG_IKCONFIG, which nearly all Linux
distributions disable (probably due to memory considerations). It adds the
section ".debug_linux_ikconfig" to the vmlinux ELF file, which is stripped
out for final images, but retained for debuginfo (objcopy detects the ".debug"
prefix). It is enabled by default whenever IKCONFIG is disabled, so that
debuggers can rely on having the kernel config available.

v1: https://lore.kernel.org/linux-debuggers/20231004165804.659482-1-stephen.s.brennan@oracle.com/T/#t
v2: https://lore.kernel.org/linux-debuggers/20231025223640.1132047-1-stephen.s.brennan@oracle.com/T/#t

Changes v2-v3:

* Added missing dependency on kernel/config_data.gz in kernel/Makefile.

Changes v1-v2:

* I added "default y if IKCONFIG!=y". The result is that whenever DEBUG_INFO=y
  is enabled, and IKCONFIG is not built-in, then DEBUG_INFO_IKCONFIG will get
  enabled automatically. The whole point of this patch is for kernel debuggers
  to be able to rely on having kernel configuration information. The IKCONFIG
  data is quite small compared to kernel debuginfo, and it doesn't change
  anything at runtime. It's safe to enable this automatically, and it's
  important so that distributions (who create debuginfo explicitly to allow
  kernel debugging) will automatically begin creating this info for debuggers.

* Randy Dunlap did review this, but I didn't apply that tag with the update,
  since I understand changing defaults is a major update, and it's a small patch
  to begin with, so I didn't want to misrepresent the review.

Stephen Brennan (1):
  kernel/config: Introduce CONFIG_DEBUG_INFO_IKCONFIG

 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

-- 
2.39.3


             reply	other threads:[~2023-10-27 17:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-27 17:17 Stephen Brennan [this message]
2023-10-27 17:17 ` [PATCH v3 1/1] kernel/config: Introduce CONFIG_DEBUG_INFO_IKCONFIG Stephen Brennan
2023-10-27 18:20   ` Arnd Bergmann
2023-11-01 19:12   ` Luis Chamberlain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231027171756.1241002-1-stephen.s.brennan@oracle.com \
    --to=stephen.s.brennan@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=brauner@kernel.org \
    --cc=dianders@chromium.org \
    --cc=elver@google.com \
    --cc=geert+renesas@glider.be \
    --cc=keescook@chromium.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-debuggers@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maninder1.s@samsung.com \
    --cc=mcgrof@kernel.org \
    --cc=michael.christie@oracle.com \
    --cc=ndesaulniers@google.com \
    --cc=pmladek@suse.com \
    --cc=rdunlap@infradead.org \
    --cc=samitolvanen@google.com \
    --cc=thunder.leizhen@huawei.com \
    --cc=zhaoyang.huang@unisoc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox