From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [RFC PATCH] xen/arm: Vmap allocator fails to allocate beyond 128M Date: Mon, 23 Feb 2015 17:03:14 +0000 Message-ID: <1424710994.27930.226.camel@citrix.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Vijay Kilari Cc: Stefano Stabellini , Julien Grall , Tim Deegan , "xen-devel@lists.xen.org" , Stefano Stabellini , Jan Beulich List-Id: xen-devel@lists.xenproject.org On Tue, 2015-02-17 at 11:37 +0530, Vijay Kilari wrote: > In vmap_init, Did you mean vm_init? vmap_init is not a function in Xen that I can find. > map_pages_to_xen() is called for mapping > vm_bitmap. Initially one page of vm_bitmap is allocated > and mapped using PAGE_HYPERVISOR attribute. > For the rest of vm_bitmap pages, MAP_SMALL_PAGES attribute > is used to map. > > In ARM for both PAGE_HYPERVISOR and MAP_SMALL_PAGES, valid bit > is set to 1 in pte entry for these mapping. > > In vma_alloc() There is no such function in Xen. (Please take care with such naming, otherwise I have to waste lots of time trying to find the code you are talking about). > , map_pages_to_xen() is failing for >128MB because > for this next vm_bitmap page the mapping is already set in vm_init() > with valid bit set in pte entry. So map_pages_to_xen() in > ARM returns error. > > On x86, for the pages mapped with MAP_SMALL_PAGES attribute > valid bit is not set. So the common vmap code assumes the > same behaviour from arm. However this is not the case. > > This patch will set valid bit to 0 in pte entry when > pages are mapped with MAP_SMALL_PAGES. MAP_SMALL_PAGES in no way indicates to me "create the PT structure but do not map any actual data pages". It is documented on x86 as "don't use superpages mappings", which doesn't imply anything to me about non-superpage mappings either. Can we along with this fix perhaps rename to something which does indicate this. MAP_NON_LEAF_PTS or something perhaps? (This is really a question for Jan). Ian.