]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[S390] smp: fix sigp sense handling
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Thu, 29 Oct 2009 14:04:14 +0000 (15:04 +0100)
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>
Thu, 29 Oct 2009 14:05:13 +0000 (15:05 +0100)
sigp sense only returns the status of a cpu if it is non zero. If the
status of the sensed cpu is all zeros condition code 0 (accpeted) is
set and no status bits are returned.
The current code however assumes that a status was returned and tests
bits in it. This means uninitalized data is accessed with random
results.
Worst case is that the code that checks if cpu is offline on cpu
hotplug assumes that the target cpu is offline while it is still
running. This leads potentially to memory corruption since resources
that are still needed by the target cpu will be freed and could be
resused while still in use.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/smp.c
arch/s390/kernel/swsusp_asm64.S

index c99c45b848e34f7ee01e81dcb4a7f2bb24b378a4..93e52039321b1f6bcb2a89c335c3c9b4ef1c1104 100644 (file)
@@ -76,7 +76,6 @@ static int cpu_stopped(int cpu)
        __u32 status;
 
        switch (signal_processor_ps(&status, 0, cpu, sigp_sense)) {
-       case sigp_order_code_accepted:
        case sigp_status_stored:
                /* Check for stopped and check stop state */
                if (status & 0x50)
index 0f4ef3b856d9709a2e769f32d4a521a155754d7d..0c26cc1898ec68a96e4b176be0eeff29bff57882 100644 (file)
@@ -207,6 +207,7 @@ restart_suspend:
        llgh    %r2,0(%r1)
 7:
        sigp    %r9,%r2,__SIGP_SENSE    /* Wait for resume CPU */
+       brc     8,7b                    /* accepted, status 0, still running */
        brc     2,7b                    /* busy, try again */
        tmll    %r9,0x40                /* Test if resume CPU is stopped */
        jz      7b