Re: [kvm-unit-tests PATCH 3/5] x86: nVMX: Require WB for the EPT walks when possible

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

 



On Wed, Feb 20, 2019 at 6:24 PM Sean Christopherson
<sean.j.christopherson@xxxxxxxxx> wrote:
>
> The memtype used by hardware when walking EPT tables is specified by
> software via an encoding in the EPTP.  Ignoring the fact that no sane
> VMM would default to UC for page table walks, KVM only supports WB,
> and has only ever supported WB (added in commit ca72d970ff9a, "KVM:
> nEPT: Advertise WB type EPTP").
>
> Require WB and remove the UC handling altogether.  Eliminating what is
> effectively dead code also removes the confusing error message (that
> never fires) regarding memtype, e.g. "EPT paging-structure memory type
> UC&WB are not supported" may be interpreted as stating that KVM unit
> tests require WC *and* WB.
>
> Cc: Marc Orr <marcorr@xxxxxxxxxx>
> Signed-off-by: Sean Christopherson <sean.j.christopherson@xxxxxxxxx>
> ---
>  x86/vmx_tests.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
> index bd17088..c9cea0e 100644
> --- a/x86/vmx_tests.c
> +++ b/x86/vmx_tests.c
> @@ -1011,11 +1011,8 @@ static int setup_eptp(u64 hpa, bool enable_ad)
>                 printf("\tEPT is not supported");
>                 return 1;
>         }
> -
> -       if (!(ept_vpid.val & EPT_CAP_UC) &&
> -                       !(ept_vpid.val & EPT_CAP_WB)) {
> -               printf("\tEPT paging-structure memory type "
> -                               "UC&WB are not supported\n");
> +       if (!(ept_vpid.val & EPT_CAP_WB)) {
> +               printf("WB memtype for EPT walks not supported\n");
>                 return 1;
>         }
>         if (!(ept_vpid.val & EPT_CAP_PWL4)) {
> @@ -1023,10 +1020,7 @@ static int setup_eptp(u64 hpa, bool enable_ad)
>                 return 1;
>         }
>
> -       if (ept_vpid.val & EPT_CAP_UC)
> -               eptp = EPT_MEM_TYPE_UC;
> -       else
> -               eptp = EPT_MEM_TYPE_WB;
> +       eptp = EPT_MEM_TYPE_WB;
>         eptp |= (3 << EPTP_PG_WALK_LEN_SHIFT);
>         eptp |= hpa;
>         if (enable_ad)
> --
> 2.20.1
>

Reviewed-by: Marc Orr <marcorr@xxxxxxxxxx>



[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