summaryrefslogtreecommitdiff
path: root/drivers/irqchip/irq-gic-v4.c
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2016-12-22 00:50:32 +0300
committerMarc Zyngier <marc.zyngier@arm.com>2017-08-31 17:31:41 +0300
commitf2eac75de435871d5a497f8b557874a2a8a7b264 (patch)
treeb78a2e2c760d762f873160e7caf959317509e54b /drivers/irqchip/irq-gic-v4.c
parenteab84318c2811e3f38c080efcc7f709f51bb8370 (diff)
downloadlinux-f2eac75de435871d5a497f8b557874a2a8a7b264.tar.xz
irqchip/gic-v4: Add VLPI configuration interface
Add the required interfaces to map, unmap and update a VLPI. Reviewed-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'drivers/irqchip/irq-gic-v4.c')
-rw-r--r--drivers/irqchip/irq-gic-v4.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/irqchip/irq-gic-v4.c b/drivers/irqchip/irq-gic-v4.c
index d3f8b7a13d2c..6d33828a84a7 100644
--- a/drivers/irqchip/irq-gic-v4.c
+++ b/drivers/irqchip/irq-gic-v4.c
@@ -97,3 +97,45 @@ int its_invall_vpe(struct its_vpe *vpe)
return its_send_vpe_cmd(vpe, &info);
}
+
+int its_map_vlpi(int irq, struct its_vlpi_map *map)
+{
+ struct its_cmd_info info = {
+ .cmd_type = MAP_VLPI,
+ .map = map,
+ };
+
+ /*
+ * The host will never see that interrupt firing again, so it
+ * is vital that we don't do any lazy masking.
+ */
+ irq_set_status_flags(irq, IRQ_DISABLE_UNLAZY);
+
+ return irq_set_vcpu_affinity(irq, &info);
+}
+
+int its_get_vlpi(int irq, struct its_vlpi_map *map)
+{
+ struct its_cmd_info info = {
+ .cmd_type = GET_VLPI,
+ .map = map,
+ };
+
+ return irq_set_vcpu_affinity(irq, &info);
+}
+
+int its_unmap_vlpi(int irq)
+{
+ irq_clear_status_flags(irq, IRQ_DISABLE_UNLAZY);
+ return irq_set_vcpu_affinity(irq, NULL);
+}
+
+int its_prop_update_vlpi(int irq, u8 config, bool inv)
+{
+ struct its_cmd_info info = {
+ .cmd_type = inv ? PROP_UPDATE_AND_INV_VLPI : PROP_UPDATE_VLPI,
+ .config = config,
+ };
+
+ return irq_set_vcpu_affinity(irq, &info);
+}