Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARC: mm: hack to allow 2 level build with 4 level code

PMD_SHIFT is mapped to PUD_SHIFT or PGD_SHIFT by asm-generic/pgtable-*
but only for !__ASSEMBLY__

tlbex.S asm code has PTRS_PER_PTE which uses PMD_SHIFT hence barfs
for CONFIG_PGTABLE_LEVEL={2,3} and works for 4.

So add a workaround local to tlbex.S - the proper fix is to change
asm-generic/pgtable-* headers to expose the defines for __ASSEMBLY__ too

Signed-off-by: Vineet Gupta <vgupta@kernel.org>

+8
+8
arch/arc/mm/tlbex.S
··· 145 145 ;TLB Miss handling Code 146 146 ;============================================================================ 147 147 148 + #ifndef PMD_SHIFT 149 + #define PMD_SHIFT PUD_SHIFT 150 + #endif 151 + 152 + #ifndef PUD_SHIFT 153 + #define PUD_SHIFT PGDIR_SHIFT 154 + #endif 155 + 148 156 ;----------------------------------------------------------------------------- 149 157 ; This macro does the page-table lookup for the faulting address. 150 158 ; OUT: r0 = PTE faulted on, r1 = ptr to PTE, r2 = Faulting V-address