public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] KVM: x86: add paging gcc optimization
@ 2012-03-08 11:45 Davidlohr Bueso
  2012-03-08 15:47 ` Christian Borntraeger
  0 siblings, 1 reply; 6+ messages in thread
From: Davidlohr Bueso @ 2012-03-08 11:45 UTC (permalink / raw)
  To: Avi Kivity, Marcelo Tosatti; +Cc: KVM, lkml

From: Davidlohr Bueso <dave@gnu.org>

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>
---
 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 cb80c29..3d1134d 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)
-- 
1.7.8.3




^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-03-28 16:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-08 11:45 [PATCH v2] KVM: x86: add paging gcc optimization Davidlohr Bueso
2012-03-08 15:47 ` Christian Borntraeger
2012-03-08 21:27   ` Davidlohr Bueso
2012-03-12 12:12   ` Avi Kivity
2012-03-23 21:51     ` Davidlohr Bueso
2012-03-28 16:36       ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox