All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH kvm-unit-tests] x86: use -cpu max instead of -cpu host
@ 2021-01-27  9:52 Paolo Bonzini
  2021-01-27 15:54 ` Thomas Huth
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2021-01-27  9:52 UTC (permalink / raw)
  To: kvm; +Cc: thuth

This allows the tests to run under TCG as well.  "-cpu max" is not available on
CentOS 7, however that doesn't change much for our CI since we weren't testing
the CentOS 7 + KVM combination anyway.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 .gitlab-ci.yml    |  4 +++-
 x86/unittests.cfg | 40 ++++++++++++++++++++--------------------
 2 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8834e59..d97e27e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -75,6 +75,7 @@ build-x86_64:
      vmexit_mov_to_cr8 vmexit_inl_pmtimer  vmexit_ipi vmexit_ipi_halt
      vmexit_ple_round_robin vmexit_tscdeadline vmexit_tscdeadline_immed
      eventinj msr port80 setjmp sieve syscall tsc rmap_chain umip intel_iommu
+     rdpru pku pks smap tsc_adjust xsave
      | tee results.txt
  - if grep -q FAIL results.txt ; then exit 1 ; fi
 
@@ -89,7 +90,7 @@ build-i386:
      cmpxchg8b vmexit_cpuid vmexit_mov_from_cr8 vmexit_mov_to_cr8
      vmexit_inl_pmtimer vmexit_ipi vmexit_ipi_halt vmexit_ple_round_robin
      vmexit_tscdeadline vmexit_tscdeadline_immed eventinj port80 setjmp sieve
-     tsc taskswitch umip
+     tsc taskswitch umip rdpru smap tsc_adjust xsave
      | tee results.txt
  - if grep -q FAIL results.txt ; then exit 1 ; fi
 
@@ -103,6 +104,7 @@ build-clang:
      vmexit_mov_to_cr8 vmexit_inl_pmtimer  vmexit_ipi vmexit_ipi_halt
      vmexit_ple_round_robin vmexit_tscdeadline vmexit_tscdeadline_immed
      eventinj msr port80 setjmp syscall tsc rmap_chain umip intel_iommu
+     rdpru pku pks smap tsc_adjust xsave
      | tee results.txt
  - grep -q PASS results.txt && ! grep -q FAIL results.txt
 
diff --git a/x86/unittests.cfg b/x86/unittests.cfg
index 8c39630..90e370f 100644
--- a/x86/unittests.cfg
+++ b/x86/unittests.cfg
@@ -128,12 +128,12 @@ check = /sys/module/kvm_intel/parameters/allow_smaller_maxphyaddr=Y
 
 [smap]
 file = smap.flat
-extra_params = -cpu host
+extra_params = -cpu max
 
 [pku]
 file = pku.flat
 arch = x86_64
-extra_params = -cpu host
+extra_params = -cpu max
 
 [pks]
 file = pks.flat
@@ -163,7 +163,7 @@ arch = x86_64
 
 [memory]
 file = memory.flat
-extra_params = -cpu host
+extra_params = -cpu max
 arch = x86_64
 
 [msr]
@@ -171,12 +171,12 @@ file = msr.flat
 
 [pmu]
 file = pmu.flat
-extra_params = -cpu host
+extra_params = -cpu max
 check = /proc/sys/kernel/nmi_watchdog=0
 
 [vmware_backdoors]
 file = vmware_backdoors.flat
-extra_params = -machine vmport=on -cpu host
+extra_params = -machine vmport=on -cpu max
 check = /sys/module/kvm/parameters/enable_vmware_backdoor=Y
 arch = x86_64
 
@@ -204,12 +204,12 @@ extra_params = -cpu kvm64,+rdtscp
 
 [tsc_adjust]
 file = tsc_adjust.flat
-extra_params = -cpu host
+extra_params = -cpu max
 
 [xsave]
 file = xsave.flat
 arch = x86_64
-extra_params = -cpu host
+extra_params = -cpu max
 
 [rmap_chain]
 file = rmap_chain.flat
@@ -218,7 +218,7 @@ arch = x86_64
 [svm]
 file = svm.flat
 smp = 2
-extra_params = -cpu host,+svm -m 4g
+extra_params = -cpu max,+svm -m 4g
 arch = x86_64
 
 [taskswitch]
@@ -248,7 +248,7 @@ arch = x86_64
 
 [rdpru]
 file = rdpru.flat
-extra_params = -cpu host
+extra_params = -cpu max
 arch = x86_64
 
 [umip]
@@ -261,33 +261,33 @@ arch = i386
 
 [vmx]
 file = vmx.flat
-extra_params = -cpu host,+vmx -append "-exit_monitor_from_l2_test -ept_access* -vmx_smp* -vmx_vmcs_shadow_test -atomic_switch_overflow_msrs_test -vmx_init_signal_test -vmx_apic_passthrough_tpr_threshold_test"
+extra_params = -cpu max,+vmx -append "-exit_monitor_from_l2_test -ept_access* -vmx_smp* -vmx_vmcs_shadow_test -atomic_switch_overflow_msrs_test -vmx_init_signal_test -vmx_apic_passthrough_tpr_threshold_test"
 arch = x86_64
 groups = vmx
 
 [ept]
 file = vmx.flat
-extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append "ept_access*"
+extra_params = -cpu max,host-phys-bits,+vmx -m 2560 -append "ept_access*"
 arch = x86_64
 groups = vmx
 
 [vmx_eoi_bitmap_ioapic_scan]
 file = vmx.flat
 smp = 2
-extra_params = -cpu host,+vmx -m 2048 -append vmx_eoi_bitmap_ioapic_scan_test
+extra_params = -cpu max,+vmx -m 2048 -append vmx_eoi_bitmap_ioapic_scan_test
 arch = x86_64
 groups = vmx
 
 [vmx_hlt_with_rvi_test]
 file = vmx.flat
-extra_params = -cpu host,+vmx -append vmx_hlt_with_rvi_test
+extra_params = -cpu max,+vmx -append vmx_hlt_with_rvi_test
 arch = x86_64
 groups = vmx
 timeout = 10
 
 [vmx_apicv_test]
 file = vmx.flat
-extra_params = -cpu host,+vmx -append "apic_reg_virt_test virt_x2apic_mode_test"
+extra_params = -cpu max,+vmx -append "apic_reg_virt_test virt_x2apic_mode_test"
 arch = x86_64
 groups = vmx
 timeout = 10
@@ -295,14 +295,14 @@ timeout = 10
 [vmx_apic_passthrough_thread]
 file = vmx.flat
 smp = 2
-extra_params = -cpu host,+vmx -m 2048 -append vmx_apic_passthrough_thread_test
+extra_params = -cpu max,+vmx -m 2048 -append vmx_apic_passthrough_thread_test
 arch = x86_64
 groups = vmx
 
 [vmx_init_signal_test]
 file = vmx.flat
 smp = 2
-extra_params = -cpu host,+vmx -m 2048 -append vmx_init_signal_test
+extra_params = -cpu max,+vmx -m 2048 -append vmx_init_signal_test
 arch = x86_64
 groups = vmx
 timeout = 10
@@ -310,21 +310,21 @@ timeout = 10
 [vmx_sipi_signal_test]
 file = vmx.flat
 smp = 2
-extra_params = -cpu host,+vmx -m 2048 -append vmx_sipi_signal_test
+extra_params = -cpu max,+vmx -m 2048 -append vmx_sipi_signal_test
 arch = x86_64
 groups = vmx
 timeout = 10
 
 [vmx_apic_passthrough_tpr_threshold_test]
 file = vmx.flat
-extra_params = -cpu host,+vmx -m 2048 -append vmx_apic_passthrough_tpr_threshold_test
+extra_params = -cpu max,+vmx -m 2048 -append vmx_apic_passthrough_tpr_threshold_test
 arch = x86_64
 groups = vmx
 timeout = 10
 
 [vmx_vmcs_shadow_test]
 file = vmx.flat
-extra_params = -cpu host,+vmx -append vmx_vmcs_shadow_test
+extra_params = -cpu max,+vmx -append vmx_vmcs_shadow_test
 arch = x86_64
 groups = vmx
 
@@ -367,5 +367,5 @@ extra_params = -M q35,kernel-irqchip=split -device intel-iommu,intremap=on,eim=o
 
 [tsx-ctrl]
 file = tsx-ctrl.flat
-extra_params = -cpu host
+extra_params = -cpu max
 groups = tsx-ctrl
-- 
2.29.2


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

* Re: [PATCH kvm-unit-tests] x86: use -cpu max instead of -cpu host
  2021-01-27  9:52 [PATCH kvm-unit-tests] x86: use -cpu max instead of -cpu host Paolo Bonzini
@ 2021-01-27 15:54 ` Thomas Huth
  2021-01-27 15:58   ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Huth @ 2021-01-27 15:54 UTC (permalink / raw)
  To: Paolo Bonzini, kvm

On 27/01/2021 10.52, Paolo Bonzini wrote:
> This allows the tests to run under TCG as well.  "-cpu max" is not available on
> CentOS 7, however that doesn't change much for our CI since we weren't testing
> the CentOS 7 + KVM combination anyway.

"-cpu max" has been added with QEMU v2.10 ... Wasn't there the possibility 
to install a qemu-kvm-ev package instead of the normal qemu-kvm package on 
CentOS 7 ? qemu-kvm-ev should likely be new enough already, I guess?

Anyway, for this patch:
Reviewed-by: Thomas Huth <thuth@redhat.com>


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

* Re: [PATCH kvm-unit-tests] x86: use -cpu max instead of -cpu host
  2021-01-27 15:54 ` Thomas Huth
@ 2021-01-27 15:58   ` Paolo Bonzini
  0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2021-01-27 15:58 UTC (permalink / raw)
  To: Thomas Huth, kvm

On 27/01/21 16:54, Thomas Huth wrote:
> On 27/01/2021 10.52, Paolo Bonzini wrote:
>> This allows the tests to run under TCG as well.  "-cpu max" is not 
>> available on
>> CentOS 7, however that doesn't change much for our CI since we weren't 
>> testing
>> the CentOS 7 + KVM combination anyway.
> 
> "-cpu max" has been added with QEMU v2.10 ... Wasn't there the 
> possibility to install a qemu-kvm-ev package instead of the normal 
> qemu-kvm package on CentOS 7 ? qemu-kvm-ev should likely be new enough 
> already, I guess?

Yes, that would work too.  I'm not sure if that version would also be 
able to run emulated SMAP or PKRU tests.

However, runnning on old TCG is of limited use because it's bound to 
encounter emulation bugs.  It is of course useful to have a smoke test 
to ensure that we don't encounter compilation issues, of course!

Paolo


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

end of thread, other threads:[~2021-01-27 16:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-27  9:52 [PATCH kvm-unit-tests] x86: use -cpu max instead of -cpu host Paolo Bonzini
2021-01-27 15:54 ` Thomas Huth
2021-01-27 15:58   ` Paolo Bonzini

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.