From: Samuel Thibault Subject: Re: [Xen-changelog] [xen-unstable] stubdom: mmap on /dev/mem support Date: Wed, 21 Oct 2009 17:36:49 +0200 Message-ID: <20091021153649.GM4693@const.bordeaux.inria.fr> References: <200910211510.n9LFAGT7019922@xenbits.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <200910211510.n9LFAGT7019922@xenbits.xensource.com> 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 Cc: xen-changelog@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Xen patchbot-unstable, le Wed 21 Oct 2009 08:10:15 -0700, a =E9crit : > + unsigned long mfns[n]; > + for (i =3D 0; i < n; i++) > + mfns[i] =3D ((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_PRES= ENT|_PAGE_RW); Actually I think the whole could just be unsigned long first_mfn =3D offset >> PAGE_SHIFT; return map_frames_ex(&first_mfn, n, 0, 1, 1, DOMID_IO, 0, _PAGE_P= RESENT|_PAGE_RW); which avoids the need to prepare a table. Samuel