irqchip/gic-v4: Add VPE command interface
authorMarc Zyngier <marc.zyngier@arm.com>
Tue, 20 Dec 2016 15:31:02 +0000 (15:31 +0000)
committerMarc Zyngier <marc.zyngier@arm.com>
Thu, 31 Aug 2017 14:31:41 +0000 (15:31 +0100)
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>
drivers/irqchip/irq-gic-v4.c
include/linux/irqchip/arm-gic-v4.h

index 3d4bedea4e785ba29c3aa89c2166cad514db38a6..d3f8b7a13d2ce4debc5c3c98f9016325476d75f1 100644 (file)
@@ -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);
+}
index 3dc811dc53da39c93eb475b82dd62c83e7f66434..6450f3ed101f90effad8015b17f27d03d06ba025 100644 (file)
@@ -93,5 +93,7 @@ struct its_cmd_info {
 
 int its_alloc_vcpu_irqs(struct its_vm *vm);
 void its_free_vcpu_irqs(struct its_vm *vm);
+int its_schedule_vpe(struct its_vpe *vpe, bool on);
+int its_invall_vpe(struct its_vpe *vpe);
 
 #endif