kvm-host icon indicating copy to clipboard operation
kvm-host copied to clipboard

arm64: Enable virtio-net and add network scripts

Open otischung opened this issue 10 months ago • 4 comments

Enable POSIX timers to support ping’s POSIX timer syscalls:

  • CONFIG_POSIX_TIMERS=y in configs/linux-arm64.config

Enable network stack and virtio-net in kernel config:

  • CONFIG_NET, CONFIG_INET, CONFIG_IP_MULTICAST, CONFIG_IP_PNP
  • CONFIG_IP_PNP_DHCP, CONFIG_NETDEVICES, CONFIG_VIRTIO
  • CONFIG_VIRTIO_NET, CONFIG_VIRTIO_RING

Add virtio_net_dev to FDT generation:

  • src/arch/arm64/vm.c: include virtio_net_dev in interrupt-map

Define VIRTIO_NET_IRQ=2 (SPI 34) in src/arch/arm64/desc.h

Add scripts for host and guest network setup:

  • scripts/set-host-bridge.sh to configure TAP bridge and default route
  • scripts/set-guest-route.sh to configure guest static IP and route

Update README.md with new scripts and build instructions

These changes have been validated on both a Raspberry Pi 5 Model B (Revision 1.0) running Ubuntu 25.10 with Linux kernel 6.14.0 and an NVIDIA Jetson Orin Nano Developer Kit running JetPack 6.2.1 (L4T 36.4.4) with Linux kernel 5.15.148-tegra.

otischung avatar Jun 30 '25 08:06 otischung

Many thanks to @visitorckw.

I rebased the branch, interchanged patches 2 and 3, flagged patch 2 for squashing, and force-pushed the result. Please examine the changes at your convenience.

otischung avatar Jul 01 '25 13:07 otischung

I’ve removed the unneeded ARM64 kernel configs (CONFIG_UNIX, CONFIG_UNIX_SCM, CONFIG_AF_UNIX_OOB) and renamed “Stop Emulator” to “Exit Emulator” in the README to better reflect its behavior. Please take a look and let me know if everything looks good for merge!

otischung avatar Jul 17 '25 09:07 otischung

Update

The changes were validated on the NVIDIA Jetson Orin Nano Developer Kit running JetPack 6.2.1 (L4T 36.4.4) with Linux kernel version 5.15.148-tegra. Network functionality within the guest operating system was confirmed to operate correctly.

otischung avatar Jul 29 '25 08:07 otischung

Update

I’ve updated the README example to use the standard $ prompt instead of for the ip a command.

Also, just a heads-up, the change requested by @visitorckw is no longer applicable, as the commit they referenced was removed by a force‑push.

Many thanks to @visitorckw.

I rebased the branch, interchanged patches 2 and 3, flagged patch 2 for squashing, and force-pushed the result. Please examine the changes at your convenience.

Let me know if you’d like any further tweaks. Thanks.

otischung avatar Jul 29 '25 11:07 otischung