lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4F587FB6.1070803@redhat.com>
Date:	Thu, 08 Mar 2012 11:45:26 +0200
From:	Avi Kivity <avi@...hat.com>
To:	dave@....org
CC:	Marcelo Tosatti <mtosatti@...hat.com>,
	lkml <linux-kernel@...r.kernel.org>, KVM <kvm@...r.kernel.org>
Subject: Re: [PATCH] KVM: x86: add paging gcc optimization

On 03/07/2012 10:02 PM, Davidlohr Bueso wrote:
> From: Davidlohr Bueso <dave@....org>
>
> Since most guests will have paging enabled for memory management, add likely() and unlikely()
> optimizations around is_paging() checks.
>
> Signed-off-by: Davidlohr Bueso <dave@....org>
> ---
>  arch/x86/kvm/mmu.c |    6 +++---
>  arch/x86/kvm/svm.c |    6 +++---
>  arch/x86/kvm/vmx.c |   16 ++++++++--------
>  arch/x86/kvm/x86.c |    8 ++++----
>  4 files changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
> index 4cb1642..84f1e95 100644
> --- a/arch/x86/kvm/mmu.c
> +++ b/arch/x86/kvm/mmu.c
> @@ -3320,7 +3320,7 @@ static int init_kvm_tdp_mmu(struct kvm_vcpu *vcpu)
>  	context->get_pdptr = kvm_pdptr_read;
>  	context->inject_page_fault = kvm_inject_page_fault;
>  
> -	if (!is_paging(vcpu)) {
> +	if (unlikely(!is_paging(vcpu))) {
>

Just change is_paging itself():

 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));
  }

-- 
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