From: aditya shevalkar Subject: Information required on the pinning/unpinning of shadow. Date: Wed, 29 Nov 2006 16:50:18 +0530 (IST) Message-ID: <20061129112018.53049.qmail@web8702.mail.in.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ascii Content-Transfer-Encoding: quoted-printable Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen devel List-Id: xen-devel@lists.xenproject.org Hi all,=0ALooking at the following code snippets could anybody explain what= is the purpose and=0Ameaning of the pinning and unpinning and hooking/unho= ok of the shadow/subshadow?=0APlease correct my question if it seems some i= nformation missing in it.=0A=0Axen-3.0.3_0-src\xen\arch\x86\mm\shadow\commo= n.c=0Avoid shadow_prealloc(struct domain *d, unsigned int order)=0A{=0A = /* Need a vpcu for calling unpins; for now, since we don't have=0A * pe= r-vcpu shadows, any will do */=0A struct vcpu *v =3D d->vcpu[0];=0A ..= ..=0A /* For PAE, we need to unpin each subshadow on this shadow= */=0A SHADOW_INTERNAL_NAME(sh_unpin_all_l3_subshadows,3,3)(v, s= mfn);=0A } =0A else =0A#endif /* 32-bit code always takes thi= s branch */=0A {=0A /* Unpin this top-level shadow */=0A = sh_unpin(v, smfn);=0A .....=0A shadow_unhook_mappi= ngs(v, smfn);=0A....=0A=0AAlso in the following code what is PGC_SH_pinned = doing internally?=0Axen-3.0.3_0-src\xen\arch\x86\mm\shadow\private.h=0A/* U= npin a shadow page: unset the pin bit and release the extra ref. */=0Astati= c inline void sh_unpin(struct vcpu *v, mfn_t smfn)=0A{=0A struct page_in= fo *page;=0A ASSERT(mfn_valid(smfn));=0A page =3D mfn_to_page(smfn);= =0A if ( page->count_info & PGC_SH_pinned )=0A {=0A page->coun= t_info &=3D ~PGC_SH_pinned;=0A sh_put_ref(v, smfn, 0);=0A }=0A}= =0Axen-3.0.3_0-src\xen\include\asm-x86\mm.h=0A#define PGC_SH_pinned = (1U<<27)=0A=0AWith Best Regards,=0AAditya Shevalkar.=0A=0A=0A=0A=0A=09=09= =0A__________________________________________________________=0AYahoo! Indi= a Answers: Share what you know. Learn something new=0Ahttp://in.answers.yah= oo.com/