summaryrefslogtreecommitdiffstats
path: root/include/kvm
diff options
context:
space:
mode:
authorChristoffer Dall <christoffer.dall@linaro.org>2017-10-27 13:30:09 -0400
committerChristoffer Dall <christoffer.dall@linaro.org>2018-01-02 04:05:46 -0500
commitb6909a659f8d5de2df36cabb1c0505d262996a24 (patch)
treee0aa8769ddd5f3203a071b9fc90331c08d5cec73 /include/kvm
parente40cc57bac792713ff6a1b80a1f67b54c05e5e21 (diff)
KVM: arm/arm64: Support a vgic interrupt line level sample function
The GIC sometimes need to sample the physical line of a mapped interrupt. As we know this to be notoriously slow, provide a callback function for devices (such as the timer) which can do this much faster than talking to the distributor, for example by comparing a few in-memory values. Fall back to the good old method of poking the physical GIC if no callback is provided. Reviewed-by: Marc Zyngier <marc.zyngier@arm.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'include/kvm')
-rw-r--r--include/kvm/arm_vgic.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h
index 8c896540a72c..cdbd142ca7f2 100644
--- a/include/kvm/arm_vgic.h
+++ b/include/kvm/arm_vgic.h
@@ -130,6 +130,17 @@ struct vgic_irq {
130 u8 priority; 130 u8 priority;
131 enum vgic_irq_config config; /* Level or edge */ 131 enum vgic_irq_config config; /* Level or edge */
132 132
133 /*
134 * Callback function pointer to in-kernel devices that can tell us the
135 * state of the input level of mapped level-triggered IRQ faster than
136 * peaking into the physical GIC.
137 *
138 * Always called in non-preemptible section and the functions can use
139 * kvm_arm_get_running_vcpu() to get the vcpu pointer for private
140 * IRQs.
141 */
142 bool (*get_input_level)(int vintid);
143
133 void *owner; /* Opaque pointer to reserve an interrupt 144 void *owner; /* Opaque pointer to reserve an interrupt
134 for in-kernel devices. */ 145 for in-kernel devices. */
135}; 146};
@@ -331,7 +342,7 @@ void kvm_vgic_init_cpu_hardware(void);
331int kvm_vgic_inject_irq(struct kvm *kvm, int cpuid, unsigned int intid, 342int kvm_vgic_inject_irq(struct kvm *kvm, int cpuid, unsigned int intid,
332 bool level, void *owner); 343 bool level, void *owner);
333int kvm_vgic_map_phys_irq(struct kvm_vcpu *vcpu, unsigned int host_irq, 344int kvm_vgic_map_phys_irq(struct kvm_vcpu *vcpu, unsigned int host_irq,
334 u32 vintid); 345 u32 vintid, bool (*get_input_level)(int vindid));
335int kvm_vgic_unmap_phys_irq(struct kvm_vcpu *vcpu, unsigned int vintid); 346int kvm_vgic_unmap_phys_irq(struct kvm_vcpu *vcpu, unsigned int vintid);
336bool kvm_vgic_map_is_active(struct kvm_vcpu *vcpu, unsigned int vintid); 347bool kvm_vgic_map_is_active(struct kvm_vcpu *vcpu, unsigned int vintid);
337 348