]>
Commit | Line | Data |
---|---|---|
95244f99 GKH |
1 | From foo@baz Wed Dec 6 17:39:55 CET 2017 |
2 | From: Greg Ungerer <gerg@linux-m68k.org> | |
3 | Date: Tue, 5 Sep 2017 22:57:06 +1000 | |
4 | Subject: m68k: fix ColdFire node shift size calculation | |
5 | ||
6 | From: Greg Ungerer <gerg@linux-m68k.org> | |
7 | ||
8 | ||
9 | [ Upstream commit f55ab8f27548ff3431a6567d400c6757c49fd520 ] | |
10 | ||
11 | The m68k pg_data_table is a fix size array defined in arch/m68k/mm/init.c. | |
12 | Index numbers within it are defined based on memory size. But for Coldfire | |
13 | these don't take into account a non-zero physical RAM base address, and this | |
14 | causes us to access past the end of this array at system start time. | |
15 | ||
16 | Change the node shift calculation so that we keep the index inside its range. | |
17 | ||
18 | Reported-by: Angelo Dureghello <angelo@sysam.it> | |
19 | Tested-by: Angelo Dureghello <angelo@sysam.it> | |
20 | Signed-off-by: Greg Ungerer <gerg@linux-m68k.org> | |
21 | Signed-off-by: Sasha Levin <alexander.levin@verizon.com> | |
22 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
23 | --- | |
24 | arch/m68k/mm/mcfmmu.c | 2 +- | |
25 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
26 | ||
27 | --- a/arch/m68k/mm/mcfmmu.c | |
28 | +++ b/arch/m68k/mm/mcfmmu.c | |
29 | @@ -169,7 +169,7 @@ void __init cf_bootmem_alloc(void) | |
30 | max_pfn = max_low_pfn = PFN_DOWN(_ramend); | |
31 | high_memory = (void *)_ramend; | |
32 | ||
33 | - m68k_virt_to_node_shift = fls(_ramend - _rambase - 1) - 6; | |
34 | + m68k_virt_to_node_shift = fls(_ramend - 1) - 6; | |
35 | module_fixup(NULL, __start_fixup, __stop_fixup); | |
36 | ||
37 | /* setup bootmem data */ |