From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: kvm_mmu doubts Date: Mon, 30 Jun 2008 22:59:46 +0300 Message-ID: <48693B32.802@qumranet.com> References: <2452.10.9.1.37.1214831194.squirrel@www.cse.iitb.ac.in> <4868E2C6.2040005@qumranet.com> <3049.10.9.1.37.1214845847.squirrel@www.cse.iitb.ac.in> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Sukanto Ghosh Return-path: Received: from il.qumranet.com ([212.179.150.194]:47234 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763147AbYF3T72 (ORCPT ); Mon, 30 Jun 2008 15:59:28 -0400 In-Reply-To: <3049.10.9.1.37.1214845847.squirrel@www.cse.iitb.ac.in> Sender: kvm-owner@vger.kernel.org List-ID: Sukanto Ghosh wrote: >> Sukanto Ghosh wrote: >> >>> What do these refer to ? >>> i) kvm_rmap_desc >>> >> It's a reverse mapping listing all shadow ptes pointing to a given guest >> > page. > > Then what is the rmap field of the 'struct kvm_memory_slot' ? Is it the > list of kvm_rmap_desc (one list entry for each guest page in that memory > slot) ? > > > The head of this list. >>> iii) kvm_mmu_page-> spt ??? ( i thought kvm_mmu_page itself refers to page >>> of shadow PT, then what does spt points to ? ) >>> >> kvm_mmu_page contains information about the guest page table and the >> > host shadow page table. spt is the host shadow page table. > > > I got more confused now. > I think it is due to terminology. I am novice here and I try to relate > everything to the OS textbooks. > > Well, that won't work as I haven't read those textbooks. > I am calling the entire tree-like structure (including the page > directories) as a page table. In the above statement are you referring to > the same ? Or is it the last-level table that holds translated physical > addresses (+ dirty bit, etc ) ? > No, any guest page that is part of the structure. Note the structure is not a tree, since multiple roots exist and as it may be cyclic. > What about the PGD, PMDs ? > We try not to use Linux specific names while describing guests. > Also, can you explain a line about each of these fields of the > kvm_mmu_page: > > i) link (LRU link of what ?) > Yes, the lru link. > ii) gfn (guest frame number of the guest page table ?) > Yes. > iii) parent_pte (in a multi-level page table structure, the PTE in a page > directory that holds the base address of the page table) > Yes (or a list of those pte pointers). > iv) root_count ( comment says 'currently serving as an active root; .is > root = PGD? ) > Yes. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.