diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2017-10-27 10:28:42 -0400 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2017-11-10 03:29:37 -0500 |
commit | 0fc9a58ee45532e7a298c7aa626b3fe5ff8cdf87 (patch) | |
tree | 25e1a002ba7def8f2cccd74d38e24eee0cd5da6f | |
parent | 07b46ed116cf0893200c97db2f72e0f7839b7f91 (diff) |
KVM: arm/arm64: GICv4: Propagate affinity changes to the physical ITS
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>
-rw-r--r-- | virt/kvm/arm/vgic/vgic-its.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c index ad14af8a4412..80bea7021e2e 100644 --- a/virt/kvm/arm/vgic/vgic-its.c +++ b/virt/kvm/arm/vgic/vgic-its.c | |||
@@ -338,11 +338,25 @@ static int vgic_copy_lpi_list(struct kvm_vcpu *vcpu, u32 **intid_ptr) | |||
338 | 338 | ||
339 | static int update_affinity(struct vgic_irq *irq, struct kvm_vcpu *vcpu) | 339 | static int update_affinity(struct vgic_irq *irq, struct kvm_vcpu *vcpu) |
340 | { | 340 | { |
341 | int ret = 0; | ||
342 | |||
341 | spin_lock(&irq->irq_lock); | 343 | spin_lock(&irq->irq_lock); |
342 | irq->target_vcpu = vcpu; | 344 | irq->target_vcpu = vcpu; |
343 | spin_unlock(&irq->irq_lock); | 345 | spin_unlock(&irq->irq_lock); |
344 | 346 | ||
345 | return 0; | 347 | if (irq->hw) { |
348 | struct its_vlpi_map map; | ||
349 | |||
350 | ret = its_get_vlpi(irq->host_irq, &map); | ||
351 | if (ret) | ||
352 | return ret; | ||
353 | |||
354 | map.vpe = &vcpu->arch.vgic_cpu.vgic_v3.its_vpe; | ||
355 | |||
356 | ret = its_map_vlpi(irq->host_irq, &map); | ||
357 | } | ||
358 | |||
359 | return ret; | ||
346 | } | 360 | } |
347 | 361 | ||
348 | /* | 362 | /* |