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-devel

Re: [Xen-devel] Re: non-contiguous allocations

To: Olaf Hering <olaf@xxxxxxxxx>
Subject: Re: [Xen-devel] Re: non-contiguous allocations
From: Keir Fraser <keir.xen@xxxxxxxxx>
Date: Mon, 09 May 2011 15:14:10 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 09 May 2011 07:14:50 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:user-agent:date:subject:from:to:cc:message-id :thread-topic:thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; bh=XsTIBTKS59aT763XLV0h/lX95HLetwyzBzL+a9h2x1Q=; b=faYYyQnlyEGgQ4mzewBqD5l7hlcRFHPhQ3czV+7istkc7EiC3gDvgwAjDsqgvDDNFx BDCGgQzrrjVSmuHYXgQHgP11VbDBmnI3e1iYOQQ6VwqyRj63iZ1c6Nb0eAVVRG7avx+h 27CXojwUmUxilSZUc/Lmm8kB3OzFq/P7nEfQw=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=user-agent:date:subject:from:to:cc:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=IZQPFQGU9OG4Km8sf6Hl7ANZHpOv/DpyjP4uYYBimyKNPenIhOSZqlBJVLdgw0r8vh vqv6kRv7UdHNoy72TNkXlUGzhaSvNN3EnYVnLpVqivlG7M7tZRcuW5WEsXVmfeslTyFF o64aaAgojGpfo8IwXkn3H8Lp/ZUKBHePdLwRs=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110509124314.GA19179@xxxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcwOU112HCPfBftuCU+e9qjL5T/u2g==
Thread-topic: [Xen-devel] Re: non-contiguous allocations
User-agent: Microsoft-Entourage/12.29.0.110113
On 09/05/2011 13:43, "Olaf Hering" <olaf@xxxxxxxxx> wrote:

>> Yes, sticking with alloc_xenheap_pages() is good.
> 
> Another question:
> alloc_trace_bufs() calls alloc_xenheap_pages(0, MEMF_bits(32 + PAGE_SHIFT));
> 
> MEMF_bits() is not used in the i386 codepath in alloc_heap_pages(),
> unless I miss something.

On i386 the xenheap is drawn from the bottom 12MB of physical memory, hence
restricting address width doesn't need to be explicitly handled -- no caller
requires addresses below 8MB.

> Otherwise alloc_domheap_pages() is called, which passes BITS_PER_LONG
> instead of 32 to domain_clamp_alloc_bitsize().
>
> Is the hardcoded 32+PAGE_SHIFT required in some way,

The allocated MFNs get passed to dom0 userspace in a uint32_t array. Hence
MFNs cannot be wider than 32 bits. Hence physical addresses of trace pages
cannot be wider than 32+PAGE_SHIFT bits.

> or could I just use
> the alloc_xenheap_page() macro and let alloc_domheap_pages() deal with
> allocation details?

No, the explicit MEMF_bits restriction is required, unless you widen the MFN
arrays passed to dom0 userspace to contain uint64_t entries.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel