summaryrefslogtreecommitdiffstats
path: root/include/kvm
diff options
context:
space:
mode:
authorChristoffer Dall <christoffer.dall@linaro.org>2015-03-13 13:02:54 -0400
committerChristoffer Dall <christoffer.dall@linaro.org>2015-03-14 08:46:44 -0400
commit47a98b15ba7cf6a13bd94ab8455d3f586b16420b (patch)
tree5b0263f9e628236b50dd863da13269912cf5873b /include/kvm
parent71760950bf3dc796e5e53ea3300dec724a09f593 (diff)
arm/arm64: KVM: support for un-queuing active IRQs
Migrating active interrupts causes the active state to be lost completely. This implements some additional bitmaps to track the active state on the distributor and export this to user space. Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'include/kvm')
-rw-r--r--include/kvm/arm_vgic.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h
index b81630b1da85..9092fad3c141 100644
--- a/include/kvm/arm_vgic.h
+++ b/include/kvm/arm_vgic.h
@@ -195,6 +195,9 @@ struct vgic_dist {
195 /* Level-triggered interrupt queued on VCPU interface */ 195 /* Level-triggered interrupt queued on VCPU interface */
196 struct vgic_bitmap irq_queued; 196 struct vgic_bitmap irq_queued;
197 197
198 /* Interrupt was active when unqueue from VCPU interface */
199 struct vgic_bitmap irq_active;
200
198 /* Interrupt priority. Not used yet. */ 201 /* Interrupt priority. Not used yet. */
199 struct vgic_bytemap irq_priority; 202 struct vgic_bytemap irq_priority;
200 203
@@ -235,6 +238,9 @@ struct vgic_dist {
235 /* Bitmap indicating which CPU has something pending */ 238 /* Bitmap indicating which CPU has something pending */
236 unsigned long *irq_pending_on_cpu; 239 unsigned long *irq_pending_on_cpu;
237 240
241 /* Bitmap indicating which CPU has active IRQs */
242 unsigned long *irq_active_on_cpu;
243
238 struct vgic_vm_ops vm_ops; 244 struct vgic_vm_ops vm_ops;
239}; 245};
240 246
@@ -266,9 +272,15 @@ struct vgic_cpu {
266 /* per IRQ to LR mapping */ 272 /* per IRQ to LR mapping */
267 u8 *vgic_irq_lr_map; 273 u8 *vgic_irq_lr_map;
268 274
269 /* Pending interrupts on this VCPU */ 275 /* Pending/active/both interrupts on this VCPU */
270 DECLARE_BITMAP( pending_percpu, VGIC_NR_PRIVATE_IRQS); 276 DECLARE_BITMAP( pending_percpu, VGIC_NR_PRIVATE_IRQS);
277 DECLARE_BITMAP( active_percpu, VGIC_NR_PRIVATE_IRQS);
278 DECLARE_BITMAP( pend_act_percpu, VGIC_NR_PRIVATE_IRQS);
279
280 /* Pending/active/both shared interrupts, dynamically sized */
271 unsigned long *pending_shared; 281 unsigned long *pending_shared;
282 unsigned long *active_shared;
283 unsigned long *pend_act_shared;
272 284
273 /* Bitmap of used/free list registers */ 285 /* Bitmap of used/free list registers */
274 DECLARE_BITMAP( lr_used, VGIC_V2_MAX_LRS); 286 DECLARE_BITMAP( lr_used, VGIC_V2_MAX_LRS);
@@ -306,6 +318,7 @@ int kvm_vgic_inject_irq(struct kvm *kvm, int cpuid, unsigned int irq_num,
306 bool level); 318 bool level);
307void vgic_v3_dispatch_sgi(struct kvm_vcpu *vcpu, u64 reg); 319void vgic_v3_dispatch_sgi(struct kvm_vcpu *vcpu, u64 reg);
308int kvm_vgic_vcpu_pending_irq(struct kvm_vcpu *vcpu); 320int kvm_vgic_vcpu_pending_irq(struct kvm_vcpu *vcpu);
321int kvm_vgic_vcpu_active_irq(struct kvm_vcpu *vcpu);
309bool vgic_handle_mmio(struct kvm_vcpu *vcpu, struct kvm_run *run, 322bool vgic_handle_mmio(struct kvm_vcpu *vcpu, struct kvm_run *run,
310 struct kvm_exit_mmio *mmio); 323 struct kvm_exit_mmio *mmio);
311 324