From patchwork Fri Aug 30 00:50:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 172662 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp3000543ily; Thu, 29 Aug 2019 17:51:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqx6PN1PCb0i9m7Og7/EYq+2YhbURiP92DOFFccQs6cADmGBKMgGe5rGHEdddn2hLMUeJlX+ X-Received: by 2002:a17:902:3:: with SMTP id 3mr13439104pla.41.1567126270353; Thu, 29 Aug 2019 17:51:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567126270; cv=none; d=google.com; s=arc-20160816; b=c589s0AGM2SwZxldCUXK6muQ7eQEDs7nSY3AGQJ6hkuRb//zIqDmUZ3FxmOEhFmdiw H0Y9NQBEzO5sDTrZrUX3ExJwT6iDfLzTbuQP5loqw79bp0R2OFqQLA3n8nURNFnhYYSY zVQVHOy8wC0igtvMucRfHXOvI2qfIaxXC9dzZIeRIbqnT6vuorZXQzvvoe9kiooNbkTD 4hWZonhFdNIikqLnl44ekIXXn+CHLK9B/b9rrCj+Rk431ffrvKSGVw/6biTYRfpyUzcA hnfYJ5iTG5spXF0jVTWF2woqFUmuYETaGdWUKEg0PwrqQjDlR7OhHgmvoqoJ4jmU5TXl cEUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=rseUd9y/GnXjRY8PsudxS8BEzI5o7BH/gE6GzGNAkz0=; b=pjqaZ1YbuWza1ydC06DLjspt3tHKNKK3awmgJoEAswaAsalbWPRdKB9XOwb94EA9iT WZJqpbdrLXDuHOzS08KAQF0LIlEATjnHiN4haAVmbLvHCgadx8MA0WRTeZ7kCak6AQUZ kyfIYZl18g2zj9gsgAVPhBbCDx6hB0L8O1llJzNYYkyMWf6/dLpmfzu+gQ+nOXqfqhWW npIR03/gGBxpXMmhl95KDhnrcHZDxNmMqrUDoE4SAvkAFazQPL9Csn1YDZMpiAKUhN5G FmI6r54rdIcmViFb96D2ARnZn80svdjjEVP6mq+zAFFXJBZeVMHwmwj5KVhUjJaAl1kO Y99w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p+c78cGO; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1si3274823pgd.443.2019.08.29.17.51.09; Thu, 29 Aug 2019 17:51:10 -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=@linaro.org header.s=google header.b=p+c78cGO; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727866AbfH3AvI (ORCPT + 28 others); Thu, 29 Aug 2019 20:51:08 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:38137 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727883AbfH3Auz (ORCPT ); Thu, 29 Aug 2019 20:50:55 -0400 Received: by mail-lf1-f67.google.com with SMTP id c12so3976329lfh.5 for ; Thu, 29 Aug 2019 17:50:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rseUd9y/GnXjRY8PsudxS8BEzI5o7BH/gE6GzGNAkz0=; b=p+c78cGOyUo6huk/pdHK4LHWxY05E5DmCBl6Y9TnX0wvtYNQzK7/aTvz75AqmlPGvA lX3zJWWhAuFN7kMzRbIe4MIRTgqe2XNObWdcxwvAYdo9v+NHqraV4ztUXFoSctAfudEb 6iWjcDghz5Lkpmgx4rrpBe3K+94vUyybq7SVTJP0KvecAGtDjApjNEeFXlxu6wHYQ2nG Aia65Ra96zxOxrfifKlzHZK+MklKrHz3P1CXW6V1T+wu0gkWFEF3j5zl9WfXVvgh/7Iz tX+fup/gKLffQChanaOEXwwKRLJP/Zl4iC0qpnp9r8NCvX0yAmZFBiQuq5bIQpJinAgf 23aA== 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:in-reply-to :references; bh=rseUd9y/GnXjRY8PsudxS8BEzI5o7BH/gE6GzGNAkz0=; b=BNoyDJvlAgc74Exz6ywK/h8/6auM3ERw1Lliis7oJG2T05AIo1984XS+hka0PuJk08 sGUZXC91Qr17Guk/wicaxbz8LMIztmCOGTbrwscm5hnvKh4tAPkOjJ5GAqopOWUF8oe2 xf5n+o+9+c8cvEsRI9PeF1A5eHjEAC+mAECGEJi8BSdGHrCgwNWgBPm1dHtW7gy9EQ3j 3TZJtO16bsWCmF0HfniK3gcOx4c1hNnLTHRkB4YVL7dckbik3QJaUHkrDYmJW/Qag25v jtHAz6HXtossTMVxNFitt5foYwP/T3XXTuoTpDl1NXOm+WYvUEpeLWhTPnUrxnCa36EF dwlQ== X-Gm-Message-State: APjAAAWcXZvqhZvCh8PauTMicOrGAWZm3C1KK5lphk2V8ii6Khk9OELQ CNAl3ZygVByqndp08wSmrscxHw== X-Received: by 2002:a19:e04f:: with SMTP id g15mr7384740lfj.46.1567126253185; Thu, 29 Aug 2019 17:50:53 -0700 (PDT) Received: from localhost.localdomain (168-200-94-178.pool.ukrtel.net. [178.94.200.168]) by smtp.gmail.com with ESMTPSA id f19sm628149lfk.43.2019.08.29.17.50.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2019 17:50:52 -0700 (PDT) From: Ivan Khoronzhuk To: linux@armlinux.org.uk, ast@kernel.org, daniel@iogearbox.net, yhs@fb.com, davem@davemloft.net, jakub.kicinski@netronome.com, hawk@kernel.org, john.fastabend@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, clang-built-linux@googlegroups.com, Ivan Khoronzhuk Subject: [PATCH RFC bpf-next 09/10] arm: include: asm: swab: mask rev16 instruction for clang Date: Fri, 30 Aug 2019 03:50:36 +0300 Message-Id: <20190830005037.24004-10-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190830005037.24004-1-ivan.khoronzhuk@linaro.org> References: <20190830005037.24004-1-ivan.khoronzhuk@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(+) -- 2.17.1 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) {