From 73df85da4f7cf039568b41b70575e82b74106906 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Fri, 11 Sep 2026 11:20:16 +0100 Subject: [PATCH] x86: Rename X86_ET_EXT_INTR to X86_ET_INTR and fix function names The name X86_ET_EXT_INTR came from the VT-x code originally, but it's not really correct. The SDM doesn't give a concrete name, and only describes the fields as "external interrupts". The APM does give a concrete name of INTR, and both Intel and AMD use the name INTR for related purposes elsewhere; the name derives originally from #INTR which was a real pin on early processors. Very importantly, this is distinct from ExtINT which is a type of maskable interrupt which can be sent in an x86 system. Therefore rename all {svm,vmx}_*_extint() to {svm,vmx}_*_intr(), as they pertain to all maskable interrupts, not only to ExtINT interrupts. No functional change. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- xen/arch/x86/hvm/hvm.c | 2 +- xen/arch/x86/hvm/svm/intr.c | 6 +++--- xen/arch/x86/hvm/svm/svm.c | 2 +- xen/arch/x86/hvm/vmx/intr.c | 6 +++--- xen/arch/x86/hvm/vmx/vmx.c | 10 +++++----- xen/arch/x86/hvm/vmx/vvmx.c | 2 +- xen/arch/x86/include/asm/hvm/vmx/vmx.h | 2 +- xen/arch/x86/include/asm/x86-defns.h | 2 +- xen/arch/x86/traps.c | 6 +++--- xen/arch/x86/x86_emulate/x86_emulate.c | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 28f11a5292..192309c2fc 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -230,7 +230,7 @@ int hvm_event_needs_reinjection(uint8_t type, uint8_t vector) { switch ( type ) { - case X86_ET_EXT_INTR: + case X86_ET_INTR: case X86_ET_NMI: return 1; case X86_ET_HW_EXC: diff --git a/xen/arch/x86/hvm/svm/intr.c b/xen/arch/x86/hvm/svm/intr.c index cf0621d2f6..4b0debfa9a 100644 --- a/xen/arch/x86/hvm/svm/intr.c +++ b/xen/arch/x86/hvm/svm/intr.c @@ -55,14 +55,14 @@ static void svm_inject_nmi(struct vcpu *v) vmcb, general1_intercepts | GENERAL1_INTERCEPT_IRET); } -static void svm_inject_extint(struct vcpu *v, int vector) +static void svm_inject_intr(struct vcpu *v, int vector) { struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb; intinfo_t event; event.raw = 0; event.v = true; - event.type = X86_ET_EXT_INTR; + event.type = X86_ET_INTR; event.vector = vector; ASSERT(!vmcb->event_inj.v); @@ -225,7 +225,7 @@ void asmlinkage svm_intr_assist(void) else { TRACE(TRC_HVM_INJ_VIRQ, intack.vector, /*fake=*/ 0); - svm_inject_extint(v, intack.vector); + svm_inject_intr(v, intack.vector); pt_intr_post(v, intack); } diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index 5f5d903d87..b5fc459e62 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -2808,7 +2808,7 @@ void asmlinkage svm_vmexit_handler(void) vmcb->exit_int_info.vector == X86_EXC_OF ) break; /* Fallthrough */ - case X86_ET_EXT_INTR: + case X86_ET_INTR: case X86_ET_NMI: insn_len = 0; break; diff --git a/xen/arch/x86/hvm/vmx/intr.c b/xen/arch/x86/hvm/vmx/intr.c index a8ced95871..6c220c4c2e 100644 --- a/xen/arch/x86/hvm/vmx/intr.c +++ b/xen/arch/x86/hvm/vmx/intr.c @@ -182,7 +182,7 @@ static int nvmx_intr_intercept(struct vcpu *v, struct hvm_intack intack) if ( intack.source == hvm_intsrc_pic || intack.source == hvm_intsrc_lapic ) { - vmx_inject_extint(intack.vector, intack.source); + vmx_inject_intr(intack.vector, intack.source); ctrl = get_vvmcs(v, VM_EXIT_CONTROLS); if ( ctrl & VM_EXIT_ACK_INTR_ON_EXIT ) @@ -202,7 +202,7 @@ static int nvmx_intr_intercept(struct vcpu *v, struct hvm_intack intack) } else if ( intack.source == hvm_intsrc_vector ) { - vmx_inject_extint(intack.vector, intack.source); + vmx_inject_intr(intack.vector, intack.source); return 1; } } @@ -389,7 +389,7 @@ void asmlinkage vmx_intr_assist(void) else { TRACE(TRC_HVM_INJ_VIRQ, intack.vector, /*fake=*/ 0); - vmx_inject_extint(intack.vector, intack.source); + vmx_inject_intr(intack.vector, intack.source); pt_intr_post(v, intack); } diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index e55c90ce7f..7fa404878a 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -2022,7 +2022,7 @@ static void __vmx_inject_exception(int trap, int type, int error_code) curr->arch.hvm.vmx.vmx_emulate = 1; } -void vmx_inject_extint(int trap, uint8_t source) +void vmx_inject_intr(int trap, uint8_t source) { struct vcpu *v = current; u32 pin_based_cntrl; @@ -2032,13 +2032,13 @@ void vmx_inject_extint(int trap, uint8_t source) if ( pin_based_cntrl & PIN_BASED_EXT_INTR_MASK ) { nvmx_enqueue_n2_exceptions (v, INTR_INFO_VALID_MASK | - MASK_INSR(X86_ET_EXT_INTR, INTR_INFO_INTR_TYPE_MASK) | + MASK_INSR(X86_ET_INTR, INTR_INFO_INTR_TYPE_MASK) | MASK_INSR(trap, INTR_INFO_VECTOR_MASK), X86_EVENT_NO_EC, source); return; } } - __vmx_inject_exception(trap, X86_ET_EXT_INTR, X86_EVENT_NO_EC); + __vmx_inject_exception(trap, X86_ET_INTR, X86_EVENT_NO_EC); } void vmx_inject_nmi(void) @@ -3846,7 +3846,7 @@ gp_fault: return X86EMUL_EXCEPTION; } -static void vmx_do_extint(struct cpu_user_regs *regs) +static void vmx_do_intr(struct cpu_user_regs *regs) { unsigned long vector; @@ -4219,7 +4219,7 @@ void asmlinkage vmx_vmexit_handler(struct cpu_user_regs *regs) switch ( (uint16_t)exit_reason ) { case EXIT_REASON_EXTERNAL_INTERRUPT: - vmx_do_extint(regs); + vmx_do_intr(regs); break; case EXIT_REASON_EXCEPTION_NMI: __vmread(VM_EXIT_INTR_INFO, &intr_info); diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c index a5aa5eb163..e2407f07c2 100644 --- a/xen/arch/x86/hvm/vmx/vvmx.c +++ b/xen/arch/x86/hvm/vmx/vvmx.c @@ -1346,7 +1346,7 @@ static void sync_exception_state(struct vcpu *v) switch ( MASK_EXTR(nvmx->intr.intr_info, INTR_INFO_INTR_TYPE_MASK) ) { - case X86_ET_EXT_INTR: + case X86_ET_INTR: /* rename exit_reason to EXTERNAL_INTERRUPT */ set_vvmcs(v, VM_EXIT_REASON, EXIT_REASON_EXTERNAL_INTERRUPT); set_vvmcs(v, EXIT_QUALIFICATION, 0); diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h b/xen/arch/x86/include/asm/hvm/vmx/vmx.h index da04752e17..713d0900a9 100644 --- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h +++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h @@ -484,7 +484,7 @@ static inline void vpid_sync_all(void) int cf_check vmx_guest_x86_mode(struct vcpu *v); unsigned int vmx_get_cpl(void); -void vmx_inject_extint(int trap, uint8_t source); +void vmx_inject_intr(int trap, uint8_t source); void vmx_inject_nmi(void); void ept_walk_table(struct domain *d, unsigned long gfn); diff --git a/xen/arch/x86/include/asm/x86-defns.h b/xen/arch/x86/include/asm/x86-defns.h index cce0f4d990..c210e9e6e1 100644 --- a/xen/arch/x86/include/asm/x86-defns.h +++ b/xen/arch/x86/include/asm/x86-defns.h @@ -221,7 +221,7 @@ * These encodings were first used in VMCB/VMCS fields, but have become * architectural in the FRED spec. */ -#define X86_ET_EXT_INTR 0 /* External Interrupt */ +#define X86_ET_INTR 0 /* External Interrupt */ #define X86_ET_NMI 2 /* NMI */ #define X86_ET_HW_EXC 3 /* Hardware Exception (#PF/#GP/etc) */ #define X86_ET_SW_INT 4 /* Software Interrupt (INT $n) */ diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 1774966305..ac01ba0872 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -1041,7 +1041,7 @@ void show_execution_state_nmi(const cpumask_t *mask, bool show_all) static const char *x86_et_name(unsigned int type) { static const char *const names[] = { - [X86_ET_EXT_INTR] = "EXT_INTR", + [X86_ET_INTR] = "INTR", [X86_ET_NMI] = "NMI", [X86_ET_HW_EXC] = "HW_EXC", [X86_ET_SW_INT] = "SW_INT", @@ -2295,7 +2295,7 @@ void asmlinkage entry_from_pv(struct cpu_user_regs *regs) switch ( type ) { - case X86_ET_EXT_INTR: + case X86_ET_INTR: return do_IRQ(regs); case X86_ET_NMI: @@ -2606,7 +2606,7 @@ void asmlinkage entry_from_xen(struct cpu_user_regs *regs) switch ( type ) { - case X86_ET_EXT_INTR: + case X86_ET_INTR: return do_IRQ(regs); case X86_ET_NMI: diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c index 830ad90c9c..89c37fea2c 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -8691,7 +8691,7 @@ static void __init __maybe_unused build_assertions(void) BUILD_BUG_ON(x86_seg_gs != 5); /* Check X86_ET_* against VMCB EVENTINJ and VMCS INTR_INFO type fields. */ - BUILD_BUG_ON(X86_ET_EXT_INTR != 0); + BUILD_BUG_ON(X86_ET_INTR != 0); BUILD_BUG_ON(X86_ET_NMI != 2); BUILD_BUG_ON(X86_ET_HW_EXC != 3); BUILD_BUG_ON(X86_ET_SW_INT != 4);