Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4431841pxv; Tue, 27 Jul 2021 07:14:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMwCN9XLyX5bqHcON6A0VL9o3zUWhq0ikRyaLxGpmKoNrYcCQEESUhend3dV2aOkMJC5Iy X-Received: by 2002:a17:906:404:: with SMTP id d4mr21935049eja.449.1627395282236; Tue, 27 Jul 2021 07:14:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627395282; cv=none; d=google.com; s=arc-20160816; b=JOlyp6YpvVjwUlU9V3aPrPBusOPrJMoHZi3QQRnm5VwvwXbNfS4YYHc2hXhLWWYsLH rO/nEu+lWE0UJrKZv3c5QPUJGlsYtrgbgcn81dLwzf+VUxf3aUjzS9lCp/DzLSXbnBwc LF+PyGxuReKIjwiyXwaOlfUfQ/AtSLxWPuL+0Wp8eIobzFrY91k/SaGXNqRCKfZ+BJ2M RBb6z57vw5c0aRBVF/DGvuLu2zymXayWX6SN2+ZpYO5CU+zixI/2xbHYRinO/9fCEIUT NxleoemkLr+jqfJOmgWVJmzcjh7jEydfQZmV9vhTGZagdoKutRITKHUsMV0Q7yoqbI1f HcDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=qh2D1P9GbylvB9WoMcMMTns7dk4r496odHfS4e44Lvg=; b=ViaeMydUcdROj4UF80ikVmy7pcS/cAn6aLsQJKqblonL8VU1GNBwcN0gideYUfg0xq UzCFad225WOI5aYyH/tckeQ725VLK+2SVOFCcjAZdRqhC6mjtQBxk+jKCd/ked0387rO BH/mjbACUDDmUX9o52Zoo/lMuho8hf4iGgWy5zPC9NVb2HcngISA4X/PjD4zOoZcohw+ B2Q4oc0qvKQGTAno4IgpwAURZ3LGmISMkDyrRu3Gw5YvKE9hD+4XQLUQxLySGBJEdBmS BE2VYLwOM4v991IM+fFk7yOxqd2BGphFrmuww6yQ1wR75qc7ugJNvfBxbKDKsZD36F6W l6Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sartura-hr.20150623.gappssmtp.com header.s=20150623 header.b=dZJmp177; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kl11si3064140ejc.593.2021.07.27.07.14.16; Tue, 27 Jul 2021 07:14:42 -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=@sartura-hr.20150623.gappssmtp.com header.s=20150623 header.b=dZJmp177; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236835AbhG0OMp (ORCPT + 99 others); Tue, 27 Jul 2021 10:12:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236775AbhG0OMo (ORCPT ); Tue, 27 Jul 2021 10:12:44 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC799C0613C1 for ; Tue, 27 Jul 2021 07:12:43 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id a80-20020a1c98530000b0290245467f26a4so2476292wme.0 for ; Tue, 27 Jul 2021 07:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sartura-hr.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=qh2D1P9GbylvB9WoMcMMTns7dk4r496odHfS4e44Lvg=; b=dZJmp177mREM10LfYUmdsmKymvqT9zX8M9d5RPLo0iJkNjXevLNRLGN2N3SaMXmwG0 vMLcK3Egi3Dx/TofYjBPkZVs7gZomoKadG+grDxLH/zhPIVWshiOWPbIRlOnhI23xx2V 8JU1Y/mZQpn/iSv0KXvTHP3kgMnFZsLIzPMcGPaDUfIPkmo/OjpDGiYVIXj37ZxwMHCw GSdXIX+TYtZnqwoZQcK3nfX9Pk53gGJlNtMzXWBMdFWCxYb0uBNYFx233cwHTgvTkXz+ bCVsfLtAaE4uD5SIZKMVIA5/cIvjop2of7YyRCNS3Z08nVO9dXrgqQQ15ovFDDCOHsXP nNiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qh2D1P9GbylvB9WoMcMMTns7dk4r496odHfS4e44Lvg=; b=GYt9l29j61t08l2zlqGW+7CTtjKFv/6cRg3mQIhNS85A3yHyQ2IPgbI7SOYECdzo1h 8afk60onI9XAjy8tMtCpTEQTKOA386nkR3JDDrzhFd8CRszKekz7oPGpjWqpt6SN2FQH R5kIp9bgLqh+foU1M+Dw9BqGQynATWTo7zXApaVpLcwWz2pdyBED4hdnYCC8YPl4RveO tJeCnuzCpFVt9fW5Dw0iPN5s600wffi9p1JDzhusV9WL8RfnoWLP3hwiOVYCxPPJgiTA sshktswofPLQXGwDYDHpV9MKzdYq3v7MAetA9tjb9KHS8RmRIKeMUlWfZp/deOCYLyo+ RcYQ== X-Gm-Message-State: AOAM5322yXIw02+XcuHL0FWsixIUsrbGRnqZDB4MISfgW8l3+Uj+aQxP ZoJ/P7uClAYBteylvlizsQvX9g== X-Received: by 2002:a05:600c:2907:: with SMTP id i7mr4369027wmd.184.1627395162452; Tue, 27 Jul 2021 07:12:42 -0700 (PDT) Received: from localhost.localdomain ([89.18.44.40]) by smtp.gmail.com with ESMTPSA id t1sm3403912wrm.42.2021.07.27.07.12.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jul 2021 07:12:42 -0700 (PDT) From: Pavo Banicevic To: linux@armlinux.org.uk, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, nathan@kernel.org, ndesaulniers@google.com, ivan.khoronzhuk@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, clang-built-linux@googlegroups.com, matt.redfearn@mips.com, mingo@kernel.org, dvlasenk@redhat.com, juraj.vijtiuk@sartura.hr, robert.marko@sartura.hr, luka.perkov@sartura.hr, jakov.petrina@sartura.hr Subject: [PATCH 1/3] arm: include: asm: swab: mask rev16 instruction for clang Date: Tue, 27 Jul 2021 16:11:17 +0200 Message-Id: <20210727141119.19812-2-pavo.banicevic@sartura.hr> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210727141119.19812-1-pavo.banicevic@sartura.hr> References: <20210727141119.19812-1-pavo.banicevic@sartura.hr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ivan Khoronzhuk The samples/bpf with clang -emit-llvm reuses linux headers to build bpf samples, and this w/a only for samples (samples/bpf/Makefile CLANG-bpf). It allows to build samples/bpf for arm bpf using clang. In another way clang -emit-llvm generates errors like: CLANG-bpf samples/bpf/tc_l2_redirect_kern.o :1:2: error: invalid register/token name rev16 r3, r0 This decision is arguable, probably there is another way, but it doesn't have impact on samples/bpf, so it's easier just ignore it for clang, at least for now. Signed-off-by: Ivan Khoronzhuk --- arch/arm/include/asm/swab.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/include/asm/swab.h b/arch/arm/include/asm/swab.h index c6051823048b..a9fd9cd33d5e 100644 --- a/arch/arm/include/asm/swab.h +++ b/arch/arm/include/asm/swab.h @@ -25,8 +25,11 @@ static inline __attribute_const__ __u32 __arch_swahb32(__u32 x) __asm__ ("rev16 %0, %1" : "=r" (x) : "r" (x)); return x; } + +#ifndef __clang__ #define __arch_swahb32 __arch_swahb32 #define __arch_swab16(x) ((__u16)__arch_swahb32(x)) +#endif static inline __attribute_const__ __u32 __arch_swab32(__u32 x) { -- 2.32.0