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 2F51EC4167B for ; Thu, 30 Nov 2023 05:39:38 +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:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TLs/BXYs/iowKkKHKoCTswiVPNj1/Wd/rpf7smrRPjM=; b=uAMBjr/2As4Roe EQ4a9dIOuTlwYlUTAjztxczhlH6tC0uvI7UPFZuC3SbC4IeTGdrrV6v2q8Z59S/lyEyRX2MkWeKum qa9gGqrQhsBeIrqm29fsktlL6oAB0WXFqpNlqoedB+QUCDZImUlWqnV+FTdn/JsQInuY80EXxTz9P lM4C3gNEDviE7Uq360rgdnpxpSEOPtigzi3N6ZZjEc4YAFx3BRR8vYHIAjrkwQ/e4h7Kfoi1JJrP1 YQps5/hvvu+uszUkso4I4ZNXbaWhZUwwJ9+kn1K4mgs+/IaBemXvSvrBiRmPfskh0QMkVxIcVvHcG V9yV6hMXjhlAxVceESvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r8ZlZ-009yqz-16; Thu, 30 Nov 2023 05:39:13 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r8ZlW-009yqL-0R for linux-arm-kernel@lists.infradead.org; Thu, 30 Nov 2023 05:39:11 +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 8D5BB1042; Wed, 29 Nov 2023 21:39:52 -0800 (PST) Received: from [10.162.41.8] (a077893.blr.arm.com [10.162.41.8]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3A0FD3F5A1; Wed, 29 Nov 2023 21:39:02 -0800 (PST) Message-ID: <2fabeac2-a1c1-4e10-b7f5-33de8d502e4d@arm.com> Date: Thu, 30 Nov 2023 11:08:59 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 03/41] arm64: mm: get rid of kimage_vaddr global variable Content-Language: en-US To: Ard Biesheuvel , linux-arm-kernel@lists.infradead.org Cc: Ard Biesheuvel , Catalin Marinas , Will Deacon , Marc Zyngier , Mark Rutland , Ryan Roberts , Kees Cook References: <20231129111555.3594833-43-ardb@google.com> <20231129111555.3594833-46-ardb@google.com> From: Anshuman Khandual In-Reply-To: <20231129111555.3594833-46-ardb@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231129_213910_286465_3A842C0F X-CRM114-Status: GOOD ( 19.80 ) 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 11/29/23 16:45, Ard Biesheuvel wrote: > From: Ard Biesheuvel > > We store the address of _text in kimage_vaddr, but since commit > 09e3c22a86f6889d ("arm64: Use a variable to store non-global mappings > decision"), we no longer reference this variable from modules so we no > longer need to export it. > > In fact, we don't need it at all so let's just get rid of it. > > Acked-by: Mark Rutland > Signed-off-by: Ard Biesheuvel There is a checkpatch.pl error for this patch. -------- ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("")' - ie: 'commit 09e3c22a86f6 ("arm64: Use a variable to store non-global mappings decision")' #6: We store the address of _text in kimage_vaddr, but since commit -------- Otherwise LGTM. Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com> > --- > arch/arm64/include/asm/memory.h | 6 ++---- > arch/arm64/kernel/head.S | 2 +- > arch/arm64/mm/mmu.c | 3 --- > 3 files changed, 3 insertions(+), 8 deletions(-) > > diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h > index fde4186cc387..b8d726f951ae 100644 > --- a/arch/arm64/include/asm/memory.h > +++ b/arch/arm64/include/asm/memory.h > @@ -182,6 +182,7 @@ > #include <linux/types.h> > #include <asm/boot.h> > #include <asm/bug.h> > +#include <asm/sections.h> > > #if VA_BITS > 48 > extern u64 vabits_actual; > @@ -193,15 +194,12 @@ extern s64 memstart_addr; > /* PHYS_OFFSET - the physical address of the start of memory. */ > #define PHYS_OFFSET ({ VM_BUG_ON(memstart_addr & 1); memstart_addr; }) > > -/* the virtual base of the kernel image */ > -extern u64 kimage_vaddr; > - > /* the offset between the kernel virtual and physical mappings */ > extern u64 kimage_voffset; > > static inline unsigned long kaslr_offset(void) > { > - return kimage_vaddr - KIMAGE_VADDR; > + return (u64)&_text - KIMAGE_VADDR; > } > > #ifdef CONFIG_RANDOMIZE_BASE > diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S > index 7b236994f0e1..cab7f91949d8 100644 > --- a/arch/arm64/kernel/head.S > +++ b/arch/arm64/kernel/head.S > @@ -482,7 +482,7 @@ SYM_FUNC_START_LOCAL(__primary_switched) > > str_l x21, __fdt_pointer, x5 // Save FDT pointer > > - ldr_l x4, kimage_vaddr // Save the offset between > + adrp x4, _text // Save the offset between > sub x4, x4, x0 // the kernel virtual and > str_l x4, kimage_voffset, x5 // physical mappings > > diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c > index 15f6347d23b6..03c73e9197ac 100644 > --- a/arch/arm64/mm/mmu.c > +++ b/arch/arm64/mm/mmu.c > @@ -52,9 +52,6 @@ u64 vabits_actual __ro_after_init = VA_BITS_MIN; > EXPORT_SYMBOL(vabits_actual); > #endif > > -u64 kimage_vaddr __ro_after_init = (u64)&_text; > -EXPORT_SYMBOL(kimage_vaddr); > - > u64 kimage_voffset __ro_after_init; > EXPORT_SYMBOL(kimage_voffset); > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel