Re: [RFC 00/31] objtool, livepatch: Livepatch module generation

From: Josh Poimboeuf
Date: Wed Sep 04 2024 - 00:30:50 EST


On Tue, Sep 03, 2024 at 10:32:00AM -0700, Song Liu wrote:
> Hi Josh,
>
> Thanks for the patchset! We really need this work so that we can undo our
> hack for LTO enabled kernels.
>
> On Mon, Sep 2, 2024 at 9:00 PM Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
> >
> > Hi,
> >
> > Here's a new way to build livepatch modules called klp-build.
> >
> > I started working on it when I realized that objtool already does 99% of
> > the work needed for detecting function changes.
> >
> > This is similar in concept to kpatch-build, but the implementation is
> > much cleaner.
> >
> > Personally I still have reservations about the "source-based" approach
> > (klp-convert and friends), including the fragility and performance
> > concerns of -flive-patching. I would submit that klp-build might be
> > considered the "official" way to make livepatch modules.
> >
> > Please try it out and let me know what you think. Based on v6.10.
> >
> > Also avaiable at:
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/jpoimboe/linux.git klp-build-rfc
>
> I tried to compile the code in this branch with gcc-12 and llvm-18. Some
> of these errors are easy to fix (attached below). But some are trickier, for
> example:
>
> with gcc-12:
> ...
> BTFIDS vmlinux
> NM System.map
> SORTTAB vmlinux
> incomplete ORC unwind tables in file: vmlinux
> Failed to sort kernel tables

Thanks for trying it! If you share your config(s) I can look into it.

I haven't tried clang yet, but will soon.

--
Josh