@@ -315,7 +315,7 @@ extern bool vgic_to_sgi(struct vcpu *v, register_t sgir,
enum gic_sgi_mode irqmode, int virq,
const struct sgi_target *target);
extern bool vgic_migrate_irq(struct vcpu *old, struct vcpu *new, unsigned int irq);
-extern void vgic_check_inflight_irqs_pending(struct domain *d, struct vcpu *v,
+extern void vgic_check_inflight_irqs_pending(struct vcpu *v,
unsigned int rank, uint32_t r);
#endif /* !CONFIG_NEW_VGIC */
@@ -483,7 +483,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ICPENDR, DABT_WORD);
if ( rank == NULL ) goto write_ignore;
- vgic_check_inflight_irqs_pending(v->domain, v, rank->index, r);
+ vgic_check_inflight_irqs_pending(v, rank->index, r);
goto write_ignore;
@@ -820,7 +820,7 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
rank = vgic_rank_offset(v, 1, reg - GICD_ICPENDR, DABT_WORD);
if ( rank == NULL ) goto write_ignore;
- vgic_check_inflight_irqs_pending(v->domain, v, rank->index, r);
+ vgic_check_inflight_irqs_pending(v, rank->index, r);
goto write_ignore;
@@ -720,13 +720,9 @@ unsigned int vgic_max_vcpus(unsigned int domctl_vgic_version)
}
}
-void vgic_check_inflight_irqs_pending(struct domain *d, struct vcpu *v,
- unsigned int rank, uint32_t r)
+void vgic_check_inflight_irqs_pending(struct vcpu *v, unsigned int rank, uint32_t r)
{
- const unsigned long mask = r;
- unsigned int i;
-
- bitmap_for_each ( i, &mask, 32 )
+ for_each_set_bit ( i, r )
{
struct pending_irq *p;
struct vcpu *v_target;
... which is better optimised for scalar values, rather than using the arbitrary-sized bitmap helpers. Additionally, unlike other vgic helpers, this takes both a domain and vcpu pointer. The domain parameter isn't used, and the callers pass v->domain. Strip out the domain pointer. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> --- CC: Stefano Stabellini <sstabellini@kernel.org> CC: Julien Grall <julien@xen.org> CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com> CC: Bertrand Marquis <bertrand.marquis@arm.com> CC: Michal Orzel <michal.orzel@amd.com> --- xen/arch/arm/include/asm/vgic.h | 2 +- xen/arch/arm/vgic-v2.c | 2 +- xen/arch/arm/vgic-v3.c | 2 +- xen/arch/arm/vgic.c | 8 ++------ 4 files changed, 5 insertions(+), 9 deletions(-)