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

Re: [Xen-ia64-devel] [Patch] Fix for re-enabling PV-on-HVM on IPF



Hi Yamahata-san,

I (Doi.Tsunehisa) said:
>   And, I've tracked the counter, so it be cleared below:
> 
> [xen/arch/ia64/xen/mm.c]
> ....
> long
> arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
> {
> ....
>         /* Unmap from old location, if any. */
>         gpfn = get_gpfn_from_mfn(mfn);
>         if (gpfn != INVALID_M2P_ENTRY)
>             guest_physmap_remove_page(d, gpfn, mfn);
> ....
> 
> 
>   I'll investigate it more.

  The reason of this issue might be the spec difference of
guest_physmap_remove_page() between x86 and IPF.

  In x86 code, guest_physmap_remove_page() clears only p2m entry
and m2p entry.

  But, in IPF code, domain_put_page() (called from zap_domain_page_one())
clears the page reference counter, I think.
# Is it correct ?

  How should we be modified it ?

[xen/arch/ia64/xen/mm.c]
....
void
guest_physmap_remove_page(struct domain *d, unsigned long gpfn,
                          unsigned long mfn)
{
    BUG_ON(mfn == 0);//XXX
    zap_domain_page_one(d, gpfn << PAGE_SHIFT, mfn);
    perfc_incrc(guest_physmap_remove_page);
}
....

static void
zap_domain_page_one(struct domain *d, unsigned long mpaddr, unsigned long mfn)
{
    struct mm_struct *mm = &d->arch.mm;
    volatile pte_t *pte;
    pte_t old_pte;
    struct page_info *page;
......
    // exchange_memory() calls
    //   steal_page()
    //     page owner is set to NULL
    //   guest_physmap_remove_page()
    //     zap_domain_page_one()
    domain_put_page(d, mpaddr, pte, old_pte, (page_get_owner(page) != NULL));
    perfc_incrc(zap_dcomain_page_one);
}

Thanks,
- Tsunehisa Doi

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel


 


Rackspace

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