1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2016,2017 ARM Limited, All Rights Reserved.
4 * Author: Marc Zyngier <marc.zyngier@arm.com>
7 #ifndef __LINUX_IRQCHIP_ARM_GIC_V4_H
8 #define __LINUX_IRQCHIP_ARM_GIC_V4_H
13 * Maximum number of ITTs when GITS_TYPER.VMOVP == 0, using the
14 * ITSList mechanism to perform inter-ITS synchronization.
16 #define GICv4_ITS_LIST_MAX 16
18 /* Embedded in kvm.arch */
20 struct fwnode_handle *fwnode;
21 struct irq_domain *domain;
22 struct page *vprop_page;
23 struct its_vpe **vpes;
25 irq_hw_number_t db_lpi_base;
26 unsigned long *db_bitmap;
28 u32 vlpi_count[GICv4_ITS_LIST_MAX];
31 /* Embedded in kvm_vcpu.arch */
33 struct page *vpt_page;
34 struct its_vm *its_vm;
35 /* Doorbell interrupt */
37 irq_hw_number_t vpe_db_lpi;
38 /* VPE proxy mapping */
41 * This collection ID is used to indirect the target
42 * redistributor for this VPE. The ID itself isn't involved in
43 * programming of the ITS.
46 /* Unique (system-wide) VPE identifier */
48 /* Implementation Defined Area Invalid */
50 /* Pending VLPIs on schedule out? */
55 * struct its_vlpi_map: structure describing the mapping of a
56 * VLPI. Only to be interpreted in the context of a physical interrupt
57 * it complements. To be used as the vcpu_info passed to
58 * irq_set_vcpu_affinity().
60 * @vm: Pointer to the GICv4 notion of a VM
61 * @vpe: Pointer to the GICv4 notion of a virtual CPU (VPE)
62 * @vintid: Virtual LPI number
63 * @properties: Priority and enable bits (as written in the prop table)
64 * @db_enabled: Is the VPE doorbell to be generated?
74 enum its_vcpu_info_cmd_type {
78 PROP_UPDATE_AND_INV_VLPI,
85 enum its_vcpu_info_cmd_type cmd_type;
87 struct its_vlpi_map *map;
92 int its_alloc_vcpu_irqs(struct its_vm *vm);
93 void its_free_vcpu_irqs(struct its_vm *vm);
94 int its_schedule_vpe(struct its_vpe *vpe, bool on);
95 int its_invall_vpe(struct its_vpe *vpe);
96 int its_map_vlpi(int irq, struct its_vlpi_map *map);
97 int its_get_vlpi(int irq, struct its_vlpi_map *map);
98 int its_unmap_vlpi(int irq);
99 int its_prop_update_vlpi(int irq, u8 config, bool inv);
101 struct irq_domain_ops;
102 int its_init_v4(struct irq_domain *domain, const struct irq_domain_ops *ops);