---
 drivers/lguest/lguest_user.c    |    4 ++++
 include/linux/lguest_launcher.h |    1 +
 2 files changed, 5 insertions(+)

diff --git a/drivers/lguest/lguest_user.c b/drivers/lguest/lguest_user.c
--- a/drivers/lguest/lguest_user.c
+++ b/drivers/lguest/lguest_user.c
@@ -329,6 +329,10 @@ static ssize_t write(struct file *file, 
 		return break_guest_out(cpu, input);
 	case LHREQ_EVENTFD:
 		return attach_eventfd(lg, input);
+	case LHREQ_GETIP:
+		/* Kick makes sure EIP is up-to-date. */
+		kick_process(cpu->tsk);
+		return cpu->regs->eip;
 	default:
 		return -EINVAL;
 	}
diff --git a/include/linux/lguest_launcher.h b/include/linux/lguest_launcher.h
--- a/include/linux/lguest_launcher.h
+++ b/include/linux/lguest_launcher.h
@@ -59,6 +59,7 @@ enum lguest_req
 	LHREQ_IRQ, /* + irq */
 	LHREQ_BREAK, /* + on/off flag (on blocks until someone does off) */
 	LHREQ_EVENTFD, /* + address, fd. */
+	LHREQ_GETIP, /* Nothing, returns EIP. */
 };
 
 /* The alignment to use between consumer and producer parts of vring.
