Skip to contentSkip to conversation

xen: some CONFIG_DEBUG_INFO changes

PATCH In review Juergen Gross 3 participants 5 messages Apr 5, 2023 – Apr 18, 2023

lore
Share & tools
lore
#0 lore raw

v3 cover xen: some CONFIG_DEBUG_INFO changes

Enabling crash dump analysis of the hypervisor requires the hypervisor having been built with CONFIG_DEBUG_INFO enabled. Today this requires either CONFIG_DEBUG or CONFIG_EXPERT set, which are both not security supported.

This small series changes that in order to allow security supported Xen builds with the capability to do crash dump analysis via the "crash" tool.

Note that due to problems with test machines proper support for EFI booted systems hasn't been verified, so this will likely need some more work.

Changes in V2:
- comments addressed

Changes in V3:
- comments addressed

Juergen Gross (2):
xen: move CONFIG_DEBUG_INFO out of EXPERT section
xen: update CONFIG_DEBUG_INFO help text

 xen/Kconfig.debug | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)
Signature · 1 line
2.35.3
#1 lore raw

PATCH v3 1/2 xen: move CONFIG_DEBUG_INFO out of EXPERT section

In order to support hypervisor analysis of crash dumps, xen-syms needs to contain debug_info. It should be allowed to configure the hypervisor to be built with CONFIG_DEBUG_INFO in non-debug builds without having to enable EXPERT.

Using a rather oldish gcc (7.5) it was verified that code generation doesn't really differ between CONFIG_DEBUG_INFO on or off without CONFIG_DEBUG being set (only observed differences were slightly different symbol addresses, verified via "objdump -d", resulting from the different config.gz in the binary). The old gcc version selection was based on the assumption, that newer gcc won't regress in this regard.

So move CONFIG_DEBUG_INFO out of the section guarded by EXPERT.

It should be mentioned that there have been reports that the linking of the xen.efi might take considerably longer with CONFIG_DEBUG_INFO selected when using newer binutils.

---
V2:
- expanded commit message (Jan Beulich)
V3:
- move DEBUG_INFO block to the end of the file (Jan Beulich)

---
 xen/Kconfig.debug | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
xen/Kconfig.debug +7 -7
index fad3050d4f..279dbe8274 100644
@@ -28,13 +28,6 @@ config GDBSX
 	  If you want to enable support for debugging guests from dom0 via
 	  gdbsx then say Y.
 
-config DEBUG_INFO
-	bool "Compile Xen with debug info"
-	default y
-	---help---
-	  If you say Y here the resulting Xen will include debugging info
-	  resulting in a larger binary image.
-
 config FRAME_POINTER
 	bool "Compile Xen with frame pointers"
 	default DEBUG
@@ -132,4 +125,11 @@ source "arch/$(SRCARCH)/Kconfig.debug"
 
 endif # DEBUG || EXPERT
 
+config DEBUG_INFO
+	bool "Compile Xen with debug info"
+	default DEBUG
+	help
+	  If you say Y here the resulting Xen will include debugging info
+	  resulting in a larger binary image.
+
 endmenu
Signature · 1 line
2.35.3
Tested-by on v3 1/2
#2 lore raw

RE: [PATCH v3 1/2] xen: move CONFIG_DEBUG_INFO out of EXPERT section

Hi Juergen,

Quoted 67 lines

From: Xen-devel <[email protected]> On Behalf Of Juergen Gross
Sent: Wednesday, April 5, 2023 3:56 PM
To: [email protected]
Cc: Juergen Gross <[email protected]>; Andrew Cooper <[email protected]>; George Dunlap <[email protected]>; Jan Beulich <[email protected]>; Julien Grall <[email protected]>; Stefano Stabellini <[email protected]>; Wei Liu <[email protected]>
Subject: [PATCH v3 1/2] xen: move CONFIG_DEBUG_INFO out of EXPERT section

In order to support hypervisor analysis of crash dumps, xen-syms needs to contain debug_info. It should be allowed to configure the hypervisor to be built with CONFIG_DEBUG_INFO in non-debug builds without having to enable EXPERT.

