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] amd iommu: Do not adjust paging mode for dom0 de

To: Wei Wang2 <wei.wang2@xxxxxxx>
Subject: Re: [Xen-devel] [PATCH] amd iommu: Do not adjust paging mode for dom0 devices
From: Keir Fraser <keir@xxxxxxx>
Date: Mon, 07 Feb 2011 10:47:32 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 07 Feb 2011 02:48:34 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:user-agent:date:subject:from:to:cc :message-id:thread-topic:thread-index:in-reply-to:mime-version :content-type:content-transfer-encoding; bh=tuNMpqdHX1JyN21yvFVWBmRRV4zKs2s1nxRlw37fOyc=; b=HEAMegkbwa+mtdYUwDQOhpFGFVoC80i5jDpKq700cqF+eG9NMI0c/bURp7mQdRrltu VBPenr9GIg2Euv122WbvlKdNGVerDIcq9P5X30LTFjMHzllSDQPefgz/vAje/8YSA+oP Q0TRuE+GlqAaU4pIYgvLn5Ayz+bGqF85hRp9g=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=qTWdjjwY26jSkV4HaqhrhyhOHDm67k+8wWjqpGV+CLT4maE68Ti455R9s8GhQElPVl A/0HG3G9uINbdqAQbZSuRql0CLMo0ybuHBaMQroRGCiwopgumjuJ1tn/JnmJ59heA40k 0KZMaEQcW5sUtviE4apI4RZE2DAmdobOEtSYE=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <201102071133.01239.wei.wang2@xxxxxxx>
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: AcvGtGwWDc4evrxVQEqCbyY+YV6AMA==
Thread-topic: [Xen-devel] [PATCH] amd iommu: Do not adjust paging mode for dom0 devices
User-agent: Microsoft-Entourage/12.28.0.101117
On 07/02/2011 10:33, "Wei Wang2" <wei.wang2@xxxxxxx> wrote:

>> And that's wrong is it? How do you know that dom0 doesn't have a whole load
>> of memory assigned to it?
>> 
>> The correct thing to do would be to adjust the table depth according to the
>> largest page number currently mapped in the table. Or just stick with four
>> levels always if you can't do the optimisation job properly.
>> 
>>  -- Keir
> Keir,
> I was a little confused, are you suggesting that max_page does not represent
> the last pfn of dom0?

The global variable max_page represents the largest machine frame number in
the system.

The domain field d->max_pages merely represents an allocation limit for a
domain, beyond which further allocation requests will be refused. Note it
doesn't guarantee that the domain does not have less memory, or *more*
memory (if max_pages got reduced below a domain's current allocation).

Also, for a PV guest like dom0, where the IOMMU table is presumably a 1:1
mapping, d->max_pages is not useful in any case because even if a guest has,
say, only 100MB memory allocated to it, that memory can be spread across the
entire host memory space from 0 to max_page. And max_page could be big!

Personally I would suggest starting with small 2-level tables and
dynamically increase their height as bigger mappings are added to them. Else
stick with 4-level tables, or size tables according to global variable
max_page. I think basing anything on d->max_pages is not a good idea.

 -- Keir

> I was assuming max_pdx is the index number... Or are
> you referring memory hot plug? If so, we might also need 4 level for dom0.




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