• Avi Kivity's avatar
    KVM: MMU: Simplify spte fetch() function · 0b3c9333
    Avi Kivity authored
    Partition the function into three sections:
    
    - fetching indirect shadow pages (host_level > guest_level)
    - fetching direct shadow pages (page_level < host_level <= guest_level)
    - the final spte (page_level == host_level)
    
    Instead of the current spaghetti.
    
    A slight change from the original code is that we call validate_direct_spte()
    more often: previously we called it only for gw->level, now we also call it for
    lower levels.  The change should have no effect.
    
    [xiao: fix regression caused by validate_direct_spte() called too late]
    Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
    Signed-off-by: default avatarXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
    Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
    0b3c9333
paging_tmpl.h 17.1 KB