Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4865439pxj; Wed, 12 May 2021 15:09:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8+Eb002A8kRZdCGM4fH1MJqbhbgVkzAy7bYcZ4uadu1DMpeW5DzafBkdnKryzhLqv1mnP X-Received: by 2002:a17:906:b104:: with SMTP id u4mr39584473ejy.211.1620857366771; Wed, 12 May 2021 15:09:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620857366; cv=none; d=google.com; s=arc-20160816; b=z0jtVLzw4wTmos3YZQOHuG+hUfPesmYhsnqWPkGTtj50GbbIedIAAj+0DA+K7fdpfp vARFAOFyU1BOwJt2sVZK5wu65jb60QyDzLiYAN7AqAaF0tBP0aQE9R3idXZ1EJuvne7W ATvgHw1DUnvsZlGc88gmVjl8usehNRT41A4ziz/wlci1FUDH7CCEToLidZ/PtW+uuOdp XE4+WPM0AD+PZX4+tCizeT2feRL+6OGvUnl6DjEr5UmkSs77PJj9+fQs0Eq8/imP5i7g fjEfrOjRAMjKGdgPcO3aAFtPmyHo8Aj/YO3rz87Y7RJWsb/yctsm/ycjTBbzb3X4Dm92 YouQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=fSm9/E8MzZmI9reOb8/NMwY3xs0gPaGSU8c4E7oVoaM=; b=sEou9FbQMOWzt7SGRSws9xzIXSfccvTYZpCArC0JV6VILgy/tXCQimkGtiHKxKGG85 bWIVvq+DSlwD1Wp/PmeMvTt9aB74b3CO+1HW27e2g5+2Ap3QPMyAWiMj+Av+xsPIjHMg YhKUBNMbIDVcVYHYbxmiLaGLxRNzD7YDWkbWwcnv9eIaXb7WKbTDrhspFm5HqHUE4TBd kYq7Zyy9k0GCE/Y/jHSDp1BVMUqz6fAd7lRU54NLVhrVCLlJlSJTXXkGY+uawIWXQPkg fRcCZ5OXkDFA7DoyQbO1GfBD6W9Qv5IwJ+TCHSaCREN9k3A0W/QpUVKqtvX/ZEkG5nTu Cpyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y20si1112109ejr.553.2021.05.12.15.08.04; Wed, 12 May 2021 15:09:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348183AbhELWFC (ORCPT + 99 others); Wed, 12 May 2021 18:05:02 -0400 Received: from www62.your-server.de ([213.133.104.62]:46736 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241781AbhELU63 (ORCPT ); Wed, 12 May 2021 16:58:29 -0400 Received: from sslproxy05.your-server.de ([78.46.172.2]) by www62.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1lgvuQ-000FjQ-J8; Wed, 12 May 2021 22:56:46 +0200 Received: from [85.7.101.30] (helo=linux.home) by sslproxy05.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lgvuQ-000Rj0-9d; Wed, 12 May 2021 22:56:46 +0200 Subject: Re: [PATCH bpf-next] bpf: arm64: Replace STACK_ALIGN() with round_up() to align stack size To: Tiezhu Yang , Alexei Starovoitov , Zi Shen Lim , Catalin Marinas , Will Deacon , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <1620651119-5663-1-git-send-email-yangtiezhu@loongson.cn> From: Daniel Borkmann Message-ID: Date: Wed, 12 May 2021 22:56:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <1620651119-5663-1-git-send-email-yangtiezhu@loongson.cn> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.103.2/26168/Wed May 12 13:07:33 2021) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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.)