From: Simon Kagstrom Subject: Re: Memory management, mapping, paging questions... Date: Wed, 25 Oct 2006 08:53:31 +0200 Message-ID: <87fydcx4wk.wl%simon.kagstrom@bth.se> References: <1161702697.453e2d2969d33@imp8-g19.free.fr> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <1161702697.453e2d2969d33@imp8-g19.free.fr> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: nicko.koinkoin@free.fr Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org At Tue, 24 Oct 2006 17:11:37 +0200, nicko.koinkoin@free.fr wrote: > Currently I play with Xen (2.0.7), especially I want to know more about > the memory management. I hope I can answer your questions, but I've only used Xen 3/unstable and I am also not one of the Xen experts (correct me if I'm wrong, please!) > So my questions are the following : > > * pt_base is the virtual adress of the pd. But what means virtual > here ? in which adress space does this adress has the right meaning > ? Xen has setup an address space which the guest domain starts in, so pt_base is simply the virtual address of the page directory. > * Does Xen create the page tables (I do not include the pd in page tables, I > think it is more understable like this, i.e. pd != pt) ? Where are these pt? > their address ? You can always traverse the page directory page to find this out. > * mfn_list : is this a list, starting at adress mfn_list, that contains all the > machine adresses of all machine pages allocated for our VM ? Yes, it stores the machine page frame numbers and it's used to translate physical addresses to machine addresses. I.e., something like unsigned long phys_to_machine(unsigned long phys) { unsigned long machine = mfn_list[phys >> 12]; machine = (machine << 12) | (phys & (unsigned long)~4095); return machine; } Mapping pages work basically as on real hardware except that you have to translate physical addresses to machine addresses before entering them into the page table. // Simon