KVM: arm64: vgic: Use vcpu_idx for the debug information
authorMarc Zyngier <maz@kernel.org>
Wed, 27 Sep 2023 09:09:05 +0000 (10:09 +0100)
committerOliver Upton <oliver.upton@linux.dev>
Sat, 30 Sep 2023 18:15:43 +0000 (18:15 +0000)
When dumping the debug information, use vcpu_idx instead of vcpu_id,
as this is independent of any userspace influence.

Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230927090911.3355209-6-maz@kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/vgic/vgic-debug.c

index 07aa0437125a60b318f626abb556e35f635c11bc..85606a531dc3987fc04c18a179c577efd2113ff8 100644 (file)
@@ -166,7 +166,7 @@ static void print_header(struct seq_file *s, struct vgic_irq *irq,
 
        if (vcpu) {
                hdr = "VCPU";
-               id = vcpu->vcpu_id;
+               id = vcpu->vcpu_idx;
        }
 
        seq_printf(s, "\n");
@@ -212,7 +212,7 @@ static void print_irq_state(struct seq_file *s, struct vgic_irq *irq,
                      "     %2d "
                      "\n",
                        type, irq->intid,
-                       (irq->target_vcpu) ? irq->target_vcpu->vcpu_id : -1,
+                       (irq->target_vcpu) ? irq->target_vcpu->vcpu_idx : -1,
                        pending,
                        irq->line_level,
                        irq->active,
@@ -224,7 +224,7 @@ static void print_irq_state(struct seq_file *s, struct vgic_irq *irq,
                        irq->mpidr,
                        irq->source,
                        irq->priority,
-                       (irq->vcpu) ? irq->vcpu->vcpu_id : -1);
+                       (irq->vcpu) ? irq->vcpu->vcpu_idx : -1);
 }
 
 static int vgic_debug_show(struct seq_file *s, void *v)