From patchwork Mon Jun 13 14:45:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 12879620 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 C20BACCA482 for ; Mon, 13 Jun 2022 14:47:30 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MCQ+woomlV8dT8QBBZtVJS7X0kE+WUgumFBnV5JJ/q4=; b=SMi2ljfPOiHxPh oW3MpB1JaVOgua1txN9FedZcVqHiP3lA2LTK48RFp8KD3tg+uap7zckt5BcJFIVu1yKBdTnnmMd0l jiHhSdPv5w5m67bGmm6lOZaDW82wxxBvDzj+kuWe/j55E8Pq+P9ki5pC82j1aBilZUYMJ7rBTCh8a 99blQt84350PD6VEzCN9RImw7Nwg+Aa01m0jiomT5KisBcNzkg+IJY6IOVR3HMdca6Hx8ird3GaDs rTkbezrUIxzezc60oumcIUG4UP4KpcNW7RAM7wwR1gVixpppbwUK0TbAHlJPK4aiHPglXImwGQljW clBOjJDfqOHBd2eobYMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o0lKn-004GUO-Dv; Mon, 13 Jun 2022 14:46:29 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o0lKR-004GJn-Bc for linux-arm-kernel@lists.infradead.org; Mon, 13 Jun 2022 14:46:08 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DD0A661408; Mon, 13 Jun 2022 14:46:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A959C3411C; Mon, 13 Jun 2022 14:46:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655131566; bh=lhYIHBai1Lir1BmRVp4tQxiQ+aicdQRyf48zl2TDTqk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q5i4+21brkA5tpmYU/P4hwrm6ErfXwByAhVXW+xVV19NOpFRpv019LVZe2FfL9eKa WLd2FQ7pbdV7vRSVIUtbrY3/ysUm52+5jUxlo6XsbkpY/AMu5bL/+faAmGpRAOyffP mu4ZKmSGfDVndwvKq+kpSKuNr1h/Rdx83pYpF4sz4Bf+w/Irnn7xis9qTDD75v4Qds JUUgAMC5cnX0iyk8Bjhbs4bO9wYkOUE8sw6CgQugWpfvB9chJjhH77vJMGx0nesZkB snmitNKwH2in0GTHPgbBhWojtynIufQEH3b32Qvwjocfu3Nvt+QJ+FECTBBiI/3sH1 5l0wksszeTkJg== From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Cc: linux-hardening@vger.kernel.org, Ard Biesheuvel , Marc Zyngier , Will Deacon , Mark Rutland , Kees Cook , Catalin Marinas , Mark Brown , Anshuman Khandual Subject: [PATCH v4 01/26] arm64: head: move kimage_vaddr variable into C file Date: Mon, 13 Jun 2022 16:45:25 +0200 Message-Id: <20220613144550.3760857-2-ardb@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220613144550.3760857-1-ardb@kernel.org> References: <20220613144550.3760857-1-ardb@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1306; h=from:subject; bh=lhYIHBai1Lir1BmRVp4tQxiQ+aicdQRyf48zl2TDTqk=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBip01sIyP22Uq9ZS8Y/nWKp2AkTlaKQSqULFNQbUO8 CJDTWXGJAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCYqdNbAAKCRDDTyI5ktmPJLTADA CbJCXd3+rZESFYA304+QnrYYW6fTNc1MBE0QDDkj2/Y3ZAzpoSxU6I+OueKVwm3ePbCWm/1oZxBEOk MZMEm+J9cMLrmn0+M9MSQkKA+wqJ21yh4XKruQhBDWSDIu8db6iz42vz2p11plC8EOnSzwrmvADoCC A9bWYKS6l8reCyefalK4012p2Rsoyd2EuR5PPjTKjOdKjSXb6k1g/Pj7ouGFCWWThSeifaJCLu1vkk TPmbrseDoZAmz1goOejw0j9OBLQf98jupzisDknvdQD0h+GuC03tBJWzXgDOZ3R6E88peVFFKKMOG9 Xw1zZBheyN6xBfzupoKVADIZwAnbsiURq4ssI1sFC/BhthPUYCfe/coW3klrV1C7sXt4HlWTjangT3 EL2uyfygOUzIomyNaAhBUwC8lMgXQZQsSplyGZr1sA/hD5toPkAilmkez+x2EoBUtw8EUmkrBfzL+i rGIGdaiVntSjoDjuIbMzuoz3bJ7Zv8sheacYXL2qCMOYc= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220613_074607_478678_ED90E41C X-CRM114-Status: GOOD ( 12.69 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This variable definition does not need to be in head.S so move it out. Signed-off-by: Ard Biesheuvel Reviewed-by: Anshuman Khandual --- arch/arm64/kernel/head.S | 7 ------- arch/arm64/mm/mmu.c | 3 +++ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S index 6a98f1a38c29..1cdecce552bb 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S @@ -469,13 +469,6 @@ SYM_FUNC_START_LOCAL(__primary_switched) ASM_BUG() SYM_FUNC_END(__primary_switched) - .pushsection ".rodata", "a" -SYM_DATA_START(kimage_vaddr) - .quad _text -SYM_DATA_END(kimage_vaddr) -EXPORT_SYMBOL(kimage_vaddr) - .popsection - /* * end early head section, begin head code that is also used for * hotplug and needs to have the same protections as the text region diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index c5563ff990da..7148928e3932 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -49,6 +49,9 @@ u64 idmap_ptrs_per_pgd = PTRS_PER_PGD; u64 __section(".mmuoff.data.write") vabits_actual; EXPORT_SYMBOL(vabits_actual); +u64 kimage_vaddr __ro_after_init = (u64)&_text; +EXPORT_SYMBOL(kimage_vaddr); + u64 kimage_voffset __ro_after_init; EXPORT_SYMBOL(kimage_voffset);