From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Wray Subject: Re: dom0 bootstrap for xenstore Date: Thu, 16 Jun 2005 16:54:44 +0100 Message-ID: <42B1A0C4.4090200@hp.com> References: <1118891075.15491.14.camel@localhost.localdomain> <1118909504.10407.4.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Ian Pratt , Rusty Russell , Xen Mailing List , Christian Limpach List-Id: xen-devel@lists.xenproject.org Keir Fraser wrote: > > On 16 Jun 2005, at 09:11, Rusty Russell wrote: > >> So here's my patch against latest bk, including test program but we have >> an issue. On unmap, I hit the BUG_ON() on mm/rmap.c:482. Is this some >> issue with using xc_map_foreign_range() on non-foreign pages? > > > Ah, it's not working because xc_map_foreign_range does not raise refcnts > on the page being mapped. unmap_range then does the right thing for > foreign pages, and things like the local domain's shared_info page which > is really a Xen heap page, but will do the wrong thing for ordinary > pages out of the local domain's page allocator (like the xenstored > page). It will try to tear down rmap, drop refcnts, atc and get itself > into a mess. Isn't it possible to fix xc_map_foreign_range() to do the right thing for 'ordinary' pages? > On XenLinux, /dev/mem and /dev/kmem only work for mapping I/O memory. > > Either we need a new interface for mmaping local xenstore page, or we > need to hack one of the existing /dev/mem or xc_map_foreign_range ioctl. > None of these options is very pleasant. :-( I think simplest would be > to extend the gross /proc/xen/privcmd to have a mmap that we can use to > mmap xenstore page (maybe make a little more general purpose by turning > offset field of mmap into an enumeration, so we can map other useful > Xen-specific bits and bobs via it in the future). OK, if xc_map_foreign_range() isn't fixable I guess we have to do something like that. Mike