[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 07 Jul 2010 09:23:15 +0800
From: Xiao Guangrong <xiaoguangrong@...fujitsu.com>
To: Marcelo Tosatti <mtosatti@...hat.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
Marcelo Tosatti wrote:
>> -
>> - 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?
>
Marcelo,
Thanks for your review.
Below codes read gptes in the prefetch path:
index = sptep - sp->spt;
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;
It reads the 16 aligned items around sptep's corresponding gpte and this gpte
is also in this area. :-)
--
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