From patchwork Thu Nov 10 06:15:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Xin3" X-Patchwork-Id: 13038333 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A1DDC4332F for ; Thu, 10 Nov 2022 06:39:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232360AbiKJGjT (ORCPT ); Thu, 10 Nov 2022 01:39:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232269AbiKJGjR (ORCPT ); Thu, 10 Nov 2022 01:39:17 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D3A113E24; Wed, 9 Nov 2022 22:39:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668062357; x=1699598357; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1ciQPXm/Sal2C1n/qXvgFnHDwndHE3vgyvJaW4yWXlY=; b=l0ltCQAulhV54S19UBjGh4mql6NT2dh/N6c2O1lPxtmIiz3dIw+GPL3N 6rmEVPAr+hm3tYLFkPzzYeUXV099XgA/hAwNWP7gS/99s6frcrGHRI0pK nRGubC0hEnsLC7fc1IUxUU77WlbEfx8/hNN8o/wvya/bwA4wurx8ZS7xz thtbjTFzUASp3rD0GDxtxZykQ79SlrNeFCOlYNv5r2KkYI7HtBl3T2M2k NpNGHzNz35LQpTQ9ke1kMqOMUKqYuiBtHttYk55OTxTUdJMJnM5EUF8xZ wxABjwBJWpWJU1mgb3nT1IyDqCEoruHCFB3Puvpw0RUZTUk5XFZL0yYQ7 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="375473999" X-IronPort-AV: E=Sophos;i="5.96,153,1665471600"; d="scan'208";a="375473999" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2022 22:39:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="588057205" X-IronPort-AV: E=Sophos;i="5.96,153,1665471600"; d="scan'208";a="588057205" Received: from unknown (HELO fred..) ([172.25.112.68]) by orsmga003.jf.intel.com with ESMTP; 09 Nov 2022 22:39:15 -0800 From: Xin Li To: linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, seanjc@google.com, pbonzini@redhat.com, kevin.tian@intel.com Subject: [RESEND PATCH 1/6] x86/traps: let common_interrupt() handle IRQ_MOVE_CLEANUP_VECTOR Date: Wed, 9 Nov 2022 22:15:40 -0800 Message-Id: <20221110061545.1531-2-xin3.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221110061545.1531-1-xin3.li@intel.com> References: <20221110061545.1531-1-xin3.li@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: "H. Peter Anvin (Intel)" IRQ_MOVE_CLEANUP_VECTOR is the only one of the system IRQ vectors that is *below* FIRST_SYSTEM_VECTOR. It is a slow path, so just push it into common_interrupt() just before the spurios interrupt handling. Signed-off-by: H. Peter Anvin (Intel) Signed-off-by: Xin Li --- arch/x86/kernel/irq.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index 766ffe3ba313..7e125fff45ab 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c @@ -248,6 +248,10 @@ DEFINE_IDTENTRY_IRQ(common_interrupt) desc = __this_cpu_read(vector_irq[vector]); if (likely(!IS_ERR_OR_NULL(desc))) { handle_irq(desc, regs); +#ifdef CONFIG_SMP + } else if (vector == IRQ_MOVE_CLEANUP_VECTOR) { + sysvec_irq_move_cleanup(regs); +#endif } else { ack_APIC_irq(); From patchwork Thu Nov 10 06:15:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Xin3" X-Patchwork-Id: 13038334 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87D52C43217 for ; Thu, 10 Nov 2022 06:39:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232548AbiKJGjW (ORCPT ); Thu, 10 Nov 2022 01:39:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232529AbiKJGjU (ORCPT ); Thu, 10 Nov 2022 01:39:20 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C06B29C91; Wed, 9 Nov 2022 22:39:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668062359; x=1699598359; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fNThYHDmqBlYOeK5UL+m4NKHtKLRQgciD55ArNLCN84=; b=idBducjoIPmUfiMZcmDeLIoFAcqGezowW9w1zRjUxLu7PHNJeecinjT0 iK7yIxV837xWQHptQiYXyNxBYYkxO75SyjHdkhLszvigNvshBqPoH9y9V peB7rEJO5h1nLs75df9ZXyo8qwIOTiFdXswtR2ankb4gm5weB/yiaLA0+ V7mE+cs6IZMUb8YNkUpF4KoiSJpSLKvXlF9ZHwGFjqB/1HHPu1D02DH5q +CAPp0ra1VUR6v3Em14TC1jRLS/fOTx5v+hFd/7ky6gqdFlgtL0Isntmi Fo1wlW1zYBC6x1YkGMdvmCxsPR8WfCJ3yhJNr8Ine60taxLN9jM9mpTi7 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="375474001" X-IronPort-AV: E=Sophos;i="5.96,153,1665471600"; d="scan'208";a="375474001" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2022 22:39:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="588057209" X-IronPort-AV: E=Sophos;i="5.96,153,1665471600"; d="scan'208";a="588057209" Received: from unknown (HELO fred..) ([172.25.112.68]) by orsmga003.jf.intel.com with ESMTP; 09 Nov 2022 22:39:17 -0800 From: Xin Li To: linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, seanjc@google.com, pbonzini@redhat.com, kevin.tian@intel.com Subject: [RESEND PATCH 2/6] x86/traps: add a system interrupt table for system interrupt dispatch Date: Wed, 9 Nov 2022 22:15:41 -0800 Message-Id: <20221110061545.1531-3-xin3.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221110061545.1531-1-xin3.li@intel.com> References: <20221110061545.1531-1-xin3.li@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Upon receiving an external interrupt, KVM VMX reinjects it through calling the interrupt handler in its IDT descriptor on the current kernel stack, which essentially uses the IDT as an interrupt dispatch table. However the IDT is one of the lowest level critical data structures between a x86 CPU and the Linux kernel, we should avoid using it *directly* whenever possible, espeically in a software defined manner. On x86, external interrupts are divided into the following groups 1) system interrupts 2) external device interrupts With the IDT, system interrupts are dispatched through the IDT directly, while external device interrupts are all routed to the external interrupt dispatch function common_interrupt(), which dispatches external device interrupts through a per-CPU external interrupt dispatch table vector_irq. To eliminate dispatching external interrupts through the IDT, add a system interrupt handler table for dispatching a system interrupt to its corresponding handler directly. Thus a software based dispatch function will be: void external_interrupt(struct pt_regs *regs, u8 vector) { if (is_system_interrupt(vector)) system_interrupt_handler_table[vector_to_sysvec(vector)](regs); else /* external device interrupt */ common_interrupt(regs, vector); } What's more, with the Intel FRED (Flexible Return and Event Delivery) architecture, IDT, the hardware based event dispatch table, is gone, and the Linux kernel needs to dispatch events to their handlers with vector to handler mappings, the dispatch function external_interrupt() is also needed. Signed-off-by: H. Peter Anvin (Intel) Signed-off-by: Xin Li --- arch/x86/include/asm/traps.h | 8 ++++++ arch/x86/kernel/traps.c | 55 ++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/arch/x86/include/asm/traps.h b/arch/x86/include/asm/traps.h index 47ecfff2c83d..3dc63d753bda 100644 --- a/arch/x86/include/asm/traps.h +++ b/arch/x86/include/asm/traps.h @@ -47,4 +47,12 @@ void __noreturn handle_stack_overflow(struct pt_regs *regs, struct stack_info *info); #endif +/* + * How system interrupt handlers are called. + */ +#define DECLARE_SYSTEM_INTERRUPT_HANDLER(f) \ + void f (struct pt_regs *regs __maybe_unused, \ + unsigned long vector __maybe_unused) +typedef DECLARE_SYSTEM_INTERRUPT_HANDLER((*system_interrupt_handler)); + #endif /* _ASM_X86_TRAPS_H */ diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index 178015a820f0..95dd917ef9ad 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c @@ -1444,6 +1444,61 @@ DEFINE_IDTENTRY_SW(iret_error) } #endif +#define SYSV(x,y) [(x) - FIRST_SYSTEM_VECTOR] = (system_interrupt_handler)y + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-function-type" + +/* + * The initializer spurious_interrupt() has two arguments of types struct + * pt_regs * and unsigned long, and the system interrupt handlers with + * prefix sysvec_ are all defined with either DEFINE_IDTENTRY_SYSVEC or + * DEFINE_IDTENTRY_SYSVEC_SIMPLE, both with only one argument of type + * struct pt_regs *. Because all handlers only declare and require a subset + * of the arguments provided by the full system_interrupt_handler prototype, + * the function type cast is safe here. + */ +const system_interrupt_handler system_interrupt_handler_table[NR_SYSTEM_VECTORS] = { + [0 ... NR_SYSTEM_VECTORS-1] = spurious_interrupt, +#ifdef CONFIG_SMP + SYSV(RESCHEDULE_VECTOR, sysvec_reschedule_ipi), + SYSV(CALL_FUNCTION_VECTOR, sysvec_call_function), + SYSV(CALL_FUNCTION_SINGLE_VECTOR, sysvec_call_function_single), + SYSV(REBOOT_VECTOR, sysvec_reboot), +#endif + +#ifdef CONFIG_X86_THERMAL_VECTOR + SYSV(THERMAL_APIC_VECTOR, sysvec_thermal), +#endif + +#ifdef CONFIG_X86_MCE_THRESHOLD + SYSV(THRESHOLD_APIC_VECTOR, sysvec_threshold), +#endif + +#ifdef CONFIG_X86_MCE_AMD + SYSV(DEFERRED_ERROR_VECTOR, sysvec_deferred_error), +#endif + +#ifdef CONFIG_X86_LOCAL_APIC + SYSV(LOCAL_TIMER_VECTOR, sysvec_apic_timer_interrupt), + SYSV(X86_PLATFORM_IPI_VECTOR, sysvec_x86_platform_ipi), +# ifdef CONFIG_HAVE_KVM + SYSV(POSTED_INTR_VECTOR, sysvec_kvm_posted_intr_ipi), + SYSV(POSTED_INTR_WAKEUP_VECTOR, sysvec_kvm_posted_intr_wakeup_ipi), + SYSV(POSTED_INTR_NESTED_VECTOR, sysvec_kvm_posted_intr_nested_ipi), +# endif +# ifdef CONFIG_IRQ_WORK + SYSV(IRQ_WORK_VECTOR, sysvec_irq_work), +# endif + SYSV(SPURIOUS_APIC_VECTOR, sysvec_spurious_apic_interrupt), + SYSV(ERROR_APIC_VECTOR, sysvec_error_interrupt), +#endif +}; + +#pragma GCC diagnostic pop + +#undef SYSV + void __init trap_init(void) { /* Init cpu_entry_area before IST entries are set up */ From patchwork Thu Nov 10 06:15:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Xin3" X-Patchwork-Id: 13038335 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0575C433FE for ; Thu, 10 Nov 2022 06:39:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232555AbiKJGja (ORCPT ); Thu, 10 Nov 2022 01:39:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232545AbiKJGjW (ORCPT ); Thu, 10 Nov 2022 01:39:22 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3688F13E24; Wed, 9 Nov 2022 22:39:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668062361; x=1699598361; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=brgRBFcFOhRItxFd22b/yhKeQsd3gT3Cd/ce66ahZHI=; b=AgjBGFIzlpG14pNGJcn2poDcpr0QU70mu+SAO612DY5cQkJPQ02MQ0nC NDwpUu56r87XXIRXfd66GhVItOBL5o0S92FcSz0dYBf3ttQTYJScLpH3+ 6JNYsVgg6SGGuDOJEmjpvZHr81sLnKF6XAm8030C7z9/MEA46bY6guWsW 7fbHvRfoQilPXWMchGkQPsNRvtRHonXUlUfdIIwaluOOSklcz6cd+52Zw WZniAdqB8iBWbjnaPA+ljGfdFmHDBOr154u7hmaFbDP0NWxPdiNUh9dXJ ZK7xZNz7wbXd4OH/VXK8ZMdCSGX6Xth3q1fUcI/NMquYAD8Z0boeVIaj5 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="375474003" X-IronPort-AV: E=Sophos;i="5.96,153,1665471600"; d="scan'208";a="375474003" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2022 22:39:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="588057224" X-IronPort-AV: E=Sophos;i="5.96,153,1665471600"; d="scan'208";a="588057224" Received: from unknown (HELO fred..) ([172.25.112.68]) by orsmga003.jf.intel.com with ESMTP; 09 Nov 2022 22:39:19 -0800 From: Xin Li To: linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, seanjc@google.com, pbonzini@redhat.com, kevin.tian@intel.com Subject: [RESEND PATCH 3/6] x86/traps: add install_system_interrupt_handler() Date: Wed, 9 Nov 2022 22:15:42 -0800 Message-Id: <20221110061545.1531-4-xin3.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221110061545.1531-1-xin3.li@intel.com> References: <20221110061545.1531-1-xin3.li@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Some kernel components install system interrupt handlers into the IDT, and we need to do the same for system_interrupt_handler_table. A new function install_system_interrupt_handler() is added to install a system interrupt handler into both the IDT and system_interrupt_handler_table. Signed-off-by: H. Peter Anvin (Intel) Signed-off-by: Xin Li --- arch/x86/include/asm/traps.h | 2 ++ arch/x86/kernel/cpu/acrn.c | 7 +++++-- arch/x86/kernel/cpu/mshyperv.c | 22 ++++++++++++++-------- arch/x86/kernel/kvm.c | 4 +++- arch/x86/kernel/traps.c | 10 +++++++++- drivers/xen/events/events_base.c | 5 ++++- 6 files changed, 37 insertions(+), 13 deletions(-) diff --git a/arch/x86/include/asm/traps.h b/arch/x86/include/asm/traps.h index 3dc63d753bda..89c4233e19db 100644 --- a/arch/x86/include/asm/traps.h +++ b/arch/x86/include/asm/traps.h @@ -41,6 +41,8 @@ void math_emulate(struct math_emu_info *); bool fault_in_kernel_space(unsigned long address); +void install_system_interrupt_handler(unsigned int n, const void *asm_addr, const void *addr); + #ifdef CONFIG_VMAP_STACK void __noreturn handle_stack_overflow(struct pt_regs *regs, unsigned long fault_address, diff --git a/arch/x86/kernel/cpu/acrn.c b/arch/x86/kernel/cpu/acrn.c index 485441b7f030..9351bf183a9e 100644 --- a/arch/x86/kernel/cpu/acrn.c +++ b/arch/x86/kernel/cpu/acrn.c @@ -18,6 +18,7 @@ #include #include #include +#include static u32 __init acrn_detect(void) { @@ -26,8 +27,10 @@ static u32 __init acrn_detect(void) static void __init acrn_init_platform(void) { - /* Setup the IDT for ACRN hypervisor callback */ - alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, asm_sysvec_acrn_hv_callback); + /* Install system interrupt handler for ACRN hypervisor callback */ + install_system_interrupt_handler(HYPERVISOR_CALLBACK_VECTOR, + asm_sysvec_acrn_hv_callback, + sysvec_acrn_hv_callback); x86_platform.calibrate_tsc = acrn_get_tsc_khz; x86_platform.calibrate_cpu = acrn_get_tsc_khz; diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index 831613959a92..144b4a622188 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -415,19 +416,24 @@ static void __init ms_hyperv_init_platform(void) */ x86_platform.apic_post_init = hyperv_init; hyperv_setup_mmu_ops(); - /* Setup the IDT for hypervisor callback */ - alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, asm_sysvec_hyperv_callback); - /* Setup the IDT for reenlightenment notifications */ + /* Install system interrupt handler for hypervisor callback */ + install_system_interrupt_handler(HYPERVISOR_CALLBACK_VECTOR, + asm_sysvec_hyperv_callback, + sysvec_hyperv_callback); + + /* Install system interrupt handler for reenlightenment notifications */ if (ms_hyperv.features & HV_ACCESS_REENLIGHTENMENT) { - alloc_intr_gate(HYPERV_REENLIGHTENMENT_VECTOR, - asm_sysvec_hyperv_reenlightenment); + install_system_interrupt_handler(HYPERV_REENLIGHTENMENT_VECTOR, + asm_sysvec_hyperv_reenlightenment, + sysvec_hyperv_reenlightenment); } - /* Setup the IDT for stimer0 */ + /* Install system interrupt handler for stimer0 */ if (ms_hyperv.misc_features & HV_STIMER_DIRECT_MODE_AVAILABLE) { - alloc_intr_gate(HYPERV_STIMER0_VECTOR, - asm_sysvec_hyperv_stimer0); + install_system_interrupt_handler(HYPERV_STIMER0_VECTOR, + asm_sysvec_hyperv_stimer0, + sysvec_hyperv_stimer0); } # ifdef CONFIG_SMP diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index d4e48b4a438b..b7388ed2a980 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -835,7 +835,9 @@ static void __init kvm_guest_init(void) if (kvm_para_has_feature(KVM_FEATURE_ASYNC_PF_INT) && kvmapf) { static_branch_enable(&kvm_async_pf_enabled); - alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, asm_sysvec_kvm_asyncpf_interrupt); + install_system_interrupt_handler(HYPERVISOR_CALLBACK_VECTOR, + asm_sysvec_kvm_asyncpf_interrupt, + sysvec_kvm_asyncpf_interrupt); } #ifdef CONFIG_SMP diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index 95dd917ef9ad..9c7826e588bc 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c @@ -1458,7 +1458,7 @@ DEFINE_IDTENTRY_SW(iret_error) * of the arguments provided by the full system_interrupt_handler prototype, * the function type cast is safe here. */ -const system_interrupt_handler system_interrupt_handler_table[NR_SYSTEM_VECTORS] = { +system_interrupt_handler system_interrupt_handler_table[NR_SYSTEM_VECTORS] = { [0 ... NR_SYSTEM_VECTORS-1] = spurious_interrupt, #ifdef CONFIG_SMP SYSV(RESCHEDULE_VECTOR, sysvec_reschedule_ipi), @@ -1499,6 +1499,14 @@ const system_interrupt_handler system_interrupt_handler_table[NR_SYSTEM_VECTORS] #undef SYSV +void __init install_system_interrupt_handler(unsigned int n, const void *asm_addr, const void *addr) +{ + BUG_ON(n < FIRST_SYSTEM_VECTOR); + + system_interrupt_handler_table[n - FIRST_SYSTEM_VECTOR] = (system_interrupt_handler)addr; + alloc_intr_gate(n, asm_addr); +} + void __init trap_init(void) { /* Init cpu_entry_area before IST entries are set up */ diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c index c443f04aaad7..1a9eaf417acc 100644 --- a/drivers/xen/events/events_base.c +++ b/drivers/xen/events/events_base.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #endif @@ -2246,7 +2247,9 @@ static __init void xen_alloc_callback_vector(void) return; pr_info("Xen HVM callback vector for event delivery is enabled\n"); - alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, asm_sysvec_xen_hvm_callback); + install_system_interrupt_handler(HYPERVISOR_CALLBACK_VECTOR, + asm_sysvec_xen_hvm_callback, + sysvec_xen_hvm_callback); } #else void xen_setup_callback_vector(void) {} From patchwork Thu Nov 10 06:15:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Xin3" X-Patchwork-Id: 13038336 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89772C4332F for ; Thu, 10 Nov 2022 06:39:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232635AbiKJGje (ORCPT ); Thu, 10 Nov 2022 01:39:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232560AbiKJGj2 (ORCPT ); Thu, 10 Nov 2022 01:39:28 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F11FA2A94F; Wed, 9 Nov 2022 22:39:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668062363; x=1699598363; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Oc0mQKbv3vl2yWZXC3YWNJd1AfkG2RvOnJu/bF1aWjE=; b=fuHH37zAkdJQrJAzoNSJWpN/L1cY1vNCU+UvuRAliNUEsvlj+HL8gVkt AHAclFPQQQ+gpM1AKS1j0x0BHgyGey7dfgl15IJTLU6oQxKwYePndnSbm hnRWgV/JiABXdArZ17Qyt9DYV46vdv0JO8H3GUyoKhsn564PGoZaZ3vw4 vviw2c9QaQahJqqSmtZOOzezVyTVsZw2FchejMpzIMB2+Utt90tr62Kxj GSO2oFN3J7d7qBrtNdSscmA+s/ztJpMEOO4GhShjE2XU2HhDJ9h8f+BLB hCgq2LbL5WNz+88bTXiBfMCeoTNBKPB7LbRp4tQzN2Aea/EOZ4hrRUYTh w==; X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="375474007" X-IronPort-AV: E=Sophos;i="5.96,153,1665471600"; d="scan'208";a="375474007" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2022 22:39:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="588057232" X-IronPort-AV: E=Sophos;i="5.96,153,1665471600"; d="scan'208";a="588057232" Received: from unknown (HELO fred..) ([172.25.112.68]) by orsmga003.jf.intel.com with ESMTP; 09 Nov 2022 22:39:21 -0800 From: Xin Li To: linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, seanjc@google.com, pbonzini@redhat.com, kevin.tian@intel.com Subject: [RESEND PATCH 4/6] x86/traps: add external_interrupt() to dispatch external interrupts Date: Wed, 9 Nov 2022 22:15:43 -0800 Message-Id: <20221110061545.1531-5-xin3.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221110061545.1531-1-xin3.li@intel.com> References: <20221110061545.1531-1-xin3.li@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Add external_interrupt() to dispatch external interrupts to their handlers. If an external interrupt is a system interrupt, dipatch it through system_interrupt_handler_table, otherwise call into common_interrupt(). Signed-off-by: H. Peter Anvin (Intel) Signed-off-by: Xin Li --- arch/x86/kernel/traps.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index 9c7826e588bc..c1eb3bd335ce 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c @@ -1507,6 +1507,27 @@ void __init install_system_interrupt_handler(unsigned int n, const void *asm_add alloc_intr_gate(n, asm_addr); } +/* + * External interrupt dispatch function. + * + * Until/unless common_interrupt() can be taught to deal with the + * special system vectors, split the dispatch. + * + * Note: common_interrupt() already deals with IRQ_MOVE_CLEANUP_VECTOR. + */ +__visible noinstr void external_interrupt(struct pt_regs *regs, + unsigned int vector) +{ + unsigned int sysvec = vector - FIRST_SYSTEM_VECTOR; + + BUG_ON(vector < FIRST_EXTERNAL_VECTOR); + + if (sysvec < NR_SYSTEM_VECTORS) + return system_interrupt_handler_table[sysvec](regs, vector); + + common_interrupt(regs, vector); +} + void __init trap_init(void) { /* Init cpu_entry_area before IST entries are set up */ From patchwork Thu Nov 10 06:15:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Xin3" X-Patchwork-Id: 13038337 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4946DC4332F for ; Thu, 10 Nov 2022 06:39:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232655AbiKJGjm (ORCPT ); Thu, 10 Nov 2022 01:39:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232607AbiKJGjb (ORCPT ); Thu, 10 Nov 2022 01:39:31 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A1D929C91; Wed, 9 Nov 2022 22:39:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668062365; x=1699598365; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=btiN7wu6yHcG/APG6+UAvWqTkcuTq8Wkw/RVvQEA/KE=; b=mvX29KLy9FNUMZR0QAAovu0ewzLmk7icUNe6s+BnBxgsQv3C17sjLuyk GCHFipgl8S2tfxDt6wSW1BBd2ZY+zBAK7qs9yLN0cklsUPweDVuhZuOnL WJm2J+KbsIFkkGFQMmQ1TLIkNHvsMF4MoEBo7MuhPbcRWmPD8nRpselqx Tq42fJNnNCKEnuJ92PUX8khKikxscx3UNk2BUAwvlFlQL/60o9n7+fpzt hj4wWflQu8fUKnZigFJQ3/xwg177bOJq10kwR0ChC3GnM0WCvS3J+P8aT LFF7q9pVncN2R8C1w3mvrTWmFP6G3vo+rdaU0KLmPN2ilEr9Ai9E46GKt A==; X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="375474019" X-IronPort-AV: E=Sophos;i="5.96,153,1665471600"; d="scan'208";a="375474019" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2022 22:39:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="588057245" X-IronPort-AV: E=Sophos;i="5.96,153,1665471600"; d="scan'208";a="588057245" Received: from unknown (HELO fred..) ([172.25.112.68]) by orsmga003.jf.intel.com with ESMTP; 09 Nov 2022 22:39:22 -0800 From: Xin Li To: linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, seanjc@google.com, pbonzini@redhat.com, kevin.tian@intel.com Subject: [RESEND PATCH 5/6] KVM: x86/VMX: add kvm_vmx_reinject_nmi_irq() for NMI/IRQ reinjection Date: Wed, 9 Nov 2022 22:15:44 -0800 Message-Id: <20221110061545.1531-6-xin3.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221110061545.1531-1-xin3.li@intel.com> References: <20221110061545.1531-1-xin3.li@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org To eliminate dispatching NMI/IRQ through the IDT, add kvm_vmx_reinject_nmi_irq(), which calls external_interrupt() for IRQ reinjection. Lastly replace calling a NMI/IRQ handler in an IDT descriptor with calling kvm_vmx_reinject_nmi_irq(). Signed-off-by: H. Peter Anvin (Intel) Signed-off-by: Xin Li --- arch/x86/include/asm/traps.h | 2 ++ arch/x86/kernel/traps.c | 23 +++++++++++++++++++++++ arch/x86/kvm/vmx/vmenter.S | 33 --------------------------------- arch/x86/kvm/vmx/vmx.c | 19 +++++++------------ 4 files changed, 32 insertions(+), 45 deletions(-) diff --git a/arch/x86/include/asm/traps.h b/arch/x86/include/asm/traps.h index 89c4233e19db..4c56a8d31762 100644 --- a/arch/x86/include/asm/traps.h +++ b/arch/x86/include/asm/traps.h @@ -57,4 +57,6 @@ void __noreturn handle_stack_overflow(struct pt_regs *regs, unsigned long vector __maybe_unused) typedef DECLARE_SYSTEM_INTERRUPT_HANDLER((*system_interrupt_handler)); +void kvm_vmx_reinject_nmi_irq(u32 vector); + #endif /* _ASM_X86_TRAPS_H */ diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index c1eb3bd335ce..9abf91534b13 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c @@ -1528,6 +1528,29 @@ __visible noinstr void external_interrupt(struct pt_regs *regs, common_interrupt(regs, vector); } +#if IS_ENABLED(CONFIG_KVM_INTEL) +/* + * KVM VMX reinjects NMI/IRQ on its current stack, it's a sync + * call thus the values in the pt_regs structure are not used in + * executing NMI/IRQ handlers, except cs.RPL and flags.IF, which + * are both always 0 in the VMX NMI/IRQ reinjection context. Thus + * we simply allocate a zeroed pt_regs structure on current stack + * to call external_interrupt(). + */ +void kvm_vmx_reinject_nmi_irq(u32 vector) +{ + struct pt_regs irq_regs; + + memset(&irq_regs, 0, sizeof(irq_regs)); + + if (vector == NMI_VECTOR) + return exc_nmi(&irq_regs); + + external_interrupt(&irq_regs, vector); +} +EXPORT_SYMBOL_GPL(kvm_vmx_reinject_nmi_irq); +#endif + void __init trap_init(void) { /* Init cpu_entry_area before IST entries are set up */ diff --git a/arch/x86/kvm/vmx/vmenter.S b/arch/x86/kvm/vmx/vmenter.S index 8477d8bdd69c..0c1608b329cd 100644 --- a/arch/x86/kvm/vmx/vmenter.S +++ b/arch/x86/kvm/vmx/vmenter.S @@ -317,36 +317,3 @@ SYM_FUNC_START(vmread_error_trampoline) RET SYM_FUNC_END(vmread_error_trampoline) - -SYM_FUNC_START(vmx_do_interrupt_nmi_irqoff) - /* - * Unconditionally create a stack frame, getting the correct RSP on the - * stack (for x86-64) would take two instructions anyways, and RBP can - * be used to restore RSP to make objtool happy (see below). - */ - push %_ASM_BP - mov %_ASM_SP, %_ASM_BP - -#ifdef CONFIG_X86_64 - /* - * Align RSP to a 16-byte boundary (to emulate CPU behavior) before - * creating the synthetic interrupt stack frame for the IRQ/NMI. - */ - and $-16, %rsp - push $__KERNEL_DS - push %rbp -#endif - pushf - push $__KERNEL_CS - CALL_NOSPEC _ASM_ARG1 - - /* - * "Restore" RSP from RBP, even though IRET has already unwound RSP to - * the correct value. objtool doesn't know the callee will IRET and, - * without the explicit restore, thinks the stack is getting walloped. - * Using an unwind hint is problematic due to x86-64's dynamic alignment. - */ - mov %_ASM_BP, %_ASM_SP - pop %_ASM_BP - RET -SYM_FUNC_END(vmx_do_interrupt_nmi_irqoff) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 63247c57c72c..b457e4888468 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -6758,15 +6759,11 @@ static void vmx_apicv_post_state_restore(struct kvm_vcpu *vcpu) memset(vmx->pi_desc.pir, 0, sizeof(vmx->pi_desc.pir)); } -void vmx_do_interrupt_nmi_irqoff(unsigned long entry); - -static void handle_interrupt_nmi_irqoff(struct kvm_vcpu *vcpu, - unsigned long entry) +static void handle_interrupt_nmi_irqoff(struct kvm_vcpu *vcpu, u32 vector) { - bool is_nmi = entry == (unsigned long)asm_exc_nmi_noist; - - kvm_before_interrupt(vcpu, is_nmi ? KVM_HANDLING_NMI : KVM_HANDLING_IRQ); - vmx_do_interrupt_nmi_irqoff(entry); + kvm_before_interrupt(vcpu, vector == NMI_VECTOR ? + KVM_HANDLING_NMI : KVM_HANDLING_IRQ); + kvm_vmx_reinject_nmi_irq(vector); kvm_after_interrupt(vcpu); } @@ -6792,7 +6789,6 @@ static void handle_nm_fault_irqoff(struct kvm_vcpu *vcpu) static void handle_exception_nmi_irqoff(struct vcpu_vmx *vmx) { - const unsigned long nmi_entry = (unsigned long)asm_exc_nmi_noist; u32 intr_info = vmx_get_intr_info(&vmx->vcpu); /* if exit due to PF check for async PF */ @@ -6806,20 +6802,19 @@ static void handle_exception_nmi_irqoff(struct vcpu_vmx *vmx) kvm_machine_check(); /* We need to handle NMIs before interrupts are enabled */ else if (is_nmi(intr_info)) - handle_interrupt_nmi_irqoff(&vmx->vcpu, nmi_entry); + handle_interrupt_nmi_irqoff(&vmx->vcpu, NMI_VECTOR); } static void handle_external_interrupt_irqoff(struct kvm_vcpu *vcpu) { u32 intr_info = vmx_get_intr_info(vcpu); unsigned int vector = intr_info & INTR_INFO_VECTOR_MASK; - gate_desc *desc = (gate_desc *)host_idt_base + vector; if (KVM_BUG(!is_external_intr(intr_info), vcpu->kvm, "KVM: unexpected VM-Exit interrupt info: 0x%x", intr_info)) return; - handle_interrupt_nmi_irqoff(vcpu, gate_offset(desc)); + handle_interrupt_nmi_irqoff(vcpu, vector); vcpu->arch.at_instruction_boundary = true; } From patchwork Thu Nov 10 06:15:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Xin3" X-Patchwork-Id: 13038338 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12302C4332F for ; Thu, 10 Nov 2022 06:40:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232707AbiKJGj5 (ORCPT ); Thu, 10 Nov 2022 01:39:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232585AbiKJGjd (ORCPT ); Thu, 10 Nov 2022 01:39:33 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EE89317C9; Wed, 9 Nov 2022 22:39:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668062366; x=1699598366; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dhU3XR4qiKmtU3OBrwyj0ws6KT1curnwZdVb3a04z6Y=; b=GkEmVS1iYmZecvvE1vB0m2WsfTqVv7ygBKLKlv01sgVBUsd2/WtGTDz8 YrhuBvydlL2NByRtdTPRyfGyhamP0HLF7mmcIsN8AZYqoZX6hseFA8sXG lp9yhJIuWRZ3eDzj2vim+W4iNxVktwf0juN39LEF7YkT2ndaxewANeEC7 n0cRMJy9IjagJBtRSV6Rd35YPLhkKZ9pkvtsIKjHe4CNiN2oLCsedoO2y wMcf5Y9AYpqOFlqVee1EgMlU/z77ivDLDfNsXnZa8QNk+qnF52SvVGMHW 0gkCZVyE8jrRm6UF9dLP+v6OcY83Zg3lIWacv5idmGZBsus0mz5GTDqKK g==; X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="375474023" X-IronPort-AV: E=Sophos;i="5.96,153,1665471600"; d="scan'208";a="375474023" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2022 22:39:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="588057257" X-IronPort-AV: E=Sophos;i="5.96,153,1665471600"; d="scan'208";a="588057257" Received: from unknown (HELO fred..) ([172.25.112.68]) by orsmga003.jf.intel.com with ESMTP; 09 Nov 2022 22:39:25 -0800 From: Xin Li To: linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, seanjc@google.com, pbonzini@redhat.com, kevin.tian@intel.com Subject: [RESEND PATCH 6/6] x86/traps: remove unused NMI entry exc_nmi_noist() Date: Wed, 9 Nov 2022 22:15:45 -0800 Message-Id: <20221110061545.1531-7-xin3.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221110061545.1531-1-xin3.li@intel.com> References: <20221110061545.1531-1-xin3.li@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org After the introduction of kvm_vmx_reinject_irq(), exc_nmi_noist() is no longer needed, thus remove it. Signed-off-by: Xin Li --- arch/x86/include/asm/idtentry.h | 15 --------------- arch/x86/kernel/nmi.c | 10 ---------- 2 files changed, 25 deletions(-) diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm/idtentry.h index 72184b0b2219..da28ac17c57a 100644 --- a/arch/x86/include/asm/idtentry.h +++ b/arch/x86/include/asm/idtentry.h @@ -581,21 +581,6 @@ DECLARE_IDTENTRY_RAW(X86_TRAP_MC, xenpv_exc_machine_check); #endif /* NMI */ - -#if defined(CONFIG_X86_64) && IS_ENABLED(CONFIG_KVM_INTEL) -/* - * Special NOIST entry point for VMX which invokes this on the kernel - * stack. asm_exc_nmi() requires an IST to work correctly vs. the NMI - * 'executing' marker. - * - * On 32bit this just uses the regular NMI entry point because 32-bit does - * not have ISTs. - */ -DECLARE_IDTENTRY(X86_TRAP_NMI, exc_nmi_noist); -#else -#define asm_exc_nmi_noist asm_exc_nmi -#endif - DECLARE_IDTENTRY_NMI(X86_TRAP_NMI, exc_nmi); #ifdef CONFIG_XEN_PV DECLARE_IDTENTRY_RAW(X86_TRAP_NMI, xenpv_exc_nmi); diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c index cec0bfa3bc04..816bb59a4ba4 100644 --- a/arch/x86/kernel/nmi.c +++ b/arch/x86/kernel/nmi.c @@ -527,16 +527,6 @@ DEFINE_IDTENTRY_RAW(exc_nmi) mds_user_clear_cpu_buffers(); } -#if defined(CONFIG_X86_64) && IS_ENABLED(CONFIG_KVM_INTEL) -DEFINE_IDTENTRY_RAW(exc_nmi_noist) -{ - exc_nmi(regs); -} -#endif -#if IS_MODULE(CONFIG_KVM_INTEL) -EXPORT_SYMBOL_GPL(asm_exc_nmi_noist); -#endif - void stop_nmi(void) { ignore_nmis++;