ia64/xen-unstable

changeset 207:39dc127a1ffe

bitkeeper revision 1.68 (3e53be42OUDyPzjPoKWKLkNgVODyHA)

Many files:
Big changes to blkdev layer -- rings now allocated in hypervisor space.
author kaf24@labyrinth.cl.cam.ac.uk
date Wed Feb 19 17:26:26 2003 +0000 (2003-02-19)
parents 75005643116d
children 2203f6130483
files xen-2.4.16/common/domain.c xen-2.4.16/common/event.c xen-2.4.16/drivers/block/xen_block.c xen-2.4.16/include/hypervisor-ifs/block.h xen-2.4.16/include/hypervisor-ifs/hypervisor-if.h xen-2.4.16/include/hypervisor-ifs/network.h xen-2.4.16/include/xeno/sched.h xenolinux-2.4.16-sparse/arch/xeno/drivers/block/xl_block.c xenolinux-2.4.16-sparse/arch/xeno/drivers/block/xl_block_test.c xenolinux-2.4.16-sparse/arch/xeno/mm/init.c xenolinux-2.4.16-sparse/include/asm-xeno/pgtable.h
line diff
     1.1 --- a/xen-2.4.16/common/domain.c	Wed Feb 19 14:06:47 2003 +0000
     1.2 +++ b/xen-2.4.16/common/domain.c	Wed Feb 19 17:26:26 2003 +0000
     1.3 @@ -42,10 +42,17 @@ struct task_struct *do_newdomain(unsigne
     1.4      p->domain    = dom_id;
     1.5      p->processor = cpu;
     1.6  
     1.7 +    spin_lock_init(&p->blk_ring_lock);
     1.8 +
     1.9      p->shared_info = (void *)get_free_page(GFP_KERNEL);
    1.10      memset(p->shared_info, 0, PAGE_SIZE);
    1.11      SHARE_PFN_WITH_DOMAIN(virt_to_page(p->shared_info), dom_id);
    1.12  
    1.13 +    if ( sizeof(*p->blk_ring_base) > PAGE_SIZE ) BUG();
    1.14 +    p->blk_ring_base = (blk_ring_t *)get_free_page(GFP_KERNEL);
    1.15 +    memset(p->blk_ring_base, 0, PAGE_SIZE);
    1.16 +    SHARE_PFN_WITH_DOMAIN(virt_to_page(p->blk_ring_base), dom_id);
    1.17 +
    1.18      SET_GDT_ENTRIES(p, DEFAULT_GDT_ENTRIES);
    1.19      SET_GDT_ADDRESS(p, DEFAULT_GDT_ADDRESS);
    1.20  
    1.21 @@ -54,16 +61,7 @@ struct task_struct *do_newdomain(unsigne
    1.22      p->active_mm  = &p->mm;
    1.23      p->num_net_vifs = 0;
    1.24  
    1.25 -    INIT_LIST_HEAD(&p->io_done_queue);
    1.26 -    spin_lock_init(&p->io_done_queue_lock);
    1.27 -
    1.28 -    /*
    1.29 -     * KAF: Passing in newdomain struct to this function is gross!
    1.30 -     * Therefore, for now we just allocate the single blk_ring
    1.31 -     * before the multiople net_rings :-)
    1.32 -     */
    1.33 -    p->blk_ring_base = (blk_ring_t *)(p->shared_info + 1);
    1.34 -    p->net_ring_base = (net_ring_t *)(p->blk_ring_base + 1);
    1.35 +    p->net_ring_base = (net_ring_t *)(p->shared_info + 1);
    1.36      INIT_LIST_HEAD(&p->pg_head);
    1.37      p->tot_pages = 0;
    1.38      write_lock_irqsave(&tasklist_lock, flags);
    1.39 @@ -218,6 +216,9 @@ void release_task(struct task_struct *p)
    1.40      }
    1.41      if ( p->mm.perdomain_pt ) free_page((unsigned long)p->mm.perdomain_pt);
    1.42  
    1.43 +    UNSHARE_PFN(virt_to_page(p->blk_ring_base));
    1.44 +    free_page((unsigned long)p->blk_ring_base);
    1.45 +
    1.46      UNSHARE_PFN(virt_to_page(p->shared_info));
    1.47      free_page((unsigned long)p->shared_info);
    1.48  
    1.49 @@ -316,7 +317,7 @@ int final_setup_guestos(struct task_stru
    1.50      virt_startinfo_addr->num_net_rings = p->num_net_vifs;
    1.51  
    1.52      /* Add block io interface */
    1.53 -    virt_startinfo_addr->blk_ring = (blk_ring_t *)SH2G(p->blk_ring_base);
    1.54 +    virt_startinfo_addr->blk_ring = virt_to_phys(p->blk_ring_base);
    1.55  
    1.56      /* Copy the command line */
    1.57      strcpy(virt_startinfo_addr->cmd_line, meminfo->cmd_line);
    1.58 @@ -548,9 +549,7 @@ int setup_guestos(struct task_struct *p,
    1.59      virt_startinfo_address->num_net_rings = p->num_net_vifs;
    1.60  
    1.61      /* Add block io interface */
    1.62 -    virt_startinfo_address->blk_ring = 
    1.63 -	(blk_ring_t *)SHIP2GUEST(p->blk_ring_base); 
    1.64 -
    1.65 +    virt_startinfo_address->blk_ring = virt_to_phys(p->blk_ring_base); 
    1.66  
    1.67      /* We tell OS about any modules we were given. */
    1.68      if ( nr_mods > 1 )
     2.1 --- a/xen-2.4.16/common/event.c	Wed Feb 19 14:06:47 2003 +0000
     2.2 +++ b/xen-2.4.16/common/event.c	Wed Feb 19 17:26:26 2003 +0000
     2.3 @@ -14,7 +14,6 @@
     2.4  typedef void (*hyp_event_callback_fn_t)(void);
     2.5  
     2.6  extern void schedule(void);
     2.7 -extern void flush_blk_queue(void);
     2.8  extern void update_shared_ring(void);
     2.9  
    2.10  /* Ordering must match definitions of _HYP_EVENT_* in xeno/sched.h */
    2.11 @@ -23,7 +22,6 @@ static hyp_event_callback_fn_t event_cal
    2.12      schedule,
    2.13      update_shared_ring,
    2.14      kill_domain, 
    2.15 -    flush_blk_queue
    2.16  };
    2.17  
    2.18  /* Handle outstanding events for the currently-executing domain. */
     3.1 --- a/xen-2.4.16/drivers/block/xen_block.c	Wed Feb 19 14:06:47 2003 +0000
     3.2 +++ b/xen-2.4.16/drivers/block/xen_block.c	Wed Feb 19 17:26:26 2003 +0000
     3.3 @@ -34,12 +34,12 @@ typedef struct blk_request
     3.4  {
     3.5    struct list_head queue;
     3.6    struct buffer_head *bh;
     3.7 -  blk_ring_entry_t request;
     3.8 -  struct task_struct *domain;                           /* requesting domain */
     3.9 +  blk_ring_req_entry_t *request;
    3.10 +  struct task_struct *domain;                /* requesting domain */
    3.11  } blk_request_t;
    3.12  #define MAX_PENDING_REQS 256                 /* very arbitrary */
    3.13  static kmem_cache_t *blk_request_cachep;
    3.14 -static atomic_t nr_pending, nr_done;
    3.15 +static atomic_t nr_pending;
    3.16  static int pending_work;              /* which domains have work for us? */
    3.17  
    3.18  
    3.19 @@ -62,10 +62,12 @@ int dispatch_debug_block_io (int index);
    3.20  void end_block_io_op(struct buffer_head * bh)
    3.21  {
    3.22      unsigned long cpu_mask;
    3.23 -    /* struct list_head *list;*/
    3.24      blk_request_t *blk_request = NULL;
    3.25 -    unsigned long flags; /* irq save */
    3.26 +    unsigned long flags;
    3.27      struct task_struct *p;
    3.28 +    int position = 0;
    3.29 +    blk_ring_t *blk_ring;
    3.30 +    int loop;
    3.31  
    3.32      if (XEN_BLK_DEBUG)  
    3.33  	printk(XEN_BLK_DEBUG_LEVEL "XEN end_block_io_op,  bh: %lx\n",
    3.34 @@ -77,76 +79,24 @@ void end_block_io_op(struct buffer_head 
    3.35      
    3.36      p = blk_request->domain;
    3.37  
    3.38 -    atomic_inc(&nr_done);
    3.39 -    spin_lock_irqsave(&p->io_done_queue_lock, flags);
    3.40 -    list_add_tail(&blk_request->queue, &p->io_done_queue);
    3.41 -    /* enqueue work for 'flush_blk_queue' handler */
    3.42 -    cpu_mask = mark_hyp_event(p, _HYP_EVENT_BLK_RX);
    3.43 -    spin_unlock_irqrestore(&p->io_done_queue_lock, flags);
    3.44 -    
    3.45 -    /* now kick the hypervisor */
    3.46 -    hyp_event_notify(cpu_mask); 
    3.47 -    return;
    3.48 -
    3.49 - bad_interrupt:
    3.50 -    printk (KERN_ALERT
    3.51 -            "   block io interrupt received for unknown buffer [0x%lx]\n",
    3.52 -            (unsigned long) bh);
    3.53 -    BUG();
    3.54 -    return;
    3.55 -}
    3.56 -
    3.57 -/*
    3.58 - * flush_blk_queue
    3.59 - *
    3.60 - * Called by the hypervisor synchronously when there is something to do
    3.61 - * (block transfers have completed)
    3.62 - */
    3.63 -
    3.64 -void flush_blk_queue(void)
    3.65 -{
    3.66 -    struct task_struct *p = current;
    3.67 -    blk_request_t *blk_request;
    3.68 -    int position = 0;
    3.69 -    blk_ring_t *blk_ring;
    3.70 -    unsigned long flags;
    3.71 -    int loop;
    3.72 +    /* Place on the response ring for the relevant domain. */ 
    3.73 +    spin_lock_irqsave(&p->blk_ring_lock, flags);
    3.74 +    blk_ring = p->blk_ring_base;
    3.75 +    position = blk_ring->resp_prod;
    3.76 +    blk_ring->resp_ring[position].id     = blk_request->request->id;
    3.77 +    blk_ring->resp_ring[position].status = 0;
    3.78 +    blk_ring->resp_prod = BLK_RESP_RING_INC(blk_ring->resp_prod);
    3.79 +    spin_unlock_irqrestore(&p->blk_ring_lock, flags);
    3.80      
    3.81 -    spin_lock_irqsave(&p->io_done_queue_lock, flags);
    3.82 -    clear_bit(_HYP_EVENT_BLK_RX, &p->hyp_events);
    3.83 -    
    3.84 -    while ( !list_empty(&p->io_done_queue) )
    3.85 -    {
    3.86 -	blk_request = list_entry(p->io_done_queue.next, blk_request_t, queue);
    3.87 -	list_del(&blk_request->queue);
    3.88 -	spin_unlock_irqrestore(&p->io_done_queue_lock, flags);
    3.89 -	atomic_dec(&nr_done);
    3.90 -
    3.91 -	/* place on ring for guest os */ 
    3.92 -	blk_ring = p->blk_ring_base;
    3.93 -	position = blk_ring->brx_prod;
    3.94 -
    3.95 -	if (XEN_BLK_DEBUG)  
    3.96 -	    printk(XEN_BLK_DEBUG_LEVEL "XEN flush_blk_queue [%d]\n", position);
    3.97 +    /* Kick the relevant domain. */
    3.98 +    cpu_mask = mark_guest_event(p, _EVENT_BLK_RESP);
    3.99 +    guest_event_notify(cpu_mask); 
   3.100  
   3.101 -	memcpy(&blk_ring->brx_ring[position], &blk_request->request,
   3.102 -	       sizeof(blk_ring_entry_t));
   3.103 -	blk_ring->brx_prod = BLK_RX_RING_INC(blk_ring->brx_prod);
   3.104 -
   3.105 -	/* notify appropriate guest os */
   3.106 -	set_bit(_EVENT_BLK_RX, &p->shared_info->events);
   3.107 -	
   3.108 -	/* free the buffer header allocated in do_block_io_op */
   3.109 -	if ( blk_request->bh )
   3.110 -	    kfree(blk_request->bh); 
   3.111 -
   3.112 -        kmem_cache_free(blk_request_cachep, blk_request);
   3.113 -
   3.114 -	spin_lock_irqsave(&p->io_done_queue_lock, flags);
   3.115 -    }
   3.116 -    spin_unlock_irqrestore(&p->io_done_queue_lock, flags);
   3.117 -
   3.118 -
   3.119 +    /* Free state associated with this request. */
   3.120 +    if ( blk_request->bh ) 
   3.121 +        kfree(blk_request->bh);     
   3.122 +    kmem_cache_free(blk_request_cachep, blk_request);
   3.123 +    
   3.124      /* XXX SMH: below is ugly and dangerous -- fix */
   3.125      /*
   3.126       * now check if there is any pending work from any domain
   3.127 @@ -177,7 +127,14 @@ void flush_blk_queue(void)
   3.128  	}
   3.129      }
   3.130  
   3.131 -    return; 
   3.132 +    return;
   3.133 +
   3.134 + bad_interrupt:
   3.135 +    printk (KERN_ALERT
   3.136 +            "   block io interrupt received for unknown buffer [0x%lx]\n",
   3.137 +            (unsigned long) bh);
   3.138 +    BUG();
   3.139 +    return;
   3.140  }
   3.141  
   3.142  
   3.143 @@ -206,15 +163,15 @@ long do_block_io_op_domain (struct task_
   3.144  
   3.145      if (XEN_BLK_DEBUG)  
   3.146  	printk(XEN_BLK_DEBUG_LEVEL "XEN do_block_io_op %d %d\n",
   3.147 -	       blk_ring->btx_cons, blk_ring->btx_prod);
   3.148 +	       blk_ring->req_cons, blk_ring->req_prod);
   3.149  
   3.150 -    for (loop = blk_ring->btx_cons; 
   3.151 -	 loop != blk_ring->btx_prod; 
   3.152 -	 loop = BLK_TX_RING_INC(loop)) {
   3.153 -
   3.154 +    for ( loop = blk_ring->req_cons; 
   3.155 +	  loop != blk_ring->req_prod; 
   3.156 +	  loop = BLK_REQ_RING_INC(loop) ) 
   3.157 +    {
   3.158  	status = 1;
   3.159  
   3.160 -	switch (blk_ring->btx_ring[loop].operation) {
   3.161 +	switch (blk_ring->req_ring[loop].operation) {
   3.162  
   3.163  	case XEN_BLOCK_READ:
   3.164  	case XEN_BLOCK_WRITE:
   3.165 @@ -231,7 +188,7 @@ long do_block_io_op_domain (struct task_
   3.166  
   3.167  	default:
   3.168  	    printk (KERN_ALERT "error: unknown block io operation [%d]\n",
   3.169 -		    blk_ring->btx_ring[loop].operation);
   3.170 +		    blk_ring->req_ring[loop].operation);
   3.171  	    BUG();
   3.172  	}
   3.173  
   3.174 @@ -247,7 +204,7 @@ long do_block_io_op_domain (struct task_
   3.175  	}
   3.176      }
   3.177  
   3.178 -    blk_ring->btx_cons = loop;
   3.179 +    blk_ring->req_cons = loop;
   3.180      return 0L;
   3.181  }
   3.182  
   3.183 @@ -265,14 +222,13 @@ int dispatch_probe_block_io (int index)
   3.184      blk_ring_t *blk_ring = current->blk_ring_base;
   3.185      xen_disk_info_t *xdi;
   3.186      
   3.187 -    xdi = phys_to_virt((unsigned long)blk_ring->btx_ring[index].buffer);
   3.188 +    xdi = phys_to_virt((unsigned long)blk_ring->req_ring[index].buffer);
   3.189      
   3.190      ide_probe_devices(xdi);
   3.191 -    
   3.192 -    memcpy(&blk_ring->brx_ring[blk_ring->brx_prod], 
   3.193 -	   &blk_ring->btx_ring[index], 
   3.194 -	   sizeof(blk_ring_entry_t));
   3.195 -    blk_ring->brx_prod = BLK_RX_RING_INC(blk_ring->brx_prod);
   3.196 +
   3.197 +    blk_ring->resp_ring[blk_ring->resp_prod].id = blk_ring->req_ring[index].id;
   3.198 +    blk_ring->resp_ring[blk_ring->resp_prod].status = 0;
   3.199 +    blk_ring->resp_prod = BLK_RESP_RING_INC(blk_ring->resp_prod);
   3.200      
   3.201      return 0;
   3.202  }
   3.203 @@ -291,24 +247,24 @@ int dispatch_rw_block_io (int index)
   3.204       * check to make sure that the block request seems at least
   3.205       * a bit legitimate
   3.206       */
   3.207 -    if ((blk_ring->btx_ring[index].block_size & (0x200 - 1)) != 0) {
   3.208 +    if ((blk_ring->req_ring[index].block_size & (0x200 - 1)) != 0) {
   3.209  	printk(KERN_ALERT "    error: dodgy block size: %d\n", 
   3.210 -	       blk_ring->btx_ring[index].block_size);
   3.211 +	       blk_ring->req_ring[index].block_size);
   3.212  	BUG();
   3.213      }
   3.214      
   3.215 -    if(blk_ring->btx_ring[index].buffer == NULL) { 
   3.216 +    if(blk_ring->req_ring[index].buffer == NULL) { 
   3.217  	printk(KERN_ALERT "xen_block: bogus buffer from guestOS\n"); 
   3.218  	BUG();
   3.219      }
   3.220  
   3.221      if (XEN_BLK_DEBUG) {
   3.222 -	printk(XEN_BLK_DEBUG_LEVEL "    btx_cons: %d  btx_prod %d  index: %d "
   3.223 -	       "op: %s, pri: %s\n", blk_ring->btx_cons, blk_ring->btx_prod, 
   3.224 +	printk(XEN_BLK_DEBUG_LEVEL "    req_cons: %d  req_prod %d  index: %d "
   3.225 +	       "op: %s, pri: %s\n", blk_ring->req_cons, blk_ring->req_prod, 
   3.226  	       index, 
   3.227 -	       (blk_ring->btx_ring[index].operation == XEN_BLOCK_READ ? 
   3.228 +	       (blk_ring->req_ring[index].operation == XEN_BLOCK_READ ? 
   3.229  		"read" : "write"), 
   3.230 -	       (blk_ring->btx_ring[index].priority == XEN_BLOCK_SYNC ? 
   3.231 +	       (blk_ring->req_ring[index].priority == XEN_BLOCK_SYNC ? 
   3.232  		"sync" : "async"));
   3.233      }
   3.234  
   3.235 @@ -319,7 +275,6 @@ int dispatch_rw_block_io (int index)
   3.236      blk_request = kmem_cache_alloc(blk_request_cachep, GFP_ATOMIC);
   3.237  
   3.238      /* we'll be doing this frequently, would a cache be appropriate? */
   3.239 -    /* free in flush_blk_queue */
   3.240      bh = (struct buffer_head *) kmalloc(sizeof(struct buffer_head), 
   3.241  					GFP_KERNEL);
   3.242      if (!bh) {
   3.243 @@ -330,16 +285,16 @@ int dispatch_rw_block_io (int index)
   3.244      /* set just the important bits of the buffer header */
   3.245      memset (bh, 0, sizeof (struct buffer_head));
   3.246      
   3.247 -    bh->b_blocknr       = blk_ring->btx_ring[index].block_number;
   3.248 -    bh->b_size          = blk_ring->btx_ring[index].block_size; 
   3.249 -    bh->b_dev           = blk_ring->btx_ring[index].device; 
   3.250 -    bh->b_rsector       = blk_ring->btx_ring[index].sector_number;
   3.251 +    bh->b_blocknr       = blk_ring->req_ring[index].block_number;
   3.252 +    bh->b_size          = blk_ring->req_ring[index].block_size; 
   3.253 +    bh->b_dev           = blk_ring->req_ring[index].device; 
   3.254 +    bh->b_rsector       = blk_ring->req_ring[index].sector_number;
   3.255      bh->b_data          = phys_to_virt((unsigned long)
   3.256 -				       blk_ring->btx_ring[index].buffer);
   3.257 +				       blk_ring->req_ring[index].buffer);
   3.258      bh->b_count.counter = 1;
   3.259      bh->b_xen_request   = (void *)blk_request;  
   3.260      
   3.261 -    if (blk_ring->btx_ring[index].operation == XEN_BLOCK_WRITE) {
   3.262 +    if (blk_ring->req_ring[index].operation == XEN_BLOCK_WRITE) {
   3.263  	bh->b_state = ((1 << BH_JBD) | (1 << BH_Mapped) | (1 << BH_Req) |
   3.264  		       (1 << BH_Dirty) | (1 << BH_Uptodate));
   3.265  	operation = WRITE;
   3.266 @@ -348,9 +303,8 @@ int dispatch_rw_block_io (int index)
   3.267  	operation = READ;
   3.268      }
   3.269  
   3.270 -    /* save meta data about request XXX SMH: should copy_from_user() */
   3.271 -    memcpy(&blk_request->request,
   3.272 -	   &blk_ring->btx_ring[index], sizeof(blk_ring_entry_t));
   3.273 +    /* save meta data about request */
   3.274 +    blk_request->request = &blk_ring->req_ring[index];
   3.275      blk_request->bh     = bh;
   3.276      blk_request->domain = current; 
   3.277      
   3.278 @@ -400,9 +354,8 @@ void dump_queue_head(struct list_head *q
   3.279  
   3.280  static void dump_blockq(u_char key, void *dev_id, struct pt_regs *regs) 
   3.281  {
   3.282 -    printk("Dumping block queue stats:\n"); 
   3.283 -    printk("nr_pending = %d, nr_done = %d\n",
   3.284 -           atomic_read(&nr_pending), atomic_read(&nr_done));
   3.285 +    printk("Dumping block queue stats: nr_pending = %d\n",
   3.286 +           atomic_read(&nr_pending));
   3.287  }
   3.288  
   3.289  
   3.290 @@ -422,6 +375,8 @@ void initialize_block_io ()
   3.291      
   3.292      /* If bit i is true then domain i has work for us to do. */
   3.293      pending_work = 0;
   3.294 +
   3.295 +    atomic_set(&nr_pending, 0);
   3.296  }
   3.297  
   3.298  
     4.1 --- a/xen-2.4.16/include/hypervisor-ifs/block.h	Wed Feb 19 14:06:47 2003 +0000
     4.2 +++ b/xen-2.4.16/include/hypervisor-ifs/block.h	Wed Feb 19 17:26:26 2003 +0000
     4.3 @@ -26,38 +26,41 @@
     4.4  
     4.5  #define XEN_BLOCK_MAX_DOMAINS 32  /* NOTE: FIX THIS. VALUE SHOULD COME FROM? */
     4.6  
     4.7 -#define BLK_TX_RING_SIZE 256
     4.8 -#define BLK_RX_RING_SIZE 256
     4.9 +#define BLK_REQ_RING_SIZE  64
    4.10 +#define BLK_RESP_RING_SIZE 64
    4.11  
    4.12 -#define BLK_TX_RING_MAX_ENTRIES (BLK_TX_RING_SIZE - 2)
    4.13 -#define BLK_RX_RING_MAX_ENTRIES (BLK_RX_RING_SIZE - 2)
    4.14 +#define BLK_REQ_RING_MAX_ENTRIES  (BLK_REQ_RING_SIZE - 2)
    4.15 +#define BLK_RESP_RING_MAX_ENTRIES (BLK_RESP_RING_SIZE - 2)
    4.16  
    4.17 -#define BLK_TX_RING_INC(_i)    (((_i)+1) & (BLK_TX_RING_SIZE-1))
    4.18 -#define BLK_RX_RING_INC(_i)    (((_i)+1) & (BLK_RX_RING_SIZE-1))
    4.19 -#define BLK_TX_RING_ADD(_i,_j) (((_i)+(_j)) & (BLK_TX_RING_SIZE-1))
    4.20 -#define BLK_RX_RING_ADD(_i,_j) (((_i)+(_j)) & (BLK_RX_RING_SIZE-1))
    4.21 +#define BLK_REQ_RING_INC(_i)     (((_i)+1) & (BLK_REQ_RING_SIZE-1))
    4.22 +#define BLK_RESP_RING_INC(_i)    (((_i)+1) & (BLK_RESP_RING_SIZE-1))
    4.23 +#define BLK_REQ_RING_ADD(_i,_j)  (((_i)+(_j)) & (BLK_REQ_RING_SIZE-1))
    4.24 +#define BLK_RESP_RING_ADD(_i,_j) (((_i)+(_j)) & (BLK_RESP_RING_SIZE-1))
    4.25  
    4.26 -typedef struct blk_ring_entry 
    4.27 +typedef struct blk_ring_req_entry 
    4.28  {
    4.29 -  void *          id;                   /* for guest os use; used for the bh */
    4.30 -  int             priority;         /* orig sched pri, SYNC or ASYNC for now */
    4.31 -  int             operation;            /* XEN_BLOCK_READ or XEN_BLOCK_WRITE */
    4.32 -  char *          buffer;
    4.33 -  unsigned long   block_number;                              /* block number */
    4.34 -  unsigned short  block_size;                                  /* block size */
    4.35 -  kdev_t          device;
    4.36 -  unsigned long   sector_number;             /* real buffer location on disk */
    4.37 -} blk_ring_entry_t;
    4.38 +    void *          id;                /* for guest os use */
    4.39 +    int             priority;          /* SYNC or ASYNC for now */
    4.40 +    int             operation;         /* XEN_BLOCK_READ or XEN_BLOCK_WRITE */
    4.41 +    char *          buffer;
    4.42 +    unsigned long   block_number;      /* block number */
    4.43 +    unsigned short  block_size;        /* block size */
    4.44 +    kdev_t          device;
    4.45 +    unsigned long   sector_number;     /* real buffer location on disk */
    4.46 +} blk_ring_req_entry_t;
    4.47 +
    4.48 +typedef struct blk_ring_resp_entry
    4.49 +{
    4.50 +    void *id;
    4.51 +    unsigned long status;
    4.52 +} blk_ring_resp_entry_t;
    4.53  
    4.54  typedef struct blk_ring_st 
    4.55  {
    4.56 -  blk_ring_entry_t *btx_ring;
    4.57 -  unsigned int      btx_prod, btx_cons;
    4.58 -  unsigned int 	    btx_ring_size;
    4.59 -
    4.60 -  blk_ring_entry_t *brx_ring;
    4.61 -  unsigned int      brx_prod, brx_cons;
    4.62 -  unsigned int	    brx_ring_size;
    4.63 +  unsigned int      req_prod, req_cons;
    4.64 +  unsigned int      resp_prod, resp_cons;
    4.65 +  blk_ring_req_entry_t  req_ring[BLK_REQ_RING_SIZE];
    4.66 +  blk_ring_resp_entry_t resp_ring[BLK_RESP_RING_SIZE];
    4.67  } blk_ring_t;
    4.68  
    4.69  #define MAX_XEN_DISK_COUNT 100
     5.1 --- a/xen-2.4.16/include/hypervisor-ifs/hypervisor-if.h	Wed Feb 19 14:06:47 2003 +0000
     5.2 +++ b/xen-2.4.16/include/hypervisor-ifs/hypervisor-if.h	Wed Feb 19 17:26:26 2003 +0000
     5.3 @@ -103,22 +103,20 @@ typedef struct
     5.4   */
     5.5  
     5.6  /* Events that a guest OS may receive from the hypervisor. */
     5.7 -#define EVENT_BLK_TX   0x01 /* packets for transmission. */
     5.8 -#define EVENT_BLK_RX   0x02 /* empty buffers for receive. */
     5.9 -#define EVENT_TIMER    0x04 /* a timeout has been updated. */
    5.10 -#define EVENT_DIE      0x08 /* OS is about to be killed. Clean up please! */
    5.11 -#define EVENT_DEBUG    0x10 /* request guest to dump debug info (gross!) */
    5.12 -#define EVENT_NET_TX   0x20 /* packets for transmission. */
    5.13 -#define EVENT_NET_RX   0x40 /* empty buffers for receive. */
    5.14 +#define EVENT_BLK_RESP 0x01 /* A block device response has been queued. */
    5.15 +#define EVENT_TIMER    0x02 /* A timeout has been updated. */
    5.16 +#define EVENT_DIE      0x04 /* OS is about to be killed. Clean up please! */
    5.17 +#define EVENT_DEBUG    0x08 /* Request guest to dump debug info (gross!) */
    5.18 +#define EVENT_NET_TX   0x10 /* There are packets for transmission. */
    5.19 +#define EVENT_NET_RX   0x20 /* There are empty buffers for receive. */
    5.20  
    5.21  /* Bit offsets, as opposed to the above masks. */
    5.22 -#define _EVENT_BLK_TX  0
    5.23 -#define _EVENT_BLK_RX  1
    5.24 -#define _EVENT_TIMER   2
    5.25 -#define _EVENT_DIE     3
    5.26 -#define _EVENT_NET_TX  4
    5.27 -#define _EVENT_NET_RX  5
    5.28 -#define _EVENT_DEBUG   6
    5.29 +#define _EVENT_BLK_RESP 0
    5.30 +#define _EVENT_TIMER    1
    5.31 +#define _EVENT_DIE      2
    5.32 +#define _EVENT_NET_TX   3
    5.33 +#define _EVENT_NET_RX   4
    5.34 +#define _EVENT_DEBUG    5
    5.35  
    5.36  
    5.37  /*
    5.38 @@ -195,13 +193,13 @@ typedef struct shared_info_st {
    5.39   */
    5.40  typedef struct start_info_st {
    5.41      unsigned long nr_pages;       /* total pages allocated to this domain */
    5.42 -    shared_info_t *shared_info;   /* start address of shared info struct */
    5.43 +    shared_info_t *shared_info;   /* VIRTUAL address of shared info struct */
    5.44      unsigned long  pt_base;       /* VIRTUAL address of page directory */
    5.45 -    unsigned long mod_start;      /* start address of pre-loaded module */
    5.46 +    unsigned long mod_start;      /* VIRTUAL address of pre-loaded module */
    5.47      unsigned long mod_len;        /* size (bytes) of pre-loaded module */
    5.48 -    net_ring_t *net_rings;
    5.49 +    net_ring_t *net_rings;        /* network rings (VIRTUAL ADDRESS) */
    5.50      int num_net_rings;
    5.51 -    blk_ring_t *blk_ring;         /* block io communication rings */
    5.52 +    unsigned long blk_ring;       /* block io ring (MACHINE ADDRESS) */
    5.53      unsigned char cmd_line[1];    /* variable-length */
    5.54  } start_info_t;
    5.55  
     6.1 --- a/xen-2.4.16/include/hypervisor-ifs/network.h	Wed Feb 19 14:06:47 2003 +0000
     6.2 +++ b/xen-2.4.16/include/hypervisor-ifs/network.h	Wed Feb 19 17:26:26 2003 +0000
     6.3 @@ -39,7 +39,7 @@ typedef struct net_ring_st {
     6.4       */
     6.5      tx_entry_t	*tx_ring;
     6.6      unsigned int tx_prod, tx_cons, tx_event;
     6.7 -    unsigned int tx_ring_size;
     6.8 +
     6.9      /*
    6.10       * Guest OS places empty buffers into ring at rx_prod.
    6.11       * Hypervisor fills buffers as rx_cons.
    6.12 @@ -50,11 +50,10 @@ typedef struct net_ring_st {
    6.13       */
    6.14      rx_entry_t	*rx_ring;
    6.15      unsigned int rx_prod, rx_cons, rx_event;
    6.16 -    unsigned int rx_ring_size;
    6.17  } net_ring_t;
    6.18  
    6.19  /* Specify base of per-domain array. Get returned free slot in the array. */
    6.20 -//net_ring_t *create_net_vif(int domain);
    6.21 +/*net_ring_t *create_net_vif(int domain);*/
    6.22  
    6.23  /* Packet routing/filtering code follows:
    6.24   */
     7.1 --- a/xen-2.4.16/include/xeno/sched.h	Wed Feb 19 14:06:47 2003 +0000
     7.2 +++ b/xen-2.4.16/include/xeno/sched.h	Wed Feb 19 17:26:26 2003 +0000
     7.3 @@ -48,7 +48,6 @@ extern struct mm_struct init_mm;
     7.4  #define _HYP_EVENT_NEED_RESCHED 0
     7.5  #define _HYP_EVENT_NET_RX       1
     7.6  #define _HYP_EVENT_DIE          2
     7.7 -#define _HYP_EVENT_BLK_RX       3
     7.8  
     7.9  #define PF_DONEFPUINIT  0x1  /* Has the FPU been initialised for this task? */
    7.10  #define PF_USEDFPU      0x2  /* Has this task used the FPU since last save? */
    7.11 @@ -77,8 +76,7 @@ struct task_struct {
    7.12  
    7.13      /* Block I/O */
    7.14      blk_ring_t *blk_ring_base;
    7.15 -    struct list_head io_done_queue;
    7.16 -    spinlock_t io_done_queue_lock;
    7.17 +    spinlock_t blk_ring_lock;
    7.18  
    7.19      int has_cpu, policy, counter;
    7.20  
     8.1 --- a/xenolinux-2.4.16-sparse/arch/xeno/drivers/block/xl_block.c	Wed Feb 19 14:06:47 2003 +0000
     8.2 +++ b/xenolinux-2.4.16-sparse/arch/xeno/drivers/block/xl_block.c	Wed Feb 19 17:26:26 2003 +0000
     8.3 @@ -40,8 +40,7 @@ static int xlblk_read_ahead;
     8.4  static int xlblk_hardsect_size[XLBLK_MAX];
     8.5  static int xlblk_max_sectors[XLBLK_MAX];
     8.6  
     8.7 -#define XLBLK_RX_IRQ _EVENT_BLK_RX
     8.8 -#define XLBLK_TX_IRQ _EVENT_BLK_TX
     8.9 +#define XLBLK_RESPONSE_IRQ _EVENT_BLK_RESP
    8.10  
    8.11  #define DEBUG_IRQ    _EVENT_DEBUG 
    8.12  
    8.13 @@ -56,6 +55,8 @@ xlblk_device_t xlblk_device;
    8.14  #define XLBLK_DEBUG       0
    8.15  #define XLBLK_DEBUG_IOCTL 0
    8.16  
    8.17 +static blk_ring_t *blk_ring;
    8.18 +
    8.19  /* 
    8.20   * disk management
    8.21   */
    8.22 @@ -203,7 +204,6 @@ void hypervisor_request(void *         i
    8.23  			kdev_t         device,
    8.24  			int            mode)
    8.25  {
    8.26 -    blk_ring_t *blk_ring = start_info.blk_ring;
    8.27      int position;
    8.28      void *buffer_pa, *buffer_ma; 
    8.29      kdev_t phys_device = (kdev_t) 0;
    8.30 @@ -246,24 +246,24 @@ void hypervisor_request(void *         i
    8.31      }
    8.32  
    8.33  
    8.34 -    if (BLK_TX_RING_INC(blk_ring->btx_prod) == blk_ring->btx_cons) {
    8.35 -	printk (KERN_ALERT "hypervisor_request: btx_cons: %d, btx_prod:%d",
    8.36 -		blk_ring->btx_cons, blk_ring->btx_prod);
    8.37 +    if (BLK_REQ_RING_INC(blk_ring->req_prod) == blk_ring->req_cons) {
    8.38 +	printk (KERN_ALERT "hypervisor_request: req_cons: %d, req_prod:%d",
    8.39 +		blk_ring->req_cons, blk_ring->req_prod);
    8.40  	BUG(); 
    8.41      }
    8.42      
    8.43      /* Fill out a communications ring structure & trap to the hypervisor */
    8.44 -    position = blk_ring->btx_prod;
    8.45 -    blk_ring->btx_ring[position].id            = id;
    8.46 -    blk_ring->btx_ring[position].priority      = mode;
    8.47 -    blk_ring->btx_ring[position].operation     = operation;
    8.48 -    blk_ring->btx_ring[position].buffer        = buffer_ma;
    8.49 -    blk_ring->btx_ring[position].block_number  = block_number;
    8.50 -    blk_ring->btx_ring[position].block_size    = block_size;
    8.51 -    blk_ring->btx_ring[position].device        = phys_device;
    8.52 -    blk_ring->btx_ring[position].sector_number = sector_number;
    8.53 +    position = blk_ring->req_prod;
    8.54 +    blk_ring->req_ring[position].id            = id;
    8.55 +    blk_ring->req_ring[position].priority      = mode;
    8.56 +    blk_ring->req_ring[position].operation     = operation;
    8.57 +    blk_ring->req_ring[position].buffer        = buffer_ma;
    8.58 +    blk_ring->req_ring[position].block_number  = block_number;
    8.59 +    blk_ring->req_ring[position].block_size    = block_size;
    8.60 +    blk_ring->req_ring[position].device        = phys_device;
    8.61 +    blk_ring->req_ring[position].sector_number = sector_number;
    8.62  
    8.63 -    blk_ring->btx_prod = BLK_TX_RING_INC(blk_ring->btx_prod);
    8.64 +    blk_ring->req_prod = BLK_REQ_RING_INC(blk_ring->req_prod);
    8.65  
    8.66      switch(mode) { 
    8.67  
    8.68 @@ -325,20 +325,16 @@ static void do_xlblk_request (request_qu
    8.69  	/* is there space in the tx ring for this request?
    8.70  	 * if the ring is full, then leave the request in the queue
    8.71  	 *
    8.72 -	 * THIS IS A BIT BOGUS SINCE XEN COULD BE UPDATING BTX_CONS
    8.73 +	 * THIS IS A BIT BOGUS SINCE XEN COULD BE UPDATING REQ_CONS
    8.74  	 * AT THE SAME TIME
    8.75  	 */
    8.76 -	{
    8.77 -	    blk_ring_t *blk_ring = start_info.blk_ring;
    8.78 -	    
    8.79 -	    if (BLK_RX_RING_INC(blk_ring->btx_prod) == blk_ring->btx_cons)
    8.80 -	    {
    8.81 -		printk (KERN_ALERT "OOPS, TX LOOKS FULL  cons: %d  prod: %d\n",
    8.82 -			blk_ring->btx_cons, blk_ring->btx_prod);
    8.83 -		BUG(); 
    8.84 -		break;
    8.85 -	    }
    8.86 -	}
    8.87 +        if (BLK_RESP_RING_INC(blk_ring->req_prod) == blk_ring->req_cons)
    8.88 +        {
    8.89 +            printk (KERN_ALERT "OOPS, TX LOOKS FULL  cons: %d  prod: %d\n",
    8.90 +                    blk_ring->req_cons, blk_ring->req_prod);
    8.91 +            BUG(); 
    8.92 +            break;
    8.93 +        }
    8.94  	
    8.95  	req->errors = 0;
    8.96  	blkdev_dequeue_request(req);
    8.97 @@ -382,24 +378,22 @@ static struct block_device_operations xe
    8.98      revalidate:         xenolinux_block_revalidate,
    8.99  };
   8.100  
   8.101 -static void xlblk_rx_int(int irq, void *dev_id, struct pt_regs *ptregs)
   8.102 +static void xlblk_response_int(int irq, void *dev_id, struct pt_regs *ptregs)
   8.103  {
   8.104 -    blk_ring_t *blk_ring = start_info.blk_ring;
   8.105      struct request *req;
   8.106      int loop;
   8.107      u_long flags; 
   8.108      
   8.109 -    for (loop = blk_ring->brx_cons;
   8.110 -	 loop != blk_ring->brx_prod;
   8.111 -	 loop = BLK_RX_RING_INC(loop)) {
   8.112 +    for (loop = blk_ring->resp_cons;
   8.113 +	 loop != blk_ring->resp_prod;
   8.114 +	 loop = BLK_RESP_RING_INC(loop)) {
   8.115  
   8.116 -	blk_ring_entry_t *bret = &blk_ring->brx_ring[loop];
   8.117 +	blk_ring_resp_entry_t *bret = &blk_ring->resp_ring[loop];
   8.118  	
   8.119 -	if(bret->operation == XEN_BLOCK_PROBE)
   8.120 -	    continue; 
   8.121 +	req = (struct request *)bret->id;
   8.122 +        if ( req == NULL ) continue; /* probes have NULL id */
   8.123  
   8.124  	spin_lock_irqsave(&io_request_lock, flags);
   8.125 -	req = (struct request *)bret->id;
   8.126  	    
   8.127  	if (!end_that_request_first(req, 1, "XenBlk"))
   8.128  	    end_that_request_last(req);
   8.129 @@ -407,54 +401,27 @@ static void xlblk_rx_int(int irq, void *
   8.130  	
   8.131      }
   8.132      
   8.133 -    blk_ring->brx_cons = loop;
   8.134 +    blk_ring->resp_cons = loop;
   8.135  }
   8.136  
   8.137 -static void xlblk_tx_int(int irq, void *dev_id, struct pt_regs *ptregs)
   8.138 -{
   8.139 -    if (XLBLK_DEBUG) 
   8.140 -	printk (KERN_ALERT "--- xlblock::xlblk_tx_int\n"); 
   8.141 -}
   8.142  
   8.143  int __init xlblk_init(void)
   8.144  {
   8.145 -    blk_ring_t *blk_ring = start_info.blk_ring;
   8.146      int loop, error, result;
   8.147  
   8.148 -    /* initialize memory rings to communicate with hypervisor */
   8.149 -    if ( blk_ring == NULL ) return -ENOMEM;
   8.150 +    /* This mapping was created early at boot time. */
   8.151 +    blk_ring = (blk_ring_t *)FIX_BLKRING_BASE;
   8.152  
   8.153 -    blk_ring->btx_prod = blk_ring->btx_cons = 0;
   8.154 -    blk_ring->brx_prod = blk_ring->brx_cons = 0;
   8.155 -    blk_ring->btx_ring = NULL;
   8.156 -    blk_ring->brx_ring = NULL;
   8.157 +    blk_ring->req_prod = blk_ring->req_cons = 0;
   8.158 +    blk_ring->resp_prod = blk_ring->resp_cons = 0;
   8.159      
   8.160 -    blk_ring->btx_ring = kmalloc(BLK_TX_RING_SIZE * sizeof(blk_ring_entry_t),
   8.161 -				 GFP_KERNEL);
   8.162 -    blk_ring->brx_ring = kmalloc(BLK_RX_RING_SIZE * sizeof(blk_ring_entry_t),
   8.163 -				 GFP_KERNEL);
   8.164 -
   8.165 -    if ((blk_ring->btx_ring == NULL) || (blk_ring->brx_ring == NULL)) {
   8.166 -	printk (KERN_ALERT "could not alloc ring memory for block device\n");
   8.167 -	error = -ENOBUFS;
   8.168 -	goto fail;
   8.169 -    }
   8.170 -    
   8.171 -    error = request_irq(XLBLK_RX_IRQ, xlblk_rx_int, 0, 
   8.172 -			"xlblk-rx", &xlblk_device);
   8.173 +    error = request_irq(XLBLK_RESPONSE_IRQ, xlblk_response_int, 0, 
   8.174 +			"xlblk-response", &xlblk_device);
   8.175      if (error) {
   8.176  	printk(KERN_ALERT "Could not allocate receive interrupt\n");
   8.177  	goto fail;
   8.178      }
   8.179  
   8.180 -    error = request_irq(XLBLK_TX_IRQ, xlblk_tx_int, 0, 
   8.181 -			"xlblk-tx", &xlblk_device);
   8.182 -    if (error) {
   8.183 -	printk(KERN_ALERT "Could not allocate transmit interrupt\n");
   8.184 -	free_irq(XLBLK_RX_IRQ, &xlblk_device);
   8.185 -	goto fail;
   8.186 -    }
   8.187 -
   8.188      memset (&xen_disk_info, 0, sizeof(xen_disk_info));
   8.189      xen_disk_info.count = 0;
   8.190  
   8.191 @@ -505,8 +472,6 @@ int __init xlblk_init(void)
   8.192      return 0;
   8.193  
   8.194   fail:
   8.195 -    if (blk_ring->btx_ring) kfree(blk_ring->btx_ring);
   8.196 -    if (blk_ring->brx_ring) kfree(blk_ring->brx_ring);
   8.197      return error;
   8.198  }
   8.199  
     9.1 --- a/xenolinux-2.4.16-sparse/arch/xeno/drivers/block/xl_block_test.c	Wed Feb 19 14:06:47 2003 +0000
     9.2 +++ b/xenolinux-2.4.16-sparse/arch/xeno/drivers/block/xl_block_test.c	Wed Feb 19 17:26:26 2003 +0000
     9.3 @@ -22,7 +22,7 @@
     9.4  /******************************************************************/
     9.5  
     9.6  static struct proc_dir_entry *bdt;
     9.7 -static blk_ring_entry_t meta;
     9.8 +static blk_ring_req_entry_t meta;
     9.9  static char * data;
    9.10  
    9.11  static int proc_read_bdt(char *page, char **start, off_t off,
    10.1 --- a/xenolinux-2.4.16-sparse/arch/xeno/mm/init.c	Wed Feb 19 14:06:47 2003 +0000
    10.2 +++ b/xenolinux-2.4.16-sparse/arch/xeno/mm/init.c	Wed Feb 19 17:26:26 2003 +0000
    10.3 @@ -115,7 +115,9 @@ static inline void set_pte_phys (unsigne
    10.4      if (pte_val(*pte))
    10.5          pte_ERROR(*pte);
    10.6      pgprot_val(prot) = pgprot_val(PAGE_KERNEL) | pgprot_val(flags);
    10.7 -    set_pte(pte, mk_pte_phys(phys, prot));
    10.8 +
    10.9 +    /* We queue directly, avoiding hidden phys->machine translation. */
   10.10 +    queue_l1_entry_update(__pa(pte), phys | pgprot_val(prot));
   10.11  
   10.12      /*
   10.13       * It's enough to flush this one mapping.
   10.14 @@ -124,10 +126,54 @@ static inline void set_pte_phys (unsigne
   10.15      __flush_tlb_one(vaddr);
   10.16  }
   10.17  
   10.18 +void __set_fixmap (enum fixed_addresses idx, unsigned long phys, 
   10.19 +                   pgprot_t flags)
   10.20 +{
   10.21 +    unsigned long address = __fix_to_virt(idx);
   10.22 +
   10.23 +    if (idx >= __end_of_fixed_addresses) {
   10.24 +        printk("Invalid __set_fixmap\n");
   10.25 +        return;
   10.26 +    }
   10.27 +    set_pte_phys(address, phys, flags);
   10.28 +}
   10.29 +
   10.30 +static void __init fixrange_init (unsigned long start, 
   10.31 +                                  unsigned long end, pgd_t *pgd_base)
   10.32 +{
   10.33 +    pgd_t *pgd;
   10.34 +    pmd_t *pmd;
   10.35 +    pte_t *pte;
   10.36 +    int i, j;
   10.37 +    unsigned long vaddr;
   10.38 +
   10.39 +    vaddr = start;
   10.40 +    i = __pgd_offset(vaddr);
   10.41 +    j = __pmd_offset(vaddr);
   10.42 +    pgd = pgd_base + i;
   10.43 +
   10.44 +    for ( ; (i < PTRS_PER_PGD) && (vaddr != end); pgd++, i++) {
   10.45 +        pmd = (pmd_t *)pgd;
   10.46 +        for (; (j < PTRS_PER_PMD) && (vaddr != end); pmd++, j++) {
   10.47 +            if (pmd_none(*pmd)) {
   10.48 +                pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
   10.49 +                set_pmd(pmd, __pmd(_KERNPG_TABLE + __pa(pte)));
   10.50 +                if (pte != pte_offset(pmd, 0))
   10.51 +                    BUG();
   10.52 +            }
   10.53 +            vaddr += PMD_SIZE;
   10.54 +        }
   10.55 +        j = 0;
   10.56 +    }
   10.57 +
   10.58 +    XENO_flush_page_update_queue();
   10.59 +}
   10.60 +
   10.61  void __init paging_init(void)
   10.62  {
   10.63      unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0};
   10.64      unsigned int max_dma, high, low;
   10.65 +    unsigned long vaddr;
   10.66      
   10.67      max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
   10.68      low = max_low_pfn;
   10.69 @@ -143,6 +189,19 @@ void __init paging_init(void)
   10.70          zones_size[ZONE_NORMAL] = low - max_dma;
   10.71      }
   10.72      free_area_init(zones_size);
   10.73 +
   10.74 +    /*
   10.75 +     * Fixed mappings, only the page table structure has to be created - 
   10.76 +     * mappings will be set by set_fixmap():
   10.77 +     */
   10.78 +    vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
   10.79 +    fixrange_init(vaddr, 0, init_mm.pgd);
   10.80 +
   10.81 +    /*
   10.82 +     * XXX We do this conversion early, so that all other page tables
   10.83 +     * will automatically get this mapping.
   10.84 +     */
   10.85 +    set_fixmap(FIX_BLKRING_BASE, start_info.blk_ring);
   10.86  }
   10.87  
   10.88  
    11.1 --- a/xenolinux-2.4.16-sparse/include/asm-xeno/pgtable.h	Wed Feb 19 14:06:47 2003 +0000
    11.2 +++ b/xenolinux-2.4.16-sparse/include/asm-xeno/pgtable.h	Wed Feb 19 17:26:26 2003 +0000
    11.3 @@ -18,6 +18,7 @@
    11.4  #include <asm/processor.h>
    11.5  #include <asm/hypervisor.h>
    11.6  #include <linux/threads.h>
    11.7 +#include <asm/fixmap.h>
    11.8  
    11.9  #ifndef _I386_BITOPS_H
   11.10  #include <asm/bitops.h>
   11.11 @@ -99,7 +100,7 @@ extern void pgtable_cache_init(void);
   11.12  #define VMALLOC_START	(((unsigned long) high_memory + 2*VMALLOC_OFFSET-1) & \
   11.13  						~(VMALLOC_OFFSET-1))
   11.14  #define VMALLOC_VMADDR(x) ((unsigned long)(x))
   11.15 -#define VMALLOC_END	(HYPERVISOR_VIRT_START-PAGE_SIZE)
   11.16 +#define VMALLOC_END	(FIXADDR_START - 2*PAGE_SIZE)
   11.17  
   11.18  #define _PAGE_BIT_PRESENT	0
   11.19  #define _PAGE_BIT_RW		1