2 * Copyright (C) 2015, 2016 ARM Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #include <linux/kvm.h>
18 #include <linux/kvm_host.h>
22 struct vgic_global __section(.hyp.text) kvm_vgic_global_state;
24 struct vgic_irq *vgic_get_irq(struct kvm *kvm, struct kvm_vcpu *vcpu,
28 if (intid <= VGIC_MAX_PRIVATE)
29 return &vcpu->arch.vgic_cpu.private_irqs[intid];
32 if (intid <= VGIC_MAX_SPI)
33 return &kvm->arch.vgic.spis[intid - VGIC_NR_PRIVATE_IRQS];
35 /* LPIs are not yet covered */
36 if (intid >= VGIC_MIN_LPI)
39 WARN(1, "Looking up struct vgic_irq for reserved INTID");