Explorar o código

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>
Davidlohr Bueso %!s(int64=14) %!d(string=hai) anos
pai
achega
c36fc04ef5
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      arch/x86/kvm/x86.h

+ 1 - 1
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)