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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C4F4CC54EE9 for ; Tue, 20 Sep 2022 12:21:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=zvfvo8vkMQVWf5wqAKUALCkdlw/LY7fTe9Oa7FaNaOU=; b=XjDoJlSPMcfAG+ PJNejRFvDqo174x1f5VHs05mgZqWuUqcDdYo1Jv5G1P8zhr5EUJ8qaNS3Nf8pUozlDWt+jGtOeXhC aRrvJQ9tqEojgT8kQctek928nsHzSSHpiXCb9HvKTyDn5UNw1tcH4YLyfQF6dBWt64x3oLNOpt3L+ ioG0hWrd2z6vTHU9YgRfwS6Fpn0wMb8Vucom170alt9eI0Qxlkis6b9Wy6mL6CBBqMaAeA89IlY7X R6omOdmRG3JUJGVBp1qMbM9XGjtMOzfsmI9ZWDgMb6nmfkgxfpwX7PaS+5tzYIOnFmq2ddBncBajR BOMjN3fXs+edPzKKG3VQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oacEu-003eLS-ID; Tue, 20 Sep 2022 12:20:36 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oacEr-003eJs-OK for linux-arm-kernel@lists.infradead.org; Tue, 20 Sep 2022 12:20:35 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0D676169C; Tue, 20 Sep 2022 05:20:38 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.89.45]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 585B83F73D; Tue, 20 Sep 2022 05:20:30 -0700 (PDT) Date: Tue, 20 Sep 2022 13:20:27 +0100 From: Mark Rutland To: "Mohan Rao .vanimina" Cc: Robin Murphy , linux-arm-kernel@lists.infradead.org, Sami Tolvanen , Kees Cook , Nathan Chancellor , Will Deacon Subject: Re: linker script /arch/arm64/kernel/vmlinux.lds build error Message-ID: References: <6f65d65b-0217-10d7-8e0c-d8ec6d95af44@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220920_052033_860509_83A30BC2 X-CRM114-Status: GOOD ( 16.94 ) 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 Thu, Sep 15, 2022 at 09:10:45PM +0530, Mohan Rao .vanimina wrote: > Thanks for the info. Sorry for this delay in the response. > As suggested I have modified the PAGE SIZE granularity from > ARM64_4K_PAGES to ARM64_64K_PAGES in the applicable config file but > still the build is failing with the same linker error. > Kindly note that the build compilation is successful for the case of > when configuring PAGE size to ARM64_16K_PAGES. Though there is some > issue that the device is crashing at bootup itself, compilation was > getting through without any issues for ARM64_16K_PAGES. > I wonder why the ARM64_64K_PAGES scenario is failing, there must be > some sanity checks at the build integration(kernel build tests) that > would have been caught this linker build issue if indeed it's really a > bug or failed due to some in-complete change. Since you're using LTO, your config is clearly divergent from defconfig; if you could share your config it would help a lot. I suspect what's happening here is exactly what the linker error describes: you're building a config without a PMD level (e.g. 64K pages with 42-bit VAs), but there's some code that blindly assumes the PMD level exists and depends on the non-existent PMD_SIZE definition. I suspect you've enabled CFI_CLANG, and the TEXT_CFI_JT section in the linker script, which would explain the problem. I don't understand why that's aligned to anything more than an instruction boundary to begin with. I don't see why it would need to be aligned to 2MB with 4K pages, nor with 512MB with 64K pages. Sami, Kees, Nathan, any idea on where this alignment came from? Will had mentioned this in passing before as bloating the kernel Image size, but I hadn't realsied this also caused a build failure until now. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel