From patchwork Thu Jun 9 04:18:50 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: 9166201 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 76EE960467 for ; Thu, 9 Jun 2016 04:22:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CCC1281F9 for ; Thu, 9 Jun 2016 04:22:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 61AF32824F; Thu, 9 Jun 2016 04:22:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 308CF281F9 for ; Thu, 9 Jun 2016 04:22:06 +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 1bArRo-0006Sy-4K; Thu, 09 Jun 2016 04:20:00 +0000 Received: from mail-pa0-x244.google.com ([2607:f8b0:400e:c03::244]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bArRV-0006Kj-MR for linux-arm-kernel@lists.infradead.org; Thu, 09 Jun 2016 04:19:43 +0000 Received: by mail-pa0-x244.google.com with SMTP id di3so1838406pab.0 for ; Wed, 08 Jun 2016 21:19:21 -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:in-reply-to:references; bh=djtcz5r1F5Od573NPDnesOyn+iFkddujXMugj7lF72Y=; b=m2SpGUi26lrBRL6K7U0oWMw4mz2RWrA88wDTgrpbHRgufPGXvfQy+hXRi+86RhWy3U kEyiG3jTGVSDinU/dzH9GILR2BNwvesbinzbyO30VEt876QJfkrQ5j7rfGeHaURzus8q OK/DPzTpE+74T2rYMG15Tl68/AXJlnZ3Wox6Bxq5iQHSbutVvqq1O9MZMNe7iENGz7v9 rkH4Q/wXALB9A8bb/PswgiwQEGUqWbeUgoO42UJG3Emf/X0oSatwsi7lrD55v9BzrOzR RmaNVxzf4w8ljeJvLIUUWIUuhR0f3GmY1/8fwxeH+9AvhqqCS2BcjAcj31HHxAdzVb3z opMA== 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:in-reply-to :references; bh=djtcz5r1F5Od573NPDnesOyn+iFkddujXMugj7lF72Y=; b=GM5qfBS2qOD5FLxy/TsglcWbOqgHm5y4mmFiY4enhE4KVfurT0kGAwLnO/9TRSe3ie yBNQjaQx5Jre4+Pao6OvFKqeOBaGxuO/WiVVcmzCwga/YsyW1q4L1Y0bIQBv0rB4NTVp OwmULNp7lx5XiJHsouO6VU0f14q5F/xrhzhuYkhC1JPVqDs54Q2Pd4zET8nQk/cgB6KV gHbOcIa9Y/WaatkLt0SyxsN3lOtvy1o8f47kQP2sT31FGj5lccfcyUOof6YQzFRD+sut 3IxmIw2mtcTFs8n1iypec8J6Fir1YqD7+P3NLeBKalqKtSvS6kI7w7N5rAceEweKvXIx aelw== X-Gm-Message-State: ALyK8tKT9YuQywtND9zf/0UhDwKjaT5DsL2W52yVcQXHS6YZOPg/cYzumG/WOUglNwceIw== X-Received: by 10.66.237.175 with SMTP id vd15mr9677291pac.139.1465445961006; Wed, 08 Jun 2016 21:19:21 -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 c13sm5848579pfc.40.2016.06.08.21.19.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Jun 2016 21:19:20 -0700 (PDT) From: Zi Shen Lim To: "David S. Miller" , Catalin Marinas , Will Deacon Subject: [PATCH net-next v3 4/4] arm64: bpf: optimize LD_ABS, LD_IND Date: Wed, 8 Jun 2016 21:18:50 -0700 Message-Id: <1465445930-3960-5-git-send-email-zlim.lnx@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465445930-3960-1-git-send-email-zlim.lnx@gmail.com> References: <1465445930-3960-1-git-send-email-zlim.lnx@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160608_211941_854101_4B0A778C X-CRM114-Status: UNSURE ( 9.31 ) X-CRM114-Notice: Please train this message. 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: Yang Shi , Daniel Borkmann , Zi Shen Lim , Alexei Starovoitov , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Remove superfluous stack frame, saving us 3 instructions for every LD_ABS or LD_IND. Signed-off-by: Zi Shen Lim --- arch/arm64/net/bpf_jit_comp.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index 7ae304e..b2fc97a 100644 --- a/arch/arm64/net/bpf_jit_comp.c +++ b/arch/arm64/net/bpf_jit_comp.c @@ -731,11 +731,8 @@ emit_cond_jmp: emit_a64_mov_i64(r3, size, ctx); emit(A64_SUB_I(1, r4, fp, STACK_SIZE), ctx); emit_a64_mov_i64(r5, (unsigned long)bpf_load_pointer, ctx); - emit(A64_PUSH(A64_FP, A64_LR, A64_SP), ctx); - emit(A64_MOV(1, A64_FP, A64_SP), ctx); emit(A64_BLR(r5), ctx); emit(A64_MOV(1, r0, A64_R(0)), ctx); - emit(A64_POP(A64_FP, A64_LR, A64_SP), ctx); jmp_offset = epilogue_offset(ctx); check_imm19(jmp_offset);