diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-01-07 08:05:28 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-01-30 06:50:08 -0500 |
commit | ad8d8f3bc61ec712dd141e1029ae68c47fadc4a7 (patch) | |
tree | 70bd69e85ef7f159a62f4cd8aa2799d8d542b92c /drivers/lguest/lguest_user.c | |
parent | 73044f05a4ac65f2df42753e9566444b9d2a660f (diff) |
lguest: per-vcpu lguest timers
Here, I introduce per-vcpu timers. With this, we can have
local expiries, needed for accounting time in smp guests
Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/lguest/lguest_user.c')
-rw-r--r-- | drivers/lguest/lguest_user.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/lguest/lguest_user.c b/drivers/lguest/lguest_user.c index 2562082a3ea3..f231b9be0b64 100644 --- a/drivers/lguest/lguest_user.c +++ b/drivers/lguest/lguest_user.c | |||
@@ -104,6 +104,7 @@ static int lg_cpu_start(struct lg_cpu *cpu, unsigned id, unsigned long start_ip) | |||
104 | cpu->id = id; | 104 | cpu->id = id; |
105 | cpu->lg = container_of((cpu - id), struct lguest, cpus[0]); | 105 | cpu->lg = container_of((cpu - id), struct lguest, cpus[0]); |
106 | cpu->lg->nr_cpus++; | 106 | cpu->lg->nr_cpus++; |
107 | init_clockdev(cpu); | ||
107 | 108 | ||
108 | return 0; | 109 | return 0; |
109 | } | 110 | } |
@@ -180,9 +181,6 @@ static int initialize(struct file *file, const unsigned long __user *input) | |||
180 | * address. */ | 181 | * address. */ |
181 | lguest_arch_setup_regs(lg, args[3]); | 182 | lguest_arch_setup_regs(lg, args[3]); |
182 | 183 | ||
183 | /* The timer for lguest's clock needs initialization. */ | ||
184 | init_clockdev(lg); | ||
185 | |||
186 | /* We keep a pointer to the Launcher task (ie. current task) for when | 184 | /* We keep a pointer to the Launcher task (ie. current task) for when |
187 | * other Guests want to wake this one (inter-Guest I/O). */ | 185 | * other Guests want to wake this one (inter-Guest I/O). */ |
188 | lg->tsk = current; | 186 | lg->tsk = current; |
@@ -273,6 +271,7 @@ static ssize_t write(struct file *file, const char __user *in, | |||
273 | static int close(struct inode *inode, struct file *file) | 271 | static int close(struct inode *inode, struct file *file) |
274 | { | 272 | { |
275 | struct lguest *lg = file->private_data; | 273 | struct lguest *lg = file->private_data; |
274 | unsigned int i; | ||
276 | 275 | ||
277 | /* If we never successfully initialized, there's nothing to clean up */ | 276 | /* If we never successfully initialized, there's nothing to clean up */ |
278 | if (!lg) | 277 | if (!lg) |
@@ -281,8 +280,9 @@ static int close(struct inode *inode, struct file *file) | |||
281 | /* We need the big lock, to protect from inter-guest I/O and other | 280 | /* We need the big lock, to protect from inter-guest I/O and other |
282 | * Launchers initializing guests. */ | 281 | * Launchers initializing guests. */ |
283 | mutex_lock(&lguest_lock); | 282 | mutex_lock(&lguest_lock); |
284 | /* Cancels the hrtimer set via LHCALL_SET_CLOCKEVENT. */ | 283 | for (i = 0; i < lg->nr_cpus; i++) |
285 | hrtimer_cancel(&lg->hrt); | 284 | /* Cancels the hrtimer set via LHCALL_SET_CLOCKEVENT. */ |
285 | hrtimer_cancel(&lg->cpus[i].hrt); | ||
286 | /* Free up the shadow page tables for the Guest. */ | 286 | /* Free up the shadow page tables for the Guest. */ |
287 | free_guest_pagetable(lg); | 287 | free_guest_pagetable(lg); |
288 | /* Now all the memory cleanups are done, it's safe to release the | 288 | /* Now all the memory cleanups are done, it's safe to release the |