diff --git a/.rootkeys b/.rootkeys index 6c0a76071c..4bfb84abd1 100644 --- a/.rootkeys +++ b/.rootkeys @@ -218,6 +218,7 @@ 41062ab7HMSSuaUv3_Z4agLpjSO88A linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/mach-xen/pci-functions.h 40f5623aDMCsWOFO0jktZ4e8sjwvEg linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/mach-xen/setup_arch_post.h 40f5623arsFXkGdPvIqvFi3yFXGR0Q linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/mach-xen/setup_arch_pre.h +4120f807GCO0uqsLqdZj9csxR1Wthw linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/mmu_context.h 40f5623aFTyFTR-vdiA-KaGxk5JOKQ linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/msr.h 40f5623adgjZq9nAgCt0IXdWl7udSA linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/page.h 40f5623a54NuG-7qHihGYmw4wWQnMA linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/param.h @@ -442,6 +443,7 @@ 40cf2937Z8WCNOnO2FcWdubvEAF9QQ tools/python/xen/xm/shutdown.py 40fcefb2K1xqVVT4D-p7nL2GzS4scg tools/sv/Main.rpy 40ffbcb66Dj5F-1kCK9BcgSqCWkt1w tools/sv/Makefile +4120b0e5L_nW-u0MWRfIdXg4ng4OjA tools/sv/images/destroy.png 4107c921_OR9NTSv2dKFiLCXxrXoxA tools/sv/images/finish.png 40fcefb3wXQMsl9WkgQAVtdrupm4sw tools/sv/images/left-end-highlight.jpg 40fcefb3K6ESt5sQhD9aCQRscQIlXQ tools/sv/images/left-end-no-highlight.jpg @@ -459,6 +461,9 @@ 40fcefb3dgsa24WLk_BJeYQHrDLuOg tools/sv/images/seperator-right-highlight.jpg 40fcefb3FtiX4Pd2kT8wDlp8u8xRhQ tools/sv/images/seperator.jpg 41013a82sUdUqBv8EoAUJii3gsZ-4g tools/sv/images/shutdown.png +4120b0e5RyNoIQNMjUs4A2kshovjaQ tools/sv/images/small-destroy.png +4120b0e6vW66wW6WvjQyFD0AZH2tng tools/sv/images/small-pause.png +4120b0e6USof7ieyGxEvtCdTMpxaQw tools/sv/images/small-unpause.png 4104ffca-jPHLVOrW0n0VghEXXtKxg tools/sv/images/unpause.png 40fcefb3yMSrZvApO9ToIi-iQwnchA tools/sv/images/xen.png 41013a83z27rKvWIxAfUBMVZ1eDCDg tools/sv/inc/script.js @@ -682,6 +687,7 @@ 404f1bc7IwU-qnH8mJeVu0YsNGMrcw xen/include/hypervisor-ifs/arch-x86_64.h 3ddb79c2PMeWTK86y4C3F4MzHw4A1g xen/include/hypervisor-ifs/dom0_ops.h 403cd194j2pyLqXD8FJ-ukvZzkPenw xen/include/hypervisor-ifs/event_channel.h +4121d149udGfSUGhn3k1ECz0bM31nQ xen/include/hypervisor-ifs/grant_table.h 3ddb79c25UE59iu4JJcbRalx95mvcg xen/include/hypervisor-ifs/hypervisor-if.h 40f5623bqoi4GEoBiiUc6TZk1HjsMg xen/include/hypervisor-ifs/io/blkif.h 40dc4076pVeE1kEEWzcUaNZin65kCA xen/include/hypervisor-ifs/io/domain_controller.h diff --git a/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/process.c b/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/process.c index da60123dfd..f519ba1c5e 100644 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/process.c +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/process.c @@ -502,10 +502,10 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas *next = &next_p->thread; int cpu = smp_processor_id(); struct tss_struct *tss = init_tss + cpu; - unsigned long flags; dom0_op_t op; - local_irq_save(flags); + /* NB. No need to disable interrupts as already done in sched.c */ + /* __cli(); */ /* * Save away %fs and %gs. No need to save %es and %ds, as @@ -569,8 +569,7 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas /* EXECUTE ALL TASK SWITCH XEN SYSCALLS AT THIS POINT. */ execute_multicall_list(); - - local_irq_restore(flags); + /* __sti(); */ /* * Restore %fs and %gs if needed. diff --git a/linux-2.6.7-xen-sparse/arch/xen/i386/mm/mmap.c b/linux-2.6.7-xen-sparse/arch/xen/i386/mm/mmap.c index d3ffc00d9c..b55742967e 100644 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/mm/mmap.c +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/mm/mmap.c @@ -27,7 +27,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) start_addr = addr = mm->free_area_cache; #else - addr = PAGE_ALIGN(TASK_UNMAPPED_BASE); + start_addr = addr = PAGE_ALIGN(TASK_UNMAPPED_BASE); #endif full_search: @@ -61,7 +61,10 @@ unsigned long arch_check_fixed_mapping(struct file *filp, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags) { - if ( addr < (FIRST_USER_PGD_NR<comm, addr, len); return -EINVAL; + } return 0; } diff --git a/linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c b/linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c index 0a0046c86a..1a92d7d8b7 100644 --- a/linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c +++ b/linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c @@ -49,15 +49,6 @@ static int recovery = 0; /* "Recovery in progress" flag. Protected #define BLKIF_RING_FULL (((req_prod - resp_cons) == BLKIF_RING_SIZE) || \ (blkif_state != BLKIF_STATE_CONNECTED)) -/* - * Request queues with outstanding work, but ring is currently full. - * We need no special lock here, as we always access this with the - * blkif_io_lock held. We only need a small maximum list. - */ -#define MAX_PENDING 8 -static request_queue_t *pending_queues[MAX_PENDING]; -static int nr_pending; - static inline void translate_req_to_mfn(blkif_request_t *xreq, blkif_request_t *req); @@ -99,6 +90,23 @@ static inline void ADD_ID_TO_FREELIST( unsigned long id ) __initcall(xlblk_init); + +static void kick_pending_request_queues(void) +{ + + if ( (xlbd_blk_queue != NULL) && + test_bit(QUEUE_FLAG_STOPPED, &xlbd_blk_queue->queue_flags) ) + { + blk_start_queue(xlbd_blk_queue); + /* XXXcl call to request_fn should not be needed but + * we get stuck without... needs investigating + */ + xlbd_blk_queue->request_fn(xlbd_blk_queue); + } + +} + + int blkif_open(struct inode *inode, struct file *filep) { struct gendisk *gd = inode->i_bdev->bd_disk; @@ -244,7 +252,7 @@ static int blkif_queue_request(struct request *req) id = GET_ID_FROM_FREELIST(); rec_ring[id].id = (unsigned long) req; -//printk("r: %d req %p (%ld)\n",req_prod,req,id); +//printk(KERN_ALERT"r: %d req %p (%ld)\n",req_prod,req,id); ring_req->id = id; ring_req->operation = rq_data_dir(req) ? BLKIF_OP_WRITE : @@ -291,6 +299,8 @@ void do_blkif_request(request_queue_t *rq) DPRINTK("Entered do_blkif_request\n"); +//printk(KERN_ALERT"r: %d req\n",req_prod); + queued = 0; while ((req = elv_next_request(rq)) != NULL) { @@ -347,7 +357,7 @@ static irqreturn_t blkif_int(int irq, void *dev_id, struct pt_regs *ptregs) id = bret->id; req = (struct request *)rec_ring[id].id; -//printk("i: %d req %p (%ld)\n",i,req,id); +//printk(KERN_ALERT"i: %d req %p (%ld)\n",i,req,id); ADD_ID_TO_FREELIST(id); // overwrites req @@ -378,15 +388,7 @@ static irqreturn_t blkif_int(int irq, void *dev_id, struct pt_regs *ptregs) resp_cons = i; - if ( (xlbd_blk_queue != NULL) && - test_bit(QUEUE_FLAG_STOPPED, &xlbd_blk_queue->queue_flags) ) - { - blk_start_queue(xlbd_blk_queue); - /* XXXcl call to request_fn should not be needed but - * we get stuck without... needs investigating - */ - xlbd_blk_queue->request_fn(xlbd_blk_queue); - } + kick_pending_request_queues(); spin_unlock_irqrestore(&blkif_io_lock, flags); @@ -400,6 +402,16 @@ static kdev_t sg_dev; static int sg_operation = -1; static unsigned long sg_next_sect; +/* + * Request queues with outstanding work, but ring is currently full. + * We need no special lock here, as we always access this with the + * blkif_io_lock held. We only need a small maximum list. + */ +#define MAX_PENDING 8 +static request_queue_t *pending_queues[MAX_PENDING]; +static int nr_pending; + + #define DISABLE_SCATTERGATHER() (sg_operation = -1) #define blkif_io_lock io_request_lock @@ -418,6 +430,18 @@ static void update_vbds_task(void *unused) } #endif +static void kick_pending_request_queues(void) +{ + /* We kick pending request queues if the ring is reasonably empty. */ + if ( (nr_pending != 0) && + ((req_prod - resp_cons) < (BLKIF_RING_SIZE >> 1)) ) + { + /* Attempt to drain the queue, but bail if the ring becomes full. */ + while ( (nr_pending != 0) && !BLKIF_RING_FULL ) + do_blkif_request(pending_queues[--nr_pending]); + } +} + int blkif_open(struct inode *inode, struct file *filep) { short xldev = inode->i_rdev; @@ -949,24 +973,13 @@ static inline void translate_req_to_mfn(blkif_request_t *xreq, static inline void flush_requests(void) { DISABLE_SCATTERGATHER(); +//printk(KERN_ALERT"flush %d\n",req_prod); wmb(); /* Ensure that the frontend can see the requests. */ blk_ring->req_prod = req_prod; notify_via_evtchn(blkif_evtchn); } -static void kick_pending_request_queues(void) -{ - /* We kick pending request queues if the ring is reasonably empty. */ - if ( (nr_pending != 0) && - ((req_prod - resp_cons) < (BLKIF_RING_SIZE >> 1)) ) - { - /* Attempt to drain the queue, but bail if the ring becomes full. */ - while ( (nr_pending != 0) && !BLKIF_RING_FULL ) - do_blkif_request(pending_queues[--nr_pending]); - } -} - void blkif_control_send(blkif_request_t *req, blkif_response_t *rsp) { unsigned long flags, id; @@ -1016,6 +1029,7 @@ static void blkif_status_change(blkif_fe_interface_status_changed_t *status) { ctrl_msg_t cmsg; blkif_fe_interface_connect_t up; + long rc; if ( status->handle != 0 ) { @@ -1075,11 +1089,13 @@ static void blkif_status_change(blkif_fe_interface_status_changed_t *status) " in state %d\n", blkif_state); break; } - blkif_evtchn = status->evtchn; blkif_irq = bind_evtchn_to_irq(blkif_evtchn); - (void)request_irq(blkif_irq, blkif_int, - SA_SAMPLE_RANDOM, "blkif", NULL); + if ( (rc=request_irq(blkif_irq, blkif_int, + SA_SAMPLE_RANDOM, "blkif", NULL)) ) + { + printk(KERN_ALERT"blkfront request_irq failed (%ld)\n",rc); + } if ( recovery ) { diff --git a/linux-2.6.7-xen-sparse/drivers/xen/netfront/netfront.c b/linux-2.6.7-xen-sparse/drivers/xen/netfront/netfront.c index 7a9cfed29e..118577ef3e 100644 --- a/linux-2.6.7-xen-sparse/drivers/xen/netfront/netfront.c +++ b/linux-2.6.7-xen-sparse/drivers/xen/netfront/netfront.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -427,9 +428,7 @@ static int netif_poll(struct net_device *dev, int *pbudget) */ if ( unlikely(rx->status <= 0) ) { - /* Gate this error. We get a (valid) slew of them on suspend. */ - if ( np->user_state == UST_OPEN ) - printk(KERN_ALERT "bad buffer on RX ring!(%d)\n", rx->status); + printk(KERN_ALERT "bad buffer on RX ring!(%d)\n", rx->status); np->rx->ring[MASK_NETIF_RX_IDX(np->rx->req_prod)].req.id = rx->id; wmb(); np->rx->req_prod++; @@ -470,6 +469,15 @@ static int netif_poll(struct net_device *dev, int *pbudget) mcl->args[2] = 0; mcl++; (void)HYPERVISOR_multicall(rx_mcl, mcl - rx_mcl); + +#if 0 + if (unlikely(rx_mcl[0].args[5] != 0)) + printk(KERN_ALERT"Hypercall0 failed %u\n",np->rx->resp_prod); + + if (unlikely(rx_mcl[1].args[5] != 0)) + printk(KERN_ALERT"Hypercall1 failed %u\n",np->rx->resp_prod); +#endif + } while ( (skb = __skb_dequeue(&rxq)) != NULL ) @@ -595,6 +603,7 @@ static void network_connect(struct net_device *dev, printk(KERN_ALERT"Netfront recovered tx=%d rxfree=%d\n", np->tx->req_prod,np->rx->req_prod); + /* Step 3: All public and private state should now be sane. Get * ready to start sending and receiving packets and give the driver * domain a kick because we've probably just requeued some @@ -712,7 +721,6 @@ static void netif_status_change(netif_fe_interface_status_changed_t *status) np->irq = bind_evtchn_to_irq(np->evtchn); (void)request_irq(np->irq, netif_int, SA_SAMPLE_RANDOM, dev->name, dev); - netctrl_connected_count(); break; @@ -897,10 +905,9 @@ void netif_suspend(void) sprintf(name,"eth%d",i); dev = __dev_get_by_name(name); - if ( dev && (dev->flags & IFF_UP) ) + if ( dev ) { np = dev->priv; - free_irq(np->irq, dev); unbind_evtchn_from_irq(np->evtchn); } @@ -932,6 +939,9 @@ void netif_resume(void) // stop bad things from happening until we're back up np->backend_state = BEST_DISCONNECTED; + + memset(np->tx,0,PAGE_SIZE); + memset(np->rx,0,PAGE_SIZE); cmsg.type = CMSG_NETIF_FE; cmsg.subtype = CMSG_NETIF_FE_INTERFACE_CONNECT; diff --git a/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/mmu_context.h b/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/mmu_context.h new file mode 100644 index 0000000000..cea0fd614c --- /dev/null +++ b/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/mmu_context.h @@ -0,0 +1,75 @@ +#ifndef __I386_SCHED_H +#define __I386_SCHED_H + +#include +#include +#include +#include +#include + +/* + * Used for LDT copy/destruction. + */ +int init_new_context(struct task_struct *tsk, struct mm_struct *mm); +void destroy_context(struct mm_struct *mm); + + +static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) +{ +#ifdef CONFIG_SMP + unsigned cpu = smp_processor_id(); + if (cpu_tlbstate[cpu].state == TLBSTATE_OK) + cpu_tlbstate[cpu].state = TLBSTATE_LAZY; +#endif +} + +static inline void switch_mm(struct mm_struct *prev, + struct mm_struct *next, + struct task_struct *tsk) +{ + int cpu = smp_processor_id(); + + if (likely(prev != next)) { + /* stop flush ipis for the previous mm */ + cpu_clear(cpu, prev->cpu_vm_mask); +#ifdef CONFIG_SMP + cpu_tlbstate[cpu].state = TLBSTATE_OK; + cpu_tlbstate[cpu].active_mm = next; +#endif + cpu_set(cpu, next->cpu_vm_mask); + + /* Re-load page tables */ + load_cr3_noflush(next->pgd); + + /* + * load the LDT, if the LDT is different: + */ + if (unlikely(prev->context.ldt != next->context.ldt)) + load_LDT_nolock(&next->context, cpu); + } +#ifdef CONFIG_SMP + else { + cpu_tlbstate[cpu].state = TLBSTATE_OK; + BUG_ON(cpu_tlbstate[cpu].active_mm != next); + + if (!cpu_test_and_set(cpu, next->cpu_vm_mask)) { + /* We were in lazy tlb mode and leave_mm disabled + * tlb flush IPI delivery. We must reload %cr3. + */ + load_cr3_noflush(next->pgd); + load_LDT_nolock(&next->context, cpu); + } + } +#endif +} + +#define deactivate_mm(tsk, mm) \ + asm("movl %0,%%fs ; movl %0,%%gs": :"r" (0)) + +#define activate_mm(prev, next) \ +do { \ + switch_mm((prev),(next),NULL); \ + flush_page_update_queue(); \ +} while ( 0 ) + +#endif diff --git a/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/processor.h b/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/processor.h index a57533dd8a..b4eafd19f7 100644 --- a/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/processor.h +++ b/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/processor.h @@ -186,6 +186,11 @@ static inline unsigned int cpuid_edx(unsigned int op) cur_pgd = pgdir; /* XXXsmp */ \ } while (/* CONSTCOND */0) +#define load_cr3_noflush(pgdir) do { \ + queue_pt_switch(__pa(pgdir)); \ + cur_pgd = pgdir; /* XXXsmp */ \ +} while (/* CONSTCOND */0) + /* * Intel CPU features in CR4 diff --git a/linux-2.6.7-xen-sparse/include/asm-xen/hypervisor.h b/linux-2.6.7-xen-sparse/include/asm-xen/hypervisor.h index 5b89913a81..a3b180ecb8 100644 --- a/linux-2.6.7-xen-sparse/include/asm-xen/hypervisor.h +++ b/linux-2.6.7-xen-sparse/include/asm-xen/hypervisor.h @@ -21,7 +21,7 @@ /* arch/xen/i386/kernel/setup.c */ union start_info_union { - extended_start_info_t start_info; + start_info_t start_info; char padding[512]; }; extern union start_info_union start_info_union; @@ -374,7 +374,8 @@ static inline int HYPERVISOR_dom_mem_op(unsigned int op, __asm__ __volatile__ ( TRAP_INSTR : "=a" (ret) : "0" (__HYPERVISOR_dom_mem_op), - "b" (op), "c" (extent_list), "d" (nr_extents), "S" (extent_order) + "b" (op), "c" (extent_list), "d" (nr_extents), "S" (extent_order), + "D" (DOMID_SELF) : "memory" ); return ret; diff --git a/linux-2.6.7-xen-sparse/include/asm-xen/suspend.h b/linux-2.6.7-xen-sparse/include/asm-xen/suspend.h index 0a9c8e74a9..937137f005 100644 --- a/linux-2.6.7-xen-sparse/include/asm-xen/suspend.h +++ b/linux-2.6.7-xen-sparse/include/asm-xen/suspend.h @@ -12,7 +12,7 @@ typedef struct suspend_record_st { /* To be filled in before resume. */ - extended_start_info_t resume_info; + start_info_t resume_info; /* * The number of a machine frame containing, in sequence, the number of * each machine frame that contains PFN -> MFN translation table data. diff --git a/tools/libxc/xc_linux_build.c b/tools/libxc/xc_linux_build.c index 39dd6c3d08..c272ecb2c2 100644 --- a/tools/libxc/xc_linux_build.c +++ b/tools/libxc/xc_linux_build.c @@ -85,7 +85,7 @@ static int setup_guestos(int xc_handle, unsigned long l2tab; unsigned long l1tab; unsigned long count, i; - extended_start_info_t *start_info; + start_info_t *start_info; shared_info_t *shared_info; mmu_t *mmu = NULL; void *pm_handle=NULL; diff --git a/tools/libxc/xc_linux_restore.c b/tools/libxc/xc_linux_restore.c index 31c9924bfd..6d4f0906aa 100644 --- a/tools/libxc/xc_linux_restore.c +++ b/tools/libxc/xc_linux_restore.c @@ -504,6 +504,54 @@ printf("XXXXXXXXXXXXXXX pin L2\n"); xcio_info(ioctxt, "\b\b\b\b100%%\nMemory reloaded.\n"); + /* Get the list of PFNs that are not in the psuedo-phys map */ + { + unsigned int count, *pfntab; + int rc; + if ( xcio_read(ioctxt, &count, sizeof(count)) ) + { + xcio_error(ioctxt, "Error when reading from state file"); + goto out; + } + + pfntab = malloc( sizeof(unsigned int) * count ); + if ( !pfntab ) + { + xcio_error(ioctxt, "Out of memory"); + goto out; + } + + if ( xcio_read(ioctxt, pfntab, sizeof(unsigned int)*count) ) + { + xcio_error(ioctxt, "Error when reading pfntab from state file"); + goto out; + } + + for(i=0;i0 ) + { + if ( (rc = do_dom_mem_op( xc_handle, + MEMOP_decrease_reservation, + pfntab, count, 0, dom )) <0 ) + { + xcio_error(ioctxt, "Could not decrease reservation : %d",rc); + goto out; + } + else + { + printf("Decreased reservation by %d pages\n", count); + } + } + + } + + if ( xcio_read(ioctxt, &ctxt, sizeof(ctxt)) || xcio_read(ioctxt, shared_info, PAGE_SIZE) ) diff --git a/tools/libxc/xc_linux_save.c b/tools/libxc/xc_linux_save.c index c3089955c9..5a47b30f56 100644 --- a/tools/libxc/xc_linux_save.c +++ b/tools/libxc/xc_linux_save.c @@ -463,10 +463,6 @@ int xc_linux_save(int xc_handle, XcIOContext *ioctxt) goto out; } - printf("SUSPPPPPPPP flags %08lx shinfo %08lx eip %08lx esi %08lx\n", - op.u.getdomaininfo.flags, op.u.getdomaininfo.shared_info_frame, - ctxt.cpu_ctxt.eip, ctxt.cpu_ctxt.esi ); - } /* calculate the power of 2 order of nr_pfns, e.g. @@ -866,9 +862,41 @@ printf("type fail: page %i mfn %08lx\n",j,pfn_type[j]); goto out; } -printf("SUSPPPPPPPP flags %08lx shinfo %08lx eip %08lx esi %08lx\n", - op.u.getdomaininfo.flags, op.u.getdomaininfo.shared_info_frame, - ctxt.cpu_ctxt.eip, ctxt.cpu_ctxt.esi ); + /* Send through a list of all the PFNs that were not in map at the close */ + { + unsigned int i,j; + unsigned int pfntab[1024]; + + for ( i = 0, j = 0; i < nr_pfns; i++ ) + { + if ( live_pfn_to_mfn_table[i] >= 0x80000000UL ) + j++; + } + + if ( xcio_write(ioctxt, &j, sizeof(unsigned int)) ) + { + xcio_error(ioctxt, "Error when writing to state file (6a)"); + goto out; + } + + for ( i = 0, j = 0; i < nr_pfns; ) + { + if ( live_pfn_to_mfn_table[i] >= 0x80000000UL ) + { + pfntab[j++] = i; + } + i++; + if ( j == 1024 || i == nr_pfns ) + { + if ( xcio_write(ioctxt, &pfntab, sizeof(unsigned long)*j) ) + { + xcio_error(ioctxt, "Error when writing to state file (6b)"); + goto out; + } + j = 0; + } + } + } /* Map the suspend-record MFN to pin it. The page must be owned by domid for this to succeed. */ diff --git a/tools/libxc/xc_netbsd_build.c b/tools/libxc/xc_netbsd_build.c index 41adfa935a..e113726551 100644 --- a/tools/libxc/xc_netbsd_build.c +++ b/tools/libxc/xc_netbsd_build.c @@ -73,7 +73,7 @@ static int setup_guestos(int xc_handle, unsigned long l1tab; unsigned long count, pt_start; unsigned long symtab_addr = 0, symtab_len = 0; - extended_start_info_t *start_info; + start_info_t *start_info; shared_info_t *shared_info; unsigned long ksize; mmu_t *mmu = NULL; diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h index 3d0572501b..d70f7df58a 100644 --- a/tools/libxc/xc_private.h +++ b/tools/libxc/xc_private.h @@ -127,6 +127,42 @@ static inline int do_multicall_op(int xc_handle, out1: return ret; } + +static inline int do_dom_mem_op(int xc_handle, + unsigned int memop, + unsigned int *extent_list, + unsigned int nr_extents, + unsigned int extent_order, + domid_t domid) +{ + privcmd_hypercall_t hypercall; + long ret = -EINVAL; + + hypercall.op = __HYPERVISOR_dom_mem_op; + hypercall.arg[0] = (unsigned long)memop; + hypercall.arg[1] = (unsigned long)extent_list; + hypercall.arg[2] = (unsigned long)nr_extents; + hypercall.arg[3] = (unsigned long)extent_order; + hypercall.arg[4] = (unsigned long)domid; + + if ( mlock(extent_list, nr_extents*sizeof(unsigned long)) != 0 ) + { + PERROR("Could not lock memory for Xen hypercall"); + goto out1; + } + + if ( (ret = do_xen_hypercall(xc_handle, &hypercall)) < 0 ) + { + fprintf(stderr, "Dom_mem operation failed (rc=%ld errno=%d)-- need to" + " rebuild the user-space tool set?\n",ret,errno); + goto out2; + } + + out2: (void)munlock(extent_list, nr_extents*sizeof(unsigned long)); + out1: return ret; +} + + /* * PFN mapping. */ diff --git a/tools/python/xen/sv/CreateDomain.py b/tools/python/xen/sv/CreateDomain.py index b4fd52f0e8..77237a3a47 100644 --- a/tools/python/xen/sv/CreateDomain.py +++ b/tools/python/xen/sv/CreateDomain.py @@ -25,6 +25,7 @@ class CreatePage0( Sheet ): self.addControl( InputControl( 'name', 'VM Name', 'VM Name:', "[\\w|\\S]+", "You must enter a name in this field" ) ) self.addControl( InputControl( 'memory', '64', 'Memory (Mb):', "[\\d]+", "You must enter a number in this field" ) ) self.addControl( InputControl( 'cpu', '0', 'CPU:', "[\\d]+", "You must enter a number in this feild" ) ) + self.addControl( InputControl( 'cpu_weight', '1', 'CPU Weight:', "[\\d]+", "You must enter a number in this feild" ) ) class CreatePage1( Sheet ): @@ -83,9 +84,16 @@ class CreateFinish( Sheet ): xend_sxp = self.translate_sxp( string2sxp( self.passback ) ) - dom_sxp = server.xend_domain_create( xend_sxp ) + try: + dom_sxp = server.xend_domain_create( xend_sxp ) + success = "Your domain was successfully created.\n" + except: + success = "There was an error creating your domain.\nThe configuration used is as follows:\n" + dom_sxp = xend_sxp + + - pt = PreTab( sxp2prettystring( dom_sxp ) ) + pt = PreTab( success + sxp2prettystring( dom_sxp ) ) pt.write_BODY( request ) request.write( "

" % self.passback ) @@ -106,6 +114,7 @@ class CreateFinish( Sheet ): vals.name = get( 'name' ) vals.memory = get( 'memory' ) vals.cpu = get( 'cpu' ) + vals.cpu_weight = get( 'cpu_weight' ) vals.builder = get( 'builder' ) vals.kernel = get( 'kernel' ) @@ -121,7 +130,7 @@ class CreateFinish( Sheet ): vals.disk = vbds - #misc crap + #misc vals.pci = [] @@ -145,4 +154,8 @@ class CreateFinish( Sheet ): vals.cmdline_ip = "%s:%s:%s:%s:%s:eth0:%s" % (ip, nfs, gate, mask, host, dhcp) - return make_config( vals ) + try: + return make_config( vals ) + except: + return [["Error creating domain config."]] + diff --git a/tools/python/xen/sv/DomInfo.py b/tools/python/xen/sv/DomInfo.py index 6f8ac1ab5b..3e4fb70b13 100755 --- a/tools/python/xen/sv/DomInfo.py +++ b/tools/python/xen/sv/DomInfo.py @@ -5,6 +5,8 @@ from xen.sv.HTMLBase import HTMLBase from xen.sv.util import * from xen.sv.GenTabbed import * +DEBUG=1 + class DomInfo( GenTabbed ): def __init__( self, urlWriter ): @@ -76,8 +78,11 @@ class DomSXPTab( PreTab ): request.write( "

