From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 257D4C4338F for ; Tue, 27 Jul 2021 21:46:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CDEFC60238 for ; Tue, 27 Jul 2021 21:46:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CDEFC60238 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kLrdYUkL8PqQyz60XwlRE22Wgj5eqZ/jcy2JnkAoneo=; b=cIKzAN3RBLQDXK 0gxNHCYh4UdpLWjLfvIWGJOonRwy4L+vJeiwEbernuSUW1QaN/SSQghe7dvs2ESRARRTKUc2P/XSU cQFYZBHJvykZFqzPZre1ZiaGyI7Zynh7zF9n7C07PgZVd6sdrhRR0W6q041BSQ7xnISh0wMz9RbSc AX8emSHsIIzJaRrPP7G1sg973zq1uCJpiN7qgMXnSd2moq5QdsC5GKsJCUIeKqhHyuNVuQvD4tNw1 csuiZFUg6m4dlcahQSA/iZ3Ug5644YDZZpGjcNqlQiTd4nDasoc2elSZTxyjLqMiFqfaQ/PBLgZYf TFp2QGtmIW8c1A81eLhg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8Urj-00GRgk-35; Tue, 27 Jul 2021 21:43:55 +0000 Received: from mail-yb1-xb2e.google.com ([2607:f8b0:4864:20::b2e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8Urf-00GRgH-G9 for linux-arm-kernel@lists.infradead.org; Tue, 27 Jul 2021 21:43:53 +0000 Received: by mail-yb1-xb2e.google.com with SMTP id s19so432707ybc.6 for ; Tue, 27 Jul 2021 14:43:51 -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=6u6wypJQeJmb/YfTyzmyqM0UJtBE0z6heRiSyMm9WoU=; b=ZwLmxb1TgizpkLWoUujWJlH4yHyMAxPpF7B1gyLjsnAFVyvUuGAl/582R6EQnGqPOQ VJYtZ96O+yh4aOftf1fjI0N6eZvizFHokQl/4bkWhB+9rqRhsyGGmpv9G+814ldsINAj pyThT4+/GMqmDiOvzi4dFzQIx4EgR8ivUE3Mslc/vublLkMoY06AzGHLtFtp+OpfHEdj oVCENJjFGcvOyn5yhHLqjMZF/Ki76bjYjNuy2tR7d871OX0zrCuRjGdkzoTxOUV5fnPa +yTGMKCUtkW7tMrZqa5fM9Hxv267csgf/A1SsTF7O/y+Y4YEnKBOBy2fMZcrqzjybtbn QKAw== 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=6u6wypJQeJmb/YfTyzmyqM0UJtBE0z6heRiSyMm9WoU=; b=WKfgPIDtwMQr4tLepPJbG4HwEjXNcixq7H/EDPrX/zazpZ6y9BtuIQvdCSeVh1BKLM R8U+6LlHW5SY6SOBvt/VyPYJdIAt5jo4uu+Eypu+foj6pdFnYRFsZIR9sX2iQqyjJlBh M6zOaKglTycuVdBDP9GMWnANttQ1cfi8XX10o/RrjnFaa0PCqera98rTON7eozvmNiUV 6lzN4AV/HVGIdVh4KokigG1Tnj54318+7RlgL452WrppyUI6w3o1FBfp+dOvODAIBEnN M+sGki6neEPBN0Q84SmsbDpmqIjRy1F7C1sS6LjQu2H5BRCxSzycF/Xzc7SJj6BtjBpq oFVA== X-Gm-Message-State: AOAM531g1/jl1JkVTdscUTzyvsPIrmvsKRUK5vLI5aLdOsPV8DKlL21s Jyq2ihChL2Ge/0QuPWHyEKvG/sdAfVunvTcnEhM= X-Google-Smtp-Source: ABdhPJz2rkdMm/N4pD3+cl4Wyi4GGBdI0Z2R9PTOr2miyLr3QrjV5+sF/QXS2PdyG9pr1d9ANZ+DmXR8OPMsHNQSAJs= X-Received: by 2002:a25:cdc7:: with SMTP id d190mr32876992ybf.425.1627422230617; Tue, 27 Jul 2021 14:43:50 -0700 (PDT) MIME-Version: 1.0 References: <20210727141119.19812-1-pavo.banicevic@sartura.hr> <20210727141119.19812-2-pavo.banicevic@sartura.hr> In-Reply-To: From: Andrii Nakryiko Date: Tue, 27 Jul 2021 14:43:39 -0700 Message-ID: Subject: Re: [PATCH 1/3] arm: include: asm: swab: mask rev16 instruction for clang To: Nick Desaulniers Cc: Pavo Banicevic , Arnd Bergmann , linux@armlinux.org.uk, Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin Lau , Song Liu , Yonghong Song , john fastabend , KP Singh , Nathan Chancellor , Ivan Khoronzhuk , linux-arm-kernel , open list , Networking , bpf , clang-built-linux , matt.redfearn@mips.com, Ingo Molnar , dvlasenk@redhat.com, Juraj Vijtiuk , robert.marko@sartura.hr, Luka Perkov , Jakov Petrina X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210727_144351_600362_6B29C0F9 X-CRM114-Status: GOOD ( 26.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jul 27, 2021 at 10:53 AM Nick Desaulniers wrote: > > 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. Would it be too horrible to just get rid of `clang -emit-llvm` and use vmlinux.h (we don't need to do CO-RE, btw, just generate vmlinux.h from the matching kernel)? Kumar has already started moving in that direction in his recent patch set ([0]). Would that get rid of all these issues? [0] https://patchwork.kernel.org/project/netdevbpf/list/?series=519281&state=* > > > > > 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel