Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3447300ybl; Tue, 21 Jan 2020 00:36:42 -0800 (PST) X-Google-Smtp-Source: APXvYqxVQrFP2nkasf8ia5xBR6yRMU2vJteLTkKAaszoNSkEELtzXbJD55865Mokmh9blN+59d43 X-Received: by 2002:a9d:74d8:: with SMTP id a24mr2845666otl.100.1579595802217; Tue, 21 Jan 2020 00:36:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579595802; cv=none; d=google.com; s=arc-20160816; b=tp64bXFwyM/AKMsH6VKKkyg8xczMGul+5HxhVoN0O9CyIg/xEUN3LuwkVfVnDL9FHm ZeoluVBlfhsNxPxkPnBM5vn6Pu9OnidzxrYF2sSxM91rALJFI5aZhtjTRYc9LKL4r6rb FdszvAGqHhWjVRwtvw+rYvSxCdKFvhmPgbP6lIwXw7tr6z2uEe9WLyeDCsUkINWV275D rLzxzeavYjym8tMl8/mbngakuDNTfg87K/9FomUhq5IdrXQmXyRo7TfUWU3ogjK0J39u 0gb6eyGYPf5MrDb6EgXSYjVAF42hDijdGmRYonz1FnYRvLslFZHczgF91EzGG7OMW4tB EkEg== 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=E0G0ePiYzgcXYYCrIJx43mflyg7kjEtDuq6YEznWnsk=; b=VhoVDMzqdw8Idef5NlX+e+ZfkVBtESmIn7dse5e2ejCdtfXbqhvbogMELfjNjgcAoP 3wE/uihuhy6PRPly0GiK+l12/deOzy7//sKCOPc7etLXT6jOUomknHILNHsWdVYovDo2 NdWC951RwBw0j2YrXyj3YS8aDrD/u9gwK8m2V0nUTvbX+ur50f8zmw9sUrUGI/okPDiH 0OduxwJCi5ZhPwUSbTx6PGkj0jKMSZCHPgNgmeA2KIdYY9uESr2QEhSQTSgW4wmmHw4n P01Ga1bkma/ucf0ILIz6ymtWDFOVXZojIykhog+W8ODYWtfJhHu6IGAxFaFdWapDBgQ8 UoYQ== 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 i5si19787195oif.211.2020.01.21.00.36.30; Tue, 21 Jan 2020 00:36:42 -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 S1728760AbgAUIfd (ORCPT + 99 others); Tue, 21 Jan 2020 03:35:33 -0500 Received: from mx2.suse.de ([195.135.220.15]:39638 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725789AbgAUIfd (ORCPT ); Tue, 21 Jan 2020 03:35:33 -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 8588FAE09; Tue, 21 Jan 2020 08:35:30 +0000 (UTC) Date: Tue, 21 Jan 2020 09:35:28 +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: <20200120165039.6hohicj5o52gdghu@treble> Message-ID: References: <20191011125903.GN2359@hirez.programming.kicks-ass.net> <20191015130739.GA23565@linux-8ccs> <20191015135634.GK2328@hirez.programming.kicks-ass.net> <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> 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 Mon, 20 Jan 2020, Josh Poimboeuf wrote: > On Mon, Oct 21, 2019 at 10:05:49AM -0500, Josh Poimboeuf wrote: > > On Wed, Oct 16, 2019 at 09:42:17AM +0200, Peter Zijlstra wrote: > > > > which are not compatible with livepatching. GCC upstream now has > > > > -flive-patching option, which disables all those interfering optimizations. > > > > > > Which, IIRC, has a significant performance impact and should thus really > > > not be used... > > > > > > If distros ship that crap, I'm going to laugh at them the next time they > > > want a single digit performance improvement because *important*. > > > > I have a crazy plan to try to use objtool to detect function changes at > > a binary level, which would hopefully allow us to drop this flag. > > > > But regardless, I wonder if we enabled this flag prematurely. We still > > don't have a reasonable way to use it for creating source-based live > > patches upstream, and it should really be optional for CONFIG_LIVEPATCH, > > since kpatch-build doesn't need it. > > I also just discovered that -flive-patching is responsible for all those > "unreachable instruction" objtool warnings which Randy has been > dutifully bugging me about over the last several months. For some > reason it subtly breaks GCC implicit noreturn detection for local > functions. Ugh, that is unfortunate. Have you reported it? > 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. > If there aren't any objections I'll be posting a patch soon to revert. I think it would be a setback. Regards Miroslav