Please Select a Domain

" ) return None - domInfo = server.xend_domain( self.dom ) - + try: + domInfo = server.xend_domain( self.dom ) + except: + domInfo = [["Error getting domain details."]] + self.source = sxp2prettystring( domInfo ) PreTab.write_BODY( self, request ) @@ -88,32 +93,54 @@ class DomActionTab( ActionTab ): actions = { "shutdown" : ( "Shutdown the Domain", "shutdown.png" ), "reboot" : ( "Reboot the Domain", "reboot.png" ), "pause" : ( "Pause the Domain", "pause.png" ), - "unpause" : ( "Unpause the Domain", "unpause.png" ) } + "unpause" : ( "Unpause the Domain", "unpause.png" ), + "destroy" : ( "Destroy the Domain", "destroy.png" ) } ActionTab.__init__( self, actions ) def op_shutdown( self, request ): dom = getVar( 'dom', request ) - if not dom is None: - print ">DomShutDown %s" % dom - #server.xend_node_shutdown() + if not dom is None and dom != '0': + if DEBUG: print ">DomShutDown %s" % dom + try: + server.xend_domain_shutdown( int( dom ), "halt" ) + except: + pass def op_reboot( self, request ): dom = getVar( 'dom', request ) - if not dom is None: - print ">DomReboot %s" % dom - #server.xend_node_reboot() - + if not dom is None and dom != '0': + if DEBUG: print ">DomReboot %s" % dom + try: + server.xend_domain_shutdown( int( dom ), "reboot" ) + except: + pass + def op_pause( self, request ): dom = getVar( 'dom', request ) - if not dom is None: - print ">DomPause %s" % dom - server.xend_domain_pause( int( dom ) ) - + if not dom is None and dom != '0': + if DEBUG: print ">DomPause %s" % dom + try: + server.xend_domain_pause( int( dom ) ) + except: + pass + def op_unpause( self, request ): dom = getVar( 'dom', request ) - if not dom is None: - print ">DomUnpause %s" % dom - server.xend_domain_unpause( int( dom ) ) + if not dom is None and dom != '0': + if DEBUG: print ">DomUnpause %s" % dom + try: + server.xend_domain_unpause( int( dom ) ) + except: + pass + + def op_destroy( self, request ): + dom = getVar( 'dom', request ) + if not dom is None and dom != '0': + if DEBUG: print ">DomDestroy %s" % dom + try: + server.xend_domain_destroy( int( dom ), "halt" ) + except: + pass diff --git a/tools/python/xen/sv/DomList.py b/tools/python/xen/sv/DomList.py index faed020b05..d6e123143e 100755 --- a/tools/python/xen/sv/DomList.py +++ b/tools/python/xen/sv/DomList.py @@ -17,9 +17,14 @@ class DomList( HTMLBase ): def write_BODY( self, request, head=True, long=True ): - domains = map(int, server.xend_domains()) - domains.sort() + domains = None + try: + domains = server.xend_domains() + domains.sort() + except: + pass + request.write( "\n\n" ) if head: @@ -29,28 +34,42 @@ class DomList( HTMLBase ): odd = True - for domain in domains: - if odd: - request.write( "\n" ) - odd = False - else: - request.write( "\n" ) - odd = True - self.write_DOMAIN( request, getDomInfoHash( domain ), long ) - request.write( "\n" ) - + if not domains is None: + for domain in domains: + if odd: + request.write( "\n" ) + odd = False + else: + request.write( "\n" ) + odd = True + self.write_DOMAIN( request, getDomInfoHash( domain ), long ) + request.write( "\n" ) + else: + request.write( "

