Skip to content

Commit afca252

Browse files
hdellerjkkm
authored andcommitted
parisc: allow to build with 16k default kernel page size
Introduce new convert_for_tlb_insert20 macro and use it to replace assembler statements with hardcoded constants. This change allows the parisc64 kernel to boot with 16kb default kernel page size, aka CONFIG_PARISC_PAGE_SIZE_16KB=y. Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
1 parent 445c088 commit afca252

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

‎arch/parisc/kernel/entry.S‎

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,18 @@
505505
STREG \pte,0(\ptep)
506506
.endm
507507

508+
/* bitshift difference between a PFN (based on kernel's PAGE_SIZE)
509+
* to a CPU TLB 4k PFN (4k => 12 bits to shift) */
510+
#define PAGE_ADD_SHIFT (PAGE_SHIFT-12)
511+
512+
/* Drop prot bits and convert to page addr for iitlbt and idtlbt */
513+
.macro convert_for_tlb_insert20 pte
514+
extrd,u \pte,(63-ASM_PFN_PTE_SHIFT)+(63-58)+PAGE_ADD_SHIFT,\
515+
64-PAGE_SHIFT-PAGE_ADD_SHIFT,\pte
516+
depdi _PAGE_SIZE_ENCODING_DEFAULT,63,\
517+
(63-58)+PAGE_ADD_SHIFT,\pte
518+
.endm
519+
508520
/* Convert the pte and prot to tlb insertion values. How
509521
* this happens is quite subtle, read below */
510522
.macro make_insert_tlb spc,pte,prot
@@ -544,8 +556,7 @@
544556
depi 1,12,1,\prot
545557

546558
/* Drop prot bits and convert to page addr for iitlbt and idtlbt */
547-
extrd,u \pte,(63-ASM_PFN_PTE_SHIFT)+(63-58),64-PAGE_SHIFT,\pte
548-
depdi _PAGE_SIZE_ENCODING_DEFAULT,63,63-58,\pte
559+
convert_for_tlb_insert20 \pte
549560
.endm
550561

551562
/* Identical macro to make_insert_tlb above, except it
@@ -1244,10 +1255,9 @@ nadtlb_check_flush_20w:
12441255
depdi,z 7,7,3,prot
12451256
depdi 1,10,1,prot
12461257

1247-
/* Get rid of prot bits and convert to page addr for idtlbt */
1258+
/* Drop prot bits from pte and convert to page addr for idtlbt */
1259+
convert_for_tlb_insert20 pte
12481260

1249-
depdi 0,63,12,pte
1250-
extrd,u pte,56,52,pte
12511261
idtlbt pte,prot
12521262

12531263
rfir
@@ -1403,10 +1413,9 @@ nadtlb_check_flush_20:
14031413
depdi,z 7,7,3,prot
14041414
depdi 1,10,1,prot
14051415

1406-
/* Get rid of prot bits and convert to page addr for idtlbt */
1416+
/* Drop prot bits from pte and convert to page addr for idtlbt */
1417+
convert_for_tlb_insert20 pte
14071418

1408-
depdi 0,63,12,pte
1409-
extrd,u pte,56,32,pte
14101419
idtlbt pte,prot
14111420

14121421
rfir

0 commit comments

Comments
 (0)