[S390] Initialize __LC_THREAD_INFO early.
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Fri, 11 Sep 2009 08:28:58 +0000 (10:28 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 11 Sep 2009 08:29:53 +0000 (10:29 +0200)
"lockdep: Fix backtraces" reveales a bug in early setup code: when
lockdep tries to save a stack backtrace before setup_arch has been
called the lowcore pointer for the current thread info pointer isn't
initialized yet.
However our save stack backtrace code relies on it. If the pointer
isn't initialized the saved backtrace will have zero entries.
lockdep however relies (correctly) on the fact that that cannot
happen.
A write access to some random memory region is the result.

Fix this by initializing the thread info pointer early.

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

index 2ced846065b7a61e340fc88d9b390a4416ead542..602b508cd4c41d3ef4792d6fbcdaae300c5aff39 100644 (file)
@@ -24,6 +24,7 @@ startup_continue:
 # Setup stack
 #
        l       %r15,.Linittu-.LPG1(%r13)
+       st      %r15,__LC_THREAD_INFO   # cache thread info in lowcore
        mvc     __LC_CURRENT(4),__TI_task(%r15)
        ahi     %r15,1<<(PAGE_SHIFT+THREAD_ORDER) # init_task_union+THREAD_SIZE
        st      %r15,__LC_KERNEL_STACK  # set end of kernel stack
index 65667b2e65cee6fdd3ed71f104ee326d4ec13d86..bdcb3f05bcd1949fd2f592b1c93c53eb18e10b08 100644 (file)
@@ -92,6 +92,7 @@ startup_continue:
 # Setup stack
 #
        larl    %r15,init_thread_union
+       stg     %r15,__LC_THREAD_INFO   # cache thread info in lowcore
        lg      %r14,__TI_task(%r15)    # cache current in lowcore
        stg     %r14,__LC_CURRENT
        aghi    %r15,1<<(PAGE_SHIFT+THREAD_ORDER) # init_task_union + THREAD_SIZE