diff options
author | kaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk> | 2004-02-12 11:51:34 +0000 |
---|---|---|
committer | kaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk> | 2004-02-12 11:51:34 +0000 |
commit | 11a7c8522c306b98bcd0f272e373e1b5eb4ef7a2 (patch) | |
tree | 05272a4254d3309189613b0388bba412d90f3dd6 | |
parent | dec59149875ba485585f017461fba9f7e484f952 (diff) | |
download | xen-11a7c8522c306b98bcd0f272e373e1b5eb4ef7a2.tar.gz xen-11a7c8522c306b98bcd0f272e373e1b5eb4ef7a2.tar.bz2 xen-11a7c8522c306b98bcd0f272e373e1b5eb4ef7a2.zip |
bitkeeper revision 1.719 (402b68c6wyzlyU0WWpwzC19I8mQBEw)
Many files:
Various cleanups to Xen control interfaces.
-rwxr-xr-x | tools/examples/xc_dom_control.py | 2 | ||||
-rw-r--r-- | tools/xc/lib/xc.h | 12 | ||||
-rw-r--r-- | tools/xc/lib/xc_bvtsched.c | 4 | ||||
-rw-r--r-- | tools/xc/lib/xc_domain.c | 30 | ||||
-rw-r--r-- | tools/xc/lib/xc_linux_build.c | 18 | ||||
-rw-r--r-- | tools/xc/lib/xc_linux_restore.c | 16 | ||||
-rw-r--r-- | tools/xc/lib/xc_linux_save.c | 18 | ||||
-rw-r--r-- | tools/xc/lib/xc_netbsd_build.c | 18 | ||||
-rw-r--r-- | tools/xc/lib/xc_vbd.c | 46 | ||||
-rw-r--r-- | tools/xc/lib/xc_vif.c | 12 | ||||
-rw-r--r-- | tools/xc/py/Xc.c | 32 | ||||
-rw-r--r-- | tools/xc/py/XenoUtil.py | 14 | ||||
-rw-r--r-- | xen/arch/i386/Rules.mk | 4 | ||||
-rw-r--r-- | xen/common/dom_mem_ops.c | 4 | ||||
-rw-r--r-- | xen/common/memory.c | 2 | ||||
-rw-r--r-- | xen/common/schedule.c | 4 | ||||
-rw-r--r-- | xen/drivers/block/xen_block.c | 4 | ||||
-rw-r--r-- | xen/drivers/block/xen_vbd.c | 21 | ||||
-rw-r--r-- | xen/include/hypervisor-ifs/block.h | 9 | ||||
-rw-r--r-- | xen/include/hypervisor-ifs/vbd.h | 8 | ||||
-rw-r--r-- | xen/include/xeno/vbd.h | 2 | ||||
-rw-r--r-- | xen/net/dev.c | 2 | ||||
-rw-r--r-- | xenolinux-2.4.24-sparse/arch/xeno/drivers/block/xl_block.c | 2 | ||||
-rw-r--r-- | xenolinux-2.4.24-sparse/arch/xeno/drivers/block/xl_vbd.c | 15 |
24 files changed, 154 insertions, 145 deletions
diff --git a/tools/examples/xc_dom_control.py b/tools/examples/xc_dom_control.py index 1f7424d092..59d137837e 100755 --- a/tools/examples/xc_dom_control.py +++ b/tools/examples/xc_dom_control.py @@ -47,7 +47,7 @@ dom = None if len( sys.argv ) > 2 and re.match('\d+$', sys.argv[2]): - dom = string.atoi(sys.argv[2]) + dom = long(sys.argv[2]) if cmd == 'stop': rc = xc.domain_stop( dom=dom ) diff --git a/tools/xc/lib/xc.h b/tools/xc/lib/xc.h index 11252852c0..5959c6265a 100644 --- a/tools/xc/lib/xc.h +++ b/tools/xc/lib/xc.h @@ -28,7 +28,7 @@ typedef struct { int has_cpu; int stopped; unsigned long nr_pages; - unsigned long long cpu_time; + u64 cpu_time; #define XC_DOMINFO_MAXNAME 16 char name[XC_DOMINFO_MAXNAME]; } xc_dominfo_t; @@ -86,8 +86,8 @@ typedef struct { } xc_vif_sched_params_t; typedef struct { - unsigned long long tx_bytes, tx_pkts; - unsigned long long rx_bytes, rx_pkts; + u64 tx_bytes, tx_pkts; + u64 rx_bytes, rx_pkts; } xc_vif_stats_t; int xc_vif_scheduler_set(int xc_handle, @@ -109,13 +109,13 @@ typedef struct { unsigned short vbdid; #define XC_VBDF_WRITEABLE (1<<0) unsigned long flags; - unsigned long nr_sectors; + u64 nr_sectors; } xc_vbd_t; typedef struct { unsigned short real_device; - unsigned long start_sector; - unsigned long nr_sectors; + u64 start_sector; + u64 nr_sectors; } xc_vbdextent_t; int xc_vbd_create(int xc_handle, diff --git a/tools/xc/lib/xc_bvtsched.c b/tools/xc/lib/xc_bvtsched.c index 6dc532df1f..57554cd2e6 100644 --- a/tools/xc/lib/xc_bvtsched.c +++ b/tools/xc/lib/xc_bvtsched.c @@ -18,7 +18,7 @@ int xc_bvtsched_global_set(int xc_handle, } int xc_bvtsched_domain_set(int xc_handle, - domid_t domid, + u64 domid, unsigned long mcuadv, unsigned long warp, unsigned long warpl, @@ -26,7 +26,7 @@ int xc_bvtsched_domain_set(int xc_handle, { dom0_op_t op; op.cmd = DOM0_ADJUSTDOM; - op.u.adjustdom.domain = domid; + op.u.adjustdom.domain = (domid_t)domid; op.u.adjustdom.mcu_adv = mcuadv; op.u.adjustdom.warp = warp; op.u.adjustdom.warpl = warpl; diff --git a/tools/xc/lib/xc_domain.c b/tools/xc/lib/xc_domain.c index 669138fd9b..759e3ecfc7 100644 --- a/tools/xc/lib/xc_domain.c +++ b/tools/xc/lib/xc_domain.c @@ -11,7 +11,7 @@ int xc_domain_create(int xc_handle, unsigned int mem_kb, const char *name, - domid_t *pdomid) + u64 *pdomid) { int err; dom0_op_t op; @@ -22,71 +22,71 @@ int xc_domain_create(int xc_handle, op.u.createdomain.name[MAX_DOMAIN_NAME-1] = '\0'; if ( (err = do_dom0_op(xc_handle, &op)) == 0 ) - *pdomid = op.u.createdomain.domain; + *pdomid = (u64)op.u.createdomain.domain; return err; } int xc_domain_start(int xc_handle, - domid_t domid) + u64 domid) { dom0_op_t op; op.cmd = DOM0_STARTDOMAIN; - op.u.startdomain.domain = domid; + op.u.startdomain.domain = (domid_t)domid; return do_dom0_op(xc_handle, &op); } int xc_domain_stop(int xc_handle, - domid_t domid) + u64 domid) { dom0_op_t op; op.cmd = DOM0_STOPDOMAIN; - op.u.stopdomain.domain = domid; + op.u.stopdomain.domain = (domid_t)domid; return do_dom0_op(xc_handle, &op); } int xc_domain_destroy(int xc_handle, - domid_t domid, + u64 domid, int force) { dom0_op_t op; op.cmd = DOM0_DESTROYDOMAIN; - op.u.destroydomain.domain = domid; + op.u.destroydomain.domain = (domid_t)domid; op.u.destroydomain.force = !!force; return do_dom0_op(xc_handle, &op); } int xc_domain_pincpu(int xc_handle, - domid_t domid, + u64 domid, int cpu) { dom0_op_t op; op.cmd = DOM0_PINCPUDOMAIN; - op.u.pincpudomain.domain = domid; + op.u.pincpudomain.domain = (domid_t)domid; op.u.pincpudomain.cpu = cpu; return do_dom0_op(xc_handle, &op); } int xc_domain_getinfo(int xc_handle, - domid_t first_domid, + u64 first_domid, unsigned int max_doms, xc_dominfo_t *info) { unsigned int nr_doms; - domid_t next_domid = first_domid; + u64 next_domid = first_domid; dom0_op_t op; for ( nr_doms = 0; nr_doms < max_doms; nr_doms++ ) { op.cmd = DOM0_GETDOMAININFO; - op.u.getdomaininfo.domain = next_domid; + op.u.getdomaininfo.domain = (domid_t)next_domid; if ( do_dom0_op(xc_handle, &op) < 0 ) break; - info->domid = op.u.getdomaininfo.domain; + info->domid = (u64)op.u.getdomaininfo.domain; info->cpu = op.u.getdomaininfo.processor; info->has_cpu = op.u.getdomaininfo.has_cpu; info->stopped = (op.u.getdomaininfo.state == DOMSTATE_STOPPED); @@ -95,7 +95,7 @@ int xc_domain_getinfo(int xc_handle, strncpy(info->name, op.u.getdomaininfo.name, XC_DOMINFO_MAXNAME); info->name[XC_DOMINFO_MAXNAME-1] = '\0'; - next_domid = op.u.getdomaininfo.domain + 1; + next_domid = (u64)op.u.getdomaininfo.domain + 1; info++; } diff --git a/tools/xc/lib/xc_linux_build.c b/tools/xc/lib/xc_linux_build.c index 0071ddf94d..2ea7d00096 100644 --- a/tools/xc/lib/xc_linux_build.c +++ b/tools/xc/lib/xc_linux_build.c @@ -12,24 +12,24 @@ #define L1_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED) #define L2_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER) -static long get_tot_pages(int xc_handle, domid_t domid) +static long get_tot_pages(int xc_handle, u64 domid) { dom0_op_t op; op.cmd = DOM0_GETDOMAININFO; - op.u.getdomaininfo.domain = domid; + op.u.getdomaininfo.domain = (domid_t)domid; return (do_dom0_op(xc_handle, &op) < 0) ? -1 : op.u.getdomaininfo.tot_pages; } static int get_pfn_list(int xc_handle, - domid_t domid, + u64 domid, unsigned long *pfn_buf, unsigned long max_pfns) { dom0_op_t op; int ret; op.cmd = DOM0_GETMEMLIST; - op.u.getmemlist.domain = domid; + op.u.getmemlist.domain = (domid_t)domid; op.u.getmemlist.max_pfns = max_pfns; op.u.getmemlist.buffer = pfn_buf; @@ -96,7 +96,7 @@ static int copy_to_domain_page(int pm_handle, } static int setup_guestos(int xc_handle, - domid_t dom, + u64 dom, gzFile kernel_gfd, gzFile initrd_gfd, unsigned long tot_pages, @@ -312,7 +312,7 @@ static int setup_guestos(int xc_handle, } int xc_linux_build(int xc_handle, - domid_t domid, + u64 domid, const char *image_name, const char *ramdisk_name, const char *cmdline) @@ -382,9 +382,9 @@ int xc_linux_build(int xc_handle, } op.cmd = DOM0_GETDOMAININFO; - op.u.getdomaininfo.domain = domid; + op.u.getdomaininfo.domain = (domid_t)domid; if ( (do_dom0_op(xc_handle, &op) < 0) || - (op.u.getdomaininfo.domain != domid) ) + ((u64)op.u.getdomaininfo.domain != domid) ) { PERROR("Could not get info on domain"); goto error_out; @@ -468,7 +468,7 @@ int xc_linux_build(int xc_handle, ctxt->failsafe_callback_cs = FLAT_RING1_CS; ctxt->failsafe_callback_eip = 0; - launch_op.u.builddomain.domain = domid; + launch_op.u.builddomain.domain = (domid_t)domid; launch_op.u.builddomain.num_vifs = 1; launch_op.cmd = DOM0_BUILDDOMAIN; diff --git a/tools/xc/lib/xc_linux_restore.c b/tools/xc/lib/xc_linux_restore.c index 7afb239d91..be65a9e367 100644 --- a/tools/xc/lib/xc_linux_restore.c +++ b/tools/xc/lib/xc_linux_restore.c @@ -19,14 +19,14 @@ } while ( 0 ) static int get_pfn_list(int xc_handle, - domid_t domain_id, + u64 domain_id, unsigned long *pfn_buf, unsigned long max_pfns) { dom0_op_t op; int ret; op.cmd = DOM0_GETMEMLIST; - op.u.getmemlist.domain = domain_id; + op.u.getmemlist.domain = (domid_t)domain_id; op.u.getmemlist.max_pfns = max_pfns; op.u.getmemlist.buffer = pfn_buf; @@ -104,12 +104,12 @@ static int checked_read(gzFile fd, void *buf, size_t count) int xc_linux_restore(int xc_handle, const char *state_file, int verbose, - domid_t *pdomid) + u64 *pdomid) { dom0_op_t op; int rc = 1, i, j; unsigned long mfn, pfn; - domid_t dom = 0; + u64 dom = 0ULL; unsigned int prev_pc, this_pc; /* Number of page frames in use by this XenoLinux session. */ @@ -225,11 +225,11 @@ int xc_linux_restore(int xc_handle, ERROR("Could not create new domain"); goto out; } - dom = op.u.createdomain.domain; + dom = (u64)op.u.createdomain.domain; /* Get the domain's shared-info frame. */ op.cmd = DOM0_GETDOMAININFO; - op.u.getdomaininfo.domain = dom; + op.u.getdomaininfo.domain = (domid_t)dom; if ( do_dom0_op(xc_handle, &op) < 0 ) { ERROR("Could not get information on new domain"); @@ -452,7 +452,7 @@ int xc_linux_restore(int xc_handle, } op.cmd = DOM0_BUILDDOMAIN; - op.u.builddomain.domain = dom; + op.u.builddomain.domain = (domid_t)dom; op.u.builddomain.num_vifs = 1; memcpy(&op.u.builddomain.ctxt, &ctxt, sizeof(ctxt)); rc = do_dom0_op(xc_handle, &op); @@ -463,7 +463,7 @@ int xc_linux_restore(int xc_handle, if ( dom != 0 ) { op.cmd = DOM0_DESTROYDOMAIN; - op.u.destroydomain.domain = dom; + op.u.destroydomain.domain = (domid_t)dom; op.u.destroydomain.force = 1; (void)do_dom0_op(xc_handle, &op); } diff --git a/tools/xc/lib/xc_linux_save.c b/tools/xc/lib/xc_linux_save.c index 62c4d379dd..40fc06acd5 100644 --- a/tools/xc/lib/xc_linux_save.c +++ b/tools/xc/lib/xc_linux_save.c @@ -40,24 +40,24 @@ static int check_pfn_ownership(int xc_handle, unsigned long mfn, - domid_t dom) + u64 dom) { dom0_op_t op; op.cmd = DOM0_GETPAGEFRAMEINFO; op.u.getpageframeinfo.pfn = mfn; - op.u.getpageframeinfo.domain = dom; + op.u.getpageframeinfo.domain = (domid_t)dom; return (do_dom0_op(xc_handle, &op) >= 0); } #define GETPFN_ERR (~0U) static unsigned int get_pfn_type(int xc_handle, unsigned long mfn, - domid_t dom) + u64 dom) { dom0_op_t op; op.cmd = DOM0_GETPAGEFRAMEINFO; op.u.getpageframeinfo.pfn = mfn; - op.u.getpageframeinfo.domain = dom; + op.u.getpageframeinfo.domain = (domid_t)dom; if ( do_dom0_op(xc_handle, &op) < 0 ) { PERROR("Unexpected failure when getting page frame info!"); @@ -75,7 +75,7 @@ static int checked_write(gzFile fd, void *buf, size_t count) } int xc_linux_save(int xc_handle, - domid_t domid, + u64 domid, const char *state_file, int verbose) { @@ -142,9 +142,9 @@ int xc_linux_save(int xc_handle, for ( ; ; ) { op.cmd = DOM0_GETDOMAININFO; - op.u.getdomaininfo.domain = domid; + op.u.getdomaininfo.domain = (domid_t)domid; if ( (do_dom0_op(xc_handle, &op) < 0) || - (op.u.getdomaininfo.domain != domid) ) + ((u64)op.u.getdomaininfo.domain != domid) ) { PERROR("Could not get info on domain"); goto out; @@ -160,7 +160,7 @@ int xc_linux_save(int xc_handle, we_stopped_it = 1; op.cmd = DOM0_STOPDOMAIN; - op.u.stopdomain.domain = domid; + op.u.stopdomain.domain = (domid_t)domid; if ( do_dom0_op(xc_handle, &op) != 0 ) { we_stopped_it = 0; @@ -375,7 +375,7 @@ int xc_linux_save(int xc_handle, if ( we_stopped_it ) { op.cmd = DOM0_STARTDOMAIN; - op.u.startdomain.domain = domid; + op.u.startdomain.domain = (domid_t)domid; (void)do_dom0_op(xc_handle, &op); } diff --git a/tools/xc/lib/xc_netbsd_build.c b/tools/xc/lib/xc_netbsd_build.c index 4da93b7023..64ba336efc 100644 --- a/tools/xc/lib/xc_netbsd_build.c +++ b/tools/xc/lib/xc_netbsd_build.c @@ -22,24 +22,24 @@ static int loadelfimage(gzFile, int, unsigned long *, unsigned long, #define L1_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED) #define L2_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER) -static long get_tot_pages(int xc_handle, domid_t domid) +static long get_tot_pages(int xc_handle, u64 domid) { dom0_op_t op; op.cmd = DOM0_GETDOMAININFO; - op.u.getdomaininfo.domain = domid; + op.u.getdomaininfo.domain = (domid_t)domid; return (do_dom0_op(xc_handle, &op) < 0) ? -1 : op.u.getdomaininfo.tot_pages; } static int get_pfn_list(int xc_handle, - domid_t domid, + u64 domid, unsigned long *pfn_buf, unsigned long max_pfns) { dom0_op_t op; int ret; op.cmd = DOM0_GETMEMLIST; - op.u.getmemlist.domain = domid; + op.u.getmemlist.domain = (domid_t)domid; op.u.getmemlist.max_pfns = max_pfns; op.u.getmemlist.buffer = pfn_buf; @@ -75,7 +75,7 @@ static int send_pgupdates(int xc_handle, mmu_update_t *updates, int nr_updates) } static int setup_guestos(int xc_handle, - domid_t dom, + u64 dom, gzFile kernel_gfd, unsigned long tot_pages, unsigned long *virt_startinfo_addr, @@ -248,7 +248,7 @@ static int setup_guestos(int xc_handle, } int xc_netbsd_build(int xc_handle, - domid_t domid, + u64 domid, const char *image_name, const char *cmdline) { @@ -282,9 +282,9 @@ int xc_netbsd_build(int xc_handle, } op.cmd = DOM0_GETDOMAININFO; - op.u.getdomaininfo.domain = domid; + op.u.getdomaininfo.domain = (domid_t)domid; if ( (do_dom0_op(xc_handle, &op) < 0) || - (op.u.getdomaininfo.domain != domid) ) + ((u64)op.u.getdomaininfo.domain != domid) ) { PERROR("Could not get info on domain"); goto error_out; @@ -364,7 +364,7 @@ int xc_netbsd_build(int xc_handle, ctxt->failsafe_callback_cs = FLAT_RING1_CS; ctxt->failsafe_callback_eip = 0; - launch_op.u.builddomain.domain = domid; + launch_op.u.builddomain.domain = (domid_t)domid; launch_op.u.builddomain.num_vifs = 1; launch_op.cmd = DOM0_BUILDDOMAIN; diff --git a/tools/xc/lib/xc_vbd.c b/tools/xc/lib/xc_vbd.c index 76a0e6814d..00d166d03d 100644 --- a/tools/xc/lib/xc_vbd.c +++ b/tools/xc/lib/xc_vbd.c @@ -10,13 +10,13 @@ #include "xc_private.h" int xc_vbd_create(int xc_handle, - domid_t domid, + u64 domid, unsigned short vbdid, int writeable) { block_io_op_t op; op.cmd = BLOCK_IO_OP_VBD_CREATE; - op.u.create_params.domain = domid; + op.u.create_params.domain = (domid_t)domid; op.u.create_params.vdevice = vbdid; op.u.create_params.mode = VBD_MODE_R | (writeable ? VBD_MODE_W : 0); return do_block_io_op(xc_handle, &op); @@ -24,47 +24,47 @@ int xc_vbd_create(int xc_handle, int xc_vbd_destroy(int xc_handle, - domid_t domid, + u64 domid, unsigned short vbdid) { block_io_op_t op; op.cmd = BLOCK_IO_OP_VBD_DELETE; - op.u.delete_params.domain = domid; + op.u.delete_params.domain = (domid_t)domid; op.u.delete_params.vdevice = vbdid; return do_block_io_op(xc_handle, &op); } int xc_vbd_grow(int xc_handle, - domid_t domid, + u64 domid, unsigned short vbdid, xc_vbdextent_t *extent) { block_io_op_t op; op.cmd = BLOCK_IO_OP_VBD_GROW; - op.u.grow_params.domain = domid; + op.u.grow_params.domain = (domid_t)domid; op.u.grow_params.vdevice = vbdid; op.u.grow_params.extent.device = extent->real_device; - op.u.grow_params.extent.start_sector = extent->start_sector; - op.u.grow_params.extent.nr_sectors = extent->nr_sectors; + op.u.grow_params.extent.start_sector = (xen_sector_t)extent->start_sector; + op.u.grow_params.extent.nr_sectors = (xen_sector_t)extent->nr_sectors; return do_block_io_op(xc_handle, &op); } int xc_vbd_shrink(int xc_handle, - domid_t domid, + u64 domid, unsigned short vbdid) { block_io_op_t op; op.cmd = BLOCK_IO_OP_VBD_SHRINK; - op.u.shrink_params.domain = domid; + op.u.shrink_params.domain = (domid_t)domid; op.u.shrink_params.vdevice = vbdid; return do_block_io_op(xc_handle, &op); } int xc_vbd_setextents(int xc_handle, - domid_t domid, + u64 domid, unsigned short vbdid, unsigned int nr_extents, xc_vbdextent_t *extents) @@ -87,13 +87,15 @@ int xc_vbd_setextents(int xc_handle, for ( i = 0; i < nr_extents; i++ ) { real_extents[i].device = extents[i].real_device; - real_extents[i].start_sector = extents[i].start_sector; - real_extents[i].nr_sectors = extents[i].nr_sectors; + real_extents[i].start_sector = + (xen_sector_t)extents[i].start_sector; + real_extents[i].nr_sectors = + (xen_sector_t)extents[i].nr_sectors; } } op.cmd = BLOCK_IO_OP_VBD_SET_EXTENTS; - op.u.setextents_params.domain = domid; + op.u.setextents_params.domain = (domid_t)domid; op.u.setextents_params.vdevice = vbdid; op.u.setextents_params.nr_extents = nr_extents; op.u.setextents_params.extents = real_extents; @@ -110,7 +112,7 @@ int xc_vbd_setextents(int xc_handle, int xc_vbd_getextents(int xc_handle, - domid_t domid, + u64 domid, unsigned short vbdid, unsigned int max_extents, xc_vbdextent_t *extents, @@ -129,7 +131,7 @@ int xc_vbd_getextents(int xc_handle, } op.cmd = BLOCK_IO_OP_VBD_INFO; - op.u.info_params.domain = domid; + op.u.info_params.domain = (domid_t)domid; op.u.info_params.vdevice = vbdid; op.u.info_params.maxextents = max_extents; op.u.info_params.extents = real_extents; @@ -142,8 +144,8 @@ int xc_vbd_getextents(int xc_handle, for ( i = 0; i < op.u.info_params.nextents; i++ ) { extents[i].real_device = real_extents[i].device; - extents[i].start_sector = real_extents[i].start_sector; - extents[i].nr_sectors = real_extents[i].nr_sectors; + extents[i].start_sector = (u64)real_extents[i].start_sector; + extents[i].nr_sectors = (u64)real_extents[i].nr_sectors; } if ( writeable != NULL ) @@ -159,7 +161,7 @@ int xc_vbd_getextents(int xc_handle, int xc_vbd_probe(int xc_handle, - domid_t domid, + u64 domid, unsigned int max_vbds, xc_vbd_t *vbds) { @@ -168,7 +170,7 @@ int xc_vbd_probe(int xc_handle, int i, j, ret, allocsz = max_vbds * sizeof(xen_disk_t); op.cmd = BLOCK_IO_OP_VBD_PROBE; - op.u.probe_params.domain = domid; + op.u.probe_params.domain = (domid_t)domid; xdi->max = max_vbds; xdi->disks = malloc(allocsz); @@ -192,11 +194,11 @@ int xc_vbd_probe(int xc_handle, if ( !(xdi->disks[i].info & XD_FLAG_VIRT) ) continue; - vbds[j].domid = xdi->disks[i].domain; + vbds[j].domid = (u64)xdi->disks[i].domain; vbds[j].vbdid = xdi->disks[i].device; vbds[j].flags = (xdi->disks[i].info & XD_FLAG_RO) ? 0 : XC_VBDF_WRITEABLE; - vbds[j].nr_sectors = xdi->disks[i].capacity; + vbds[j].nr_sectors = (u64)xdi->disks[i].capacity; j++; } diff --git a/tools/xc/lib/xc_vif.c b/tools/xc/lib/xc_vif.c index c73e2dde72..518abfa0e3 100644 --- a/tools/xc/lib/xc_vif.c +++ b/tools/xc/lib/xc_vif.c @@ -9,13 +9,13 @@ #include "xc_private.h" int xc_vif_scheduler_set(int xc_handle, - domid_t domid, + u64 domid, unsigned int vifid, xc_vif_sched_params_t *params) { network_op_t netop; netop.cmd = NETWORK_OP_VIFSETPARAMS; - netop.u.vif_setparams.domain = domid; + netop.u.vif_setparams.domain = (domid_t)domid; netop.u.vif_setparams.vif = vifid; netop.u.vif_setparams.credit_bytes = params->credit_bytes; netop.u.vif_setparams.credit_usec = params->credit_usec; @@ -24,7 +24,7 @@ int xc_vif_scheduler_set(int xc_handle, int xc_vif_scheduler_get(int xc_handle, - domid_t domid, + u64 domid, unsigned int vifid, xc_vif_sched_params_t *params) { @@ -32,7 +32,7 @@ int xc_vif_scheduler_get(int xc_handle, int rc; netop.cmd = NETWORK_OP_VIFGETINFO; - netop.u.vif_getinfo.domain = domid; + netop.u.vif_getinfo.domain = (domid_t)domid; netop.u.vif_getinfo.vif = vifid; if ( (rc = do_network_op(xc_handle, &netop)) >= 0 ) @@ -46,7 +46,7 @@ int xc_vif_scheduler_get(int xc_handle, int xc_vif_stats_get(int xc_handle, - domid_t domid, + u64 domid, unsigned int vifid, xc_vif_stats_t *stats) { @@ -54,7 +54,7 @@ int xc_vif_stats_get(int xc_handle, int rc; netop.cmd = NETWORK_OP_VIFGETINFO; - netop.u.vif_getinfo.domain = domid; + netop.u.vif_getinfo.domain = (domid_t)domid; netop.u.vif_getinfo.vif = vifid; if ( (rc = do_network_op(xc_handle, &netop)) >= 0 ) diff --git a/tools/xc/py/Xc.c b/tools/xc/py/Xc.c index 8e3f5f7dcb..a483581e5e 100644 --- a/tools/xc/py/Xc.c +++ b/tools/xc/py/Xc.c @@ -432,7 +432,7 @@ static PyObject *pyxc_vbd_grow(PyObject *self, static char *kwd_list[] = { "dom", "vbd", "device", "start_sector", "nr_sectors", NULL }; - if ( !PyArg_ParseTupleAndKeywords(args, kwds, "Liill", kwd_list, + if ( !PyArg_ParseTupleAndKeywords(args, kwds, "LiiLL", kwd_list, &dom, &vbd, &extent.real_device, &extent.start_sector, @@ -502,13 +502,13 @@ static PyObject *pyxc_vbd_setextents(PyObject *self, goto fail; extents[i].real_device = (unsigned short)PyInt_AsLong(obj); if ( ((obj = PyDict_GetItemString(dict,"start_sector")) == NULL) || - !PyInt_Check(obj) ) + !PyLong_Check(obj) ) goto fail; - extents[i].start_sector = PyInt_AsLong(obj); + extents[i].start_sector = PyLong_AsUnsignedLongLong(obj); if ( ((obj = PyDict_GetItemString(dict, "nr_sectors")) == NULL) || - !PyInt_Check(obj) ) + !PyLong_Check(obj) ) goto fail; - extents[i].nr_sectors = PyInt_AsLong(obj); + extents[i].nr_sectors = PyLong_AsUnsignedLongLong(obj); } } @@ -564,7 +564,7 @@ static PyObject *pyxc_vbd_getextents(PyObject *self, { PyList_SetItem( list, i, - Py_BuildValue("{s:i,s:l,s:l}", + Py_BuildValue("{s:i,s:L,s:L}", "device", extents[i].real_device, "start_sector", extents[i].start_sector, "nr_sectors", extents[i].nr_sectors)); @@ -606,7 +606,7 @@ static PyObject *pyxc_vbd_probe(PyObject *self, { PyList_SetItem( list, i, - Py_BuildValue("{s:L,s:i,s:i,s:l}", + Py_BuildValue("{s:L,s:i,s:i,s:L}", "dom", info[i].domid, "vbd", info[i].vbdid, "writeable", !!(info[i].flags & XC_VBDF_WRITEABLE), @@ -806,8 +806,8 @@ static PyMethodDef pyxc_methods[] = { " dom [long]: Identifier of domain containing the VBD.\n" " vbd [int]: Identifier of the VBD.\n" " device [int]: Identifier of the real underlying block device.\n" - " start_sector [int]: Real start sector of this extent.\n" - " nr_sectors [int]: Length, in sectors, of this extent.\n\n" + " start_sector [long]: Real start sector of this extent.\n" + " nr_sectors [long]: Length, in sectors, of this extent.\n\n" "Returns: [int] 0 on success; -1 on error.\n" }, { "vbd_shrink", @@ -825,9 +825,9 @@ static PyMethodDef pyxc_methods[] = { " dom [long]: Identifier of domain containing the VBD.\n" " vbd [int]: Identifier of the VBD.\n" " extents [list of dicts]: Per-extent information.\n" - " device [int]: Identifier of the real underlying block device.\n" - " start_sector [int]: Real start sector of this extent.\n" - " nr_sectors [int]: Length, in sectors, of this extent.\n\n" + " device [int]: Id of the real underlying block device.\n" + " start_sector [long]: Real start sector of this extent.\n" + " nr_sectors [long]: Length, in sectors, of this extent.\n\n" "Returns: [int] 0 on success; -1 on error.\n" }, { "vbd_getextents", @@ -837,9 +837,9 @@ static PyMethodDef pyxc_methods[] = { " dom [long]: Identifier of domain containing the VBD.\n" " vbd [int]: Identifier of the VBD.\n\n" "Returns: [list of dicts] per-extent information; empty on error.\n" - " device [int]: Identifier of the real underlying block device.\n" - " start_sector [int]: Real start sector of this extent.\n" - " nr_sectors [int]: Length, in sectors, of this extent.\n" }, + " device [int]: Identifier of the real underlying block device.\n" + " start_sector [long]: Real start sector of this extent.\n" + " nr_sectors [long]: Length, in sectors, of this extent.\n" }, { "vbd_probe", (PyCFunction)pyxc_vbd_probe, @@ -852,7 +852,7 @@ static PyMethodDef pyxc_methods[] = { " dom [long]: Domain containing this VBD.\n" " vbd [int]: Domain-specific identifier of this VBD.\n" " writeable [int]: Bool - is this VBD writeable?\n" - " nr_sectors [int]: Size of this VBD, in 512-byte sectors.\n" }, + " nr_sectors [long]: Size of this VBD, in 512-byte sectors.\n" }, { "readconsolering", (PyCFunction)pyxc_readconsolering, diff --git a/tools/xc/py/XenoUtil.py b/tools/xc/py/XenoUtil.py index 043d7782d1..68f4f02f54 100644 --- a/tools/xc/py/XenoUtil.py +++ b/tools/xc/py/XenoUtil.py @@ -133,8 +133,8 @@ def lookup_raw_partn(partition): nr_sectors, type } device: Device number of the given partition start_sector: Index of first sector of the partition - nr_sectsors: Number of sectors comprising this partition - type: 'Disk' or identifying name for partition type + nr_sectors: Number of sectors comprising this partition + type: 'Disk' or identifying name for partition type """ if not re.match( '/dev/', partition ): @@ -147,8 +147,8 @@ def lookup_raw_partn(partition): line = fd.readline() if line: return [ { 'device' : blkdev_name_to_number(drive), - 'start_sector' : 0, - 'nr_sectors' : int(line) * 2, + 'start_sector' : long(0), + 'nr_sectors' : long(line) * 2, 'type' : 'Disk' } ] return None @@ -162,8 +162,8 @@ def lookup_raw_partn(partition): 'size=\s*([0-9]+), Id=\s*(\S+).*$', line) if m: return [ { 'device' : blkdev_name_to_number(drive), - 'start_sector' : int(m.group(1)), - 'nr_sectors' : int(m.group(2)), + 'start_sector' : long(m.group(1)), + 'nr_sectors' : long(m.group(2)), 'type' : m.group(3) } ] return None @@ -421,7 +421,7 @@ def vd_lookup(id): # the disk device this extent is on - for passing to Xen 'device' : lookup_raw_partn(partition)[0]['device'], # the offset of this extent within the disk - for passing to Xen - 'start_sector' : int(part_offset + lookup_raw_partn(partition)[0]['start_sector']), + 'start_sector' : long(part_offset + lookup_raw_partn(partition)[0]['start_sector']), # extent size, in sectors 'nr_sectors' : nr_sectors, # partition device this extent is on (useful to know for XenoUtil fns) diff --git a/xen/arch/i386/Rules.mk b/xen/arch/i386/Rules.mk index 56f5932b6d..7adf28664d 100644 --- a/xen/arch/i386/Rules.mk +++ b/xen/arch/i386/Rules.mk @@ -9,8 +9,8 @@ MONITOR_BASE := 0xFC500000 LOAD_BASE := 0x00100000 CFLAGS := -nostdinc -fno-builtin -fno-common -fno-strict-aliasing CFLAGS += -iwithprefix include -O3 -Wall -DMONITOR_BASE=$(MONITOR_BASE) -CFLAGS += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__ -DNDEBUG -#CFLAGS += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__ +#CFLAGS += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__ -DNDEBUG +CFLAGS += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__ CFLAGS += -Wno-pointer-arith -Wredundant-decls LDFLAGS := -T xeno.lds -N diff --git a/xen/common/dom_mem_ops.c b/xen/common/dom_mem_ops.c index 53facf8477..97b0f784e6 100644 --- a/xen/common/dom_mem_ops.c +++ b/xen/common/dom_mem_ops.c @@ -62,7 +62,7 @@ static long free_dom_mem(struct task_struct *p, reservation_decrease_t op) op.pages++; if ( mpfn >= max_page ) { - DPRINTK("Domain %d page number out of range (%08lx>=%08lx)\n", + DPRINTK("Domain %llu page number out of range (%08lx>=%08lx)\n", p->domain, mpfn, max_page); rc = -EINVAL; goto out; @@ -71,7 +71,7 @@ static long free_dom_mem(struct task_struct *p, reservation_decrease_t op) page = &frame_table[mpfn]; if ( unlikely(!get_page(page, p)) ) { - DPRINTK("Bad page free for domain %d\n", p->domain); + DPRINTK("Bad page free for domain %llu\n", p->domain); rc = -EINVAL; goto out; } diff --git a/xen/common/memory.c b/xen/common/memory.c index 1f952c8b27..cd643b2686 100644 --- a/xen/common/memory.c +++ b/xen/common/memory.c @@ -141,7 +141,7 @@ #ifndef NDEBUG #define MEM_LOG(_f, _a...) \ - printk("DOM%d: (file=memory.c, line=%d) " _f "\n", \ + printk("DOM%llu: (file=memory.c, line=%d) " _f "\n", \ current->domain, __LINE__, ## _a ) #else #define MEM_LOG(_f, _a...) ((void)0) diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 122915f145..e6450cc54c 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -260,7 +260,7 @@ long do_sched_op(unsigned long op) case SCHEDOP_exit: { - DPRINTK("DOM%d killed itself!\n", current->domain); + DPRINTK("DOM%llu killed itself!\n", current->domain); DPRINTK(" EIP == %08lx\n", get_execution_context()->eip); kill_domain(); break; @@ -268,7 +268,7 @@ long do_sched_op(unsigned long op) case SCHEDOP_stop: { - DPRINTK("DOM%d stopped itself!\n", current->domain); + DPRINTK("DOM%llu stopped itself!\n", current->domain); DPRINTK(" EIP == %08lx\n", get_execution_context()->eip); stop_domain(); break; diff --git a/xen/drivers/block/xen_block.c b/xen/drivers/block/xen_block.c index 4f0888a185..937086a6a0 100644 --- a/xen/drivers/block/xen_block.c +++ b/xen/drivers/block/xen_block.c @@ -452,7 +452,7 @@ static void dispatch_rw_block_io(struct task_struct *p, new_segs = vbd_translate(&phys_seg[nr_psegs], p, operation); if ( new_segs < 0 ) { - DPRINTK("access denied: %s of [%ld,%ld] on dev=%04x\n", + DPRINTK("access denied: %s of [%llu,%llu] on dev=%04x\n", operation == READ ? "read" : "write", req->sector_number + tot_sects, req->sector_number + tot_sects + nr_sects, @@ -498,7 +498,7 @@ static void dispatch_rw_block_io(struct task_struct *p, bh->b_size = phys_seg[i].nr_sects << 9; bh->b_dev = phys_seg[i].dev; - bh->b_rsector = phys_seg[i].sector_number; + bh->b_rsector = (unsigned long)phys_seg[i].sector_number; bh->b_data = phys_to_virt(phys_seg[i].buffer); bh->b_end_io = end_block_io_op; bh->pending_req = pending_req; diff --git a/xen/drivers/block/xen_vbd.c b/xen/drivers/block/xen_vbd.c index 8a42026dac..3e25440e52 100644 --- a/xen/drivers/block/xen_vbd.c +++ b/xen/drivers/block/xen_vbd.c @@ -88,7 +88,7 @@ long vbd_create(vbd_create_t *create) if ( unlikely((p = find_domain_by_id(create->domain)) == NULL) ) { - DPRINTK("vbd_create attempted for non-existent domain %d\n", + DPRINTK("vbd_create attempted for non-existent domain %llu\n", create->domain); return -EINVAL; } @@ -170,7 +170,7 @@ long vbd_grow(vbd_grow_t *grow) if ( unlikely((p = find_domain_by_id(grow->domain)) == NULL) ) { - DPRINTK("vbd_grow: attempted for non-existent domain %d\n", + DPRINTK("vbd_grow: attempted for non-existent domain %llu\n", grow->domain); return -EINVAL; } @@ -197,7 +197,7 @@ long vbd_shrink(vbd_shrink_t *shrink) if ( (p = find_domain_by_id(shrink->domain)) == NULL ) { - DPRINTK("vbd_shrink attempted for non-existent domain %d\n", + DPRINTK("vbd_shrink attempted for non-existent domain %llu\n", shrink->domain); return -EINVAL; } @@ -259,7 +259,7 @@ long vbd_setextents(vbd_setextents_t *setextents) if ( (p = find_domain_by_id(setextents->domain)) == NULL ) { - DPRINTK("vbd_setextents attempted for non-existent domain %d\n", + DPRINTK("vbd_setextents attempted for non-existent domain %llu\n", setextents->domain); return -EINVAL; } @@ -355,7 +355,7 @@ long vbd_delete(vbd_delete_t *delete) if ( (p = find_domain_by_id(delete->domain)) == NULL ) { - DPRINTK("vbd_delete attempted for non-existent domain %d\n", + DPRINTK("vbd_delete attempted for non-existent domain %llu\n", delete->domain); return -EINVAL; } @@ -450,7 +450,7 @@ static int vbd_probe_single(xen_disk_info_t *xdi, cur_disk.info = vbd->type; if ( !VBD_CAN_WRITE(vbd) ) cur_disk.info |= XD_FLAG_RO; - cur_disk.capacity = 0 ; + cur_disk.capacity = 0ULL; for ( x = vbd->extents; x != NULL; x = x->next ) cur_disk.capacity += x->extent.nr_sectors; cur_disk.domain = p->domain; @@ -542,7 +542,7 @@ long vbd_probe(vbd_probe_t *probe) if ( (probe->domain != VBD_PROBE_ALL) && ((p = find_domain_by_id(probe->domain)) == NULL) ) { - DPRINTK("vbd_probe attempted for non-existent domain %d\n", + DPRINTK("vbd_probe attempted for non-existent domain %llu\n", probe->domain); return -EINVAL; } @@ -597,7 +597,7 @@ long vbd_info(vbd_info_t *info) if ( (p = find_domain_by_id(info->domain)) == NULL ) { - DPRINTK("vbd_info attempted for non-existent domain %d\n", + DPRINTK("vbd_info attempted for non-existent domain %llu\n", info->domain); return -EINVAL; } @@ -653,7 +653,8 @@ int vbd_translate(phys_seg_t *pseg, struct task_struct *p, int operation) xen_extent_le_t *x; vbd_t *vbd; rb_node_t *rb; - unsigned long sec_off, nr_secs; + xen_sector_t sec_off; + unsigned long nr_secs; spin_lock(&p->vbd_lock); @@ -669,7 +670,7 @@ int vbd_translate(phys_seg_t *pseg, struct task_struct *p, int operation) goto found; } - DPRINTK("vbd_translate; domain %d attempted to access " + DPRINTK("vbd_translate; domain %llu attempted to access " "non-existent VBD.\n", p->domain); spin_unlock(&p->vbd_lock); diff --git a/xen/include/hypervisor-ifs/block.h b/xen/include/hypervisor-ifs/block.h index 515d8ad338..da5f38ee67 100644 --- a/xen/include/hypervisor-ifs/block.h +++ b/xen/include/hypervisor-ifs/block.h @@ -8,6 +8,8 @@ #ifndef __BLOCK_H__ #define __BLOCK_H__ +typedef u64 xen_sector_t; + /* * * These are the ring data structures for buffering messages between @@ -28,16 +30,17 @@ /* * Maximum scatter/gather segments per request. * This is carefully chosen so that sizeof(blk_ring_t) <= PAGE_SIZE. + * NB. This could be 12 if the ring indexes weren't stored in the same page. */ -#define MAX_BLK_SEGS 12 +#define MAX_BLK_SEGS 11 typedef struct blk_ring_req_entry { unsigned long id; /* private guest os value */ - unsigned long sector_number; /* start sector idx on disk */ unsigned short device; /* XENDEV_??? + idx */ unsigned char operation; /* XEN_BLOCK_??? */ unsigned char nr_segments; /* number of segments */ + xen_sector_t sector_number; /* start sector idx on disk */ /* Least 9 bits is 'nr_sects'. High 23 bits are the address. */ unsigned long buffer_and_sects[MAX_BLK_SEGS]; } blk_ring_req_entry_t; @@ -97,7 +100,7 @@ typedef struct xen_disk { unsigned short device; /* device number (opaque 16 bit val) */ unsigned short info; /* device type and flags */ - unsigned long capacity; /* size in terms of #512 byte sectors */ + xen_sector_t capacity; /* size in terms of #512 byte sectors */ domid_t domain; /* if a VBD, domain this 'belongs to' */ } xen_disk_t; diff --git a/xen/include/hypervisor-ifs/vbd.h b/xen/include/hypervisor-ifs/vbd.h index a16d1253de..adf24e9682 100644 --- a/xen/include/hypervisor-ifs/vbd.h +++ b/xen/include/hypervisor-ifs/vbd.h @@ -18,10 +18,10 @@ #define BLOCK_IO_OP_VBD_INFO 9 /* query info about a particular VBD */ typedef struct _xen_extent { - u16 device; - u16 unused; - ulong start_sector; - ulong nr_sectors; + u16 device; + u16 unused; + xen_sector_t start_sector; + xen_sector_t nr_sectors; } xen_extent_t; #define VBD_MODE_R 0x1 diff --git a/xen/include/xeno/vbd.h b/xen/include/xeno/vbd.h index 6f1b6a04e5..3c6a2de88d 100644 --- a/xen/include/xeno/vbd.h +++ b/xen/include/xeno/vbd.h @@ -57,8 +57,8 @@ void destroy_all_vbds(struct task_struct *p); typedef struct { unsigned short dev; unsigned short nr_sects; - unsigned long sector_number; unsigned long buffer; + xen_sector_t sector_number; } phys_seg_t; diff --git a/xen/net/dev.c b/xen/net/dev.c index 48c7a58295..afa85895ec 100644 --- a/xen/net/dev.c +++ b/xen/net/dev.c @@ -2064,7 +2064,7 @@ static void get_rx_bufs(net_vif_t *vif) if ( unlikely(pte_pfn >= max_page) || unlikely(!get_page_and_type(pte_page, p, PGT_l1_page_table)) ) { - DPRINTK("Bad page frame for ppte %d,%08lx,%08lx,%08lx\n", + DPRINTK("Bad page frame for ppte %llu,%08lx,%08lx,%08lx\n", p->domain, pte_pfn, max_page, pte_page->type_and_flags); make_rx_response(vif, rx.id, 0, RING_STATUS_BAD_PAGE, 0); continue; diff --git a/xenolinux-2.4.24-sparse/arch/xeno/drivers/block/xl_block.c b/xenolinux-2.4.24-sparse/arch/xeno/drivers/block/xl_block.c index 4be2f56e6a..2f6bfe5fd4 100644 --- a/xenolinux-2.4.24-sparse/arch/xeno/drivers/block/xl_block.c +++ b/xenolinux-2.4.24-sparse/arch/xeno/drivers/block/xl_block.c @@ -366,7 +366,7 @@ static int hypervisor_request(unsigned long id, req = &blk_ring->ring[MASK_BLK_IDX(req_prod)].req; req->id = id; req->operation = operation; - req->sector_number = sector_number; + req->sector_number = (xen_sector_t)sector_number; req->device = device; req->nr_segments = 1; req->buffer_and_sects[0] = buffer_ma | nr_sectors; diff --git a/xenolinux-2.4.24-sparse/arch/xeno/drivers/block/xl_vbd.c b/xenolinux-2.4.24-sparse/arch/xeno/drivers/block/xl_vbd.c index 77a3f0e401..61f232acb9 100644 --- a/xenolinux-2.4.24-sparse/arch/xeno/drivers/block/xl_vbd.c +++ b/xenolinux-2.4.24-sparse/arch/xeno/drivers/block/xl_vbd.c @@ -102,6 +102,7 @@ static int xlvbd_init_device(xen_disk_t *xd) struct block_device *bd; xl_disk_t *disk; int i, rc = 0, max_part, partno; + unsigned long capacity; unsigned char buf[64]; @@ -237,6 +238,9 @@ static int xlvbd_init_device(xen_disk_t *xd) gd->flags[minor >> gd->minor_shift] |= GENHD_FL_XENO; + /* NB. Linux 2.4 only handles 32-bit sector offsets and capacities. */ + capacity = (unsigned long)xd->capacity; + if ( partno != 0 ) { /* @@ -268,15 +272,15 @@ static int xlvbd_init_device(xen_disk_t *xd) /* Need to skankily setup 'partition' information */ gd->part[minor].start_sect = 0; - gd->part[minor].nr_sects = xd->capacity; - gd->sizes[minor] = xd->capacity; + gd->part[minor].nr_sects = capacity; + gd->sizes[minor] = capacity; gd->flags[minor >> gd->minor_shift] |= GENHD_FL_VIRT_PARTNS; } else { - gd->part[minor].nr_sects = xd->capacity; - gd->sizes[minor] = xd->capacity>>(BLOCK_SIZE_BITS-9); + gd->part[minor].nr_sects = capacity; + gd->sizes[minor] = capacity>>(BLOCK_SIZE_BITS-9); /* Some final fix-ups depending on the device type */ switch ( XD_TYPE(xd->info) ) @@ -301,8 +305,7 @@ static int xlvbd_init_device(xen_disk_t *xd) disk_name(gd, MINOR(device), buf)); break; } - register_disk(gd, device, gd->max_p, &xlvbd_block_fops, - xd->capacity); + register_disk(gd, device, gd->max_p, &xlvbd_block_fops, capacity); break; default: |