From mboxrd@z Thu Jan 1 00:00:00 1970 From: jeet Subject: Re: page fault handling in Xen Date: Mon, 5 Mar 2007 11:59:18 +0530 (IST) Message-ID: <77764.294.qm@web8811.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: Tim Deegan Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Hi Tim=0A=0Ain case of second fault that will occur when guest will try to = write in GPT(which is readonly)=0Aand faulting address would be of Page tab= le in which the write is attempted. VM exit will occur and xen would execut= e =0Afollowing code=0A=0Ain file xen-3.0.3_0-src\xen\arch\mm\shadow\multi.= c in the page fault handler=0A=0Astatic int sh_page_fault(struct vcpu *v, = =0A unsigned long va, =0A = struct cpu_user_regs *regs)=0A{=0A...=0A...=0A[line 2949]=0A // Was it a = write fault?=0A //=0A if ( regs->error_code & PFEC_write_access )=0A = {=0A // //if error is write access and RW permission is not present= =0A if ( unlikely(!(accumulated_gflags & _PAGE_RW)) )=0A {=0A= perfc_incrc(shadow_fault_bail_ro_mapping);=0A goto = not_a_shadow_fault;=0A }=0A=0A...=0A..=0A=0AAbove code will execute = and in inner unlikely condition will be true as PT table is read only and = error is write_access=0Aand control will go to not_a_shadow_fault?=0A=0Aso = when the emulation code would be executed for the write that has been perfo= rmed on read only guest PT for adding entry in =0Aguest page table by guest= ?=0A=0AHave I missed some thing here in understanding =0A=0Akindly provide = your valuable reply =0A=0Ajeet=0A=0A----- Original Message ----=0AFrom: Tim= Deegan =0ATo: jeet =0ACc= : xen-devel@lists.xensource.com=0ASent: Friday, 2 March, 2007 7:05:43 PM=0A= Subject: Re: [Xen-devel] page fault handling in Xen=0A=0AAt 17:36 +0530 on = 02 Mar (1172856988), jeet wrote:=0A> Is shadow code implementation in xen 3= .0.3 is same as explained by you in reply?=0A=0AYes.=0A=0ACheers,=0A=0ATim.= =0A=0A-- =0ATim Deegan , XenSource UK Limited=0AR= egistered office c/o EC2Y 5EB, UK; company number 05334508=0A=0A___________= ____________________________________=0AXen-devel mailing list=0AXen-devel@l= ists.xensource.com=0Ahttp://lists.xensource.com/xen-devel=0A=0A=0A=0A=0A=0A= =09=09=0A__________________________________________________________=0AYahoo= ! India Answers: Share what you know. Learn something new=0Ahttp://in.answe= rs.yahoo.com/