• Kai Huang's avatar
    KVM: MMU: Add mmu help functions to support PML · f4b4b180
    Kai Huang authored
    This patch adds new mmu layer functions to clear/set D-bit for memory slot, and
    to write protect superpages for memory slot.
    
    In case of PML, CPU logs the dirty GPA automatically to PML buffer when CPU
    updates D-bit from 0 to 1, therefore we don't have to write protect 4K pages,
    instead, we only need to clear D-bit in order to log that GPA.
    
    For superpages, we still write protect it and let page fault code to handle
    dirty page logging, as we still need to split superpage to 4K pages in PML.
    
    As PML is always enabled during guest's lifetime, to eliminate unnecessary PML
    GPA logging, we set D-bit manually for the slot with dirty logging disabled.
    Signed-off-by: default avatarKai Huang <kai.huang@linux.intel.com>
    Reviewed-by: default avatarXiao Guangrong <guangrong.xiao@linux.intel.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    f4b4b180
kvm_host.h 32.5 KB