2 * Copyright (C) 2016,2017 ARM Limited, All Rights Reserved.
3 * Author: Marc Zyngier <marc.zyngier@arm.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef __LINUX_IRQCHIP_ARM_GIC_V4_H
19 #define __LINUX_IRQCHIP_ARM_GIC_V4_H
23 /* Embedded in kvm.arch */
25 struct fwnode_handle *fwnode;
26 struct irq_domain *domain;
27 struct page *vprop_page;
28 struct its_vpe **vpes;
30 irq_hw_number_t db_lpi_base;
31 unsigned long *db_bitmap;
35 /* Embedded in kvm_vcpu.arch */
37 struct page *vpt_page;
38 struct its_vm *its_vm;
39 /* Doorbell interrupt */
41 irq_hw_number_t vpe_db_lpi;
42 /* VPE proxy mapping */
45 * This collection ID is used to indirect the target
46 * redistributor for this VPE. The ID itself isn't involved in
47 * programming of the ITS.
50 /* Unique (system-wide) VPE identifier */
52 /* Implementation Defined Area Invalid */
54 /* Pending VLPIs on schedule out? */
59 * struct its_vlpi_map: structure describing the mapping of a
60 * VLPI. Only to be interpreted in the context of a physical interrupt
61 * it complements. To be used as the vcpu_info passed to
62 * irq_set_vcpu_affinity().
64 * @vm: Pointer to the GICv4 notion of a VM
65 * @vpe: Pointer to the GICv4 notion of a virtual CPU (VPE)
66 * @vintid: Virtual LPI number
67 * @db_enabled: Is the VPE doorbell to be generated?
76 enum its_vcpu_info_cmd_type {
80 PROP_UPDATE_AND_INV_VLPI,
87 enum its_vcpu_info_cmd_type cmd_type;
89 struct its_vlpi_map *map;
94 int its_alloc_vcpu_irqs(struct its_vm *vm);
95 void its_free_vcpu_irqs(struct its_vm *vm);
96 int its_schedule_vpe(struct its_vpe *vpe, bool on);
97 int its_invall_vpe(struct its_vpe *vpe);
98 int its_map_vlpi(int irq, struct its_vlpi_map *map);
99 int its_get_vlpi(int irq, struct its_vlpi_map *map);
100 int its_unmap_vlpi(int irq);
101 int its_prop_update_vlpi(int irq, u8 config, bool inv);
103 int its_init_v4(struct irq_domain *domain, const struct irq_domain_ops *ops);