diff --git a/common.mk b/common.mk index 3abdf4d6f23dda2d2122a4890776ae9811d915ce..f4232f96578749f6ef2367b7f4a804995027de13 100644 --- a/common.mk +++ b/common.mk @@ -37,9 +37,6 @@ CCACHE ?= $(shell which ccache) # Don't remove this comment (space is needed) QEMU_VIRTFS_ENABLE ?= n QEMU_VIRTFS_HOST_DIR ?= $(ROOT) -# Enable SLiRP user networking -QEMU_USERNET_ENABLE ?= n - ################################################################################ # Mandatory for autotools (for specifying --host) ################################################################################ @@ -309,10 +306,8 @@ QEMU_EXTRA_ARGS +=\ -device virtio-9p-device,fsdev=fsdev0,mount_tag=host endif -ifeq ($(QEMU_USERNET_ENABLE),y) -QEMU_EXTRA_ARGS +=\ - -netdev user,id=vmnic -device virtio-net-device,netdev=vmnic -endif +# Enable QEMU SLiRP user networking +QEMU_EXTRA_ARGS += -netdev user,id=vmnic -device virtio-net-device,netdev=vmnic define run-help @echo @@ -511,10 +506,8 @@ filelist-tee-common: optee-client xtest optee-examples echo "file /lib/libyaml-0.so.2.0.5 $(LIBYAML_LIB_OUT)/libyaml-0.so.2.0.5 755 0 0" \ >> $(fl); \ fi - @if [ "$(QEMU_USERNET_ENABLE)" = "y" ]; then \ - echo "slink /etc/rc.d/S02_udhcp_networking /etc/init.d/udhcpc 755 0 0" \ - >> $(fl); \ - fi + @echo "slink /etc/rc.d/S02_udhcp_networking /etc/init.d/udhcpc 755 0 0" \ + >> $(fl); @echo "# Secure storage dir" >> $(fl) @echo "dir /data 755 0 0" >> $(fl) @echo "dir /data/tee 755 0 0" >> $(fl) diff --git a/docs/qemu.md b/docs/qemu.md index c9559d899b4363087a2c13e63e3c7abb37689daf..f1cdc2c3b9126e1a36b4ebce85abc056dd324924 100644 --- a/docs/qemu.md +++ b/docs/qemu.md @@ -45,12 +45,14 @@ To mount host folder in QEMU, simply run: ```bash $ mount -t 9p -o trans=virtio host <mount_point> ``` -# 5. SLiRP user networking -To enable SLiRP user networking just set `QEMU_USERNET_ENABLE ?= y` in `common.mk`. -After booting QEMU VM, eth0 will automatically receive IP address via DHCP +# 5. Networking +After booting the QEMU VM, `eth0` will automatically receive an IP address from +QEMU via DHCP thanks to the SLiRP user networking feature. QEMU will act as a +gateway to the host network [SLiRP]. -*Important* Take into account that ICMP doesn't work in SLiRP mode, -so `ping` utility won't work. +Please note that ICMP won't work in the guest unless additional configuration is +made, so the `ping` utility won't work. [bios]: https://github.com/linaro-swg/bios_qemu_tz_arm [README.md]: ../README.md +[SLiRP]: https://wiki.qemu.org/Documentation/Networking#User_Networking_.28SLIRP.29