From patchwork Wed Feb 3 13:41:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 61089 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp299233lbl; Wed, 3 Feb 2016 05:43:02 -0800 (PST) X-Received: by 10.66.90.166 with SMTP id bx6mr2209395pab.75.1454506982070; Wed, 03 Feb 2016 05:43:02 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id gk10si9458007pac.103.2016.02.03.05.43.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Feb 2016 05:43:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aQxgw-00006K-DQ; Wed, 03 Feb 2016 13:41:54 +0000 Received: from mail-io0-x22a.google.com ([2607:f8b0:4001:c06::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aQxgs-0008LN-Ch for linux-arm-kernel@lists.infradead.org; Wed, 03 Feb 2016 13:41:51 +0000 Received: by mail-io0-x22a.google.com with SMTP id 9so55437357iom.1 for ; Wed, 03 Feb 2016 05:41:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=awnUpaf3g/DejoqD2ONoq9dN3nuznaVYxmxRVw+cODA=; b=WHkCrO8ZivP6IWeoOwbrir5I2hN5kG5D5MMOnOwhqgQ6xxGLPgK4tXd1xq6ugbeJD+ EGSqzNg6D5z7nrRW9mnujtiMCzgy+KjS+8wdNykq7NJZr+WMb6fF5Qag5JKKa4iBNzph 26MfX0f4bnSE3epi3GfXqtVvSfWahscc9s/RU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=awnUpaf3g/DejoqD2ONoq9dN3nuznaVYxmxRVw+cODA=; b=ToxOtn6ERuy69XEin9NaYC3IXS/h9Uv5vOtjzC0CPgYylfqcgxUjgzVEhWeCWGQFSy JVvG9e0vtZh+AhV+CxT/2A5hwDuXkjnCTwXBAoHbEqyL6TxSbMiqr+NqGDmeIVN2LP0d 9sWF+xCtVwyYMkQg9h0Y5XwiLaVwwIVNRpsPT/+gb1Y4tvoqn4XkvTRRGALYar8dkt3E UoeXMHJYcaA6wLM+R5EyuXAKuYr7U26tF60F3K3IAQa7UXqgHB3+ZB41CRCuxbiSRk7t vLEBoHlg/K8eKDml4oo6s3X9KRKyj8M76QOKwNfGL+gJtnI3SBX/tqxGGjRomdfFTMdJ gXCw== X-Gm-Message-State: AG10YORW/AtGnmixbJ4BQ5HlcMwIDqjXIbc7CpIDWxpAoRNCVdBwSjKdl200ehb/OyUwGJ4HkBi4CWhTZ6fsbvmH MIME-Version: 1.0 X-Received: by 10.107.162.197 with SMTP id l188mr4063398ioe.56.1454506889177; Wed, 03 Feb 2016 05:41:29 -0800 (PST) Received: by 10.36.29.6 with HTTP; Wed, 3 Feb 2016 05:41:29 -0800 (PST) In-Reply-To: References: <1454419174-21290-1-git-send-email-ard.biesheuvel@linaro.org> Date: Wed, 3 Feb 2016 14:41:29 +0100 Message-ID: Subject: Re: [PATCH 0/3] kallsyms: remove special handling for CONFIG_ARM From: Ard Biesheuvel To: Chris Brandt X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160203_054150_763738_DE73F854 X-CRM114-Status: GOOD ( 19.27 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:4001:c06:0:0:0:22a listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux@arm.linux.org.uk" , "arnd@arndb.de" , "nico@linaro.org" , "linus.walleij@linaro.org" , "broonie@linaro.org" , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org On 3 February 2016 at 14:33, Chris Brandt wrote: > On 2 Feb 2016, Chris Brandt wrote: >> I then applied the 3 patches and tried again and this time it booted >> up....almost. >> It looks like it makes it all the way up to when it is going to mount >> my rootfs, but then dies. > > > I did some debugging, and here's why I'm crashing. > > > If you look at my System.map file, you'll see that I've got 2 "__stubs_start" symbols. > > One at 0x bf353edc, the other at 0x bf353ee0. > > bf353edc T __stubs_start This is a global symbol > bf353edc T _etext > bf353ee0 t __stubs_start This is a local symbol > bf353ee4 t vector_rst > bf353f00 t vector_irq > bf353f80 t vector_dabt > bf354000 t vector_pabt > bf354080 t vector_und > bf354100 t vector_addrexcptn > bf354120 T vector_fiq > bf3541a0 T __stubs_end > bf3541a0 T __vectors_start > bf3541c0 t __mmap_switched > bf3541c0 T __vectors_end > > > So, when you get to early_trap_init(), it grabs the first __stubs_start for the memcpy: > > memcpy((void *)vectors + 0x1000, __stubs_start, __stubs_end - __stubs_start); > Indeed. It grabs the first one, which is the one defined by the linker script. > > And when a printed out the destination, I get: > > Stubs at c09ff000 :00000000 BF006F20 EF9F0000 EA000064 etc... > > Notice the first entry is 0....that's not right...and we know it's using that first __stubs_start symbol. > The first quantity after __stubs_start should be the address of vector_swi. Can you check if the second value coincides with that? > > So, I hacked the code and put an offset of 4 like this: > > memcpy((void *)vectors + 0x1000, __stubs_start+4, __stubs_end - (__stubs_start+4)); > > > And sure enough it booted fine. > > > So, why are there 2 __stubs_start symbols??? > I haven't figured that one out yet. > One defined by entry-armv.S and one defined by the linker script > And, I'm assuming you guys don't have 2 __stubs_start symbols either, correct? > Yes, we do. This is caused by the fact that __stubs_start is not aligned correctly on XIP. Could you try this, please? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index 7160658fd5d4..a5b8e7b80d17 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -164,8 +164,8 @@ SECTIONS * The vectors and stubs are relocatable code, and the * only thing that matters is their relative offsets */ - __stubs_start = .; .stubs : { + __stubs_start = .; *(.stubs) } __stubs_end = .;