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/
Home Products Support Community News


Re: [Xen-devel] Does xc_map_foreign_pages() update IOMMU tables?

To: Joanna Rutkowska <joanna@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Does xc_map_foreign_pages() update IOMMU tables?
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Thu, 13 May 2010 13:27:36 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 13 May 2010 05:31:07 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4BEBEC09.1010503@xxxxxxxxxxxxxxxxxxxxxx>
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: AcrylMp5ctU1Vs6gShSGZIgTGSp/dwAAuC8c
Thread-topic: [Xen-devel] Does xc_map_foreign_pages() update IOMMU tables?
User-agent: Microsoft-Entourage/
On 13/05/2010 13:09, "Joanna Rutkowska" <joanna@xxxxxxxxxxxxxxxxxxxxxx>

>> Seeing as how xc_map_foreign_pages() maps pages into a particular
>> guest-process virtual address space, whereas IOMMU tables are a mapping from
>> guest-physical address space, it's clear that x_m_f_p() cannot sensibly be
>> having any effect on the IOMMU.
> Interesting. That suggests the graphics drivers we tested do not use DMA
> for XShmPutImage()...

Ah, actually dom0 is special in that it gets a 1:1 mapping of all of RAM
(except for some private Xen areas). See
drivers/passthrough/vtd/x86/vtd.c:iommu_set_dom0_mapping(). I forgot about
that when I wrote my previous reply!

> Anyway, what would be the recommend way of updating IOMMU mappings in
> this case? Would you consider patching of x_m_f_p() an acceptable
> solution? (perhaps with some additional flag: "update_iommu")?

Like I said, the concept does not make sense: IOMMU tables and host page
tables map from different address spaces. But of course this does not matter
anyway given dom0 gets a pretty comprehensive mapping set up by default. So
I think you are good to go.

 -- Keir

Xen-devel mailing list