summaryrefslogtreecommitdiff
path: root/drivers/irqchip/irq-gic-v4.c
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2016-12-20 15:31:02 +0000
committerMarc Zyngier <marc.zyngier@arm.com>2017-08-31 15:31:41 +0100
commiteab84318c2811e3f38c080efcc7f709f51bb8370 (patch)
tree0928ecb91d8f93805ddf1aa99e0516e23459ec41 /drivers/irqchip/irq-gic-v4.c
parent7de5c0af9c7c717f9052e6d75b24f90050e6a56e (diff)
irqchip/gic-v4: Add VPE command interface
Add the required interfaces to schedule a VPE and perform a VINVALL command. Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Eric Auger <eric.auger@redhat.com> 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.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/irqchip/irq-gic-v4.c b/drivers/irqchip/irq-gic-v4.c
index 3d4bedea4e78..d3f8b7a13d2c 100644
--- a/drivers/irqchip/irq-gic-v4.c
+++ b/drivers/irqchip/irq-gic-v4.c
@@ -72,3 +72,28 @@ void its_free_vcpu_irqs(struct its_vm *vm)
irq_domain_remove(vm->domain);
irq_domain_free_fwnode(vm->fwnode);
}
+
+static int its_send_vpe_cmd(struct its_vpe *vpe, struct its_cmd_info *info)
+{
+ return irq_set_vcpu_affinity(vpe->irq, info);
+}
+
+int its_schedule_vpe(struct its_vpe *vpe, bool on)
+{
+ struct its_cmd_info info;
+
+ WARN_ON(preemptible());
+
+ info.cmd_type = on ? SCHEDULE_VPE : DESCHEDULE_VPE;
+
+ return its_send_vpe_cmd(vpe, &info);
+}
+
+int its_invall_vpe(struct its_vpe *vpe)
+{
+ struct its_cmd_info info = {
+ .cmd_type = INVALL_VPE,
+ };
+
+ return its_send_vpe_cmd(vpe, &info);
+}