• Avi Kivity's avatar
    KVM: MMU: Push clean gpte write protection out of gpte_access() · 8ea667f2
    Avi Kivity authored
    gpte_access() computes the access permissions of a guest pte and also
    write-protects clean gptes.  This is wrong when we are servicing a
    write fault (since we'll be setting the dirty bit momentarily) but
    correct when instantiating a speculative spte, or when servicing a
    read fault (since we'll want to trap a following write in order to
    set the dirty bit).
    
    It doesn't seem to hurt in practice, but in order to make the code
    readable, push the write protection out of gpte_access() and into
    a new protect_clean_gpte() which is called explicitly when needed.
    Reviewed-by: default avatarXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
    Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
    8ea667f2
paging_tmpl.h 21 KB