lkml.org 
[lkml]   [2019]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH v3 7/8] KVM:X86: Add XSS bit 11 and 12 support for CET xsaves/xrstors.
    From
    Date
    On 28/02/19 09:44, Yang Weijiang wrote:
    >>> if (!vmx_xsaves_supported())
    >>> return 1;
    >>> +
    >>> /*
    >>> - * The only supported bit as of Skylake is bit 8, but
    >>> - * it is not supported on KVM.
    >>> + * Check bits being set are supported in KVM.
    >> I'd drop the comment altogether, it's pretty obvious from the code that
    >> were checking which bits are supported.
    > you won't see these redundancies in next version ;)
    >>> */
    >>> - if (data != 0)
    >>> + if (data & ~kvm_supported_xss())
    >>> return 1;

    You should instead check this against CPUID[0xD, 1].EDX:ECX. If CET is
    disabled in CPUID, the guest should not be able to set it in MSR_IA32_CSS.

    Paolo

    \
     
     \ /
      Last update: 2019-03-08 12:33    [W:2.295 / U:0.404 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site