diff options
author | Dong, Eddie <eddie.dong@intel.com> | 2008-01-02 14:29:08 +0800 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 18:01:21 +0200 |
commit | 5882842f9b86179e1fe2e17e35e0e46a268d04e4 (patch) | |
tree | 033dbe065c24563d6cd21ae2c10af8833eac79d9 /arch | |
parent | eb787d10af8045dd00d4d4c9a8e90fa495f1b0c1 (diff) | |
download | kernel-common-5882842f9b86179e1fe2e17e35e0e46a268d04e4.tar.gz kernel-common-5882842f9b86179e1fe2e17e35e0e46a268d04e4.tar.bz2 kernel-common-5882842f9b86179e1fe2e17e35e0e46a268d04e4.zip |
KVM: MMU: Merge shadow level check in FNAME(fetch)
Remove the redundant level check when fetching
shadow pte for present & non-present spte.
Signed-off-by: Yaozu (Eddie) Dong <eddie.dong@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/paging_tmpl.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index 349920556be3..03ba8608fe0f 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h @@ -300,16 +300,13 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr, bool new_page = 0; shadow_ent = ((u64 *)__va(shadow_addr)) + index; + if (level == PT_PAGE_TABLE_LEVEL) + break; if (is_shadow_present_pte(*shadow_ent)) { - if (level == PT_PAGE_TABLE_LEVEL) - break; shadow_addr = *shadow_ent & PT64_BASE_ADDR_MASK; continue; } - if (level == PT_PAGE_TABLE_LEVEL) - break; - if (level - 1 == PT_PAGE_TABLE_LEVEL && walker->level == PT_DIRECTORY_LEVEL) { metaphysical = 1; |