Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5275600ybl; Wed, 22 Jan 2020 13:44:37 -0800 (PST) X-Google-Smtp-Source: APXvYqz3AQvuoJlvL+yw9VbFmBFgixiBlgCNK0fxqlgcJ2eBpjTiqM8LB70TxdL1QymzblemUgiq X-Received: by 2002:a9d:7cd0:: with SMTP id r16mr9230142otn.50.1579729477577; Wed, 22 Jan 2020 13:44:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579729477; cv=none; d=google.com; s=arc-20160816; b=arxwWS+reAbzGO5BfDlAuSauAU9f7Ye9V7wRL2r10NTXf45ibKv+fQlPIuRn+JyFvm 0dhY1fcTttesZnEi7AXEDvgyK+qqjd/h07d2psUuUfzrYVdoROulQF3/jk/PUMAEF9hQ WpuXvqos6CNpn+9+xAKqNix6h3uBycCLTdmIH48MkGCY76HNmNeSWf1KgwUIBHICVrfS CHZadeYv38VIPMfCG3yCNDVGCGx+TG/HWLhlU0fHBX11UhPmLgfWttZ3iYzGsu+6H1cf Nd8Pbu3q64cbyPlmB5qAz7atGbJ9iF1zmHXxBs57j1tqaP17/YoesruHUe0uS5UA7mD1 aPNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=1gFcEZJIvMTM55lub5PAcGjASB5nWcvJKHPzUNKZDoA=; b=YN/h8yDtxsIXnOeP/BeQtuuGCB5FQmF5KSjjD+bLV5lVFqisiDbtc5H4IRU8rRMoSJ 8o9KxPMiILvj2B+oIXfhwl0LvSEO8ORvR5AIzs4wgLCCTtz80wtFrlijKGSVfbB7n0Hs F4wh2KaTWyAn/ahmh/GY8mOekmhK9VLNeIHmwm8RhOTpOZydUyy9Ols2+heJR1NlFKPs EIiGnz9SwbWpIo6c8xHbfWt/iy+wFtze3Wz400NVIyei/nzhcrjSlDDoR+Yf4bX44zMn HkInE+s960CSJ4kYaauve4/qPYbMyrMGtiLt8JW6bZfhFPAX0cTAVFt4gR2JRPg/uA4c Eo2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PPCrmiWC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i5si16820otr.293.2020.01.22.13.44.20; Wed, 22 Jan 2020 13:44:37 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PPCrmiWC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729133AbgAVVmz (ORCPT + 99 others); Wed, 22 Jan 2020 16:42:55 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:48549 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725943AbgAVVmz (ORCPT ); Wed, 22 Jan 2020 16:42:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579729373; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1gFcEZJIvMTM55lub5PAcGjASB5nWcvJKHPzUNKZDoA=; b=PPCrmiWCvfrjFqBcEAFSNgJNCNm5yutIyhtsoeqPcunEVjGQwkx8Gqo48aLQWwXtVZKNjE Tb2ZQF3RfXyqVhCumf3MvP/MNOXYk1l0hZ9n9CYaTFLlvArtEj8iDxESUZuYcb7VM5SngW 6b7Gnd4qklA5e42/g2v39adz5DVNkKw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-46-vfrKVyS_PUyEIk0FIgm2lg-1; Wed, 22 Jan 2020 16:42:51 -0500 X-MC-Unique: vfrKVyS_PUyEIk0FIgm2lg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C11F9107ACC4; Wed, 22 Jan 2020 21:42:48 +0000 (UTC) Received: from treble (ovpn-122-154.rdu2.redhat.com [10.10.122.154]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6DE9A88893; Wed, 22 Jan 2020 21:42:41 +0000 (UTC) Date: Wed, 22 Jan 2020 15:42:39 -0600 From: Josh Poimboeuf To: Miroslav Benes 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() Message-ID: <20200122214239.ivnebi7hiabi5tbs@treble> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Josh