Skip to content

Commit 8475d8f

Browse files
committed
parisc: Fix initial page table creation for boot
The KERNEL_INITIAL_ORDER value defines the initial size (usually 32 or 64 MB) of the page table during bootup. Up until now the whole area was initialized with PTE entries, but there was no check if we filled too many entries. Change the code to fill up with so many entries that the "_end" symbol can be reached by the kernel, but not more entries than actually fit into the initial PTE tables. Signed-off-by: Helge Deller <deller@gmx.de> Cc: <stable@vger.kernel.org> # v6.0+
1 parent 17c144f commit 8475d8f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

arch/parisc/kernel/head.S

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ ENTRY(parisc_kernel_start)
5656

5757
.import __bss_start,data
5858
.import __bss_stop,data
59+
.import __end,data
5960

6061
load32 PA(__bss_start),%r3
6162
load32 PA(__bss_stop),%r4
@@ -149,7 +150,11 @@ $cpu_ok:
149150
* everything ... it will get remapped correctly later */
150151
ldo 0+_PAGE_KERNEL_RWX(%r0),%r3 /* Hardwired 0 phys addr start */
151152
load32 (1<<(KERNEL_INITIAL_ORDER-PAGE_SHIFT)),%r11 /* PFN count */
152-
load32 PA(pg0),%r1
153+
load32 PA(_end),%r1
154+
SHRREG %r1,PAGE_SHIFT,%r1 /* %r1 is PFN count for _end symbol */
155+
cmpb,<<,n %r11,%r1,1f
156+
copy %r1,%r11 /* %r1 PFN count smaller than %r11 */
157+
1: load32 PA(pg0),%r1
153158

154159
$pgt_fill_loop:
155160
STREGM %r3,ASM_PTE_ENTRY_SIZE(%r1)

0 commit comments

Comments
 (0)