lkml.org 
[lkml]   [2022]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PATCH v2 3/4] KVM: nVMX: Don't muck with allowed sec exec controls on CPUID changes
    From
    On 12/13/22 07:23, Sean Christopherson wrote:
    > Don't modify the set of allowed secondary execution controls, i.e. the
    > virtual MSR_IA32_VMX_PROCBASED_CTLS2, in response to guest CPUID changes.
    > To avoid breaking old userspace that never sets the VMX MSRs, i.e. relies
    > on KVM to provide a consistent vCPU model, keep the existing behavior if
    > userspace has never written MSR_IA32_VMX_PROCBASED_CTLS2.
    >
    > KVM should not modify the VMX capabilities presented to L1 based on CPUID
    > as doing so may discard explicit settings provided by userspace. E.g. if
    > userspace does KVM_SET_MSRS => KVM_SET_CPUID and disables a feature in
    > the VMX MSRs but not CPUID (to prevent exposing the feature to L2), then
    > stuffing the VMX MSRs during KVM_SET_CPUID will expose the feature to L2
    > against userspace's wishes.

    The commit message doesn't explain *why* KVM_SET_CPUID would be done
    before KVM_SET_MSRS. The presence of certain MSRs or bits within is
    signaled by CPUID bits, and even though KVM is more lenient on
    host-initiated MSR writes it still verifies in general that the bits are
    valid.

    For now I applied patch 1 and (with a reworded comment) patch 2. I'm
    not opposed to the rest, but I would like to better understand the
    reason for them. (If it has been reported to the mailing list, please
    add a "Link" trailer too).

    Paolo

    \
     
     \ /
      Last update: 2023-03-26 23:19    [W:4.198 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site