diff mbox series

[kvm-unit-tests,02/15] KVM: x86/config: Consolidate EPT access tests into a single test

Message ID 20190212233451.27740-3-sean.j.christopherson@intel.com (mailing list archive)
State New, archived
Headers show
Series KVM: clean up the nVMX config | expand

Commit Message

Sean Christopherson Feb. 12, 2019, 11:34 p.m. UTC
Defining individual testcases in the config for each individual test in
vmx.flat has proven to be a maintenance nightmare, e.g. has led to poor
test configurations due to naive copy+paste.  For example, many VMX
tests specify "-m 2560" or "-m 2048" even though only the EPT access
tests actually require >2gb of memory.  Take advantage of vmx.flat's
simple glob parsing to create a single testcase for the EPC access
tests.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 x86/unittests.cfg | 126 +++-------------------------------------------
 1 file changed, 6 insertions(+), 120 deletions(-)

Comments

Liam Merwick Feb. 14, 2019, 5:33 p.m. UTC | #1
On 12/02/2019 23:34, Sean Christopherson wrote:
> Defining individual testcases in the config for each individual test in
> vmx.flat has proven to be a maintenance nightmare, e.g. has led to poor
> test configurations due to naive copy+paste.  For example, many VMX
> tests specify "-m 2560" or "-m 2048" even though only the EPT access
> tests actually require >2gb of memory.  Take advantage of vmx.flat's
> simple glob parsing to create a single testcase for the EPC access


Is EPC a typo there?

> tests.
> 
> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>

Otherwise

Reviewed-by: Liam Merwick <liam.merwick@oracle.com>

> ---
>   x86/unittests.cfg | 126 +++-------------------------------------------
>   1 file changed, 6 insertions(+), 120 deletions(-)
> 
> diff --git a/x86/unittests.cfg b/x86/unittests.cfg
> index 64ecb43..3f23cde 100644
> --- a/x86/unittests.cfg
> +++ b/x86/unittests.cfg
> @@ -230,6 +230,12 @@ extra_params = -cpu host,+vmx -m 2560 -append -exit_monitor_from_l2_test
>   arch = x86_64
>   groups = vmx
>   
> +[ept]
> +file = vmx.flat
> +extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append "ept_access*"
> +arch = x86_64
> +groups = vmx
> +
>   [vmx_null]
>   file = vmx.flat
>   extra_params = -cpu host,+vmx -append null
> @@ -410,126 +416,6 @@ extra_params = -cpu host,+vmx -append "v2_null_test v2_multiple_entries_test fix
>   arch = x86_64
>   groups = vmx
>   
> -[vmx_ept_access_test_not_present]
> -file = vmx.flat
> -extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_not_present
> -arch = x86_64
> -groups = vmx
> -
> -[vmx_ept_access_test_read_only]
> -file = vmx.flat
> -extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_read_only
> -arch = x86_64
> -groups = vmx
> -
> -[vmx_ept_access_test_write_only]
> -file = vmx.flat
> -extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_write_only
> -arch = x86_64
> -groups = vmx
> -
> -[vmx_ept_access_test_read_write]
> -file = vmx.flat
> -extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_read_write
> -arch = x86_64
> -groups = vmx
> -
> -[vmx_ept_access_test_execute_only]
> -file = vmx.flat
> -extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_execute_only
> -arch = x86_64
> -groups = vmx
> -
> -[vmx_ept_access_test_read_execute]
> -file = vmx.flat
> -extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_read_execute
> -arch = x86_64
> -groups = vmx
> -
> -[vmx_ept_access_test_write_execute]
> -file = vmx.flat
> -extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_write_execute
> -arch = x86_64
> -groups = vmx
> -
> -[vmx_ept_access_test_read_write_execute]
> -file = vmx.flat
> -extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_read_write_execute
> -arch = x86_64
> -groups = vmx
> -
> -[vmx_ept_access_test_reserved_bits]
> -file = vmx.flat
> -extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_reserved_bits
> -arch = x86_64
> -groups = vmx
> -
> -[vmx_ept_access_test_ignored_bits]
> -file = vmx.flat
> -extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_ignored_bits
> -arch = x86_64
> -groups = vmx
> -
> -[vmx_ept_access_test_paddr_not_present_ad_disabled]
> -file = vmx.flat
> -extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_paddr_not_present_ad_disabled
> -arch = x86_64
> -groups = vmx
> -
> -[vmx_ept_access_test_paddr_not_present_ad_enabled]
> -file = vmx.flat
> -extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_paddr_not_present_ad_enabled
> -arch = x86_64
> -groups = vmx
> -
> -[vmx_ept_access_test_paddr_read_only_ad_disabled]
> -file = vmx.flat
> -extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_paddr_read_only_ad_disabled
> -arch = x86_64
> -groups = vmx
> -
> -[vmx_ept_access_test_paddr_read_only_ad_enabled]
> -file = vmx.flat
> -extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_paddr_read_only_ad_enabled
> -arch = x86_64
> -groups = vmx
> -
> -[vmx_ept_access_test_paddr_read_write]
> -file = vmx.flat
> -extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_paddr_read_write
> -arch = x86_64
> -groups = vmx
> -
> -[vmx_ept_access_test_paddr_read_write_execute]
> -file = vmx.flat
> -extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_paddr_read_write_execute
> -arch = x86_64
> -groups = vmx
> -
> -[vmx_ept_access_test_paddr_read_execute_ad_disabled]
> -file = vmx.flat
> -extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_paddr_read_execute_ad_disabled
> -arch = x86_64
> -groups = vmx
> -
> -[vmx_ept_access_test_paddr_read_execute_ad_enabled]
> -file = vmx.flat
> -extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_paddr_read_execute_ad_enabled
> -arch = x86_64
> -groups = vmx
> -
> -[vmx_ept_access_test_paddr_not_present_page_fault]
> -file = vmx.flat
> -extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_paddr_not_present_page_fault
> -arch = x86_64
> -groups = vmx
> -
> -[vmx_ept_access_test_force_2m_page]
> -file = vmx.flat
> -extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_force_2m_page
> -arch = x86_64
> -groups = vmx
> -
>   [vmx_invvpid]
>   file = vmx.flat
>   extra_params = -cpu host,+vmx -m 2560 -append invvpid_test_v2
>
Sean Christopherson Feb. 14, 2019, 5:36 p.m. UTC | #2
On Thu, Feb 14, 2019 at 05:33:15PM +0000, Liam Merwick wrote:
> On 12/02/2019 23:34, Sean Christopherson wrote:
> >Defining individual testcases in the config for each individual test in
> >vmx.flat has proven to be a maintenance nightmare, e.g. has led to poor
> >test configurations due to naive copy+paste.  For example, many VMX
> >tests specify "-m 2560" or "-m 2048" even though only the EPT access
> >tests actually require >2gb of memory.  Take advantage of vmx.flat's
> >simple glob parsing to create a single testcase for the EPC access
> 
> 
> Is EPC a typo there?

Indeed it is.

> 
> >tests.
> >
> >Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
> 
> Otherwise
> 
> Reviewed-by: Liam Merwick <liam.merwick@oracle.com>
>
diff mbox series

Patch

diff --git a/x86/unittests.cfg b/x86/unittests.cfg
index 64ecb43..3f23cde 100644
--- a/x86/unittests.cfg
+++ b/x86/unittests.cfg
@@ -230,6 +230,12 @@  extra_params = -cpu host,+vmx -m 2560 -append -exit_monitor_from_l2_test
 arch = x86_64
 groups = vmx
 
+[ept]
+file = vmx.flat
+extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append "ept_access*"
+arch = x86_64
+groups = vmx
+
 [vmx_null]
 file = vmx.flat
 extra_params = -cpu host,+vmx -append null
@@ -410,126 +416,6 @@  extra_params = -cpu host,+vmx -append "v2_null_test v2_multiple_entries_test fix
 arch = x86_64
 groups = vmx
 
-[vmx_ept_access_test_not_present]
-file = vmx.flat
-extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_not_present
-arch = x86_64
-groups = vmx
-
-[vmx_ept_access_test_read_only]
-file = vmx.flat
-extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_read_only
-arch = x86_64
-groups = vmx
-
-[vmx_ept_access_test_write_only]
-file = vmx.flat
-extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_write_only
-arch = x86_64
-groups = vmx
-
-[vmx_ept_access_test_read_write]
-file = vmx.flat
-extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_read_write
-arch = x86_64
-groups = vmx
-
-[vmx_ept_access_test_execute_only]
-file = vmx.flat
-extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_execute_only
-arch = x86_64
-groups = vmx
-
-[vmx_ept_access_test_read_execute]
-file = vmx.flat
-extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_read_execute
-arch = x86_64
-groups = vmx
-
-[vmx_ept_access_test_write_execute]
-file = vmx.flat
-extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_write_execute
-arch = x86_64
-groups = vmx
-
-[vmx_ept_access_test_read_write_execute]
-file = vmx.flat
-extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_read_write_execute
-arch = x86_64
-groups = vmx
-
-[vmx_ept_access_test_reserved_bits]
-file = vmx.flat
-extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_reserved_bits
-arch = x86_64
-groups = vmx
-
-[vmx_ept_access_test_ignored_bits]
-file = vmx.flat
-extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_ignored_bits
-arch = x86_64
-groups = vmx
-
-[vmx_ept_access_test_paddr_not_present_ad_disabled]
-file = vmx.flat
-extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_paddr_not_present_ad_disabled
-arch = x86_64
-groups = vmx
-
-[vmx_ept_access_test_paddr_not_present_ad_enabled]
-file = vmx.flat
-extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_paddr_not_present_ad_enabled
-arch = x86_64
-groups = vmx
-
-[vmx_ept_access_test_paddr_read_only_ad_disabled]
-file = vmx.flat
-extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_paddr_read_only_ad_disabled
-arch = x86_64
-groups = vmx
-
-[vmx_ept_access_test_paddr_read_only_ad_enabled]
-file = vmx.flat
-extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_paddr_read_only_ad_enabled
-arch = x86_64
-groups = vmx
-
-[vmx_ept_access_test_paddr_read_write]
-file = vmx.flat
-extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_paddr_read_write
-arch = x86_64
-groups = vmx
-
-[vmx_ept_access_test_paddr_read_write_execute]
-file = vmx.flat
-extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_paddr_read_write_execute
-arch = x86_64
-groups = vmx
-
-[vmx_ept_access_test_paddr_read_execute_ad_disabled]
-file = vmx.flat
-extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_paddr_read_execute_ad_disabled
-arch = x86_64
-groups = vmx
-
-[vmx_ept_access_test_paddr_read_execute_ad_enabled]
-file = vmx.flat
-extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_paddr_read_execute_ad_enabled
-arch = x86_64
-groups = vmx
-
-[vmx_ept_access_test_paddr_not_present_page_fault]
-file = vmx.flat
-extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_paddr_not_present_page_fault
-arch = x86_64
-groups = vmx
-
-[vmx_ept_access_test_force_2m_page]
-file = vmx.flat
-extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_force_2m_page
-arch = x86_64
-groups = vmx
-
 [vmx_invvpid]
 file = vmx.flat
 extra_params = -cpu host,+vmx -m 2560 -append invvpid_test_v2