Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3852482ybl; Tue, 21 Jan 2020 08:13:19 -0800 (PST) X-Google-Smtp-Source: APXvYqwEJGffKpi+rcxvl7euy3l69oXZUnvL+tyL2DfldU7M5ClZ33/TlEr6rD7QAq1YOFHFVyOq X-Received: by 2002:aca:4c57:: with SMTP id z84mr3381856oia.0.1579623199446; Tue, 21 Jan 2020 08:13:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579623199; cv=none; d=google.com; s=arc-20160816; b=kv8BAmzVCiHN/A+7ie/77fetWL42oTvxLeaph3bhQYI8N4/JoDIIbKsAQo7dEeuBs7 XYUpZ7Jx39NdXukZeHit/qiT9j2rGuErTjiqp4EPz2+irvZ4FZuc7OGhMD2mnwLNvhau 2lfYVixLT1lgMvA6r4mqVFWr42XMKZ0hFcVJ1ALGJTUvF/kw52jdd6Myn706LOh18QVB HhUpRDHAHuXn6oGco4jN7Ea6zFgFeZFgyrA8h9Q5ZjvoRP+Z83hDbuBTXjrLgUlsMFLq VS5umNX8HapnvFVWsaCS02BtUKec6hda1RDHYNUfmLl2IpGx4HcdJS2Jtc4wTctvyF/C Zcxw== 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=heVKG+KSMzawq2hC2KgTNTV1AZM6QZ5629QiClM/r1A=; b=0d5gsWwmTPOImd0HkYDMJQaBNeVOzN3nJ5p8ulsCRMeuVdEbUVM13QflImK0hDfqX2 HIr2QGgE9QRvvLuqDE4BgCT7es1Q7Rn1BVnqcUolGZEytS8Z30IskNcrn991U/Pd0QIU GPIOsBQUB2PLN7i0pI67dyonGb9XxgtVR4dmQXWKt1B7AJBpcenCJg1l4PktFWLIw0pX oFX+5WUNuARn95lxpWN5nFai7ru+6cNFshaSHDstKivSgSyDBuUwRMsjka4J+a7fHbez ovPhhPl0BWc2eS0Ifj5p0gsUSYhlhk6PU0VERlaULTuxra45RYQaFDbtce55NCMJybYi XwYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DvWqyFeX; 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 n6si22791503otf.246.2020.01.21.08.13.06; Tue, 21 Jan 2020 08:13:19 -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=DvWqyFeX; 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 S1729366AbgAUQLK (ORCPT + 99 others); Tue, 21 Jan 2020 11:11:10 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:24372 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729238AbgAUQLK (ORCPT ); Tue, 21 Jan 2020 11:11:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579623069; 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=heVKG+KSMzawq2hC2KgTNTV1AZM6QZ5629QiClM/r1A=; b=DvWqyFeXCIVWIQfTa6O7EDCPLTdyr2SpUsYk90z6zYMD8GekQWRK7ypH10El6l+/4Z0A7+ F2G+klwk1qN3woOZ5U6X5sAm1eDB/G+ONAjg7w2RR+gnjOVpOP6zhJqgmOQc9jkmshQUdS fQ/DH7wgt+zRO1gaKVtntuZo9Mr3aiQ= 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-298-2Vtp-qc_OfeKGDhAjMVAfQ-1; Tue, 21 Jan 2020 11:11:02 -0500 X-MC-Unique: 2Vtp-qc_OfeKGDhAjMVAfQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5A4B4113784C; Tue, 21 Jan 2020 16:11:00 +0000 (UTC) Received: from treble (ovpn-122-154.rdu2.redhat.com [10.10.122.154]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9C81E2898C; Tue, 21 Jan 2020 16:10:47 +0000 (UTC) Date: Tue, 21 Jan 2020 10:10:45 -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: <20200121161045.dhihqibnpyrk2lsu@treble> References: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 21, 2020 at 09:35:28AM +0100, Miroslav Benes wrote: > 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? Not yet (but I plan to). > > 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. -- Josh