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: <20100706195254.GA4311@amt.cnet>
Date:	Tue, 6 Jul 2010 16:52:54 -0300
From:	Marcelo Tosatti <mtosatti@...hat.com>
To:	Xiao Guangrong <xiaoguangrong@...fujitsu.com>
Cc:	Avi Kivity <avi@...hat.com>, LKML <linux-kernel@...r.kernel.org>,
	KVM list <kvm@...r.kernel.org>
Subject: Re: [PATCH v5 8/9] KVM: MMU: combine guest pte read between fetch
 and pte prefetch

On Tue, Jul 06, 2010 at 06:51:06PM +0800, Xiao Guangrong wrote:
> Combine guest pte read between guest pte check in the fetch path and pte prefetch
> 
> Signed-off-by: Xiao Guangrong <xiaoguangrong@...fujitsu.com>
> ---
>  arch/x86/kvm/paging_tmpl.h |   69 ++++++++++++++++++++++++++-----------------
>  1 files changed, 42 insertions(+), 27 deletions(-)
> 
> diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
> index e04c1a4..a1e6d91 100644
> --- a/arch/x86/kvm/paging_tmpl.h
> +++ b/arch/x86/kvm/paging_tmpl.h
> @@ -67,6 +67,7 @@ struct guest_walker {
>  	int level;
>  	gfn_t table_gfn[PT_MAX_FULL_LEVELS];
>  	pt_element_t ptes[PT_MAX_FULL_LEVELS];
> +	pt_element_t prefetch_ptes[PTE_PREFETCH_NUM];
>  	gpa_t pte_gpa[PT_MAX_FULL_LEVELS];
>  	unsigned pt_access;
>  	unsigned pte_access;
> @@ -291,12 +292,12 @@ static void FNAME(update_pte)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp,
>  		     gpte_to_gfn(gpte), pfn, true, true);
>  }
>  
> -static void FNAME(pte_prefetch)(struct kvm_vcpu *vcpu, u64 *sptep)
> +static void FNAME(pte_prefetch)(struct kvm_vcpu *vcpu, struct guest_walker *gw,
> +				u64 *sptep)
>  {
>  	struct kvm_mmu_page *sp;
> -	pt_element_t gptep[PTE_PREFETCH_NUM];
> -	gpa_t first_pte_gpa;
> -	int offset = 0, index, i, j, max;
> +	pt_element_t *gptep;
> +	int index, i, j, max;
>  
>  	sp = page_header(__pa(sptep));
>  	index = sptep - sp->spt;
> @@ -311,15 +312,7 @@ static void FNAME(pte_prefetch)(struct kvm_vcpu *vcpu, u64 *sptep)
>  	i = index & ~(PTE_PREFETCH_NUM - 1);
>  	max = index | (PTE_PREFETCH_NUM - 1);
>  
> -	if (PTTYPE == 32)
> -		offset = sp->role.quadrant << PT64_LEVEL_BITS;
> -
> -	first_pte_gpa = gfn_to_gpa(sp->gfn) +
> -				(offset + i) * sizeof(pt_element_t);
> -
> -	if (kvm_read_guest_atomic(vcpu->kvm, first_pte_gpa, gptep,
> -					sizeof(gptep)) < 0)
> -		return;
> +	gptep = gw->prefetch_ptes;

Where do you reread the gpte in the prefetch path?

--
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