All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: selftests: get-reg-list: Add KVM_REG_ARM_FW_REG(3)
@ 2022-03-16 12:51 Andrew Jones
  2022-03-16 14:34 ` Marc Zyngier
  2022-04-07  9:47 ` Marc Zyngier
  0 siblings, 2 replies; 3+ messages in thread
From: Andrew Jones @ 2022-03-16 12:51 UTC (permalink / raw)
  To: kvmarm; +Cc: maz

When testing a kernel with commit a5905d6af492 ("KVM: arm64:
Allow SMCCC_ARCH_WORKAROUND_3 to be discovered and migrated")
get-reg-list output

vregs: Number blessed registers:   234
vregs: Number registers:           238

vregs: There are 1 new registers.
Consider adding them to the blessed reg list with the following lines:

	KVM_REG_ARM_FW_REG(3),

vregs: PASS
...

That output inspired two changes: 1) add the new register to the
blessed list and 2) explain why "Number registers" is actually four
larger than "Number blessed registers" (on the system used for
testing), even though only one register is being stated as new.
The reason is that some registers are host dependent and they get
filtered out when comparing with the blessed list. The system
used for the test apparently had three filtered registers.

Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 tools/testing/selftests/kvm/aarch64/get-reg-list.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/kvm/aarch64/get-reg-list.c b/tools/testing/selftests/kvm/aarch64/get-reg-list.c
index f769fc6cd927..7efe918ded9e 100644
--- a/tools/testing/selftests/kvm/aarch64/get-reg-list.c
+++ b/tools/testing/selftests/kvm/aarch64/get-reg-list.c
@@ -503,8 +503,13 @@ static void run_test(struct vcpu_config *c)
 		++missing_regs;
 
 	if (new_regs || missing_regs) {
+		n = 0;
+		for_each_reg_filtered(i)
+			++n;
+
 		printf("%s: Number blessed registers: %5lld\n", config_name(c), blessed_n);
-		printf("%s: Number registers:         %5lld\n", config_name(c), reg_list->n);
+		printf("%s: Number registers:         %5lld (includes %lld filtered registers)\n",
+		       config_name(c), reg_list->n, reg_list->n - n);
 	}
 
 	if (new_regs) {
@@ -683,9 +688,10 @@ static __u64 base_regs[] = {
 	KVM_REG_ARM64 | KVM_REG_SIZE_U64 | KVM_REG_ARM_CORE | KVM_REG_ARM_CORE_REG(spsr[4]),
 	KVM_REG_ARM64 | KVM_REG_SIZE_U32 | KVM_REG_ARM_CORE | KVM_REG_ARM_CORE_REG(fp_regs.fpsr),
 	KVM_REG_ARM64 | KVM_REG_SIZE_U32 | KVM_REG_ARM_CORE | KVM_REG_ARM_CORE_REG(fp_regs.fpcr),
-	KVM_REG_ARM_FW_REG(0),
-	KVM_REG_ARM_FW_REG(1),
-	KVM_REG_ARM_FW_REG(2),
+	KVM_REG_ARM_FW_REG(0),		/* KVM_REG_ARM_PSCI_VERSION */
+	KVM_REG_ARM_FW_REG(1),		/* KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1 */
+	KVM_REG_ARM_FW_REG(2),		/* KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2 */
+	KVM_REG_ARM_FW_REG(3),		/* KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_3 */
 	ARM64_SYS_REG(3, 3, 14, 3, 1),	/* CNTV_CTL_EL0 */
 	ARM64_SYS_REG(3, 3, 14, 3, 2),	/* CNTV_CVAL_EL0 */
 	ARM64_SYS_REG(3, 3, 14, 0, 2),
-- 
2.34.1

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: selftests: get-reg-list: Add KVM_REG_ARM_FW_REG(3)
  2022-03-16 12:51 [PATCH] KVM: selftests: get-reg-list: Add KVM_REG_ARM_FW_REG(3) Andrew Jones
@ 2022-03-16 14:34 ` Marc Zyngier
  2022-04-07  9:47 ` Marc Zyngier
  1 sibling, 0 replies; 3+ messages in thread
From: Marc Zyngier @ 2022-03-16 14:34 UTC (permalink / raw)
  To: Andrew Jones; +Cc: Paolo Bonzini, kvmarm

+Paolo

On Wed, 16 Mar 2022 12:51:29 +0000,
Andrew Jones <drjones@redhat.com> wrote:
> 
> When testing a kernel with commit a5905d6af492 ("KVM: arm64:
> Allow SMCCC_ARCH_WORKAROUND_3 to be discovered and migrated")
> get-reg-list output
> 
> vregs: Number blessed registers:   234
> vregs: Number registers:           238
> 
> vregs: There are 1 new registers.
> Consider adding them to the blessed reg list with the following lines:
> 
> 	KVM_REG_ARM_FW_REG(3),
> 
> vregs: PASS
> ...
> 
> That output inspired two changes: 1) add the new register to the
> blessed list and 2) explain why "Number registers" is actually four
> larger than "Number blessed registers" (on the system used for
> testing), even though only one register is being stated as new.
> The reason is that some registers are host dependent and they get
> filtered out when comparing with the blessed list. The system
> used for the test apparently had three filtered registers.
> 
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> ---
>  tools/testing/selftests/kvm/aarch64/get-reg-list.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/testing/selftests/kvm/aarch64/get-reg-list.c b/tools/testing/selftests/kvm/aarch64/get-reg-list.c
> index f769fc6cd927..7efe918ded9e 100644
> --- a/tools/testing/selftests/kvm/aarch64/get-reg-list.c
> +++ b/tools/testing/selftests/kvm/aarch64/get-reg-list.c
> @@ -503,8 +503,13 @@ static void run_test(struct vcpu_config *c)
>  		++missing_regs;
>  
>  	if (new_regs || missing_regs) {
> +		n = 0;
> +		for_each_reg_filtered(i)
> +			++n;
> +
>  		printf("%s: Number blessed registers: %5lld\n", config_name(c), blessed_n);
> -		printf("%s: Number registers:         %5lld\n", config_name(c), reg_list->n);
> +		printf("%s: Number registers:         %5lld (includes %lld filtered registers)\n",
> +		       config_name(c), reg_list->n, reg_list->n - n);
>  	}
>  
>  	if (new_regs) {
> @@ -683,9 +688,10 @@ static __u64 base_regs[] = {
>  	KVM_REG_ARM64 | KVM_REG_SIZE_U64 | KVM_REG_ARM_CORE | KVM_REG_ARM_CORE_REG(spsr[4]),
>  	KVM_REG_ARM64 | KVM_REG_SIZE_U32 | KVM_REG_ARM_CORE | KVM_REG_ARM_CORE_REG(fp_regs.fpsr),
>  	KVM_REG_ARM64 | KVM_REG_SIZE_U32 | KVM_REG_ARM_CORE | KVM_REG_ARM_CORE_REG(fp_regs.fpcr),
> -	KVM_REG_ARM_FW_REG(0),
> -	KVM_REG_ARM_FW_REG(1),
> -	KVM_REG_ARM_FW_REG(2),
> +	KVM_REG_ARM_FW_REG(0),		/* KVM_REG_ARM_PSCI_VERSION */
> +	KVM_REG_ARM_FW_REG(1),		/* KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1 */
> +	KVM_REG_ARM_FW_REG(2),		/* KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2 */
> +	KVM_REG_ARM_FW_REG(3),		/* KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_3 */
>  	ARM64_SYS_REG(3, 3, 14, 3, 1),	/* CNTV_CTL_EL0 */
>  	ARM64_SYS_REG(3, 3, 14, 3, 2),	/* CNTV_CVAL_EL0 */
>  	ARM64_SYS_REG(3, 3, 14, 0, 2),

Acked-by: Marc Zyngier <maz@kernel.org>

Paolo, I don't have anything pending for 5.17, so feel free to take it
directly into Linus' tree.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: selftests: get-reg-list: Add KVM_REG_ARM_FW_REG(3)
  2022-03-16 12:51 [PATCH] KVM: selftests: get-reg-list: Add KVM_REG_ARM_FW_REG(3) Andrew Jones
  2022-03-16 14:34 ` Marc Zyngier
@ 2022-04-07  9:47 ` Marc Zyngier
  1 sibling, 0 replies; 3+ messages in thread
From: Marc Zyngier @ 2022-04-07  9:47 UTC (permalink / raw)
  To: kvmarm, Andrew Jones

On Wed, 16 Mar 2022 13:51:29 +0100, Andrew Jones wrote:
> When testing a kernel with commit a5905d6af492 ("KVM: arm64:
> Allow SMCCC_ARCH_WORKAROUND_3 to be discovered and migrated")
> get-reg-list output
> 
> vregs: Number blessed registers:   234
> vregs: Number registers:           238
> 
> [...]

Applied to fixes, thanks!

[1/1] KVM: selftests: get-reg-list: Add KVM_REG_ARM_FW_REG(3)
      commit: 02de9331c4d0c6bddac9c5fa66d91f70adf8612b

Cheers,

	M.
-- 
Without deviation from the norm, progress is not possible.


_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-07  9:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16 12:51 [PATCH] KVM: selftests: get-reg-list: Add KVM_REG_ARM_FW_REG(3) Andrew Jones
2022-03-16 14:34 ` Marc Zyngier
2022-04-07  9:47 ` 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.