direct-io.hg

changeset 8120:ff95b53bd39a

Public interface cleanups. Widen some fields in public
interface defintions for future extensibility. In particular,
grant references are now 32 bits and this has some knock-on
effects on split-driver interfaces.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Nov 30 16:03:05 2005 +0100 (2005-11-30)
parents 37c09b20a896
children 58d46463413e
files linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c tools/blktap/blkdump.c tools/blktap/blktaplib.c tools/blktap/blktaplib.h tools/blktap/parallax/parallax.c tools/blktap/ublkback/ublkbacklib.c xen/arch/x86/dom0_ops.c xen/include/public/acm_ops.h xen/include/public/dom0_ops.h xen/include/public/grant_table.h xen/include/public/io/blkif.h xen/include/public/io/tpmif.h xen/include/public/sched_ctl.h xen/include/public/xen.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c	Wed Nov 30 12:51:24 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c	Wed Nov 30 16:03:05 2005 +0100
     1.3 @@ -335,7 +335,6 @@ static void dispatch_rw_block_io(blkif_t
     1.4  {
     1.5  	extern void ll_rw_block(int rw, int nr, struct buffer_head * bhs[]); 
     1.6  	int operation = (req->operation == BLKIF_OP_WRITE) ? WRITE : READ;
     1.7 -	unsigned long fas = 0;
     1.8  	int i, pending_idx = pending_ring[MASK_PEND_IDX(pending_cons)];
     1.9  	pending_req_t *pending_req;
    1.10  	struct gnttab_map_grant_ref map[BLKIF_MAX_SEGMENTS_PER_REQUEST];
    1.11 @@ -362,16 +361,17 @@ static void dispatch_rw_block_io(blkif_t
    1.12  	preq.nr_sects      = 0;
    1.13  
    1.14  	for (i = 0; i < nseg; i++) {
    1.15 -		fas         = req->frame_and_sects[i];
    1.16 -		seg[i].nsec = blkif_last_sect(fas) - blkif_first_sect(fas) + 1;
    1.17 +		seg[i].nsec = req->seg[i].last_sect -
    1.18 +			req->seg[i].first_sect + 1;
    1.19  
    1.20 -		if (seg[i].nsec <= 0)
    1.21 +		if ((req->seg[i].last_sect >= (PAGE_SIZE >> 9)) ||
    1.22 +		    (seg[i].nsec <= 0))
    1.23  			goto bad_descriptor;
    1.24  		preq.nr_sects += seg[i].nsec;
    1.25  
    1.26  		map[i].host_addr = MMAP_VADDR(pending_idx, i);
    1.27  		map[i].dom = blkif->domid;
    1.28 -		map[i].ref = blkif_gref_from_fas(fas);
    1.29 +		map[i].ref = req->seg[i].gref;
    1.30  		map[i].flags = GNTMAP_host_map;
    1.31  		if ( operation == WRITE )
    1.32  			map[i].flags |= GNTMAP_readonly;
    1.33 @@ -390,9 +390,8 @@ static void dispatch_rw_block_io(blkif_t
    1.34  				pending_idx, i)) >> PAGE_SHIFT,
    1.35  				FOREIGN_FRAME(map[i].dev_bus_addr>>PAGE_SHIFT));
    1.36  #endif
    1.37 -			fas        = req->frame_and_sects[i];
    1.38 -			seg[i].buf = map[i].dev_bus_addr | 
    1.39 -				(blkif_first_sect(fas) << 9);
    1.40 +			seg[i].buf = map[i].dev_bus_addr |
    1.41 +				(req->seg[i].first_sect << 9);
    1.42  		} else {
    1.43  			errors++;
    1.44  		}
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Wed Nov 30 12:51:24 2005 +0100
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Wed Nov 30 16:03:05 2005 +0100
     2.3 @@ -32,7 +32,6 @@
     2.4   * IN THE SOFTWARE.
     2.5   */
     2.6  
     2.7 -
     2.8  #if 1
     2.9  #define ASSERT(p)							   \
    2.10  	if (!(p)) { printk("Assertion '%s' failed, line %d, file %s", #p , \
    2.11 @@ -41,7 +40,6 @@
    2.12  #define ASSERT(_p)
    2.13  #endif
    2.14  
    2.15 -
    2.16  #include <linux/version.h>
    2.17  #include "block.h"
    2.18  #include <linux/cdrom.h>
    2.19 @@ -54,16 +52,14 @@
    2.20  #include <asm-xen/gnttab.h>
    2.21  #include <asm/hypervisor.h>
    2.22  
    2.23 -
    2.24  #define BLKIF_STATE_DISCONNECTED 0
    2.25  #define BLKIF_STATE_CONNECTED    1
    2.26  #define BLKIF_STATE_SUSPENDED    2
    2.27  
    2.28  #define MAXIMUM_OUTSTANDING_BLOCK_REQS \
    2.29 -    (BLKIF_MAX_SEGMENTS_PER_REQUEST * BLKIF_RING_SIZE)
    2.30 +    (BLKIF_MAX_SEGMENTS_PER_REQUEST * BLK_RING_SIZE)
    2.31  #define GRANT_INVALID_REF	0
    2.32  
    2.33 -
    2.34  static void connect(struct blkfront_info *);
    2.35  static void blkfront_closing(struct xenbus_device *);
    2.36  static int blkfront_remove(struct xenbus_device *);
    2.37 @@ -551,8 +547,11 @@ static int blkif_queue_request(struct re
    2.38  			info->shadow[id].frame[ring_req->nr_segments] =
    2.39  				mfn_to_pfn(buffer_mfn);
    2.40  
    2.41 -			ring_req->frame_and_sects[ring_req->nr_segments] =
    2.42 -				blkif_fas_from_gref(ref, fsect, lsect);
    2.43 +			ring_req->seg[ring_req->nr_segments] =
    2.44 +				(struct blkif_request_segment) {
    2.45 +					.gref       = ref,
    2.46 +					.first_sect = fsect, 
    2.47 +					.last_sect  = lsect };
    2.48  
    2.49  			ring_req->nr_segments++;
    2.50  		}
    2.51 @@ -699,8 +698,7 @@ static void blkif_completion(struct blk_
    2.52  {
    2.53  	int i;
    2.54  	for (i = 0; i < s->req.nr_segments; i++)
    2.55 -		gnttab_end_foreign_access(
    2.56 -			blkif_gref_from_fas(s->req.frame_and_sects[i]), 0, 0UL);
    2.57 +		gnttab_end_foreign_access(s->req.seg[i].gref, 0, 0UL);
    2.58  }
    2.59  
    2.60  static void blkif_recover(struct blkfront_info *info)
    2.61 @@ -740,7 +738,7 @@ static void blkif_recover(struct blkfron
    2.62  		/* Rewrite any grant references invalidated by susp/resume. */
    2.63  		for (j = 0; j < req->nr_segments; j++)
    2.64  			gnttab_grant_foreign_access_ref(
    2.65 -				blkif_gref_from_fas(req->frame_and_sects[j]),
    2.66 +				req->seg[j].gref,
    2.67  				info->xbdev->otherend_id,
    2.68  				pfn_to_mfn(info->shadow[req->id].frame[j]),
    2.69  				rq_data_dir(
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c	Wed Nov 30 12:51:24 2005 +0100
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c	Wed Nov 30 16:03:05 2005 +0100
     3.3 @@ -33,6 +33,9 @@
     3.4  #include <linux/blkdev.h>
     3.5  #include <linux/list.h>
     3.6  
     3.7 +#define BLKIF_MAJOR(dev) ((dev)>>8)
     3.8 +#define BLKIF_MINOR(dev) ((dev) & 0xff)
     3.9 +
    3.10  /*
    3.11   * For convenience we distinguish between ide, scsi and 'other' (i.e.,
    3.12   * potentially combinations of the two) in the naming scheme and in a few other
     4.1 --- a/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c	Wed Nov 30 12:51:24 2005 +0100
     4.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c	Wed Nov 30 16:03:05 2005 +0100
     4.3 @@ -713,7 +713,7 @@ static void dispatch_rw_block_io(blkif_t
     4.4  		/* Map the remote page to kernel. */
     4.5  		map[op].host_addr = kvaddr;
     4.6  		map[op].dom   = blkif->domid;
     4.7 -		map[op].ref   = blkif_gref_from_fas(req->frame_and_sects[i]);
     4.8 +		map[op].ref   = req->seg[i].gref;
     4.9  		map[op].flags = GNTMAP_host_map;
    4.10  		/* This needs a bit more thought in terms of interposition: 
    4.11  		 * If we want to be able to modify pages during write using 
    4.12 @@ -733,7 +733,7 @@ static void dispatch_rw_block_io(blkif_t
    4.13  
    4.14  		map[op].host_addr = ptep;
    4.15  		map[op].dom       = blkif->domid;
    4.16 -		map[op].ref       = blkif_gref_from_fas(req->frame_and_sects[i]);
    4.17 +		map[op].ref       = req->seg[i].gref;
    4.18  		map[op].flags     = GNTMAP_host_map | GNTMAP_application_map
    4.19  			| GNTMAP_contains_pte;
    4.20  		/* Above interposition comment applies here as well. */
     5.1 --- a/tools/blktap/blkdump.c	Wed Nov 30 12:51:24 2005 +0100
     5.2 +++ b/tools/blktap/blkdump.c	Wed Nov 30 16:03:05 2005 +0100
     5.3 @@ -11,7 +11,6 @@
     5.4  int request_print(blkif_request_t *req)
     5.5  {
     5.6      int i;
     5.7 -    unsigned long fas;
     5.8      
     5.9      if ( (req->operation == BLKIF_OP_READ) ||
    5.10           (req->operation == BLKIF_OP_WRITE) )
    5.11 @@ -24,12 +23,10 @@ int request_print(blkif_request_t *req)
    5.12          
    5.13          
    5.14          for (i=0; i < req->nr_segments; i++) {
    5.15 -            fas = req->frame_and_sects[i];
    5.16 -            printf("              (pf: 0x%8lx start: %lu stop: %lu)\n",
    5.17 -                    (fas & PAGE_MASK),
    5.18 -                    blkif_first_sect(fas),
    5.19 -                    blkif_last_sect(fas)
    5.20 -                    );
    5.21 +            printf("              (gref: 0x%8x start: %u stop: %u)\n",
    5.22 +                   req->seg[i].gref,
    5.23 +                   req->seg[i].first_sect,
    5.24 +                   req->seg[i].last_sect);
    5.25          }
    5.26              
    5.27      } else {
     6.1 --- a/tools/blktap/blktaplib.c	Wed Nov 30 12:51:24 2005 +0100
     6.2 +++ b/tools/blktap/blktaplib.c	Wed Nov 30 16:03:05 2005 +0100
     6.3 @@ -244,8 +244,8 @@ int blktap_listen(void)
     6.4      RING_IDX          rp, i, pfd_count; 
     6.5      
     6.6      /* pending rings */
     6.7 -    blkif_request_t req_pending[BLKIF_RING_SIZE];
     6.8 -    /* blkif_response_t rsp_pending[BLKIF_RING_SIZE] */;
     6.9 +    blkif_request_t req_pending[BLK_RING_SIZE];
    6.10 +    /* blkif_response_t rsp_pending[BLK_RING_SIZE] */;
    6.11      
    6.12      /* handler hooks: */
    6.13      request_hook_t   *req_hook;
     7.1 --- a/tools/blktap/blktaplib.h	Wed Nov 30 12:51:24 2005 +0100
     7.2 +++ b/tools/blktap/blktaplib.h	Wed Nov 30 16:03:05 2005 +0100
     7.3 @@ -18,11 +18,13 @@
     7.4  #include <xen/io/domain_controller.h>
     7.5  #include <xs.h>
     7.6  
     7.7 +#define BLK_RING_SIZE __RING_SIZE((blkif_sring_t *)0, PAGE_SIZE)
     7.8 +
     7.9  /* /dev/xen/blktap resides at device number major=10, minor=202        */ 
    7.10  #define BLKTAP_MINOR 202
    7.11  
    7.12  /* size of the extra VMA area to map in attached pages. */
    7.13 -#define BLKTAP_VMA_PAGES BLKIF_RING_SIZE
    7.14 +#define BLKTAP_VMA_PAGES BLK_RING_SIZE
    7.15  
    7.16  /* blktap IOCTLs:                                                      */
    7.17  #define BLKTAP_IOCTL_KICK_FE         1
     8.1 --- a/tools/blktap/parallax/parallax.c	Wed Nov 30 12:51:24 2005 +0100
     8.2 +++ b/tools/blktap/parallax/parallax.c	Wed Nov 30 16:03:05 2005 +0100
     8.3 @@ -280,8 +280,7 @@ int parallax_probe(blkif_request_t *req,
     8.4        goto err;
     8.5  
     8.6      /* Make sure the buffer is page-sized. */
     8.7 -    if ( (blkif_first_sect(req->frame_and_sects[0]) != 0) ||
     8.8 -       (blkif_last_sect (req->frame_and_sects[0]) != 7) )
     8.9 +    if ( (req->seg[0].first_sect != 0) || (req->seg[0].last_sect != 7) )
    8.10        goto err;
    8.11  
    8.12      /* fill the list of devices */
    8.13 @@ -350,17 +349,16 @@ static void read_cb(struct io_ret r, voi
    8.14      /* Calculate read size and offset within the read block. */
    8.15  
    8.16      offset = (param->sector << SECTOR_SHIFT) % BLOCK_SIZE;
    8.17 -    size = ( blkif_last_sect (req->frame_and_sects[segment]) -
    8.18 -             blkif_first_sect(req->frame_and_sects[segment]) + 1
    8.19 -        ) << SECTOR_SHIFT;
    8.20 -    start = blkif_first_sect(req->frame_and_sects[segment]) 
    8.21 -        << SECTOR_SHIFT;
    8.22 +    size = (req->seg[segment].last_sect - req->seg[segment].first_sect + 1) <<
    8.23 +        SECTOR_SHIFT;
    8.24 +    start = req->seg[segment].first_sect << SECTOR_SHIFT;
    8.25  
    8.26      DPRINTF("ParallaxRead: sect: %lld (%ld,%ld),  "
    8.27              "vblock %llx, "
    8.28              "size %lx\n", 
    8.29 -            param->sector, blkif_first_sect(p->req->frame_and_sects[segment]),
    8.30 -            blkif_last_sect (p->req->frame_and_sects[segment]),
    8.31 +            param->sector,
    8.32 +            p->req->seg[segment].first_sect,
    8.33 +            p->req->seg[segment].last_sect,
    8.34              param->vblock, size); 
    8.35  
    8.36      memcpy(dpage + start, spage + offset, size);
    8.37 @@ -506,16 +504,15 @@ int parallax_write(blkif_request_t *req,
    8.38          /* Calculate read size and offset within the read block. */
    8.39          
    8.40          offset = (sector << SECTOR_SHIFT) % BLOCK_SIZE;
    8.41 -        size = ( blkif_last_sect (req->frame_and_sects[i]) -
    8.42 -                 blkif_first_sect(req->frame_and_sects[i]) + 1
    8.43 -            ) << SECTOR_SHIFT;
    8.44 -        start = blkif_first_sect(req->frame_and_sects[i]) << SECTOR_SHIFT;
    8.45 +        size = (req->seg[i].last_sect - req->seg[i].first_sect + 1) <<
    8.46 +            SECTOR_SHIFT;
    8.47 +        start = req->seg[i].first_sect << SECTOR_SHIFT;
    8.48  
    8.49          DPRINTF("ParallaxWrite: sect: %lld (%ld,%ld),  "
    8.50                  "vblock %llx, gblock %llx, "
    8.51                  "size %lx\n", 
    8.52 -                sector, blkif_first_sect(req->frame_and_sects[i]),
    8.53 -                blkif_last_sect (req->frame_and_sects[i]),
    8.54 +                sector, 
    8.55 +                req->seg[i].first_sect, req->seg[i].last_sect,
    8.56                  vblock, gblock, size); 
    8.57        
    8.58          /* XXX: For now we just freak out if they try to write a   */
     9.1 --- a/tools/blktap/ublkback/ublkbacklib.c	Wed Nov 30 12:51:24 2005 +0100
     9.2 +++ b/tools/blktap/ublkback/ublkbacklib.c	Wed Nov 30 16:03:05 2005 +0100
     9.3 @@ -233,8 +233,7 @@ int ublkback_request(blkif_t *blkif, blk
     9.4      case BLKIF_OP_WRITE:
     9.5      {
     9.6          unsigned long size;
     9.7 -        
     9.8 -        
     9.9 +
    9.10          batch_count++;
    9.11  
    9.12          idx = ID_TO_IDX(req->id);
    9.13 @@ -247,18 +246,17 @@ int ublkback_request(blkif_t *blkif, blk
    9.14              
    9.15              sector = req->sector_number + (8*i);
    9.16              
    9.17 -            size = blkif_last_sect (req->frame_and_sects[i]) -
    9.18 -                   blkif_first_sect(req->frame_and_sects[i]) + 1;
    9.19 +            size = req->seg[i].last_sect - req->seg[i].first_sect + 1;
    9.20              
    9.21 -            if (blkif_first_sect(req->frame_and_sects[i]) != 0)
    9.22 -            DPRINTF("iWR: sec_nr: %10llu sec: %10llu (%1lu,%1lu) pos: %15lu\n",
    9.23 -                    req->sector_number, sector, 
    9.24 -                    blkif_first_sect(req->frame_and_sects[i]),
    9.25 -                    blkif_last_sect (req->frame_and_sects[i]),
    9.26 -                    (long)(sector << SECTOR_SHIFT));
    9.27 +            if (req->seg[i].first_sect != 0)
    9.28 +                DPRINTF("iWR: sec_nr: %10llu sec: %10llu (%1lu,%1lu) "
    9.29 +                        "pos: %15lu\n",
    9.30 +                        req->sector_number, sector, 
    9.31 +                        req->seg[i].first_sect, req->seg[i].last_sect,
    9.32 +                        (long)(sector << SECTOR_SHIFT));
    9.33                          
    9.34              spage  = (char *)MMAP_VADDR(ID_TO_IDX(req->id), i);
    9.35 -            spage += blkif_first_sect(req->frame_and_sects[i]) << SECTOR_SHIFT;
    9.36 +            spage += req->seg[i].first_sect << SECTOR_SHIFT;
    9.37              
    9.38              /*convert size and sector to byte offsets */
    9.39              size   <<= SECTOR_SHIFT;
    9.40 @@ -297,19 +295,17 @@ int ublkback_request(blkif_t *blkif, blk
    9.41              
    9.42              sector  = req->sector_number + (8*i);
    9.43              
    9.44 -            size = blkif_last_sect (req->frame_and_sects[i]) -
    9.45 -                   blkif_first_sect(req->frame_and_sects[i]) + 1;
    9.46 -            
    9.47 +            size = req->seg[i].last_sect - req->seg[i].first_sect + 1;
    9.48 +
    9.49              dpage  = (char *)MMAP_VADDR(ID_TO_IDX(req->id), i);
    9.50 -            dpage += blkif_first_sect(req->frame_and_sects[i]) << SECTOR_SHIFT;
    9.51 +            dpage += req->seg[i].first_sect << SECTOR_SHIFT;
    9.52              
    9.53 -            if (blkif_first_sect(req->frame_and_sects[i]) != 0)
    9.54 -            DPRINTF("iRD : sec_nr: %10llu sec: %10llu (%1lu,%1lu) "
    9.55 -                    "pos: %15lu dpage: %p\n", 
    9.56 -                    req->sector_number, sector, 
    9.57 -                    blkif_first_sect(req->frame_and_sects[i]),
    9.58 -                    blkif_last_sect (req->frame_and_sects[i]),
    9.59 -                    (long)(sector << SECTOR_SHIFT), dpage);
    9.60 +            if (req->seg[i].first_sect != 0)
    9.61 +                DPRINTF("iRD : sec_nr: %10llu sec: %10llu (%1lu,%1lu) "
    9.62 +                        "pos: %15lu dpage: %p\n", 
    9.63 +                        req->sector_number, sector, 
    9.64 +                        req->seg[i].first_sect, req->seg[i].last_sect,
    9.65 +                        (long)(sector << SECTOR_SHIFT), dpage);
    9.66              
    9.67              /*convert size and sector to byte offsets */
    9.68              size   <<= SECTOR_SHIFT;
    10.1 --- a/xen/arch/x86/dom0_ops.c	Wed Nov 30 12:51:24 2005 +0100
    10.2 +++ b/xen/arch/x86/dom0_ops.c	Wed Nov 30 16:03:05 2005 +0100
    10.3 @@ -144,7 +144,7 @@ long arch_do_dom0_op(dom0_op_t *op, dom0
    10.4          unsigned int p;
    10.5  
    10.6          ret = -EINVAL;
    10.7 -        if ( (fp + np) >= 65536 )
    10.8 +        if ( (fp + np) > 65536 )
    10.9              break;
   10.10  
   10.11          ret = -ESRCH;
    11.1 --- a/xen/include/public/acm_ops.h	Wed Nov 30 12:51:24 2005 +0100
    11.2 +++ b/xen/include/public/acm_ops.h	Wed Nov 30 16:03:05 2005 +0100
    11.3 @@ -63,7 +63,7 @@ struct acm_getssid {
    11.4          ssidref_t    ssidref;
    11.5      } id;
    11.6      void *ssidbuf;
    11.7 -    uint16_t ssidbuf_size;
    11.8 +    uint32_t ssidbuf_size;
    11.9  };
   11.10  
   11.11  #define ACM_GETDECISION        8
    12.1 --- a/xen/include/public/dom0_ops.h	Wed Nov 30 12:51:24 2005 +0100
    12.2 +++ b/xen/include/public/dom0_ops.h	Wed Nov 30 16:03:05 2005 +0100
    12.3 @@ -19,7 +19,7 @@
    12.4   * This makes sure that old versions of dom0 tools will stop working in a
    12.5   * well-defined way (rather than crashing the machine, for instance).
    12.6   */
    12.7 -#define DOM0_INTERFACE_VERSION   0xAAAA1012
    12.8 +#define DOM0_INTERFACE_VERSION   0xAAAA1013
    12.9  
   12.10  /************************************************************************/
   12.11  
   12.12 @@ -98,7 +98,7 @@ typedef struct {
   12.13  typedef struct {
   12.14      /* IN variables. */
   12.15      domid_t               domain;
   12.16 -    uint16_t              vcpu;
   12.17 +    uint32_t              vcpu;
   12.18      /* IN/OUT parameters */
   12.19      vcpu_guest_context_t *ctxt;
   12.20  } dom0_setdomaininfo_t;
   12.21 @@ -107,7 +107,7 @@ typedef struct {
   12.22  typedef struct {
   12.23      /* IN variables. */
   12.24      uint32_t write;
   12.25 -    uint32_t cpu_mask;
   12.26 +    cpumap_t cpu_mask;
   12.27      uint32_t msr;
   12.28      uint32_t in1;
   12.29      uint32_t in2;
   12.30 @@ -116,21 +116,6 @@ typedef struct {
   12.31      uint32_t out2;
   12.32  } dom0_msr_t;
   12.33  
   12.34 -#define DOM0_DEBUG            16
   12.35 -typedef struct {
   12.36 -    /* IN variables. */
   12.37 -    domid_t  domain;
   12.38 -    uint8_t  opcode;
   12.39 -    uint32_t in1;
   12.40 -    uint32_t in2;
   12.41 -    uint32_t in3;
   12.42 -    uint32_t in4;
   12.43 -    /* OUT variables. */
   12.44 -    uint32_t status;
   12.45 -    uint32_t out1;
   12.46 -    uint32_t out2;
   12.47 -} dom0_debug_t;
   12.48 -
   12.49  /*
   12.50   * Set clock such that it would read <secs,nsecs> after 00:00:00 UTC,
   12.51   * 1 January, 1970 if the current system time was <system_time>.
   12.52 @@ -182,8 +167,8 @@ typedef struct {
   12.53  typedef struct {
   12.54      /* IN variables. */
   12.55      domid_t   domain;
   12.56 -    uint16_t  vcpu;
   12.57 -    cpumap_t cpumap;
   12.58 +    uint32_t  vcpu;
   12.59 +    cpumap_t  cpumap;
   12.60  } dom0_pincpudomain_t;
   12.61  
   12.62  /* Get trace buffers machine base address */
   12.63 @@ -196,9 +181,9 @@ typedef struct {
   12.64  #define DOM0_TBUF_SET_SIZE     3
   12.65  #define DOM0_TBUF_ENABLE       4
   12.66  #define DOM0_TBUF_DISABLE      5
   12.67 -    uint8_t op;
   12.68 +    uint32_t      op;
   12.69      /* IN/OUT variables */
   12.70 -    unsigned long cpu_mask;
   12.71 +    cpumap_t      cpu_mask;
   12.72      uint32_t      evt_mask;
   12.73      /* OUT variables */
   12.74      unsigned long buffer_mfn;
   12.75 @@ -327,7 +312,7 @@ typedef struct {
   12.76  #define DOM0_PERFCCONTROL_OP_RESET 1   /* Reset all counters to zero. */
   12.77  #define DOM0_PERFCCONTROL_OP_QUERY 2   /* Get perfctr information. */
   12.78  typedef struct {
   12.79 -    uint8_t      name[80];             /*  name of perf counter */
   12.80 +    uint8_t      name[80];             /* name of perf counter */
   12.81      uint32_t     nr_vals;              /* number of values for this counter */
   12.82      uint32_t     vals[64];             /* array of values */
   12.83  } dom0_perfc_desc_t;
   12.84 @@ -349,16 +334,16 @@ typedef struct {
   12.85  #define DOM0_IOPORT_PERMISSION   36
   12.86  typedef struct {
   12.87      domid_t  domain;                  /* domain to be affected */
   12.88 -    uint16_t first_port;              /* first port int range */
   12.89 -    uint16_t nr_ports;                /* size of port range */
   12.90 -    uint16_t allow_access;            /* allow or deny access to range? */
   12.91 +    uint32_t first_port;              /* first port int range */
   12.92 +    uint32_t nr_ports;                /* size of port range */
   12.93 +    uint8_t  allow_access;            /* allow or deny access to range? */
   12.94  } dom0_ioport_permission_t;
   12.95  
   12.96  #define DOM0_GETVCPUCONTEXT      37
   12.97  typedef struct {
   12.98      /* IN variables. */
   12.99      domid_t  domain;                  /* domain to be affected */
  12.100 -    uint16_t vcpu;                    /* vcpu # */
  12.101 +    uint32_t vcpu;                    /* vcpu # */
  12.102      /* OUT variables. */
  12.103      vcpu_guest_context_t *ctxt;
  12.104  } dom0_getvcpucontext_t;
  12.105 @@ -367,7 +352,7 @@ typedef struct {
  12.106  typedef struct {
  12.107      /* IN variables. */
  12.108      domid_t  domain;                  /* domain to be affected */
  12.109 -    uint16_t vcpu;                    /* vcpu # */
  12.110 +    uint32_t vcpu;                    /* vcpu # */
  12.111      /* OUT variables. */
  12.112      uint8_t  online;                  /* currently online (not hotplugged)? */
  12.113      uint8_t  blocked;                 /* blocked waiting for an event? */
  12.114 @@ -381,35 +366,36 @@ typedef struct {
  12.115  typedef struct {
  12.116      /* IN variables. */
  12.117      domid_t               first_domain;
  12.118 -    unsigned int          max_domains;
  12.119 +    uint32_t              max_domains;
  12.120      dom0_getdomaininfo_t *buffer;
  12.121      /* OUT variables. */
  12.122 -    unsigned int          num_domains;
  12.123 +    uint32_t              num_domains;
  12.124  } dom0_getdomaininfolist_t;
  12.125  
  12.126  #define DOM0_PLATFORM_QUIRK      39  
  12.127  #define QUIRK_NOIRQBALANCING  1
  12.128  typedef struct {
  12.129      /* IN variables. */
  12.130 -    int quirk_id;
  12.131 +    uint32_t quirk_id;
  12.132  } dom0_platform_quirk_t;
  12.133  
  12.134  #define DOM0_PHYSICAL_MEMORY_MAP 40
  12.135  typedef struct {
  12.136      /* IN variables. */
  12.137 -    int max_map_entries;
  12.138 +    uint32_t max_map_entries;
  12.139      /* OUT variables. */
  12.140 -    int nr_map_entries;
  12.141 +    uint32_t nr_map_entries;
  12.142      struct dom0_memory_map_entry {
  12.143          uint64_t start, end;
  12.144 -        int is_ram;
  12.145 +        uint32_t flags; /* reserved */
  12.146 +        uint8_t  is_ram;
  12.147      } *memory_map;
  12.148  } dom0_physical_memory_map_t;
  12.149  
  12.150  #define DOM0_MAX_VCPUS 41
  12.151  typedef struct {
  12.152 -    domid_t domain;             /* domain to be affected */
  12.153 -    unsigned int max;           /* maximum number of vcpus */
  12.154 +    domid_t  domain;        /* domain to be affected */
  12.155 +    uint32_t max;           /* maximum number of vcpus */
  12.156  } dom0_max_vcpus_t;
  12.157  
  12.158  #define DOM0_SETDOMAINHANDLE 44
  12.159 @@ -433,7 +419,6 @@ typedef struct {
  12.160          dom0_getdomaininfo_t     getdomaininfo;
  12.161          dom0_getpageframeinfo_t  getpageframeinfo;
  12.162          dom0_msr_t               msr;
  12.163 -        dom0_debug_t             debug;
  12.164          dom0_settime_t           settime;
  12.165          dom0_readconsole_t       readconsole;
  12.166          dom0_pincpudomain_t      pincpudomain;
    13.1 --- a/xen/include/public/grant_table.h	Wed Nov 30 12:51:24 2005 +0100
    13.2 +++ b/xen/include/public/grant_table.h	Wed Nov 30 16:03:05 2005 +0100
    13.3 @@ -73,14 +73,14 @@
    13.4   */
    13.5  typedef struct grant_entry {
    13.6      /* GTF_xxx: various type and flag information.  [XEN,GST] */
    13.7 -    uint16_t     flags;
    13.8 +    uint16_t flags;
    13.9      /* The domain being granted foreign privileges. [GST] */
   13.10 -    domid_t domid;
   13.11 +    domid_t  domid;
   13.12      /*
   13.13       * GTF_permit_access: Frame that @domid is allowed to map and access. [GST]
   13.14       * GTF_accept_transfer: Frame whose ownership transferred by @domid. [XEN]
   13.15       */
   13.16 -    uint32_t     frame;
   13.17 +    uint32_t frame;
   13.18  } grant_entry_t;
   13.19  
   13.20  /*
   13.21 @@ -131,7 +131,7 @@ typedef struct grant_entry {
   13.22  /*
   13.23   * Reference to a grant entry in a specified domain's grant table.
   13.24   */
   13.25 -typedef uint16_t grant_ref_t;
   13.26 +typedef uint32_t grant_ref_t;
   13.27  
   13.28  /*
   13.29   * GNTTABOP_map_grant_ref: Map the grant entry (<dom>,<ref>) for access
   13.30 @@ -156,9 +156,9 @@ typedef struct gnttab_map_grant_ref {
   13.31      uint64_t host_addr;
   13.32      domid_t  dom;
   13.33      grant_ref_t ref;
   13.34 -    uint16_t flags;               /* GNTMAP_* */
   13.35 +    uint32_t flags;               /* GNTMAP_* */
   13.36      /* OUT parameters. */
   13.37 -    int16_t  handle;              /* +ve: handle; -ve: GNTST_* */
   13.38 +    int32_t  handle;              /* +ve: handle; -ve: GNTST_* */
   13.39      uint64_t dev_bus_addr;
   13.40  } gnttab_map_grant_ref_t;
   13.41  
   13.42 @@ -178,9 +178,9 @@ typedef struct gnttab_unmap_grant_ref {
   13.43      /* IN parameters. */
   13.44      uint64_t host_addr;
   13.45      uint64_t dev_bus_addr;
   13.46 -    uint16_t handle;
   13.47 +    uint32_t handle;
   13.48      /* OUT parameters. */
   13.49 -    int16_t  status;              /* GNTST_* */
   13.50 +    int32_t  status;              /* GNTST_* */
   13.51  } gnttab_unmap_grant_ref_t;
   13.52  
   13.53  /*
   13.54 @@ -196,9 +196,9 @@ typedef struct gnttab_unmap_grant_ref {
   13.55  typedef struct gnttab_setup_table {
   13.56      /* IN parameters. */
   13.57      domid_t  dom;
   13.58 -    uint16_t nr_frames;
   13.59 +    uint32_t nr_frames;
   13.60      /* OUT parameters. */
   13.61 -    int16_t  status;              /* GNTST_* */
   13.62 +    int32_t  status;              /* GNTST_* */
   13.63      unsigned long *frame_list;
   13.64  } gnttab_setup_table_t;
   13.65  
   13.66 @@ -211,7 +211,7 @@ typedef struct gnttab_dump_table {
   13.67      /* IN parameters. */
   13.68      domid_t dom;
   13.69      /* OUT parameters. */
   13.70 -    int16_t status;               /* GNTST_* */
   13.71 +    int32_t status;               /* GNTST_* */
   13.72  } gnttab_dump_table_t;
   13.73  
   13.74  /*
   13.75 @@ -229,7 +229,7 @@ typedef struct {
   13.76      domid_t       domid;
   13.77      grant_ref_t   ref;
   13.78      /* OUT parameters. */
   13.79 -    int16_t       status;
   13.80 +    int32_t       status;
   13.81  } gnttab_transfer_t;
   13.82  
   13.83  /*
   13.84 @@ -283,7 +283,8 @@ typedef struct {
   13.85      "invalid virtual address",                  \
   13.86      "invalid device address",                   \
   13.87      "no spare translation slot in the I/O MMU", \
   13.88 -    "permission denied"                         \
   13.89 +    "permission denied",                        \
   13.90 +    "bad page"                                  \
   13.91  }
   13.92  
   13.93  #endif /* __XEN_PUBLIC_GRANT_TABLE_H__ */
    14.1 --- a/xen/include/public/io/blkif.h	Wed Nov 30 12:51:24 2005 +0100
    14.2 +++ b/xen/include/public/io/blkif.h	Wed Nov 30 16:03:05 2005 +0100
    14.3 @@ -19,9 +19,6 @@
    14.4  #define BLKIF_OP_READ      0
    14.5  #define BLKIF_OP_WRITE     1
    14.6  
    14.7 -/* NB. Ring size must be small enough for sizeof(blkif_ring_t) <= PAGE_SIZE. */
    14.8 -#define BLKIF_RING_SIZE        64
    14.9 -
   14.10  /*
   14.11   * Maximum scatter/gather segments per request.
   14.12   * This is carefully chosen so that sizeof(blkif_ring_t) <= PAGE_SIZE.
   14.13 @@ -33,34 +30,25 @@ typedef struct blkif_request {
   14.14      uint8_t        operation;    /* BLKIF_OP_???                         */
   14.15      uint8_t        nr_segments;  /* number of segments                   */
   14.16      blkif_vdev_t   handle;       /* only for read/write requests         */
   14.17 -    unsigned long  id;           /* private guest value, echoed in resp  */
   14.18 +    uint64_t       id;           /* private guest value, echoed in resp  */
   14.19      blkif_sector_t sector_number;/* start sector idx on disk (r/w only)  */
   14.20 -    /* @f_a_s[4:0]=last_sect ; @f_a_s[9:5]=first_sect                        */
   14.21 -    /* @f_a_s[:16]= grant reference (16 bits)                                */
   14.22 -    /* @first_sect: first sector in frame to transfer (inclusive).           */
   14.23 -    /* @last_sect: last sector in frame to transfer (inclusive).             */
   14.24 -    unsigned long  frame_and_sects[BLKIF_MAX_SEGMENTS_PER_REQUEST];
   14.25 +    struct blkif_request_segment {
   14.26 +        grant_ref_t gref;        /* reference to I/O buffer frame        */
   14.27 +        /* @first_sect: first sector in frame to transfer (inclusive).   */
   14.28 +        /* @last_sect: last sector in frame to transfer (inclusive).     */
   14.29 +        uint8_t     first_sect, last_sect;
   14.30 +    } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
   14.31  } blkif_request_t;
   14.32  
   14.33 -#define blkif_fas(_addr, _fs, _ls) ((_addr)|((_fs)<<5)|(_ls))
   14.34 -#define blkif_first_sect(_fas) (((_fas)>>5)&31)
   14.35 -#define blkif_last_sect(_fas)  ((_fas)&31)
   14.36 -
   14.37 -#define blkif_fas_from_gref(_gref, _fs, _ls) (((_gref)<<16)|((_fs)<<5)|(_ls))
   14.38 -#define blkif_gref_from_fas(_fas) ((_fas)>>16)
   14.39 -
   14.40  typedef struct blkif_response {
   14.41 -    unsigned long   id;              /* copied from request */
   14.42 +    uint64_t        id;              /* copied from request */
   14.43      uint8_t         operation;       /* copied from request */
   14.44 -    int16_t         status;          /* BLKIF_RSP_???       */
   14.45 +    int32_t         status;          /* BLKIF_RSP_???       */
   14.46  } blkif_response_t;
   14.47  
   14.48  #define BLKIF_RSP_ERROR  -1 /* non-specific 'error' */
   14.49  #define BLKIF_RSP_OKAY    0 /* non-specific 'okay'  */
   14.50  
   14.51 -#define BLKIF_MAJOR(dev) ((dev)>>8)
   14.52 -#define BLKIF_MINOR(dev) ((dev) & 0xff)
   14.53 -
   14.54  /*
   14.55   * Generate blkif ring structures and types.
   14.56   */
    15.1 --- a/xen/include/public/io/tpmif.h	Wed Nov 30 12:51:24 2005 +0100
    15.2 +++ b/xen/include/public/io/tpmif.h	Wed Nov 30 16:03:05 2005 +0100
    15.3 @@ -18,7 +18,7 @@
    15.4  
    15.5  typedef struct {
    15.6      unsigned long addr;   /* Machine address of packet.   */
    15.7 -    int      ref;         /* grant table access reference */
    15.8 +    grant_ref_t ref;      /* grant table access reference */
    15.9      uint16_t id;          /* Echoed in response message.  */
   15.10      uint16_t size;        /* Packet size in bytes.        */
   15.11  } tpmif_tx_request_t;
    16.1 --- a/xen/include/public/sched_ctl.h	Wed Nov 30 12:51:24 2005 +0100
    16.2 +++ b/xen/include/public/sched_ctl.h	Wed Nov 30 16:03:05 2005 +0100
    16.3 @@ -48,8 +48,8 @@ struct sched_adjdom_cmd {
    16.4              uint64_t period;
    16.5              uint64_t slice;
    16.6              uint64_t latency;
    16.7 -            uint16_t extratime;
    16.8 -            uint16_t weight;
    16.9 +            uint32_t extratime;
   16.10 +            uint32_t weight;
   16.11          } sedf;
   16.12  
   16.13      } u;
    17.1 --- a/xen/include/public/xen.h	Wed Nov 30 12:51:24 2005 +0100
    17.2 +++ b/xen/include/public/xen.h	Wed Nov 30 16:03:05 2005 +0100
    17.3 @@ -410,9 +410,9 @@ typedef struct start_info {
    17.4      unsigned long shared_info;  /* MACHINE address of shared info struct. */
    17.5      uint32_t flags;             /* SIF_xxx flags.                         */
    17.6      unsigned long store_mfn;    /* MACHINE page number of shared page.    */
    17.7 -    uint16_t store_evtchn;      /* Event channel for store communication. */
    17.8 +    uint32_t store_evtchn;      /* Event channel for store communication. */
    17.9      unsigned long console_mfn;  /* MACHINE address of console page.       */
   17.10 -    uint16_t console_evtchn;    /* Event channel for console messages.    */
   17.11 +    uint32_t console_evtchn;    /* Event channel for console messages.    */
   17.12      /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME).     */
   17.13      unsigned long pt_base;      /* VIRTUAL address of page directory.     */
   17.14      unsigned long nr_pt_frames; /* Number of bootstrap p.t. frames.       */