public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcos Paulo de Souza <mpdesouza@suse.com>
To: Lukas Hruska <lhruska@suse.cz>
Cc: Petr Mladek <pmladek@suse.com>, Miroslav Benes <mbenes@suse.cz>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	Joe Lawrence <joe.lawrence@redhat.com>,
	live-patching@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kbuild@vger.kernel.org,
	Marcos Paulo de Souza <mpdesouza@suse.com>
Subject: Re: [PATCH v1 0/5] livepatch: klp-convert tool - Minimal version
Date: Wed, 10 Apr 2024 12:32:18 -0300	[thread overview]
Message-ID: <20240410153220.15927-1-mpdesouza@suse.com> (raw)
In-Reply-To: <20231106162513.17556-1-lhruska@suse.cz>

On Mon,  6 Nov 2023 17:25:08 +0100 Lukas Hruska <lhruska@suse.cz> wrote:

> Summary
> -------
> 
> This is a significantly simplified version of the original klp-convert tool.
> The klp-convert code has never got a proper review and also clean ups 
> were not easy. The last version was v7, see 
> https://lore.kernel.org/r/20230306140824.3858543-1-joe.lawrence@redhat.com
> 
> The main change is that the tool does not longer search for the 
> symbols which would need the livepatch specific relocation entry.
> Also klp.symbols file is not longer needed.
> 
> Instead, the needed information is appended to the symbol declaration
> via a new macro KLP_RELOC_SYMBOL(). It creates symbol with all needed
> metadata. For example:
> 
>   extern char *saved_command_line \
>                  KLP_RELOC_SYMBOL(vmlinux, vmlinux, saved_command_line, 0); 
> 
> would create symbol
> 
> $>readelf -r -W <compiled livepatch module>:
> Relocation section '.rela.text' at offset 0x32e60 contains 10 entries:
>     Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
> [...]
> 0000000000000068  0000003c00000002 R_X86_64_PC32          0000000000000000 .klp.sym.rela.vmlinux.vmlinux.saved_command_line,0 - 4 
> [...]
> 
> 
> The simplified klp-convert tool just transforms symbols
> created by KLP_RELOC_SYMBOL() to object specific rela sections
> and rela entries which would later be proceed when the livepatch
> or the livepatched object is loaded.
> 
> For example, klp-convert would replace the above symbols with:
> 
> $> readelf -r -W <livepatch_module_proceed_by_klp_convert>
> Relocation section '.klp.rela.vmlinux.text' at offset 0x5cb60 contains 1 entry:
>     Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
> 0000000000000068  0000003c00000002 R_X86_64_PC32          0000000000000000 .klp.sym.vmlinux.saved_command_line,0 - 4 
> 
> 
> Note that similar macro was needed also in the original version
> to handle more symbols of the same name (sympos).
> 
> Given the above, add klp-convert tool; integrate klp-convert tool into
> kbuild; add data-structure and macros to enable users to annotate
> livepatch source code; make modpost stage compatible with livepatches;
> update livepatch-sample and update documentation.
> 
> 
> Testing
> -------
> 
> The patchset selftests build and execute on x86_64, s390x, and ppc64le
> for both default config (with added livepatch dependencies) and a larger
> SLE-15-ish config.
> 
> 
> Summary of changes in this minimal version
> ------------------------
> 
> - rebase for v6.5
> - cleaned-up SoB chains (suggested by pmladek)
> - klp-convert: remove the symbol map auto-resolving solution
> - klp-convert: add macro for flagging variables inside a LP src to be resolved by this tool
> - klp-convert: code simplification

Do we have anything that blocks klp-convert-mini to be merged, or something that
needs to be fixed?

Thanks,
  Marcos

> 
> Previous versions
> -----------------
> 
> RFC:
>   https://lore.kernel.org/lkml/cover.1477578530.git.jpoimboe@redhat.com/
> v2:
>   https://lore.kernel.org/lkml/f52d29f7-7d1b-ad3d-050b-a9fa8878faf2@redhat.com/
> v3:
>   https://lore.kernel.org/lkml/20190410155058.9437-1-joe.lawrence@redhat.com/
> v4:
>   https://lore.kernel.org/lkml/20190509143859.9050-1-joe.lawrence@redhat.com/
> v5:
>   (not posted)
>   https://github.com/joe-lawrence/klp-convert-tree/tree/klp-convert-v5-devel
> v6:
>   https://lore.kernel.org/live-patching/20220216163940.228309-1-joe.lawrence@redhat.com/
> v7:
>   https://lore.kernel.org/all/20230306140824.3858543-1-joe.lawrence@redhat.com/

  parent reply	other threads:[~2024-04-10 15:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-06 16:25 [PATCH v1 0/5] livepatch: klp-convert tool - Minimal version Lukas Hruska
2023-11-06 16:25 ` [PATCH v1 1/5] livepatch: Create and include UAPI headers Lukas Hruska
2024-01-05 10:15   ` Petr Mladek
2024-01-10 13:38   ` Marcos Paulo de Souza
2023-11-06 16:25 ` [PATCH v1 2/5] livepatch: Add klp-convert tool Lukas Hruska
2024-01-05 13:29   ` Petr Mladek
2024-01-10 19:03     ` Marcos Paulo de Souza
2024-01-05 15:01   ` Petr Mladek
2023-11-06 16:25 ` [PATCH v1 3/5] kbuild/modpost: integrate klp-convert Lukas Hruska
2024-01-05 14:03   ` Petr Mladek
2024-01-10 19:37   ` Marcos Paulo de Souza
2024-01-25  9:44   ` Lukas Hruska
2023-11-06 16:25 ` [PATCH v1 4/5] livepatch: Add sample livepatch module Lukas Hruska
2024-01-05 14:14   ` Petr Mladek
2023-11-06 16:25 ` [PATCH v1 5/5] documentation: Update on livepatch elf format Lukas Hruska
2024-01-05 14:16   ` Petr Mladek
2024-01-10 19:54   ` Marcos Paulo de Souza
2024-04-10 15:32 ` Marcos Paulo de Souza [this message]
2024-04-11  6:27   ` [PATCH v1 0/5] livepatch: klp-convert tool - Minimal version Miroslav Benes
2024-04-11 13:58     ` Lukas Hruska

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240410153220.15927-1-mpdesouza@suse.com \
    --to=mpdesouza@suse.com \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@kernel.org \
    --cc=lhruska@suse.cz \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=pmladek@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox