README 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. Tests for the x86 architecture are run as kernel images for qemu that support
  2. multiboot format. The tests use an infrastructure called from the bios code.
  3. The infrastructure initialize the system/cpus, switches to long-mode, and
  4. calls the 'main' function of the individual test. Tests use a qemu virtual
  5. test device, named testdev, for services like printing, exiting, querying
  6. memory size, etc. See file docs/testdev.txt for more details.
  7. Examples of a test invocation:
  8. These invocations run the msr test case and outputs to stdio.
  9. Using qemu-kvm:
  10. qemu-kvm -device testdev,chardev=testlog \
  11. -chardev file,id=testlog,path=msr.out \
  12. -serial stdio -kernel ./x86/msr.flat
  13. Using qemu (supported since qemu 1.3):
  14. qemu-system-x86_64 -enable-kvm -device pc-testdev -serial stdio \
  15. -device isa-debug-exit,iobase=0xf4,iosize=0x4 \
  16. -kernel ./x86/msr.flat
  17. Tests in this directory and what they do:
  18. access: lots of page table related access (pte/pde) (read/write)
  19. apic: enable x2apic, self ipi, ioapic intr, ioapic simultaneous
  20. emulator: move to/from regs, cmps, push, pop, to/from cr8, smsw and lmsw
  21. hypercall: intel and amd hypercall insn
  22. msr: write to msr (only KERNEL_GS_BASE for now)
  23. port80: lots of out to port 80
  24. realmode: goes back to realmode, shld, push/pop, mov immediate, cmp
  25. immediate, add immediate, io, eflags instructions
  26. (clc, cli, etc.), jcc short, jcc near, call, long jmp, xchg
  27. sieve: heavy memory access with no paging and with paging static and
  28. with paging vmalloc'ed
  29. smptest: run smp_id() on every cpu and compares return value to number
  30. tsc: write to tsc(0) and write to tsc(100000000000) and read it back
  31. vmexit: long loops for each: cpuid, vmcall, mov_from_cr8, mov_to_cr8,
  32. inl_pmtimer, ipi, ipi+halt
  33. kvmclock_test: test of wallclock, monotonic cycle and performance of kvmclock
  34. pcid: basic functionality test of PCID/INVPCID feature
  35. Legacy notes:
  36. The exit status of the binary is inconsistent; with qemu-system, after
  37. the unit-test is done, the exit status of qemu is 1, different from the
  38. 'old style' qemu-kvm, whose exit status in successful completion is 0.
  39. The run script converts the qemu-system exit status to 0 (SUCCESS), and
  40. treats the legacy exit status of 0 as an error, converting it to an exit
  41. status of 1.