Gregory Haskins wrote:
> On Fri, 2007-08-10 at 19:59 +0300, Avi Kivity wrote:
>
>   
>> Note that passing a virtual address is highly discouraged as its meaning 
>> can change from vcpu to vcpu, it might not be mapped, translation is 
>> slow, etc.  Just let the guest do the translation.
>>     
>
> Yeah, Hollis and Anthony straighted me out via IRC.  I will mostly be
> dealing with kmalloc/skb buffers so we settled on the following as
> optimal:
>
> guest-side
>
> gpa = __pa(ptr);
>
> host-side:
>
> gfn  = gpa >> PAGE_SHIFT
> page = gfn_to_page(gfn);
> ptr = kmap(page);
>
> ..
>
> kunmap(ptr); 
>   

kmap can sleep so you often have to use kmap_atomic in KVM.  Although, 
I'm not sure if the pre-emption notification means that no longer is the 
case.

Regards,

Anthony Liguori

>   
>> We have something running at qumranet, will be sent out soon.  I am 
>> somewhat discouraged in trying to get the thing to page -- Shaohua's 
>> approach is much simpler.
>>
>>     
>
> Cool!  Ill keep an eye out.
>
> -Greg
>
>
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to