From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53DDFC433E0 for ; Wed, 17 Mar 2021 16:20:43 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C339364F0F for ; Wed, 17 Mar 2021 16:20:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C339364F0F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=xoWTN8BRi/rukp9s5OzgP4goixLBoRjHASM55MUe8ts=; b=Fst2l2mO1Fh+cEbG+s2wnNYpR m4jTU0tdLafyYz33/9pQ4MvmIr9l57Xm43BY7+GmjfiHqthporHiwIhcQrJE/mttabGc9EzVOsHoL bmjQur44sUqTuwT2YXc1Ka2rnNPWvaKnDfFaCxe+rXQpMSTNua2XzBuzhk3/0s2bz8BuD9iew/b53 GANSoJjLPmRsgN1I/GpKEGvGnieJw2AOoucScTSSzGL8MC3zOLqq94OxdvVNCoLxgCcdg36QWla5A sVZicudQpkE5nJC7+QkIlz+RphgXJHCkrKiTs+j5M/6lk2B9VVbgQ23mtcVKleWXPgZ1XFSj/EvSz T0aWLZFqg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lMYsp-003XKd-Qt; Wed, 17 Mar 2021 16:18:56 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lMYsh-003XIh-PA for linux-arm-kernel@lists.infradead.org; Wed, 17 Mar 2021 16:18:51 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8DB3A60C41; Wed, 17 Mar 2021 16:18:42 +0000 (UTC) Date: Wed, 17 Mar 2021 16:18:39 +0000 From: Catalin Marinas To: Arnd Bergmann Cc: Will Deacon , Nathan Chancellor , Nick Desaulniers , Arnd Bergmann , Kees Cook , Mark Brown , Vincenzo Frascino , Geert Uytterhoeven , Kristina Martsenko , Ionela Voinescu , Mark Rutland , Andrew Scull , David Brazdil , Marc Zyngier , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH] [RFC] arm64: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION Message-ID: <20210317161838.GF12269@arm.com> References: <20210225112122.2198845-1-arnd@kernel.org> <20210317143757.GD12269@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210317143757.GD12269@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210317_161848_483975_417AE73B X-CRM114-Status: GOOD ( 17.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Mar 17, 2021 at 02:37:57PM +0000, Catalin Marinas wrote: > On Thu, Feb 25, 2021 at 12:20:56PM +0100, Arnd Bergmann wrote: > > diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S > > index bad2b9eaab22..926cdb597a45 100644 > > --- a/arch/arm64/kernel/vmlinux.lds.S > > +++ b/arch/arm64/kernel/vmlinux.lds.S > > @@ -217,7 +217,7 @@ SECTIONS > > INIT_CALLS > > CON_INITCALL > > INIT_RAM_FS > > - *(.init.altinstructions .init.bss .init.bss.*) /* from the EFI stub */ > > + *(.init.altinstructions .init.data.* .init.bss .init.bss.*) /* from the EFI stub */ > > INIT_DATA already covers .init.data and .init.data.*, so I don't think > we need this change. Ah, INIT_DATA only covers init.data.* (so no dot in front). The above is needed for the EFI stub. However, I gave this a quick try and under Qemu with -cpu max and -smp 2 (or more) it fails as below. I haven't debugged but the lr points to just after the switch_to() call. Maybe some section got discarded and we patched in the wrong instructions. It is fine with -cpu host or -smp 1. -------------------8<------------------------ smp: Bringing up secondary CPUs ... Detected PIPT I-cache on CPU1 CPU1: Booted secondary processor 0x0000000001 [0x000f0510] Unable to handle kernel paging request at virtual address eb91d81ad2971160 Mem abort info: ESR = 0x86000004 EC = 0x21: IABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 [eb91d81ad2971160] address between user and kernel address ranges Internal error: Oops: 86000004 [#1] PREEMPT SMP Modules linked in: CPU: 1 PID: 16 Comm: migration/1 Not tainted 5.12.0-rc3-00002-g128e977c1322 #1 Stopper: 0x0 <- 0x0 pstate: 60000085 (nZCv daIf -PAN -UAO -TCO BTYPE=--) pc : 0xeb91d81ad2971160 lr : __schedule+0x230/0x6b8 sp : ffff80001009bd60 x29: ffff80001009bd60 x28: 0000000000000000 x27: ffff0000000a6760 x26: ffff0000000b7540 x25: 0080000000000000 x24: ffffd81ad3969000 x23: ffff0000000a6200 x22: 6ee0d81ad2971658 x21: ffff0000000a6200 x20: ffff000000080000 x19: ffff00007fbc6bc0 x18: 0000000000000030 x17: 0000000000000000 x16: 0000000000000000 x15: 00008952b30a9a9e x14: 0000000000000366 x13: 0000000000000192 x12: 0000000000000000 x11: 0000000000000003 x10: 00000000000009b0 x9 : ffff80001009bd30 x8 : ffff0000000a6c10 x7 : ffff00007fbc6cc0 x6 : 00000000fffedb30 x5 : 00000000ffffffff x4 : 0000000000000000 x3 : 0000000000000008 x2 : 0000000000000000 x1 : ffff0000000a6200 x0 : ffff0000000a3800 Call trace: 0xeb91d81ad2971160 schedule+0x70/0x108 schedule_preempt_disabled+0x24/0x40 __kthread_parkme+0x68/0xd0 kthread+0x138/0x170 ret_from_fork+0x10/0x30 Code: bad PC value ---[ end trace af3481062ecef3e7 ]--- -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel