[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Remove option for running block devices without grant-tables.



# HG changeset patch
# User cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID 473af43ac65b1a872b058469d01acc6cfa21505d
# Parent  b6ededee6dc997ebe379aeb9c647ca6d43a96b8d
Remove option for running block devices without grant-tables.
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r b6ededee6dc9 -r 473af43ac65b linux-2.6-xen-sparse/arch/xen/Kconfig
--- a/linux-2.6-xen-sparse/arch/xen/Kconfig     Sun Aug 21 17:06:08 2005
+++ b/linux-2.6-xen-sparse/arch/xen/Kconfig     Mon Aug 22 10:20:58 2005
@@ -61,15 +61,6 @@
           with the blktap.  This option will be removed as the block drivers 
are
           modified to use grant tables.
 
-config XEN_BLKDEV_GRANT
-        bool "Grant table substrate for block drivers"
-        depends on !XEN_BLKDEV_TAP_BE
-        default y
-        help
-          This introduces the use of grant tables as a data exhange mechanism
-          between the frontend and backend block drivers. This currently
-          conflicts with the block tap.
-
 config XEN_NETDEV_BACKEND
        bool "Network-device backend driver"
        depends on XEN_PHYSDEV_ACCESS
diff -r b6ededee6dc9 -r 473af43ac65b 
linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_32
--- a/linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_32       Sun Aug 
21 17:06:08 2005
+++ b/linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_32       Mon Aug 
22 10:20:58 2005
@@ -14,7 +14,6 @@
 CONFIG_XEN_PHYSDEV_ACCESS=y
 CONFIG_XEN_BLKDEV_BACKEND=y
 # CONFIG_XEN_BLKDEV_TAP_BE is not set
-CONFIG_XEN_BLKDEV_GRANT=y
 CONFIG_XEN_NETDEV_BACKEND=y
 CONFIG_XEN_BLKDEV_FRONTEND=y
 CONFIG_XEN_NETDEV_FRONTEND=y
diff -r b6ededee6dc9 -r 473af43ac65b 
linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64
--- a/linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64       Sun Aug 
21 17:06:08 2005
+++ b/linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64       Mon Aug 
22 10:20:58 2005
@@ -14,7 +14,6 @@
 CONFIG_XEN_PHYSDEV_ACCESS=y
 CONFIG_XEN_BLKDEV_BACKEND=y
 # CONFIG_XEN_BLKDEV_TAP_BE is not set
-CONFIG_XEN_BLKDEV_GRANT=y
 CONFIG_XEN_NETDEV_BACKEND=y
 CONFIG_XEN_BLKDEV_FRONTEND=y
 CONFIG_XEN_NETDEV_FRONTEND=y
diff -r b6ededee6dc9 -r 473af43ac65b 
linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_32
--- a/linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_32       Sun Aug 
21 17:06:08 2005
+++ b/linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_32       Mon Aug 
22 10:20:58 2005
@@ -12,7 +12,6 @@
 #
 # CONFIG_XEN_PRIVILEGED_GUEST is not set
 # CONFIG_XEN_PHYSDEV_ACCESS is not set
-CONFIG_XEN_BLKDEV_GRANT=y
 CONFIG_XEN_BLKDEV_FRONTEND=y
 CONFIG_XEN_NETDEV_FRONTEND=y
 CONFIG_XEN_NETDEV_GRANT_TX=y
diff -r b6ededee6dc9 -r 473af43ac65b 
linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_64
--- a/linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_64       Sun Aug 
21 17:06:08 2005
+++ b/linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_64       Mon Aug 
22 10:20:58 2005
@@ -12,7 +12,6 @@
 #
 # CONFIG_XEN_PRIVILEGED_GUEST is not set
 # CONFIG_XEN_PHYSDEV_ACCESS is not set
-CONFIG_XEN_BLKDEV_GRANT=y
 CONFIG_XEN_BLKDEV_FRONTEND=y
 CONFIG_XEN_NETDEV_FRONTEND=y
 CONFIG_XEN_NETDEV_GRANT_TX=y
diff -r b6ededee6dc9 -r 473af43ac65b 
linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_32
--- a/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_32        Sun Aug 
21 17:06:08 2005
+++ b/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_32        Mon Aug 
22 10:20:58 2005
@@ -14,7 +14,6 @@
 CONFIG_XEN_PHYSDEV_ACCESS=y
 CONFIG_XEN_BLKDEV_BACKEND=y
 # CONFIG_XEN_BLKDEV_TAP_BE is not set
-CONFIG_XEN_BLKDEV_GRANT=y
 CONFIG_XEN_NETDEV_BACKEND=y
 CONFIG_XEN_BLKDEV_FRONTEND=y
 CONFIG_XEN_NETDEV_FRONTEND=y
diff -r b6ededee6dc9 -r 473af43ac65b 
linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_64
--- a/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_64        Sun Aug 
21 17:06:08 2005
+++ b/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_64        Mon Aug 
22 10:20:58 2005
@@ -14,7 +14,6 @@
 CONFIG_XEN_PHYSDEV_ACCESS=y
 CONFIG_XEN_BLKDEV_BACKEND=y
 # CONFIG_XEN_BLKDEV_TAP_BE is not set
-CONFIG_XEN_BLKDEV_GRANT=y
 CONFIG_XEN_NETDEV_BACKEND=y
 CONFIG_XEN_BLKDEV_FRONTEND=y
 CONFIG_XEN_NETDEV_FRONTEND=y
diff -r b6ededee6dc9 -r 473af43ac65b 
linux-2.6-xen-sparse/arch/xen/kernel/reboot.c
--- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c     Sun Aug 21 17:06:08 2005
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c     Mon Aug 22 10:20:58 2005
@@ -143,13 +143,8 @@
 #define usbif_resume() do{}while(0)
 #endif
 
-#ifdef CONFIG_XEN_BLKDEV_GRANT
     extern int gnttab_suspend(void);
     extern int gnttab_resume(void);
-#else
-#define gnttab_suspend() do{}while(0)
-#define gnttab_resume()  do{}while(0)
-#endif
 
 #ifdef CONFIG_SMP
     extern void smp_suspend(void);
diff -r b6ededee6dc9 -r 473af43ac65b 
linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c        Sun Aug 21 
17:06:08 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c        Mon Aug 22 
10:20:58 2005
@@ -80,7 +80,6 @@
 }
 #endif
 
-#ifdef CONFIG_XEN_BLKDEV_GRANT
 /* When using grant tables to map a frame for device access then the
  * handle returned must be used to unmap the frame. This is needed to
  * drop the ref count on the frame.
@@ -89,7 +88,6 @@
 #define pending_handle(_idx, _i) \
     (pending_grant_handles[((_idx) * BLKIF_MAX_SEGMENTS_PER_REQUEST) + (_i)])
 #define BLKBACK_INVALID_HANDLE (0xFFFF)
-#endif
 
 #ifdef CONFIG_XEN_BLKDEV_TAP_BE
 /*
@@ -110,7 +108,6 @@
 
 static void fast_flush_area(int idx, int nr_pages)
 {
-#ifdef CONFIG_XEN_BLKDEV_GRANT
     struct gnttab_unmap_grant_ref unmap[BLKIF_MAX_SEGMENTS_PER_REQUEST];
     unsigned int i, invcount = 0;
     u16 handle;
@@ -129,21 +126,6 @@
     if ( unlikely(HYPERVISOR_grant_table_op(
                     GNTTABOP_unmap_grant_ref, unmap, invcount)))
         BUG();
-#else
-
-    multicall_entry_t mcl[BLKIF_MAX_SEGMENTS_PER_REQUEST];
-    int               i;
-
-    for ( i = 0; i < nr_pages; i++ )
-    {
-       MULTI_update_va_mapping(mcl+i, MMAP_VADDR(idx, i),
-                               __pte(0), 0);
-    }
-
-    mcl[nr_pages-1].args[MULTI_UVMFLAGS_INDEX] = UVMF_TLB_FLUSH|UVMF_ALL;
-    if ( unlikely(HYPERVISOR_multicall(mcl, nr_pages) != 0) )
-        BUG();
-#endif
 }
 
 
@@ -367,12 +349,7 @@
     unsigned long fas = 0;
     int i, pending_idx = pending_ring[MASK_PEND_IDX(pending_cons)];
     pending_req_t *pending_req;
-#ifdef CONFIG_XEN_BLKDEV_GRANT
     struct gnttab_map_grant_ref map[BLKIF_MAX_SEGMENTS_PER_REQUEST];
-#else
-    unsigned long remap_prot;
-    multicall_entry_t mcl[BLKIF_MAX_SEGMENTS_PER_REQUEST];
-#endif
     struct phys_req preq;
     struct { 
         unsigned long buf; unsigned int nsec;
@@ -399,7 +376,6 @@
     preq.sector_number = req->sector_number;
     preq.nr_sects      = 0;
 
-#ifdef CONFIG_XEN_BLKDEV_GRANT
     for ( i = 0; i < nseg; i++ )
     {
         fas         = req->frame_and_sects[i];
@@ -435,20 +411,11 @@
 
         pending_handle(pending_idx, i) = map[i].handle;
     }
-#endif
 
     for ( i = 0; i < nseg; i++ )
     {
         fas         = req->frame_and_sects[i];
-#ifdef CONFIG_XEN_BLKDEV_GRANT
         seg[i].buf  = map[i].dev_bus_addr | (blkif_first_sect(fas) << 9);
-#else
-        seg[i].buf  = (fas & PAGE_MASK) | (blkif_first_sect(fas) << 9);
-        seg[i].nsec = blkif_last_sect(fas) - blkif_first_sect(fas) + 1;
-        if ( seg[i].nsec <= 0 )
-            goto bad_descriptor;
-        preq.nr_sects += seg[i].nsec;
-#endif
     }
 
     if ( vbd_translate(&preq, blkif, operation) != 0 )
@@ -458,40 +425,6 @@
                 preq.sector_number + preq.nr_sects, preq.dev); 
         goto bad_descriptor;
     }
-
-#ifndef CONFIG_XEN_BLKDEV_GRANT
-    if ( operation == READ )
-        remap_prot = _PAGE_PRESENT|_PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_RW;
-    else
-        remap_prot = _PAGE_PRESENT|_PAGE_DIRTY|_PAGE_ACCESSED;
-
-
-    for ( i = 0; i < nseg; i++ )
-    {
-       MULTI_update_va_mapping_otherdomain(
-           mcl+i, MMAP_VADDR(pending_idx, i),
-           pfn_pte_ma(seg[i].buf >> PAGE_SHIFT, __pgprot(remap_prot)),
-           0, blkif->domid);
-#ifdef CONFIG_XEN_BLKDEV_TAP_BE
-        if ( blkif->is_blktap )
-            mcl[i].args[MULTI_UVMDOMID_INDEX] = ID_TO_DOM(req->id);
-#endif
-        phys_to_machine_mapping[__pa(MMAP_VADDR(pending_idx, i))>>PAGE_SHIFT] =
-            FOREIGN_FRAME(seg[i].buf >> PAGE_SHIFT);
-    }
-
-    BUG_ON(HYPERVISOR_multicall(mcl, nseg) != 0);
-
-    for ( i = 0; i < nseg; i++ )
-    {
-        if ( unlikely(mcl[i].result != 0) )
-        {
-            DPRINTK("invalid buffer -- could not remap it\n");
-            fast_flush_area(pending_idx, nseg);
-            goto bad_descriptor;
-        }
-    }
-#endif /* end ifndef CONFIG_XEN_BLKDEV_GRANT */
 
     pending_req = &pending_reqs[pending_idx];
     pending_req->blkif     = blkif;
@@ -666,10 +599,7 @@
 
     blkif_xenbus_init();
 
-#ifdef CONFIG_XEN_BLKDEV_GRANT
     memset( pending_grant_handles,  BLKBACK_INVALID_HANDLE, MMAP_PAGES );
-    printk(KERN_ALERT "Blkif backend is using grant tables.\n");
-#endif
 
 #ifdef CONFIG_XEN_BLKDEV_TAP_BE
     printk(KERN_ALERT "NOTE: Blkif backend is running with tap support on!\n");
diff -r b6ededee6dc9 -r 473af43ac65b 
linux-2.6-xen-sparse/drivers/xen/blkback/common.h
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/common.h Sun Aug 21 17:06:08 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/common.h Mon Aug 22 10:20:58 2005
@@ -17,9 +17,7 @@
 #include <asm-xen/hypervisor.h>
 #include <asm-xen/xen-public/io/blkif.h>
 #include <asm-xen/xen-public/io/ring.h>
-#ifdef CONFIG_XEN_BLKDEV_GRANT
 #include <asm-xen/gnttab.h>
-#endif
 
 #if 0
 #define ASSERT(_p) \
@@ -69,11 +67,9 @@
     atomic_t         refcnt;
 
     struct work_struct work;
-#ifdef CONFIG_XEN_BLKDEV_GRANT
     u16 shmem_handle;
     unsigned long shmem_vaddr;
     grant_ref_t shmem_ref;
-#endif
 } blkif_t;
 
 void blkif_create(blkif_be_create_t *create);
diff -r b6ededee6dc9 -r 473af43ac65b 
linux-2.6-xen-sparse/drivers/xen/blkback/interface.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c      Sun Aug 21 
17:06:08 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c      Mon Aug 22 
10:20:58 2005
@@ -47,19 +47,6 @@
     return blkif;
 }
 
-#ifndef CONFIG_XEN_BLKDEV_GRANT
-static int map_frontend_page(blkif_t *blkif, unsigned long localaddr,
-                            unsigned long shared_page)
-{
-    return direct_remap_area_pages(&init_mm, localaddr,
-                                  shared_page<<PAGE_SHIFT, PAGE_SIZE,
-                                  __pgprot(_KERNPG_TABLE), blkif->domid);
-}
-
-static void unmap_frontend_page(blkif_t *blkif)
-{
-}
-#else
 static int map_frontend_page(blkif_t *blkif, unsigned long localaddr,
                             unsigned long shared_page)
 {
@@ -91,7 +78,6 @@
     op.dev_bus_addr = 0;
     BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, &op, 1));
 }
-#endif /* CONFIG_XEN_BLKDEV_GRANT */
 
 int blkif_map(blkif_t *blkif, unsigned long shared_page, unsigned int evtchn)
 {
diff -r b6ededee6dc9 -r 473af43ac65b 
linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c Sun Aug 21 17:06:08 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c Mon Aug 22 10:20:58 2005
@@ -75,16 +75,6 @@
        if (vbd_is_active(be->vbd))
                return;
 
-#ifndef CONFIG_XEN_BLKDEV_GRANT
-       err = xenbus_gather(be->frontpath, "shared-frame", "%lu", &sharedmfn,
-                           "event-channel", "%u", &evtchn, NULL);
-       if (err) {
-               xenbus_dev_error(be->dev, err, 
-                                "reading %s/shared-frame and event-channel",
-                                be->frontpath);
-               return;
-       }
-#else
        err = xenbus_gather(be->frontpath, "grant-id", "%lu", &sharedmfn,
                            "event-channel", "%u", &evtchn, NULL);
        if (err) {
@@ -93,7 +83,6 @@
                                 be->frontpath);
                return;
        }
-#endif
 
        /* Domains must use same shared frame for all vbds. */
        if (be->blkif->status == CONNECTED &&
diff -r b6ededee6dc9 -r 473af43ac65b 
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c      Sun Aug 21 
17:06:08 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c      Mon Aug 22 
10:20:58 2005
@@ -55,10 +55,8 @@
 #include <scsi/scsi.h>
 #include <asm-xen/evtchn.h>
 #include <asm-xen/xenbus.h>
-#ifdef CONFIG_XEN_BLKDEV_GRANT
 #include <asm-xen/xen-public/grant_table.h>
 #include <asm-xen/gnttab.h>
-#endif
 
 typedef unsigned char byte; /* from linux/ide.h */
 
@@ -78,14 +76,12 @@
 
 #define BLK_RING_SIZE __RING_SIZE((blkif_sring_t *)0, PAGE_SIZE)
 
-#ifdef CONFIG_XEN_BLKDEV_GRANT
 static domid_t rdomid = 0;
 static grant_ref_t gref_head, gref_terminal;
 #define MAXIMUM_OUTSTANDING_BLOCK_REQS \
     (BLKIF_MAX_SEGMENTS_PER_REQUEST * BLKIF_RING_SIZE)
 #define GRANTREF_INVALID (1<<15)
 static int shmem_ref;
-#endif
 
 static struct blk_shadow {
     blkif_request_t req;
@@ -131,30 +127,14 @@
 
 static inline void pickle_request(struct blk_shadow *s, blkif_request_t *r)
 {
-#ifndef CONFIG_XEN_BLKDEV_GRANT
-    int i;
-#endif
 
     s->req = *r;
-
-#ifndef CONFIG_XEN_BLKDEV_GRANT
-    for ( i = 0; i < r->nr_segments; i++ )
-        s->req.frame_and_sects[i] = machine_to_phys(r->frame_and_sects[i]);
-#endif
 }
 
 static inline void unpickle_request(blkif_request_t *r, struct blk_shadow *s)
 {
-#ifndef CONFIG_XEN_BLKDEV_GRANT
-    int i;
-#endif
 
     *r = s->req;
-
-#ifndef CONFIG_XEN_BLKDEV_GRANT
-    for ( i = 0; i < s->req.nr_segments; i++ )
-        r->frame_and_sects[i] = phys_to_machine(s->req.frame_and_sects[i]);
-#endif
 }
 
 
@@ -256,9 +236,7 @@
     int idx;
     unsigned long id;
     unsigned int fsect, lsect;
-#ifdef CONFIG_XEN_BLKDEV_GRANT
     int ref;
-#endif
 
     if ( unlikely(blkif_state != BLKIF_STATE_CONNECTED) )
         return 1;
@@ -284,7 +262,6 @@
             buffer_ma = page_to_phys(bvec->bv_page);
             fsect = bvec->bv_offset >> 9;
             lsect = fsect + (bvec->bv_len >> 9) - 1;
-#ifdef CONFIG_XEN_BLKDEV_GRANT
             /* install a grant reference. */
             ref = gnttab_claim_grant_reference(&gref_head, gref_terminal);
             ASSERT( ref != -ENOSPC );
@@ -300,11 +277,6 @@
 
             ring_req->frame_and_sects[ring_req->nr_segments++] =
                 blkif_fas_from_gref(ref, fsect, lsect);
-
-#else
-            ring_req->frame_and_sects[ring_req->nr_segments++] =
-                blkif_fas(buffer_ma, fsect, lsect);
-#endif
         }
     }
 
@@ -711,9 +683,7 @@
     blkif_request_t    *req;
     struct buffer_head *bh;
     unsigned int        fsect, lsect;
-#ifdef CONFIG_XEN_BLKDEV_GRANT
     int ref;
-#endif
 
     fsect = (buffer_ma & ~PAGE_MASK) >> 9;
     lsect = fsect + nr_sectors - 1;
@@ -762,7 +732,6 @@
             bh->b_reqnext = (struct buffer_head *)blk_shadow[req->id].request;
             blk_shadow[req->id].request = (unsigned long)id;
 
-#ifdef CONFIG_XEN_BLKDEV_GRANT
             /* install a grant reference. */
             ref = gnttab_claim_grant_reference(&gref_head, gref_terminal);
             ASSERT( ref != -ENOSPC );
@@ -778,10 +747,6 @@
 
             req->frame_and_sects[req->nr_segments] =
                 blkif_fas_from_gref(ref, fsect, lsect);
-#else
-            req->frame_and_sects[req->nr_segments] =
-                blkif_fas(buffer_ma, fsect, lsect);
-#endif
             if ( ++req->nr_segments < BLKIF_MAX_SEGMENTS_PER_REQUEST )
                 sg_next_sect += nr_sectors;
             else
@@ -819,7 +784,6 @@
     req->sector_number = (blkif_sector_t)sector_number;
     req->handle        = handle; 
     req->nr_segments   = 1;
-#ifdef CONFIG_XEN_BLKDEV_GRANT
     /* install a grant reference. */
     ref = gnttab_claim_grant_reference(&gref_head, gref_terminal);
     ASSERT( ref != -ENOSPC );
@@ -833,9 +797,6 @@
     blk_shadow[xid].frame[0] = buffer_ma >> PAGE_SHIFT;
 
     req->frame_and_sects[0] = blkif_fas_from_gref(ref, fsect, lsect);
-#else
-    req->frame_and_sects[0] = blkif_fas(buffer_ma, fsect, lsect);
-#endif
 
     /* Keep a private copy so we can reissue requests when recovering. */    
     pickle_request(&blk_shadow[xid], req);
@@ -1015,9 +976,7 @@
     int i;
     blkif_request_t *req;
     struct blk_shadow *copy;
-#ifdef CONFIG_XEN_BLKDEV_GRANT
     int j;
-#endif
 
     /* Stage 1: Make a safe copy of the shadow state. */
     copy = (struct blk_shadow *)kmalloc(sizeof(blk_shadow), GFP_KERNEL);
@@ -1047,7 +1006,6 @@
         req->id = GET_ID_FROM_FREELIST();
         memcpy(&blk_shadow[req->id], &copy[i], sizeof(copy[i]));
 
-#ifdef CONFIG_XEN_BLKDEV_GRANT
         /* Rewrite any grant references invalidated by suspend/resume. */
         for ( j = 0; j < req->nr_segments; j++ )
         {
@@ -1061,7 +1019,6 @@
             req->frame_and_sects[j] &= ~GRANTREF_INVALID;
         }
         blk_shadow[req->id].req = *req;
-#endif
 
         blk_ring.req_prod_pvt++;
     }
@@ -1085,9 +1042,7 @@
     int err = 0;
 
     blkif_evtchn = evtchn;
-#ifdef CONFIG_XEN_BLKDEV_GRANT
     rdomid       = domid;
-#endif
 
     err = bind_evtchn_to_irqhandler(
         blkif_evtchn, blkif_int, SA_SAMPLE_RANDOM, "blkif", NULL);
@@ -1168,7 +1123,6 @@
        SHARED_RING_INIT(sring);
        FRONT_RING_INIT(&blk_ring, sring, PAGE_SIZE);
 
-#ifdef CONFIG_XEN_BLKDEV_GRANT
        shmem_ref = gnttab_claim_grant_reference(&gref_head,
                                                 gref_terminal);
        ASSERT(shmem_ref != -ENOSPC);
@@ -1176,7 +1130,6 @@
                                        backend_id,
                                        virt_to_mfn(blk_ring.sring),
                                        0);
-#endif
 
        op.u.alloc_unbound.dom = backend_id;
        err = HYPERVISOR_event_channel_op(&op);
@@ -1228,20 +1181,11 @@
                goto destroy_blkring;
        }
 
-#ifdef CONFIG_XEN_BLKDEV_GRANT
        err = xenbus_printf(dev->nodename, "grant-id","%u", shmem_ref);
        if (err) {
                message = "writing grant-id";
                goto abort_transaction;
        }
-#else
-       err = xenbus_printf(dev->nodename, "shared-frame", "%lu",
-                           virt_to_mfn(blk_ring.sring));
-       if (err) {
-               message = "writing shared-frame";
-               goto abort_transaction;
-       }
-#endif
        err = xenbus_printf(dev->nodename,
                            "event-channel", "%u", blkif_evtchn);
        if (err) {
@@ -1419,13 +1363,10 @@
 {
     int i;
 
-#ifdef CONFIG_XEN_BLKDEV_GRANT
     /* A grant for every ring slot, plus one for the ring itself. */
     if (gnttab_alloc_grant_references(MAXIMUM_OUTSTANDING_BLOCK_REQS + 1,
                                      &gref_head, &gref_terminal) < 0)
         return 1;
-    printk(KERN_ALERT "Blkif frontend is using grant tables.\n");
-#endif
 
     if ( (xen_start_info.flags & SIF_INITDOMAIN) ||
          (xen_start_info.flags & SIF_BLK_BE_DOMAIN) )
@@ -1449,20 +1390,7 @@
 static void blkif_completion(struct blk_shadow *s)
 {
     int i;
-#ifdef CONFIG_XEN_BLKDEV_GRANT
     for ( i = 0; i < s->req.nr_segments; i++ )
         gnttab_release_grant_reference(
             &gref_head, blkif_gref_from_fas(s->req.frame_and_sects[i]));
-#else
-    /* This is a hack to get the dirty logging bits set */
-    if ( s->req.operation == BLKIF_OP_READ )
-    {
-        for ( i = 0; i < s->req.nr_segments; i++ )
-        {
-            unsigned long pfn = s->req.frame_and_sects[i] >> PAGE_SHIFT;
-            unsigned long mfn = phys_to_machine_mapping[pfn];
-            xen_machphys_update(mfn, pfn);
-        }
-    }
-#endif
-}
+}
diff -r b6ededee6dc9 -r 473af43ac65b xen/include/public/io/blkif.h
--- a/xen/include/public/io/blkif.h     Sun Aug 21 17:06:08 2005
+++ b/xen/include/public/io/blkif.h     Mon Aug 22 10:20:58 2005
@@ -36,11 +36,7 @@
     unsigned long  id;           /* private guest value, echoed in resp  */
     blkif_sector_t sector_number;/* start sector idx on disk (r/w only)  */
     /* @f_a_s[4:0]=last_sect ; @f_a_s[9:5]=first_sect                        */
-#ifdef CONFIG_XEN_BLKDEV_GRANT
     /* @f_a_s[:16]= grant reference (16 bits)                                */
-#else
-    /* @f_a_s[:12]=@frame: machine page frame number.                        */
-#endif
     /* @first_sect: first sector in frame to transfer (inclusive).           */
     /* @last_sect: last sector in frame to transfer (inclusive).             */
     unsigned long  frame_and_sects[BLKIF_MAX_SEGMENTS_PER_REQUEST];
@@ -50,10 +46,8 @@
 #define blkif_first_sect(_fas) (((_fas)>>5)&31)
 #define blkif_last_sect(_fas)  ((_fas)&31)
 
-#ifdef CONFIG_XEN_BLKDEV_GRANT
 #define blkif_fas_from_gref(_gref, _fs, _ls) (((_gref)<<16)|((_fs)<<5)|(_ls))
 #define blkif_gref_from_fas(_fas) ((_fas)>>16)
-#endif
 
 typedef struct blkif_response {
     unsigned long   id;              /* copied from request */

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.