From: Tiezhu Yang <yangtiezhu@loongson.cn>
To: George Guo <dongtai.guo@linux.dev>, chenhuacai@kernel.org
Cc: hengqi.chen@gmail.com, guodongtai@kylinos.cn,
bpf@vger.kernel.org, loongarch@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/5] LoongArch: BPF: Allow programs 2 KiB of stack
Date: Mon, 30 Nov 2026 19:36:38 +0800 [thread overview]
Message-ID: <a4e07c34-3cb7-caf0-002b-63386b80f726@loongson.cn> (raw)
In-Reply-To: <20261126034048.7370-4-dongtai.guo@linux.dev>
On 11/26/26 11:40 AM, George Guo wrote:
> From: George Guo <guodongtai@kylinos.cn>
...
> @@ -140,27 +144,25 @@ static void build_prologue(struct jit_ctx *ctx)
> */
> const bool is_exception_prog = prog->aux->exception_boundary ||
> prog->aux->exception_cb;
> -
> - bpf_stack_adjust = round_up(ctx->prog->aux->stack_depth, 16);
> -
> - /* To store ra, fp, s0, s1, s2, s3, s4, s5 */
> - stack_adjust += sizeof(long) * 8;
> -
> - /* To store tcc and tcc_ptr */
> - stack_adjust += sizeof(long) * 2;
> + /* To store ra, fp, s0, s1, s2, s3, s4, s5, tcc and tcc_ptr */
> + int size = sizeof(long) * 10;
>
> if (ctx->arena_vm_start || is_exception_prog)
> - stack_adjust += sizeof(long);
> + size += sizeof(long);
>
> - stack_adjust = round_up(stack_adjust, 16);
> + return round_up(size, 16);
> +}
Patch 2 modifies the frame size calculation and this patch
immediately refactors it into jit_save_area_size(). Please
order the 2 KiB stack patch before the exceptions patch.
That way, the exception frame changes (s6-s8) only need to
be added once in jit_save_area_size(), IMO.
Thanks,
Tiezhu
next prev parent reply other threads:[~2026-11-30 11:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 3:40 [PATCH v3 0/5] LoongArch: BPF: Add private stack, exceptions, large stack and arena support George Guo
2026-11-26 3:40 ` [PATCH v3 1/5] LoongArch: BPF: Add support for private stack George Guo
2026-11-26 3:40 ` [PATCH v3 2/5] LoongArch: BPF: Add support for exceptions George Guo
2026-11-30 11:27 ` Tiezhu Yang
2026-11-26 3:40 ` [PATCH v3 3/5] LoongArch: BPF: Allow programs 2 KiB of stack George Guo
2026-11-30 11:36 ` Tiezhu Yang [this message]
2026-12-01 8:09 ` George Guo
2026-11-26 3:40 ` [PATCH v3 4/5] LoongArch: BPF: Add support for signed arena loads George Guo
2026-11-26 3:40 ` [PATCH v3 5/5] LoongArch: BPF: Add support for arena atomics George Guo
2026-11-30 9:50 ` Tiezhu Yang
2026-12-01 8:00 ` George Guo
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=a4e07c34-3cb7-caf0-002b-63386b80f726@loongson.cn \
--to=yangtiezhu@loongson.cn \
--cc=bpf@vger.kernel.org \
--cc=chenhuacai@kernel.org \
--cc=dongtai.guo@linux.dev \
--cc=guodongtai@kylinos.cn \
--cc=hengqi.chen@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
/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
all inboxes | Powered by JetHome®