]> bbs.cooldavid.org Git - net-next-2.6.git/commit
KVM: MMU: Simplify spte fetch() function
authorAvi Kivity <avi@redhat.com>
Tue, 13 Jul 2010 11:27:09 +0000 (14:27 +0300)
committerAvi Kivity <avi@redhat.com>
Mon, 2 Aug 2010 03:40:45 +0000 (06:40 +0300)
commit0b3c933302262d83018dd5f69656bca9f28a0cd3
tree809d6c97623ee87baa195ded38fe98a0a3df8638
parent39c8c672a18c52048343d7531dfb2dcf3431ee74
KVM: MMU: Simplify spte fetch() function

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: Avi Kivity <avi@redhat.com>
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/paging_tmpl.h