From patchwork Fri May 13 06:37:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zi Shen Lim X-Patchwork-Id: 9088191 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 56A8CBF29F for ; Fri, 13 May 2016 06:39:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8488020204 for ; Fri, 13 May 2016 06:39:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B7D0D201D3 for ; Fri, 13 May 2016 06:39:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b16jx-0007x6-V3; Fri, 13 May 2016 06:38:25 +0000 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b16jw-0007vC-2G for linux-arm-kernel@lists.infradead.org; Fri, 13 May 2016 06:38:24 +0000 Received: by mail-pf0-x243.google.com with SMTP id y7so8585333pfb.0 for ; Thu, 12 May 2016 23:38:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=ZY2XxEW3ixlPUSfUjhm2BHKkZeLJ/sKVz6iqqMsnp80=; b=0jLlLtPM82PmhKyS67NngEn3Gp3PSW1XMIu6lO0bYMwjY5FQHOOHeJ05s611gZ/z3o CKX3/40+ju+9ropKy9SBu1atJOMtwciVbtsYal4NA3nA8jSl/dXeS/W5fvN8dDh8IHGM yxOSQQJGOGy/p5T35eoWIEAa9s+HfYQMHvqXCQslTrp9zZ823LVuksZbwHW/oMf34RIk 16N+W98NA0m/6bO78Ok9nW7tF0fUzMbmC5lo2/AuTYVLbmLOuL9M9eKry/7VWBV2sGu2 lWGxZqc3dGoGGbVh+FTRaIVBLAwFh6S2fVkMx+8JKSZBNZuImcY0rOEeDrkj93f4Nv7f fC+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ZY2XxEW3ixlPUSfUjhm2BHKkZeLJ/sKVz6iqqMsnp80=; b=G6jnc+03uV+S52/8nXWRmCLehz70UCXQUzQOOs9J/GPr8i7pITW+RlLik5sI2fnQ4U WCiCjB1neJrM3Q9QuaW5bQpms6VNhrdLAp/XV/rv+P58/fkP8UUcpv5qQp8ewDInet9W pog/dKIEdEnfy9WGL/sp970uahb1A73q+/NdGhpzryiSmW7X87u4in2SC4HIXGYN2n8I 11O7lJQ9PEk4Un5UqaENfCXup96j4M0ZO4vd+BQgPWhIYYmk4rBYecD9+i3u+kzT+FE+ 381B666RkwOy0V1ihm0WnGbMP6c/ojuNTqxIrjr5LVtuG3bOENZQ1MPfWziZhNS66RUs dIWg== X-Gm-Message-State: AOPr4FUHWcndZrIzj9k2hDisC4zzsiULdX09/mB6ju4zZAo43ylLsgjV0+sRBqZGhKeYdA== X-Received: by 10.98.69.213 with SMTP id n82mr20403177pfi.48.1463121483100; Thu, 12 May 2016 23:38:03 -0700 (PDT) Received: from localhost.localdomain (c-73-223-118-172.hsd1.ca.comcast.net. [73.223.118.172]) by smtp.gmail.com with ESMTPSA id 194sm24424424pfv.8.2016.05.12.23.38.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 May 2016 23:38:02 -0700 (PDT) From: Zi Shen Lim To: Alexei Starovoitov , "David S. Miller" , Will Deacon , Catalin Marinas Subject: [PATCH] arm64: bpf: jit JMP_JSET_{X,K} Date: Thu, 12 May 2016 23:37:58 -0700 Message-Id: <1463121478-18484-1-git-send-email-zlim.lnx@gmail.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160512_233824_153677_6731DD1D X-CRM114-Status: GOOD ( 11.62 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zi Shen Lim , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Daniel Borkmann , Yang Shi MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Original implementation commit e54bcde3d69d ("arm64: eBPF JIT compiler") had the relevant code paths, but due to an oversight always fail jiting. As a result, we had been falling back to BPF interpreter whenever a BPF program has JMP_JSET_{X,K} instructions. With this fix, we confirm that the corresponding tests in lib/test_bpf continue to pass, and also jited. ... [ 2.784553] test_bpf: #30 JSET jited:1 188 192 197 PASS [ 2.791373] test_bpf: #31 tcpdump port 22 jited:1 325 677 625 PASS [ 2.808800] test_bpf: #32 tcpdump complex jited:1 323 731 991 PASS ... [ 3.190759] test_bpf: #237 JMP_JSET_K: if (0x3 & 0x2) return 1 jited:1 110 PASS [ 3.192524] test_bpf: #238 JMP_JSET_K: if (0x3 & 0xffffffff) return 1 jited:1 98 PASS [ 3.211014] test_bpf: #249 JMP_JSET_X: if (0x3 & 0x2) return 1 jited:1 120 PASS [ 3.212973] test_bpf: #250 JMP_JSET_X: if (0x3 & 0xffffffff) return 1 jited:1 89 PASS ... Fixes: e54bcde3d69d ("arm64: eBPF JIT compiler") Signed-off-by: Zi Shen Lim Acked-by: Will Deacon Acked-by: Yang Shi --- arch/arm64/net/bpf_jit_comp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index 031ed08..d0d5190 100644 --- a/arch/arm64/net/bpf_jit_comp.c +++ b/arch/arm64/net/bpf_jit_comp.c @@ -478,6 +478,7 @@ emit_cond_jmp: case BPF_JGE: jmp_cond = A64_COND_CS; break; + case BPF_JSET: case BPF_JNE: jmp_cond = A64_COND_NE; break;