Skip to content

Conversation

@emmil
Copy link
Contributor

@emmil emmil commented Sep 5, 2025

kpatch-build: fix ppc64le trampoline handling after BPF changes

Starting from linux commit eec37961a56a (powerpc64/ftrace: Move
ftrace sequence out of line) the kpatch-build fails

    Extracting new and modified ELF sections
    create-diff-object: ERROR: fs/proc/cmdline.o: kpatch_create_ftrace_callsite_sections: 3860: cmdline_proc_show: unexpected instruction in patch section of function

    fs/proc/cmdline.o: changed function: cmdline_proc_show
    doing "deep find" for parent object
    ERROR: invalid ancestor arch/powerpc/tools/vmlinux.arch.o for arch/powerpc/tools/vmlinux.arch.o. Check /root/.kpatch/build.log for more details.

Moving the ftrace stubs out-of-line modified the prologue on ppc64le
and it now uses a single nop instead of two.
Update the nop check in create-diff-object.c accordingly.

Also add vmlinux.arch.o to the list of objects excluded from
instrumentation, since it only contains the out-of-line ftrace stubs
for vmlinux.
The module loader will create any necessary (livepatch) module
ftrace stubs, so we don't care about modifications to this file.

Closes: #1470 ("cs-10: ppc64le builds fail")
Reported-by: Joe Lawrence joe.lawrence@redhat.com
Signed-off-by: Radomir Vrbovsky rvrbovsk@redhat.com

Copy link
Contributor

@joe-lawrence joe-lawrence left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes look fine. As we discussed off list, we could be more deliberate about detecting one or two NOPs, but since this is only a minor assertion it's not worth the effort.

A few nits with the commit msg:

  • I usually use my email alias in this repo: Joe Lawrence joe.lawrence@redhat.com
  • As I understand the patchset: [PATCH v7 00/17] powerpc: Core ftrace rework, support for ftrace direct and bpf trampolines:
    • We don't need to specify that these were "BPF changes", I think it could just say, "Moving the ftrace stubs out-of-line modified the prologue ..."
    • And then regarding vmlinux.arch.o, "... excluded from
      instrumentation, since it only contains the out-of-line ftrace stubs for vmlinux. The module loader will create any necessary (livepatch) module ftrace stubs, so we don't care about modifications to this file."

@joe-lawrence
Copy link
Contributor

/packit test --labels integration-pr

Starting from linux commit eec37961a56a (powerpc64/ftrace: Move
ftrace sequence out of line) the kpatch-build fails

	Extracting new and modified ELF sections
	create-diff-object: ERROR: fs/proc/cmdline.o: kpatch_create_ftrace_callsite_sections: 3860: cmdline_proc_show: unexpected instruction in patch section of function

	fs/proc/cmdline.o: changed function: cmdline_proc_show
	doing "deep find" for parent object
	ERROR: invalid ancestor arch/powerpc/tools/vmlinux.arch.o for arch/powerpc/tools/vmlinux.arch.o. Check /root/.kpatch/build.log for more details.

Moving the ftrace stubs out-of-line modified the prologue on ppc64le
and it now uses a single nop instead of two.
Update the nop check in create-diff-object.c accordingly.

Also add vmlinux.arch.o to the list of objects excluded from
instrumentation, since it only contains the out-of-line ftrace stubs
for vmlinux.
The module loader will create any necessary (livepatch) module
ftrace stubs, so we don't care about modifications to this file.

Closes: dynup#1470 ("cs-10: ppc64le builds fail")
Reported-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Radomir Vrbovsky <rvrbovsk@redhat.com>
Copy link
Contributor

@joe-lawrence joe-lawrence left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @emmil

@joe-lawrence joe-lawrence merged commit 7c58ba8 into dynup:master Sep 8, 2025
3 checks passed
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.

cs-10: ppc64le builds fail

2 participants