All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuan-Wei Chiu <visitorckw@gmail.com>
To: trini@konsulko.com, tuomas.tynkkynen@iki.fi, bmeng.cn@gmail.com,
	sjg@chromium.org, jerome.forissier@arm.com
Cc: jserv@ccns.ncku.edu.tw, eleanor15x@gmail.com,
	marscheng@google.com, u-boot@lists.u-boot-project.org,
	Kuan-Wei Chiu <visitorckw@gmail.com>
Subject: [PATCH v3 0/6] fs: Add 9P filesystem support over virtio
Date: Wed, 23 Sep 2026 21:29:56 +0000	[thread overview]
Message-ID: <20260923213002.1070404-1-visitorckw@gmail.com> (raw)

Add 9P network filesystem support to U-Boot.

It allows U-Boot to directly mount host directories in virtualization
environments via virtio. This is useful for loading kernel and
initramfs images directly from the host into the VM during development
and testing without having to rebuild disk images or set up a TFTP
server.

The functionality has been verified on qemu arm64 by successfully
loading a Linux kernel image and an initramfs image via 9P, and booting
to the Linux shell.

To test with QEMU:
  -fsdev local,id=fsdev0,path=/path/to/host/dir,security_model=none \
  -device virtio-9p-device,fsdev=fsdev0,mount_tag=rootfs

U-Boot usage:
  => virtio scan
  => ls 9p rootfs /
  => ls 9p 0 /
  => ls 9p - /
  => load 9p rootfs $kernel_addr_r /Image
  => load 9p rootfs $ramdisk_addr_r /initramfs.cpio
  => booti $kernel_addr_r $ramdisk_addr_r:$filesize $fdtcontroladdr

Changes in v3:
- Return received byte length from virtio_9p_request() and check it
  against the reply header size in p9_request().
- Call virtio_del_vqs() before virtio_reset() in virtio_9p_remove().
- Use double backticks for literal text in 9p.rst.
- Assert expected error strings in test_9p.py negative test cases.
- Add doc/develop/pytest/test_9p.rst.

Changes in v2:
- Introduce DM UCLASS_9P and dm_p9_ops for transport devices.
- Support selecting devices by mount tag, sequence index, or default.
- Integrate 9p into disk/part.c and generic VFS null_dev_desc handling.
- Consistently use 9P2000.L naming across subjects, code, and Kconfig.
- Add kerneldoc comments and separate filesystem header.
- Add timeout handling, feature negotiation, and remove callback.
- Add 9P documentation.
- Add automated pytest and enable in qemu_arm64_defconfig.
- Fix error checking, bounds checks, and memory leaks.

Kuan-Wei Chiu (6):
  net: 9p: Add 9P2000.L protocol support
  fs: 9p: Add 9P filesystem support
  virtio: 9p: Add 9P transport driver
  doc: 9p: Add 9P filesystem documentation
  test: 9p: Add test for 9P filesystem
  MAINTAINERS: Add entry for 9PFS

 MAINTAINERS                    |  12 +
 configs/qemu_arm64_defconfig   |   3 +
 disk/part.c                    |  16 ++
 doc/develop/pytest/test_9p.rst |  10 +
 doc/usage/filesystems/9p.rst   |  55 +++++
 doc/usage/index.rst            |   1 +
 drivers/virtio/Kconfig         |   7 +
 drivers/virtio/Makefile        |   1 +
 drivers/virtio/virtio-uclass.c |   1 +
 drivers/virtio/virtio_9p.c     | 120 ++++++++++
 fs/9p/9p.c                     | 185 +++++++++++++++
 fs/9p/Kconfig                  |   8 +
 fs/9p/Makefile                 |   5 +
 fs/Kconfig                     |   2 +
 fs/Makefile                    |   1 +
 fs/fs.c                        |  25 ++
 include/9p.h                   | 203 ++++++++++++++++
 include/9pfs.h                 |  60 +++++
 include/dm/uclass-id.h         |   1 +
 include/fs.h                   |   1 +
 include/virtio.h               |  12 +-
 net/9p/Kconfig                 |   5 +
 net/9p/Makefile                |   5 +
 net/9p/client.c                | 415 +++++++++++++++++++++++++++++++++
 net/Kconfig                    |   2 +
 net/Makefile                   |   1 +
 test/py/tests/test_9p.py       |  82 +++++++
 27 files changed, 1238 insertions(+), 1 deletion(-)
 create mode 100644 doc/develop/pytest/test_9p.rst
 create mode 100644 doc/usage/filesystems/9p.rst
 create mode 100644 drivers/virtio/virtio_9p.c
 create mode 100644 fs/9p/9p.c
 create mode 100644 fs/9p/Kconfig
 create mode 100644 fs/9p/Makefile
 create mode 100644 include/9p.h
 create mode 100644 include/9pfs.h
 create mode 100644 net/9p/Kconfig
 create mode 100644 net/9p/Makefile
 create mode 100644 net/9p/client.c
 create mode 100644 test/py/tests/test_9p.py

-- 
2.56.0.rc1.310.g51773c2048-goog


             reply	other threads:[~2026-09-23 21:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23 21:29 Kuan-Wei Chiu [this message]
2026-09-23 21:29 ` [PATCH v3 1/6] net: 9p: Add 9P2000.L protocol support Kuan-Wei Chiu
2026-09-23 21:29 ` [PATCH v3 2/6] fs: 9p: Add 9P filesystem support Kuan-Wei Chiu
2026-09-23 21:29 ` [PATCH v3 3/6] virtio: 9p: Add 9P transport driver Kuan-Wei Chiu
2026-09-27 15:40   ` Simon Glass
2026-09-23 21:30 ` [PATCH v3 4/6] doc: 9p: Add 9P filesystem documentation Kuan-Wei Chiu
2026-09-27 15:40   ` Simon Glass
2026-09-23 21:30 ` [PATCH v3 5/6] test: 9p: Add test for 9P filesystem Kuan-Wei Chiu
2026-09-27 15:40   ` Simon Glass
2026-09-23 21:30 ` [PATCH v3 6/6] MAINTAINERS: Add entry for 9PFS Kuan-Wei Chiu
2026-10-07 18:42 ` [PATCH v3 0/6] fs: Add 9P filesystem support over virtio Tom Rini
2026-10-07 19:59   ` Tom Rini
2026-10-07 20:13     ` Kuan-Wei Chiu
2026-10-07 20:30       ` Kuan-Wei Chiu
2026-10-07 20:31         ` Tom Rini

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=20260923213002.1070404-1-visitorckw@gmail.com \
    --to=visitorckw@gmail.com \
    --cc=bmeng.cn@gmail.com \
    --cc=eleanor15x@gmail.com \
    --cc=jerome.forissier@arm.com \
    --cc=jserv@ccns.ncku.edu.tw \
    --cc=marscheng@google.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=tuomas.tynkkynen@iki.fi \
    --cc=u-boot@lists.u-boot-project.org \
    /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.