1#include <xtf/extable.h>
2#include <xtf/asm_macros.h>
3#include <xen/arch-x86/xen.h>
4#include <arch/processor.h>
6 /* Macro to generate a single test function. */
7 /* See lowlevel.h for a description of nomenclature. */
8.macro GEN_SINGLE name, insn, fep=0, addr=0
15 /* Ensure the overflow flag is set, to trigger 'into'. */
20 /* Possibly insert a Xen Forced Emulation prefix. */
28 * Possibly insert a redundant prefix.
30 * Uses 'address size override' which has no effect on any of the
31 * target instructions, but in a form which GAS won't complain about.
37 /* Target instruction to test. */
42 .byte 0xcd, 0x03 /* Some assembers turn `int $3` into `int3`. */
51 .byte 0xce /* Raw opcode to avoid failure in 64bit build. */
58 _ASM_EXTABLE_HANDLER(.L_\name\()_fault, .L_\name\()_trap, ex_record_fault_eax)
59 _ASM_EXTABLE_HANDLER(.L_\name\()_trap, .L_\name\()_trap, ex_record_trap_eax)
61ENDFUNC(stub_\name\())
64 /* For a single instruction, generate each test variant. */
65.macro GEN_SEQUENCE user insn
66 GEN_SINGLE \user\()\insn \insn
67 GEN_SINGLE \user\()\insn\()_A \insn addr=1
68 GEN_SINGLE \user\()\insn\()_F \insn fep=1
69 GEN_SINGLE \user\()\insn\()_FA \insn fep=1 addr=1
72 /* Generate test sequences for each instruction. */
79.pushsection .text.user, "ax", @progbits
81GEN_SEQUENCE user_ int3
82GEN_SEQUENCE user_ int_0x3
83GEN_SEQUENCE user_ icebp
84GEN_SEQUENCE user_ int_0x1
85GEN_SEQUENCE user_ into
92 * indent-tabs-mode: nil