All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] KVM: selftests: Report enable_pmu module value when test is skipped
@ 2023-02-14  8:49 Like Xu
  2023-02-14  8:49 ` [PATCH 1/2] KVM: selftests: Add a helper to read kvm boolean module parameters Like Xu
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Like Xu @ 2023-02-14  8:49 UTC (permalink / raw)
  To: Sean Christopherson; +Cc: Paolo Bonzini, kvm, linux-kernel

Adequate info can help developers quickly distinguish whether the cause
is a code flaw or a platform limitation when a test fails or is skipped,
and this minor patch-set is doing a little work in that direction.

Base: kvm-x86/next

Like Xu (2):
  KVM: selftests: Add a helper to read kvm boolean module parameters
  KVM: selftests: Report enable_pmu module value when test is skipped

 tools/testing/selftests/kvm/include/kvm_util_base.h        | 1 +
 tools/testing/selftests/kvm/lib/kvm_util.c                 | 5 +++++
 tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c | 1 +
 3 files changed, 7 insertions(+)

-- 
2.39.1


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

* [PATCH 1/2] KVM: selftests: Add a helper to read kvm boolean module parameters
  2023-02-14  8:49 [PATCH 0/2] KVM: selftests: Report enable_pmu module value when test is skipped Like Xu
@ 2023-02-14  8:49 ` Like Xu
  2023-02-14  8:49 ` [PATCH 2/2] KVM: selftests: Report enable_pmu module value when test is skipped Like Xu
  2023-03-24 20:58 ` [PATCH 0/2] " Sean Christopherson
  2 siblings, 0 replies; 6+ messages in thread
From: Like Xu @ 2023-02-14  8:49 UTC (permalink / raw)
  To: Sean Christopherson; +Cc: Paolo Bonzini, kvm, linux-kernel

From: Like Xu <likexu@tencent.com>

Add a helper function for reading kvm boolean module parameters values.
No functional change intended.

Signed-off-by: Like Xu <likexu@tencent.com>
---
 tools/testing/selftests/kvm/include/kvm_util_base.h | 1 +
 tools/testing/selftests/kvm/lib/kvm_util.c          | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/tools/testing/selftests/kvm/include/kvm_util_base.h b/tools/testing/selftests/kvm/include/kvm_util_base.h
index fbc2a79369b8..a089c356f354 100644
--- a/tools/testing/selftests/kvm/include/kvm_util_base.h
+++ b/tools/testing/selftests/kvm/include/kvm_util_base.h
@@ -213,6 +213,7 @@ extern const struct vm_guest_mode_params vm_guest_mode_params[];
 int open_path_or_exit(const char *path, int flags);
 int open_kvm_dev_path_or_exit(void);
 
+bool get_kvm_param_bool(const char *param);
 bool get_kvm_intel_param_bool(const char *param);
 bool get_kvm_amd_param_bool(const char *param);
 
diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c
index 403ea0ee77ac..fae0c76c344a 100644
--- a/tools/testing/selftests/kvm/lib/kvm_util.c
+++ b/tools/testing/selftests/kvm/lib/kvm_util.c
@@ -80,6 +80,11 @@ static bool get_module_param_bool(const char *module_name, const char *param)
 	TEST_FAIL("Unrecognized value '%c' for boolean module param", value);
 }
 
+bool get_kvm_param_bool(const char *param)
+{
+	return get_module_param_bool("kvm", param);
+}
+
 bool get_kvm_intel_param_bool(const char *param)
 {
 	return get_module_param_bool("kvm_intel", param);
-- 
2.39.1


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

* [PATCH 2/2] KVM: selftests: Report enable_pmu module value when test is skipped
  2023-02-14  8:49 [PATCH 0/2] KVM: selftests: Report enable_pmu module value when test is skipped Like Xu
  2023-02-14  8:49 ` [PATCH 1/2] KVM: selftests: Add a helper to read kvm boolean module parameters Like Xu
@ 2023-02-14  8:49 ` Like Xu
  2023-02-14 18:03   ` Sean Christopherson
  2023-03-24 20:58 ` [PATCH 0/2] " Sean Christopherson
  2 siblings, 1 reply; 6+ messages in thread
From: Like Xu @ 2023-02-14  8:49 UTC (permalink / raw)
  To: Sean Christopherson; +Cc: Paolo Bonzini, kvm, linux-kernel

From: Like Xu <likexu@tencent.com>

Running x86_64/pmu_event_filter_test with enable_pmu globally disabled
will report the following skipping prompt:
	1..0 # SKIP - Requirement not met: use_intel_pmu() || use_amd_pmu()
this can be confusing, so add a check on enable_pmu.

Signed-off-by: Like Xu <likexu@tencent.com>
---
 tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c b/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c
index bad7ef8c5b92..070bc8a60a7f 100644
--- a/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c
+++ b/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c
@@ -771,6 +771,7 @@ int main(int argc, char *argv[])
 	TEST_REQUIRE(kvm_has_cap(KVM_CAP_PMU_EVENT_FILTER));
 	TEST_REQUIRE(kvm_has_cap(KVM_CAP_PMU_EVENT_MASKED_EVENTS));
 
+	TEST_REQUIRE(get_kvm_param_bool("enable_pmu"));
 	TEST_REQUIRE(use_intel_pmu() || use_amd_pmu());
 	guest_code = use_intel_pmu() ? intel_guest_code : amd_guest_code;
 
-- 
2.39.1


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

* Re: [PATCH 2/2] KVM: selftests: Report enable_pmu module value when test is skipped
  2023-02-14  8:49 ` [PATCH 2/2] KVM: selftests: Report enable_pmu module value when test is skipped Like Xu
@ 2023-02-14 18:03   ` Sean Christopherson
  0 siblings, 0 replies; 6+ messages in thread
From: Sean Christopherson @ 2023-02-14 18:03 UTC (permalink / raw)
  To: Like Xu; +Cc: Paolo Bonzini, kvm, linux-kernel

On Tue, Feb 14, 2023, Like Xu wrote:
> From: Like Xu <likexu@tencent.com>
> 
> Running x86_64/pmu_event_filter_test with enable_pmu globally disabled
> will report the following skipping prompt:
> 	1..0 # SKIP - Requirement not met: use_intel_pmu() || use_amd_pmu()
> this can be confusing, so add a check on enable_pmu.
> 
> Signed-off-by: Like Xu <likexu@tencent.com>
> ---
>  tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c b/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c
> index bad7ef8c5b92..070bc8a60a7f 100644
> --- a/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c
> +++ b/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c
> @@ -771,6 +771,7 @@ int main(int argc, char *argv[])
>  	TEST_REQUIRE(kvm_has_cap(KVM_CAP_PMU_EVENT_FILTER));
>  	TEST_REQUIRE(kvm_has_cap(KVM_CAP_PMU_EVENT_MASKED_EVENTS));
>  
> +	TEST_REQUIRE(get_kvm_param_bool("enable_pmu"));

I think it makes sense to put this at the very top, just in case more requirements
that depend on enable_pmu get added in the future.  I can do that when applying.

I'll plan on grabbing this for 6.4.

Thanks!

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

* Re: [PATCH 0/2] KVM: selftests: Report enable_pmu module value when test is skipped
  2023-02-14  8:49 [PATCH 0/2] KVM: selftests: Report enable_pmu module value when test is skipped Like Xu
  2023-02-14  8:49 ` [PATCH 1/2] KVM: selftests: Add a helper to read kvm boolean module parameters Like Xu
  2023-02-14  8:49 ` [PATCH 2/2] KVM: selftests: Report enable_pmu module value when test is skipped Like Xu
@ 2023-03-24 20:58 ` Sean Christopherson
  2023-03-24 21:25   ` Sean Christopherson
  2 siblings, 1 reply; 6+ messages in thread
From: Sean Christopherson @ 2023-03-24 20:58 UTC (permalink / raw)
  To: Sean Christopherson, Like Xu; +Cc: Paolo Bonzini, kvm, linux-kernel

On Tue, 14 Feb 2023 16:49:18 +0800, Like Xu wrote:
> Adequate info can help developers quickly distinguish whether the cause
> is a code flaw or a platform limitation when a test fails or is skipped,
> and this minor patch-set is doing a little work in that direction.
> 
> Base: kvm-x86/next
> 
> Like Xu (2):
>   KVM: selftests: Add a helper to read kvm boolean module parameters
>   KVM: selftests: Report enable_pmu module value when test is skipped
> 
> [...]

Applied to kvm-x86 selftests, thanks!

[1/2] KVM: selftests: Add a helper to read kvm boolean module parameters
      https://github.com/kvm-x86/linux/commit/d14d9139c023
[2/2] KVM: selftests: Report enable_pmu module value when test is skipped
      https://github.com/kvm-x86/linux/commit/6cf332e8eca6

--
https://github.com/kvm-x86/linux/tree/next
https://github.com/kvm-x86/linux/tree/fixes

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

* Re: [PATCH 0/2] KVM: selftests: Report enable_pmu module value when test is skipped
  2023-03-24 20:58 ` [PATCH 0/2] " Sean Christopherson
@ 2023-03-24 21:25   ` Sean Christopherson
  0 siblings, 0 replies; 6+ messages in thread
From: Sean Christopherson @ 2023-03-24 21:25 UTC (permalink / raw)
  To: Like Xu; +Cc: Paolo Bonzini, kvm, linux-kernel

On Fri, Mar 24, 2023, Sean Christopherson wrote:
> On Tue, 14 Feb 2023 16:49:18 +0800, Like Xu wrote:
> > Adequate info can help developers quickly distinguish whether the cause
> > is a code flaw or a platform limitation when a test fails or is skipped,
> > and this minor patch-set is doing a little work in that direction.
> > 
> > Base: kvm-x86/next
> > 
> > Like Xu (2):
> >   KVM: selftests: Add a helper to read kvm boolean module parameters
> >   KVM: selftests: Report enable_pmu module value when test is skipped
> > 
> > [...]
> 
> Applied to kvm-x86 selftests, thanks!
> 
> [1/2] KVM: selftests: Add a helper to read kvm boolean module parameters
>       https://github.com/kvm-x86/linux/commit/d14d9139c023
> [2/2] KVM: selftests: Report enable_pmu module value when test is skipped
>       https://github.com/kvm-x86/linux/commit/6cf332e8eca6

Replaced patch 2 with your v2:

  KVM: selftests: Report enable_pmu module value when test is skipped
  https://github.com/kvm-x86/linux/commit/5b1abc285a08

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

end of thread, other threads:[~2023-03-24 21:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-14  8:49 [PATCH 0/2] KVM: selftests: Report enable_pmu module value when test is skipped Like Xu
2023-02-14  8:49 ` [PATCH 1/2] KVM: selftests: Add a helper to read kvm boolean module parameters Like Xu
2023-02-14  8:49 ` [PATCH 2/2] KVM: selftests: Report enable_pmu module value when test is skipped Like Xu
2023-02-14 18:03   ` Sean Christopherson
2023-03-24 20:58 ` [PATCH 0/2] " Sean Christopherson
2023-03-24 21:25   ` Sean Christopherson

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.