summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kvm/arch_timer.c
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2021-03-01 18:39:39 +0100
committerMarc Zyngier <maz@kernel.org>2021-06-01 11:45:59 +0200
commitdb75f1a33f82ad332b6e139c5960e01999969d2c (patch)
tree07fad6697aebf6c31113c7ff510a3de5854f594b /arch/arm64/kvm/arch_timer.c
parentKVM: arm64: vgic: Let an interrupt controller advertise lack of HW deactivation (diff)
downloadlinux-db75f1a33f82ad332b6e139c5960e01999969d2c.tar.xz
linux-db75f1a33f82ad332b6e139c5960e01999969d2c.zip
KVM: arm64: vgic: move irq->get_input_level into an ops structure
We already have the option to attach a callback to an interrupt to retrieve its pending state. As we are planning to expand this facility, move this callback into its own data structure. This will limit the size of individual interrupts as the ops structures can be shared across multiple interrupts. Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'arch/arm64/kvm/arch_timer.c')
-rw-r--r--arch/arm64/kvm/arch_timer.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/arm64/kvm/arch_timer.c b/arch/arm64/kvm/arch_timer.c
index 74e0699661e9..e2288b6bf435 100644
--- a/arch/arm64/kvm/arch_timer.c
+++ b/arch/arm64/kvm/arch_timer.c
@@ -1116,6 +1116,10 @@ bool kvm_arch_timer_get_input_level(int vintid)
return kvm_timer_should_fire(timer);
}
+static struct irq_ops arch_timer_irq_ops = {
+ .get_input_level = kvm_arch_timer_get_input_level,
+};
+
int kvm_timer_enable(struct kvm_vcpu *vcpu)
{
struct arch_timer_cpu *timer = vcpu_timer(vcpu);
@@ -1143,7 +1147,7 @@ int kvm_timer_enable(struct kvm_vcpu *vcpu)
ret = kvm_vgic_map_phys_irq(vcpu,
map.direct_vtimer->host_timer_irq,
map.direct_vtimer->irq.irq,
- kvm_arch_timer_get_input_level);
+ &arch_timer_irq_ops);
if (ret)
return ret;
@@ -1151,7 +1155,7 @@ int kvm_timer_enable(struct kvm_vcpu *vcpu)
ret = kvm_vgic_map_phys_irq(vcpu,
map.direct_ptimer->host_timer_irq,
map.direct_ptimer->irq.irq,
- kvm_arch_timer_get_input_level);
+ &arch_timer_irq_ops);
}
if (ret)