aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/lguest/lguest_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/lguest/lguest_user.c')
-rw-r--r--drivers/lguest/lguest_user.c10
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,
273static int close(struct inode *inode, struct file *file) 271static 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