hc
2024-05-10 ee930fffee469d076998274a2ca55e13dc1efb67
kernel/arch/x86/kvm/irq.h
....@@ -1,22 +1,10 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * irq.h: in kernel interrupt controller related definitions
34 * Copyright (c) 2007, Intel Corporation.
45 *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms and conditions of the GNU General Public License,
7
- * version 2, as published by the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope it will be useful, but WITHOUT
10
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
- * more details.
13
- *
14
- * You should have received a copy of the GNU General Public License along with
15
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16
- * Place - Suite 330, Boston, MA 02111-1307 USA.
176 * Authors:
187 * Yaozu (Eddie) Dong <Eddie.dong@intel.com>
19
- *
208 */
219
2210 #ifndef __IRQ_H
....@@ -28,7 +16,6 @@
2816 #include <linux/spinlock.h>
2917
3018 #include <kvm/iodev.h>
31
-#include "ioapic.h"
3219 #include "lapic.h"
3320
3421 #define PIC_NUM_PINS 16
....@@ -78,15 +65,6 @@
7865 int kvm_pic_read_irq(struct kvm *kvm);
7966 void kvm_pic_update_irq(struct kvm_pic *s);
8067
81
-static inline int pic_in_kernel(struct kvm *kvm)
82
-{
83
- int mode = kvm->arch.irqchip_mode;
84
-
85
- /* Matches smp_wmb() when setting irqchip_mode */
86
- smp_rmb();
87
- return mode == KVM_IRQCHIP_KERNEL;
88
-}
89
-
9068 static inline int irqchip_split(struct kvm *kvm)
9169 {
9270 int mode = kvm->arch.irqchip_mode;
....@@ -105,6 +83,11 @@
10583 return mode == KVM_IRQCHIP_KERNEL;
10684 }
10785
86
+static inline int pic_in_kernel(struct kvm *kvm)
87
+{
88
+ return irqchip_kernel(kvm);
89
+}
90
+
10891 static inline int irqchip_in_kernel(struct kvm *kvm)
10992 {
11093 int mode = kvm->arch.irqchip_mode;
....@@ -114,7 +97,6 @@
11497 return mode != KVM_IRQCHIP_NONE;
11598 }
11699
117
-bool kvm_arch_irqfd_allowed(struct kvm *kvm, struct kvm_irqfd *args);
118100 void kvm_inject_pending_timer_irqs(struct kvm_vcpu *vcpu);
119101 void kvm_inject_apic_timer_irqs(struct kvm_vcpu *vcpu);
120102 void kvm_apic_nmi_wd_deliver(struct kvm_vcpu *vcpu);
....@@ -126,5 +108,8 @@
126108
127109 int kvm_setup_default_irq_routing(struct kvm *kvm);
128110 int kvm_setup_empty_irq_routing(struct kvm *kvm);
111
+int kvm_irq_delivery_to_apic(struct kvm *kvm, struct kvm_lapic *src,
112
+ struct kvm_lapic_irq *irq,
113
+ struct dest_map *dest_map);
129114
130115 #endif