Message ID | 20221114114344.18650-41-jirislaby@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2098440wru; Mon, 14 Nov 2022 03:50:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf5EPGVv6fioHFosSbiyKt+uVnYj28cCXvGfZfV6Noisgmi9idcckL5YpNoCo5rzI85pv4a0 X-Received: by 2002:a17:907:9618:b0:78e:17ad:ba62 with SMTP id gb24-20020a170907961800b0078e17adba62mr9846766ejc.719.1668426600631; Mon, 14 Nov 2022 03:50:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668426600; cv=none; d=google.com; s=arc-20160816; b=0n+jLkqJYYGpvWautMJQHws1fGIryJ+ueD7UJSIfnoOUJ4X6dTHxpwFOSH37aQrAvk Awkr3E+ltZG0rVyq7nnwvBzPTOUXNlGXihYMtM12pVhBgrH+skrbzKh5qSylKId+v1n9 XbvMzJlgeZqN817683Ivlm68zGGqoZpU/Eobb7TIZ7bq4zqmLIv6eO+A8JKGw056NYLi mKOoLNVzaR6v4ys4ccwURup7/tf8oYdKAK2kXaQWbc+l5jUMwzgMg/CqHrwUCAuacz0C 1uPS0aXjySy5KqrweIoUo6XYeFokcm1G3Ae5kPRYJytLRRRikdM6qG+7WHYaQO5Pdxzp ekdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hfW68vlzImJ9VWw36gGP8kKR4M7g53GIW7BTkc56XY4=; b=wrLYl2LQms91t1pSK1P74c4pM8kaxGaKjRNDRwLtrFtG2ffAMK//hPxyS/k6affHlw CbF8HUTGjkQAGZk4OgDPdxjftOOAuhd79oTxvXU9vUTNaIFVysiorLakcFKlm3LBa3XK 1oz6CJ+nNfudlsPHGgOCKl5PWbbfj/JSJDh2lA1HQPXNSghR3rq6m8L6HpwgS1NMpddg wRpSmxmQF6soKXWq/onCnLGCXt0OHLOsGQisqoR3cBpIULdCy+5eumPTeZVpy4qGRAzD JWN8A1I4vwxWgUIj0DoyvFjIZj50D+ALqphtEDENmy7W4K99caSQolMXKIM95n6UziyH kYgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lKwgXStS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p21-20020a056402075500b0046168e49e6fsi8289715edy.80.2022.11.14.03.49.35; Mon, 14 Nov 2022 03:50:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lKwgXStS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236819AbiKNLsr (ORCPT <rfc822;winker.wchi@gmail.com> + 99 others); Mon, 14 Nov 2022 06:48:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236804AbiKNLsE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 14 Nov 2022 06:48:04 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 735442252F; Mon, 14 Nov 2022 03:45:35 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 10D0D61045; Mon, 14 Nov 2022 11:45:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2416DC433C1; Mon, 14 Nov 2022 11:45:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668426334; bh=E5uKKkSwNTVS2fkyiUTAmxhhGrPiE6X9sXCDPf3qXro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lKwgXStSf5BKGYokF2vP5wwXHZ8kyH6GC/7CZR735e0tt2uwibnhyjRwidpNrhuRE 7wuYoAIM8NIoLhYgNKKhSlEpLOC/wLxgTmxgY8cwmO7xq+/ybN6O7NLZPiuWVMnCQ8 n4+5Kt1SqPDbdFIdpVt6Jo7l8QuHjozrEkB2L0nO5sylYBZasNhS4FMUoWA5OV687r 7PENiN1LQelH6MSTfsfI+cV9z3s3l/tJn1FdHWODV5Ho42JMu8/L6I0LAn55fU2a/f PKdOKJM1aAPdAnxda4OdISiVeDjVBHrkOyOMeuiHuD661PbY2u5nzkadl/hRLPd3dM mVTEojYb5NrqQ== From: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> To: linux-kernel@vger.kernel.org Cc: Andi Kleen <andi@firstfloor.org>, Josh Poimboeuf <jpoimboe@kernel.org>, Jiri Kosina <jikos@kernel.org>, Miroslav Benes <mbenes@suse.cz>, Petr Mladek <pmladek@suse.com>, Joe Lawrence <joe.lawrence@redhat.com>, live-patching@vger.kernel.org, Andi Kleen <ak@linux.intel.com>, Martin Liska <mliska@suse.cz>, Jiri Slaby <jslaby@suse.cz> Subject: [PATCH 40/46] x86/livepatch, lto: Disable live patching with gcc LTO Date: Mon, 14 Nov 2022 12:43:38 +0100 Message-Id: <20221114114344.18650-41-jirislaby@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221114114344.18650-1-jirislaby@kernel.org> References: <20221114114344.18650-1-jirislaby@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749472091468848274?= X-GMAIL-MSGID: =?utf-8?q?1749472091468848274?= |
Series |
gcc-LTO support for the kernel
|
|
Commit Message
Jiri Slaby
Nov. 14, 2022, 11:43 a.m. UTC
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(+)
Comments
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.
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
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?
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
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 [...]
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"