Skip to content

task switch and event injection tests

Gleb Natapov kvm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest16 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16Move idt.c into lib code.config-x86-common.mak lib/x86/idt.c lib/x86/idt.h +1 more+164 -1510 replies
2/16Make access.c use library functions.x86/access.c+5 -870 replies
3/16Remove duplicated idt code from apic test.x86/apic.c+11 -380 replies
4/16Remove unused function from apic test.x86/apic.c+0 -50 replies
5/16Rename idt.[ch] into desc.[ch]config-x86-common.mak lib/x86/desc.c lib/x86/desc.h +7 more+185 -1851 reply
6/16Specify correct operand length for ltr and str.lib/x86/processor.h+2 -24 replies
7/16Move irq_(enable|disable) into library code.lib/x86/processor.h x86/apic.c+10 -100 replies
8/16Add another task switch test.config-i386.mak lib/x86/desc.c lib/x86/desc.h +1 more+372 -10 replies
9/16Move vm.[ch] info library code.config-x86-common.mak lib/x86/vm.c lib/x86/vm.h +2 more+281 -2830 replies
10/16Fix mmu on 32 bit.lib/x86/vm.c+31 -110 replies
11/16Set WP bit in CR0 to make write protection work.lib/x86/vm.c+2 -10 replies
12/16Fix exception handling on i386 arch.lib/x86/desc.c+7 -00 replies
13/16Move handle_irq() from apic test into library code.config-x86-common.mak lib/x86/isr.c lib/x86/isr.h +1 more+115 -990 replies
14/16Add handle_exception() interface.lib/x86/desc.c lib/x86/desc.h+103 -380 replies
15/16Move invlpg() into library code.lib/x86/processor.h x86/access.c+4 -50 replies
16/16Add even injection test.config-x86-common.mak lib/x86/desc.c lib/x86/desc.h +3 more+391 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH unit-tests 00/16] task switch and event injection tests

Long time ago I wrote a mini guest to test various interesting task switch and even injection scenarios. This is the port of the test cases to unit test framework.

Gleb Natapov (16):
Move idt.c into lib code.
Make access.c use library functions.
Remove duplicated idt code from apic test. Remove unused function from apic test. Rename idt.[ch] into desc.[ch]
Specify correct operand length for ltr and str. Move irq_(enable|disable) into library code. Add another task switch test.
Move vm.[ch] info library code.
Fix mmu on 32 bit.
Set WP bit in CR0 to make write protection work. Fix exception handling on i386 arch.
Move handle_irq() from apic test into library code. Add handle_exception() interface.
Move invlpg() into library code.
Add even injection test.

 config-i386.mak       |    3 +-
 config-x86-common.mak |   24 ++--
 lib/x86/desc.c        |  393 +++++++++++++++++++++++++++++++++++++++++++++++++
 lib/x86/desc.h        |   51 +++++++
 lib/x86/idt.h         |   19 ---
 lib/x86/isr.c         |   99 +++++++++++++
 lib/x86/isr.h         |   14 ++
 lib/x86/processor.h   |   18 ++-
 lib/x86/vm.c          |  256 ++++++++++++++++++++++++++++++++
 lib/x86/vm.h          |   47 ++++++
 x86/access.c          |   97 +------------
 x86/apic.c            |  156 +-------------------
 x86/emulator.c        |    2 +-
 x86/eventinj.c        |  372 ++++++++++++++++++++++++++++++++++++++++++++++
 x86/idt.c             |  148 -------------------
 x86/idt_test.c        |    2 +-
 x86/taskswitch2.c     |  185 +++++++++++++++++++++++
 x86/vm.c              |  229 ----------------------------
 x86/vm.h              |   46 ------
 x86/xsave.c           |    2 +-
 20 files changed, 1464 insertions(+), 699 deletions(-)
 create mode 100644 lib/x86/desc.c
 create mode 100644 lib/x86/desc.h
 delete mode 100644 lib/x86/idt.h
 create mode 100644 lib/x86/isr.c
 create mode 100644 lib/x86/isr.h
 create mode 100644 lib/x86/vm.c
 create mode 100644 lib/x86/vm.h
 create mode 100644 x86/eventinj.c
 delete mode 100644 x86/idt.c
 create mode 100644 x86/taskswitch2.c
 delete mode 100644 x86/vm.c
 delete mode 100644 x86/vm.h
Signature · 1 line
1.7.2.3