* [PATCH 40/46] x86/livepatch, lto: Disable live patching with gcc LTO
[not found] <20221114114344.18650-1-jirislaby@kernel.org>
@ 2022-11-14 11:43 ` Jiri Slaby (SUSE)
2022-11-14 19:07 ` Josh Poimboeuf
2022-11-17 20:00 ` Song Liu
0 siblings, 2 replies; 6+ messages in thread
From: Jiri Slaby (SUSE) @ 2022-11-14 11:43 UTC (permalink / raw)
To: linux-kernel
Cc: Andi Kleen, Josh Poimboeuf, Jiri Kosina, Miroslav Benes,
Petr Mladek, Joe Lawrence, live-patching, Andi Kleen,
Martin Liska, Jiri Slaby
From: Andi Kleen <andi@firstfloor.org>
It is not supported by gcc 12 so far, so it causes compiler "sorry"
messages.
Other than the compiler support, there shouldn't be any barriers for
live patching LTOed kernels, although it might be more difficult to
create patches for larger functions.
Cc: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Miroslav Benes <mbenes@suse.cz>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Joe Lawrence <joe.lawrence@redhat.com>
Cc: live-patching@vger.kernel.org
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Martin Liska <mliska@suse.cz>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
kernel/livepatch/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/livepatch/Kconfig b/kernel/livepatch/Kconfig
index 53d51ed619a3..22699adc39a6 100644
--- a/kernel/livepatch/Kconfig
+++ b/kernel/livepatch/Kconfig
@@ -12,6 +12,7 @@ config LIVEPATCH
depends on KALLSYMS_ALL
depends on HAVE_LIVEPATCH
depends on !TRIM_UNUSED_KSYMS
+ depends on !LTO_GCC # not supported in gcc
help
Say Y here if you want to support kernel live patching.
This option has no runtime impact until a kernel "patch"
--
2.38.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 40/46] x86/livepatch, lto: Disable live patching with gcc LTO
2022-11-14 11:43 ` [PATCH 40/46] x86/livepatch, lto: Disable live patching with gcc LTO Jiri Slaby (SUSE)
@ 2022-11-14 19:07 ` Josh Poimboeuf
2022-11-14 20:28 ` Andi Kleen
2022-11-17 20:00 ` Song Liu
1 sibling, 1 reply; 6+ messages in thread
From: Josh Poimboeuf @ 2022-11-14 19:07 UTC (permalink / raw)
To: Jiri Slaby (SUSE)
Cc: linux-kernel, Andi Kleen, Jiri Kosina, Miroslav Benes,
Petr Mladek, Joe Lawrence, live-patching, Andi Kleen,
Martin Liska, Jiri Slaby
On Mon, Nov 14, 2022 at 12:43:38PM +0100, Jiri Slaby (SUSE) wrote:
> From: Andi Kleen <andi@firstfloor.org>
>
> It is not supported by gcc 12 so far, so it causes compiler "sorry"
> messages.
What specifically is not supported by GCC 12? What are the "sorry"
messages?
> Other than the compiler support, there shouldn't be any barriers for
> live patching LTOed kernels, although it might be more difficult to
> create patches for larger functions.
This seems to conflict with the documentation.
> Cc: Josh Poimboeuf <jpoimboe@kernel.org>
> Cc: Jiri Kosina <jikos@kernel.org>
> Cc: Miroslav Benes <mbenes@suse.cz>
> Cc: Petr Mladek <pmladek@suse.com>
> Cc: Joe Lawrence <joe.lawrence@redhat.com>
> Cc: live-patching@vger.kernel.org
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> Signed-off-by: Martin Liska <mliska@suse.cz>
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> ---
> kernel/livepatch/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kernel/livepatch/Kconfig b/kernel/livepatch/Kconfig
> index 53d51ed619a3..22699adc39a6 100644
> --- a/kernel/livepatch/Kconfig
> +++ b/kernel/livepatch/Kconfig
> @@ -12,6 +12,7 @@ config LIVEPATCH
> depends on KALLSYMS_ALL
> depends on HAVE_LIVEPATCH
> depends on !TRIM_UNUSED_KSYMS
> + depends on !LTO_GCC # not supported in gcc
The comment doesn't help.
--
Josh
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 40/46] x86/livepatch, lto: Disable live patching with gcc LTO
2022-11-14 19:07 ` Josh Poimboeuf
@ 2022-11-14 20:28 ` Andi Kleen
2022-11-14 22:00 ` Josh Poimboeuf
0 siblings, 1 reply; 6+ messages in thread
From: Andi Kleen @ 2022-11-14 20:28 UTC (permalink / raw)
To: Josh Poimboeuf
Cc: Jiri Slaby (SUSE), linux-kernel, Andi Kleen, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, live-patching,
Andi Kleen, Martin Liska, Jiri Slaby
On Mon, Nov 14, 2022 at 11:07:42AM -0800, Josh Poimboeuf wrote:
> On Mon, Nov 14, 2022 at 12:43:38PM +0100, Jiri Slaby (SUSE) wrote:
> > From: Andi Kleen <andi@firstfloor.org>
> >
> > It is not supported by gcc 12 so far, so it causes compiler "sorry"
> > messages.
>
> What specifically is not supported by GCC 12?
-fwhole-program and the live patching options are mutually exclusive.
Okay I suppose it could be handled by disabling -fwhole-program, although
that might limit some optimizations.
> What are the "sorry" messages?
It's an error message from the compiler telling you that something is
not implemented.
-Andi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 40/46] x86/livepatch, lto: Disable live patching with gcc LTO
2022-11-14 20:28 ` Andi Kleen
@ 2022-11-14 22:00 ` Josh Poimboeuf
2022-11-15 13:32 ` Martin Liška
0 siblings, 1 reply; 6+ messages in thread
From: Josh Poimboeuf @ 2022-11-14 22:00 UTC (permalink / raw)
To: Andi Kleen
Cc: Jiri Slaby (SUSE), linux-kernel, Jiri Kosina, Miroslav Benes,
Petr Mladek, Joe Lawrence, live-patching, Andi Kleen,
Martin Liska, Jiri Slaby
On Mon, Nov 14, 2022 at 12:28:09PM -0800, Andi Kleen wrote:
> On Mon, Nov 14, 2022 at 11:07:42AM -0800, Josh Poimboeuf wrote:
> > On Mon, Nov 14, 2022 at 12:43:38PM +0100, Jiri Slaby (SUSE) wrote:
> > > From: Andi Kleen <andi@firstfloor.org>
> > >
> > > It is not supported by gcc 12 so far, so it causes compiler "sorry"
> > > messages.
> >
> > What specifically is not supported by GCC 12?
>
> -fwhole-program and the live patching options are mutually exclusive.
What live patching options are you referring to?
--
Josh
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 40/46] x86/livepatch, lto: Disable live patching with gcc LTO
2022-11-14 22:00 ` Josh Poimboeuf
@ 2022-11-15 13:32 ` Martin Liška
0 siblings, 0 replies; 6+ messages in thread
From: Martin Liška @ 2022-11-15 13:32 UTC (permalink / raw)
To: Josh Poimboeuf, Andi Kleen
Cc: Jiri Slaby (SUSE), linux-kernel, Jiri Kosina, Miroslav Benes,
Petr Mladek, Joe Lawrence, live-patching, Andi Kleen, Jiri Slaby
On 11/14/22 23:00, Josh Poimboeuf wrote:
> On Mon, Nov 14, 2022 at 12:28:09PM -0800, Andi Kleen wrote:
>> On Mon, Nov 14, 2022 at 11:07:42AM -0800, Josh Poimboeuf wrote:
>>> On Mon, Nov 14, 2022 at 12:43:38PM +0100, Jiri Slaby (SUSE) wrote:
>>>> From: Andi Kleen <andi@firstfloor.org>
>>>>
>>>> It is not supported by gcc 12 so far, so it causes compiler "sorry"
>>>> messages.
>>>
>>> What specifically is not supported by GCC 12?
>>
>> -fwhole-program and the live patching options are mutually exclusive.
>
> What live patching options are you referring to?
>
As mentioned in the reply to the next email, we speak about:
https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-flive-patching
option:
gcc -flto -flive-patching=inline-clone a.c
cc1: sorry, unimplemented: live patching is not supported with LTO
Cheers,
Martin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 40/46] x86/livepatch, lto: Disable live patching with gcc LTO
2022-11-14 11:43 ` [PATCH 40/46] x86/livepatch, lto: Disable live patching with gcc LTO Jiri Slaby (SUSE)
2022-11-14 19:07 ` Josh Poimboeuf
@ 2022-11-17 20:00 ` Song Liu
1 sibling, 0 replies; 6+ messages in thread
From: Song Liu @ 2022-11-17 20:00 UTC (permalink / raw)
To: Jiri Slaby (SUSE)
Cc: linux-kernel, Andi Kleen, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, live-patching,
Andi Kleen, Martin Liska, Jiri Slaby
On Mon, Nov 14, 2022 at 3:48 AM Jiri Slaby (SUSE) <jirislaby@kernel.org> wrote:
>
> From: Andi Kleen <andi@firstfloor.org>
>
> It is not supported by gcc 12 so far, so it causes compiler "sorry"
> messages.
>
> Other than the compiler support, there shouldn't be any barriers for
> live patching LTOed kernels, although it might be more difficult to
> create patches for larger functions.
A loosely related question: does livepatch work with CLANG LTO?
AFAICT, kpatch-build doesn't support it. But the kernel side should
work just fine?
Thanks,
Song
[...]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-11-17 20:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20221114114344.18650-1-jirislaby@kernel.org>
2022-11-14 11:43 ` [PATCH 40/46] x86/livepatch, lto: Disable live patching with gcc LTO Jiri Slaby (SUSE)
2022-11-14 19:07 ` Josh Poimboeuf
2022-11-14 20:28 ` Andi Kleen
2022-11-14 22:00 ` Josh Poimboeuf
2022-11-15 13:32 ` Martin Liška
2022-11-17 20:00 ` Song Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox