public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* kvm_mmu doubts
@ 2008-06-30 13:06 Sukanto Ghosh
  2008-06-30 13:42 ` Avi Kivity
  2008-06-30 14:13 ` Carsten Otte
  0 siblings, 2 replies; 7+ messages in thread
From: Sukanto Ghosh @ 2008-06-30 13:06 UTC (permalink / raw)
  To: kvm

What do these refer to ?
i) kvm_rmap_desc
ii) rmap_pde
iii) kvm_mmu_page-> spt ??? ( i thought kvm_mmu_page itself refers to page
of shadow PT, then what does spt points to ? )


Thanks and Regards
Sukanto Ghosh














^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: kvm_mmu doubts
  2008-06-30 13:06 kvm_mmu doubts Sukanto Ghosh
@ 2008-06-30 13:42 ` Avi Kivity
  2008-06-30 17:10   ` Sukanto Ghosh
  2008-06-30 14:13 ` Carsten Otte
  1 sibling, 1 reply; 7+ messages in thread
From: Avi Kivity @ 2008-06-30 13:42 UTC (permalink / raw)
  To: Sukanto Ghosh; +Cc: kvm

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.

> ii) rmap_pde
>   

Same, for large guest pages.

> 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.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: kvm_mmu doubts
  2008-06-30 13:06 kvm_mmu doubts Sukanto Ghosh
  2008-06-30 13:42 ` Avi Kivity
@ 2008-06-30 14:13 ` Carsten Otte
  1 sibling, 0 replies; 7+ messages in thread
From: Carsten Otte @ 2008-06-30 14:13 UTC (permalink / raw)
  To: Sukanto Ghosh; +Cc: kvm

Sukanto Ghosh wrote:
> What do these refer to ?
> i) kvm_rmap_desc
> ii) rmap_pde
> iii) kvm_mmu_page-> spt ??? ( i thought kvm_mmu_page itself refers to page
> of shadow PT, then what does spt points to ? )
I liked Avis presentation about the kvm softmmu at the developer forum 
2007. I felt like I understood what's going on after that, but I've 
forgotten at least 75% since. Maybe this helps?
http://kvm.qumranet.com/kvmwiki/KvmForum2007?action=AttachFile&do=get&target=shadowy-depths-of-the-kvm-mmu.pdf

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: kvm_mmu doubts
  2008-06-30 13:42 ` Avi Kivity
@ 2008-06-30 17:10   ` Sukanto Ghosh
  2008-06-30 19:59     ` Avi Kivity
  0 siblings, 1 reply; 7+ messages in thread
From: Sukanto Ghosh @ 2008-06-30 17:10 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Sukanto Ghosh, kvm

> 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) ?


>> 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.

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 ) ?

What about the PGD, PMDs ?

Also, can you explain a line about each of these fields of the
kvm_mmu_page:

i) link (LRU link of what ?)

ii) gfn (guest frame number of the guest page table ?)

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)

iv) root_count ( comment says 'currently serving as an active root; .is
root = PGD? )



Thanks and regards,
Sukanto

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: kvm_mmu doubts
  2008-06-30 17:10   ` Sukanto Ghosh
@ 2008-06-30 19:59     ` Avi Kivity
  2008-07-01  5:20       ` Sukanto Ghosh
  0 siblings, 1 reply; 7+ messages in thread
From: Avi Kivity @ 2008-06-30 19:59 UTC (permalink / raw)
  To: Sukanto Ghosh; +Cc: kvm

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.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: kvm_mmu doubts
  2008-06-30 19:59     ` Avi Kivity
@ 2008-07-01  5:20       ` Sukanto Ghosh
  2008-07-05 10:58         ` Avi Kivity
  0 siblings, 1 reply; 7+ messages in thread
From: Sukanto Ghosh @ 2008-07-01  5:20 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Sukanto Ghosh, kvm

> Sukanto Ghosh wrote:
>>
>> 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.
>

I understand that it is not a tree and that in case of sharing and
aliasing, multiple roots will exist. But, how can it be cyclic ? (Are you
not considering directionality or is it because the nodes in this
structure do have pointers to the parents or there is something else as
well ?)


Thanks and Regards,
Sukanto Ghosh

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: kvm_mmu doubts
  2008-07-01  5:20       ` Sukanto Ghosh
@ 2008-07-05 10:58         ` Avi Kivity
  0 siblings, 0 replies; 7+ messages in thread
From: Avi Kivity @ 2008-07-05 10:58 UTC (permalink / raw)
  To: Sukanto Ghosh; +Cc: kvm

Sukanto Ghosh wrote:
>> Sukanto Ghosh wrote:
>>     
>>> 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.
>>
>>     
>
> I understand that it is not a tree and that in case of sharing and
> aliasing, multiple roots will exist. But, how can it be cyclic ? (Are you
> not considering directionality or is it because the nodes in this
> structure do have pointers to the parents or there is something else as
> well ?)
>   

A page-directory entry can point at the page directory (some OSes do this).

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-07-05 10:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-30 13:06 kvm_mmu doubts Sukanto Ghosh
2008-06-30 13:42 ` Avi Kivity
2008-06-30 17:10   ` Sukanto Ghosh
2008-06-30 19:59     ` Avi Kivity
2008-07-01  5:20       ` Sukanto Ghosh
2008-07-05 10:58         ` Avi Kivity
2008-06-30 14:13 ` Carsten Otte

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox