hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/include/linux/irqchip/arm-gic-v4.h
....@@ -1,18 +1,7 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (C) 2016,2017 ARM Limited, All Rights Reserved.
34 * Author: Marc Zyngier <marc.zyngier@arm.com>
4
- *
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.
8
- *
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.
13
- *
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/>.
165 */
176
187 #ifndef __LINUX_IRQCHIP_ARM_GIC_V4_H
....@@ -43,11 +32,41 @@
4332 struct its_vpe {
4433 struct page *vpt_page;
4534 struct its_vm *its_vm;
35
+ /* per-vPE VLPI tracking */
36
+ atomic_t vlpi_count;
4637 /* Doorbell interrupt */
4738 int irq;
4839 irq_hw_number_t vpe_db_lpi;
49
- /* VPE proxy mapping */
50
- int vpe_proxy_event;
40
+ /* VPE resident */
41
+ bool resident;
42
+ /* VPT parse complete */
43
+ bool ready;
44
+ union {
45
+ /* GICv4.0 implementations */
46
+ struct {
47
+ /* VPE proxy mapping */
48
+ int vpe_proxy_event;
49
+ /* Implementation Defined Area Invalid */
50
+ bool idai;
51
+ };
52
+ /* GICv4.1 implementations */
53
+ struct {
54
+ struct fwnode_handle *fwnode;
55
+ struct irq_domain *sgi_domain;
56
+ struct {
57
+ u8 priority;
58
+ bool enabled;
59
+ bool group;
60
+ } sgi_config[16];
61
+ atomic_t vmapp_count;
62
+ };
63
+ };
64
+
65
+ /*
66
+ * Ensures mutual exclusion between affinity setting of the
67
+ * vPE and vLPI operations using vpe->col_idx.
68
+ */
69
+ raw_spinlock_t vpe_lock;
5170 /*
5271 * This collection ID is used to indirect the target
5372 * redistributor for this VPE. The ID itself isn't involved in
....@@ -56,8 +75,6 @@
5675 u16 col_idx;
5776 /* Unique (system-wide) VPE identifier */
5877 u16 vpe_id;
59
- /* Implementation Defined Area Invalid */
60
- bool idai;
6178 /* Pending VLPIs on schedule out? */
6279 bool pending_last;
6380 };
....@@ -89,7 +106,9 @@
89106 PROP_UPDATE_AND_INV_VLPI,
90107 SCHEDULE_VPE,
91108 DESCHEDULE_VPE,
109
+ COMMIT_VPE,
92110 INVALL_VPE,
111
+ PROP_UPDATE_VSGI,
93112 };
94113
95114 struct its_cmd_info {
....@@ -97,19 +116,33 @@
97116 union {
98117 struct its_vlpi_map *map;
99118 u8 config;
119
+ bool req_db;
120
+ struct {
121
+ bool g0en;
122
+ bool g1en;
123
+ };
124
+ struct {
125
+ u8 priority;
126
+ bool group;
127
+ };
100128 };
101129 };
102130
103131 int its_alloc_vcpu_irqs(struct its_vm *vm);
104132 void its_free_vcpu_irqs(struct its_vm *vm);
105
-int its_schedule_vpe(struct its_vpe *vpe, bool on);
133
+int its_make_vpe_resident(struct its_vpe *vpe, bool g0en, bool g1en);
134
+int its_make_vpe_non_resident(struct its_vpe *vpe, bool db);
135
+int its_commit_vpe(struct its_vpe *vpe);
106136 int its_invall_vpe(struct its_vpe *vpe);
107137 int its_map_vlpi(int irq, struct its_vlpi_map *map);
108138 int its_get_vlpi(int irq, struct its_vlpi_map *map);
109139 int its_unmap_vlpi(int irq);
110140 int its_prop_update_vlpi(int irq, u8 config, bool inv);
141
+int its_prop_update_vsgi(int irq, u8 priority, bool group);
111142
112143 struct irq_domain_ops;
113
-int its_init_v4(struct irq_domain *domain, const struct irq_domain_ops *ops);
144
+int its_init_v4(struct irq_domain *domain,
145
+ const struct irq_domain_ops *vpe_ops,
146
+ const struct irq_domain_ops *sgi_ops);
114147
115148 #endif