From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick Colp Subject: Re: [PATCH] Paging and memory sharing for HVM guests Date: Wed, 16 Dec 2009 16:00:22 -0800 Message-ID: <4B297496.5010903@cs.ubc.ca> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030409010907080102000704" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Dan Magenheimer Cc: xen-devel@lists.xensource.com, Keir Fraser , Grzegorz Milos , Andrew Peace List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------030409010907080102000704 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Oops! I've attached the missing patch. The easiest way to apply them is to use a mercurial patch queue, but simply applying them in order of the series file works too. Did the patches that failed fail before or after this missing one? If after, then try again with this patch and see if there are still any problems. If before, which patches? The queue was refreshed against revision 20683, pulled yesterday morning. Patrick Dan Magenheimer wrote: > Hi Gregor and Patrick -- > > Congrats! > > Could you provide instructions on how to apply them > to xen-unstable tip? I tried applying them using > "patch -p1" in the order given in the file "series" > and most applied but I got a handful of failed hunks > and even one patch file missing altogether > (...pfec_page_paged.patch). > > (Just xen patches, no Linux patches tried yet.) > > Thanks, > Dan > >> -----Original Message----- >> From: Grzegorz Milos [mailto:gm281@cam.ac.uk] >> Sent: Wednesday, December 16, 2009 4:15 PM >> To: xen-devel@lists.xensource.com; Patrick Colp; Andrew Peace; Keir >> Fraser >> Subject: [Xen-devel] [PATCH] Paging and memory sharing for HVM guests >> >> >> The series of 46 patches attached to this email contain the initial >> implementation of memory paging and sharing for Xen. Patrick Colp >> leads the work on the pager, and I am mostly responsible for memory >> sharing. We would be grateful for any comments/suggestions you might >> have. Individual patches are labeled with comments describing their >> purpose and a sign-off footnote. Of course we are happy to discuss >> them in more detail, as required. Assuming that there are no major >> objections against including them in the mainstream xen-unstable tree, >> we would like to move future development to that tree. >> >> Thanks >> Patrick & Gregor >> > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel --------------030409010907080102000704 Content-Type: text/x-patch; name="mem_paging_xen_pfec_page_paged.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mem_paging_xen_pfec_page_paged.patch" hap_gva_to_gfn paging support. Return PFEC_page_paged when a paged out page is found. Ensure top-level page table page and l1 entry are paged in. If an intermediary page table page is paged out, propogate error to caller. Signed-off-by: Patrick Colp diff -r 5c370b75a5b7 xen/arch/x86/mm/hap/guest_walk.c --- a/xen/arch/x86/mm/hap/guest_walk.c Wed Oct 14 10:33:40 2009 -0700 +++ b/xen/arch/x86/mm/hap/guest_walk.c Wed Oct 14 10:33:44 2009 -0700 @@ -46,6 +46,14 @@ /* Get the top-level table's MFN */ cr3 = v->arch.hvm_vcpu.guest_cr[3]; top_mfn = gfn_to_mfn(v->domain, _gfn(cr3 >> PAGE_SHIFT), &p2mt); + if ( p2m_is_paging(p2mt) ) + { +// if ( p2m_is_paged(p2mt) ) + p2m_mem_paging_populate(v->domain, cr3 >> PAGE_SHIFT); + + pfec[0] = PFEC_page_paged; + return INVALID_GFN; + } if ( !p2m_is_ram(p2mt) ) { pfec[0] &= ~PFEC_page_present; @@ -62,12 +70,28 @@ unmap_domain_page(top_map); /* Interpret the answer */ - if ( missing == 0 ) - return gfn_x(guest_l1e_get_gfn(gw.l1e)); - + if ( missing == 0 ) + { + gfn_t gfn = guest_l1e_get_gfn(gw.l1e); + gfn_to_mfn(v->domain, gfn, &p2mt); + if ( p2m_is_paging(p2mt) ) + { +// if ( p2m_is_paged(p2mt) ) + p2m_mem_paging_populate(v->domain, gfn_x(gfn)); + + pfec[0] = PFEC_page_paged; + return INVALID_GFN; + } + + return gfn_x(gfn); + } + if ( missing & _PAGE_PRESENT ) pfec[0] &= ~PFEC_page_present; - + + if ( missing & _PAGE_PAGED ) + pfec[0] = PFEC_page_paged; + return INVALID_GFN; } diff -r 5c370b75a5b7 xen/include/asm-x86/processor.h --- a/xen/include/asm-x86/processor.h Wed Oct 14 10:33:40 2009 -0700 +++ b/xen/include/asm-x86/processor.h Wed Oct 14 10:33:44 2009 -0700 @@ -132,6 +132,7 @@ #define PFEC_user_mode (1U<<2) #define PFEC_reserved_bit (1U<<3) #define PFEC_insn_fetch (1U<<4) +#define PFEC_page_paged (1U<<5) #ifndef __ASSEMBLY__ --------------030409010907080102000704 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 --------------030409010907080102000704--