README 2.1 KB
Newer Older
Andrew Jones's avatar
Andrew Jones committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

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

Examples of a test invocation:
 These invocations run the msr test case and outputs to stdio.

 Using qemu-kvm:

	qemu-kvm -device testdev,chardev=testlog \
		 -chardev file,id=testlog,path=msr.out \
		 -serial stdio -kernel ./x86/msr.flat

 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

24
Tests in this directory and what they do:
Andrew Jones's avatar
Andrew Jones committed
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 access:	lots of page table related access (pte/pde) (read/write)
 apic:		enable x2apic, self ipi, ioapic intr, ioapic simultaneous
 emulator:	move to/from regs, cmps, push, pop, to/from cr8, smsw and lmsw
 hypercall:	intel and amd hypercall insn
 msr:		write to msr (only KERNEL_GS_BASE for now)
 port80:	lots of out to port 80
 realmode:	goes back to realmode, shld, push/pop, mov immediate, cmp
		immediate, add immediate, io, eflags instructions
		(clc, cli, etc.), jcc short, jcc near, call, long jmp, xchg
 sieve:		heavy memory access with no paging and with paging static and
		with paging vmalloc'ed
 smptest:	run smp_id() on every cpu and compares return value to number
 tsc:		write to tsc(0) and write to tsc(100000000000) and read it back
 vmexit:	long loops for each: cpuid, vmcall, mov_from_cr8, mov_to_cr8,
		inl_pmtimer, ipi, ipi+halt
 kvmclock_test:	test of wallclock, monotonic cycle and performance of kvmclock
 pcid:		basic functionality test of PCID/INVPCID feature
42

Andrew Jones's avatar
Andrew Jones committed
43
44
45
46
47
Legacy notes:
 The exit status of the binary (and the script) is inconsistent: with
 qemu-system, after the unit-test is done, the exit status of qemu is 1,
 different from the 'old style' qemu-kvm, whose exit status in successful
 completion is 0.