Skip to content

Conversation

@lu21253
Copy link

@lu21253 lu21253 commented Dec 4, 2025

For x86_64 this option uses -fpatchable-function-entry=$(CONFIG_FUNCTION_PADDING_BYTES),$(CONFIG_FUNCTION_PADDING_BYTES), so CONFIG_FUNCTION_PADDING_BYTES NOPs are placed before the function entry point (in order to store a pointer to ftrace_ops).When calculating function padding, check for the presence of the CONFIG_FUNCTION_PADDING_BYTES NOPs, and adjust the padding size by CONFIG_FUNCTION_PADDING_BYTES if they are found.

Signed-off-by: l21253 lu.haoA@h3c.com
Reviewed-by: w28894 wang.shijie@h3c.com
Reviewed-by: z17497 zhang.chunA@h3c.com

For x86_64 this option uses
-fpatchable-function-entry=$(CONFIG_FUNCTION_PADDING_BYTES),$(CONFIG_FUNCTION_PADDING_BYTES),
so CONFIG_FUNCTION_PADDING_BYTES NOPs are placed before the function entry point (in order to
store a pointer to ftrace_ops).When calculating function padding, check for the presence of the
CONFIG_FUNCTION_PADDING_BYTES NOPs, and adjust the padding size by CONFIG_FUNCTION_PADDING_BYTES if they are found.

Signed-off-by: lu21253 <lu.haoA@h3c.com>
Reviewed-by: w28894 <wang.shijie@h3c.com>
Reviewed-by: z17497 <zhang.chunA@h3c.com>
@lu21253 lu21253 changed the title creatte-diff-object: Add support for x86_64 CONFIG_CALL_PADDING create-diff-object: Add support for x86_64 CONFIG_CALL_PADDING Dec 4, 2025
@joe-lawrence
Copy link
Contributor

/packit test

@joe-lawrence
Copy link
Contributor

Hi @lu21253 : just curious, what was the failure mode that you encountered that this patch fixes? And if you could attach your complete kernel configuration.

I ask as RHEL-10 sets CONFIG_CALL_PADDING=y and CONFIG_FUNCTION_PADDING_BYTES=16, yet there are no problems (at least using gcc).

Thanks and btw, many of us here will be away at LPC over the next week or two, so replies may take a while. Thanks!

@lu21253
Copy link
Author

lu21253 commented Dec 6, 2025

Hi, @joe-lawrence :
My kernel configuration consists of some standard settings. I am debugging livepatch on Linux kernel 6.6.0 and want to use kpatch-master to generate the livepatch patch ko object file. When executing create-diff-object, the following error occurred:

make: Leaving directory '/home/l21253/V9/B93D001/PUBLIC/kernel'

/home/l21253/V9/B93D001/kpatch-master/kpatch-build/create-diff-object /home/l21253/V9/B93D001/objs64/orig/n_tty.o /home/l21253/V9/B93D001/objs64/patched/n_tty.o vmlinux /home/l21253/V9/B93D001/objs64/vmlinux.symtab /home/l21253/V9/B93D001/TARGET/arch/x86_64/release/Module.symvers livepatch-livepatch-vmlinux-tty.ko /home/l21253/V9/B93D001/objs64/output/n_tty.o

create-diff-object: ERROR: home/l21253/V9/B93D001/objs64/orig/n_tty.o: kpatch_bundle_symbols: 355: symbol echo_set_canon_col at offset 16 within section .text.echo_set_canon_col, expected 0

@joe-lawrence
Copy link
Contributor

@lu21253 : can you attach your kernel .config? (Or indicate which distro kernel you may be using.) Thanks!

@lu21253
Copy link
Author

lu21253 commented Dec 24, 2025

@joe-lawrence kernel version is 6.6.0, Thanks!

@joe-lawrence
Copy link
Contributor

@joe-lawrence kernel version is 6.6.0, Thanks!

Yes that's the version, but the kernel config? Perhaps it's at /boot/config-$(uname -r)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants