Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1349707ybn; Wed, 2 Oct 2019 14:51:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3EBN0F373JuejmBCdNPvR8VJBc0j8CbthC9rjv4bXKgpTKF5vPn0/N8F/DA2Qomb8Nqol X-Received: by 2002:a05:6402:1ade:: with SMTP id ba30mr6355298edb.304.1570053084555; Wed, 02 Oct 2019 14:51:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570053084; cv=none; d=google.com; s=arc-20160816; b=dvGHIboqEkFvdWzveV223G0ruVEsBNnp3rR8t68wHulcEof94YUq5Kp/Wm6v58auQB 6goHZX1BGEe8J/rtKzXp1eFKRcWwvVGRV5G2fy5KDrEZT4Z8Trk65IsoG042JQX49gTE 3DvTpuQ3MduHv1bvM4LBd7SQk1EyQo9OHfhMDn+f+9w3GoXopRMzyvlLnmgSvUly+eOL FajvAYWxupeoPRh7Nj+ep5LIcAFlLlJJNNrtUn2wLEvFLki4CRqoY66x6DkZWxLs/4A5 9Zo0e60PitkRydk6JhzwXQH/1XJuZkOD23aPu8inLU9BKgkDDW4sqRU7bSD0Vxfz8JJC NcDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=fcINkAGrhaxybz9we0aCJ9+w9JUp7C0z8Gn94WWvQGI=; b=NaKNwnHolp9jWRHKB15njdvzSNL8C4apAK+7uQ9sAoObGZTV5lRNrqjqMhAxRMAtQ3 sI948XsCZ1ygqxrNF8V5s1IDjQVqFnnWI4tB0TW114IKk+VgWa1d+sx0BCArc0usNoEJ GwWHGInv/PfnygQJBpBa/9ppl0tD7/2XvFlgsvK1cIvqZMG0gvuC4H8Y3AJo1O244FsU wGyVtPJrPNtllgj+3Ww6YtJ3IIGbk+YfCOVputhBcbxxoRP/C28bV+LGIWg16OuYYKIp 2bpeNC1I2QEKaIpHPqmg2vgA0MePmuR3MKmofHNSwdPkdKVhxgLN1HGGaoEhPRzaATIf z2lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BjDZyYgj; 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 s14si298364edc.83.2019.10.02.14.51.00; Wed, 02 Oct 2019 14:51:24 -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=BjDZyYgj; 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 S1727484AbfJBUWV (ORCPT + 99 others); Wed, 2 Oct 2019 16:22:21 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:46577 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727304AbfJBUWU (ORCPT ); Wed, 2 Oct 2019 16:22:20 -0400 Received: by mail-qt1-f195.google.com with SMTP id u22so356460qtq.13; Wed, 02 Oct 2019 13:22:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fcINkAGrhaxybz9we0aCJ9+w9JUp7C0z8Gn94WWvQGI=; b=BjDZyYgjhfxWcP3NTWkt0mMF/bAuMBjpivsjx7HfXOrCmMr1getLWzGJso+UuJ3zdb K2PaFVMLXTGS2/r7nMFf3pMjf2yg+79Eb3x+suEdXJWcBAvvMgbMyAObfJWypFt4a+ED EooK5rxib95WH0eMz1mwL2sTqVbbyFjGDt7vRPwi8HL7liGAwYiknyv2hIDssS5zx8fQ +QR9Fg0ISZPTwmpGpTI10DbOIKVhpSq9LC/tPUfDLtZWjBgZfOnjGWTcglvLdmyGJZoS vPVYma+ZxpAM7X63vm2eRkThUj42ZUGXwEohT+v+JpVo27Kf9BhZAG/m/ebC8JUIiR4m 4lAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fcINkAGrhaxybz9we0aCJ9+w9JUp7C0z8Gn94WWvQGI=; b=qHSqfwUAPJ+kLMeh/Qr708AdeG6ljvpRPvvRY0lDCmvTcG5YCxVLFP4ZnJWXlbu+sX OoqY5NFIaR5u3MLdRWOl2Ok69PmOs84ywmwzIp4rRSxnkQx/ZvUt0cYh86XculpLO6zn eqOGNs/SaFHLHVQZ9NIyOszRemXiPwCO04sG32suDU34C4jFXZ3h7DFGAKWPRd9T/YAg 2WUteIGNnpmqfeQyxZj+mICcke1RsQg8efsh2jrGKtQVmmBIk9t5JCG6cqYduIQfrqIz Tsx6n0ri93VmKgk117ImSqq4MVOlNhWgWwqY4j+Jyax9xlajm/PYiLFzGW03MmZHwd92 fTMw== X-Gm-Message-State: APjAAAUlDw7kTrA8O82dmChMwK5P6oofKV2J12T7xW7RtY1Y3b7yfK8B pIBxvl0CBTTsXcREhca5fqKW1CBfn5iSbzI7bwI= X-Received: by 2002:ac8:1417:: with SMTP id k23mr5869128qtj.93.1570047739558; Wed, 02 Oct 2019 13:22:19 -0700 (PDT) MIME-Version: 1.0 References: <20191002191652.11432-1-kpsingh@chromium.org> In-Reply-To: <20191002191652.11432-1-kpsingh@chromium.org> From: Andrii Nakryiko Date: Wed, 2 Oct 2019 13:22:08 -0700 Message-ID: Subject: Re: [PATCH v2] samples/bpf: Add a workaround for asm_inline To: KP Singh Cc: open list , bpf , Florent Revest , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Florent Revest , Rasmus Villemoes , Arnaldo Carvalho de Melo Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 2, 2019 at 12:17 PM KP Singh wrote: > > From: KP Singh > > This was added in: > > commit eb111869301e ("compiler-types.h: add asm_inline definition") > > and breaks samples/bpf as clang does not support asm __inline. > > Co-developed-by: Florent Revest > Signed-off-by: Florent Revest > Signed-off-by: KP Singh > --- > > Changes since v1: > > - Dropped the rename from asm_workaround.h to asm_goto_workaround.h > - Dropped the fix for task_fd_query_user.c as it is updated in > https://lore.kernel.org/bpf/20191001112249.27341-1-bjorn.topel@gmail.com/ > > samples/bpf/asm_goto_workaround.h | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/samples/bpf/asm_goto_workaround.h b/samples/bpf/asm_goto_workaround.h > index 7409722727ca..7048bb3594d6 100644 > --- a/samples/bpf/asm_goto_workaround.h > +++ b/samples/bpf/asm_goto_workaround.h > @@ -3,7 +3,8 @@ > #ifndef __ASM_GOTO_WORKAROUND_H > #define __ASM_GOTO_WORKAROUND_H > > -/* this will bring in asm_volatile_goto macro definition > +/* > + * This will bring in asm_volatile_goto and asm_inline macro definitions > * if enabled by compiler and config options. > */ > #include > @@ -13,5 +14,15 @@ > #define asm_volatile_goto(x...) asm volatile("invalid use of asm_volatile_goto") > #endif > > +/* > + * asm_inline is defined as asm __inline in "include/linux/compiler_types.h" > + * if supported by the kernel's CC (i.e CONFIG_CC_HAS_ASM_INLINE) which is not > + * supported by CLANG. > + */ > +#ifdef asm_inline > +#undef asm_inline > +#define asm_inline asm > +#endif Would it be better to just #undef CONFIG_CC_HAS_ASM_INLINE for BPF programs? > + > #define volatile(x...) volatile("") > #endif > -- > 2.20.1 >