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=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 25D0EC4320A for ; Tue, 27 Jul 2021 14:12:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0EC0961AA5 for ; Tue, 27 Jul 2021 14:12:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236852AbhG0OMq (ORCPT ); Tue, 27 Jul 2021 10:12:46 -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-Google-Smtp-Source: ABdhPJwxw8NT0xdiy200Yml8rZafYGmbp6+07m5Rczyx8Rmsxg2J5fenyyka4XSwb6wfG6tz1ibW8g== 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 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=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 AA57EC4338F for ; Tue, 27 Jul 2021 14:14:53 +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 76FDF61AA5 for ; Tue, 27 Jul 2021 14:14:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 76FDF61AA5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sartura.hr 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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UiZrogp8dM/UuN7B7IbF5QxeRkj31sHPrLKAyruaP8M=; b=f+EdWlB33a+WSX BZSHnwDvDMM3ULvMumju6p6vWZryPlB5J0ryvGv/ntZMXyLzl40PLjHwXd4p2bCGdIQ9m5SoxQKpq DjIXtJJXti4QTWdxCsnq9J3kroMDyyg4Xxdur3phSss7qrUG60K3Mi/e+oJzfDP89oSYgE+aV3IcC Mn7nyV5A0gXr84rovuRUtEd3taX3OCEGk3EbXoPdJuN9m7GWuVjWJCPL/rsJOE3QOh1NYRqFr/5z5 OSkMsVhqjanTcwL95QRe1NbfkyG95u9DLQ1CLiVOpZQ2a01BqBC2kcUk61lpdoD8eoBWLcF4ZEimg WoIIs+8yMI9CY3f7yWDw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8NpD-00F1i3-Nh; Tue, 27 Jul 2021 14:12:51 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8Np6-00F1cz-CJ for linux-arm-kernel@lists.infradead.org; Tue, 27 Jul 2021 14:12:45 +0000 Received: by mail-wm1-x333.google.com with SMTP id o5-20020a1c4d050000b02901fc3a62af78so1976296wmh.3 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=BfVHi7uWx3FQQg03H0KDvv8kwgmvEgKkMOX2F1yOxZis1FyXUItuNOMK2X52wc1i/u pL4H+L2/4bIpcEpTf/05w/5idvPJYPSDT+sGp/GWta9OJJ6gytqIumEpzDoxYX4AEcoe O5QtrBt0iQ4VbnX5fBNtGlbBsqmNUajZmpnqSz+yFxuh19jyHwtTgInJA+I1STA64GSc biVFKL+BU24B8akvlXvFSSMK8q8oVuaACbiqhLd1ohy1Q+UZhnAAFT3tZ3CCbNANPQ1W d4FkAWgs7bRXBQfYa6fZAHWdp5qgoBXBCaBnXU6ysejblQGfVYV1ogAKLVMHylPEh+KF k7QA== X-Gm-Message-State: AOAM5307CDs9RjMmH9yTZqy1eCx3qUa7vwvGU3wLuy0Lw9B94x2FxZo5 nZbz/oRnCNLhXBjS50mNrk9eAA== X-Google-Smtp-Source: ABdhPJwxw8NT0xdiy200Yml8rZafYGmbp6+07m5Rczyx8Rmsxg2J5fenyyka4XSwb6wfG6tz1ibW8g== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210727_071244_487693_8EF434BF X-CRM114-Status: GOOD ( 12.08 ) 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 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel