ARM: zynq: Reserve correct amount of non-DMA RAM
Subsystems (3)
PATCH 1/1 ARM: zynq: Reserve correct amount of non-DMA RAM
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.
kernel")
---
Found when migrating from 4.1 to 4.6.
arch/arm/mach-zynq/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-zynq/common.c +1 -1
@@ -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 = {
Signature · 1 line
2.9.3
Nathan Rossi
Tested-byQuoted 15 lines · Michal Simek
+ Nathan
2016-10-31 17:26 GMT+01:00 Kyle Roeschley <[email protected]>:
Quoted 12 lines
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_reservecall inarm_memblock_init(). Now, reserve the correct amount excplicitly rather than relying onswapper_pg_dir, which is an address and not a size anyway.Fixes 46f5b96 ("ARM: zynq: Reserve not DMAable space in front of thekernel")
Signed-off-by Kyle Roeschley <[email protected]>
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
Quoted 37 lines
Quoted 23 lines
---
Found when migrating from 4.1 to 4.6.arch/arm/mach-zynq/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/mach-zynq/common.c +1
-2@@ -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
Quoted 4 lines
_______________________________________________
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
Quoted 12 lines · Nathan Rossi
Quoted 11 lines · Michal Simek
+ Nathan
2016-10-31 17:26 GMT+01:00 Kyle Roeschley <[email protected]>:
Quoted 8 lines
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_reservecall inarm_memblock_init(). Now, reserve the correct amount excplicitly rather than relying onswapper_pg_dir, which is an address and not a size anyway.
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
Fixes 46f5b96 ("ARM: zynq: Reserve not DMAable space in front of thekernel")
Signed-off-by Kyle Roeschley <[email protected]>Tested-by Nathan Rossi <[email protected]>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
Quoted 44 lines
default yes for
CPU_V7in v4.6) due to padding memory between .head.text and .text, allowing memory below0x80000to be available for allocation as non-reserved memory.Regards,
NathanQuoted 37 lines
Quoted 23 lines
---
Found when migrating from 4.1 to 4.6.arch/arm/mach-zynq/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/mach-zynq/common.c +1
-2@@ -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
Quoted 4 lines
_______________________________________________
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
Michal Simek
AppliedQuoted 20 lines · Nathan Rossi
Quoted 19 lines · Nathan Rossi
Quoted 15 lines · Michal Simek
+ Nathan
2016-10-31 17:26 GMT+01:00 Kyle Roeschley <[email protected]>:
Quoted 12 lines
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_reservecall inarm_memblock_init(). Now, reserve the correct amount excplicitly rather than relying onswapper_pg_dir, which is an address and not a size anyway.Fixes 46f5b96 ("ARM: zynq: Reserve not DMAable space in front of thekernel")
Signed-off-by Kyle Roeschley <[email protected]>Tested-by Nathan Rossi <[email protected]>
Quoted 11 lines
Quoted 1 line
For reference this causes problems with
DEBUG_RODATA(which changed toSorry typo -> s/causes/caused/, as in "... this [incorrect reserving of the lower 512K] caused ...".
Regards,
NathanQuoted 3 lines
default yes for
CPU_V7in v4.6) due to padding memory between .head.text and .text, allowing memory below0x80000to 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>