Re: [kvm-unit-tests PATCH] KVM: nVMX: Use host_phys_bits for EPT tests that require 40+ PA bits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 25/01/19 18:46, Sean Christopherson wrote:
> The EPT tests require at least 40 bits of physical address space so that
> they can use a separate EPT L4 entry to hold guest data.  Qemu defaults
> to 40 bits for the size of the guest PA, which causes the tests' check
> against CPUID to always pass regardless of the system's actual PA space.
> This results in unexpected reserved-bit page faults due to attempting to
> access a GPA beyond the physical address width of the system, i.e. bit
> 39 is reserved.
> 
> Pass host_phys_bits for the tests to instruct Qemu to use the host's PA
> bits.  Qemu has supported this option since v2.7, which was released in
> 2016, before the introduction of the EPT tests in 2017.
> 
> GPA bits mapped to EPT levels:
> 
>     Offset: 11:0
>     EPT L1: 20:12
>     EPT L2: 29:21
>     EPT L3: 38:30
>     EPT L4: 47:39
>     EPT L5: 56:48
> 
> Fixes: 359575f ("x86: ept access tests")
> Signed-off-by: Sean Christopherson <sean.j.christopherson@xxxxxxxxx>
> ---
>  x86/unittests.cfg | 40 ++++++++++++++++++++--------------------
>  1 file changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/x86/unittests.cfg b/x86/unittests.cfg
> index d7975e9..64ecb43 100644
> --- a/x86/unittests.cfg
> +++ b/x86/unittests.cfg
> @@ -412,121 +412,121 @@ groups = vmx
>  
>  [vmx_ept_access_test_not_present]
>  file = vmx.flat
> -extra_params = -cpu host,+vmx -m 2560 -append ept_access_test_not_present
> +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,+vmx -m 2560 -append ept_access_test_read_only
> +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,+vmx -m 2560 -append ept_access_test_write_only
> +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,+vmx -m 2560 -append ept_access_test_read_write
> +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,+vmx -m 2560 -append ept_access_test_execute_only
> +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,+vmx -m 2560 -append ept_access_test_read_execute
> +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,+vmx -m 2560 -append ept_access_test_write_execute
> +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,+vmx -m 2560 -append ept_access_test_read_write_execute
> +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,+vmx -m 2560 -append ept_access_test_reserved_bits
> +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,+vmx -m 2560 -append ept_access_test_ignored_bits
> +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,+vmx -m 2560 -append ept_access_test_paddr_not_present_ad_disabled
> +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,+vmx -m 2560 -append ept_access_test_paddr_not_present_ad_enabled
> +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,+vmx -m 2560 -append ept_access_test_paddr_read_only_ad_disabled
> +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,+vmx -m 2560 -append ept_access_test_paddr_read_only_ad_enabled
> +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,+vmx -m 2560 -append ept_access_test_paddr_read_write
> +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,+vmx -m 2560 -append ept_access_test_paddr_read_write_execute
> +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,+vmx -m 2560 -append ept_access_test_paddr_read_execute_ad_disabled
> +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,+vmx -m 2560 -append ept_access_test_paddr_read_execute_ad_enabled
> +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,+vmx -m 2560 -append ept_access_test_paddr_not_present_page_fault
> +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,+vmx -m 2560 -append ept_access_test_force_2m_page
> +extra_params = -cpu host,host-phys-bits,+vmx -m 2560 -append ept_access_test_force_2m_page
>  arch = x86_64
>  groups = vmx
>  
> 

Queued, thanks.

Paolo



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux