From patchwork Sat Jun 4 22:00:30 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: 9155001 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 2A1FC60221 for ; Sat, 4 Jun 2016 22:03:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B836281FE for ; Sat, 4 Jun 2016 22:03:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0FD1E28327; Sat, 4 Jun 2016 22:03:10 +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 7F1E0281FE for ; Sat, 4 Jun 2016 22:03:09 +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 1b9Jdj-0000VB-8H; Sat, 04 Jun 2016 22:01:55 +0000 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b9Jda-0000Qb-V9 for linux-arm-kernel@lists.infradead.org; Sat, 04 Jun 2016 22:01:48 +0000 Received: by mail-pf0-x241.google.com with SMTP id b124so14640808pfb.0 for ; Sat, 04 Jun 2016 15:01:26 -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=l52GvIqDARPIQ8MdymavqAwBxqPyI1L965NrOFGVGv1Hunz9RUZdGUob7gKXOULg7m B8wkRWkF4c3Q/LahHAqfLS3gXSda++TbVRS1bZtWI1rEbQTb2yvsJidtGhsSCc2AAikx ScCxUHY2S5Q3WT2d0sKatsTilxQDjIO3hOr8Vg6c8F0ic04hb95NR98+5bWWn3Ppulrm G07hQynjtX06OeOFFqSxpfDy/PZW+oZzBhW0RM0Khp2UZCW/JBGy7op98fSk+zmermke rwJ5oluOlLEU8E8FO8EXRNrF8ykYDvnJoWxeKD2ekI1ZR4gF5XfxKNOvqxE4mXSdQ43+ Wyyg== 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=kz+NCccB4YvmFoQEE3mCzYfkiFCm+96g0w/OJNlKmG05oZGxv0nyERgik1tHRxeO2a kRRxgrnvRBlhjcnyqw7xbLvbNH9hsciUAIfBM4KZ6vQahY9avcS+7IPRJrdZbz82iOgw 61k7m89QNGeSgi7ymU959MSDqdSb5PSRkpvb0IjjnXooEikG1a260wQoYYacnY0EPHup PArRtG79asigw6H/Th5j9txZn1PA8h0Mlzp0uD2VliFGDNcRi7H8cw5jUIWGFv71pakx sdj7cKmpFlrXwpmyEo320YHL/6+NJYEKd99WtceMJh4R4DN7BdLaNN7ipUCLDop5zCFv GTAQ== X-Gm-Message-State: ALyK8tJOcrS5nOvo2xGw2Aacl9EfamUeasM27+9jEUITLGOJx+m9DHil2FOfzzs8oIp//g== X-Received: by 10.98.75.146 with SMTP id d18mr15040341pfj.4.1465077686252; Sat, 04 Jun 2016 15:01:26 -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 y186sm17385539pfb.13.2016.06.04.15.01.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 04 Jun 2016 15:01:25 -0700 (PDT) From: Zi Shen Lim To: "David S. Miller" , Catalin Marinas , Will Deacon Subject: [PATCH net-next 3/3] arm64: bpf: optimize LD_ABS, LD_IND Date: Sat, 4 Jun 2016 15:00:30 -0700 Message-Id: <1465077630-633-3-git-send-email-zlim.lnx@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465077630-633-1-git-send-email-zlim.lnx@gmail.com> References: <1465077630-633-1-git-send-email-zlim.lnx@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160604_150147_133209_2FF16137 X-CRM114-Status: UNSURE ( 8.96 ) 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);