From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Borkmann Subject: [PATCH bpf-next v2 4/8] bpf, arm32: save 4 bytes of unneeded stack space Date: Mon, 14 May 2018 23:22:30 +0200 Message-ID: <20180514212234.2661-5-daniel@iogearbox.net> References: <20180514212234.2661-1-daniel@iogearbox.net> Cc: netdev@vger.kernel.org, Daniel Borkmann To: alexei.starovoitov@gmail.com Return-path: Received: from www62.your-server.de ([213.133.104.62]:55135 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752096AbeENVWw (ORCPT ); Mon, 14 May 2018 17:22:52 -0400 In-Reply-To: <20180514212234.2661-1-daniel@iogearbox.net> Sender: netdev-owner@vger.kernel.org List-ID: The extra skb_copy_bits() buffer is not used anymore, therefore remove the extra 4 byte stack space requirement. Signed-off-by: Daniel Borkmann --- arch/arm/net/bpf_jit_32.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index 82689b9..d3ea645 100644 --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/arm/net/bpf_jit_32.c @@ -234,18 +234,11 @@ static void jit_fill_hole(void *area, unsigned int size) #define SCRATCH_SIZE 80 /* total stack size used in JITed code */ -#define _STACK_SIZE \ - (ctx->prog->aux->stack_depth + \ - + SCRATCH_SIZE + \ - + 4 /* extra for skb_copy_bits buffer */) - -#define STACK_SIZE ALIGN(_STACK_SIZE, STACK_ALIGNMENT) +#define _STACK_SIZE (ctx->prog->aux->stack_depth + SCRATCH_SIZE) +#define STACK_SIZE ALIGN(_STACK_SIZE, STACK_ALIGNMENT) /* Get the offset of eBPF REGISTERs stored on scratch space. */ -#define STACK_VAR(off) (STACK_SIZE-off-4) - -/* Offset of skb_copy_bits buffer */ -#define SKB_BUFFER STACK_VAR(SCRATCH_SIZE) +#define STACK_VAR(off) (STACK_SIZE - off) #if __LINUX_ARM_ARCH__ < 7 -- 2.9.5