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] [PATCH] x86/iommu: account for necessary allocations whe

To: Jan Beulich <JBeulich@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] x86/iommu: account for necessary allocations when calculating Dom0's initial allocation size
From: Keir Fraser <keir@xxxxxxx>
Date: Tue, 14 Dec 2010 09:28:59 +0000
Cc:
Delivery-date: Tue, 14 Dec 2010 01:30:11 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:user-agent:date :subject:from:to:message-id:thread-topic:thread-index:in-reply-to :mime-version:content-type:content-transfer-encoding; bh=xAmvK28Zwb8XSUQV2Y4RsK4yBt9rUFSwtWgKiwReDkI=; b=NWiE+lwmLb7pF20J498Xm1SQwlosN2h3JFmhoGved6atWijbFsnbaRQwUwRBFYLjoA Yq98LRes1yI3CQkFnJgyJzbi9B7bK6bznHcVJV3N27p/2oP16OklbFwONw8EwNus2UX0 F7TD9ATe3RAX54EMr1xIyn9NXprL0DGvebyKM=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:user-agent:date:subject:from:to:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=tv8nbLJ6DE8eCAIYGG5owwV+pBNcAKnOsX47Qf4+lvYYvWJgRKATbdcqden1wjIBuZ CaU/kYE0yiNzh/gejvA1An9oruWShWekqAvwgkS++2yNZEdFHM11nrTBg1ql4Zz9ICeo cfri7LgLUwmQqLVvkZrtkNQ02efg52oAKmlTM=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4D07410B0200007800027C04@xxxxxxxxxxxxxxxxxx>
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: AcubcVYzGT5Bh4nk1E6GG3/xiRHLvg==
Thread-topic: [Xen-devel] [PATCH] x86/iommu: account for necessary allocations when calculating Dom0's initial allocation size
User-agent: Microsoft-Entourage/12.27.0.100910
Thank Jan. I'm not really sure about putting your earlier patch into 4.0.2,
so can I put only this patch in for 4.0.2, replacing max_pdx with max_page?

 -- Keir

On 14/12/2010 09:03, "Jan Beulich" <JBeulich@xxxxxxxxxx> wrote:

> As of c/s 21812:e382656e4dcc, IOMMU related allocations for Dom0
> happen only after it got all of its memory allocated, and hence the
> reserve (mainly for setting up its swiotlb) may get exhausted without
> accounting for the necessary allocations up front.
> 
> While not precise, the estimate has been found to be within a couple
> of pages for the systems it got tested on.
> 
> For the calculation to be reasonably correct, this depends on the
> patch titled "x86/iommu: don't map RAM holes above 4G" sent out
> yesterday.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
> 
> --- a/xen/arch/x86/domain_build.c
> +++ b/xen/arch/x86/domain_build.c
> @@ -191,6 +191,15 @@ static unsigned long __init compute_dom0
>      if ( is_pv_32on64_domain(d) )
>          avail -= opt_dom0_max_vcpus - 1;
>  
> +    /* Reserve memory for iommu_dom0_init() (rough estimate). */
> +    if ( iommu_enabled )
> +    {
> +        unsigned int s;
> +
> +        for ( s = 9; s < BITS_PER_LONG; s += 9 )
> +            avail -= max_pdx >> s;
> +    }
> +
>      /*
>       * If domain 0 allocation isn't specified, reserve 1/16th of available
>       * memory for things like DMA buffers. This reservation is clamped to
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



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

<Prev in Thread] Current Thread [Next in Thread>