lkml.org 
[lkml]   [2010]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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. :-)


    \
     
     \ /
      Last update: 2010-07-07 03:29    [W:5.103 / U:1.400 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site