Error getting domain list
Perhaps XenD not running?

") + request.write( "
\n" ) def write_DOMAIN( self, request, domInfoHash, long=True ): - request.write( "%(dom)-4d\n" % domInfoHash ) + request.write( "%(id)s\n" % domInfoHash ) - url = self.urlWriter( "&mod=info&dom=%(dom)-4d" % domInfoHash ) + url = self.urlWriter( "&mod=info&dom=%(id)s" % domInfoHash ) request.write( "%s\n" % ( url, domInfoHash['name'] ) ) if long: request.write( "%(memory)5s\n" % domInfoHash ) request.write( "%(cpu)2s\n" % domInfoHash ) request.write( "%(state)5s\n" % domInfoHash ) + if domInfoHash[ 'id' ] != "0": + request.write( "" ) + + if domInfoHash[ 'state' ][ 2 ] == "-": + request.write( "" % domInfoHash ) + else: + request.write( "" % domInfoHash ) + + request.write( "" % domInfoHash) + else: + request.write( " " ) def write_DOMAIN_HEAD( self, request, long=True ): request.write( "Domain\n" ) @@ -59,4 +78,4 @@ class DomList( HTMLBase ): request.write( "Memory / Mb\n" ) request.write( "CPU\n" ) request.write( "State\n" ) - + request.write( "\n" ) diff --git a/tools/python/xen/sv/HTMLBase.py b/tools/python/xen/sv/HTMLBase.py index 10d860e0c4..e67784d558 100755 --- a/tools/python/xen/sv/HTMLBase.py +++ b/tools/python/xen/sv/HTMLBase.py @@ -1,4 +1,5 @@ from twisted.web.resource import Resource +from xen.sv.util import * class HTMLBase( Resource ): @@ -28,6 +29,7 @@ class HTMLBase( Resource ): def write_BOTTOM( self, request ): request.write('') + request.write('') request.write('') request.write( "" ) diff --git a/tools/python/xen/sv/Main.py b/tools/python/xen/sv/Main.py index bf6119c600..2362287c50 100755 --- a/tools/python/xen/sv/Main.py +++ b/tools/python/xen/sv/Main.py @@ -4,6 +4,8 @@ from xen.sv.NodeInfo import NodeInfo from xen.sv.DomInfo import DomInfo from xen.sv.CreateDomain import CreateDomain +from xen.xend.XendClient import server + from xen.sv.util import getVar class Main( HTMLBase ): @@ -20,14 +22,18 @@ class Main( HTMLBase ): def render_POST( self, request ): #decide what module post'd the action + + args = getVar( 'args', request ) mod = getVar( 'mod', request ) - if not mod is None: + if not mod is None and args is None: module = self.modules[ mod ] #check module exists if module: - module( self.mainUrlWriter ).perform( request ) + module( self.mainUrlWriter ).perform( request ) + else: + self.perform( request ) return self.render_GET( request ) @@ -80,3 +86,18 @@ class Main( HTMLBase ): request.write( "\n" ) + + def op_destroy( self, request ): + dom = getVar( 'args', request ) + if not dom is None and dom != "0": + server.xend_domain_destroy( int( dom ), "halt" ) + + def op_pause( self, request ): + dom = getVar( 'args', request ) + if not dom is None and dom != "0": + server.xend_domain_pause( int( dom ) ) + + def op_unpause( self, request ): + dom = getVar( 'args', request ) + if not dom is None and dom != "0": + server.xend_domain_unpause( int( dom ) ) \ No newline at end of file diff --git a/tools/python/xen/sv/NodeInfo.py b/tools/python/xen/sv/NodeInfo.py index 948acef4b6..8afc41d491 100755 --- a/tools/python/xen/sv/NodeInfo.py +++ b/tools/python/xen/sv/NodeInfo.py @@ -20,8 +20,12 @@ class NodeInfoTab( GeneralTab ): def __init__( self ): - nodeInfo = sxp2hash( server.xend_node() ) - + nodeInfo = {} + try: + nodeInfo = sxp2hash( server.xend_node() ) + except: + nodeInfo[ 'system' ] = 'Error getting node info' + dictTitles = {} dictTitles[ 'System' ] = 'system' dictTitles[ 'Hostname' ] = 'host' @@ -39,8 +43,11 @@ class NodeInfoTab( GeneralTab ): class NodeDmesgTab( PreTab ): def __init__( self ): - dmesg = server.xend_node_dmesg() - PreTab.__init__( self, dmesg[ 1 ] ) + try: + dmesg = server.xend_node_dmesg() + except: + dmesg = "Error getting node information: XenD not running?" + PreTab.__init__( self, dmesg ) class NodeActionTab( ActionTab ): diff --git a/tools/python/xen/sv/util.py b/tools/python/xen/sv/util.py index b332b60482..3207b8f0cc 100755 --- a/tools/python/xen/sv/util.py +++ b/tools/python/xen/sv/util.py @@ -5,8 +5,12 @@ from xen.xend import PrettyPrint import types def getDomInfoHash( domain ): - domInfoHash = sxp2hash( server.xend_domain( int( domain ) ) ) - domInfoHash['dom'] = int( domain ) + domInfoHash = {} + try: + domInfoHash = sxp2hash( server.xend_domain( domain ) ) + domInfoHash['dom'] = domain + except: + domInfoHash['name'] = "Error getting domain details" return domInfoHash def sxp2hash( s ): diff --git a/tools/sv/Makefile b/tools/sv/Makefile index c7bd3d5880..dcc298826a 100755 --- a/tools/sv/Makefile +++ b/tools/sv/Makefile @@ -33,7 +33,12 @@ install: install -m0644 images/reboot.png $(sv_insdir)/images install -m0644 images/pause.png $(sv_insdir)/images install -m0644 images/unpause.png $(sv_insdir)/images + install -m0644 images/destroy.png $(sv_insdir)/images + install -m0644 images/small-destroy.png $(sv_insdir)/images + install -m0644 images/small-pause.png $(sv_insdir)/images + install -m0644 images/small-unpause.png $(sv_insdir)/images + install -m0644 images/next.png $(sv_insdir)/images install -m0644 images/previous.png $(sv_insdir)/images install -m0644 images/finish.png $(sv_insdir)/images diff --git a/tools/sv/images/destroy.png b/tools/sv/images/destroy.png new file mode 100644 index 0000000000..9545fc4837 Binary files /dev/null and b/tools/sv/images/destroy.png differ diff --git a/tools/sv/images/small-destroy.png b/tools/sv/images/small-destroy.png new file mode 100644 index 0000000000..f800bd7685 Binary files /dev/null and b/tools/sv/images/small-destroy.png differ diff --git a/tools/sv/images/small-pause.png b/tools/sv/images/small-pause.png new file mode 100644 index 0000000000..7bbdbfaafe Binary files /dev/null and b/tools/sv/images/small-pause.png differ diff --git a/tools/sv/images/small-unpause.png b/tools/sv/images/small-unpause.png new file mode 100644 index 0000000000..6ae5687a0c Binary files /dev/null and b/tools/sv/images/small-unpause.png differ diff --git a/tools/sv/inc/script.js b/tools/sv/inc/script.js index fca5a972ab..47cd10399c 100755 --- a/tools/sv/inc/script.js +++ b/tools/sv/inc/script.js @@ -13,3 +13,10 @@ function doOp( op ) document.forms[0].op.value = op document.forms[0].submit() } + +function doOp2( op, args ) +{ + document.forms[0].op.value = op + document.forms[0].args.value = args + document.forms[0].submit() +} diff --git a/xen/common/dom_mem_ops.c b/xen/common/dom_mem_ops.c index e2a330ae96..027dc790ce 100644 --- a/xen/common/dom_mem_ops.c +++ b/xen/common/dom_mem_ops.c @@ -92,13 +92,32 @@ static long free_dom_mem(struct domain *d, long do_dom_mem_op(unsigned int op, unsigned long *extent_list, unsigned long nr_extents, - unsigned int extent_order) + unsigned int extent_order, + domid_t domid) { - if ( op == MEMOP_increase_reservation ) - return alloc_dom_mem(current, extent_list, nr_extents, extent_order); + struct domain *d; + long rc = -ENOSYS; - if ( op == MEMOP_decrease_reservation ) - return free_dom_mem(current, extent_list, nr_extents, extent_order); + if (domid == DOMID_SELF) + d = current; + else + d = find_domain_by_id(domid); - return -ENOSYS; + if (d==NULL) + return -ESRCH; + + switch( op ) + { + case MEMOP_increase_reservation: + rc = alloc_dom_mem(d, extent_list, nr_extents, extent_order); + break; + case MEMOP_decrease_reservation: + rc = free_dom_mem(d, extent_list, nr_extents, extent_order); + break; + } + + if (domid!=DOMID_SELF) + put_domain(d); + + return rc; } diff --git a/xen/include/hypervisor-ifs/grant_table.h b/xen/include/hypervisor-ifs/grant_table.h new file mode 100644 index 0000000000..9c9456b786 --- /dev/null +++ b/xen/include/hypervisor-ifs/grant_table.h @@ -0,0 +1,89 @@ +/****************************************************************************** + * grant_table.h + * + * Interface for granting foreign access to page frames, and receiving + * page-ownership transfers. + * + * Copyright (c) 2004, K A Fraser + * + * Some rough guidelines on accessing and updating grant-table entries + * in a concurreny-safe manner. For more information, Linux contains a + * reference implementation for guest OSes (arch/xen/kernel/grant_table.c). + * + * NB. WMB is a no-op on current-generation x86 processors. + * + * Introducing a valid entry into the grant table: + * 1. Write ent->domid. + * 2. Write ent->frame (to zero if installing GTF_accept_transfer). + * 3. Write memory barrier (WMB). + * 4. Write ent->flags, inc. valid type. + * + * Removing an unused GTF_permit_access entry: + * 1. flags = ent->flags. + * 2. Observe that !(flags & (GTF_reading|GTF_writing)). + * 3. Check result of SMP-safe CMPXCHG(&ent->flags, flags, 0). + * 4. WMB. + * + * Removing an unused GTF_accept_transfer entry: + * 1. Clear ent->flags. + * 2. WMB. + * + * Changing a GTF_permit_access from writable to read-only: + * Use SMP-safe CMPXCHG to set GTF_readonly, while checking !GTF_writing. + * + * Changing a GTF_permit_access from read-only to writable: + * Use SMP-safe bit-setting instruction. + */ + +#ifndef __HYPERVISOR_IFS_GRANT_TABLE_H__ +#define __HYPERVISOR_IFS_GRANT_TABLE_H__ + +/* + * A grant table comprises a packed array of grant entries in one or more + * page frames shared between Xen and a guest. + * [XEN]: This field is written by Xen and read by the sharing guest. + * [GST]: This field is written by the guest and read by Xen. + */ +typedef struct { + /* GTF_xxx: various type and flag information. [XEN,GST] */ + u16 flags; /* 0 */ + /* The domain being granted foreign privileges. [GST] */ + domid_t domid; /* 2 */ + /* + * GTF_permit_access: Frame that @domid is allowed to map and access. [GST] + * GTF_accept_transfer: Frame whose ownership transferred by @domid. [XEN] + */ + u32 frame; /* 4 */ +} PACKED grant_entry_t; /* 8 bytes */ + +/* + * Reference to a grant entry in a specified domain's grant table. + */ +typedef u16 grant_ref_t; + +/* + * Type of grant entry. + * GTF_invalid: This grant entry grants no privileges. + * GTF_permit_access: Allow @domid to map/access @frame. + * GTF_accept_transfer: Allow @domid to transfer ownership of one page frame + * to this guest. Xen writes the page number to @frame. + */ +#define GTF_invalid (0<<0) +#define GTF_permit_access (1<<0) +#define GTF_accept_transfer (2<<0) +#define GTF_type_mask (3<<0) + +/* + * Subflags for GTF_permit_access. + * GTF_readonly: Restrict @domid to read-only mappings and accesses. [GST] + * GTF_reading: Grant entry is currently mapped for reading by @domid. [XEN] + * GTF_writing: Grant entry is currently mapped for writing by @domid. [XEN] + */ +#define _GTF_readonly (2) +#define GTF_readonly (1<<_GTF_readonly) +#define _GTF_reading (3) +#define GTF_reading (1<<_GTF_inuse) +#define _GTF_writing (4) +#define GTF_writing (1<<_GTF_inuse) + +#endif /* __HYPERVISOR_IFS_GRANT_TABLE_H__ */ diff --git a/xen/include/hypervisor-ifs/hypervisor-if.h b/xen/include/hypervisor-ifs/hypervisor-if.h index bbcbc9f505..1ffbd3773c 100644 --- a/xen/include/hypervisor-ifs/hypervisor-if.h +++ b/xen/include/hypervisor-ifs/hypervisor-if.h @@ -2,6 +2,8 @@ * hypervisor-if.h * * Guest OS interface to Xen. + * + * Copyright (c) 2004, K A Fraser */ #ifndef __HYPERVISOR_IF_H__ @@ -360,47 +362,35 @@ typedef struct shared_info_st * extended by an extra 4MB to ensure this. */ -/* - * This is the basic bootstrap information structure as passed by Xen to the - * initial controller domain. We want this structure to be easily extended by - * more sophisticated domain builders and controllers, so we make the basic - * fields of this structure available via a BASIC_START_INFO macro. - * - * Extended version of start_info_t should be defined as: - * typedef struct { - * BASIC_START_INFO; - * <...extra fields...> - * } extended_start_info_t; - */ #define MAX_CMDLINE 256 -#define BASIC_START_INFO \ - /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME. */ \ - memory_t nr_pages; /* 0: Total pages allocated to this domain. */ \ - _MEMORY_PADDING(A); \ - memory_t shared_info; /* 8: MACHINE address of shared info struct.*/ \ - _MEMORY_PADDING(B); \ - u32 flags; /* 16: SIF_xxx flags. */ \ - u32 __pad; \ - /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME). */ \ - memory_t pt_base; /* 24: VIRTUAL address of page directory. */ \ - _MEMORY_PADDING(C); \ - memory_t nr_pt_frames; /* 32: Number of bootstrap p.t. frames. */ \ - _MEMORY_PADDING(D); \ - memory_t mfn_list; /* 40: VIRTUAL address of page-frame list. */ \ - _MEMORY_PADDING(E); \ - memory_t mod_start; /* 48: VIRTUAL address of pre-loaded module. */ \ - _MEMORY_PADDING(F); \ - memory_t mod_len; /* 56: Size (bytes) of pre-loaded module. */ \ - _MEMORY_PADDING(G); \ - u8 cmd_line[MAX_CMDLINE] /* 64 */ - typedef struct { - BASIC_START_INFO; + /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME. */ + memory_t nr_pages; /* 0: Total pages allocated to this domain. */ + _MEMORY_PADDING(A); + memory_t shared_info; /* 8: MACHINE address of shared info struct.*/ + _MEMORY_PADDING(B); + u32 flags; /* 16: SIF_xxx flags. */ + u16 domain_controller_evtchn; /* 20 */ + u16 __pad; + /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME). */ + memory_t pt_base; /* 24: VIRTUAL address of page directory. */ + _MEMORY_PADDING(C); + memory_t nr_pt_frames; /* 32: Number of bootstrap p.t. frames. */ + _MEMORY_PADDING(D); + memory_t mfn_list; /* 40: VIRTUAL address of page-frame list. */ + _MEMORY_PADDING(E); + memory_t mod_start; /* 48: VIRTUAL address of pre-loaded module. */ + _MEMORY_PADDING(F); + memory_t mod_len; /* 56: Size (bytes) of pre-loaded module. */ + _MEMORY_PADDING(G); + u8 cmd_line[MAX_CMDLINE]; /* 64 */ } PACKED start_info_t; /* 320 bytes */ /* These flags are passed in the 'flags' field of start_info_t. */ #define SIF_PRIVILEGED (1<<0) /* Is the domain privileged? */ #define SIF_INITDOMAIN (1<<1) /* Is this the initial control domain? */ +#define SIF_BLK_BE_DOMAIN (1<<4) /* Is this a block backend domain? */ +#define SIF_NET_BE_DOMAIN (1<<5) /* Is this a net backend domain? */ /* For use in guest OSes. */ extern shared_info_t *HYPERVISOR_shared_info; diff --git a/xen/include/hypervisor-ifs/io/domain_controller.h b/xen/include/hypervisor-ifs/io/domain_controller.h index da1f2441de..42eedd945e 100644 --- a/xen/include/hypervisor-ifs/io/domain_controller.h +++ b/xen/include/hypervisor-ifs/io/domain_controller.h @@ -11,23 +11,6 @@ #define __DOMAIN_CONTROLLER_H__ -#ifndef BASIC_START_INFO -#error "Xen header file hypervisor-if.h must already be included here." -#endif - - -/* - * EXTENDED BOOTSTRAP STRUCTURE FOR NEW DOMAINS. - */ - -typedef struct { - BASIC_START_INFO; - u16 domain_controller_evtchn; /* 320 */ -} PACKED extended_start_info_t; /* 322 bytes */ -#define SIF_BLK_BE_DOMAIN (1<<4) /* Is this a block backend domain? */ -#define SIF_NET_BE_DOMAIN (1<<5) /* Is this a net backend domain? */ - - /* * Reason codes for SCHEDOP_shutdown. These are opaque to Xen but may be * interpreted by control software to determine the appropriate action. These