lguest: allow any process to send interrupts
[deliverable/linux.git] / drivers / lguest / lguest_user.c
index b8ee103eed5f503e44ad5ebb27aab75e81ba5bec..1982b45bd9357bcf3c6ba8573dba19a1add9707b 100644 (file)
@@ -24,8 +24,8 @@ static int break_guest_out(struct lg_cpu *cpu, const unsigned long __user*input)
 
        if (on) {
                cpu->break_out = 1;
-               /* Pop it out of the Guest (may be running on different CPU) */
-               wake_up_process(cpu->tsk);
+               if (!wake_up_process(cpu->tsk))
+                       kick_process(cpu->tsk);
                /* Wait for them to reset it */
                return wait_event_interruptible(cpu->break_wq, !cpu->break_out);
        } else {
@@ -45,9 +45,8 @@ static int user_send_irq(struct lg_cpu *cpu, const unsigned long __user *input)
                return -EFAULT;
        if (irq >= LGUEST_IRQS)
                return -EINVAL;
-       /* Next time the Guest runs, the core code will see if it can deliver
-        * this interrupt. */
-       set_bit(irq, cpu->irqs_pending);
+
+       set_interrupt(cpu, irq);
        return 0;
 }
 
@@ -252,11 +251,6 @@ static ssize_t write(struct file *file, const char __user *in,
                /* Once the Guest is dead, you can only read() why it died. */
                if (lg->dead)
                        return -ENOENT;
-
-               /* If you're not the task which owns the Guest, all you can do
-                * is break the Launcher out of running the Guest. */
-               if (current != cpu->tsk && req != LHREQ_BREAK)
-                       return -EPERM;
        }
 
        switch (req) {
This page took 0.025828 seconds and 5 git commands to generate.