public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* Q: Why not use struct mm_struct to manage guest physical addresses in new port?
@ 2013-02-05 19:02 David Daney
  2013-02-08 22:11 ` Marcelo Tosatti
  0 siblings, 1 reply; 3+ messages in thread
From: David Daney @ 2013-02-05 19:02 UTC (permalink / raw)
  To: KVM devel mailing list; +Cc: Ralf Baechle

Hi,

I am starting to working on a port of KVM to an architecture that has a 
dual TLB.  The Guest Virtual Addresses (GVA) are translated to Guest 
Physical Addresses (GPA) by the first TLB, then a second TLB translates 
the GPA to a Root Physical Address (RPA).  For the sake of this 
question, we will ignore the GVA->GPA TLB and consider only the GPA->RPA 
TLB.

I seems that most existing ports have a bunch of custom code that 
manages the GPA->RPA TLB and page tables.

Here is what I would like to try:  Create a mm for the GPA->RPA mappings 
each vma would have a fault handler that calls gfn_to_pfn() to look up 
the proper page.  In kvm_arch_vcpu_ioctl_run() we would call switch_mm() 
to this new 'gva_mm'.  Upon exiting guest mode we would switch back to 
the original mm of the controlling process.

For me the benefit of this approach is that all the code that manages 
the TLB is already implemented and works well for struct mm_struct.  The 
only thing I need to do is write a vma fault handler.  That is a lot 
easier and less error prone than maintaining a parallel TLB management 
framework and making sure it interacts properly with the existing TLB 
code for 'normal' processes.


Q1: Am I crazy for wanting to try this?

Q2: Have others tried this and rejected it?  What were the reasons?


Thanks in advance,
David Daney
Cavium, Inc.

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

end of thread, other threads:[~2013-02-08 23:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-05 19:02 Q: Why not use struct mm_struct to manage guest physical addresses in new port? David Daney
2013-02-08 22:11 ` Marcelo Tosatti
2013-02-08 23:08   ` David Daney

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