diff options
author | Eric Auger <eric.auger@redhat.com> | 2018-05-22 10:55:14 +0300 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2018-05-25 14:29:27 +0300 |
commit | c011f4ea106b94e5499358b62d8c2d74f7e184f9 (patch) | |
tree | a4b656fb03fe9d7059a1c51a11118d14ea112d2c /virt/kvm/arm/vgic/vgic-init.c | |
parent | 5ec17fbac6713be82b90f54d5a31251803fd8de5 (diff) | |
download | linux-c011f4ea106b94e5499358b62d8c2d74f7e184f9.tar.xz |
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>
Diffstat (limited to 'virt/kvm/arm/vgic/vgic-init.c')
-rw-r--r-- | virt/kvm/arm/vgic/vgic-init.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/virt/kvm/arm/vgic/vgic-init.c b/virt/kvm/arm/vgic/vgic-init.c index 272af9704952..2673efce65f3 100644 --- a/virt/kvm/arm/vgic/vgic-init.c +++ b/virt/kvm/arm/vgic/vgic-init.c @@ -199,6 +199,9 @@ int kvm_vgic_vcpu_init(struct kvm_vcpu *vcpu) int ret = 0; int i; + vgic_cpu->rd_iodev.base_addr = VGIC_ADDR_UNDEF; + vgic_cpu->sgi_iodev.base_addr = VGIC_ADDR_UNDEF; + INIT_LIST_HEAD(&vgic_cpu->ap_list_head); spin_lock_init(&vgic_cpu->ap_list_lock); |