Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1186606ybz; Wed, 29 Apr 2020 16:45:59 -0700 (PDT) X-Google-Smtp-Source: APiQypIOZrkFBZ5u1boamkgiVCPQZEr9K6LyklAsx5bv8r8XVVE22TfBPJNSDyl7cVNBEhZon6Ss X-Received: by 2002:a17:906:390a:: with SMTP id f10mr263219eje.74.1588203958916; Wed, 29 Apr 2020 16:45:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588203958; cv=none; d=google.com; s=arc-20160816; b=KzWa4G11EJwME7aUD8xUE5rBO3eNl1pMVqKzMUc3PfWaUTiNuTTf/X5uyoKtoey9C+ wjeeLAdKjn1gqzF74z/MW1wd2gzoWxzqzzYF0NDR/0FmquX25fGfI6WrACPsDNSv4t2V Xfe3Dqyj4tss0zBh5AsoLv4qLEfuA1eIBKJ06dqOKf8lGJk+l0Uhg2PqMkCtJnIgkVgn ISRnd4DVM4jiv2nQ1uRoDFEmko5kOIFAeGGFmTEaWFGToPcVVLlgprB7/LqaZH+FYiC0 xM6RYxnqiUlcOd1Q6UgzDLn2SEE1XYkPr8WDnCTiSNd83orCtWOO0HI7E/ttioydm2t4 2kMg== 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=do9+MWbG28UjyHAK/kcWf4pA+OINYdqriwEnk8jdTKY=; b=np4rKyAVtcWWUmp4v6YnTgkihyeefeiKTE7CzWzz0+vmdYR98TucxUnMT8ft9lAH1b 0jchq4WbSowAoyMO44edPhQehEokcMfOiG9C3X59EUgFJedO6xacaKLtrcaaJ2/FPJUN ZE1U//69DtyqmvYdRop1UkDJ1x1pSY2OEyIag1wzJmI7xBHM0yvp1ldbCcDKAl6aqCgz ASnElHcZ/JljFKtBimq5HQT1rJz/Ua6yXjzeP3vjYevwQQPVbJJ5LmlzXse2fDnLbI9W JYpFGsSujL52gzpK40DqfbCM1Ju/6w3bxCpM2bPg3r1H9SboqniZtUiNldjlnOv9IGtP gbJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dmwaP+II; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h21si4477711edj.79.2020.04.29.16.45.35; Wed, 29 Apr 2020 16:45:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dmwaP+II; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727100AbgD2XmE (ORCPT + 99 others); Wed, 29 Apr 2020 19:42:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726164AbgD2XmD (ORCPT ); Wed, 29 Apr 2020 19:42:03 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B635C03C1AE; Wed, 29 Apr 2020 16:42:03 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id 145so1902629pfw.13; Wed, 29 Apr 2020 16:42:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=do9+MWbG28UjyHAK/kcWf4pA+OINYdqriwEnk8jdTKY=; b=dmwaP+IIHgrZTFicMlJo0kRd02lRso6m3dcRss+7ThqI0dTejM7ZefD+XY9faiukTk +KvvM/uNd/3S5ivSMMscmqUrYcDQqIO/N/0ST66hp0d0LyO8t1PvZyLk4Ov1g3Nbf82a Pot8aPwSqX26OJpde3f5NLWa+WTr6EuYo5Ijeb2AeQrLv0OqNkkj1FtSJSU2d4+NiWOi O9xX6FAFffFvw3AOFdJHzVTgFO3YKYatUtBw7a2DvLixCLjRi2Y/ITp6RKrFx2QHfXWQ 7pi3/GUfSscN15rZKA4wxEforf9ihW39y9rXN3xUAt82heDUepP5QDPyBpcuweFpes73 ApVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=do9+MWbG28UjyHAK/kcWf4pA+OINYdqriwEnk8jdTKY=; b=SmT9FnpdQEN+NG8pJ4qnin9qPl+aGcE0R5D1V3hUWEpOovYBHIG5PXIVQZfX45dN3j +GVTGONN1hJERGrdZLBDthdIyz1Gzw39tV2HE5h/IXm3DX/PaRgkI7JfxPS9A2FpsVNd XRbKtsWCzWD9feRpqcrtakliH95j5j0x4vAciCfmjIUMRSoPtJlpp641N+JWJoI3zszZ YJ136Ndr+EbX3z0TQgsYAhzsuAI6BZFGSD2Blx5bbMDJkcMWX9PGPn71KWMeP7G6pOJh oXLu2aPL2Qi2QEtViIoTDVDGxvg01h/Hprpkf2sToBUtKHMM9NpUOW3tR+KpHDvMh1Py RJuA== X-Gm-Message-State: AGi0PuahwjS4PFdOw512ywVawz1X+XVessTJVUvplKhUI5BHPfeV84PT IKukq3bbjLjz21/d6idvyks= X-Received: by 2002:a63:5a50:: with SMTP id k16mr610640pgm.171.1588203722891; Wed, 29 Apr 2020 16:42:02 -0700 (PDT) Received: from ast-mbp.dhcp.thefacebook.com ([2620:10d:c090:400::5:e95f]) by smtp.gmail.com with ESMTPSA id t80sm2003237pfc.23.2020.04.29.16.42.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2020 16:42:01 -0700 (PDT) Date: Wed, 29 Apr 2020 16:41:59 -0700 From: Alexei Starovoitov To: Josh Poimboeuf Cc: x86@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org, hpa@zytor.com, ast@kernel.org, peterz@infradead.org, rdunlap@infradead.org, Arnd Bergmann , bpf@vger.kernel.org, daniel@iogearbox.net Subject: Re: BPF vs objtool again Message-ID: <20200429234159.gid6ht74qqmlpuz7@ast-mbp.dhcp.thefacebook.com> References: <30c3ca29ba037afcbd860a8672eef0021addf9fe.1563413318.git.jpoimboe@redhat.com> <20200429215159.eah6ksnxq6g5adpx@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200429215159.eah6ksnxq6g5adpx@treble> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 29, 2020 at 04:51:59PM -0500, Josh Poimboeuf wrote: > On Thu, Jul 18, 2019 at 12:14:08PM -0700, tip-bot for Josh Poimboeuf wrote: > > Commit-ID: 3193c0836f203a91bef96d88c64cccf0be090d9c > > Gitweb: https://git.kernel.org/tip/3193c0836f203a91bef96d88c64cccf0be090d9c > > Author: Josh Poimboeuf > > AuthorDate: Wed, 17 Jul 2019 20:36:45 -0500 > > Committer: Thomas Gleixner > > CommitDate: Thu, 18 Jul 2019 21:01:06 +0200 > > > > bpf: Disable GCC -fgcse optimization for ___bpf_prog_run() > > For some reason, this > > __attribute__((optimize("-fno-gcse"))) > > is disabling frame pointers in ___bpf_prog_run(). If you compile with > CONFIG_FRAME_POINTER it'll show something like: > > kernel/bpf/core.o: warning: objtool: ___bpf_prog_run.cold()+0x7: call without frame pointer save/setup you mean it started to disable frame pointers from some version of gcc? It wasn't doing this before, since objtool wasn't complaining, right? Sounds like gcc bug? > Also, since GCC 9.1, the GCC docs say "The optimize attribute should be > used for debugging purposes only. It is not suitable in production > code." That doesn't sound too promising. > > So it seems like this commit should be reverted. But then we're back to > objtool being broken again in the RETPOLINE=n case, which means no ORC > coverage in this function. (See above commit for the details) > > Some ideas: > > - Skip objtool checking of that func/file (at least for RETPOLINE=n) -- > but then it won't have ORC coverage. > > - Get rid of the "double goto" in ___bpf_prog_run(), which simplifies it > enough for objtool to understand -- but then the text explodes for > RETPOLINE=y. How that will look like? That could be the best option. > - Add -fno-gfcse to the Makefile for kernel/bpf/core.c -- but then that > affects the optimization of other functions in the file. However I > don't think the impact is significant. > > - Move ___bpf_prog_run() to its own file with the -fno-gfcse flag. I'm > thinking this could be the least bad option. Alexei? I think it would be easier to move some of the hot path functions out of core.c instead. Like *ksym*, BPF_CALL*, bpf_jit*, bpf_prog*. I think resulting churn will be less. imo it's more important to keep git blame history for interpreter than for the other funcs. Sounds like it's a fix that needs to be sent for the next RC ? Please send a patch for bpf tree then. Daniel, thoughts?