README 1.86 KB
Newer Older
1
2
3
4
5
6
7
8
9
This directory contains sources for a kvm test suite.

Tests for x86 architecture are run as kernel images for qemu that supports multiboot format.
Tests uses an infrastructure called from the bios code. The infrastructure initialize the system/cpu's,
switch to long-mode and calls the 'main' function of the individual test.
Tests uses a qemu's virtual test device, named testdev, for services like printing, exiting, query memory size etc.
See file testdev.txt for more details.

To create the tests' images just type 'make' in this directory.
Jason Wang's avatar
Jason Wang committed
10
Tests' images created in ./<ARCH>/*.flat
11
12

An example of a test invocation:
13
14
15
Using qemu-kvm:

qemu-kvm -device testdev,chardev=testlog -chardev file,id=testlog,path=msr.out -serial stdio -kernel ./x86/msr.flat
16
This invocation runs the msr test case. The test outputs to stdio.
17

18
19
20
Using qemu (supported since qemu 1.3):
qemu-system-x86_64 -enable-kvm -device pc-testdev -serial stdio -device isa-debug-exit,iobase=0xf4,iosize=0x4 -kernel ./x86/msr.flat

21
22
23
24
Note that it's not necessary to specify the "-m" option to qemu. The default
memory size is enough. Actually, the tests infrastructure doesn't support too
much RAM anyway, so specifying a large amount of RAM may break it.

25
26
27
28
Or use a runner script to detect the correct invocation:
./x86-run ./x86/msr.flat
To select a specific qemu binary, specify the QEMU=<path> environment:
QEMU=/tmp/qemu/x86_64-softmmu/qemu-system-x86_64 ./x86-run ./x86/msr.flat
29

30
31
32
33
The exit status of the binary (and the script) is inconsistent: with
qemu-system, after the unittest is done, the exit status of qemu is 1,
different from the 'old style' qemu-kvm, whose exit status in successful
completion is 0.
34
35
36

Directory structure:
.:  Makefile and config files for the tests
Jason Wang's avatar
Jason Wang committed
37
38
39
./lib: general services for the tests
./lib/<ARCH>: architecture dependent services for the tests
./<ARCH>: the sources of the tests and the created objects/images
40