From: "Jan Beulich" Subject: Re: [PATCH v3] xen/arm: Do not allocate pte entries for MAP_SMALL_PAGES Date: Mon, 09 Mar 2015 13:26:01 +0000 Message-ID: <54FDAD790200007800067898@mail.emea.novell.com> References: <1425884393-28949-1-git-send-email-vijay.kilari@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1425884393-28949-1-git-send-email-vijay.kilari@gmail.com> Content-Disposition: inline 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@gmail.com Cc: keir@xen.org, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, Prasun.Kapoor@caviumnetworks.com, andrew.cooper3@citrix.com, manish.jaggi@caviumnetworks.com, julien.grall@linaro.org, tim@xen.org, xen-devel@lists.xen.org, stefano.stabellini@citrix.com, Vijaya Kumar K List-Id: xen-devel@lists.xenproject.org >>> On 09.03.15 at 07:59, wrote: > From: Vijaya Kumar K > > On x86, for the pages mapped with PAGE_HYPERVISOR attribute > non-leaf page tables are allocated with valid pte entries. > and with MAP_SMALL_PAGES attribute only non-leaf page tables are > allocated with invalid (valid bit set to 0) pte entries. > However on arm this is not the case. On arm for the pages > mapped with PAGE_HYPERVISOR and MAP_SMALL_PAGES both > non-leaf and leaf level page table are allocated with valid bit > in pte entries. > > This behaviour in arm makes common vmap code fail to > allocate memory beyond 128MB as described below. > > In vm_init, 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 vm_alloc(), 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. > > With this patch, MAP_SMALL_PAGES attribute will only allocate > non-leaf page tables only and arch specific populate_pt_range() > api is introduced to populate non-leaf page table entries > for the requested pages. > > Here we use bit[16] in the attribute flag to know if leaf page > tables should be allocated or not. > > This bit is set only for MAP_SMALL_PAGES attribute. > > Signed-off-by: Vijaya Kumar K Non-ARM bits Acked-by: Jan Beulich