Re: [PATCH v4 0/9] ftrace with regs + live patching for ppc64 LE (ABI v2)

From: Petr Mladek
Date: Thu Dec 03 2015 - 11:00:16 EST


On Wed 2015-11-25 17:53:17, Torsten Duwe wrote:
> Torsten Duwe (9):
> ppc64 (le): prepare for -mprofile-kernel
> ppc64le FTRACE_WITH_REGS implementation
> ppc use ftrace_modify_all_code default
> ppc64 ftrace_with_regs configuration variables
> ppc64 ftrace_with_regs: spare early boot and low level
> ppc64 ftrace: disable profiling for some functions
> ppc64 ftrace: disable profiling for some files
> Implement kernel live patching for ppc64le (ABIv2)
> Enable LIVEPATCH to be configured on ppc64le and add livepatch.o if it
> is selected.

I had to add the patch below to get LivePatching working.

I tested it the following way:

# livepatching sample
CONFIG_SAMPLES=y
CONFIG_SAMPLE_LIVEPATCH=m

# booted the compiled kernel and printed the default cmdline
$> cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-4.4.0-rc3-11-default+ root=UUID=...

# loaded the patch and printed the patch cmdline
$> modprobe livepatch-sample
$> cat /proc/cmdline
this has been live patched

# tried to disable and enable the patch
$> echo 0 > /sys/kernel/livepatch/livepatch_sample/enabled
$> cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-4.4.0-rc3-11-default+ root=UUID=...
$> echo 1 > /sys/kernel/livepatch/livepatch_sample/enabled
$> cat /proc/cmdline
this has been live patched

# also checked messages
$> dmesg | tail -n 4
[ 33.673057] livepatch: tainting kernel with TAINT_LIVEPATCH
[ 33.673068] livepatch: enabling patch 'livepatch_sample'
[ 1997.098257] livepatch: disabling patch 'livepatch_sample'
[ 2079.696277] livepatch: enabling patch 'livepatch_sample'


Here is the patch: