From: Ruslan Nikolaev Subject: Re: Mmap to user space (question) Date: Wed, 6 Oct 2010 10:54:31 -0700 (PDT) Message-ID: <98748.90663.qm@web113612.mail.gq1.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org =0A=0A--- On Wed, 10/6/10, Ruslan Nikolaev wrote:= =0A=0A> From: Ruslan Nikolaev =0A> Subject: Re: [X= en-devel] Mmap to user space (question)=0A> To: "Keir Fraser" =0A> Date: Wednesday, October 6, 2010, 9:53 PM=0A> =0A> =0A> --- On Wed, 1= 0/6/10, Keir Fraser =0A> wrote:=0A> =0A> > From: Keir Fraser = =0A> > Subject: Re: [Xen-devel] Mmap to user space=0A> (quest= ion)=0A> > To: "Ruslan Nikolaev" ,=0A> xen-devel@l= ists.xensource.com=0A> > Date: Wednesday, October 6, 2010, 10:52 AM=0A> > O= n 06/10/2010 00:10, "Ruslan=0A> > Nikolaev" =0A> >= wrote:=0A> > =0A> > > Note: I already posted the message on xci-devel,=0A>= but I=0A> > think this list is=0A> > > better suited for this question. So= , I duplicated=0A> it=0A> > here.=0A> > > =0A> > > ----=0A> > > =0A> > > Hi= =0A> > > =0A> > > I need to map shared_info (provided by hypervisor=0A> to= =0A> > each guest) to user space=0A> > > (read-only access). I am curious h= ow I can do it,=0A> and=0A> > if there are some good=0A> > > examples for t= he case if NO autotranslation is=0A> > available. (BTW, Am I correct=0A> > = > that I can use regular vm_insert_page or=0A> > remap_pfn_range if autotra= nslation is=0A> > > available?)=0A> > =0A> > I wouldn't worry about auto-tr= anslate for PV guests.=0A> It's=0A> > pretty broken.=0A> > =0A> > You will = be using a similar mapping path to ioremap.=0A> So=0A> > something like=0A>= > remap_pfn_range. A function called=0A> > xen_remap_domain_mfn_range soun= ds=0A> > promising. There's no grant table or other nonsense=0A> to=0A> > w= orry about. You just=0A> > need to get the page mapped into a special vmare= a=0A> that=0A> > won't be subject to=0A> > paging or any other kernel VM ma= chinery. Like mmap on=0A> > /dev/mem and=0A> > /proc/xen/privcmd, then.=0A>= > =0A> >=A0 -- Keir=0A> =0A> =0A> =0A> Thank you! I think, xen_remap_domai= n_mfn_range is indeed=0A> what I am looking for.=0A> =0A> =0A> Ruslan.=0A> = =0A> =0A> > =0A> > > If I am correct, shared_info page is mapped=0A> initia= lly=0A> > into some fixmap area in=0A> > > the guest. However, no actual pf= n exists for the=0A> page.=0A> > Instead, guest gets mfn=0A> > > address fr= om start_info.=0A> > > =0A> > > Now, what is the standard procedure to hand= le=0A> this=0A> > situation? I found=0A> > > xen_remap_domain_mfn_range fun= ction, but not sure=0A> if=0A> > it is what I am looking=0A> > > for. Also,= I am not sure if I need to update=0A> grant=0A> > tables. I would greatly= =0A> > > appreciate if someone can enlighten me on this=0A> issue,=0A> > an= d, perhaps, refer to=0A> > > some examples.=0A> > > =0A> > > Thank you!=0A>= > > =0A> > > Ruslan.=0A> > > =0A> > > =0A> > > =0A> > >=A0 =A0 =A0=A0=A0= =0A> > > =0A> > > _______________________________________________=0A> > > X= en-devel mailing list=0A> > > Xen-devel@lists.xensource.com=0A> > > http://= lists.xensource.com/xen-devel=0A> > =0A> > =0A> > =0A> > __________________= _____________________________=0A> > Xen-devel mailing list=0A> > Xen-devel@= lists.xensource.com=0A> > http://lists.xensource.com/xen-devel=0A> > =0A> = =0A> =0A> =0A> =0A=0A=0A