aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/tests/qemu/Makefile
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-10-24 19:54:55 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-10-24 20:38:22 +0200
commitb5bf72d0f7ace28b3bb9cfe58d4b550159cb97f5 (patch)
tree8e2361b7284fc39fd0987bbb3eeb330af3106645 /src/tests/qemu/Makefile
parentqemu: allow for cross compilation (diff)
downloadwireguard-monolithic-historical-b5bf72d0f7ace28b3bb9cfe58d4b550159cb97f5.tar.xz
wireguard-monolithic-historical-b5bf72d0f7ace28b3bb9cfe58d4b550159cb97f5.zip
qemu: work around bogus QEMU virt ARM machinesjd/broken-arm-qemu-serial
The virt machine type in QEMU only supports one native serial port, which means we're forced to add in a whole PCI bus if we want to get any more information out. Bad situation. This should be reverted as soon as upstream QEMU does something about it.
Diffstat (limited to 'src/tests/qemu/Makefile')
-rw-r--r--src/tests/qemu/Makefile7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tests/qemu/Makefile b/src/tests/qemu/Makefile
index ae03f6a..4a8ca17 100644
--- a/src/tests/qemu/Makefile
+++ b/src/tests/qemu/Makefile
@@ -59,6 +59,8 @@ $(eval $(call tar_download,IPUTILS,iputils,s20161105,.tar.gz,https://github.com/
export CFLAGS ?= -O3 -pipe
export CPPFLAGS := -I$(BUILD_PATH)/include
+QEMU_SERIAL_PORTS := -serial stdio -serial file:$(BUILD_PATH)/result
+
ifeq ($(CHOST),$(CBUILD))
CROSS_COMPILE_FLAG := --host=$(CHOST)
CFLAGS += -march=native
@@ -77,6 +79,7 @@ else
QEMU_MACHINE := -cpu cortex-a53 -machine virt
CFLAGS += -march=armv8-a -mtune=cortex-a53
endif
+QEMU_SERIAL_PORTS := -device pci-serial-2x,chardev1=stdio,chardev2=result -chardev stdio,id=stdio -chardev file,path=$(BUILD_PATH)/result,id=result
else ifeq ($(ARCH),arm)
QEMU_ARCH := arm
KERNEL_ARCH := arm
@@ -87,6 +90,7 @@ else
QEMU_MACHINE := -cpu cortex-a15 -machine virt
CFLAGS += -march=armv7-a -mtune=cortex-a15 -mabi=aapcs-linux
endif
+QEMU_SERIAL_PORTS := -device pci-serial-2x,chardev1=stdio,chardev2=result -chardev stdio,id=stdio -chardev file,path=$(BUILD_PATH)/result,id=result
else ifeq ($(ARCH),x86_64)
QEMU_ARCH := x86_64
KERNEL_ARCH := x86_64
@@ -169,9 +173,8 @@ qemu: $(KERNEL_BZIMAGE)
-nographic \
-smp $(NR_CPUS) \
$(QEMU_MACHINE) \
+ $(QEMU_SERIAL_PORTS) \
-m 192M \
- -serial stdio \
- -serial file:$(BUILD_PATH)/result \
-no-reboot \
-monitor none \
-kernel $<