Commit c011f4ea106b94e5499358b62d8c2d74f7e184f9
Committed by
Marc Zyngier
1 parent
5ec17fbac6
KVM: arm/arm64: Check vcpu redist base before registering an iodev
As we are going to register several redist regions, vgic_register_all_redist_iodevs() may be called several times. We need to register a redist_iodev for a given vcpu only once. So let's check if the base address has already been set. Initialize this latter in kvm_vgic_vcpu_init(). Signed-off-by: Eric Auger <eric.auger@redhat.com> Acked-by: Christoffer Dall <christoffer.dall@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Showing 2 changed files with 6 additions and 0 deletions Side-by-side Diff
virt/kvm/arm/vgic/vgic-init.c
virt/kvm/arm/vgic/vgic-mmio-v3.c
... | ... | @@ -592,6 +592,9 @@ |
592 | 592 | gpa_t rd_base, sgi_base; |
593 | 593 | int ret; |
594 | 594 | |
595 | + if (!IS_VGIC_ADDR_UNDEF(vgic_cpu->rd_iodev.base_addr)) | |
596 | + return 0; | |
597 | + | |
595 | 598 | /* |
596 | 599 | * We may be creating VCPUs before having set the base address for the |
597 | 600 | * redistributor region, in which case we will come back to this |