blob: e6463f866abc24bdc1a1f1e04e3c0b6333fbdedc [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Alexander Grafde9ba2f2013-04-16 17:42:19 +02002#ifndef __IRQ_H
3#define __IRQ_H
4
5#include <linux/kvm_host.h>
6
7static 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 Mackerras5975a2e2013-04-27 00:28:37 +000014#ifdef CONFIG_KVM_XICS
15 ret = ret || (kvm->arch.xics != NULL);
Benjamin Herrenschmidt5af50992017-04-05 17:54:56 +100016 ret = ret || (kvm->arch.xive != NULL);
Paul Mackerras5975a2e2013-04-27 00:28:37 +000017#endif
Alexander Grafde9ba2f2013-04-16 17:42:19 +020018 smp_rmb();
19 return ret;
20}
21
22#endif