From: Tim Deegan Subject: Re: Swapping of PT pages Date: Wed, 20 Feb 2008 09:31:41 +0000 Message-ID: <20080220093141.GA24343@york.uk.xensource.com> References: <6bc632150802191244j16f7575ctf4bba69e57abc9d4@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Return-path: Content-Disposition: inline In-Reply-To: <6bc632150802191244j16f7575ctf4bba69e57abc9d4@mail.gmail.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: pradeep singh rautela Cc: xen-devel@lists.xensource.com, Mike Sun List-Id: xen-devel@lists.xenproject.org At 02:14 +0530 on 20 Feb (1203473672), pradeep singh rautela wrote: > I suspect Xen translates the mfns of the PV guests PT pages to > equivalent pfns before they can be actually swapped out on to a > physical disk. Xen is not involved in the guest's swapping/paging activities. If a guest were to page its pagetables out to disk and then be migrated, they would indeed be incorrect when they were reloaded. The canonicalisation happens only for pages that are currently in memory and marked with a page-table type. > > decided; if swapping of PT pages were allowed, then wouldn't certain > > page table pages not be canonicalized (since they would be on disk, > > not in any of the machine frames). This obviously be bad. > > > > Am I understanding things incorrectly? You're right. If a guest wanted to use a pagetable after it had been paged out, it would have to do the same MFN->PFN canonicalization on the on-disk form, and PFN->MFN when reloading. (That's PV guests, BTW. HVM guests that swapped their pagetables could potentially experience memory corruption if they used the emulated disk controller, but should work fine with PV drivers, or with NPT.) Tim. -- Tim Deegan Principal Software Engineer, Citrix Systems (R&D) Ltd. [Company #02300071, SL9 0DZ, UK.]