netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Tiezhu Yang <yangtiezhu@loongson.cn>,
	Alexei Starovoitov <ast@kernel.org>,
	Zi Shen Lim <zlim.lnx@gmail.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH bpf-next] bpf: arm64: Replace STACK_ALIGN() with round_up() to align stack size
Date: Wed, 12 May 2021 22:56:45 +0200	[thread overview]
Message-ID: <c1f5d54e-333f-733b-5806-498f2b4e3d5a@iogearbox.net> (raw)
In-Reply-To: <1620651119-5663-1-git-send-email-yangtiezhu@loongson.cn>

On 5/10/21 2:51 PM, Tiezhu Yang wrote:
> Use the common function round_up() directly to show the align size
> explicitly, the function STACK_ALIGN() is needless, remove it.
> 
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> ---
>   arch/arm64/net/bpf_jit_comp.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
> index f7b1948..81c380f 100644
> --- a/arch/arm64/net/bpf_jit_comp.c
> +++ b/arch/arm64/net/bpf_jit_comp.c
> @@ -178,9 +178,6 @@ static bool is_addsub_imm(u32 imm)
>   	return !(imm & ~0xfff) || !(imm & ~0xfff000);
>   }
>   
> -/* Stack must be multiples of 16B */
> -#define STACK_ALIGN(sz) (((sz) + 15) & ~15)
> -
>   /* Tail call offset to jump into */
>   #if IS_ENABLED(CONFIG_ARM64_BTI_KERNEL)
>   #define PROLOGUE_OFFSET 8
> @@ -255,7 +252,7 @@ static int build_prologue(struct jit_ctx *ctx, bool ebpf_from_cbpf)
>   			emit(A64_BTI_J, ctx);
>   	}
>   
> -	ctx->stack_size = STACK_ALIGN(prog->aux->stack_depth);
> +	ctx->stack_size = round_up(prog->aux->stack_depth, 16);
>   

Applied, thanks! (I retained the comment wrt stack requirement to have it explicitly stated.)

      reply	other threads:[~2021-05-12 21:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10 12:51 [PATCH bpf-next] bpf: arm64: Replace STACK_ALIGN() with round_up() to align stack size Tiezhu Yang
2021-05-12 20:56 ` Daniel Borkmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c1f5d54e-333f-733b-5806-498f2b4e3d5a@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=will@kernel.org \
    --cc=yangtiezhu@loongson.cn \
    --cc=yhs@fb.com \
    --cc=zlim.lnx@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).