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

[Xen-devel] Information required on the pinning/unpinning of shadow.


  • To: xen devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: aditya shevalkar <aditya27783@xxxxxxxxxxx>
  • Date: Wed, 29 Nov 2006 16:50:18 +0530 (IST)
  • Delivery-date: Wed, 29 Nov 2006 03:38:52 -0800
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.in; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=UfQtJgjI+ThOm+UjnCzHh47iP+MtAHaQ7yS9XuaWaR6HtFV/xk7sau5i+GfMwMrSEY87cWoj6gVO3WItzNXOJSLYhI87azHVKPotMzeEGKwZCpy2DCkB6VXoTrOOoCZZ2iz/VouHKdRZUvb0TcCNvmNz5IZMz3pOpg7RbxS/xrE= ;
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

Hi all,
Looking at the following code snippets could anybody explain what is the 
purpose and
meaning of the pinning and unpinning and hooking/unhook of the shadow/subshadow?
Please correct my question if it seems some information missing in it.

xen-3.0.3_0-src\xen\arch\x86\mm\shadow\common.c
void shadow_prealloc(struct domain *d, unsigned int order)
{
    /* Need a vpcu for calling unpins; for now, since we don't have
     * per-vcpu shadows, any will do */
    struct vcpu *v = d->vcpu[0];
   ....
            /* For PAE, we need to unpin each subshadow on this shadow */
            SHADOW_INTERNAL_NAME(sh_unpin_all_l3_subshadows,3,3)(v, smfn);
        } 
        else 
#endif /* 32-bit code always takes this branch */
        {
            /* Unpin this top-level shadow */
            sh_unpin(v, smfn);
       .....
         shadow_unhook_mappings(v, smfn);
....

Also in the following code what is PGC_SH_pinned doing internally?
xen-3.0.3_0-src\xen\arch\x86\mm\shadow\private.h
/* Unpin a shadow page: unset the pin bit and release the extra ref. */
static inline void sh_unpin(struct vcpu *v, mfn_t smfn)
{
    struct page_info *page;
    ASSERT(mfn_valid(smfn));
    page = mfn_to_page(smfn);
    if ( page->count_info & PGC_SH_pinned )
    {
        page->count_info &= ~PGC_SH_pinned;
        sh_put_ref(v, smfn, 0);
    }
}
xen-3.0.3_0-src\xen\include\asm-x86\mm.h
#define PGC_SH_pinned         (1U<<27)

With Best Regards,
Aditya Shevalkar.




                
__________________________________________________________
Yahoo! India Answers: Share what you know. Learn something new
http://in.answers.yahoo.com/

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


 


Rackspace

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