Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2575139pxj; Mon, 10 May 2021 06:14:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfX9GDS+6jLCtzRjLLhsPuWXhs015LEtrjrbs4640HN629UTQugWxPCejV/rmtqdossMCH X-Received: by 2002:a17:906:f742:: with SMTP id jp2mr26192429ejb.199.1620652455999; Mon, 10 May 2021 06:14:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620652455; cv=none; d=google.com; s=arc-20160816; b=VHpfQb9FAhK+st/OC5t9hR08L3pbQnGijSAmzcYiJOOL9TIZna5iAndIZfNJQtwVdI YugQzQOZVFxL0ENvVIoLTU6Tm3lGHBp5M3Y7fUt64H07wQzXgIMO4tl+9q4Ot6l/aTfu lVJWEsli4astVwoq7CnXqROR/0lyE7Lr+hiLQdoeuvoh68oijackUVaMo4uMPHg3Jw+Y wVdduEI9oWtkZtxNLmm2KP4tIfJqZX3SLkXNu8kukowzCndoI6zLwB+h00kzznuewv68 MiIku6B1R1Ra7BblR3jMNSkXlsSe+2NYSapL3RKRKsWieGTWI460Xspuv9RvyXpSKD4n 3bTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=ypUP7/PsGFHcK902Skn1HmX6IRbVFHiAz7spz3TVPvQ=; b=xLQNKh1qzN6STppLxDHKF5z8oqE4AC6MQKNk44WOI+rDndMGc7usyKfGMi/7VJkUC7 1l5yJFZgVb8ZwMYoz6NfzRZrkWcT7z4D+F/XnbWYHQsPMV4NUcVx7mtZLmqIlhQj12xV Wl2v1wxGgxv2bamOJiusw4IhpzUErzmvlXXkbEil6m77K+oMi0kte0QYQma7/a88cdB9 GehMUCEKmkFoq/BuTE+6TyrnuWh7qGuEn1QSyi0zZbrt3hXXTygQNA/2ZxhUjxySBHY1 yJOts0I6YzoOwttaP9QAA5uGnbdjb4491ZRlG1pGhGsGQ9thHG+ovRSmcGRsXj/l/rUH N9LQ== 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 w20si12868719ejq.119.2021.05.10.06.13.46; Mon, 10 May 2021 06:14:15 -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 S235752AbhEJNDe (ORCPT + 99 others); Mon, 10 May 2021 09:03:34 -0400 Received: from mail.loongson.cn ([114.242.206.163]:56454 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S241723AbhEJMx2 (ORCPT ); Mon, 10 May 2021 08:53:28 -0400 Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9DxH+9wLJlguH4UAA--.15168S2; Mon, 10 May 2021 20:52:00 +0800 (CST) From: Tiezhu Yang To: Alexei Starovoitov , Daniel Borkmann , 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 Subject: [PATCH bpf-next] bpf: arm64: Replace STACK_ALIGN() with round_up() to align stack size Date: Mon, 10 May 2021 20:51:59 +0800 Message-Id: <1620651119-5663-1-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: AQAAf9DxH+9wLJlguH4UAA--.15168S2 X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enderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); /* Set up function call stack */ emit(A64_SUB_I(1, A64_SP, A64_SP, ctx->stack_size), ctx); -- 2.1.0