* updated maddy (0.7.1 -> 0.8.1), untested
[t2sde.git] / package / kernel / linux / hotfix-sparc64-sun4u-8g.patch
blob569b4018c0b772734fd631080294d661f5a687db
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/linux/hotfix-sparc64-sun4u-8g.patch
3 # Copyright (C) 2024 The T2 SDE Project
4 #
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
7 #
8 # This patch file is dual-licensed. It is available under the license the
9 # patched project is licensed under, as long as it is an OpenSource license
10 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
11 # of the GNU General Public License version 2 as used by the T2 SDE.
12 # --- T2-COPYRIGHT-NOTE-END ---
14 Unable to handle kernel NULL pointer dereference
15 tsk->{mm,active_mm}->context = 0000000000000000
16 tsk->{mm,active_mm}->pgd = fff00001ff002000
17 \|/ ____ \|/
18 "@'/ .. \`@"
19 /_| \__/ |_\
20 \__U_/
21 swapper(0): Oops [#1]
22 CPU: 0 PID: 0 Comm: swapper Not tainted 6.10.11-t2 #45
23 TSTATE: 0000009980e01602 TPC: 0000000000c5ec98 TNPC: 0000000000c5ec9c Y: f9e69dcb Not tainted
24 TPC: <subsection_map_init+0x50/0x98>
25 g0: 0000000010d7d038 g1: 0000000000000000 g2: 0000000000000000 g3: 0000000000000001
26 g4: 0000000000b95d80 g5: 0000000000000000 g6: 0000000000b84000 g7: 0000000000000000
27 o0: 0000000000000000 o1: ffffffffffffffff o2: 0000000000000000 o3: 0000000000ae1c40
28 o4: 0000000000b87ae8 o5: 0000000000000000 sp: 0000000000b871b1 ret_pc: 0000000000c5ec90
29 RPC: <subsection_map_init+0x48/0x98>
30 l0: 0000000000020000 l1: 0000000000020000 l2: 0000000000b0d730 l3: 0000000000000001
31 l4: 0000000000000000 l5: 0000000000000001 l6: 0000000001dfefbf l7: 00000001ff8f3110
32 i0: 0000000000000000 i1: 00000000000ff7ff i2: 0000000000000001 i3: 000000000001ffff
33 i4: 0000000000000000 i5: 0000000000000007 i6: 0000000000b87261 i7: 0000000000c5a4c8
34 I7: <free_area_init+0x58c/0xc78>
35 Call Trace:
36 [<0000000000c5a4c8>] free_area_init+0x58c/0xc78
37 [<0000000000c509c8>] paging_init+0xd1c/0xdd0
38 [<0000000000c4b848>] setup_arch+0x110/0x774
39 [<0000000000c48664>] start_kernel+0x58/0x778
40 [<0000000000c4b584>] start_early_boot+0x78/0x22c
41 [<00000000009b5264>] tlb_fixup_done+0x4c/0x54
42 [<00000000002f1a28>] 0x2f1a28
43 Disabling lock debugging due to kernel taint
44 Caller[0000000000c5a4c8]: free_area_init+0x58c/0xc78
45 Caller[0000000000c509c8]: paging_init+0xd1c/0xdd0
46 Caller[0000000000c4b848]: setup_arch+0x110/0x774
47 Caller[0000000000c48664]: start_kernel+0x58/0x778
48 Caller[0000000000c4b584]: start_early_boot+0x78/0x22c
49 Caller[00000000009b5264]: tlb_fixup_done+0x4c/0x54
51 --- linux-6.10/arch/sparc/kernel/ktlb.S 2024-07-15 00:43:32.000000000 +0200
52 +++ b/arch/sparc/kernel/ktlb.S 2024-09-24 20:18:35.373344860 +0200
53 @@ -144,7 +144,7 @@
54 brgez,pn %g4, kvmap_dtlb_nonlinear
55 nop
57 -#ifdef CONFIG_DEBUG_PAGEALLOC
58 +#if 1 /* def CONFIG_DEBUG_PAGEALLOC */
59 /* Index through the base page size TSB even for linear
60 * mappings when using page allocation debugging.
62 --- linux-6.10/arch/sparc/mm/init_64.c 2024-07-15 00:43:32.000000000 +0200
63 +++ b/arch/sparc/mm/init_64.c 2024-09-24 20:35:22.566682546 +0200
64 @@ -1891,11 +1891,22 @@
65 static void __init kernel_physical_mapping_init(void)
67 unsigned long i, mem_alloced = 0UL;
68 + unsigned long phys_mem = 0UL;
69 bool use_huge = true;
71 #ifdef CONFIG_DEBUG_PAGEALLOC
72 use_huge = false;
73 #endif
75 + if (tlb_type == cheetah_plus) {
76 + for (i = 0; i < pall_ents; i++)
77 + phys_mem += pall[i].reg_size;
78 + printk("phys_mem: %ld\n", phys_mem);
80 + if (phys_mem > 4294967296)
81 + use_huge = false;
82 + }
84 for (i = 0; i < pall_ents; i++) {
85 unsigned long phys_start, phys_end;