Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf: vm: Add support for VIRTIO_FS

danobi/vmtest is going to migrate from using 9p to using virtio_fs to
mount the local rootfs: https://github.com/danobi/vmtest/pull/88

BPF CI uses danobi/vmtest to run bpf selftests and will need to support
VIRTIO_FS.

This change enables new kconfigs to be able to support the upcoming
danobi/vmtest.

Tested by building a new kernel with those config and confirming it
would successfully run with 9p (currently what is used by vmtest), and
with virtio_fs (using a local build of vmtest).

$ vmtest -k arch/x86/boot/bzImage "findmnt /"
=> bzImage
===> Booting
===> Setting up VM
===> Running command
TARGET SOURCE FSTYPE OPTIONS
/ /dev/root 9p rw,relatime,cache=5,access=client,msize=512000,trans=virtio
$ /home/chantra/local/danobi-vmtest/target/debug/vmtest -k arch/x86/boot/bzImage "findmnt /"
=> bzImage
===> Initializing host environment
===> Booting
===> Setting up VM
===> Running command
TARGET SOURCE FSTYPE OPTIONS
/ rootfs virtiofs rw,relatime

Changes in v2:
* Sorted configs alphabetically

Signed-off-by: Manu Bretelle <chantr4@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Daniel Xu <dxu@dxuuu.xyz>
Link: https://lore.kernel.org/bpf/20240925002210.501266-1-chantr4@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Manu Bretelle and committed by
Alexei Starovoitov
78971150 a400d08b

+5 -2
+5 -2
tools/testing/selftests/bpf/config.vm
··· 1 - CONFIG_9P_FS=y 2 1 CONFIG_9P_FS_POSIX_ACL=y 3 2 CONFIG_9P_FS_SECURITY=y 3 + CONFIG_9P_FS=y 4 4 CONFIG_CRYPTO_DEV_VIRTIO=y 5 - CONFIG_NET_9P=y 5 + CONFIG_FUSE_FS=y 6 + CONFIG_FUSE_PASSTHROUGH=y 6 7 CONFIG_NET_9P_VIRTIO=y 8 + CONFIG_NET_9P=y 7 9 CONFIG_VIRTIO_BALLOON=y 8 10 CONFIG_VIRTIO_BLK=y 9 11 CONFIG_VIRTIO_CONSOLE=y 12 + CONFIG_VIRTIO_FS=y 10 13 CONFIG_VIRTIO_NET=y 11 14 CONFIG_VIRTIO_PCI=y 12 15 CONFIG_VIRTIO_VSOCKETS_COMMON=y