Revision a6335fa11e08fc386740557b2a4c1b7ff34bc499 authored by Alexander Sverdlin on 02 July 2015, 15:16:01 UTC, committed by Ralf Baechle on 09 July 2015, 09:02:59 UTC
Commit f9a7febd leads to a fact that mapstart and therefore a page bitmap for
bootmem allocator immediately follows initrd_end. This doesn't always work
well on Octeon, where there are holes in PFN ranges (refer to 5b3b1688 and
4MB-aligned PFN allocation). Depending on the inird location it could happen,
that mapstart would be in an area not allocated by plat_mem_setup() in
arch/mips/cavium-octeon/setup.c, but in the alignment hole between initrd and
the next PFN area. Later on this memory will be unconditionally made available
to buddy allocator at the end of free_all_bootmem_core() (mm/bootmem.c).
All of this results in Linux using the memory not designated for Linux in
Octeon's plat_mem_setup(), which in turn means corruption of the memory used
by another OS/baremetal code on the same SoC.

It doesn't look to me as a problem of Octeon platform code, but rather as an
inability of f9a7febd to deal correctly with the fragmented memory-mappings.
Proposed fix moves the check for initrd address to the same calculation-loop
in bootmem_init() (arch/mips/kernel/setup.c), which also accounts for kernel
code location. This should result in mapstart located starting from the first
PFN area after kernel code AND initrd.

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
Cc: linux-mips@linux-mips.org
Cc: David Daney <david.daney@cavium.com>
Cc: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Cc: Huacai Chen <chenhc@lemote.com>
Cc: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
Cc: Joe Perches <joe@perches.com>
Cc: Steven J. Hill <Steven.Hill@imgtec.com>
Cc: Yusuf Khan <yusuf.khan@nokia.com>
Cc: Michael Kreuzer <michael.kreuzer@nokia.com>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Patchwork: https://patchwork.linux-mips.org/patch/10594/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent 7928eb0
History
File Mode Size
Kconfig -rw-r--r-- 23.1 KB
Makefile -rw-r--r-- 2.5 KB
act_api.c -rw-r--r-- 23.2 KB
act_bpf.c -rw-r--r-- 8.0 KB
act_connmark.c -rw-r--r-- 4.6 KB
act_csum.c -rw-r--r-- 12.8 KB
act_gact.c -rw-r--r-- 4.9 KB
act_ipt.c -rw-r--r-- 7.3 KB
act_mirred.c -rw-r--r-- 6.1 KB
act_nat.c -rw-r--r-- 6.7 KB
act_pedit.c -rw-r--r-- 5.5 KB
act_police.c -rw-r--r-- 9.0 KB
act_simple.c -rw-r--r-- 4.5 KB
act_skbedit.c -rw-r--r-- 5.2 KB
act_vlan.c -rw-r--r-- 4.6 KB
cls_api.c -rw-r--r-- 14.4 KB
cls_basic.c -rw-r--r-- 6.8 KB
cls_bpf.c -rw-r--r-- 10.8 KB
cls_cgroup.c -rw-r--r-- 5.3 KB
cls_flow.c -rw-r--r-- 16.3 KB
cls_flower.c -rw-r--r-- 18.8 KB
cls_fw.c -rw-r--r-- 9.4 KB
cls_route.c -rw-r--r-- 14.1 KB
cls_rsvp.c -rw-r--r-- 761 bytes
cls_rsvp.h -rw-r--r-- 17.0 KB
cls_rsvp6.c -rw-r--r-- 768 bytes
cls_tcindex.c -rw-r--r-- 13.8 KB
cls_u32.c -rw-r--r-- 23.8 KB
em_canid.c -rw-r--r-- 5.5 KB
em_cmp.c -rw-r--r-- 2.1 KB
em_ipset.c -rw-r--r-- 3.0 KB
em_meta.c -rw-r--r-- 22.3 KB
em_nbyte.c -rw-r--r-- 1.9 KB
em_text.c -rw-r--r-- 3.7 KB
em_u32.c -rw-r--r-- 1.4 KB
ematch.c -rw-r--r-- 14.6 KB
sch_api.c -rw-r--r-- 45.1 KB
sch_atm.c -rw-r--r-- 19.1 KB
sch_blackhole.c -rw-r--r-- 1.2 KB
sch_cbq.c -rw-r--r-- 47.2 KB
sch_choke.c -rw-r--r-- 14.8 KB
sch_codel.c -rw-r--r-- 7.8 KB
sch_drr.c -rw-r--r-- 11.4 KB
sch_dsmark.c -rw-r--r-- 11.3 KB
sch_fifo.c -rw-r--r-- 4.1 KB
sch_fq.c -rw-r--r-- 20.5 KB
sch_fq_codel.c -rw-r--r-- 15.7 KB
sch_generic.c -rw-r--r-- 23.8 KB
sch_gred.c -rw-r--r-- 14.3 KB
sch_hfsc.c -rw-r--r-- 40.9 KB
sch_hhf.c -rw-r--r-- 21.1 KB
sch_htb.c -rw-r--r-- 42.7 KB
sch_ingress.c -rw-r--r-- 2.5 KB
sch_mq.c -rw-r--r-- 5.8 KB
sch_mqprio.c -rw-r--r-- 10.5 KB
sch_multiq.c -rw-r--r-- 9.3 KB
sch_netem.c -rw-r--r-- 26.3 KB
sch_pie.c -rw-r--r-- 15.5 KB
sch_plug.c -rw-r--r-- 6.7 KB
sch_prio.c -rw-r--r-- 8.4 KB
sch_qfq.c -rw-r--r-- 42.6 KB
sch_red.c -rw-r--r-- 8.8 KB
sch_sfb.c -rw-r--r-- 16.4 KB
sch_sfq.c -rw-r--r-- 21.7 KB
sch_tbf.c -rw-r--r-- 13.9 KB
sch_teql.c -rw-r--r-- 12.0 KB

back to top