File tree Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -55,8 +55,9 @@ struct vgic_global kvm_vgic_global_state __ro_after_init = {
55
55
*/
56
56
57
57
/*
58
- * Iterate over the VM's list of mapped LPIs to find the one with a
59
- * matching interrupt ID and return a reference to the IRQ structure.
58
+ * Index the VM's xarray of mapped LPIs and return a reference to the IRQ
59
+ * structure. The caller is expected to call vgic_put_irq() later once it's
60
+ * finished with the IRQ.
60
61
*/
61
62
static struct vgic_irq * vgic_get_lpi (struct kvm * kvm , u32 intid )
62
63
{
@@ -66,20 +67,10 @@ static struct vgic_irq *vgic_get_lpi(struct kvm *kvm, u32 intid)
66
67
67
68
raw_spin_lock_irqsave (& dist -> lpi_list_lock , flags );
68
69
69
- list_for_each_entry (irq , & dist -> lpi_list_head , lpi_list ) {
70
- if (irq -> intid != intid )
71
- continue ;
72
-
73
- /*
74
- * This increases the refcount, the caller is expected to
75
- * call vgic_put_irq() later once it's finished with the IRQ.
76
- */
70
+ irq = xa_load (& dist -> lpi_xa , intid );
71
+ if (irq )
77
72
vgic_get_irq_kref (irq );
78
- goto out_unlock ;
79
- }
80
- irq = NULL ;
81
73
82
- out_unlock :
83
74
raw_spin_unlock_irqrestore (& dist -> lpi_list_lock , flags );
84
75
85
76
return irq ;
You can’t perform that action at this time.
0 commit comments