From: Tim Deegan Subject: Re: Question about page table used by hypervisor Date: Mon, 4 Apr 2011 11:10:23 +0100 Message-ID: <20110404101023.GC30961@whitby.uk.xensource.com> References: <20110120094437.GI8286@whitby.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Return-path: Content-Disposition: inline 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: KennyChen Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org Hi, At 02:42 +0100 on 30 Mar (1301452953), KennyChen wrote: > Hi, Tim: > > One more doubt here. > In the Linux concept, each process all share a common part of kernel page > tables, e.g., 3-4GB address mapping are the same among all processes. Thus when > switching to kernel, there is no need to change hardware CR3. > > But when going to PV guest, is that the same way? > I thought Xen prepares the page tables for PV guest in such a way that > some portion of address mapping is reserved particularly for > hypervisor, which can be used for translation inside hypervisor. Yes, PV guests share an address space with the hypervisor, as described in the original "Xen and the art of virtualization" paper. > For PV, it might be ok because the page table is directly translated to machine > physical address. So when switching to hypervisor, this page table (same cr3) > can still be used for address translation. > > But how about HVM guest (assume EPT is enabled)? > When vmexit happens, does the hardware CR3 switches to some other value Yes; it's called the "host cr3" in the APMs and PRMs. , which > points to a special page table for Xen's use? If no switching happens, then the > hardware MMU would walk through guest page table for translation which is weird > to me. > > If such special page table exists, could you point it out? It's called the "monitor table" in the Xen code. Cheers, Tim. > Thanks, > Kenny > > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel -- Tim Deegan Principal Software Engineer, Xen Platform Team Citrix Systems UK Ltd. (Company #02937203, SL9 0BG)