From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965221AbdADRgx (ORCPT ); Wed, 4 Jan 2017 12:36:53 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:33563 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934760AbdADRgr (ORCPT ); Wed, 4 Jan 2017 12:36:47 -0500 Subject: Re: [PATCH v5 2/4] ARM: Define KERNEL_START and KERNEL_END To: Hartley Sweeten , "linux-arm-kernel@lists.infradead.org" , "catalin.marinas@arm.com" References: <20170104011417.1496-1-f.fainelli@gmail.com> <20170104011417.1496-3-f.fainelli@gmail.com> Cc: "nicolas.pitre@linaro.org" , "mark.rutland@arm.com" , "matt@codeblueprint.co.uk" , "will.deacon@arm.com" , "stefan@agner.ch" , "chris.brandt@renesas.com" , "linux-mtd@lists.infradead.org" , "cyrille.pitchen@atmel.com" , "panand@redhat.com" , "boris.brezillon@free-electrons.com" , "pawel.moll@arm.com" , "richard@nod.at" , "linux@armlinux.org.uk" , "ben@decadent.org.uk" , "vladimir.murzin@arm.com" , "keescook@chromium.org" , "arnd@arndb.de" , "labbott@fedoraproject.org" , "jonathan.austin@arm.com" , "ard.biesheuvel@linaro.org" , "linux-kernel@vger.kernel.org" , "computersforpeace@gmail.com" , "dwmw2@infradead.org" , "kirill.shutemov@linux.intel.com" , "js07.lee@samsung.com" From: Florian Fainelli Message-ID: <764f7a9d-243b-617d-3bb6-30b4e5bf4025@gmail.com> Date: Wed, 4 Jan 2017 09:36:39 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/04/2017 07:58 AM, Hartley Sweeten wrote: > On Tuesday, January 03, 2017 6:14 PM, Florian Fainelli wrote: >> >> In preparation for adding CONFIG_DEBUG_VIRTUAL support, define a set of >> common constants: KERNEL_START and KERNEL_END which abstract >> CONFIG_XIP_KERNEL vs. !CONFIG_XIP_KERNEL. Update the code where >> relevant. >> >> Acked-by: Russell King >> Signed-off-by: Florian Fainelli >> --- >> arch/arm/include/asm/memory.h | 7 +++++++ >> arch/arm/mm/init.c | 7 ++----- >> arch/arm/mm/mmu.c | 6 +----- >> 3 files changed, 10 insertions(+), 10 deletions(-) >> >> diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h >> index 76cbd9c674df..bee7511c5098 100644 >> --- a/arch/arm/include/asm/memory.h >> +++ b/arch/arm/include/asm/memory.h >> @@ -111,6 +111,13 @@ >> >> #endif /* !CONFIG_MMU */ >> >> +#ifdef CONFIG_XIP_KERNEL >> +#define KERNEL_START _sdata >> +#else >> +#define KERNEL_START _stext >> +#endif >> +#define KERNEL_END _end >> + >> /* >> * We fix the TCM memories max 32 KiB ITCM resp DTCM at these >> * locations >> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c >> index 370581aeb871..c87d0d5b65f2 100644 >> --- a/arch/arm/mm/init.c >> +++ b/arch/arm/mm/init.c >> @@ -230,11 +230,8 @@ phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align) >> void __init arm_memblock_init(const struct machine_desc *mdesc) >> { >> /* Register the kernel text, kernel data and initrd with memblock. */ >> -#ifdef CONFIG_XIP_KERNEL >> - memblock_reserve(__pa(_sdata), _end - _sdata); >> -#else >> - memblock_reserve(__pa(_stext), _end - _stext); >> -#endif >> + memblock_reserve(__pa(KERNEL_START), _end - KERNEL_START); > > Shouldn't the '_end' above be 'KERNEL_END'? I sort of intentionally not changed that line in order not to make the line exceed 80 columns and make checkpatch whine about it, but if you think this is clearer, I can add this change, since I need to respin to address Laura's feedback anyway. Thanks! -- Florian