]> Pileus Git - ~andy/linux/commitdiff
KVM: PPC: Book3S: PR: Fix preemption
authorAlexander Graf <agraf@suse.de>
Tue, 13 Mar 2012 22:31:02 +0000 (23:31 +0100)
committerPaul Mackerras <paulus@samba.org>
Tue, 3 Apr 2012 06:42:39 +0000 (16:42 +1000)
We were leaking preemption counters. Fix the code to always toggle
between preempt and non-preempt properly.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kvm/book3s_pr.c

index a657c44b7fbc68f5de670ee67b53e4c0a10acd8e..7759053d391b87298a4888c1cbbb7463ee6e8431 100644 (file)
@@ -777,6 +777,7 @@ program_interrupt:
        }
        }
 
+       preempt_disable();
        if (!(r & RESUME_HOST)) {
                /* To avoid clobbering exit_reason, only check for signals if
                 * we aren't already exiting to userspace for some other
@@ -798,8 +799,6 @@ program_interrupt:
                        run->exit_reason = KVM_EXIT_INTR;
                        r = -EINTR;
                } else {
-                       preempt_disable();
-
                        /* In case an interrupt came in that was triggered
                         * from userspace (like DEC), we need to check what
                         * to inject now! */