Hi, I am trying to understand how Xen handle pagefault for paravirtialization VM on x86. In xen/arch/x86/traps.c, do_page_fault() calls fixup_page_fault(), which calls paging_fault(). Then paging_fault() calls v->arch.paging.mode->page_fault() in include/asm-x86/paging.h However, I dont see where in the code we assign v->arch.paging.mode for PV domain. I grep around for many possible words, but didnt see anything interesting. Anybody please help? Thanks a lot, Jun _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
We don''t call paging_fault() for PV guests (unless doing live migration). Paging_mode_enabled() and paging_mode_external() will both return 0. -- Keir On 22/01/2009 10:15, "Jun Koi" <junkoi2004@gmail.com> wrote:> Hi, > > I am trying to understand how Xen handle pagefault for > paravirtialization VM on x86. > > In xen/arch/x86/traps.c, do_page_fault() calls fixup_page_fault(), > which calls paging_fault(). Then paging_fault() calls > v->arch.paging.mode->page_fault() in include/asm-x86/paging.h > > However, I dont see where in the code we assign v->arch.paging.mode > for PV domain. I grep around for many possible words, but didnt see > anything interesting. > > Anybody please help? > > Thanks a lot, > Jun > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Thu, Jan 22, 2009 at 7:21 PM, Keir Fraser <keir.fraser@eu.citrix.com> wrote:> We don''t call paging_fault() for PV guests (unless doing live migration). > Paging_mode_enabled() and paging_mode_external() will both return 0. >Oops I skip that code, so missed it. Thanks! BTW, this code in xen/arch/x86/traps.c::fixup_page_fault() looks suspicious: the VM_ASSIST check looks bogus. Is that dead code? if ( VM_ASSIST(d, VMASST_TYPE_writable_pagetables) && guest_kernel_mode(v, regs) && Thanks, Jun> On 22/01/2009 10:15, "Jun Koi" <junkoi2004@gmail.com> wrote: > >> Hi, >> >> I am trying to understand how Xen handle pagefault for >> paravirtialization VM on x86. >> >> In xen/arch/x86/traps.c, do_page_fault() calls fixup_page_fault(), >> which calls paging_fault(). Then paging_fault() calls >> v->arch.paging.mode->page_fault() in include/asm-x86/paging.h >> >> However, I dont see where in the code we assign v->arch.paging.mode >> for PV domain. I grep around for many possible words, but didnt see >> anything interesting. >> >> Anybody please help? >> >> Thanks a lot, >> Jun >> >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xensource.com >> http://lists.xensource.com/xen-devel > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 22/01/2009 14:55, "Jun Koi" <junkoi2004@gmail.com> wrote:> On Thu, Jan 22, 2009 at 7:21 PM, Keir Fraser <keir.fraser@eu.citrix.com> > wrote: >> We don''t call paging_fault() for PV guests (unless doing live migration). >> Paging_mode_enabled() and paging_mode_external() will both return 0. >> > > Oops I skip that code, so missed it. Thanks! > > BTW, this code in xen/arch/x86/traps.c::fixup_page_fault() looks > suspicious: the VM_ASSIST check looks bogus. Is that dead code?No, we only emulate pagetable writes for PV guests if the guest wants us to. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Fri, Jan 23, 2009 at 12:21 AM, Keir Fraser <keir.fraser@eu.citrix.com> wrote:> On 22/01/2009 14:55, "Jun Koi" <junkoi2004@gmail.com> wrote: > >> On Thu, Jan 22, 2009 at 7:21 PM, Keir Fraser <keir.fraser@eu.citrix.com> >> wrote: >>> We don''t call paging_fault() for PV guests (unless doing live migration). >>> Paging_mode_enabled() and paging_mode_external() will both return 0. >>> >> >> Oops I skip that code, so missed it. Thanks! >> >> BTW, this code in xen/arch/x86/traps.c::fixup_page_fault() looks >> suspicious: the VM_ASSIST check looks bogus. Is that dead code? > > No, we only emulate pagetable writes for PV guests if the guest wants us to.I mean that the const VMASST_TYPE_writable_pagetables should be exposed where it is set, as you can see that it is implicitly set somewhere, and this is the only place we refer to it. So the code looks very confused. Thanks, J _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel