All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] KVM: selftests: a couple fixes
@ 2021-07-13 20:37 ` Andrew Jones
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Jones @ 2021-07-13 20:37 UTC (permalink / raw)
  To: kvm, kvmarm; +Cc: maz, pbonzini

The first removes a compiler warning. The second does what a 6 patch
patch series wanted to do, but apparently got too distracted with
the preparation refactoring to actually do...

Andrew Jones (2):
  KVM: selftests: change pthread_yield to sched_yield
  KVM: arm64: selftests: get-reg-list: actually enable pmu regs in pmu
    sublist

 tools/testing/selftests/kvm/aarch64/get-reg-list.c | 3 ++-
 tools/testing/selftests/kvm/steal_time.c           | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

-- 
2.31.1


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

* [PATCH 0/2] KVM: selftests: a couple fixes
@ 2021-07-13 20:37 ` Andrew Jones
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Jones @ 2021-07-13 20:37 UTC (permalink / raw)
  To: kvm, kvmarm; +Cc: maz, pbonzini

The first removes a compiler warning. The second does what a 6 patch
patch series wanted to do, but apparently got too distracted with
the preparation refactoring to actually do...

Andrew Jones (2):
  KVM: selftests: change pthread_yield to sched_yield
  KVM: arm64: selftests: get-reg-list: actually enable pmu regs in pmu
    sublist

 tools/testing/selftests/kvm/aarch64/get-reg-list.c | 3 ++-
 tools/testing/selftests/kvm/steal_time.c           | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

-- 
2.31.1

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

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

* [PATCH 1/2] KVM: selftests: change pthread_yield to sched_yield
  2021-07-13 20:37 ` Andrew Jones
@ 2021-07-13 20:37   ` Andrew Jones
  -1 siblings, 0 replies; 10+ messages in thread
From: Andrew Jones @ 2021-07-13 20:37 UTC (permalink / raw)
  To: kvm, kvmarm; +Cc: maz, pbonzini

With later GCC we get

 steal_time.c: In function ‘main’:
 steal_time.c:323:25: warning: ‘pthread_yield’ is deprecated: pthread_yield is deprecated, use sched_yield instead [-Wdeprecated-declarations]

Let's follow the instructions and use sched_yield instead.

Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 tools/testing/selftests/kvm/steal_time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/kvm/steal_time.c b/tools/testing/selftests/kvm/steal_time.c
index b0031f2d38fd..ecec30865a74 100644
--- a/tools/testing/selftests/kvm/steal_time.c
+++ b/tools/testing/selftests/kvm/steal_time.c
@@ -320,7 +320,7 @@ int main(int ac, char **av)
 		run_delay = get_run_delay();
 		pthread_create(&thread, &attr, do_steal_time, NULL);
 		do
-			pthread_yield();
+			sched_yield();
 		while (get_run_delay() - run_delay < MIN_RUN_DELAY_NS);
 		pthread_join(thread, NULL);
 		run_delay = get_run_delay() - run_delay;
-- 
2.31.1


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

* [PATCH 1/2] KVM: selftests: change pthread_yield to sched_yield
@ 2021-07-13 20:37   ` Andrew Jones
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Jones @ 2021-07-13 20:37 UTC (permalink / raw)
  To: kvm, kvmarm; +Cc: maz, pbonzini

With later GCC we get

 steal_time.c: In function ‘main’:
 steal_time.c:323:25: warning: ‘pthread_yield’ is deprecated: pthread_yield is deprecated, use sched_yield instead [-Wdeprecated-declarations]

Let's follow the instructions and use sched_yield instead.

Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 tools/testing/selftests/kvm/steal_time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/kvm/steal_time.c b/tools/testing/selftests/kvm/steal_time.c
index b0031f2d38fd..ecec30865a74 100644
--- a/tools/testing/selftests/kvm/steal_time.c
+++ b/tools/testing/selftests/kvm/steal_time.c
@@ -320,7 +320,7 @@ int main(int ac, char **av)
 		run_delay = get_run_delay();
 		pthread_create(&thread, &attr, do_steal_time, NULL);
 		do
-			pthread_yield();
+			sched_yield();
 		while (get_run_delay() - run_delay < MIN_RUN_DELAY_NS);
 		pthread_join(thread, NULL);
 		run_delay = get_run_delay() - run_delay;
-- 
2.31.1

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

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

* [PATCH 2/2] KVM: arm64: selftests: get-reg-list: actually enable pmu regs in pmu sublist
  2021-07-13 20:37 ` Andrew Jones
@ 2021-07-13 20:37   ` Andrew Jones
  -1 siblings, 0 replies; 10+ messages in thread
From: Andrew Jones @ 2021-07-13 20:37 UTC (permalink / raw)
  To: kvm, kvmarm; +Cc: maz, pbonzini

We reworked get-reg-list to make it easier to enable optional register
sublists by parametrizing their vcpu feature flags as well as making
other generalizations. That was all to make sure we enable the PMU
registers when we want to test them. Somehow we forgot to actually
include the PMU feature flag in the PMU sublist description though!
Do that now.

Fixes: 313673bad871 ("KVM: arm64: selftests: get-reg-list: Split base and pmu registers")
Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 tools/testing/selftests/kvm/aarch64/get-reg-list.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/kvm/aarch64/get-reg-list.c b/tools/testing/selftests/kvm/aarch64/get-reg-list.c
index a16c8f05366c..cc898181faab 100644
--- a/tools/testing/selftests/kvm/aarch64/get-reg-list.c
+++ b/tools/testing/selftests/kvm/aarch64/get-reg-list.c
@@ -1019,7 +1019,8 @@ static __u64 sve_rejects_set[] = {
 #define VREGS_SUBLIST \
 	{ "vregs", .regs = vregs, .regs_n = ARRAY_SIZE(vregs), }
 #define PMU_SUBLIST \
-	{ "pmu", .regs = pmu_regs, .regs_n = ARRAY_SIZE(pmu_regs), }
+	{ "pmu", .capability = KVM_CAP_ARM_PMU_V3, .feature = KVM_ARM_VCPU_PMU_V3, \
+	  .regs = pmu_regs, .regs_n = ARRAY_SIZE(pmu_regs), }
 #define SVE_SUBLIST \
 	{ "sve", .capability = KVM_CAP_ARM_SVE, .feature = KVM_ARM_VCPU_SVE, .finalize = true, \
 	  .regs = sve_regs, .regs_n = ARRAY_SIZE(sve_regs), \
-- 
2.31.1


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

* [PATCH 2/2] KVM: arm64: selftests: get-reg-list: actually enable pmu regs in pmu sublist
@ 2021-07-13 20:37   ` Andrew Jones
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Jones @ 2021-07-13 20:37 UTC (permalink / raw)
  To: kvm, kvmarm; +Cc: maz, pbonzini

We reworked get-reg-list to make it easier to enable optional register
sublists by parametrizing their vcpu feature flags as well as making
other generalizations. That was all to make sure we enable the PMU
registers when we want to test them. Somehow we forgot to actually
include the PMU feature flag in the PMU sublist description though!
Do that now.

Fixes: 313673bad871 ("KVM: arm64: selftests: get-reg-list: Split base and pmu registers")
Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 tools/testing/selftests/kvm/aarch64/get-reg-list.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/kvm/aarch64/get-reg-list.c b/tools/testing/selftests/kvm/aarch64/get-reg-list.c
index a16c8f05366c..cc898181faab 100644
--- a/tools/testing/selftests/kvm/aarch64/get-reg-list.c
+++ b/tools/testing/selftests/kvm/aarch64/get-reg-list.c
@@ -1019,7 +1019,8 @@ static __u64 sve_rejects_set[] = {
 #define VREGS_SUBLIST \
 	{ "vregs", .regs = vregs, .regs_n = ARRAY_SIZE(vregs), }
 #define PMU_SUBLIST \
-	{ "pmu", .regs = pmu_regs, .regs_n = ARRAY_SIZE(pmu_regs), }
+	{ "pmu", .capability = KVM_CAP_ARM_PMU_V3, .feature = KVM_ARM_VCPU_PMU_V3, \
+	  .regs = pmu_regs, .regs_n = ARRAY_SIZE(pmu_regs), }
 #define SVE_SUBLIST \
 	{ "sve", .capability = KVM_CAP_ARM_SVE, .feature = KVM_ARM_VCPU_SVE, .finalize = true, \
 	  .regs = sve_regs, .regs_n = ARRAY_SIZE(sve_regs), \
-- 
2.31.1

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

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

* Re: [PATCH 2/2] KVM: arm64: selftests: get-reg-list: actually enable pmu regs in pmu sublist
  2021-07-13 20:37   ` Andrew Jones
@ 2021-07-14 10:53     ` Marc Zyngier
  -1 siblings, 0 replies; 10+ messages in thread
From: Marc Zyngier @ 2021-07-14 10:53 UTC (permalink / raw)
  To: Andrew Jones; +Cc: kvm, kvmarm, pbonzini

On 2021-07-13 21:37, Andrew Jones wrote:
> We reworked get-reg-list to make it easier to enable optional register
> sublists by parametrizing their vcpu feature flags as well as making
> other generalizations. That was all to make sure we enable the PMU
> registers when we want to test them. Somehow we forgot to actually
> include the PMU feature flag in the PMU sublist description though!
> Do that now.

Ah! :D

> 
> Fixes: 313673bad871 ("KVM: arm64: selftests: get-reg-list: Split base
> and pmu registers")
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> ---
>  tools/testing/selftests/kvm/aarch64/get-reg-list.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/kvm/aarch64/get-reg-list.c
> b/tools/testing/selftests/kvm/aarch64/get-reg-list.c
> index a16c8f05366c..cc898181faab 100644
> --- a/tools/testing/selftests/kvm/aarch64/get-reg-list.c
> +++ b/tools/testing/selftests/kvm/aarch64/get-reg-list.c
> @@ -1019,7 +1019,8 @@ static __u64 sve_rejects_set[] = {
>  #define VREGS_SUBLIST \
>  	{ "vregs", .regs = vregs, .regs_n = ARRAY_SIZE(vregs), }
>  #define PMU_SUBLIST \
> -	{ "pmu", .regs = pmu_regs, .regs_n = ARRAY_SIZE(pmu_regs), }
> +	{ "pmu", .capability = KVM_CAP_ARM_PMU_V3, .feature = 
> KVM_ARM_VCPU_PMU_V3, \
> +	  .regs = pmu_regs, .regs_n = ARRAY_SIZE(pmu_regs), }
>  #define SVE_SUBLIST \
>  	{ "sve", .capability = KVM_CAP_ARM_SVE, .feature = KVM_ARM_VCPU_SVE,
> .finalize = true, \
>  	  .regs = sve_regs, .regs_n = ARRAY_SIZE(sve_regs), \

Good timing, I'm queuing fixes. I'll pick those in a moment.

Thanks,

         M.
-- 
Jazz is not dead. It just smells funny...

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

* Re: [PATCH 2/2] KVM: arm64: selftests: get-reg-list: actually enable pmu regs in pmu sublist
@ 2021-07-14 10:53     ` Marc Zyngier
  0 siblings, 0 replies; 10+ messages in thread
From: Marc Zyngier @ 2021-07-14 10:53 UTC (permalink / raw)
  To: Andrew Jones; +Cc: pbonzini, kvmarm, kvm

On 2021-07-13 21:37, Andrew Jones wrote:
> We reworked get-reg-list to make it easier to enable optional register
> sublists by parametrizing their vcpu feature flags as well as making
> other generalizations. That was all to make sure we enable the PMU
> registers when we want to test them. Somehow we forgot to actually
> include the PMU feature flag in the PMU sublist description though!
> Do that now.

Ah! :D

> 
> Fixes: 313673bad871 ("KVM: arm64: selftests: get-reg-list: Split base
> and pmu registers")
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> ---
>  tools/testing/selftests/kvm/aarch64/get-reg-list.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/kvm/aarch64/get-reg-list.c
> b/tools/testing/selftests/kvm/aarch64/get-reg-list.c
> index a16c8f05366c..cc898181faab 100644
> --- a/tools/testing/selftests/kvm/aarch64/get-reg-list.c
> +++ b/tools/testing/selftests/kvm/aarch64/get-reg-list.c
> @@ -1019,7 +1019,8 @@ static __u64 sve_rejects_set[] = {
>  #define VREGS_SUBLIST \
>  	{ "vregs", .regs = vregs, .regs_n = ARRAY_SIZE(vregs), }
>  #define PMU_SUBLIST \
> -	{ "pmu", .regs = pmu_regs, .regs_n = ARRAY_SIZE(pmu_regs), }
> +	{ "pmu", .capability = KVM_CAP_ARM_PMU_V3, .feature = 
> KVM_ARM_VCPU_PMU_V3, \
> +	  .regs = pmu_regs, .regs_n = ARRAY_SIZE(pmu_regs), }
>  #define SVE_SUBLIST \
>  	{ "sve", .capability = KVM_CAP_ARM_SVE, .feature = KVM_ARM_VCPU_SVE,
> .finalize = true, \
>  	  .regs = sve_regs, .regs_n = ARRAY_SIZE(sve_regs), \

Good timing, I'm queuing fixes. I'll pick those in a moment.

Thanks,

         M.
-- 
Jazz is not dead. It just smells funny...
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

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

* Re: [PATCH 0/2] KVM: selftests: a couple fixes
  2021-07-13 20:37 ` Andrew Jones
@ 2021-07-14 10:56   ` Marc Zyngier
  -1 siblings, 0 replies; 10+ messages in thread
From: Marc Zyngier @ 2021-07-14 10:56 UTC (permalink / raw)
  To: kvmarm, Andrew Jones, kvm; +Cc: pbonzini

On Tue, 13 Jul 2021 22:37:40 +0200, Andrew Jones wrote:
> The first removes a compiler warning. The second does what a 6 patch
> patch series wanted to do, but apparently got too distracted with
> the preparation refactoring to actually do...
> 
> Andrew Jones (2):
>   KVM: selftests: change pthread_yield to sched_yield
>   KVM: arm64: selftests: get-reg-list: actually enable pmu regs in pmu
>     sublist
> 
> [...]

Applied to fixes, thanks!

[1/2] KVM: selftests: change pthread_yield to sched_yield
      commit: bac0b135907855e9f8c032877c3df3c60885a08f
[2/2] KVM: arm64: selftests: get-reg-list: actually enable pmu regs in pmu sublist
      commit: 5cf17746b302aa32a4f200cc6ce38865bfe4cf94

Cheers,

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



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

* Re: [PATCH 0/2] KVM: selftests: a couple fixes
@ 2021-07-14 10:56   ` Marc Zyngier
  0 siblings, 0 replies; 10+ messages in thread
From: Marc Zyngier @ 2021-07-14 10:56 UTC (permalink / raw)
  To: kvmarm, Andrew Jones, kvm; +Cc: pbonzini

On Tue, 13 Jul 2021 22:37:40 +0200, Andrew Jones wrote:
> The first removes a compiler warning. The second does what a 6 patch
> patch series wanted to do, but apparently got too distracted with
> the preparation refactoring to actually do...
> 
> Andrew Jones (2):
>   KVM: selftests: change pthread_yield to sched_yield
>   KVM: arm64: selftests: get-reg-list: actually enable pmu regs in pmu
>     sublist
> 
> [...]

Applied to fixes, thanks!

[1/2] KVM: selftests: change pthread_yield to sched_yield
      commit: bac0b135907855e9f8c032877c3df3c60885a08f
[2/2] KVM: arm64: selftests: get-reg-list: actually enable pmu regs in pmu sublist
      commit: 5cf17746b302aa32a4f200cc6ce38865bfe4cf94

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] 10+ messages in thread

end of thread, other threads:[~2021-07-14 10:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-13 20:37 [PATCH 0/2] KVM: selftests: a couple fixes Andrew Jones
2021-07-13 20:37 ` Andrew Jones
2021-07-13 20:37 ` [PATCH 1/2] KVM: selftests: change pthread_yield to sched_yield Andrew Jones
2021-07-13 20:37   ` Andrew Jones
2021-07-13 20:37 ` [PATCH 2/2] KVM: arm64: selftests: get-reg-list: actually enable pmu regs in pmu sublist Andrew Jones
2021-07-13 20:37   ` Andrew Jones
2021-07-14 10:53   ` Marc Zyngier
2021-07-14 10:53     ` Marc Zyngier
2021-07-14 10:56 ` [PATCH 0/2] KVM: selftests: a couple fixes Marc Zyngier
2021-07-14 10:56   ` 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.