lkml.org 
[lkml]   [2012]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: how to map a host virtual address (hva) to guest address space (gva/gpa/gfn)
From
Thanks Mehul.

On Tue, Jun 19, 2012 at 7:33 PM, Mehul Chadha <mehulc87@gmail.com> wrote:
> On Tue, Jun 19, 2012 at 6:09 PM, sheng qiu <herbert1984106@gmail.com> wrote:
>> Hi all,
>>
>> is there any existing function in KVM that can map a host virtual
>> address (hva) to the guest address space. So that the guest VM can
>> access it.
>> i.e. translate hva to a gpa or gva or gfn, so the guest VM can use
>> that converted address to access?
> I am not aware of a function that exists in kvm, but you can write one using
> __gfn_to_memslot()  as a reference implementation.
>
> you can check if the hva falls in a particular memslot using
> userspace_addr member
> of the memslot structure, and then calculate the corresponding gfn from that.
>>
>> Thanks,
>> Sheng
>> --
>> To unsubscribe from this list: send the line "unsubscribe kvm" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html



--
Sheng Qiu
Texas A & M University
Room 332B Wisenbaker
email: herbert1984106@gmail.com
College Station, TX 77843-3259
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-06-20 17:01    [W:0.033 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site