From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751955AbcAXHGU (ORCPT ); Sun, 24 Jan 2016 02:06:20 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:54090 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751253AbcAXHGP (ORCPT ); Sun, 24 Jan 2016 02:06:15 -0500 Subject: Re: Problems with commit 'kallsyms: add support for relative offsets in kallsyms address table' (in mmotm) To: Ard Biesheuvel References: <56A431B5.8010505@roeck-us.net> <56A43882.50308@roeck-us.net> Cc: Heiko Carstens , Michael Ellerman , Kees Cook , Andrew Morton , "linux-kernel@vger.kernel.org" From: Guenter Roeck Message-ID: <56A477E1.50509@roeck-us.net> Date: Sat, 23 Jan 2016 23:06:09 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated_sender: linux@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: linux@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: linux@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/23/2016 10:10 PM, Ard Biesheuvel wrote: > > >> On 24 jan. 2016, at 03:35, Guenter Roeck wrote: >> >>> On 01/23/2016 06:06 PM, Guenter Roeck wrote: >>> Hi, >>> >>> I see runtime problems with the current mmotm branch. All qemu mips targets >>> (32 and 64 bit, big and little endian) are stuck in boot after this commit. >>> >>> Bisect points to commit d13682e4d9d2 ("kallsyms: add support for relative offsets >>> in kallsyms address table". Disabling CONFIG_KALLSYMS_BASE_RELATIVE fixes the problem, >>> ie I can boot the image with qemu. >>> >>> Bisect log is attached. >>> >>> Playing with the problem, I found the following: >>> >>> 1) The problem is only seen with a toolchain using binutils 2.22, but not >>> with a toolchain using binutils 2.25. The compiler configuration may be >>> different for both toolchains. >>> 2) Message "kallsyms failure: absolute symbol value 0xffffffff807afd14 out of range >>> in relative mode" (twice) when using the toolchain with binutils 2.22. >>> This does not cause the build to fail, though. >>> 3) kallsyms_sym_address() parameter variable type is "int". In the calling code, >>> the variable type used is "unsigned long". That has no impact on the problem, >>> though. >> >> An additional data point: When using the older toolchain, many symbols in System.map >> are marked "A". >> ffffffff80100000 A _text >> With the more recent toolchain, the same symbols are marked "T". >> ffffffff80100000 T _text >> > > Thanks for the analysis. It is surprising that the build does not fail when this occurs, and the subsequent hangs themselves are probably caused by missing kallsyms data. > Yes, I wondered why the build doesn't fail. Seems odd. > scripts/kallsyms.c ignores all A symbols except _text, which is actually a relative symbol by nature so we can simply assume it is relative (i.e., override it as T) > > Re x86_64 !SMP, any build time errors there as well? Likewise for sparc32? > Yes, same kind of errors for both. For x86_64/nosmp I also get the error message when using the Ubuntu native toolchain, so it doesn't seem to be (directly) related to binutils 2.22 vs. 2.25 for that architecture. Runtime behavior is a bit different for the different architectures. x86_64 dies silently without any console output, mips just hangs, and sparc32 gets a panic with NULL pointer access. Of course, with missing kallsyms data all bets are off. > > Thanks again, and sorry for the trouble, No worries. Hope you'll get this sorted out. Guenter