]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Revert "xen-blkfront: set pages are FOREIGN_FRAME when sharing them"
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 7 May 2012 18:24:00 +0000 (14:24 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 7 May 2012 18:24:00 +0000 (14:24 -0400)
This reverts commit 9e4ff2f69bb3cc216aa79d838b079fbc3e220364.

As we are getting issues with this on PVonHVM guests.

drivers/block/xen-blkfront.c

index 8068a2729541760d1026cccfcaf19f5836ff6e1c..0406e48eee1519014020c6fbe7762e799e4cc028 100644 (file)
@@ -260,7 +260,7 @@ static int blkif_ioctl(struct block_device *bdev, fmode_t mode,
 static int blkif_queue_request(struct request *req)
 {
        struct blkfront_info *info = req->rq_disk->private_data;
-       unsigned long buffer_mfn, buffer_pfn;
+       unsigned long buffer_mfn;
        struct blkif_request *ring_req;
        unsigned long id;
        unsigned int fsect, lsect;
@@ -319,8 +319,7 @@ static int blkif_queue_request(struct request *req)
                       BLKIF_MAX_SEGMENTS_PER_REQUEST);
 
                for_each_sg(info->sg, sg, ring_req->u.rw.nr_segments, i) {
-                       buffer_pfn = page_to_pfn(sg_page(sg));
-                       buffer_mfn = pfn_to_mfn(buffer_pfn);
+                       buffer_mfn = pfn_to_mfn(page_to_pfn(sg_page(sg)));
                        fsect = sg->offset >> 9;
                        lsect = fsect + (sg->length >> 9) - 1;
                        /* install a grant reference. */
@@ -339,17 +338,6 @@ static int blkif_queue_request(struct request *req)
                                                .gref       = ref,
                                                .first_sect = fsect,
                                                .last_sect  = lsect };
-                       /* 
-                        * Set the page as foreign, considering that we are giving
-                        * it to a foreign domain.
-                        * This is important in case the destination domain is
-                        * ourselves, so that we can more easily recognize the
-                        * source pfn from destination pfn, both mapping to the same
-                        * mfn.
-                        */
-                       if (xen_pv_domain())
-                               set_phys_to_machine(buffer_pfn,
-                                               FOREIGN_FRAME(buffer_mfn));
                }
        }
 
@@ -729,12 +717,8 @@ static void blkif_completion(struct blk_shadow *s)
        int i;
        /* Do not let BLKIF_OP_DISCARD as nr_segment is in the same place
         * flag. */
-       for (i = 0; i < s->req.u.rw.nr_segments; i++) {
+       for (i = 0; i < s->req.u.rw.nr_segments; i++)
                gnttab_end_foreign_access(s->req.u.rw.seg[i].gref, 0, 0UL);
-               if (xen_pv_domain())
-                       set_phys_to_machine(s->frame[i],
-                                       get_phys_to_machine(s->frame[i]) & ~FOREIGN_FRAME_BIT);
-       }
 }
 
 static irqreturn_t blkif_interrupt(int irq, void *dev_id)
@@ -1070,20 +1054,13 @@ static int blkif_recover(struct blkfront_info *info)
                memcpy(&info->shadow[req->u.rw.id], &copy[i], sizeof(copy[i]));
 
                if (req->operation != BLKIF_OP_DISCARD) {
-                       unsigned long buffer_pfn;
-                       unsigned long buffer_mfn;
                /* Rewrite any grant references invalidated by susp/resume. */
-                       for (j = 0; j < req->u.rw.nr_segments; j++) {
-                               buffer_pfn = info->shadow[req->u.rw.id].frame[j];
-                               buffer_mfn = pfn_to_mfn(buffer_pfn);
+                       for (j = 0; j < req->u.rw.nr_segments; j++)
                                gnttab_grant_foreign_access_ref(
                                        req->u.rw.seg[j].gref,
                                        info->xbdev->otherend_id,
-                                       buffer_mfn,
+                                       pfn_to_mfn(info->shadow[req->u.rw.id].frame[j]),
                                        rq_data_dir(info->shadow[req->u.rw.id].request));
-                               if (xen_pv_domain())
-                                       set_phys_to_machine(buffer_pfn, FOREIGN_FRAME(buffer_mfn));
-                       }
                }
                info->shadow[req->u.rw.id].req = *req;