Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4587320pxv; Tue, 27 Jul 2021 10:55:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4T7q7wM17P/Yu6/okMJ7zsGo0CbbXOIucpPZ7EIBQpOfg2UrJ0235vvUxujhVwss4WOlR X-Received: by 2002:a17:906:1703:: with SMTP id c3mr23080644eje.64.1627408551125; Tue, 27 Jul 2021 10:55:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627408551; cv=none; d=google.com; s=arc-20160816; b=A5BlcBxxnuP8l83xq+AdeuuBNNeqSdCezy6pARptszo4ec1XvqjM2Izc5vdG1cHWp3 QX1XSHcl2Q0zlpuUBP1dfIOrN/biiMHGoRxba9PWgXT/D8AADLmKc9CwaudoRCmP/jbs zSdTpio7cp/bhw7uQ5zNyVk0gjuooYKdNcHMqCyecKkCu4QAeAoJNO1eLUoaGoopP+Qg 6pFcRqJGcTxiU1Ud9Vf9+GDNKB/bblKfBFaEswHJw+K7fiKe2e3zjRIjNl3eUWKpTc8U Ul2jICh7thl9gUBUiwzc/cWrJZaC5HghpOokhbiCbmpJghyJPbDCutMu5Tcm/rA6gamF O9PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Awr/4hVZSQpR09EKl8Cxh+0W9sPXqPB7mEdVNsZFybE=; b=zNZJfY0k7cILg+USruCVKgPrj5ABa6TudUjt9qCBO1JO3/57cUteWBSQIDR6pzalES iCA0wXcm87//hQKHJ0LtflS+8DfpfBd0jHj3h8RBEKFMsWBTPLFfCGj3zJnhWVQDMyaZ Afj940clIsGAWucK6i7C+zYWddAI/Vd5xcTol8kNA7372ON9laNGYQIdyYlmtbV0TSDc 6s+Lrl+yAYAgDM9z8NyTBUm8z5+Ekz4cUaJjzGIXoYar982VEMszErtFFeprx9wkz3p7 ODfpN2ik/kfgxOkOtZu3LuG23779eMELONrL6lhxIcu6787A27yUC4TRqSG3SPPSwMIk EbvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="V2PLR/CA"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f27si4288492ejf.63.2021.07.27.10.55.04; Tue, 27 Jul 2021 10:55:51 -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=@google.com header.s=20161025 header.b="V2PLR/CA"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229759AbhG0Rxf (ORCPT + 99 others); Tue, 27 Jul 2021 13:53:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbhG0Rxd (ORCPT ); Tue, 27 Jul 2021 13:53:33 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D8B6C061764 for ; Tue, 27 Jul 2021 10:53:33 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id y34so23133305lfa.8 for ; Tue, 27 Jul 2021 10:53:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Awr/4hVZSQpR09EKl8Cxh+0W9sPXqPB7mEdVNsZFybE=; b=V2PLR/CAJgIlsjKRoDW/LGwfrR93pYMWyDC98nZxzvVcnvPhmyIvZh1T0TZHwr9S6y A3/vJNoA/t86Rs+UHOC8QW2Nm6cZlqn2v94Hy840MI10ZTYaDTAsOitPtTlt7OvNH7Gj Ch67d9S9LaWY1UVfcAZZOr+USn7gpKICbuApTOylauPXABmOcyuIyaSSu5BSDBDp8GKA +BQxuxVlcslOlOLYeWCmn3eBO9kv8kLUDt0HcKDXyLtqUs3p4wT5lHY6VltGfTJ6E/hV OTmY690ZkbGm/fuzHcIKm0PVs4+oM12SYG0hj7frRKkcxkDvhLcBmWp32Drs/d5rPJAu mM3Q== 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=Awr/4hVZSQpR09EKl8Cxh+0W9sPXqPB7mEdVNsZFybE=; b=YRHDmek0mQ3QA0+kbcCVZnt6pdLTD/oTGbuJUf9RSskOaihi1U7kUU0CX6V4VDTIyR qWgr+MoCBa2VYE9fktqE98ye6WFoyGLF3ey/bKC9RZezgB5S6v5g5qK46R6kxMEzfEGx ZwL0xYPZPDx4co1D9X9Ui6dozIYtoS6MEO/G+LyRjpuwoDgSeR7eMMIU/w8J8kMTOYCP 7nJaiK9GevHeSXeOjdlUyCKmsm3fO7Lvg7iEnS9cCOUu04MzxyJ/CXhrjYfeqABnsWX4 d5u51ywU2YzsxSEhPJSMS1CcC0ZV93wz2oVhM9v4hmcNbwkUAB5rOLqMwTGhULiE+4Od mUaA== X-Gm-Message-State: AOAM530BLbJpgxMXtYtSHuVR/IiSjODSIkweXLYwJWUbtQRzgATUiSnN 6o9ZHkov4JfxSI6110DWHHSDtHcd1nNwrBbOYm6+qA== X-Received: by 2002:ac2:596a:: with SMTP id h10mr10205722lfp.374.1627408411608; Tue, 27 Jul 2021 10:53:31 -0700 (PDT) MIME-Version: 1.0 References: <20210727141119.19812-1-pavo.banicevic@sartura.hr> <20210727141119.19812-2-pavo.banicevic@sartura.hr> In-Reply-To: <20210727141119.19812-2-pavo.banicevic@sartura.hr> From: Nick Desaulniers Date: Tue, 27 Jul 2021 10:53:20 -0700 Message-ID: Subject: Re: [PATCH 1/3] arm: include: asm: swab: mask rev16 instruction for clang To: Pavo Banicevic , Arnd Bergmann Cc: 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, 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 27, 2021 at 7:12 AM Pavo Banicevic wrote: > > 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. NACK The way to fix these is to sort out the header includes, not turning off arbitrary things that are used by the actual kernel build for 32b ARM. > > 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 > -- Thanks, ~Nick Desaulniers