Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754750AbcKJJ5O (ORCPT ); Thu, 10 Nov 2016 04:57:14 -0500 Received: from mail-qk0-f195.google.com ([209.85.220.195]:34608 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752513AbcKJJ5M (ORCPT ); Thu, 10 Nov 2016 04:57:12 -0500 MIME-Version: 1.0 In-Reply-To: References: <20161031162617.10565-1-kyle.roeschley@ni.com> From: Nathan Rossi Date: Thu, 10 Nov 2016 19:57:11 +1000 Message-ID: Subject: Re: [PATCH] ARM: zynq: Reserve correct amount of non-DMA RAM To: Michal Simek , Kyle Roeschley Cc: linux-arm , linux@armlinux.org.uk, Soren Brinkmann , LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2467 Lines: 72 On 10 November 2016 at 19:33, Nathan Rossi wrote: > On 10 November 2016 at 18:41, Michal Simek wrote: >> + Nathan >> >> 2016-10-31 17:26 GMT+01:00 Kyle Roeschley : >>> >>> On Zynq, we haven't been reserving the correct amount of DMA-incapable >>> RAM to keep DMA away from it (per the Zynq TRM Section 4.1, it should be >>> the first 512k). In older kernels, this was masked by the >>> memblock_reserve call in arm_memblock_init(). Now, reserve the correct >>> amount excplicitly rather than relying on swapper_pg_dir, which is an >>> address and not a size anyway. >>> >>> Fixes: 46f5b96 ("ARM: zynq: Reserve not DMAable space in front of the >>> kernel") >>> >>> Signed-off-by: Kyle Roeschley > > Tested-by: Nathan Rossi > > For reference this causes problems with DEBUG_RODATA (which changed to Sorry typo -> s/causes/caused/, as in "... this [incorrect reserving of the lower 512K] caused ...". Regards, Nathan > default yes for CPU_V7 in v4.6) due to padding memory between > .head.text and .text, allowing memory below 0x80000 to be available > for allocation as non-reserved memory. > > Regards, > Nathan > >>> --- >>> Found when migrating from 4.1 to 4.6. >>> >>> arch/arm/mach-zynq/common.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c >>> index 6cefdb8..75885bc 100644 >>> --- a/arch/arm/mach-zynq/common.c >>> +++ b/arch/arm/mach-zynq/common.c >>> @@ -59,7 +59,7 @@ void __iomem *zynq_scu_base; >>> static void __init zynq_memory_init(void) >>> { >>> if (!__pa(PAGE_OFFSET)) >>> - memblock_reserve(__pa(PAGE_OFFSET), __pa(swapper_pg_dir)); >>> + memblock_reserve(__pa(PAGE_OFFSET), 0x80000); >>> } >>> >>> static struct platform_device zynq_cpuidle_device = { >>> -- >>> 2.9.3 >>> >>> >>> _______________________________________________ >>> linux-arm-kernel mailing list >>> linux-arm-kernel@lists.infradead.org >>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel >> >> >> >> >> -- >> Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91 >> w: www.monstr.eu p: +42-0-721842854 >> Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/ >> Maintainer of Linux kernel - Xilinx Zynq ARM architecture >> Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform