Received: by 10.192.165.148 with SMTP id m20csp1319548imm; Thu, 10 May 2018 08:54:26 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoRh5hvK6LZTjzXMzjXu1vKVBullWmD3S0Sv2SbtXUpWmyRsOor7Ic4v6MqYBxKB16r9pUV X-Received: by 2002:a62:581:: with SMTP id 123-v6mr1923807pff.38.1525967666346; Thu, 10 May 2018 08:54:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525967666; cv=none; d=google.com; s=arc-20160816; b=0p59FWsmMDEtsUNrwene6wUKNy0OLTFVKSDgSJ72LLStQP7jvSuWHR4srJpzQ3Hm3+ DXP0ckHTofudUuslXtrvPFwzHQC64Xua3N8p3DxfbIOLf3AtRKW1x/KdjzCiMJhjQcLD lcfzekeDsrUaSC//e+uJoVzYCQhDjTQF2gt6O7jevVejz8VJKiXFoCh2zGSXNMARGDNj flq6hw7ALpdGD2uOJsIeJRJLKycJNh4uuLaGUXBCUg/zmbKVos2k/N3ynMTfQGvvqj6f i99t8Smxc/ufdB0KCdzV5mnUjK8fUs6ZZO6nC1J7LBh1BvWIyqD07D/SW/5lcuchBpN3 PJYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=UpppS5u+40PipeEzCqtnaj2std9SfZOOn/8v2w4FrEo=; b=QwCOB8BuAxdZ98KshcEpMUHQCEb7f5irEU0eBvBXACPaMicaLHZjHvx95um6ATs5i/ 503dTJTqK9mNeQBvJZhPhYLRCDFzvkjBoZGgluYOnvF5J1c6GqIuveVxG8uZi8CsdsFI ti9jpG3vPYylMZekoJ/m74d0N6r7zMX5GNwhnbygcU3AJ7+UzP4xjpzy5GyD36FWY47P UtOOXwMRJIbuW/OwpvUrFADnFOQ1+n2jr2ueUrbnvmQQE9evepbzJ/Kq1Nnzzm1TmEoD bc7z9dQEfNX4jHM+73WIqOqb738I7uifmhGtB4daspEnRadAv34EuwijeRE4zlOT+oq0 dlYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Fgc65EwD; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k9-v6si868680pgo.340.2018.05.10.08.54.11; Thu, 10 May 2018 08:54:26 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=Fgc65EwD; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966355AbeEJPwr (ORCPT + 99 others); Thu, 10 May 2018 11:52:47 -0400 Received: from mail-pg0-f41.google.com ([74.125.83.41]:36854 "EHLO mail-pg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965033AbeEJPwq (ORCPT ); Thu, 10 May 2018 11:52:46 -0400 Received: by mail-pg0-f41.google.com with SMTP id z70-v6so1151469pgz.3; Thu, 10 May 2018 08:52:45 -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:user-agent; bh=UpppS5u+40PipeEzCqtnaj2std9SfZOOn/8v2w4FrEo=; b=Fgc65EwD8fn0ccy5IbPkgfGpbwWjBnDgEi8zfqcafkrIjHBVxxUbN5HMrkcqX1eSsp qmL6IMFcq8ybytUKbCQdgyExZ99f3ST8yarqExU5Duu+SGsue4zMys6r9+zPOyjZJOA4 WSN3Z52QmRAP8Fm3GaMmuAXmrBIFXiYV4JbBSh7RiMdxH71a2vGZvKssJAcorduQ9YDC rJ2tpTFPvOctJ0pvaLnzMrHj09/5wLsXW6wNH2MsI3GfEhbuHpV1oRgaIPlUXPxUN+Fb r2J/YmWhTXGplynBdvxUByMsCwMvHepZGjnlcjLjU4NHaYiDHou6eUw7D/owzEoVnCPp NGdQ== 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:user-agent; bh=UpppS5u+40PipeEzCqtnaj2std9SfZOOn/8v2w4FrEo=; b=IRQAvEBqj8BFSgz66XjuHMeYXztg8tXhgZXcsP09oOTmxdmOa+mVwa57eneTDjsC5C pReeE1O5zTlCCPNNfoGGIoyZ0Apkn5FLVN969cMudjdvPSjXEWNgcooC+uj8eVF4PJ59 uIJLAk0PsN/8/RGsdY8PXuGwHkAu1aTXuRF77ykcBpsxWr48sqpPVKgpJciyuIGto3iZ OcESgdQNobWsd6NUq7S6nx0e75EbFTDv4vI5CVdtbpQwv2NmozwNaEharVnUOy3UgI6R 9ufR5vjuMgV/E3QZ9lDFCBq8RHnceZKyES98jm9rICkebrHkucvftMjPq6waSOEnteKT sgiQ== X-Gm-Message-State: ALKqPwd6wT/tnCCZLFGLWTSKucmFyapTgDpAMbhT0AhGFJdJV94hsngC ZdL3Y3ul3Pl43AXHzu5Sjug= X-Received: by 2002:a65:4102:: with SMTP id w2-v6mr1564659pgp.31.1525967565331; Thu, 10 May 2018 08:52:45 -0700 (PDT) Received: from ast-mbp.dhcp.thefacebook.com ([2620:10d:c090:200::4:c752]) by smtp.gmail.com with ESMTPSA id a4-v6sm4355034pfj.19.2018.05.10.08.52.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 May 2018 08:52:44 -0700 (PDT) Date: Thu, 10 May 2018 08:52:42 -0700 From: Alexei Starovoitov To: Peter Zijlstra Cc: Yonghong Song , mingo@kernel.org, torvalds@linux-foundation.org, ast@fb.com, daniel@iogearbox.net, linux-kernel@vger.kernel.org, x86@kernel.org, netdev@vger.kernel.org, kernel-team@fb.com, Thomas Gleixner Subject: Re: [PATCH bpf v3] x86/cpufeature: bpf hack for clang not supporting asm goto Message-ID: <20180510155240.5s2fpgm2fwal3jlj@ast-mbp.dhcp.thefacebook.com> References: <20180504033119.2130788-1-yhs@fb.com> <20180510100634.GZ12217@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180510100634.GZ12217@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20180223 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 10, 2018 at 12:06:34PM +0200, Peter Zijlstra wrote: > On Thu, May 03, 2018 at 08:31:19PM -0700, Yonghong Song wrote: > > > This approach is preferred since the already deployed bcc scripts, or > > any other bpf applicaitons utilizing LLVM JIT compilation functionality, > > will continue work with the new kernel without re-compilation and > > re-deployment. > > So I really hate this and would much rather see the BPF build > environment changed. It not consistenyly having __BPF__ defined really > smells like a bug on your end. > > Sometimes you just need to update tools... Is it really too hard to do > -D__BPF__ in the bpf build process that we need to mollest the kernel > for it? > > > Note that this is a hack in the kernel to workaround bpf compilation issue. > > The hack will be removed once clang starts to support asm goto. > > Note that that ^^ already mandates people re-deploy their bpf tools, so > why is llvm supporting asm-goto a better point to re-deploy than fixing > a consistent __BPF__ define for the bpf build environment? This thread has been going for over a month now. Looks like we're starting to go in circles and what we discussed earlier got lost. To recap: - this is NOT a bpf issue. libbcc is the first user that got broken by commit d0266046ad54 ("x86: Remove FAST_FEATURE_TESTS") - all other libraries and tools (like fuzzers, static code analyzers, etc) that are using clang front-end to process kernel headers are broken too That makes me wonder what happened with "we do not break user space" rule? I think the safest course of action would be to partially revert the offending commit d0266046ad54 which we proposed first. Since you were concerned that this is somehow will disincentivize clang folks to add asm-goto support, we agreed to add this __NO_CLANG_BPF_HACK macro to un-break libbcc at least, so that existing libbcc installations will continue to work when people upgrade kernels. The __BPF__ macro is automatically defined by clang when '-target bpf' is used. This is NOT the case here. libbcc has to use native target when processing kernel headers. It happens from time to time that one or the other libbcc script gets broken by new kernel because kprobe symbol that the script is using got changed in the recent kernel. That's ok and we deal with this situation all the time. What's different this time that ALL bcc scripts are broken because of this commit and we cannot workaround in user space.