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:10:12 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 07 Feb 2011 02:11:49 -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=uvWgC43ImnISl5Anh9NX8+DhjGpuqjGKmyvzWAoTRGM=; b=eY+DmAcOssogskG4GAEMVQtKyFozELZbePoW1a3/dbsXNv4rUBG9CdqhDbnOOdCD3e 9fGFZhRkKGtnCKH8dAiOpyttUFauHnsCi9XSXEP8dF6pLZaal3470oAW+dqIcsarq38t 0TsQiPyX2cV+zsKWVKn1w39znlk2VGNHqaBNo=
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=c1v5q7YA47QrgS0JuMUvPprHcEqSLXQ/kxqhMvHd8gUo393qhSOdmMtOpmrQNsAK8j 5C/6YOp354BJXYUBV8Dpk8z0eMiA+1CTS903vfLX0lnvyu84ENOuLHf5wMwI7LizC2Q/ 7KgaQkHxbH/9aTcY+ZkcPhkXO5hfL5mQnrjeE=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <201102071058.29383.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: AcvGrzTxmyA8ihmyqUS6mqVProQf1g==
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 09:58, "Wei Wang2" <wei.wang2@xxxxxxx> wrote:

> On Sunday 06 February 2011 17:58:18 Keir Fraser wrote:
>> On 01/02/2011 17:34, "Wei Wang2" <wei.wang2@xxxxxxx> wrote:
>
> amd_iommu_domain_init() is called very early, where get_paging_mode() cannot
> use domU->max_pages to setup proper io page level for domU. Instead, paging
> mode of domU has to be initialized as 4 for safety. That is why I want to
> adjust hd->paging_mode in reassign_device() using domU->max_pages. Since most
> domU use 2-3 level page tables, always using 4 level might be a waste.
> 
> But I had a wrong assumption of dom0->max_pages, and consequently when return
> passthru device back to dom0, following lines in c/s 22825
> 
> +    if ( target->max_pages > 0 )
> +        t->paging_mode = get_paging_mode(target->max_pages);
> 
> will change hd->paging_mode of dom0 from 3 (in most case) to 4 (using
> get_paging_mode(dom0->max_pages)).

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

> Thanks,
> -Wei
> 
> 
> 
> 
> 
> 



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