[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Mmap to user space (question)


  • To: Ruslan Nikolaev <nruslan_devel@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: Keir Fraser <keir@xxxxxxx>
  • Date: Wed, 06 Oct 2010 07:52:28 +0100
  • Cc:
  • Delivery-date: Tue, 05 Oct 2010 23:53:20 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:user-agent:date:subject:from:to:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=EiGPRxGxBmhj1PdOURozkHdRyWOTgdzKQH+WNHdr9Q0kjM+ygu1hgQHFHuOsN+UkRp 0TSEkJupdBPXXqBOecoeQqid1nBt7wiiamzNDukioxy3kpmD6skGgy2s2ksLpK/0xv6V KxEmD7i9LnXbGyEu50frhGRFp6EKkJCPDO0fw=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: ActlIwo5odKf9lmd3k2fJSOiK4Fs8w==
  • Thread-topic: [Xen-devel] Mmap to user space (question)

On 06/10/2010 00:10, "Ruslan Nikolaev" <nruslan_devel@xxxxxxxxx> wrote:

> Note: I already posted the message on xci-devel, but I think this list is
> better suited for this question. So, I duplicated it here.
> 
> ----
> 
> Hi
> 
> I need to map shared_info (provided by hypervisor to each guest) to user space
> (read-only access). I am curious how I can do it, and if there are some good
> examples for the case if NO autotranslation is available. (BTW, Am I correct
> that I can use regular vm_insert_page or remap_pfn_range if autotranslation is
> available?)

I wouldn't worry about auto-translate for PV guests. It's pretty broken.

You will be using a similar mapping path to ioremap. So something like
remap_pfn_range. A function called xen_remap_domain_mfn_range sounds
promising. There's no grant table or other nonsense to worry about. You just
need to get the page mapped into a special vmarea that won't be subject to
paging or any other kernel VM machinery. Like mmap on /dev/mem and
/proc/xen/privcmd, then.

 -- Keir

> If I am correct, shared_info page is mapped initially into some fixmap area in
> the guest. However, no actual pfn exists for the page. Instead, guest gets mfn
> address from start_info.
> 
> Now, what is the standard procedure to handle this situation? I found
> xen_remap_domain_mfn_range function, but not sure if it is what I am looking
> for. Also, I am not sure if I need to update grant tables. I would greatly
> appreciate if someone can enlighten me on this issue, and, perhaps, refer to
> some examples.
> 
> Thank you!
> 
> Ruslan.
> 
> 
> 
>       
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.