Skip to contentSkip to conversation

x86: provide enabled and disabled variation of the PCID test

PATCH In review Paolo Bonzini 3 participants 4 messages Feb 5, 2020 KVM

lore
Share & tools
lore

Paolo Bonzini

author maintainer
#0 lore raw

PATCH 1/1 x86: provide enabled and disabled variation of the PCID test

The PCID test checks for exceptions when PCID=0 or INVPCID=0 in CPUID. Cover that by adding a separate testcase with different CPUID.

---
 x86/unittests.cfg | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
x86/unittests.cfg +6 -1
index aae1523..f2401eb 100644
@@ -228,7 +228,12 @@ extra_params = --append "10000000 `date +%s`"
 
 [pcid]
 file = pcid.flat
-extra_params = -cpu qemu64,+pcid
+extra_params = -cpu qemu64,+pcid,+invpcid
+arch = x86_64
+
+[pcid-disabled]
+file = pcid.flat
+extra_params = -cpu qemu64,-pcid,-invpcid
 arch = x86_64
 
 [rdpru]
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 15 lines · Paolo Bonzini

The PCID test checks for exceptions when PCID=0 or INVPCID=0 in CPUID. Cover that by adding a separate testcase with different CPUID.

---
 x86/unittests.cfg | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
x86/unittests.cfg +0 -0
index aae1523..f2401eb 100644
@@ -228,7 +228,12 @@ extra_params = --append "10000000 `date +%s`"
 

x86/unittests.cfg extra_params = --append "10000000 `date +%s`" · line 237

Quoted 10 lines
x86/unittests.cfg +6 -1
 [pcid]
 file = pcid.flat
-extra_params = -cpu qemu64,+pcid
+extra_params = -cpu qemu64,+pcid,+invpcid
+arch = x86_64
+
+[pcid-disabled]
+file = pcid.flat
+extra_params = -cpu qemu64,-pcid,-invpcid
 arch = x86_64

Hrm, but "-cpu qemu64,-pcid,+invpcid" is arguably the more interesting test from a KVM perspective because of the logic in KVM to hide invpcid if pcid isn't supported.

And +pcid,-invpcid is also interesting.

Is there an easy-ish change that can be made to allow iterating over multiple CPU configurations for single test case?

#2 lore raw
Quoted 31 lines · Sean Christopherson
Quoted 15 lines · Paolo Bonzini

The PCID test checks for exceptions when PCID=0 or INVPCID=0 in CPUID. Cover that by adding a separate testcase with different CPUID.

---
 x86/unittests.cfg | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
x86/unittests.cfg +0 -0
index aae1523..f2401eb 100644
@@ -228,7 +228,12 @@ extra_params = --append "10000000 `date +%s`"
 

x86/unittests.cfg extra_params = --append "10000000 `date +%s`" · line 237

Quoted 10 lines
x86/unittests.cfg +6 -1
 [pcid]
 file = pcid.flat
-extra_params = -cpu qemu64,+pcid
+extra_params = -cpu qemu64,+pcid,+invpcid
+arch = x86_64
+
+[pcid-disabled]
+file = pcid.flat
+extra_params = -cpu qemu64,-pcid,-invpcid
 arch = x86_64

Hrm, but "-cpu qemu64,-pcid,+invpcid" is arguably the more interesting test from a KVM perspective because of the logic in KVM to hide invpcid if pcid isn't supported.

Quoted 5 lines

And +pcid,-invpcid is also interesting.

Is there an easy-ish change that can be made to allow iterating over multiple CPU configurations for single test case?

Just a small change to Paolo's patch

[pcid]
file = pcid.flat
extra_params = -cpu qemu64,+pcid,+invpcid
arch = x86_64
group = pcid

[pcid-disabled]
file = pcid.flat
extra_params = -cpu qemu64,-pcid,-invpcid
arch = x86_64
group = pcid

[pcid-more-interesting]
file = pcid.flat
extra_params = -cpu qemu64,-pcid,+invpcid
arch = x86_64
group = pcid

Then run the group with ./run_tests.sh -g pcid

Thanks,
drew

#3 lore raw
Quoted 52 lines · Andrew Jones
Quoted 31 lines · Sean Christopherson
Quoted 15 lines · Paolo Bonzini

The PCID test checks for exceptions when PCID=0 or INVPCID=0 in CPUID. Cover that by adding a separate testcase with different CPUID.

---
 x86/unittests.cfg | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
x86/unittests.cfg +0 -0
index aae1523..f2401eb 100644
@@ -228,7 +228,12 @@ extra_params = --append "10000000 `date +%s`"
 

x86/unittests.cfg extra_params = --append "10000000 `date +%s`" · line 237

Quoted 10 lines
x86/unittests.cfg +6 -1
 [pcid]
 file = pcid.flat
-extra_params = -cpu qemu64,+pcid
+extra_params = -cpu qemu64,+pcid,+invpcid
+arch = x86_64
+
+[pcid-disabled]
+file = pcid.flat
+extra_params = -cpu qemu64,-pcid,-invpcid
 arch = x86_64

Hrm, but "-cpu qemu64,-pcid,+invpcid" is arguably the more interesting test from a KVM perspective because of the logic in KVM to hide invpcid if pcid isn't supported.

Quoted 5 lines

And +pcid,-invpcid is also interesting.

Is there an easy-ish change that can be made to allow iterating over multiple CPU configurations for single test case?

Just a small change to Paolo's patch

[pcid]
file = pcid.flat
extra_params = -cpu qemu64,+pcid,+invpcid
arch = x86_64
group = pcid

[pcid-disabled]
file = pcid.flat
extra_params = -cpu qemu64,-pcid,-invpcid
arch = x86_64
group = pcid

Quoted 7 lines

[pcid-more-interesting]
file = pcid.flat
extra_params = -cpu qemu64,-pcid,+invpcid
arch = x86_64
group = pcid

Then run the group with ./run_tests.sh -g pcid

Ya, I was thinking more long term, e.g. syntax like:

[pcid]
file = pcid.flat
permute_features = pcid,invpcid
arch = x86_64

In general, I would love to have infrastructure to permute over *all* the interesting bits of KVM, e.g. module params and whatnot.