Using a rather oldish gcc (7.5) it was verified that code generation doesn't really differ between CONFIG_DEBUG_INFO on or off without CONFIG_DEBUG being set (only observed differences were slightly different symbol addresses, verified via "objdump -d", resulting from the different config.gz in the binary). The old gcc version selection was based on the assumption, that newer gcc won't regress in this regard.

So move CONFIG_DEBUG_INFO out of the section guarded by EXPERT.

It should be mentioned that there have been reports that the linking of the xen.efi might take considerably longer with CONFIG_DEBUG_INFO selected when using newer binutils.

---
V2:
- expanded commit message (Jan Beulich)
V3:
- move DEBUG_INFO block to the end of the file (Jan Beulich)

---
 xen/Kconfig.debug | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
xen/Kconfig.debug +7 -8
index fad3050d4f..279dbe8274 100644
@@ -28,13 +28,6 @@ config GDBSX
 	  If you want to enable support for debugging guests from dom0 via
 	  gdbsx then say Y.
 
-config DEBUG_INFO
-	bool "Compile Xen with debug info"
-	default y
-	---help---
-	  If you say Y here the resulting Xen will include debugging info
-	  resulting in a larger binary image.
-
 config FRAME_POINTER
 	bool "Compile Xen with frame pointers"
 	default DEBUG
@@ -132,4 +125,11 @@ source "arch/$(SRCARCH)/Kconfig.debug"
 
 endif # DEBUG || EXPERT
 
+config DEBUG_INFO
+	bool "Compile Xen with debug info"
+	default DEBUG
+	help
+	  If you say Y here the resulting Xen will include debugging info
+	  resulting in a larger binary image.
+
 endmenu
--
Quoted 2 lines

2.35.3

For the non-efi xen:

Dietmar.

#3 lore raw

PATCH v3 2/2 xen: update CONFIG_DEBUG_INFO help text

In reply to Juergen Gross

Update the help text of the CONFIG_DEBUG_INFO option to be a little bit more specific.

---
V2:
- expand help text, especially mentioning INSTALL_EFI_STRIP (Jan Beulich)
V3:
- expand help text even more (Jan Beulich)

---
 xen/Kconfig.debug | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
xen/Kconfig.debug +10 -2
index 279dbe8274..94e818ee09 100644
@@ -129,7 +129,15 @@ config DEBUG_INFO
 	bool "Compile Xen with debug info"
 	default DEBUG
 	help
-	  If you say Y here the resulting Xen will include debugging info
-	  resulting in a larger binary image.
+	  Say Y here if you want to build Xen with debug information. This
+	  information is needed e.g. for doing crash dump analysis of the
+	  hypervisor via the "crash" tool.
+	  Saying Y will increase the size of the xen-syms and xen.efi
+	  binaries. In case the space on the EFI boot partition is rather
+	  limited, you may want to install a stripped variant of xen.efi in
+	  the EFI boot partition (look for "INSTALL_EFI_STRIP" in
+	  docs/misc/efi.pandoc for more information - when not using
+	  "make install-xen" for installing xen.efi, stripping needs to be
+	  done outside the Xen build environment).
 
 endmenu
Signature · 1 line
2.35.3
Acked-by on the v3 series
#4 lore raw
In reply to Juergen Gross
Quoted 19 lines · Juergen Gross

Enabling crash dump analysis of the hypervisor requires the hypervisor having been built with CONFIG_DEBUG_INFO enabled. Today this requires either CONFIG_DEBUG or CONFIG_EXPERT set, which are both not security supported.

This small series changes that in order to allow security supported Xen builds with the capability to do crash dump analysis via the "crash" tool.

Note that due to problems with test machines proper support for EFI booted systems hasn't been verified, so this will likely need some more work.

Changes in V2:
- comments addressed

Changes in V3:
- comments addressed

Quoted 6 lines

Juergen Gross (2):
xen: move CONFIG_DEBUG_INFO out of EXPERT section
xen: update CONFIG_DEBUG_INFO help text

 xen/Kconfig.debug | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

Seeing no-one else showing any interest either way:

Jan