bitkeeper revision 1.220 (3eba7140Xm9JLEfxz1hmvq2pg7H5UA)

sched.h, domain.c, dom0_ops.c:
  Robustify domain creation and building.
This commit is contained in:
kaf24@scramble.cl.cam.ac.uk committed 2003-05-08 15:01:20 +00:00
1 parent 9c9974b78f
commit 5188bc32cd
3 files changed
+16 -7

No files matched your search

+6 -1
View File
@@ -20,7 +20,9 @@ extern unsigned int alloc_new_dom_mem(struct task_struct *, unsigned int);
static unsigned int get_domnr(void)
{
static unsigned int domnr = 0;
return ++domnr;
do { domnr = (domnr+1) & ((1<<20)-1); }
while ( find_domain_by_id(domnr) != NULL );
return domnr;
}
static void build_page_list(struct task_struct *p)
@@ -75,6 +77,9 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
case DOM0_STARTDOMAIN:
{
struct task_struct * p = find_domain_by_id(op.u.meminfo.domain);
ret = -EINVAL;
if ( (p == NULL) || !(p->flags & PF_CONSTRUCTED) )
break;
wake_up(p);
reschedule(p);
ret = p->domain;
+9 -6
View File
@@ -48,7 +48,7 @@ struct task_struct *do_newdomain(unsigned int dom_id, unsigned int cpu)
p->domain = dom_id;
p->processor = cpu;
sprintf (p->name, "Domain-%d", dom_id);
sprintf(p->name, "Domain-%d", dom_id);
spin_lock_init(&p->blk_ring_lock);
spin_lock_init(&p->page_lock);
@@ -331,6 +331,9 @@ int final_setup_guestos(struct task_struct * p, dom_meminfo_t * meminfo)
net_vif_t *net_vif;
int i;
if ( (p->flags & PF_CONSTRUCTED) )
return -EINVAL;
/* High entries in page table must contain hypervisor
* mem mappings - set them up.
*/
@@ -386,11 +389,6 @@ int final_setup_guestos(struct task_struct * p, dom_meminfo_t * meminfo)
virt_startinfo_addr->dom_id = p->domain;
virt_startinfo_addr->flags = IS_PRIV(p) ? SIF_PRIVILEGED : 0;
if( virt_startinfo_addr->mod_len )
printk("Initrd module present %08lx (%08lx)\n",
virt_startinfo_addr->mod_start,
virt_startinfo_addr->mod_len);
/* Add virtual network interfaces and point to them in startinfo. */
while (meminfo->num_vifs-- > 0) {
net_vif = create_net_vif(p->domain);
@@ -417,6 +415,8 @@ int final_setup_guestos(struct task_struct * p, dom_meminfo_t * meminfo)
__asm__ __volatile__ (
"mov %%eax,%%cr3" : : "a" (pagetable_val(current->mm.pagetable)));
__sti();
p->flags |= PF_CONSTRUCTED;
new_thread(p,
(unsigned long)meminfo->virt_load_addr,
@@ -461,6 +461,7 @@ int setup_guestos(struct task_struct *p, dom0_newdomain_t *params,
/* Sanity! */
if ( p->domain != 0 ) BUG();
if ( (p->flags & PF_CONSTRUCTED) ) BUG();
/*
* This is all a bit grim. We've moved the modules to the "safe" physical
@@ -700,6 +701,8 @@ int setup_guestos(struct task_struct *p, dom0_newdomain_t *params,
__write_cr3_counted(pagetable_val(current->mm.pagetable));
__sti();
p->flags |= PF_CONSTRUCTED;
new_thread(p,
(unsigned long)virt_load_address,
(unsigned long)virt_stack_address,
+1
View File
@@ -58,6 +58,7 @@ extern struct mm_struct init_mm;
#define PF_DONEFPUINIT 0x1 /* Has the FPU been initialised for this task? */
#define PF_USEDFPU 0x2 /* Has this task used the FPU since last save? */
#define PF_GUEST_STTS 0x4 /* Has the guest OS requested 'stts'? */
#define PF_CONSTRUCTED 0x8 /* Has the guest OS been fully built yet? */
#include <xeno/vif.h>
#include <xeno/block.h>
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.