Received: by 10.192.165.148 with SMTP id m20csp3275666imm; Mon, 23 Apr 2018 03:54:21 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+XRg5mQ9cKUASIFJoQOGsHmsNVXlw46VTrHpJBzFcUnl9JcXb0gXIXFwxwgqMEzhs4lFAj X-Received: by 10.101.97.15 with SMTP id z15mr16603796pgu.393.1524480861479; Mon, 23 Apr 2018 03:54:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524480861; cv=none; d=google.com; s=arc-20160816; b=fsNxa9sOqROutI4B0+ABggPpqiegEqt4y1nvsw1ZarYsp8XT+1Ws+RayLYfyvw1jo/ 70ZlpPKz+t5mQNWbvAg1vSoYbWU/0KMJHXzp0cUbM6hNb6mS6udfQ9dyPh/PGAUt4s0e at8Yggbw/y2DM5+WOm3ugcy2xiH07UnNInOzfxQeMLTCBiCsAzW/Qas7/czGLtJ/vfY4 0R3bQyoS2ymnQe40r7oHyNK886MjdHD7IWjs4t0aggRqDLOAPv15JHqZOdeEEHhkt9rV pilX0cyiYXu2i38XQe6+EivgU8GxI0XlAS8VXHns6yg0G5+p0wDpBaMdN1Ng2GD7mWlu YOdQ== 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=wwYJvHe05ZurqEABcWnbLzwkVi/1jfGob6/cRFk7Ob8=; b=xjGpcMS1JmbLkleBUyFPtVCFrnAtGaPuYnY82XceWVHobuHbnKHmRTATwG6P3INMPl 01hk2UosbKS0d5nkY+7Y/U1LZcHtbxD3XEpEx7pKyM5eidK/bicCN3+nuK1yDjVXJMyZ PCCH5dWTzyPs3rp68Ih+5otdSfEmG3FMO+zEM81jU6fpjlc20Xg2eF8fXEtv4aFlch8/ VdV80wZ9kU4zfcj7IYuzlWgBvCpKMNwcjZHl85NiqE2i+9i3AJxzQtraQxlToaFgIHHt zVmStFgsNW6E3ivzmYCve8RbID4V9UzzB3HH/15oHfKjODWlgynX9aBpEJR3V6mNfOok dcjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=di3tDx9r; 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 j10si10693435pfi.326.2018.04.23.03.54.07; Mon, 23 Apr 2018 03:54:21 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=di3tDx9r; 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 S1755251AbeDWKwW (ORCPT + 99 others); Mon, 23 Apr 2018 06:52:22 -0400 Received: from merlin.infradead.org ([205.233.59.134]:49090 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754808AbeDWKwT (ORCPT ); Mon, 23 Apr 2018 06:52:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=wwYJvHe05ZurqEABcWnbLzwkVi/1jfGob6/cRFk7Ob8=; b=di3tDx9rbfa8LszMMoeDRJCOO oiLg9DebpbqcE7VNxMq8Z5s4QkUsSIbiBl+pP07GfzPTUhviVeMI54UPuU7RInD3a7/Qcx4prLf0x lpvqdFHeOuOjF4C95X6UwRE+frEOL+nDHmX+eUKGl7D03lCtSXZoZe1QgXWX65o5LpYs7hIzb1j/I kcGMrK/docP0wY1KHSeVQpPn0fRoxb7NXNzZnv8PZfgNNDDwen7Ba6JAEV2WaGRQ32rq1yVG907eI iSNzBofxdJ4LMUjHI75JS2xEokXAB87FFVCQVsvnib+FbHYivMVEBds99Fy30CVlpNZMHTzg8UzeT uLzCdlTMA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fAZ4s-0007TQ-TG; Mon, 23 Apr 2018 10:52:11 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 7D8C9203BFA02; Mon, 23 Apr 2018 12:52:09 +0200 (CEST) Date: Mon, 23 Apr 2018 12:52:09 +0200 From: Peter Zijlstra To: Yonghong Song Cc: mingo@kernel.org, ast@fb.com, daniel@iogearbox.net, linux-kernel@vger.kernel.org, x86@kernel.org, kernel-team@fb.com Subject: Re: [PATCH v2] x86/cpufeature: guard asm_volatile_goto usage with NO_BPF_WORKAROUND Message-ID: <20180423105209.GX4064@hirez.programming.kicks-ass.net> References: <20180415042738.1788215-1-yhs@fb.com> <20180420081936.GD4064@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 20, 2018 at 11:06:03AM -0700, Yonghong Song wrote: > On 4/20/18 1:19 AM, Peter Zijlstra wrote: > > Hurm, so adding __BPF__ for BPF compiles isn't an option? It seems to me > > having a CPP flag to identify BPF compile context might be useful in > > general. > > With "clang -target bpf", we already have __BPF__ defined. > For tracing, esp. ptrace.h is included, "clang -target " where > "-target " can be omitted, is typically used. > The reason is the native architecture header files typically > include a lot of various asm related stuff where "-target bpf" cannot > really handle. We relay on native clang to flush out all these > asm constructs and only bpf program needed stuff survives > reach to backend compiler. So because 'clang -target bpf' is 'broken', you do a work-around using 'clang -target '. But because that doesn't set __BPF__ you want to add NO_BPF_WORKAROUND to the kernel instead of adding __BPF__ to your build rules to better mimick -target bpf, which you should be using. How is that sane? Why not use 'clang -target -D__BPF__'