Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp203870ybl; Tue, 28 Jan 2020 01:30:46 -0800 (PST) X-Google-Smtp-Source: APXvYqwxkQHGlQMt6vfbmjKZOhPQgv5m6xNNXkO5BJTIgfPAAa9fKfkEsVzjjaxfeMp6WUOypZJO X-Received: by 2002:a05:6830:1f13:: with SMTP id u19mr15098747otg.237.1580203846087; Tue, 28 Jan 2020 01:30:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580203846; cv=none; d=google.com; s=arc-20160816; b=g4qLoldBHDpZ1ar8N7sloqZp1Ss+xebr0wUEwxDu3jDeTAAlxi3gczAF+ZBirW+ev+ S1o9wpbRxTOyHrhnvKXsGgkTq0YeAUD3UnBTClRDf4TO6LAADeqxQfc5fwBiZ/9uVCl4 0KI+vjtiMBgUkI05beAdriW1y2pSYZNP9HtqgZGwbOkl0DClVxhiKNSo3zYXj5xfXfe1 iYvkZYa/jDfc/QEU8rbJ15nGMzgwSB5t43vORjAnM1lZp3rh+GJmwaOuCeZK/SoQIZq3 +hx45Q5Xvm1y6gV5MkU7MsHJcCJYGM7xRnJGI5ulhRra6xYgJDXrVq5dfAI2ZPCe38j2 nRNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=0oEduGl3z4bMxz+L/UyapD37PZpx7GZEOEbXsuwFaVA=; b=O3HHs1Oc4RMo9IuBhqy+9IYKWQearNHEcremD8vALLcRstXUn8xLTz/x9g9VxParR/ XzejXXSve9PuKM87ldyTi9V3e6ipAFyTrHFJ/1VzWgIzdEJmU5DQJX0X1HAICnL81RVC SFr2YPSr6UVLmmKw8/3hlquLoeWNoyuaUZna3THTz01Nu89yGYcNOT4XkCOhnW46ID5Y OWIgUPlG2jKHeUbOgQcFOYOeHH5uYdVVTddj+NEf0gIqJ2VNYmNCbE1vV440tSvkmbkK 2EfzhDP0iLcbFg/iqvrFYzs+wroFvMIMxCDvPVTELr9bOq/EHWK00mMcScTJ5pWUiors cjbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i20si8344180otk.270.2020.01.28.01.30.31; Tue, 28 Jan 2020 01:30:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726059AbgA1J2N (ORCPT + 99 others); Tue, 28 Jan 2020 04:28:13 -0500 Received: from mx2.suse.de ([195.135.220.15]:33168 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725920AbgA1J2N (ORCPT ); Tue, 28 Jan 2020 04:28:13 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3B8B7ADA1; Tue, 28 Jan 2020 09:28:10 +0000 (UTC) Date: Tue, 28 Jan 2020 10:28:07 +0100 (CET) From: Miroslav Benes To: Josh Poimboeuf cc: Peter Zijlstra , Steven Rostedt , Joe Lawrence , Jessica Yu , x86@kernel.org, linux-kernel@vger.kernel.org, mhiramat@kernel.org, bristot@redhat.com, jbaron@akamai.com, torvalds@linux-foundation.org, tglx@linutronix.de, mingo@kernel.org, namit@vmware.com, hpa@zytor.com, luto@kernel.org, ard.biesheuvel@linaro.org, live-patching@vger.kernel.org, Randy Dunlap Subject: Re: [PATCH v3 5/6] x86/ftrace: Use text_poke() In-Reply-To: <20200122214239.ivnebi7hiabi5tbs@treble> Message-ID: References: <88bab814-ea24-ece9-2bc0-7a1e10a62f12@redhat.com> <20191015153120.GA21580@linux-8ccs> <7e9c7dd1-809e-f130-26a3-3d3328477437@redhat.com> <20191015182705.1aeec284@gandalf.local.home> <20191016074217.GL2328@hirez.programming.kicks-ass.net> <20191021150549.bitgqifqk2tbd3aj@treble> <20200120165039.6hohicj5o52gdghu@treble> <20200121161045.dhihqibnpyrk2lsu@treble> <20200122214239.ivnebi7hiabi5tbs@treble> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 22 Jan 2020, Josh Poimboeuf wrote: > On Wed, Jan 22, 2020 at 11:09:56AM +0100, Miroslav Benes wrote: > > > > > > > At this point, I only see downsides of -flive-patching, at least until > > > > > we actually have real upstream code which needs it. > > > > > > > > Can you explain this? The option makes GCC to avoid optimizations which > > > > are difficult to detect and would make live patching unsafe. I consider it > > > > useful as it is, so if you shared the other downsides and what you meant > > > > by real upstream code, we could discuss it. > > > > > > Only SLES needs it right? Why inflict it on other livepatch users? By > > > "real upstream code" I mean there's no (documented) way to create live > > > patches using the method which relies on this flag. So I don't see any > > > upstream benefits for having it enabled. > > > > I'd put it differently. SLES and upstream need it, RHEL does not need it. > > Or anyone using kpatch-build. > > I'm confused about why you think upstream needs it. > > Is all the tooling available somewhere? Is there documentation > available which describes how to build patches using that method from > start to finish? Are there actual users other than SUSE? > > BTW, kpatch-build has a *lot* of users other than RHEL. All its tooling > and documentation are available on Github. > > > It is perfectly fine to prepare live patches just from the source code > > using upstream live patching infrastructure. > > Do you mean the dangerous method used by the livepatch sample code which > completely ignores interprocedural optimizations? I wouldn't call that > perfectly fine. > > > After all, SLES is nothing else than upstream here. We were creating live > > patches manually for quite a long time and only recently we have been > > using Nicolai's klp-ccp automation (https://github.com/SUSE/klp-ccp). > > > > So, everyone using upstream directly relies on the flag, which seems to be > > a clear benefit to me. Reverting the patch would be a step back. > > Who exactly is "everyone using upstream"? > > >From what I can tell, kpatch-build is the only known way (to those > outside of SUSE) to make safe patches for an upstream kernel. And it > doesn't need this flag and the problems associated with it: performance, > LTO incompatibility, clang incompatibility (I think?), the GCC dead code > issue. I don't think we have something special at SUSE not generally available... ...and I don't think it is really important to discuss that and replying to the above, because there is a legitimate use case which relies on the flag. We decided to support different use cases right at the beginning. I understand it currently complicates things for objtool, but objtool is sensitive to GCC code generation by definition. "Issues" appear with every new GCC version. I see no difference here and luckily it is not so difficult to fix it. I am happy to help with acting on those objtool warning reports you mentioned in the other email. Just Cc me where appropriate. We will take a look. Regards Miroslav