Xen Test Framework
|
Tests for the exception frame generated from emulated software interrupt instructions, in situations which will results in traps and faults.
This test requires a debug Xen, booted with "hvm_fep"
to allow the test to directly invoke the x86 instruction emulator.
Each of the following instructions are tested:
int3
(0xcc
)int $3
(0xcd 0x03
)icebp
(0xf1
)int $1
(0xcd 0x01
)into
(0xce
)with and without a redundant prefix (address size override specifically, as it has no effect on instructs like these). Each combination is executed both normally, and via the instruction emulator, to confirm that hardware and the instruction emulator are behaving identically.
Injection of software interrupts by Xen is complicated by differing available of hardware support. Intel VT-x and AMD SVM (both with and without NextRIP support) all provide different levels of hardware support, which affects how much Xen must emulate in software to cause the guest to observe architectural behaviour.
Each instruction/prefix combination is executed in the following conditions:
icebp
)Handling of into
is more complicated. In 32bit it is tested as normal, but the instruction isn't recognised in 64bit. Instead, it is just tested to unconditionally generate a #UD fault.
In all cases, the exception frame is verified to be correct.