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


[Xen-devel] Re: [PATCH] infiniband/mthca : Fix userland mapping of mthca

To: Vivien Bernet-Rollande <vbr@xxxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH] infiniband/mthca : Fix userland mapping of mthca infiniband cards in Xen dom0
From: Roland Dreier <rdreier@xxxxxxxxx>
Date: Thu, 06 Jan 2011 11:15:34 -0800
Authentication-results: sj-iport-6.cisco.com; dkim=neutral (message not signed) header.i=none
Cc: jackm@xxxxxxxxxxxxxx, Jeremy Fitzhardinge <jeremy@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, linux-rdma@xxxxxxxxxxxxxxx, rdreir@xxxxxxxxx, sean.hefty@xxxxxxxxx
Delivery-date: Thu, 06 Jan 2011 11:16:11 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AANLkTi=zMiVJfTRDeYvbxT46b0iASKG9jPgXqG81bqAK@xxxxxxxxxxxxxx> (Vivien Bernet-Rollande's message of "Thu, 6 Jan 2011 12:08:11 +0100")
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: <1293034260.30522.426.camel@trax> <adamxnfdty8.fsf@xxxxxxxxx> <AANLkTi=zMiVJfTRDeYvbxT46b0iASKG9jPgXqG81bqAK@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
 > > Finally as a stylistic thing I would probably prefer to see the
 > > vm_page_prot manipulation written as
 > >
 > >        vma->vm_page_prot = 
 > > pgprot_noncached(vm_get_page_prot(vma->vm_flags));
 > >
 > Makes sense.
 > While digging, I've also seen things like :
 > vma->vm_page_prot = pgprot_noncached(vm_get_page_prot(vma->vm_flags | 
 > VM_IO));

This isn't the same, since it doesn't set VM_IO in vm_flags.

 > > wrapped up in a helper function; presumably every instance of
 > >
 > >        vma->vm_page_prot = pgprot_FOO(vma->vm_page_prot)
 > >
 > > under drivers/ would need the same fix for Xen.
 > The issue is actually only related to mappings of bus memory to
 > userland. In kernel space, ioremap() is generaly used, which I
 > understand sets the _PAGE_IOMAP flag.

Right, but setting vm_page_prot means a driver is doing userspace
mapping of something, and if it's setting pgprot, that would generally
mean it's not mapping RAM.

 - R.

Xen-devel mailing list