Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1431535pxf; Fri, 26 Mar 2021 07:43:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymiyQMNsz9XapSZ9XlysoZNT+9/fXiStMwVt2gfN0V9xQt6SLMrZZrARMlJ7b+1nB+kTYC X-Received: by 2002:a05:6402:1115:: with SMTP id u21mr15375666edv.383.1616769824247; Fri, 26 Mar 2021 07:43:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616769824; cv=none; d=google.com; s=arc-20160816; b=LOxg6QVmcAVHb7JxK4CLFNvIS5qH5Lha++oX3EEMorscRA7lGvWUBRJOqTg1+zstLk tYvxtZ15HShCJC3uohnSoN295FMn4rersNnWJUOScBYSufbMIFA7Yn2QIPJNuUD5HEWe bDfuqsJ3LKsAe6CL0vRGYeQBqzMfdosTJDW3bLjCOxeC1ajsWncyG6EFjr6IiaYABrbD +eSvjG72ACLiJYDCrezBr0CsqNOW8FPZjKtJMiSSyxrP8b/fKSzuvcT8qMg9wdlc69S2 Kq+j+rSTv+55nWeY/qGasZtg8ISOFBWfv1b8z1fCxDVtkwDDOqO9mgLBJb4so3bPVOsw frkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=3hl9LjMjlSaYRTBMxtyoa0r2T4OowqUd76ikmJwOIVI=; b=UMkYctbrHcg4XgO9CkJQDt3iXLClXrUhK1MJFUE8A/SMLsdufE4hMYgTxn7Wd6LTb2 EFfvYiPAJ/4opnN9d5+m6i8mLncnztN/uzB2QBS6ghaBXBYydIzv1DepSaKE26BQ/28r 26Cr/8ikxSLSEBs5OxN+BvXBJuPMZUfF53uSJSRfjCNKheJyXXuK2IzRbGbq8oQoItYQ /dqWrQsrTiuL4lKkL5K9Sq6K7XTt0CPOs2mk7K8k3XIqhiByuBSPONLoW/yhbWCwOeYZ P8gh7rOc1P/RUAvU18StVpUm3tjUC/M+lUyL+mTYteznHnvNMHdwnvvT7kwYsE8HyznQ 03qQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y23si6950882eds.278.2021.03.26.07.43.22; Fri, 26 Mar 2021 07:43:44 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230108AbhCZOmR (ORCPT + 99 others); Fri, 26 Mar 2021 10:42:17 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:30047 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230230AbhCZOmG (ORCPT ); Fri, 26 Mar 2021 10:42:06 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4F6PnR4Ky0z9v0Nc; Fri, 26 Mar 2021 15:42:03 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id CVOEt96TWs_n; Fri, 26 Mar 2021 15:42:03 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4F6PnR3NyVz9v0NB; Fri, 26 Mar 2021 15:42:03 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 3E5CD8B8D9; Fri, 26 Mar 2021 15:42:05 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id PwkSzDQZPpbn; Fri, 26 Mar 2021 15:42:05 +0100 (CET) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 25D228B8D7; Fri, 26 Mar 2021 15:42:04 +0100 (CET) Subject: Re: [PATCH v2 0/8] Implement EBPF on powerpc32 To: Andrii Nakryiko Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin Lau , Song Liu , Yonghong Song , john fastabend , KP Singh , naveen.n.rao@linux.ibm.com, sandipan@linux.ibm.com, open list , linuxppc-dev@lists.ozlabs.org, Networking , bpf References: From: Christophe Leroy Message-ID: <86028d25-c3fe-3765-f7c3-12448523405a@csgroup.eu> Date: Fri, 26 Mar 2021 15:41:59 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 22/03/2021 à 18:53, Andrii Nakryiko a écrit : > On Mon, Mar 22, 2021 at 9:37 AM Christophe Leroy > wrote: >> >> This series implements extended BPF on powerpc32. For the implementation >> details, see the patch before the last. >> >> The following operations are not implemented: >> >> case BPF_ALU64 | BPF_DIV | BPF_X: /* dst /= src */ >> case BPF_ALU64 | BPF_MOD | BPF_X: /* dst %= src */ >> case BPF_STX | BPF_XADD | BPF_DW: /* *(u64 *)(dst + off) += src */ >> >> The following operations are only implemented for power of two constants: >> >> case BPF_ALU64 | BPF_MOD | BPF_K: /* dst %= imm */ >> case BPF_ALU64 | BPF_DIV | BPF_K: /* dst /= imm */ >> >> Below are the results on a powerpc 885: >> - with the patch, with and without bpf_jit_enable >> - without the patch, with bpf_jit_enable (ie with CBPF) >> >> With the patch, with bpf_jit_enable = 1 : >> >> [ 60.826529] test_bpf: Summary: 378 PASSED, 0 FAILED, [354/366 JIT'ed] >> [ 60.832505] test_bpf: test_skb_segment: Summary: 2 PASSED, 0 FAILED >> >> With the patch, with bpf_jit_enable = 0 : >> >> [ 75.186337] test_bpf: Summary: 378 PASSED, 0 FAILED, [0/366 JIT'ed] >> [ 75.192325] test_bpf: test_skb_segment: Summary: 2 PASSED, 0 FAILED >> >> Without the patch, with bpf_jit_enable = 1 : >> >> [ 186.112429] test_bpf: Summary: 371 PASSED, 7 FAILED, [119/366 JIT'ed] >> >> Couldn't run test_progs because it doesn't build (clang 11 crashes during the build). > > Can you please try checking out the latest clang from sources and use > that one instead? The crash is fixed, it builds one step more, then fails at: [root@PC-server-ldb bpf]# make CROSS_COMPILE=ppc-linux- ARCH=powerpc V=1 /root/gen_ldb/linux-powerpc/tools/testing/selftests/bpf/host-tools/sbin/bpftool gen skeleton /root/gen_ldb/linux-powerpc/tools/testing/selftests/bpf/atomic_bounds.o > /root/gen_ldb/linux-powerpc/tools/testing/selftests/bpf/atomic_bounds.skel.h libbpf: elf: endianness mismatch in atomic_bounds. Error: failed to open BPF object file: Endian mismatch I'm cross-building on x86 for powerpc/32 [root@PC-server-ldb bpf]# file atomic_bounds.o atomic_bounds.o: ELF 64-bit MSB relocatable, eBPF, version 1 (SYSV), with debug_info, not stripped Christophe