Migrate to new vmx.h's interrupt definitions, which makes it easier to grok from one code base to another. No functional change intended. Signed-off-by: Jon Kohler --- x86/vmx.h | 22 ---------------------- x86/vmx_tests.c | 12 ++++++------ 2 files changed, 6 insertions(+), 28 deletions(-) diff --git a/x86/vmx.h b/x86/vmx.h index 8bb49d8e..99ba7e52 100644 --- a/x86/vmx.h +++ b/x86/vmx.h @@ -406,31 +406,9 @@ enum Reason { VMX_XRSTORS = 64, }; -enum Intr_type { - VMX_INTR_TYPE_EXT_INTR = 0, - VMX_INTR_TYPE_NMI_INTR = 2, - VMX_INTR_TYPE_HARD_EXCEPTION = 3, - VMX_INTR_TYPE_SOFT_INTR = 4, - VMX_INTR_TYPE_SOFT_EXCEPTION = 6, -}; - -/* - * Interruption-information format - */ -#define INTR_INFO_VECTOR_MASK 0xff /* 7:0 */ -#define INTR_INFO_INTR_TYPE_MASK 0x700 /* 10:8 */ -#define INTR_INFO_DELIVER_CODE_MASK 0x800 /* 11 */ -#define INTR_INFO_UNBLOCK_NMI_MASK 0x1000 /* 12 */ -#define INTR_INFO_VALID_MASK 0x80000000 /* 31 */ #define INTR_INFO_INTR_TYPE_SHIFT 8 -/* - * Guest interruptibility state - */ -#define GUEST_INTR_STATE_MOVSS (1 << 1) -#define GUEST_INTR_STATE_ENCLAVE (1 << 4) - #define SAVE_GPR \ "xchg %rax, regs\n\t" \ diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c index 2f9858a3..338e39b0 100644 --- a/x86/vmx_tests.c +++ b/x86/vmx_tests.c @@ -1763,7 +1763,7 @@ static int interrupt_exit_handler(union exit_reason exit_reason) vmcs_write(GUEST_ACTV_STATE, ACTV_HLT); vmcs_write(ENT_INTR_INFO, TIMER_VECTOR | - (VMX_INTR_TYPE_EXT_INTR << INTR_INFO_INTR_TYPE_SHIFT) | + INTR_TYPE_EXT_INTR | INTR_INFO_VALID_MASK); break; } @@ -8803,7 +8803,7 @@ static void vmx_nmi_window_test(void) * is one byte.) */ report_prefix_push("active, blocking by MOV-SS"); - vmcs_write(GUEST_INTR_STATE, GUEST_INTR_STATE_MOVSS); + vmcs_write(GUEST_INTR_STATE, GUEST_INTR_STATE_MOV_SS); enter_guest(); verify_nmi_window_exit(nop_addr + 1); report_prefix_pop(); @@ -8969,7 +8969,7 @@ static void vmx_intr_window_test(void) * instruction. (NOP is one byte.) */ report_prefix_push("active, blocking by MOV-SS, RFLAGS.IF=1"); - vmcs_write(GUEST_INTR_STATE, GUEST_INTR_STATE_MOVSS); + vmcs_write(GUEST_INTR_STATE, GUEST_INTR_STATE_MOV_SS); enter_guest(); verify_intr_window_exit(nop_addr + 1); report_prefix_pop(); @@ -9479,7 +9479,7 @@ static void single_step_guest(const char *test_name, u64 starting_dr6, vmcs_write(GUEST_RFLAGS, X86_EFLAGS_FIXED | X86_EFLAGS_TF); if (pending_debug_exceptions) { vmcs_write(GUEST_PENDING_DEBUG, pending_debug_exceptions); - vmcs_write(GUEST_INTR_STATE, GUEST_INTR_STATE_MOVSS); + vmcs_write(GUEST_INTR_STATE, GUEST_INTR_STATE_MOV_SS); } enter_guest(); } @@ -10982,9 +10982,9 @@ static void handle_exception_in_l1(u32 vector) enter_guest(); if (vector == BP_VECTOR || vector == OF_VECTOR) - intr_type = VMX_INTR_TYPE_SOFT_EXCEPTION; + intr_type = EVENT_TYPE_SWEXC; else - intr_type = VMX_INTR_TYPE_HARD_EXCEPTION; + intr_type = EVENT_TYPE_HWEXC; intr_info = vmcs_read(EXI_INTR_INFO); report((vmcs_read(EXI_REASON) == VMX_EXC_NMI) && -- 2.43.0