Skip to content

Commit

Permalink
KVM: arm/arm64: Fixup userspace irqchip static key optimization
Browse files Browse the repository at this point in the history
When I introduced a static key to avoid work in the critical path for
userspace irqchips which is very rarely used, I accidentally messed up
my logic and used && where I should have used ||, because the point was
to short-circuit the evaluation in case userspace irqchips weren't even
in use.

This fixes an issue when running in-kernel irqchip VMs alongside
userspace irqchip VMs.

Acked-by: Marc Zyngier <[email protected]>
Fixes: c44c232ee2d3 ("KVM: arm/arm64: Avoid work when userspace iqchips are not used")
Signed-off-by: Christoffer Dall <[email protected]>
  • Loading branch information
chazy committed Jan 31, 2018
1 parent f1d7231 commit cd15d20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion virt/kvm/arm/arch_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ static void kvm_timer_update_irq(struct kvm_vcpu *vcpu, bool new_level,
trace_kvm_timer_update_irq(vcpu->vcpu_id, timer_ctx->irq.irq,
timer_ctx->irq.level);

if (!static_branch_unlikely(&userspace_irqchip_in_use) &&
if (!static_branch_unlikely(&userspace_irqchip_in_use) ||
likely(irqchip_in_kernel(vcpu->kvm))) {
ret = kvm_vgic_inject_irq(vcpu->kvm, vcpu->vcpu_id,
timer_ctx->irq.irq,
Expand Down

0 comments on commit cd15d20

Please sign in to comment.