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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'powerpc-5.1-7' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fix from Michael Ellerman:
"One regression fix.

Changes we merged to STRICT_KERNEL_RWX on 32-bit were causing crashes
under load on some machines depending on memory layout.

Thanks to Christophe Leroy"

* tag 'powerpc-5.1-7' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/32s: Fix BATs setting with CONFIG_STRICT_KERNEL_RWX

+14 -4
+14 -4
arch/powerpc/mm/ppc_mmu_32.c
··· 98 98 return -1; 99 99 } 100 100 101 + /* 102 + * This function calculates the size of the larger block usable to map the 103 + * beginning of an area based on the start address and size of that area: 104 + * - max block size is 8M on 601 and 256 on other 6xx. 105 + * - base address must be aligned to the block size. So the maximum block size 106 + * is identified by the lowest bit set to 1 in the base address (for instance 107 + * if base is 0x16000000, max size is 0x02000000). 108 + * - block size has to be a power of two. This is calculated by finding the 109 + * highest bit set to 1. 110 + */ 101 111 static unsigned int block_size(unsigned long base, unsigned long top) 102 112 { 103 113 unsigned int max_size = (cpu_has_feature(CPU_FTR_601) ? 8 : 256) << 20; 104 - unsigned int base_shift = (fls(base) - 1) & 31; 114 + unsigned int base_shift = (ffs(base) - 1) & 31; 105 115 unsigned int block_shift = (fls(top - base) - 1) & 31; 106 116 107 117 return min3(max_size, 1U << base_shift, 1U << block_shift); ··· 167 157 168 158 unsigned long __init mmu_mapin_ram(unsigned long base, unsigned long top) 169 159 { 170 - int done; 160 + unsigned long done; 171 161 unsigned long border = (unsigned long)__init_begin - PAGE_OFFSET; 172 162 173 163 if (__map_without_bats) { ··· 179 169 return __mmu_mapin_ram(base, top); 180 170 181 171 done = __mmu_mapin_ram(base, border); 182 - if (done != border - base) 172 + if (done != border) 183 173 return done; 184 174 185 - return done + __mmu_mapin_ram(border, top); 175 + return __mmu_mapin_ram(border, top); 186 176 } 187 177 188 178 void mmu_mark_initmem_nx(void)