• Home
  • Raw
  • Download

Lines Matching refs:lg

49 	map = rcu_dereference(cpu->lg->eventfds);  in send_notify_to_eventfd()
90 static int add_eventfd(struct lguest *lg, unsigned long addr, int fd) in add_eventfd() argument
92 struct lg_eventfd_map *new, *old = lg->eventfds; in add_eventfd()
133 rcu_assign_pointer(lg->eventfds, new); in add_eventfd()
153 static int attach_eventfd(struct lguest *lg, const unsigned long __user *input) in attach_eventfd() argument
170 err = add_eventfd(lg, addr, fd); in attach_eventfd()
203 struct lguest *lg = file->private_data; in read() local
208 if (!lg) in read()
212 if (cpu_id >= lg->nr_cpus) in read()
215 cpu = &lg->cpus[cpu_id]; in read()
222 if (lg->dead) { in read()
226 if (IS_ERR(lg->dead)) in read()
227 return PTR_ERR(lg->dead); in read()
230 len = min(size, strlen(lg->dead)+1); in read()
231 if (copy_to_user(user, lg->dead, len) != 0) in read()
254 if (id >= ARRAY_SIZE(cpu->lg->cpus)) in lg_cpu_start()
259 cpu->lg = container_of(cpu, struct lguest, cpus[id]); in lg_cpu_start()
260 cpu->lg->nr_cpus++; in lg_cpu_start()
320 struct lguest *lg; in initialize() local
340 lg = kzalloc(sizeof(*lg), GFP_KERNEL); in initialize()
341 if (!lg) { in initialize()
346 lg->eventfds = kmalloc(sizeof(*lg->eventfds), GFP_KERNEL); in initialize()
347 if (!lg->eventfds) { in initialize()
351 lg->eventfds->num = 0; in initialize()
354 lg->mem_base = (void __user *)args[0]; in initialize()
355 lg->pfn_limit = args[1]; in initialize()
358 err = lg_cpu_start(&lg->cpus[0], 0, args[2]); in initialize()
366 err = init_guest_pagetable(lg); in initialize()
371 file->private_data = lg; in initialize()
380 free_page(lg->cpus[0].regs_page); in initialize()
382 kfree(lg->eventfds); in initialize()
384 kfree(lg); in initialize()
408 struct lguest *lg = file->private_data; in write() local
421 if (!lg || (cpu_id >= lg->nr_cpus)) in write()
423 cpu = &lg->cpus[cpu_id]; in write()
426 if (lg->dead) in write()
436 return attach_eventfd(lg, input); in write()
453 struct lguest *lg = file->private_data; in close() local
457 if (!lg) in close()
467 free_guest_pagetable(lg); in close()
469 for (i = 0; i < lg->nr_cpus; i++) { in close()
471 hrtimer_cancel(&lg->cpus[i].hrt); in close()
473 free_page(lg->cpus[i].regs_page); in close()
478 mmput(lg->cpus[i].mm); in close()
482 for (i = 0; i < lg->eventfds->num; i++) in close()
483 eventfd_ctx_put(lg->eventfds->map[i].event); in close()
484 kfree(lg->eventfds); in close()
490 if (!IS_ERR(lg->dead)) in close()
491 kfree(lg->dead); in close()
493 kfree(lg); in close()