Skip to contentSkip to conversation

livepatch: Make livepatch dependent on !TRIM_UNUSED_KSYMS

PATCH Applied Miroslav Benes 4 participants 4 messages May 26, 2017 – May 27, 2017 Live patching

lore
Share & tools
lore

Miroslav Benes

author maintainer
#0 lore raw

PATCH 1/1 livepatch: Make livepatch dependent on !TRIM_UNUSED_KSYMS

If TRIM_UNUSED_KSYMS is enabled, all unneeded exported symbols are made unexported. Two-pass build of the kernel is done to find out which symbols are needed based on a configuration. This effectively complicates things for out-of-tree modules.

Livepatch exports functions to (un)register and enable/disable a live patch. The only in-tree module which uses these functions is a sample in samples/livepatch/. If the sample is disabled, the functions are trimmed and out-of-tree live patches cannot be built.

Note that live patches are intended to be built out-of-tree.

---
 kernel/livepatch/Kconfig | 1 +
 1 file changed, 1 insertion(+)
kernel/livepatch/Kconfig +1 -0
index 045022557936..ec4565122e65 100644
@@ -10,6 +10,7 @@ config LIVEPATCH
 	depends on SYSFS
 	depends on KALLSYMS_ALL
 	depends on HAVE_LIVEPATCH
+	depends on !TRIM_UNUSED_KSYMS
 	help
 	  Say Y here if you want to support kernel live patching.
 	  This option has no runtime impact until a kernel "patch"
Signature · 1 line
2.12.2
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Miroslav Benes

If TRIM_UNUSED_KSYMS is enabled, all unneeded exported symbols are made unexported. Two-pass build of the kernel is done to find out which symbols are needed based on a configuration. This effectively complicates things for out-of-tree modules.

Livepatch exports functions to (un)register and enable/disable a live patch. The only in-tree module which uses these functions is a sample in samples/livepatch/. If the sample is disabled, the functions are trimmed and out-of-tree live patches cannot be built.

Quoted 4 lines

Note that live patches are intended to be built out-of-tree.

Signature · 1 line
Josh
Acked-by on v1 1/1
#2 lore raw
In reply to Miroslav Benes

+++ Miroslav Benes [26/05/17 14:45 +0200]:

Quoted 10 lines

If TRIM_UNUSED_KSYMS is enabled, all unneeded exported symbols are made unexported. Two-pass build of the kernel is done to find out which symbols are needed based on a configuration. This effectively complicates things for out-of-tree modules.

Livepatch exports functions to (un)register and enable/disable a live patch. The only in-tree module which uses these functions is a sample in samples/livepatch/. If the sample is disabled, the functions are trimmed and out-of-tree live patches cannot be built.

Quoted 4 lines

Note that live patches are intended to be built out-of-tree.

Makes sense to me:

Quoted 19 lines

---
kernel/livepatch/Kconfig | 1 +

1 file changed, 1 insertion(+)
kernel/livepatch/Kconfig +1 -0
index 045022557936..ec4565122e65 100644
@@ -10,6 +10,7 @@ config LIVEPATCH
 	depends on SYSFS
 	depends on KALLSYMS_ALL
 	depends on HAVE_LIVEPATCH
+	depends on !TRIM_UNUSED_KSYMS
 	help
 	  Say Y here if you want to support kernel live patching.
 	  This option has no runtime impact until a kernel "patch"
Signature · 1 line
2.12.2
Applied
#3 lore raw
In reply to Miroslav Benes
Quoted 10 lines · Miroslav Benes

If TRIM_UNUSED_KSYMS is enabled, all unneeded exported symbols are made unexported. Two-pass build of the kernel is done to find out which symbols are needed based on a configuration. This effectively complicates things for out-of-tree modules.

Livepatch exports functions to (un)register and enable/disable a live patch. The only in-tree module which uses these functions is a sample in samples/livepatch/. If the sample is disabled, the functions are trimmed and out-of-tree live patches cannot be built.

Quoted 4 lines

Note that live patches are intended to be built out-of-tree.

Applied, thanks.

Signature · 2 lines
Jiri Kosina
SUSE Labs