Lines Matching defs:cpu
12 #include <linux/cpu.h>
182 void __lgread(struct lg_cpu *cpu, void *b, unsigned long addr, unsigned bytes)
184 if (!lguest_address_ok(cpu->lg, addr, bytes)
185 || copy_from_user(b, cpu->lg->mem_base + addr, bytes) != 0) {
188 kill_guest(cpu, "bad read address %#lx len %u", addr, bytes);
193 void __lgwrite(struct lg_cpu *cpu, unsigned long addr, const void *b,
196 if (!lguest_address_ok(cpu->lg, addr, bytes)
197 || copy_to_user(cpu->lg->mem_base + addr, b, bytes) != 0)
198 kill_guest(cpu, "bad write address %#lx len %u", addr, bytes);
207 int run_guest(struct lg_cpu *cpu, unsigned long __user *user)
210 while (!cpu->lg->dead) {
215 if (cpu->hcall)
216 do_hypercalls(cpu);
222 if (cpu->pending_notify) {
227 if (!send_notify_to_eventfd(cpu)) {
229 if (put_user(cpu->pending_notify, user))
231 return sizeof(cpu->pending_notify);
244 irq = interrupt_pending(cpu, &more);
246 try_deliver_interrupt(cpu, irq, more);
259 if (cpu->lg->dead)
266 if (cpu->halted) {
272 if (interrupt_pending(cpu, &more) < LGUEST_IRQS)
286 lguest_arch_run_guest(cpu);
292 lguest_arch_handle_trap(cpu);
296 if (cpu->lg->dead == ERR_PTR(-ERESTART))