* [PATCH] KVM: arm64: Improve out-of-order sysreg table diagnostics
@ 2024-04-10 15:25 ` Marc Zyngier
0 siblings, 0 replies; 6+ messages in thread
From: Marc Zyngier @ 2024-04-10 15:25 UTC (permalink / raw)
To: kvmarm, linux-arm-kernel
Cc: James Morse, Suzuki K Poulose, Oliver Upton, Zenghui Yu
Adding new entries to our system register tables is a painful exercise,
as we require them to be ordered by Op0,Op1,CRn,CRm,Op2.
If an entry is misordered, we output an error that indicates the
pointer to the entry and the number *of the last valid one*.
That's not very helpful, and would be much better if we printed the
number of the *offending* entry as well as its name (which is present
in the vast majority of the cases).
This makes debugging new additions to the tables much easier.
Signed-off-by: Marc Zyngier <maz@kernel.org>
---
arch/arm64/kvm/sys_regs.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
index a23f4e935a2e..60f548d8572e 100644
--- a/arch/arm64/kvm/sys_regs.c
+++ b/arch/arm64/kvm/sys_regs.c
@@ -3920,12 +3920,14 @@ static bool check_sysreg_table(const struct sys_reg_desc *table, unsigned int n,
for (i = 0; i < n; i++) {
if (!is_32 && table[i].reg && !table[i].reset) {
- kvm_err("sys_reg table %pS entry %d lacks reset\n", &table[i], i);
+ kvm_err("sys_reg table %pS entry %d (%s) lacks reset\n",
+ &table[i], i, table[i].name);
return false;
}
if (i && cmp_sys_reg(&table[i-1], &table[i]) >= 0) {
- kvm_err("sys_reg table %pS entry %d out of order\n", &table[i - 1], i - 1);
+ kvm_err("sys_reg table %pS entry %d (%s -> %s) out of order\n",
+ &table[i], i, table[i - 1].name, table[i].name);
return false;
}
}
--
2.39.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH] KVM: arm64: Improve out-of-order sysreg table diagnostics
@ 2024-04-10 15:25 ` Marc Zyngier
0 siblings, 0 replies; 6+ messages in thread
From: Marc Zyngier @ 2024-04-10 15:25 UTC (permalink / raw)
To: kvmarm, linux-arm-kernel
Cc: James Morse, Suzuki K Poulose, Oliver Upton, Zenghui Yu
Adding new entries to our system register tables is a painful exercise,
as we require them to be ordered by Op0,Op1,CRn,CRm,Op2.
If an entry is misordered, we output an error that indicates the
pointer to the entry and the number *of the last valid one*.
That's not very helpful, and would be much better if we printed the
number of the *offending* entry as well as its name (which is present
in the vast majority of the cases).
This makes debugging new additions to the tables much easier.
Signed-off-by: Marc Zyngier <maz@kernel.org>
---
arch/arm64/kvm/sys_regs.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
index a23f4e935a2e..60f548d8572e 100644
--- a/arch/arm64/kvm/sys_regs.c
+++ b/arch/arm64/kvm/sys_regs.c
@@ -3920,12 +3920,14 @@ static bool check_sysreg_table(const struct sys_reg_desc *table, unsigned int n,
for (i = 0; i < n; i++) {
if (!is_32 && table[i].reg && !table[i].reset) {
- kvm_err("sys_reg table %pS entry %d lacks reset\n", &table[i], i);
+ kvm_err("sys_reg table %pS entry %d (%s) lacks reset\n",
+ &table[i], i, table[i].name);
return false;
}
if (i && cmp_sys_reg(&table[i-1], &table[i]) >= 0) {
- kvm_err("sys_reg table %pS entry %d out of order\n", &table[i - 1], i - 1);
+ kvm_err("sys_reg table %pS entry %d (%s -> %s) out of order\n",
+ &table[i], i, table[i - 1].name, table[i].name);
return false;
}
}
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] KVM: arm64: Improve out-of-order sysreg table diagnostics
2024-04-10 15:25 ` Marc Zyngier
@ 2024-04-11 3:03 ` Zenghui Yu
-1 siblings, 0 replies; 6+ messages in thread
From: Zenghui Yu @ 2024-04-11 3:03 UTC (permalink / raw)
To: Marc Zyngier
Cc: kvmarm, linux-arm-kernel, James Morse, Suzuki K Poulose,
Oliver Upton
On 2024/4/10 23:25, Marc Zyngier wrote:
> Adding new entries to our system register tables is a painful exercise,
> as we require them to be ordered by Op0,Op1,CRn,CRm,Op2.
>
> If an entry is misordered, we output an error that indicates the
> pointer to the entry and the number *of the last valid one*.
>
> That's not very helpful, and would be much better if we printed the
> number of the *offending* entry as well as its name (which is present
> in the vast majority of the cases).
>
> This makes debugging new additions to the tables much easier.
>
> Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
Thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] KVM: arm64: Improve out-of-order sysreg table diagnostics
@ 2024-04-11 3:03 ` Zenghui Yu
0 siblings, 0 replies; 6+ messages in thread
From: Zenghui Yu @ 2024-04-11 3:03 UTC (permalink / raw)
To: Marc Zyngier
Cc: kvmarm, linux-arm-kernel, James Morse, Suzuki K Poulose,
Oliver Upton
On 2024/4/10 23:25, Marc Zyngier wrote:
> Adding new entries to our system register tables is a painful exercise,
> as we require them to be ordered by Op0,Op1,CRn,CRm,Op2.
>
> If an entry is misordered, we output an error that indicates the
> pointer to the entry and the number *of the last valid one*.
>
> That's not very helpful, and would be much better if we printed the
> number of the *offending* entry as well as its name (which is present
> in the vast majority of the cases).
>
> This makes debugging new additions to the tables much easier.
>
> Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
Thanks.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] KVM: arm64: Improve out-of-order sysreg table diagnostics
2024-04-10 15:25 ` Marc Zyngier
@ 2024-04-14 9:00 ` Marc Zyngier
-1 siblings, 0 replies; 6+ messages in thread
From: Marc Zyngier @ 2024-04-14 9:00 UTC (permalink / raw)
To: kvmarm, linux-arm-kernel, Marc Zyngier
Cc: James Morse, Suzuki K Poulose, Oliver Upton, Zenghui Yu
On Wed, 10 Apr 2024 16:25:03 +0100, Marc Zyngier wrote:
> Adding new entries to our system register tables is a painful exercise,
> as we require them to be ordered by Op0,Op1,CRn,CRm,Op2.
>
> If an entry is misordered, we output an error that indicates the
> pointer to the entry and the number *of the last valid one*.
>
> That's not very helpful, and would be much better if we printed the
> number of the *offending* entry as well as its name (which is present
> in the vast majority of the cases).
>
> [...]
Applied to next, thanks!
[1/1] KVM: arm64: Improve out-of-order sysreg table diagnostics
commit: a88a9ec1729a4687370856567919e1ab79a02483
Cheers,
M.
--
Without deviation from the norm, progress is not possible.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] KVM: arm64: Improve out-of-order sysreg table diagnostics
@ 2024-04-14 9:00 ` Marc Zyngier
0 siblings, 0 replies; 6+ messages in thread
From: Marc Zyngier @ 2024-04-14 9:00 UTC (permalink / raw)
To: kvmarm, linux-arm-kernel, Marc Zyngier
Cc: James Morse, Suzuki K Poulose, Oliver Upton, Zenghui Yu
On Wed, 10 Apr 2024 16:25:03 +0100, Marc Zyngier wrote:
> Adding new entries to our system register tables is a painful exercise,
> as we require them to be ordered by Op0,Op1,CRn,CRm,Op2.
>
> If an entry is misordered, we output an error that indicates the
> pointer to the entry and the number *of the last valid one*.
>
> That's not very helpful, and would be much better if we printed the
> number of the *offending* entry as well as its name (which is present
> in the vast majority of the cases).
>
> [...]
Applied to next, thanks!
[1/1] KVM: arm64: Improve out-of-order sysreg table diagnostics
commit: a88a9ec1729a4687370856567919e1ab79a02483
Cheers,
M.
--
Without deviation from the norm, progress is not possible.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-04-14 9:01 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-10 15:25 [PATCH] KVM: arm64: Improve out-of-order sysreg table diagnostics Marc Zyngier
2024-04-10 15:25 ` Marc Zyngier
2024-04-11 3:03 ` Zenghui Yu
2024-04-11 3:03 ` Zenghui Yu
2024-04-14 9:00 ` Marc Zyngier
2024-04-14 9:00 ` Marc Zyngier
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.