]> xenbits.xensource.com Git - people/julieng/linux-arm.git/commitdiff
KVM: arm/arm64: make GIC frame address initialization model specific
authorAndre Przywara <andre.przywara@arm.com>
Fri, 10 Jul 2015 14:21:41 +0000 (15:21 +0100)
committerJulien Grall <julien.grall@citrix.com>
Mon, 28 Sep 2015 11:05:12 +0000 (12:05 +0100)
Currently we initialize all the possible GIC frame addresses in one
function, without looking at the specific GIC model we instantiate
for the guest.
As this gets confusing when adding another VGIC model later, lets
move these initializations into the respective model's init functions.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
virt/kvm/arm/vgic-v2-emul.c
virt/kvm/arm/vgic-v3-emul.c
virt/kvm/arm/vgic.c

index 13907970d11c3a94b8dc0a5b1848973035cc41cf..8faa28c93d825ac8cf8b0c14feb5fcc6bc3a46d4 100644 (file)
@@ -567,6 +567,9 @@ void vgic_v2_init_emulation(struct kvm *kvm)
        dist->vm_ops.init_model = vgic_v2_init_model;
        dist->vm_ops.map_resources = vgic_v2_map_resources;
 
+       dist->vgic_cpu_base = VGIC_ADDR_UNDEF;
+       dist->vgic_dist_base = VGIC_ADDR_UNDEF;
+
        kvm->arch.max_vcpus = VGIC_V2_MAX_CPUS;
 }
 
index d2eeb203af0942e5dda4bb7c9b1c34b29dda2062..1f42348c2f70e7a2b622e5b79b35e273112b73ae 100644 (file)
@@ -885,6 +885,9 @@ void vgic_v3_init_emulation(struct kvm *kvm)
        dist->vm_ops.destroy_model = vgic_v3_destroy_model;
        dist->vm_ops.map_resources = vgic_v3_map_resources;
 
+       dist->vgic_dist_base = VGIC_ADDR_UNDEF;
+       dist->vgic_redist_base = VGIC_ADDR_UNDEF;
+
        kvm->arch.max_vcpus = KVM_MAX_VCPUS;
 }
 
index cc8f5edfe89d4474584f03660d173951b76b66cf..59f1801d3357788fa431f8f0956877c8dcf47a8c 100644 (file)
@@ -1830,9 +1830,6 @@ int kvm_vgic_create(struct kvm *kvm, u32 type)
        kvm->arch.vgic.in_kernel = true;
        kvm->arch.vgic.vgic_model = type;
        kvm->arch.vgic.vctrl_base = vgic->vctrl_base;
-       kvm->arch.vgic.vgic_dist_base = VGIC_ADDR_UNDEF;
-       kvm->arch.vgic.vgic_cpu_base = VGIC_ADDR_UNDEF;
-       kvm->arch.vgic.vgic_redist_base = VGIC_ADDR_UNDEF;
 
 out_unlock:
        for (; vcpu_lock_idx >= 0; vcpu_lock_idx--) {