From: jeet Subject: [Queries] Unpinning and Unhooking shadow Date: Wed, 14 Mar 2007 21:12:39 +0530 (IST) Message-ID: <181879.72537.qm@web8806.mail.in.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 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@lists.xensource.com Cc: Tim Deegan List-Id: xen-devel@lists.xenproject.org Hi All,=0A=0AI have some queries regarding unpinning and unhooking top leve= l shadow page table for HVM guest on page fault.=0A=0Awhenever we try to ma= ke some space prior to allocating the shadow using prealloc_shadaow() call = =0A=0A1. we do back traversing of per domain list of top level shadow pages= and try to unpin them using function call sh_unpin()=0A=0Abut in unpinning= shadow we are unsetting pin bit in page->count_info and decrement the refe= rence count of shadow page=0Ausing call to sh_put_ref() [define in xen/arch= /x86/mm/shadow/private.h]=0A=0Abut in this function I am not able to unders= tand why this condition is unlikely? =0A=0Aif ( unlikely(nx =3D=3D 0) ) =0A= sh_destroy_shadow(v, smfn);=0A=0Aas we are trying to make space for= new shadow which would be created using shadow_alloc() =0Aso this sh_destr= oy_shadow must be called for any one of the entry in toplevel list to free = space of at least required order =0Aand put back the pages in freelist of s= hadow pool ?=0A=0A2. if we could not free space for shadow creation by this= then why are we not pinning all the top level pages again while we are =0A= marking them unpinned while traversing the top level list? =0AOr is it not = necessary to pinned all top level shadows in list? or it has some other sig= nificance?=0A=0A3. Also after this if still space is not free then we try t= o unhooking the same toplevel list by going though each entry in list and = =0Amarking corresponding PML4 table's entries as 0 if that entry was marked= PRESENT.=0A=0ABut I am not able to understand how this will return pages b= ack to per domain freelist of shadow pages?=0A=0APlease correct if there is= something wrong in my understanding or if I have missed any piece of code = in this flow=0A=0APlz provide your valuable replies to clear my queries/dou= bts.=0A=0AJeet=0A=0A=0A=0A=0A=09=09=0A_____________________________________= _____________________=0AYahoo! India Answers: Share what you know. Learn so= mething new=0Ahttp://in.answers.yahoo.com/