[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] put_page in ptwr_do_page_fault



Hi all,
I am trying to understand write page table handler for PV guests. I got the core of ptwr_do_page_fault is x86_emulate() which will emulate the write operation in Xen. But why after that Xen calls  put_page() to free the page mapped to the PTE ? The code snapshot is as follows: 

int ptwr_do_page_fault(struct vcpu *v, unsigned long addr,
                       struct cpu_user_regs *regs)
{
    struct domain *d = v->domain;
    struct page_info *page;
    l1_pgentry_t      pte;
    struct ptwr_emulate_ctxt ptwr_ctxt;
    int rc;

    /* Attempt to read the PTE that maps the VA being accessed. */
    guest_get_eff_l1e(v, addr, &pte);

    ......

    page = l1e_get_page(pte); 
    
    ......

    rc = x86_emulate(&ptwr_ctxt.ctxt, &ptwr_emulate_ops);
  
    page_unlock(page);
    put_page(page);

    ......
}

Thanks a lot,
--
Xinxin

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.