From: Daniel Borkmann <daniel@iogearbox.net>
To: memxor@gmail.com
Cc: brauner@kernel.org, kpsingh@kernel.org, ast@kernel.org,
john.fastabend@gmail.com, a.s.protopopov@gmail.com,
bpf@vger.kernel.org
Subject: [PATCH bpf-next 09/11] selftests/bpf: Allow appending to guest kernel cmdline in vmtest.sh
Date: Fri, 21 Aug 2026 23:41:09 +0200 [thread overview]
Message-ID: <20260821214111.1120748-10-daniel@iogearbox.net> (raw)
In-Reply-To: <20260821214111.1120748-1-daniel@iogearbox.net>
vmtest.sh currently hardcodes the guest command line, so there is no
way to ask for such a setting without editing the script. Append
$KERNEL_CMDLINE_EXTRA to it when set to it can be used for testing
BPF keyring:
# KERNEL_CMDLINE_EXTRA="bpf.keyring_unsealed=1" \
./vmtest.sh -- ./test_progs -t signed_loader
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
---
tools/testing/selftests/bpf/vmtest.sh | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/vmtest.sh b/tools/testing/selftests/bpf/vmtest.sh
index 6a3d026d76bd..e7e0b419a0b8 100755
--- a/tools/testing/selftests/bpf/vmtest.sh
+++ b/tools/testing/selftests/bpf/vmtest.sh
@@ -107,6 +107,14 @@ Options:
-s) Instead of powering off the VM, start an interactive
shell. If <command> is specified, the shell runs after
the command finishes executing
+
+Environment variables:
+
+ KERNEL_CMDLINE_EXTRA
+ Extra arguments to append to the guest kernel command
+ line, for tests that need a boot-time setting. e.g:
+
+ KERNEL_CMDLINE_EXTRA="bpf.keyring_unsealed=1" $0 -- ./test_progs -t signed_loader
EOF
}
@@ -286,6 +294,12 @@ EOF
QEMU_FLAGS=("${HOST_FLAGS[@]}")
fi
+ local kernel_cmdline="root=/dev/vda rw console=${QEMU_CONSOLE}"
+
+ if [[ -n "${KERNEL_CMDLINE_EXTRA:-}" ]]; then
+ kernel_cmdline+=" ${KERNEL_CMDLINE_EXTRA}"
+ fi
+
${QEMU_BINARY} \
-nodefaults \
-display none \
@@ -294,7 +308,7 @@ EOF
-m 4G \
-drive file="${rootfs_img}",format=raw,index=1,media=disk,if=virtio,cache=none \
-kernel "${kernel_bzimage}" \
- -append "root=/dev/vda rw console=${QEMU_CONSOLE}"
+ -append "${kernel_cmdline}"
}
copy_logs()
--
2.43.0
next prev parent reply other threads:[~2026-08-21 21:41 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-21 21:41 [PATCH bpf-next 00/11] BPF keyring and signed loader ML-DSA support Daniel Borkmann
2026-08-21 21:41 ` [PATCH bpf-next 01/11] bpf: Add a bpf keyring for program signature validation Daniel Borkmann
2026-08-21 21:56 ` sashiko-bot
2026-08-21 22:18 ` Daniel Borkmann
2026-08-21 22:50 ` bot+bpf-ci
2026-08-21 21:41 ` [PATCH bpf-next 02/11] bpf: Refuse caller-supplied keyrings when the bpf one is active Daniel Borkmann
2026-08-21 22:39 ` bot+bpf-ci
2026-08-21 21:41 ` [PATCH bpf-next 03/11] bpf: Raise the bound on a program's signature size Daniel Borkmann
2026-08-21 22:39 ` bot+bpf-ci
2026-08-21 21:41 ` [PATCH bpf-next 04/11] bpftool: Support ML-DSA program signing Daniel Borkmann
2026-08-21 22:39 ` bot+bpf-ci
2026-08-21 21:41 ` [PATCH bpf-next 05/11] selftests/bpf: Add a test for the sealed bpf keyring Daniel Borkmann
2026-08-21 21:53 ` sashiko-bot
2026-08-21 22:50 ` bot+bpf-ci
2026-08-21 21:41 ` [PATCH bpf-next 06/11] selftests/bpf: Rebuild signed lskels when signing key changes Daniel Borkmann
2026-08-21 21:41 ` [PATCH bpf-next 07/11] selftests/bpf: Rename the verify_sig_setup.sh setup into setup-rsa Daniel Borkmann
2026-08-21 21:41 ` [PATCH bpf-next 08/11] selftests/bpf: Add an end-to-end ML-DSA signed loader test Daniel Borkmann
2026-08-21 21:50 ` sashiko-bot
2026-08-21 22:39 ` bot+bpf-ci
2026-08-21 21:41 ` Daniel Borkmann [this message]
2026-08-21 21:41 ` [PATCH bpf-next 10/11] selftests/bpf: Add tests for bpf keyring in signed loader Daniel Borkmann
2026-08-21 21:53 ` sashiko-bot
2026-08-21 22:50 ` bot+bpf-ci
2026-08-21 21:41 ` [PATCH bpf-next 11/11] Documentation/bpf: Document the bpf keyring and improve examples Daniel Borkmann
2026-08-21 22:50 ` bot+bpf-ci
2026-08-24 15:18 ` [PATCH bpf-next 00/11] BPF keyring and signed loader ML-DSA support Paul Moore
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=20260821214111.1120748-10-daniel@iogearbox.net \
--to=daniel@iogearbox.net \
--cc=a.s.protopopov@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=brauner@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kpsingh@kernel.org \
--cc=memxor@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 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.