[PATCH v2] xen/Kconfig: livepatch-build-tools requires debug information

Roger Pau Monne posted 1 patch 11 months, 4 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20241108101025.82228-1-roger.pau@citrix.com
xen/Kconfig.debug | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH v2] xen/Kconfig: livepatch-build-tools requires debug information
Posted by Roger Pau Monne 11 months, 4 weeks ago
The tools infrastructure used to build livepatches for Xen
(livepatch-build-tools) consumes some DWARF debug information present in
xen-syms to generate a livepatch (see livepatch-build script usage of readelf
-wi).

The current Kconfig defaults however will enable LIVEPATCH without DEBUG_INFO
on release builds, thus providing a default Kconfig selection that's not
suitable for livepatch-build-tools even when LIVEPATCH support is enabled,
because it's missing the DWARF debug section.

Fix by selecting DEBUG_INFO by default if LIVEPATCH is enabled.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Changes since v1:
 - Don't use select.
---
 xen/Kconfig.debug | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug
index 07ff7eb7ba83..c4a8d86912e0 100644
--- a/xen/Kconfig.debug
+++ b/xen/Kconfig.debug
@@ -133,7 +133,7 @@ endif # DEBUG || EXPERT
 
 config DEBUG_INFO
 	bool "Compile Xen with debug info"
-	default DEBUG
+	default DEBUG || LIVEPATCH
 	help
 	  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
-- 
2.46.0


Re: [PATCH v2] xen/Kconfig: livepatch-build-tools requires debug information
Posted by Jan Beulich 11 months, 4 weeks ago
On 08.11.2024 11:10, Roger Pau Monne wrote:
> The tools infrastructure used to build livepatches for Xen
> (livepatch-build-tools) consumes some DWARF debug information present in
> xen-syms to generate a livepatch (see livepatch-build script usage of readelf
> -wi).
> 
> The current Kconfig defaults however will enable LIVEPATCH without DEBUG_INFO
> on release builds, thus providing a default Kconfig selection that's not
> suitable for livepatch-build-tools even when LIVEPATCH support is enabled,
> because it's missing the DWARF debug section.
> 
> Fix by selecting DEBUG_INFO by default if LIVEPATCH is enabled.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

Yet I wonder whether this now faces Andrew's opposition.

Jan

Re: [PATCH v2] xen/Kconfig: livepatch-build-tools requires debug information
Posted by Roger Pau Monné 11 months, 4 weeks ago
On Fri, Nov 08, 2024 at 11:24:12AM +0100, Jan Beulich wrote:
> On 08.11.2024 11:10, Roger Pau Monne wrote:
> > The tools infrastructure used to build livepatches for Xen
> > (livepatch-build-tools) consumes some DWARF debug information present in
> > xen-syms to generate a livepatch (see livepatch-build script usage of readelf
> > -wi).
> > 
> > The current Kconfig defaults however will enable LIVEPATCH without DEBUG_INFO
> > on release builds, thus providing a default Kconfig selection that's not
> > suitable for livepatch-build-tools even when LIVEPATCH support is enabled,
> > because it's missing the DWARF debug section.
> > 
> > Fix by selecting DEBUG_INFO by default if LIVEPATCH is enabled.
> > 
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> 
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> 
> Yet I wonder whether this now faces Andrew's opposition.

You have both options now on the list.  I don't mind that much, just
want to get this sorted.  Either patch is better than the current
situation.

Thanks, Roger.