Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Alexander Graf | de9ba2f | 2013-04-16 17:42:19 +0200 | [diff] [blame] | 2 | #ifndef __IRQ_H |
| 3 | #define __IRQ_H |
| 4 | |
| 5 | #include <linux/kvm_host.h> |
| 6 | |
| 7 | static inline int irqchip_in_kernel(struct kvm *kvm) |
| 8 | { |
| 9 | int ret = 0; |
| 10 | |
| 11 | #ifdef CONFIG_KVM_MPIC |
| 12 | ret = ret || (kvm->arch.mpic != NULL); |
| 13 | #endif |
Paul Mackerras | 5975a2e | 2013-04-27 00:28:37 +0000 | [diff] [blame] | 14 | #ifdef CONFIG_KVM_XICS |
| 15 | ret = ret || (kvm->arch.xics != NULL); |
Benjamin Herrenschmidt | 5af5099 | 2017-04-05 17:54:56 +1000 | [diff] [blame] | 16 | ret = ret || (kvm->arch.xive != NULL); |
Paul Mackerras | 5975a2e | 2013-04-27 00:28:37 +0000 | [diff] [blame] | 17 | #endif |
Alexander Graf | de9ba2f | 2013-04-16 17:42:19 +0200 | [diff] [blame] | 18 | smp_rmb(); |
| 19 | return ret; |
| 20 | } |
| 21 | |
| 22 | #endif |