Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4719935pxv; Tue, 27 Jul 2021 14:46:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhiDvrWKJ6BRipJoORWZu8nGr3wZoJSloomDqScq+KekBJv6t3iqibjvqu8lgiPoKQDSDE X-Received: by 2002:a05:6e02:14cc:: with SMTP id o12mr11008023ilk.76.1627422380058; Tue, 27 Jul 2021 14:46:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627422380; cv=none; d=google.com; s=arc-20160816; b=QPmttjHydbuzPIlQRi1UZMimaF2H4j2WEi5iDzKAAQ4m7KSX2AnEt1lWZS35PJH+RK r2q4i19ZRbDntmq0Lphbj41CKa8j3XFZFl25qOYI5ZQkJ+/375FRiYgKdsJYqoUyVMdS 2edi4rIAq7TsyuppeaJor1yJ/nTwpTQQ9Cph0gHwL3/Ut7VTvVH3cc9OTSbyhjTMkPnK wZ7hgwmjZmvsCgd014WFoEWriYFPZ+fIMDah2529t4ncf2/LluZyAimG/mpTn3G6yyEz F/bc7/NSdwdAsYCR1jPh9dDKjHeyDadDolG9cGAhPm+bWhVybQ/mjC7oQXukAlXOTX3Q eREw== 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=6u6wypJQeJmb/YfTyzmyqM0UJtBE0z6heRiSyMm9WoU=; b=oqO28S/C7F+CQuBAJm76u9F5BJZEEg+Gl9MgcqZOrvFbJ4sPmbn2mpTUwH+H7DwXHS Tnmvbk4ilCoTSYOsu+RHiqtJS12Ug4aaxDKTsx5eoNydyYkY9V9nDatHOYAbz4SnHaaa fAQ0EqF8G17RhCYLGHVfxKeJXp2HGZ2fMPV3oWxpZrDbzuzgWTO1n91ugfSe6f/hrZma uZTgUwwhDH0021o/TUcyamsbT/lXau1hve83a7TpoAo9lx28bDqRZnaqX5MN9ROiQbY6 lNeMJaBDQXGd7kGhrJM4/wKTUoockPIn+nh15WsiZRYXH+rNfT4WbKJ3uxg+Sd4Fb0At 3Ldw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZwLmxb1T; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y17si6097191iov.62.2021.07.27.14.46.08; Tue, 27 Jul 2021 14:46:20 -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=@gmail.com header.s=20161025 header.b=ZwLmxb1T; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232088AbhG0Vnx (ORCPT + 99 others); Tue, 27 Jul 2021 17:43:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231445AbhG0Vnw (ORCPT ); Tue, 27 Jul 2021 17:43:52 -0400 Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65F2DC061757; Tue, 27 Jul 2021 14:43:51 -0700 (PDT) Received: by mail-yb1-xb2e.google.com with SMTP id k65so372447yba.13; 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=LM2m3zSBD9SMeY2IGMeapGx2RY+eAYw7JniIflNFA+BhloYPEaZXrtQXDOCSARviid y9HOOOYWn/wBUkMm2418fmxF8vSaNGYn/Hv4bzfKIB0Tat1I5Tpb+OtZzLHpXTRTMNfm 5R7aCYzHq0V2oUAQeaqKHe+S3Ymj8sw+4b7u+IXJwYhnOs9IesTPpOxK4tEIzyCeisZ6 bPbkqzaaBRBVPnbWBiI7t1NactpHh6qoQRHBxEasOwsFizHhiXvKgFR5DSnwJhpzSeJ+ f+LRQkwDJiNJCm0eUnMB3vmWJqxuPTz+BhxKKbK9I6gJWte28JluUd7/Gw5CBgfxiYme MXhQ== X-Gm-Message-State: AOAM532hMqMiNhPUjksmsIsZW6lk1eYsivBDsYyyEAGJe9VTmBXLnZf1 FJ42p7mLY4qdFogPrknPKYYdbqv6mVfahqD7eh8= 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 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 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