Skip to content

Commit

Permalink
KVM: arm/arm64: GICv4: Propagate affinity changes to the physical ITS
Browse files Browse the repository at this point in the history
When the guest issues an affinity change, we need to tell the physical
ITS that we're now targetting a new vcpu.  This is done by extracting
the current mapping, updating the target, and reapplying the mapping.

Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
  • Loading branch information
Marc Zyngier authored and Christoffer Dall committed Nov 10, 2017
1 parent 07b46ed commit 0fc9a58
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion virt/kvm/arm/vgic/vgic-its.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,25 @@ static int vgic_copy_lpi_list(struct kvm_vcpu *vcpu, u32 **intid_ptr)

static int update_affinity(struct vgic_irq *irq, struct kvm_vcpu *vcpu)
{
int ret = 0;

spin_lock(&irq->irq_lock);
irq->target_vcpu = vcpu;
spin_unlock(&irq->irq_lock);

return 0;
if (irq->hw) {
struct its_vlpi_map map;

ret = its_get_vlpi(irq->host_irq, &map);
if (ret)
return ret;

map.vpe = &vcpu->arch.vgic_cpu.vgic_v3.its_vpe;

ret = its_map_vlpi(irq->host_irq, &map);
}

return ret;
}

/*
Expand Down

0 comments on commit 0fc9a58

Please sign in to comment.