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-changelog

[Xen-changelog] [linux-2.6.18-xen] blktap: Small fix to the blktap clear

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] blktap: Small fix to the blktap clear pte hook.
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 11 Jun 2007 02:23:17 -0700
Delivery-date: Mon, 11 Jun 2007 02:27:01 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1181034262 -3600
# Node ID 396dfc8423774be703a37d8d86fed37eadbc2eb7
# Parent  45dfe4cfc5ef81f158cbf301a10939ed66dcc483
blktap: Small fix to the blktap clear pte hook.

Fix an offset error in the foreign page map indexing, add support for
auto-translated physmap mode and remove warning message.

This is an update on a patch submitted by Isaku Yamahata 
<yamahata@xxxxxxxxxxxxx>.

Signed-off-by: Geoffrey Lefebvre <geoffrey@xxxxxxxxx>
---
 drivers/xen/blktap/blktap.c |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff -r 45dfe4cfc5ef -r 396dfc842377 drivers/xen/blktap/blktap.c
--- a/drivers/xen/blktap/blktap.c       Mon Jun 04 14:35:51 2007 +0100
+++ b/drivers/xen/blktap/blktap.c       Tue Jun 05 10:04:22 2007 +0100
@@ -309,7 +309,7 @@ static pte_t blktap_clear_pte(struct vm_
                              unsigned long uvaddr,
                              pte_t *ptep, int is_fullmm)
 {
-       pte_t copy = *ptep;
+       pte_t copy;
        tap_blkif_t *info;
        int offset, seg, usr_idx, pending_idx, mmap_idx;
        unsigned long uvstart = vma->vm_start + (RING_PAGES << PAGE_SHIFT);
@@ -319,20 +319,14 @@ static pte_t blktap_clear_pte(struct vm_
        struct grant_handle_pair *khandle;
        struct gnttab_unmap_grant_ref unmap[2];
        int count = 0;
-       static int print_warning = 1;
-
-       /* Print a warning message once, if the hook gets called. */
-       if (print_warning) {
-               WPRINTK("Clear pte hook called!\n");
-               print_warning = 0;
-       }
 
        /*
         * If the address is before the start of the grant mapped region or
         * if vm_file is NULL (meaning mmap failed and we have nothing to do)
         */
        if (uvaddr < uvstart || vma->vm_file == NULL)
-               return copy;
+               return ptep_get_and_clear_full(vma->vm_mm, uvaddr, 
+                                              ptep, is_fullmm);
 
        info = vma->vm_file->private_data;
        map = vma->vm_private_data;
@@ -352,7 +346,7 @@ static pte_t blktap_clear_pte(struct vm_
        kvaddr = idx_to_kaddr(mmap_idx, pending_idx, seg);
        pg = pfn_to_page(__pa(kvaddr) >> PAGE_SHIFT);
        ClearPageReserved(pg);
-       map[offset] = NULL;
+       map[offset + RING_PAGES] = NULL;
 
        khandle = &pending_handle(mmap_idx, pending_idx, seg);
 
@@ -368,12 +362,19 @@ static pte_t blktap_clear_pte(struct vm_
        if (khandle->user != INVALID_GRANT_HANDLE) {
                BUG_ON(xen_feature(XENFEAT_auto_translated_physmap));
 
+               copy = *ptep;
                gnttab_set_unmap_op(&unmap[count], virt_to_machine(ptep), 
                                    GNTMAP_host_map 
                                    | GNTMAP_application_map 
                                    | GNTMAP_contains_pte,
                                    khandle->user);
                count++;
+       } else {
+               BUG_ON(!xen_feature(XENFEAT_auto_translated_physmap));
+
+               /* USING SHADOW PAGE TABLES. */
+               copy = ptep_get_and_clear_full(vma->vm_mm, uvaddr, ptep,
+                                              is_fullmm);
        }
 
        if (count) {
@@ -979,6 +980,7 @@ static void fast_flush_area(pending_req_
                               MMAP_VADDR(info->user_vstart, u_idx, 0), 
                               req->nr_pages << PAGE_SHIFT, NULL);
                up_write(&info->vma->vm_mm->mmap_sem);
+               return;
        }
 
        mmap_idx = req->mem_idx;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] blktap: Small fix to the blktap clear pte hook., Xen patchbot-linux-2.6.18-xen <=