diff options
author | Davidlohr Bueso <dave@gnu.org> | 2012-03-08 12:45:54 +0100 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-04-08 13:03:13 +0200 |
commit | c36fc04ef558c95cff46a8c89d2f804f217335f5 (patch) | |
tree | 98f5fcb78a62fd2c1a33f89a8dea0c9f5074aaef /arch | |
parent | KVM: VMX: Auto-load on CPUs with VMX (diff) | |
download | linux-c36fc04ef558c95cff46a8c89d2f804f217335f5.tar.xz linux-c36fc04ef558c95cff46a8c89d2f804f217335f5.zip |
KVM: x86: add paging gcc optimization
Since most guests will have paging enabled for memory management, add likely() optimization
around CR0.PG checks.
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/x86.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h index cb80c293cdd8..3d1134ddb885 100644 --- a/arch/x86/kvm/x86.h +++ b/arch/x86/kvm/x86.h @@ -64,7 +64,7 @@ static inline int is_pse(struct kvm_vcpu *vcpu) static inline int is_paging(struct kvm_vcpu *vcpu) { - return kvm_read_cr0_bits(vcpu, X86_CR0_PG); + return likely(kvm_read_cr0_bits(vcpu, X86_CR0_PG)); } static inline u32 bit(int bitno) |