• Sean Christopherson's avatar
    KVM: x86: Move PAT MSR handling out of mtrr.c · bc7fe2f0
    Sean Christopherson authored
    Drop handling of MSR_IA32_CR_PAT from mtrr.c now that SVM and VMX handle
    writes without bouncing through kvm_set_msr_common().  PAT isn't truly an
    MTRR even though it affects memory types, and more importantly KVM enables
    hardware virtualization of guest PAT (by NOT setting "ignore guest PAT")
    when a guest has non-coherent DMA, i.e. KVM doesn't need to zap SPTEs when
    the guest PAT changes.
    
    The read path is and always has been trivial, i.e. burying it in the MTRR
    code does more harm than good.
    
    WARN and continue for the PAT case in kvm_set_msr_common(), as that code
    is _currently_ reached if and only if KVM is buggy.  Defer cleaning up the
    lack of symmetry between the read and write paths to a future patch.
    Reviewed-by: default avatarKai Huang <kai.huang@intel.com>
    Link: https://lore.kernel.org/r/20230511233351.635053-7-seanjc@google.comSigned-off-by: default avatarSean Christopherson <seanjc@google.com>
    bc7fe2f0
x86.c 363 KB