mbox series

[kvm-unit-tests,0/3] Fix up test failures induced by !enable_pmu

Message ID 20220609083916.36658-1-weijiang.yang@intel.com (mailing list archive)
Headers show
Series Fix up test failures induced by !enable_pmu | expand

Message

Yang, Weijiang June 9, 2022, 8:39 a.m. UTC
When pmu is disabled via enable_pmu=0, some perf related MSRs or instructions
are not available to VM, this results into some test failures, fix them in
this series.

Patches were tested with below config:

kernel:
kvm/queue, commit 5e9402ac128b371635478fd2bb04342d4dbf0d74

qemu:
master, commit 9b1f58854959c5a9bdb347e3e04c252ab7fc9ef5

platform:
Skylake/Sapphire Rapids

Yang Weijiang (3):
  x86: Remove perf enable bit from default config
  x86: Skip running test when pmu is disabled
  x86: Skip perf related tests when pmu is disabled

 x86/msr.c       |  4 +++-
 x86/pmu_lbr.c   |  4 +++-
 x86/vmx_tests.c | 24 ++++++++++++++++++++++++
 3 files changed, 30 insertions(+), 2 deletions(-)


base-commit: 2eed0bf1096077144cc3a0dd9974689487f9511a

Comments

Like Xu June 10, 2022, 12:02 a.m. UTC | #1
On 9/6/2022 4:39 pm, Yang Weijiang wrote:
> When pmu is disabled via enable_pmu=0, some perf related MSRs or instructions
> are not available to VM, this results into some test failures, fix them in
> this series.

How about applying it in the x86/unittests.cfg:

	check = /sys/module/kvm/parameters/enable_pmu=N

and add another pmu_disable.flat to cover all those unavailable expectations ?
Yang, Weijiang June 10, 2022, 6:29 a.m. UTC | #2
On 6/10/2022 8:02 AM, Like Xu wrote:
> On 9/6/2022 4:39 pm, Yang Weijiang wrote:
>> When pmu is disabled via enable_pmu=0, some perf related MSRs or 
>> instructions
>> are not available to VM, this results into some test failures, fix 
>> them in
>> this series.
>
> How about applying it in the x86/unittests.cfg:
>
>     check = /sys/module/kvm/parameters/enable_pmu=N

I'm afraid you mean check enable_pmu=Y for those failing tests?

Let's not hide the defects of the code :-)

>
> and add another pmu_disable.flat to cover all those unavailable 
> expectations ?

A standalone test for !enable_pmu is a good idea, but the checklist is open,

it may be added to the _TODO_ list.