Skip to content
Snippets Groups Projects
Commit 0aea4ef1 authored by Igor Opaniuk's avatar Igor Opaniuk Committed by Jerome Forissier
Browse files

qemu: add option to enable SLiRP user networking


Reviewed-by: default avatarJoakim Bech <joakim.bech@linaro.org>
Reviewed-by: default avatarJerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: default avatarIgor Opaniuk <igor.opaniuk@linaro.org>
[Rebase on top of master]
Signed-off-by: default avatarJerome Forissier <jerome.forissier@linaro.org>
parent 6d1869fc
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,8 @@ 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
################################################################################
# Check coherency of compilation mode
################################################################################
......@@ -196,6 +198,11 @@ QEMU_EXTRA_ARGS +=\
-fsdev local,id=fsdev0,path=$(QEMU_VIRTFS_HOST_DIR),security_model=none \
-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
################################################################################
# OP-TEE
################################################################################
......@@ -301,6 +308,10 @@ filelist-tee-common: optee-client xtest helloworld
"$(HELLOWORLD_PATH)/ta/8aaaf200-2450-11e4-abe2-0002a5d5c51b.ta" \
"444 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 "# Secure storage dir" >> $(fl)
@echo "dir /data 755 0 0" >> $(fl)
@echo "dir /data/tee 755 0 0" >> $(fl)
......
......@@ -4,7 +4,8 @@
1. [Introduction](#1-introduction)
2. [Regular build](#2-regular-build)
3. [Install files on the device](#3-qemu-console)
4. [Host-Guest folder sharing in QEMU/QEMUv8 configurations](#4-host-guest-folder-sharing-in-qemuqemuv8-configurations)
4. [Host-Guest folder sharing](#4-host-guest-folder-sharing)
5. [SLiRP user networking](#5-slirp-user-networking)
# 1. Introduction
The instructions here will tell how to run OP-TEE using QEMU. We have two
......@@ -31,12 +32,12 @@ It will stop on the QEMU console, to continue, simply
## 3.2 ARMv8-A
It won't stop, it will just boot up QEMU and OP-TEE.
#4. Host-Guest folder sharing in QEMU/QEMUv8 configurations
# 4. Host-Guest folder sharing
To avoid changing rootfs CPIO archive each time you need to add additional files
to it, you can also use VirtFS QEMU feature to share a folder between the guest
and host operating systems. To use this feature enable VirtFS QEMU build in
build/common.mk (set QEMU_VIRTFS_ENABLE ?= y), adjust QEMU_VIRTFS_HOST_DIR and
build/common.mk (set `QEMU_VIRTFS_ENABLE ?= y`), adjust `QEMU_VIRTFS_HOST_DIR` and
rebuild QEMU.
To mount host folder in QEMU, simply run:
......@@ -44,6 +45,12 @@ To mount host folder in QEMU, simply run:
```bash
$ mount_shared <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
*Important* Take into account that ICMP doesn't work in SLiRP mode,
so `ping` utility won't work.
[bios]: https://github.com/linaro-swg/bios_qemu_tz_arm
[README.md]: ../README.md
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment