Commit ce5b5b05 authored by Marc Zyngier's avatar Marc Zyngier

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: default avatarMarc Zyngier <maz@kernel.org>
parents 7b6871f6 440523b9
...@@ -763,10 +763,12 @@ static int vgic_register_all_redist_iodevs(struct kvm *kvm) ...@@ -763,10 +763,12 @@ static int vgic_register_all_redist_iodevs(struct kvm *kvm)
} }
if (ret) { if (ret) {
/* The current c failed, so we start with the previous one. */ /* The current c failed, so iterate over the previous ones. */
int i;
mutex_lock(&kvm->slots_lock); mutex_lock(&kvm->slots_lock);
for (c--; c >= 0; c--) { for (i = 0; i < c; i++) {
vcpu = kvm_get_vcpu(kvm, c); vcpu = kvm_get_vcpu(kvm, i);
vgic_unregister_redist_iodev(vcpu); vgic_unregister_redist_iodev(vcpu);
} }
mutex_unlock(&kvm->slots_lock); mutex_unlock(&kvm->slots_lock);
......
...@@ -293,12 +293,12 @@ int vgic_v2_map_resources(struct kvm *kvm) ...@@ -293,12 +293,12 @@ int vgic_v2_map_resources(struct kvm *kvm)
if (IS_VGIC_ADDR_UNDEF(dist->vgic_dist_base) || if (IS_VGIC_ADDR_UNDEF(dist->vgic_dist_base) ||
IS_VGIC_ADDR_UNDEF(dist->vgic_cpu_base)) { IS_VGIC_ADDR_UNDEF(dist->vgic_cpu_base)) {
kvm_err("Need to set vgic cpu and dist addresses first\n"); kvm_debug("Need to set vgic cpu and dist addresses first\n");
return -ENXIO; return -ENXIO;
} }
if (!vgic_v2_check_base(dist->vgic_dist_base, dist->vgic_cpu_base)) { if (!vgic_v2_check_base(dist->vgic_dist_base, dist->vgic_cpu_base)) {
kvm_err("VGIC CPU and dist frames overlap\n"); kvm_debug("VGIC CPU and dist frames overlap\n");
return -EINVAL; return -EINVAL;
} }
......
...@@ -554,12 +554,12 @@ int vgic_v3_map_resources(struct kvm *kvm) ...@@ -554,12 +554,12 @@ int vgic_v3_map_resources(struct kvm *kvm)
} }
if (IS_VGIC_ADDR_UNDEF(dist->vgic_dist_base)) { if (IS_VGIC_ADDR_UNDEF(dist->vgic_dist_base)) {
kvm_err("Need to set vgic distributor addresses first\n"); kvm_debug("Need to set vgic distributor addresses first\n");
return -ENXIO; return -ENXIO;
} }
if (!vgic_v3_check_base(kvm)) { if (!vgic_v3_check_base(kvm)) {
kvm_err("VGIC redist and dist frames overlap\n"); kvm_debug("VGIC redist and dist frames overlap\n");
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment