1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18#ifndef __LINUX_IRQCHIP_ARM_GIC_V4_H
19#define __LINUX_IRQCHIP_ARM_GIC_V4_H
20
21struct its_vpe;
22
23
24
25
26
27#define GICv4_ITS_LIST_MAX 16
28
29
30struct its_vm {
31 struct fwnode_handle *fwnode;
32 struct irq_domain *domain;
33 struct page *vprop_page;
34 struct its_vpe **vpes;
35 int nr_vpes;
36 irq_hw_number_t db_lpi_base;
37 unsigned long *db_bitmap;
38 int nr_db_lpis;
39 u32 vlpi_count[GICv4_ITS_LIST_MAX];
40};
41
42
43struct its_vpe {
44 struct page *vpt_page;
45 struct its_vm *its_vm;
46
47 int irq;
48 irq_hw_number_t vpe_db_lpi;
49
50 int vpe_proxy_event;
51
52
53
54
55
56 u16 col_idx;
57
58 u16 vpe_id;
59
60 bool idai;
61
62 bool pending_last;
63};
64
65
66
67
68
69
70
71
72
73
74
75
76
77struct its_vlpi_map {
78 struct its_vm *vm;
79 struct its_vpe *vpe;
80 u32 vintid;
81 u8 properties;
82 bool db_enabled;
83};
84
85enum its_vcpu_info_cmd_type {
86 MAP_VLPI,
87 GET_VLPI,
88 PROP_UPDATE_VLPI,
89 PROP_UPDATE_AND_INV_VLPI,
90 SCHEDULE_VPE,
91 DESCHEDULE_VPE,
92 INVALL_VPE,
93};
94
95struct its_cmd_info {
96 enum its_vcpu_info_cmd_type cmd_type;
97 union {
98 struct its_vlpi_map *map;
99 u8 config;
100 };
101};
102
103int its_alloc_vcpu_irqs(struct its_vm *vm);
104void its_free_vcpu_irqs(struct its_vm *vm);
105int its_schedule_vpe(struct its_vpe *vpe, bool on);
106int its_invall_vpe(struct its_vpe *vpe);
107int its_map_vlpi(int irq, struct its_vlpi_map *map);
108int its_get_vlpi(int irq, struct its_vlpi_map *map);
109int its_unmap_vlpi(int irq);
110int its_prop_update_vlpi(int irq, u8 config, bool inv);
111
112struct irq_domain_ops;
113int its_init_v4(struct irq_domain *domain, const struct irq_domain_ops *ops);
114
115#endif
116