Skip to contentSkip to conversation

selftests/bpf: vm: add support for VIRTIO_FS

PATCH Superseded Manu Bretelle 2 participants 2 messages Sep 23, 2024

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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
---
 tools/testing/selftests/bpf/config.vm | 3 +++
 1 file changed, 3 insertions(+)
tools/testing/selftests/bpf/config.vm +3 -0
index a9746ca78777..b96b1fad2a04 100644
@@ -10,3 +10,6 @@ CONFIG_VIRTIO_CONSOLE=y
 CONFIG_VIRTIO_NET=y
 CONFIG_VIRTIO_PCI=y
 CONFIG_VIRTIO_VSOCKETS_COMMON=y
+CONFIG_FUSE_FS=y
+CONFIG_VIRTIO_FS=y
+CONFIG_FUSE_PASSTHROUGH=y
Signature · 1 line
2.43.5
reviewer Acked-by on v1 1/1
#1 lore raw
Quoted 40 lines · Manu Bretelle

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
---
 tools/testing/selftests/bpf/config.vm | 3 +++
 1 file changed, 3 insertions(+)
tools/testing/selftests/bpf/config.vm +0 -0
index a9746ca78777..b96b1fad2a04 100644

tools/testing/selftests/bpf/config.vm CONFIG_VIRTIO_CONSOLE=y · line 15

Quoted 6 lines
tools/testing/selftests/bpf/config.vm +3 -0
@@ -10,3 +10,6 @@ CONFIG_VIRTIO_CONSOLE=y
 CONFIG_VIRTIO_NET=y
 CONFIG_VIRTIO_PCI=y
 CONFIG_VIRTIO_VSOCKETS_COMMON=y
+CONFIG_FUSE_FS=y
+CONFIG_VIRTIO_FS=y
+CONFIG_FUSE_PASSTHROUGH=y

Please sort these CONFIG_* in alphabetical order.

Other than this,

Thanks,
Song