From patchwork Tue Oct 11 07:47:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 680636 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3stTfQ3tfZz9s5w for ; Tue, 11 Oct 2016 18:49:34 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=ul1F6T1A; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3stTfQ2n1dzDsvb for ; Tue, 11 Oct 2016 18:49:34 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=ul1F6T1A; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pa0-x242.google.com (mail-pa0-x242.google.com [IPv6:2607:f8b0:400e:c03::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3stTcp5jfTzDrSF for ; Tue, 11 Oct 2016 18:48:10 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=ul1F6T1A; dkim-atps=neutral Received: by mail-pa0-x242.google.com with SMTP id qn10so1115568pac.2 for ; Tue, 11 Oct 2016 00:48:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=phXJYcRs+C8mFm9mi4kP2EYBuVFToGC9souMsw7TtG4=; b=ul1F6T1A92c8gzlBBoLMTk05evLYfQGemBCARkDWdjFv5cPPEmKzZUVvBCJ0JfYfyG qEZBjP9TbzFREHAsOitkCnnj/zbkq7wD1Qks34eVBwVAq79stI/vXhCbqCO46D2Xmiil zr7MkiknrF2PWRgSEmGyZGuoFXLUcjw++SZBM+heXYbW/cTucDxJ72oLO3fVVDpvp7z1 gC1URGce2WlBOdQz2KbUzmpLZ9lf82o71PYQ0Tj1mw5S2qo+ifZGfUUhYYTk6CdEK3UP EzyyWLvLqCh05XFTyPWuMparTWGmo/ecLx9pt3qaASPRyhQnUkNIU4nECftwryG43kDC Swbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=phXJYcRs+C8mFm9mi4kP2EYBuVFToGC9souMsw7TtG4=; b=YwbEeZSxqMnG30zYHnn6lSzoGER9wQN0cyBSP0UbpAXw+B9Tf0gLOknIV5Hf+E0B/v LBBMAob6c/204Adv/Zfq56fh0SMu8VaS6ewxvwLpl08yCUrgGjU4UizRLTNuUTT8/sHL IoaFdulG2uQPNPPZorsjRcG/cIDhbeuvVuVpFemercUrw8stF8Fepc3I44QHciZNuLKG DuVVltxWTsHH3vQxfo/D9FYqvtch27O0QMYOZEt29zGsvMWqS8vTrmihI94pM2l9TC1B +z+onJ/jU2ZbVwu6Mbpd1or+HHGAqdKJtHb1/+LNc+kATatNxQozDNtmZTDKh6vUAk2A wj7w== X-Gm-Message-State: AA6/9Rlmsh2W4vctYocJ+iP7nlm2h5g1W1uPFZl0EpYBTEjl9KqM938pPQLyxeE9rxVpuw== X-Received: by 10.66.222.202 with SMTP id qo10mr4691031pac.76.1476172088920; Tue, 11 Oct 2016 00:48:08 -0700 (PDT) Received: from roar.ozlabs.ibm.com (28.9.218.139.dynamic.dsl.dv.iprimus.net.au. [139.218.9.28]) by smtp.gmail.com with ESMTPSA id s6sm2556028pfg.46.2016.10.11.00.48.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Oct 2016 00:48:08 -0700 (PDT) Date: Tue, 11 Oct 2016 18:47:56 +1100 From: Nicholas Piggin To: Guenter Roeck Subject: Re: ppc64 qemu test failure since commit f9aa67142 ("powerpc/64s: Consolidate Alignment 0x600 interrupt") Message-ID: <20161011184756.5f09aa81@roar.ozlabs.ibm.com> In-Reply-To: References: <20161009152121.GA13188@roeck-us.net> <20161010164953.5f37e6e4@roar.ozlabs.ibm.com> Organization: IBM X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon, 10 Oct 2016 07:15:11 -0700 Guenter Roeck wrote: > On 10/09/2016 10:49 PM, Nicholas Piggin wrote: > > On Sun, 9 Oct 2016 08:21:21 -0700 > > Guenter Roeck wrote: > > > >> Nicholas, > >> > >> some of my qemu tests for ppc64 started failing on mainline (and -next). > >> You can find a test log at > >> http://kerneltests.org/builders/qemu-ppc64-master/builds/580/steps/qemubuildcommand/logs/stdio > >> > >> The scripts to run the test are available at > >> https://github.com/groeck/linux-build-test/tree/master/rootfs/ppc64 > >> > >> Bisect points to commit f9aa67142ef26 ("powerpc/64s: Consolidate Alignment 0x600 > >> interrupt"). Bisect log is attached. > >> > >> Since I don't have the means to run the code on a real system, I have no idea > >> if the problem is caused by qemu or by the code. It is interesting, though, that > >> only the 'mac99' tests are affected. > >> > >> Please let me know if there is anything I can do to help tracking down the > >> problem. > > > > Thanks for this. That patch just moves a small amount of code, so it's likely > > that it's caused something to get placed out of range of its caller, or the > > linker started generating a stub for some reason. I can't immediately see the > > problem, but it could be specific to your exact toolchain. > > > > Something that might help, would you be able to put the compiled vmlinux binaries > > from before/after the bad patch somewhere I can grab them? > > > > http://server.roeck-us.net/qemu/ppc64/mac99/ > > 'bad' is at f9aa67142ef26, 'good' is one commit earlier, 'tot' is from top of tree > (b66484cd7470, more specifically). > > Key difference in System.map, from the bad case: > > c000000000005c00 T __end_interrupts > c000000000007000 t end_virt_trampolines > c000000000008000 t 00000010.long_branch.power4_fixup_nap+0 > c000000000008100 t fs_label > c000000000008100 t start_text > > 00000010.long_branch.power4_fixup_nap+0 does not exist in the good case, > and fs_label/start_text are at c000000000008000. > > Toolchain is from poky 1.5.1, which uses gcc 4.8.1 and binutils 2.23.2. > I also tried with the toolchain from poky 1.6, using gcc 4.8.2 and binutils 2.24, > with the same result. Thank you for the quick response, this points to the exact problem. I've attached a patch which should fix the bug. There are some checks I've got planned that will catch this type of thing at build time and be much easier to track down. Thanks, Nick From: Nicholas Piggin Date: Tue, 11 Oct 2016 18:33:26 +1100 Subject: [PATCH] powerpc/64s: fix power4_fixup_nap placement power4_fixup_nap is called from the "common" handlers, not the virt/real handlers, therefore it should itself be a common handler. Placing it down in the trampoline space caused it to go out of reach of its callers, requiring a trampoline inserted at the start of the text section, which breaks the fixed section address calculations. Reported-by: Guenter Roeck Signed-off-by: Nicholas Piggin Tested-by: Guenter Roeck --- arch/powerpc/kernel/exceptions-64s.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 08992f8..f129408 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S @@ -1377,7 +1377,7 @@ __end_interrupts: DEFINE_FIXED_SYMBOL(__end_interrupts) #ifdef CONFIG_PPC_970_NAP -TRAMP_REAL_BEGIN(power4_fixup_nap) +EXC_COMMON_BEGIN(power4_fixup_nap) andc r9,r9,r10 std r9,TI_LOCAL_FLAGS(r11) ld r10,_LINK(r1) /* make idle task do the */