All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Björn Töpel" <bjorn@kernel.org>
To: Song Liu <song@kernel.org>, bpf@vger.kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	martin.lau@kernel.org, kernel-team@meta.com, xukuohai@huawei.com,
	pulehui@huawei.com, iii@linux.ibm.com, jolsa@kernel.org,
	Song Liu <song@kernel.org>
Subject: Re: [PATCH v5 bpf-next 6/7] bpf: Use arch_bpf_trampoline_size
Date: Thu, 26 Oct 2023 22:21:08 +0200	[thread overview]
Message-ID: <8734xxgmob.fsf@all.your.base.are.belong.to.us> (raw)
In-Reply-To: <20231024224601.2292927-7-song@kernel.org>

Song Liu <song@kernel.org> writes:

> Instead of blindly allocating PAGE_SIZE for each trampoline, check the size
> of the trampoline with arch_bpf_trampoline_size(). This size is saved in
> bpf_tramp_image->size, and used for modmem charge/uncharge. The fallback
> arch_alloc_bpf_trampoline() still allocates a whole page because we need to
> use set_memory_* to protect the memory.
>
> struct_ops trampoline still uses a whole page for multiple trampolines.
>
> With this size check at caller (regular trampoline and struct_ops
> trampoline), remove arch_bpf_trampoline_size() from
> arch_prepare_bpf_trampoline() in archs.
>
> Also, update bpf_image_ksym_add() to handle symbol of different sizes.
>
> Signed-off-by: Song Liu <song@kernel.org>
> Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
> Tested-by: Ilya Leoshkevich <iii@linux.ibm.com>  # on s390x

(And this one got stuck on my queue...)

Acked-by: Björn Töpel <bjorn@rivosinc.com>
Tested-by: Björn Töpel <bjorn@rivosinc.com> # on riscv

  reply	other threads:[~2023-10-26 20:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-24 22:45 [PATCH v5 bpf-next 0/7] Allocate bpf trampoline on bpf_prog_pack Song Liu
2023-10-24 22:45 ` [PATCH v5 bpf-next 1/7] bpf: Let bpf_prog_pack_free handle any pointer Song Liu
2023-10-24 22:45 ` [PATCH v5 bpf-next 2/7] bpf: Adjust argument names of arch_prepare_bpf_trampoline() Song Liu
2023-10-24 22:45 ` [PATCH v5 bpf-next 3/7] bpf: Add helpers for trampoline image management Song Liu
2023-10-24 22:45 ` [PATCH v5 bpf-next 4/7] bpf, x86: Adjust arch_prepare_bpf_trampoline return value Song Liu
2023-10-24 22:45 ` [PATCH v5 bpf-next 5/7] bpf: Add arch_bpf_trampoline_size() Song Liu
2023-10-26 11:59   ` Björn Töpel
2023-10-24 22:46 ` [PATCH v5 bpf-next 6/7] bpf: Use arch_bpf_trampoline_size Song Liu
2023-10-26 20:21   ` Björn Töpel [this message]
2023-10-24 22:46 ` [PATCH v5 bpf-next 7/7] x86, bpf: Use bpf_prog_pack for bpf trampoline Song Liu
2023-10-25 13:49 ` [PATCH v5 bpf-next 0/7] Allocate bpf trampoline on bpf_prog_pack Jiri Olsa

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=8734xxgmob.fsf@all.your.base.are.belong.to.us \
    --to=bjorn@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=iii@linux.ibm.com \
    --cc=jolsa@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=martin.lau@kernel.org \
    --cc=pulehui@huawei.com \
    --cc=song@kernel.org \
    --cc=xukuohai@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.