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] question on iommu _map_page

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] question on iommu _map_page
From: Kaushik Kumar Ram <kaushik@xxxxxxxx>
Date: Thu, 10 Jun 2010 16:59:39 -0500
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 10 Jun 2010 15:01:33 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C82538A4.161DB%keir.fraser@xxxxxxxxxxxxx>
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>
References: <C82538A4.161DB%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On May 28, 2010, at 3:08 AM, Keir Fraser wrote:

> On 27/05/2010 21:59, "Kaushik Kumar Ram" <kaushik@xxxxxxxx> wrote:
> 
>> On May 27, 2010, at 3:46 PM, Keir Fraser wrote:
>> 
>>> It looks like the person who implemented that never needed the read-only
>>> case. We need a function to map pages into the iommu read-only and to call
>>> that from the grant code.
>>> 
>>> A patch to just call iommu_map_page() for any kind of grant mapping would be
>>> acceptable for now, if you want to submit a patch.
>> 
>> OK. Attached.
> 
> Actually I've implemented the better fix as xen-unstable:21476. Hope that
> works okay for you.


Checking if act->pin is zero before calling iommu_unmap_page() (in 
grant_table.c) is not sufficient since there can be multiple
active grants all referring to the same mfn. In fact I came across iommu page 
faults because pages were 
getting unmapped from the IOMMU when active grants referring to these pages 
were still around.
Ideally, there needs to be a per-page count of how many IOMMU mappings exists 
for a page. 
I can't think of an obvious fix for this problem. For my purposes, I hacked 
page_info to add another counter which I guess is not an acceptable solution! 

-Kaushik


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

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