Skip to content

Commit

Permalink
KVM: x86: add paging gcc optimization
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Davidlohr Bueso authored and Avi Kivity committed Apr 8, 2012
1 parent e9bda3b commit c36fc04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kvm/x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c36fc04

Please sign in to comment.