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] [PATCH 06/12] xen: gntdev: move use of GNTMAP_contains_pte n

To: linux-kernel@xxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 06/12] xen: gntdev: move use of GNTMAP_contains_pte next to the map_op
From: stefano.stabellini@xxxxxxxxxxxxx
Date: Mon, 10 Jan 2011 10:36:35 +0000
Cc: "Derek G. Murray" <Derek.Murray@xxxxxxxxxxxx>, Jeremy Fitzhardinge <jeremy@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, Ian Campbell <ian.campbell@xxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>, konrad.wilk@xxxxxxxxxx, Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>, Jeremy.Fitzhardinge@xxxxxxxxxx, Gerd Hoffmann <kraxel@xxxxxxxxxx>
Delivery-date: Mon, 10 Jan 2011 02:49:54 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.1101101012190.2390@kaball-desktop>
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: <alpine.DEB.2.00.1101101012190.2390@kaball-desktop>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
From: Ian Campbell <ian.campbell@xxxxxxxxxx>

This flag controls the meaning of gnttab_map_grant_ref.host_addr and
specifies that the field contains a reference to the pte entry to be
used to perform the mapping. Therefore move the use of this flag to
the point at which we actually use a reference to the pte instead of
something else, splitting up the usage of the flag in this way is
confusing and potentially error prone.

The other flags are all properties of the mapping itself as opposed to
properties of the hypercall arguments and therefore it make sense to
continue to pass them round in map->flags.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Cc: Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Cc: Derek G. Murray <Derek.Murray@xxxxxxxxxxxx>
Cc: Gerd Hoffmann <kraxel@xxxxxxxxxx>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
 drivers/xen/gntdev.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
index fa6355a..888d763 100644
--- a/drivers/xen/gntdev.c
+++ b/drivers/xen/gntdev.c
@@ -211,10 +211,12 @@ static int find_grant_ptes(pte_t *pte, pgtable_t token,
        BUG_ON(pgnr >= map->count);
        pte_maddr  = (u64)pfn_to_mfn(page_to_pfn(token)) << PAGE_SHIFT;
        pte_maddr += (unsigned long)pte & ~PAGE_MASK;
-       gnttab_set_map_op(&map->map_ops[pgnr], pte_maddr, map->flags,
+       gnttab_set_map_op(&map->map_ops[pgnr], pte_maddr,
+                         GNTMAP_contains_pte | map->flags,
-       gnttab_set_unmap_op(&map->unmap_ops[pgnr], pte_maddr, map->flags,
+       gnttab_set_unmap_op(&map->unmap_ops[pgnr], pte_maddr,
+                           GNTMAP_contains_pte | map->flags,
                            0 /* handle */);
        return 0;
@@ -569,7 +571,7 @@ static int gntdev_mmap(struct file *flip, struct 
vm_area_struct *vma)
        vma->vm_private_data = map;
        map->vma = vma;
-       map->flags = GNTMAP_host_map | GNTMAP_application_map | 
+       map->flags = GNTMAP_host_map | GNTMAP_application_map;
        if (!(vma->vm_flags & VM_WRITE))
                map->flags |= GNTMAP_readonly;

Xen-devel mailing list

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