diff options
author | Christoffer Dall <christoffer.dall@linaro.org> | 2018-01-12 05:40:21 -0500 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2018-01-12 05:40:21 -0500 |
commit | f8f85dc00b7427de6222ea3955c52512315d13cd (patch) | |
tree | 56be5a7ae60ad2c3b59074e8add00fa73992ef0d /virt | |
parent | c507babf10ead4d5c8cca704539b170752a8ac84 (diff) |
KVM: arm64: Fix GICv4 init when called from vgic_its_create
Commit 3d1ad640f8c94 ("KVM: arm/arm64: Fix GICv4 ITS initialization
issues") moved the vgic_supports_direct_msis() check in vgic_v4_init().
However when vgic_v4_init is called from vgic_its_create(), the has_its
field is not yet set. Hence vgic_supports_direct_msis returns false and
vgic_v4_init does nothing.
The gic/its init sequence is a bit messy, so let's be specific about the
prerequisite checks in the various call paths instead of relying on a
common wrapper.
Fixes: 3d1ad640f8c94 ("KVM: arm/arm64: Fix GICv4 ITS initialization issues")
Reported-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/arm/vgic/vgic-init.c | 8 | ||||
-rw-r--r-- | virt/kvm/arm/vgic/vgic-v4.c | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/virt/kvm/arm/vgic/vgic-init.c b/virt/kvm/arm/vgic/vgic-init.c index 62310122ee78..743ca5cb05ef 100644 --- a/virt/kvm/arm/vgic/vgic-init.c +++ b/virt/kvm/arm/vgic/vgic-init.c | |||
@@ -285,9 +285,11 @@ int vgic_init(struct kvm *kvm) | |||
285 | if (ret) | 285 | if (ret) |
286 | goto out; | 286 | goto out; |
287 | 287 | ||
288 | ret = vgic_v4_init(kvm); | 288 | if (vgic_has_its(kvm)) { |
289 | if (ret) | 289 | ret = vgic_v4_init(kvm); |
290 | goto out; | 290 | if (ret) |
291 | goto out; | ||
292 | } | ||
291 | 293 | ||
292 | kvm_for_each_vcpu(i, vcpu, kvm) | 294 | kvm_for_each_vcpu(i, vcpu, kvm) |
293 | kvm_vgic_vcpu_enable(vcpu); | 295 | kvm_vgic_vcpu_enable(vcpu); |
diff --git a/virt/kvm/arm/vgic/vgic-v4.c b/virt/kvm/arm/vgic/vgic-v4.c index 4a37292855bc..bc4265154bac 100644 --- a/virt/kvm/arm/vgic/vgic-v4.c +++ b/virt/kvm/arm/vgic/vgic-v4.c | |||
@@ -118,7 +118,7 @@ int vgic_v4_init(struct kvm *kvm) | |||
118 | struct kvm_vcpu *vcpu; | 118 | struct kvm_vcpu *vcpu; |
119 | int i, nr_vcpus, ret; | 119 | int i, nr_vcpus, ret; |
120 | 120 | ||
121 | if (!vgic_supports_direct_msis(kvm)) | 121 | if (!kvm_vgic_global_state.has_gicv4) |
122 | return 0; /* Nothing to see here... move along. */ | 122 | return 0; /* Nothing to see here... move along. */ |
123 | 123 | ||
124 | if (dist->its_vm.vpes) | 124 | if (dist->its_vm.vpes) |