Skip to content

Commit ce5b5b0

Browse files
author
Marc Zyngier
committed
Merge branch kvm-arm64/vgic-fixes-5.17 into kvmarm-master/next
* kvm-arm64/vgic-fixes-5.17: : . : A few vgic fixes: : - Harden vgic-v3 error handling paths against signed vs unsigned : comparison that will happen once the xarray-based vcpus are in : - Demote userspace-triggered console output to kvm_debug() : . KVM: arm64: vgic: Demote userspace-triggered console prints to kvm_debug() KVM: arm64: vgic-v3: Fix vcpu index comparison Signed-off-by: Marc Zyngier <[email protected]>
2 parents 7b6871f + 440523b commit ce5b5b0

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

arch/arm64/kvm/vgic/vgic-mmio-v3.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -763,10 +763,12 @@ static int vgic_register_all_redist_iodevs(struct kvm *kvm)
763763
}
764764

765765
if (ret) {
766-
/* The current c failed, so we start with the previous one. */
766+
/* The current c failed, so iterate over the previous ones. */
767+
int i;
768+
767769
mutex_lock(&kvm->slots_lock);
768-
for (c--; c >= 0; c--) {
769-
vcpu = kvm_get_vcpu(kvm, c);
770+
for (i = 0; i < c; i++) {
771+
vcpu = kvm_get_vcpu(kvm, i);
770772
vgic_unregister_redist_iodev(vcpu);
771773
}
772774
mutex_unlock(&kvm->slots_lock);

arch/arm64/kvm/vgic/vgic-v2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,12 @@ int vgic_v2_map_resources(struct kvm *kvm)
293293

294294
if (IS_VGIC_ADDR_UNDEF(dist->vgic_dist_base) ||
295295
IS_VGIC_ADDR_UNDEF(dist->vgic_cpu_base)) {
296-
kvm_err("Need to set vgic cpu and dist addresses first\n");
296+
kvm_debug("Need to set vgic cpu and dist addresses first\n");
297297
return -ENXIO;
298298
}
299299

300300
if (!vgic_v2_check_base(dist->vgic_dist_base, dist->vgic_cpu_base)) {
301-
kvm_err("VGIC CPU and dist frames overlap\n");
301+
kvm_debug("VGIC CPU and dist frames overlap\n");
302302
return -EINVAL;
303303
}
304304

arch/arm64/kvm/vgic/vgic-v3.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,12 +554,12 @@ int vgic_v3_map_resources(struct kvm *kvm)
554554
}
555555

556556
if (IS_VGIC_ADDR_UNDEF(dist->vgic_dist_base)) {
557-
kvm_err("Need to set vgic distributor addresses first\n");
557+
kvm_debug("Need to set vgic distributor addresses first\n");
558558
return -ENXIO;
559559
}
560560

561561
if (!vgic_v3_check_base(kvm)) {
562-
kvm_err("VGIC redist and dist frames overlap\n");
562+
kvm_debug("VGIC redist and dist frames overlap\n");
563563
return -EINVAL;
564564
}
565565

0 commit comments

Comments
 (0)