From: "Wu Bingzheng" Subject: Re:Re: Re: Re:Re:Re: Questions about shadow page table. Date: Fri, 29 May 2009 17:03:31 +0800 (CST) Message-ID: <10273005.158821243587811460.JavaMail.coremail@bj163app88.163.com> References: <20090527094057.GD16056@york.uk.xensource.com> <20090527081217.GB16056@york.uk.xensource.com> <12737400.124241243392478610.JavaMail.coremail@bj163app62.163.com> <3841352.530971243347632779.JavaMail.coremail@bj163app57.163.com> <20090526095459.GA16056@york.uk.xensource.com> <27156115.386171243327618700.JavaMail.coremail@bj163app31.163.com> <22314741.143001243393791075.JavaMail.coremail@bj163app62.163.com> <1182088.377301243415442619.JavaMail.coremail@bj163app26.163.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2053956931==" Return-path: In-Reply-To: <20090527094057.GD16056@york.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Tim Deegan Cc: xen-devel List-Id: xen-devel@lists.xenproject.org --===============2053956931== Content-Type: multipart/alternative; boundary="----=_Part_42821_23640643.1243587811459" ------=_Part_42821_23640643.1243587811459 Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: 7bit Thanks so much. I have another question. If a process's page is read-write in guest's page table, but the Xen hypervisor sets it as read-only in shadow page table on some purpose. What happens if the process writes this page? Is this case treated as guest page fault or shadow page fault? Thanks, Wu >At 10:10 +0100 on 27 May (1243419042), Wu Bingzheng wrote: >> ??2009-05-27??"Tim Deegan" ?????? >> >At 04:09 +0100 on 27 May (1243397391), Wu Bingzheng wrote: >> >> In another word, how can page-fault handler distinguish the >> >> shadow-page-fault and non-shadow-page-fault? >> > >> >By looking at the guest's own pagetables (not the shadows) and the error >> >code, and figuring out whether this would have been a pagefault on bare >> >metal. Yes, the not_a_shadow_fault path is for this. > >Actually, all "goto propagate" paths in sh_page_fault() do this too; the >not_a_shadow_fault label also has some lock handling that's required on >some paths. > >> Thanks. Would you like to point out where exactly to make the >> decision? > >Typical guest faults are caught at the first "goto propagate", based on >the return code of sh_walk_guest_tables(). > >Cheers, > >Tim. > >-- >Tim Deegan >Principal Software Engineer, Citrix Systems (R&D) Ltd. >[Company #02300071, SL9 0DZ, UK.] > >_______________________________________________ >Xen-devel mailing list >Xen-devel@lists.xensource.com >http://lists.xensource.com/xen-devel ------=_Part_42821_23640643.1243587811459 Content-Type: text/html; charset=gbk Content-Transfer-Encoding: quoted-printable Thanks so much.

I have another question.
If a process's page is read-write in&nbs= p;guest's page table, but the Xen hypervisor&= nbsp;sets it as read-only in shadow page = ;table on some purpose. What happens if = the process writes this page?
Is this case=  treated as guest page fault or shadow&n= bsp;page fault?

Thanks,
Wu


>At 10:10 = ;+0100 on 27 May (1243419042), Wu Bingzheng&n= bsp;wrote:
>> ??2009-05-27??"Tim Deegan" <Tim.De= egan@citrix.com> ??????
>> >At 04:09 +01= 00 on 27 May (1243397391), Wu Bingzheng = wrote:
>> >> In another word, how&n= bsp;can page-fault handler distinguish the
>>&= nbsp;>> shadow-page-fault and non-shadow-page-fault?>> >
>> >By looking at the&= nbsp;guest's own pagetables (not the shadows) = ;and the error
>> >code, and figuring&= nbsp;out whether this would have been a = pagefault on bare
>> >metal.  Yes,&nbs= p;the not_a_shadow_fault path is for this.
>=
>Actually, all "goto propagate" paths in&nb= sp;sh_page_fault() do this too; the
>not_a_shadow= _fault label also has some lock handling = ;that's required on
>some paths.
>
>>&n= bsp;Thanks. Would you like to point out = where exactly to make the
>> decision?>
>Typical guest faults are caught at&nb= sp;the first "goto propagate", based on
>the=  return code of sh_walk_guest_tables().
>
>= Cheers,
>
>Tim.
>
>-- 
>Tim Deegan&= nbsp;<Tim.Deegan@citrix.com>
>Principal Software Engi= neer, Citrix Systems (R&D) Ltd.
>[Company&nbs= p;#02300071, SL9 0DZ, UK.]
>
>__________________= _____________________________
>Xen-devel mailing list
&g= t;Xen-devel@lists.xensource.com
>http://lists.xensource.com/xen-devel=


=B4=A9=D4=BD=B5=D8=D5=F0=B4=F8 =BC=CD=C4=EE=E3=EB=B4=A8=B5=D8=D5=F0= =D2=BB=D6=DC=C4=EA
------=_Part_42821_23640643.1243587811459-- --===============2053956931== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============2053956931==--