Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80904
b: refs/heads/master
c: 4dcc53d
h: refs/heads/master
v: v3
  • Loading branch information
Glauber de Oliveira Costa authored and Rusty Russell committed Jan 30, 2008
1 parent 7be0b98 commit 78b897d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e3283fa0cc5c4f9bde52339a40da89297e51b481
refs/heads/master: 4dcc53da49c2387078fe8ceb7a420d125e027fc6
17 changes: 17 additions & 0 deletions trunk/drivers/lguest/lguest_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@ static ssize_t read(struct file *file, char __user *user, size_t size,loff_t*o)
return run_guest(lg, (unsigned long __user *)user);
}

static int lg_cpu_start(struct lg_cpu *cpu, unsigned id, unsigned long start_ip)
{
if (id >= NR_CPUS)
return -EINVAL;

cpu->id = id;
cpu->lg = container_of((cpu - id), struct lguest, cpus[0]);
cpu->lg->nr_cpus++;

return 0;
}

/*L:020 The initialization write supplies 4 pointer sized (32 or 64 bit)
* values (in addition to the LHREQ_INITIALIZE value). These are:
*
Expand Down Expand Up @@ -134,6 +146,11 @@ static int initialize(struct file *file, const unsigned long __user *input)
lg->mem_base = (void __user *)(long)args[0];
lg->pfn_limit = args[1];

/* This is the first cpu */
err = cpu_start(&lg->cpus[0], 0, args[3]);
if (err)
goto release_guest;

/* We need a complete page for the Guest registers: they are accessible
* to the Guest and we can only grant it access to whole pages. */
lg->regs_page = get_zeroed_page(GFP_KERNEL);
Expand Down

0 comments on commit 78b897d

Please sign in to comment.