lguest: use C code for irq enable and restore ops.
---
 arch/x86/lguest/boot.c |   25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -243,6 +243,25 @@ static void irq_disable(void)
 	lguest_data.irq_enabled = 0;
 }
 
+/* Interrupts go on. */
+static void irq_enable_simple(void)
+{
+	lguest_data.irq_enabled = X86_EFLAGS_IF;
+	mb();
+	if (lguest_data.irq_pending)
+		hcall(LHCALL_SEND_INTERRUPTS, 0, 0, 0, 0);
+}
+
+static void restore_fl_simple(unsigned long eflags)
+{
+	lguest_data.irq_enabled = eflags;
+	mb();
+	if (eflags & lguest_data.irq_pending)
+		hcall(LHCALL_SEND_INTERRUPTS, 0, 0, 0, 0);
+}
+PV_CALLEE_SAVE_REGS_THUNK(restore_fl_simple);
+PV_CALLEE_SAVE_REGS_THUNK(irq_enable_simple);
+
 /*
  * Let's pause a moment.  Remember how I said these are called so often?
  * Jeremy Fitzhardinge optimized them so hard early in 2009 that he had to
@@ -1270,10 +1289,12 @@ __init void lguest_init(void)
 
 	/* Interrupt-related operations */
 	pv_irq_ops.save_fl = PV_CALLEE_SAVE(save_fl);
-	pv_irq_ops.restore_fl = __PV_IS_CALLEE_SAVE(lg_restore_fl);
+//	pv_irq_ops.restore_fl = __PV_IS_CALLEE_SAVE(lg_restore_fl);
 	pv_irq_ops.irq_disable = PV_CALLEE_SAVE(irq_disable);
-	pv_irq_ops.irq_enable = __PV_IS_CALLEE_SAVE(lg_irq_enable);
+//	pv_irq_ops.irq_enable = __PV_IS_CALLEE_SAVE(lg_irq_enable);
 	pv_irq_ops.safe_halt = lguest_safe_halt;
+	pv_irq_ops.restore_fl = PV_CALLEE_SAVE(restore_fl_simple);
+	pv_irq_ops.irq_enable = PV_CALLEE_SAVE(irq_enable_simple);
 
 	/* Setup operations */
 	pv_init_ops.patch = lguest_patch;
