Build requirements:
- GNU Make >= 3.81
+For x86:
- GNU compatible compiler, capable of:
-std=gnu99
-m64 and -m32
+For arm64/arm32:
+-when cross-compiling:
+ - GNU compatible cross-compiler toolchain for Aarch64/Aarch32
+-when building natively:
+ - GNU compatible toolchain for Aarch64/Aarch32
+
+To build XTF:
+-for x86:
+ $ make
+-for arm64 natively:
+ $ make ARCH=arm64
+-for arm64 when cross compiling:
+ $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
+-for arm32 natively:
+ $ make ARCH=arm32
+-for arm32 when cross compiling:
+ $ make ARCH=arm32 CROSS_COMPILE=arm-linux-gnueabi-
xtftestdir := $(xtfdir)/tests
# Supported architectures
-SUPPORTED_ARCH := x86
+SUPPORTED_ARCH := x86 arm64 arm32
# Default architecture
ARCH ?= x86
# Check if specified architecture is supported
export CC LD CPP INSTALL INSTALL_DATA INSTALL_DIR INSTALL_PROGRAM OBJCOPY PYTHON
+# Some tests are architecture specific. In this case we can have a list of tests
+# supported by a given architecture in $(ROOT)/build/$(ARCH)/arch-tests.mk
+-include $(ROOT)/build/$(ARCH)/arch-tests.mk
+
# By default enable all the tests
TESTS ?= $(wildcard tests/*)
microkernels, to test the same functionality from different types of virtual
machine.
+Currently there are 3 architectures available: x86, arm64 and arm32 although
+only x86 is truly supported. Initial support for arm64 and arm32 is added
+allowing to run a startup code based on the test: tests/example.
+This creates a base for future implementation.
+
## The framework consists of:
* PV and HVM, 32 and 64 bit entry points
* Hypercall interface
* PV console driver (output)
* Common reporting framework
+* Initial support for arm64/arm32 (startup code running)
## TODO List:
--- /dev/null
+# Common makefile for arm
+
+# Compilation recipe
+# arm needs linking normally, then converting to a binary format
+define build-$(ARCH)
+ $(LD) $$(LDFLAGS_$(ARCH)) $$(DEPS-$(ARCH)) -o $$@-syms
+ $(OBJCOPY) $$@-syms -O binary $$@
+endef
--- /dev/null
+# Common files compiled and linked for arm
+
+# obj-perenv += $(ROOT)/common/console.o
+# obj-perenv += $(ROOT)/common/lib.o
+# obj-perenv += $(ROOT)/common/libc/stdio.o
+# obj-perenv += $(ROOT)/common/libc/string.o
+# obj-perenv += $(ROOT)/common/libc/vsnprintf.o
+# obj-perenv += $(ROOT)/common/report.o
+# obj-perenv += $(ROOT)/common/setup.o
+# obj-perenv += $(ROOT)/common/xenbus.o
+# obj-perenv += $(ROOT)/common/weak-defaults.o
+
+# obj-perenv += $(ROOT)/arch/arm/setup.o
--- /dev/null
+# Architecture specific configuration for arm32
+
+ARCH_PATH := $(ROOT)/arch/arm
+ALL_ENVIRONMENTS := arm32
+
+arm32_arch := arm32
+arm32_guest := arm32
+defcfg-arm32 := $(ROOT)/config/default-arm.cfg.in
+
+COMMON_CFLAGS += -marm -march=armv7ve+fp
+
+# Include arm common makefile
+include $(ROOT)/build/arm-common/arch-common.mk
--- /dev/null
+# Architecture specific files compiled and linked for arm32
+
+# Include arm common files
+include $(ROOT)/build/arm-common/arch-files.mk
+
+# Specific files for arm32
+obj-perenv += $(ROOT)/arch/arm/arm32/head.o
--- /dev/null
+# Supported tests by arm32
+
+# Currently only example test is supported
+TESTS := $(ROOT)/tests/stubarm
--- /dev/null
+# Architecture specific configuration for arm64
+
+ARCH_PATH := $(ROOT)/arch/arm
+ALL_ENVIRONMENTS := arm64
+
+arm64_arch := arm64
+arm64_guest := arm64
+defcfg-arm64 := $(ROOT)/config/default-arm.cfg.in
+
+COMMON_CFLAGS += -march=armv8-a
+
+# Include arm common makefile
+include $(ROOT)/build/arm-common/arch-common.mk
--- /dev/null
+# Architecture specific files compiled and linked for arm64
+
+# Include arm common files
+include $(ROOT)/build/arm-common/arch-files.mk
+
+# Specific files for arm64
+obj-perenv += $(ROOT)/arch/arm/arm64/head.o
--- /dev/null
+# Supported tests by arm64
+
+# Currently only example test is supported
+TESTS := $(ROOT)/tests/stubarm
--- /dev/null
+name="test-@@ENV@@-@@NAME@@@@VARIATION@@"
+
+vcpus=@@VCPUS@@
+
+memory=128
+kernel="@@XTFDIR@@/tests/@@NAME@@/test-@@ENV@@-@@NAME@@"
A test is built for one or more environments. The environment encodes:
+For x86 architecture:
- The Xen VM ABI in use (PV or HVM).
- The compilation width (32bit or 64bit).
- The primary paging mode (none, PSE, PAE).
-All available environments are:
+For arm64/arm32 there is currently a single environment called arm64/arm32.
+
+All available environments for x86 are:
+@dontinclude build/x86/arch-common.mk
@skipline ALL_ENVIRONMENTS
-Some more specific collections for environments are also available:
+Some more specific collections for x86 environments are also available:
@skipline PV_ENVIRONMENTS
@until 64BIT_ENVIRONMENTS
+All available environments for arm64 are:
+@dontinclude build/arm64/arch-common.mk
+@skipline ALL_ENVIRONMENTS
+
+All available environments for arm32 are:
+@dontinclude build/arm32/arch-common.mk
+@skipline ALL_ENVIRONMENTS
+
An individual test, compiled for more than one environment, will end up with a
individual microkernel binary for each specified environment.
easy to write code once and compile it for multiple different environments
(virtual machines).
+Currently there are 3 architectures available: x86, arm64 and arm32 although
+only x86 is truly supported. Initial support for arm64 and arm32 is added
+allowing to run a startup code based on the test: tests/example.
+This creates a base for future implementation.
+
The current environments supported are:
+x86:
Environment | Guest | Width | Paging
:-----------|:------|:------|:---------
`pv32pae` | PV | 32bit | PAE
`hvm32pae` | HVM | 32bit | PAE
`hvm64` | HVM | 64bit | Long mode
+arm64:
+Environment | Guest | Width | Paging
+:-----------|:------|:------|:----------------
+`arm64` | arm64 | 64bit | Currently no MMU
+
+arm32:
+Environment | Guest | Width | Paging
+:-----------|:------|:------|:----------------
+`arm32` | arm32 | 32bit | Currently no MMU
@section getting-started Getting Started
`elf32-i386` will be used which will load correctly, but disassemble
incorrectly.
+For arm64/arm32:
+-when cross-compiling:
+ - GNU compatible cross-compiler toolchain for Aarch64/Aarch32
+-when building natively:
+ - GNU compatible toolchain for Aarch64/Aarch32
+
To obtain and build:
$ git clone git://xenbits.xen.org/xtf.git
$ cd xtf
+ # To build for x86:
$ make -j4
+ # To build for arm64 natively:
+ $ make ARCH=arm64
+ # To build for arm32 natively:
+ $ make ARCH=arm32
+ # To build for arm64 when cross compiling:
+ $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
+ # To build for arm32 when cross compiling:
+ $ make ARCH=arm32 CROSS_COMPILE=arm-linux-gnueabi-
To run tests on a Xen host: (see @ref errata first)