Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1403274ybz; Wed, 29 Apr 2020 21:45:10 -0700 (PDT) X-Google-Smtp-Source: APiQypJmLzQV6txZyxal6Npjg2ds3RbD4dsrmFlrU8FfY/WF1O5OO405TSFEnDYchzbIaCu3HonN X-Received: by 2002:a17:907:b11:: with SMTP id h17mr982953ejl.371.1588221910616; Wed, 29 Apr 2020 21:45:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588221910; cv=none; d=google.com; s=arc-20160816; b=M2IacIw/kwYSvOMRcqdW7uD3RLb0B4BOYZ6gCs524sQZFWtggZntCVnodeyOEaPAD6 neGWNCUHGo+1l3hGYMfRnzy/LK0keYVKAIgMxEj5LghCyrFFa6aV4hqVtcAEfepa+moz 7KzfgGEuH6tIifLJqZfYR7XMrUgkx6ROETNoZsju06SPRdJA0oUm9QsqjpNzvkJfIS9g trVP/aANVjP+HbfTbWGjvLeDi1K2eFVqEv7IJH1ECs0JRrYyRiLwhONOySusHZwNY98c mXKSt5YBjNYekTzdBl/sizEsaGl6lRoHwAQsAin7EID55MgH9CRqICfret4XY18YiMih dw3g== 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=L5n4gtXTehbFEMm9+vNyemjrQTYFiG9C1+7VDPD2ZDM=; b=KqCV0dlHj9DnBjVOa2hPFxVumI6JR1MyXOee6TKY/16e8dBZvFo4OeQgRqeL/5dpVi p0ZwaV7SGaAb4chmU8fm5JQsclBnkrsZRrTmzsesKbjvpqFr8XnFI3OfuQqFBdrky263 N2dCneoUYqiM5lAn16sonL5wBQDHLjfNAaqW0ysOXAkxH9Cr/sq9UMb5XmujaL4L8Y1P 3zOAcwOKxP7CaskIqUOWj0HiojplZQal/uAxgxC+jzqTgkgKTb0QrqyMfLZ3P5tL9RkN 3xJ5Z+p6Xm8dj+PnP+YCBqW4d3KPthY91HWQUXBt0mJPulyctOqqhF9p1bWVK0HZ2laa eSSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IMBroTwG; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o14si4922279ejm.511.2020.04.29.21.44.46; Wed, 29 Apr 2020 21:45:10 -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=@redhat.com header.s=mimecast20190719 header.b=IMBroTwG; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726428AbgD3EnV (ORCPT + 99 others); Thu, 30 Apr 2020 00:43:21 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:21704 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726391AbgD3EnU (ORCPT ); Thu, 30 Apr 2020 00:43:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588221800; 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=L5n4gtXTehbFEMm9+vNyemjrQTYFiG9C1+7VDPD2ZDM=; b=IMBroTwGUtmQmZKi/XHboKgMFYzKClflZaLB6VAAZ87Q2LneKPC7TZtIpBJhQlUcpFTnbm /JiGOfY1pU6tD2HG4vLeBhMGQqPl5kcDy2/giX9Z/gsE7ulVwPa8+qMl81caACipRLbQcD ll0mlms3Qt0v5LcOtdf5Mhu5VS0q3Ks= 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-165-u5tkPwroN5-ug1W3-b0i_w-1; Thu, 30 Apr 2020 00:43:15 -0400 X-MC-Unique: u5tkPwroN5-ug1W3-b0i_w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B9C9C18FF660; Thu, 30 Apr 2020 04:43:13 +0000 (UTC) Received: from treble (ovpn-113-19.rdu2.redhat.com [10.10.113.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 74C815EDE0; Thu, 30 Apr 2020 04:43:11 +0000 (UTC) Date: Wed, 29 Apr 2020 23:43:08 -0500 From: Josh Poimboeuf To: Alexei Starovoitov 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: <20200430044308.kkniqb7pnpn4bovg@treble> References: <30c3ca29ba037afcbd860a8672eef0021addf9fe.1563413318.git.jpoimboe@redhat.com> <20200429215159.eah6ksnxq6g5adpx@treble> <20200429234159.gid6ht74qqmlpuz7@ast-mbp.dhcp.thefacebook.com> <20200430001300.k3pgq2minrowstbs@treble> <20200430021052.k47qzm63kpcn32pg@ast-mbp.dhcp.thefacebook.com> <20200430035315.tc74v5twfdxv2goh@treble> <20200430042400.45vvqx4ocwwogp3j@ast-mbp.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200430042400.45vvqx4ocwwogp3j@ast-mbp.dhcp.thefacebook.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 09:24:00PM -0700, Alexei Starovoitov wrote: > > This would actually be contingent on RETPOLINE, not FRAME_POINTER. > > > > (FRAME_POINTER was the other issue with the "optimize" attribute, which > > we're reverting so it'll no longer be a problem.) > > > > So if you're not concerned about the retpoline text growth, it could be > > as simple as: > > > > #define CONT ({ insn++; goto *jumptable[insn->code]; }) > > #define CONT_JMP ({ insn++; goto *jumptable[insn->code]; }) > > > > > > Or, if you wanted to avoid the text growth, it could be: > > > > #ifdef CONFIG_RETPOLINE > > I'm a bit lost. So objtool is fine with the asm when retpoline is on? Yeah, it's confusing... this has been quite an adventure with GCC. Objtool is fine with the RETPOLINE double goto. It's only the !RETPOLINE double goto which is the problem, because that triggers more GCC weirdness (see 3193c0836f20). > Then pls do: > #if defined(CONFIG_RETPOLINE) || !defined(CONFIG_X86) > > since there is no need to mess with other archs. Getting rid of select_insn altogether would make the code a lot simpler, but it's your call. I'll make a patch soon. -- Josh