/* This routine copies memory from the Guest. Here we can see how useful the kill_lguest() routine we met in the Launcher can be: we return a random value (all zeroes) instead of needing to return an error.  */
void __lgread(struct lg_cpu *cpu, void *b, unsigned long addr, unsigned bytes)
/* This routine copies memory from the Guest. Here we can see how useful the kill_lguest() routine we met in the Launcher can be: we return a random value (all zeroes) instead of needing to return an error.  */
void __lgread(struct lg_cpu *cpu, void *b, unsigned long addr, unsigned bytes)
{
	if (!lguest_address_ok(cpu->lg, addr, bytes)
	    || copy_from_user(b, cpu->lg->mem_base + addr, bytes) != 0) {
		memset(b, 0, bytes);
		kill_guest(cpu, "bad read address %#lx len %u", addr, bytes);
	}
}