Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1199649ybn; Wed, 2 Oct 2019 12:19:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxG3JN4v1EhFwGmLGwC24j97lkKUD157VdKxdp+r1lSu7Le/TefHmLARdQXjUuR6aUJkZCI X-Received: by 2002:a50:d556:: with SMTP id f22mr5437559edj.263.1570043969463; Wed, 02 Oct 2019 12:19:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570043969; cv=none; d=google.com; s=arc-20160816; b=WH/cv8uknSBDq6geM/jhbE/PovbatuYsLjfUr9vISQPTg7mZyldCCv47qLROpmqusI zlTxw0jNKMhnBR6CqMj5t6BFEaYlP9imDc+d1URrALddVW6oMMXy1mL488Vq16iCo9Fw zFiN6kMEwZhjdIFpyLr41tBtQk/FU8tpSfTD7mBxPpKLIBy/wxf3XugbIMN16NL6Xd9n sjLQqK84gcT2lmFpglRObG9RG63Bbb8KNsEJviIbjzD5B6yq76WVX4oF0lJ001WSsI2m 9Jpss27MDt+LerHTxy1ADwY9bbfqmtB6fiYF9sPBf+znAvMRxNNj4d+my7TTAZfUdz03 fYAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=4oGOfktdveo5ZtuoH4C6yPHNIwcTv3+DyM2wCB4zh4U=; b=e+oYXZiqkCwtvGT/5ceRroEIT+kUphj+v4QbUiEjqYnHzlRhAnnoNj5G/toQuoNuRv YABzLOw01SHEhFZn0KyKLOQrOQ2I8X2yStXTz7HJNKvX5cCqoTStyb4tszmXvZywI9bH GM+u+xXppfXz8U2+t8WpTumI4jAPgywV5e7WKBJXdUP6SKPdTmnrDaMhiJQk/jLjTdSq 1xSdypKUb/+/u0ELxzY90RSfC8wq9SmHQKM22ohwe/EhYbRAThcgYIlNUBS6vZjEmZSC iGH/MOJPPF2xYkUh4rNyMQmRPBjybB+zVwoMMlokH+kjNG/VrJjaqfJd6C71qJiMJLgd 9t8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dAo0QIHT; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ni5si10954ejb.184.2019.10.02.12.19.05; Wed, 02 Oct 2019 12:19:29 -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=@chromium.org header.s=google header.b=dAo0QIHT; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729305AbfJBTRL (ORCPT + 99 others); Wed, 2 Oct 2019 15:17:11 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:44142 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728995AbfJBTRL (ORCPT ); Wed, 2 Oct 2019 15:17:11 -0400 Received: by mail-ed1-f67.google.com with SMTP id r16so154892edq.11 for ; Wed, 02 Oct 2019 12:17:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4oGOfktdveo5ZtuoH4C6yPHNIwcTv3+DyM2wCB4zh4U=; b=dAo0QIHTfhTRnlYtaeL9gFzX3qDzreXEhE4rf+FJms1XQb84amNAa8vp3so/P0rIps KN84SQ3T51eDvLkMPS8292geBjpXywMAmzx7uOca+jx9ndkr9cbGzz/16GXRurF3Dp6o dsodWB+N7/WQ/Jyv3/I1NxxsGTV5AUsJZqCBM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4oGOfktdveo5ZtuoH4C6yPHNIwcTv3+DyM2wCB4zh4U=; b=IbRK1vZ5gcuYA+x7AAZcdMu0zzr0FCLnnwn4t3jdAVl/pkYWETGqBZuj0Vde7CyXaG JGj9gf1dbmt3VAJFQc/yXS+6dDdc4NZmrEsgOfNFvuErzr2s/DFUUBUVQMljuJpAolc0 WFqEDOOuMLkVaJxnq8efzvQZsMql+h2xp0/YJzsGyHONOt6g+dXQnhKQBvg4wNtV7ITn POXNoVe3uTTq2Y6E6LFHWAp5kWZyIkG1Bd6+n1pi3DgSt6guowuGIKGeQI/sS72gWY6S /w/G4n8MARiLqJ6+sqh0EZQSgZFeOqCQO4FSewUuwpkVJIlxZtmTBfE+nt5kGUEsuoOd JrvA== X-Gm-Message-State: APjAAAVGhIsbPGQAdCtDsz9QsBzIQe0sHxQdnrQytJmmpkPoXtmFpZcP aTD4UFTIqBPdKpPaQnYS1H9nmAq75go= X-Received: by 2002:a17:906:1394:: with SMTP id f20mr4650214ejc.274.1570043829050; Wed, 02 Oct 2019 12:17:09 -0700 (PDT) Received: from kpsingh-kernel.localdomain (77-56-209-237.dclient.hispeed.ch. [77.56.209.237]) by smtp.gmail.com with ESMTPSA id p19sm7996edq.31.2019.10.02.12.17.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2019 12:17:08 -0700 (PDT) From: KP Singh To: linux-kernel@vger.kernel.org, bpf@vger.kernel.org Cc: Florent Revest , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Florent Revest , Rasmus Villemoes , Arnaldo Carvalho de Melo Subject: [PATCH v2] samples/bpf: Add a workaround for asm_inline Date: Wed, 2 Oct 2019 21:16:52 +0200 Message-Id: <20191002191652.11432-1-kpsingh@chromium.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 + #define volatile(x...) volatile("") #endif -- 2.20.1