* [PATCH] ARM: zynq: Reserve correct amount of non-DMA RAM
@ 2016-10-31 16:26 Kyle Roeschley
[not found] ` <CAHTX3d+8kBYQwcUUcL1Z71Geij4EU3pjcv29=r8ndqSLW8iZDw@mail.gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Kyle Roeschley @ 2016-10-31 16:26 UTC (permalink / raw)
To: linux-arm-kernel
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 <kyle.roeschley@ni.com>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread[parent not found: <CAHTX3d+8kBYQwcUUcL1Z71Geij4EU3pjcv29=r8ndqSLW8iZDw@mail.gmail.com>]
* [PATCH] ARM: zynq: Reserve correct amount of non-DMA RAM [not found] ` <CAHTX3d+8kBYQwcUUcL1Z71Geij4EU3pjcv29=r8ndqSLW8iZDw@mail.gmail.com> @ 2016-11-10 9:33 ` Nathan Rossi 2016-11-10 9:57 ` Nathan Rossi 0 siblings, 1 reply; 4+ messages in thread From: Nathan Rossi @ 2016-11-10 9:33 UTC (permalink / raw) To: linux-arm-kernel On 10 November 2016 at 18:41, Michal Simek <monstr@monstr.eu> wrote: > + Nathan > > 2016-10-31 17:26 GMT+01:00 Kyle Roeschley <kyle.roeschley@ni.com>: >> >> 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 <kyle.roeschley@ni.com> Tested-by: Nathan Rossi <nathan@nathanrossi.com> For reference this causes problems with DEBUG_RODATA (which changed to 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 at 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ARM: zynq: Reserve correct amount of non-DMA RAM 2016-11-10 9:33 ` Nathan Rossi @ 2016-11-10 9:57 ` Nathan Rossi 2016-11-14 15:10 ` Michal Simek 0 siblings, 1 reply; 4+ messages in thread From: Nathan Rossi @ 2016-11-10 9:57 UTC (permalink / raw) To: linux-arm-kernel On 10 November 2016 at 19:33, Nathan Rossi <nathan@nathanrossi.com> wrote: > On 10 November 2016 at 18:41, Michal Simek <monstr@monstr.eu> wrote: >> + Nathan >> >> 2016-10-31 17:26 GMT+01:00 Kyle Roeschley <kyle.roeschley@ni.com>: >>> >>> 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 <kyle.roeschley@ni.com> > > Tested-by: Nathan Rossi <nathan@nathanrossi.com> > > 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 at 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ARM: zynq: Reserve correct amount of non-DMA RAM 2016-11-10 9:57 ` Nathan Rossi @ 2016-11-14 15:10 ` Michal Simek 0 siblings, 0 replies; 4+ messages in thread From: Michal Simek @ 2016-11-14 15:10 UTC (permalink / raw) To: linux-arm-kernel On 10.11.2016 10:57, Nathan Rossi wrote: > On 10 November 2016 at 19:33, Nathan Rossi <nathan@nathanrossi.com> wrote: >> On 10 November 2016 at 18:41, Michal Simek <monstr@monstr.eu> wrote: >>> + Nathan >>> >>> 2016-10-31 17:26 GMT+01:00 Kyle Roeschley <kyle.roeschley@ni.com>: >>>> >>>> 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 <kyle.roeschley@ni.com> >> >> Tested-by: Nathan Rossi <nathan@nathanrossi.com> >> >> 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. Applied to zynq/soc https://github.com/Xilinx/linux-xlnx/commits/zynq/soc Thanks, Michal -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: OpenPGP digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161114/08ba1daa/attachment.sig> ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-11-14 15:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-31 16:26 [PATCH] ARM: zynq: Reserve correct amount of non-DMA RAM Kyle Roeschley
[not found] ` <CAHTX3d+8kBYQwcUUcL1Z71Geij4EU3pjcv29=r8ndqSLW8iZDw@mail.gmail.com>
2016-11-10 9:33 ` Nathan Rossi
2016-11-10 9:57 ` Nathan Rossi
2016-11-14 15:10 ` Michal Simek
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox