WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

Re: [Xen-devel] Re: [Xen-changelog] [xen-unstable] stubdom: mmap on /dev

To: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] Re: [Xen-changelog] [xen-unstable] stubdom: mmap on /dev/mem support
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Wed, 21 Oct 2009 16:57:54 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "xen-changelog@xxxxxxxxxxxxxxxxxxx" <xen-changelog@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 21 Oct 2009 08:59:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20091021153649.GM4693@xxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <200910211510.n9LFAGT7019922@xxxxxxxxxxxxxxxxxxxxx> <20091021153649.GM4693@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Wed, 21 Oct 2009, Samuel Thibault wrote:
> Xen patchbot-unstable, le Wed 21 Oct 2009 08:10:15 -0700, a écrit :
> > +        unsigned long mfns[n];
> > +        for (i = 0; i < n; i++)
> > +            mfns[i] = ((unsigned long) offset + (i * PAGE_SIZE)) >> 
> > PAGE_SHIFT;
> 
> Mmm, is there a reason for adding (i*PAGE_SIZE) before right-shifting?
> 
> > +        return map_frames_ex(mfns, n, 1, 0, 1, DOMID_IO, 0, 
> > _PAGE_PRESENT|_PAGE_RW);
> 
> Actually I think the whole could just be
> 
>       unsigned long first_mfn = offset >> PAGE_SHIFT;
>         return map_frames_ex(&first_mfn, n, 0, 1, 1, DOMID_IO, 0, 
> _PAGE_PRESENT|_PAGE_RW);
> 
> which avoids the need to prepare a table.

Yeah, you are right.
Both versions are fine for me.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>