Received: by 10.192.165.148 with SMTP id m20csp1415463imm; Wed, 25 Apr 2018 18:44:55 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/CdyBPzagYLpjbUy9w/F/s7AtctebHHHkTZGRyrqJ5zcukYIox2XMT1NhftBjdUzXMwdDI X-Received: by 10.99.154.9 with SMTP id o9mr25839790pge.130.1524707094969; Wed, 25 Apr 2018 18:44:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524707094; cv=none; d=google.com; s=arc-20160816; b=clXR3Q3XkQFwea40pO72NxBbYY5DxfL0B/1U2pRJCIGuTFIi7Bi8rmckQirMWe4Tle 4DeSu4pQnKtN3cV7hXB2k0OAnT2ec+OGlAxLCGnCWuD6APPgAsaFLOvkeXIEesW8vsek tWEOu7Q576VwetRWW+hA8i1YKb9Af6weKZTIwTQJ5PYQ3PLB9bRhDJ11y3BmRPIxmn3K EP0k+VSCF+Xk3DQYXZumtAYHTZTqLEnBFsO1Ez9IoYrCJNhqVj+elxOoq3LFwzRd4uhh V0Zityc6BjX1mHAAC0IoGq6S6ZmlCprqIaPyz1dzdoAsV5B5m+WTd+uJdoTn/RyR5IwI KvMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=mCbHzEQPuUS4hTtE49Bx66OaRvxLzSBlMNwn9Zp3PGc=; b=PfznGwYN9cNsgXzyTxsO6v5eWGh3kSefbAmyS8VziRkl0OPoyiiUbQoAJL9pPMJlbU gdB1JbU7PLMBboc6+TVHl4LWOzZr4b41i+Mlv1fpXCCUgn/1CKelgaT3Abwf/7DVq4Oc BqGG/cefV7hqAmpG+eov6fD6P5DUF3cNs0bDCi0cQQzRwuFjgqGtPwhVp2uSqDTtFMlq lK+EvYouB6CAJjHxNJZoJ+ShFDpA4Pm7FDMdO2MdeA+RKw4rNkTdL06ZaokbhSIo4thU lCQE5umCqpuORtDuukBGwwGuMFE0h9ZP28Q00Gzr44HJkK5uRhocjKNc6XAqS67kEgAm gxcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=k+3iub62; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id f96-v6si17756571plb.418.2018.04.25.18.44.40; Wed, 25 Apr 2018 18:44:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=k+3iub62; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1753505AbeDZBnT (ORCPT + 99 others); Wed, 25 Apr 2018 21:43:19 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:45147 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752105AbeDZBnP (ORCPT ); Wed, 25 Apr 2018 21:43:15 -0400 Received: by mail-pf0-f193.google.com with SMTP id l27so16816084pfk.12; Wed, 25 Apr 2018 18:43:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=mCbHzEQPuUS4hTtE49Bx66OaRvxLzSBlMNwn9Zp3PGc=; b=k+3iub62trK25HHGLVq3GdoZdNTZ7Wwux6vnYnhFt5ZjtMKL1xVlOqihFx266wKVHs wAdnTeDSQpjrp/7YLS+QI9fCzzRk8hoFivpG8ocEwamoeKLsMSJ0sf/i5leUq3NHdubw /VBfpon0krN08B0UfkYZSwgD2RqVEMwxJqjexa8Rv5cIggv719hjKEskurkn+ZQ+cZ18 wnZ5YjlzCI1dQC4S450/1yT+v1arjmwb8zfEhphF1gTOMcgZbtjRR6oQDaDE8Gl7qkhq n3mDhnA8hqX8LbAXC8hoIkO5BP6VGvBhG3YuqkRK7WOMSG7fF3byi0QiemDSy6mIyBSU wLvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=mCbHzEQPuUS4hTtE49Bx66OaRvxLzSBlMNwn9Zp3PGc=; b=jvGPB2fqBR9qGrUH9/nu0tt5YXyMZiTuiMBQ6oPtXbHWFO6sRrHId3nvtto7aQQaUM iLoGGtknkQalt+zekTYsLOP+qbvYyLFEXC5qoCiP7NoRSuGlydo6S63NFl/OFB+lgmEZ GUJrOeQs+Wk3zCi3XeW9VOP7GQkd238RTszoKkgDjkZKgGrSGV/D0n+mWwJ8lhFjo+EE dcJIoCHGDgKHZv3HRznz09F7igLNRghBcRJoCVXe1eI1N2SEeCDl3/XPjZ+hXgdfKMcj bce1G+EGrRa1203ffsYiZPMwY1kkCOG3Ro/fQhvpev6HxNGNoZgkGHij0QIRh7usDTV4 yESg== X-Gm-Message-State: ALQs6tC7+V+8wRDAtYXl++5ReLLotVEFoUhHLqWlA7Az/itEUNcjg6rg RlkpJqNj8nnl6YgtPkocqww= X-Received: by 2002:a17:902:d808:: with SMTP id a8-v6mr1069387plz.177.1524706994709; Wed, 25 Apr 2018 18:43:14 -0700 (PDT) Received: from udknight.localhost ([183.90.36.235]) by smtp.gmail.com with ESMTPSA id m185sm39786809pfc.88.2018.04.25.18.43.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Apr 2018 18:43:13 -0700 (PDT) Received: from udknight.localhost (localhost [127.0.0.1]) by udknight.localhost (8.14.9/8.14.9) with ESMTP id w3Q1hHXc007633; Thu, 26 Apr 2018 09:43:17 +0800 Received: (from root@localhost) by udknight.localhost (8.14.9/8.14.9/Submit) id w3Q1hDa0007630; Thu, 26 Apr 2018 09:43:13 +0800 Date: Thu, 26 Apr 2018 09:43:13 +0800 From: Wang YanQing To: Daniel Borkmann Cc: ast@kernel.org, illusionist.neo@gmail.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, davem@davemloft.net, x86@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] bpf, x86_32: add eBPF JIT compiler for ia32 Message-ID: <20180426014313.GA23526@udknight> Mail-Followup-To: Wang YanQing , Daniel Borkmann , ast@kernel.org, illusionist.neo@gmail.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, davem@davemloft.net, x86@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180419155420.GA5468@udknight> <20e1eabd-e821-8240-cb4c-6da253c49585@iogearbox.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20e1eabd-e821-8240-cb4c-6da253c49585@iogearbox.net> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 25, 2018 at 02:11:16AM +0200, Daniel Borkmann wrote: > On 04/19/2018 05:54 PM, Wang YanQing wrote: > > Testing results on i5-5200U: > > > > 1) test_bpf: Summary: 349 PASSED, 0 FAILED, [319/341 JIT'ed] > > 2) test_progs: Summary: 81 PASSED, 2 FAILED. > > test_progs report "libbpf: incorrect bpf_call opcode" for > > test_l4lb_noinline and test_xdp_noinline, because there is > > no llvm-6.0 on my machine, and current implementation doesn't > > support BPF_PSEUDO_CALL, so I think we can ignore the two failed > > testcases. > > 3) test_lpm: OK > > 4) test_lru_map: OK > > 5) test_verifier: Summary: 823 PASSED, 5 FAILED > > test_verifier report "invalid bpf_context access off=68 size=1/2/4/8" > > for all the 5 FAILED testcases with/without jit, we need to fix the > > failed testcases themself instead of this jit. > > Can you elaborate further on these? Looks like this definitely needs > fixing on 32 bit. Would be great to get a better understanding of the > underlying bug(s) and properly fix them. > Hi Daniel Borkmann, here is the detailed log for failed testcases. linux: Gentoo 32 bit llvm: ~ # llc --version LLVM (http://llvm.org/): LLVM version 4.0.1 Optimized build. Default target: i686-pc-linux-gnu Host CPU: broadwell Registered Targets: amdgcn - AMD GCN GPUs bpf - BPF (host endian) bpfeb - BPF (big endian) bpfel - BPF (little endian) nvptx - NVIDIA PTX 32-bit nvptx64 - NVIDIA PTX 64-bit r600 - AMD GPUs HD2XXX-HD6XXX x86 - 32-bit X86: Pentium-Pro and above x86-64 - 64-bit X86: EM64T and AMD64 ~ # clang --version clang version 4.0.1 (tags/RELEASE_401/final) Target: i686-pc-linux-gnu Thread model: posix InstalledDir: /usr/lib/llvm/4/bin kernel version:4.16.2 test program:test_verifier in kselftest condition:bpf_jit_enable=0,bpf_jit_harden=0 log: #172/p unpriv: spill/fill of different pointers ldx FAIL Unexpected error message! 0: (bf) r6 = r10 1: (07) r6 += -8 2: (15) if r1 == 0x0 goto pc+3 R1=ctx(id=0,off=0,imm=0) R6=fp-8,call_-1 R10=fp0,call_-1 3: (bf) r2 = r10 4: (07) r2 += -76 5: (7b) *(u64 *)(r6 +0) = r2 6: (55) if r1 != 0x0 goto pc+1 R1=ctx(id=0,off=0,imm=0) R2=fp-76,call_-1 R6=fp-8,call_-1 R10=fp0,call_-1 fp-8=fp 7: (7b) *(u64 *)(r6 +0) = r1 8: (79) r1 = *(u64 *)(r6 +0) 9: (79) r1 = *(u64 *)(r1 +68) invalid bpf_context access off=68 size=8 #378/p check bpf_perf_event_data->sample_period byte load permitted FAIL Failed to load prog 'Permission denied'! 0: (b7) r0 = 0 1: (71) r0 = *(u8 *)(r1 +68) invalid bpf_context access off=68 size=1 #379/p check bpf_perf_event_data->sample_period half load permitted FAIL Failed to load prog 'Permission denied'! 0: (b7) r0 = 0 1: (69) r0 = *(u16 *)(r1 +68) invalid bpf_context access off=68 size=2 #380/p check bpf_perf_event_data->sample_period word load permitted FAIL Failed to load prog 'Permission denied'! 0: (b7) r0 = 0 1: (61) r0 = *(u32 *)(r1 +68) invalid bpf_context access off=68 size=4 #381/p check bpf_perf_event_data->sample_period dword load permitted FAIL Failed to load prog 'Permission denied'! 0: (b7) r0 = 0 1: (79) r0 = *(u64 *)(r1 +68) invalid bpf_context access off=68 size=8 test program:test_progs condition:bpf_jit_enable=0,bpf_jit_harden=0 bpf # ./test_progs test_pkt_access:PASS:ipv4 53 nsec test_pkt_access:PASS:ipv6 47 nsec test_xdp:PASS:ipv4 1281 nsec test_xdp:PASS:ipv6 749 nsec test_l4lb:PASS:ipv4 427 nsec test_l4lb:PASS:ipv6 562 nsec libbpf: incorrect bpf_call opcode <= caused by ./test_l4lb_noinline.o in function test_l4lb_all libbpf: incorrect bpf_call opcode <= caused by ././test_xdp_noinline.o in function test_xdp_noinline Thanks.