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.

s390/kasan: remove identity mapping support

The identity mapping is created in the decompressor,
there is no need to have the same functionality in
the kasan setup code. Thus, remove it.

Remove the 4KB pages check for first 1MB since there
is no need to take care of the lowcore pages.

Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>

authored by

Alexander Gordeev and committed by
Heiko Carstens
07493a9c 12cf6473

+4 -21
+4 -21
arch/s390/mm/kasan_init.c
··· 75 75 } 76 76 77 77 enum populate_mode { 78 - POPULATE_ONE2ONE, 79 78 POPULATE_MAP, 80 79 POPULATE_ZERO_SHADOW, 81 80 POPULATE_SHALLOW ··· 100 101 pmd_t pmd; 101 102 pte_t pte; 102 103 103 - if (!has_nx) 104 + if (!has_nx) { 104 105 pgt_prot_zero = pgprot_clear_bit(pgt_prot_zero, _PAGE_NOEXEC); 105 - if (!has_nx || mode == POPULATE_ONE2ONE) { 106 106 pgt_prot = pgprot_clear_bit(pgt_prot, _PAGE_NOEXEC); 107 107 sgt_prot = pgprot_clear_bit(sgt_prot, _SEGMENT_ENTRY_NOEXEC); 108 108 } 109 109 110 - /* 111 - * The first 1MB of 1:1 mapping is mapped with 4KB pages 112 - */ 113 110 while (address < end) { 114 111 pg_dir = pgd_offset_k(address); 115 112 if (pgd_none(*pg_dir)) { ··· 162 167 pmd_populate(&init_mm, pm_dir, kasan_early_shadow_pte); 163 168 address = (address + PMD_SIZE) & PMD_MASK; 164 169 continue; 165 - } else if (has_edat && address) { 166 - void *page; 170 + } else if (has_edat) { 171 + void *page = kasan_early_alloc_segment(); 167 172 168 - if (mode == POPULATE_ONE2ONE) { 169 - page = (void *)address; 170 - } else { 171 - page = kasan_early_alloc_segment(); 172 - memset(page, 0, _SEGMENT_SIZE); 173 - } 173 + memset(page, 0, _SEGMENT_SIZE); 174 174 pmd = __pmd(__pa(page)); 175 175 pmd = set_pmd_bit(pmd, sgt_prot); 176 176 set_pmd(pm_dir, pmd); ··· 185 195 void *page; 186 196 187 197 switch (mode) { 188 - case POPULATE_ONE2ONE: 189 - page = (void *)address; 190 - pte = __pte(__pa(page)); 191 - pte = set_pte_bit(pte, pgt_prot); 192 - set_pte(pt_dir, pte); 193 - break; 194 198 case POPULATE_MAP: 195 199 page = kasan_early_alloc_pages(0); 196 200 memset(page, 0, PAGE_SIZE); ··· 243 259 * - ident_map_size represents online + standby and memory limits 244 260 * accounted. 245 261 * Kasan maps "memsize" right away. 246 - * [0, memsize] - as identity mapping 247 262 * [__sha(0), __sha(memsize)] - shadow memory for identity mapping 248 263 * The rest [memsize, ident_map_size] if memsize < ident_map_size 249 264 * could be mapped/unmapped dynamically later during memory hotplug.