History

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Catalin Marinas: - Fix a kernel fault during page table walking in huge_pte_alloc() with PTABLE_LEVELS=5 due to using p4d_offset() instead of p4d_alloc() - head.S fix and cleanup to disable the MMU before toggling the HCR_EL2.E2H bit when entering the kernel with the MMU on from the EFI stub. Changing this bit (currently from VHE to nVHE) causes some system registers as well as page table descriptors to be interpreted differently, potentially resulting in spurious MMU faults - Fix translation fault in swsusp_save() accessing MEMBLOCK_NOMAP memory ranges due to kernel_page_present() returning true in most configurations other than rodata_full == true, CONFIG_DEBUG_PAGEALLOC=y or CONFIG_KFENCE=y * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: hibernate: Fix level3 translation fault in swsusp_save() arm64/head: Disable MMU at EL2 before clearing HCR_EL2.E2H arm64/head: Drop unnecessary pre-disable-MMU workaround arm64/hugetlb: Fix page table walk in huge_pte_alloc()

Linus Torvalds committed 2 years ago

Commit 25ec51e2 parents 3cdb455 50449ca3 files · +9 −6Browse files

Unified · Split

3 files
  1. arch/arm64/kernel/head.S +5 −2
  2. arch/arm64/mm/hugetlbpage.c +4 −1
  3. arch/arm64/mm/pageattr.c +0 −3
arch/arm64/kernel/head.S+5−2
@@ -289,6 +289,11 @@ SYM_INNER_LABEL(init_el2, SYM_L_LOCAL) · 288 unmodified lines
289 adr_l x1, __hyp_text_end289 adr_l x1, __hyp_text_end
290 adr_l x2, dcache_clean_poc290 adr_l x2, dcache_clean_poc
291 blr x2291 blr x2
292
293 mov_q x0, INIT_SCTLR_EL2_MMU_OFF
294 pre_disable_mmu_workaround
295 msr sctlr_el2, x0
296 isb
2920:2970:
293 mov_q x0, HCR_HOST_NVHE_FLAGS298 mov_q x0, HCR_HOST_NVHE_FLAGS
294 299
@@ -323,13 +328,11 @@ SYM_INNER_LABEL(init_el2, SYM_L_LOCAL) · 28 unmodified lines
323 cbz x0, 2f328 cbz x0, 2f
324 329
325 /* Set a sane SCTLR_EL1, the VHE way */330 /* Set a sane SCTLR_EL1, the VHE way */
326 pre_disable_mmu_workaround
327 msr_s SYS_SCTLR_EL12, x1331 msr_s SYS_SCTLR_EL12, x1
328 mov x2, #BOOT_CPU_FLAG_E2H332 mov x2, #BOOT_CPU_FLAG_E2H
329 b 3f333 b 3f
330 334
3312:3352:
332 pre_disable_mmu_workaround
333 msr sctlr_el1, x1336 msr sctlr_el1, x1
334 mov x2, xzr337 mov x2, xzr
3353:3383:
arch/arm64/mm/hugetlbpage.c+4−1
@@ -276,7 +276,10 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma, · 275 unmodified lines
276 pte_t *ptep = NULL;276 pte_t *ptep = NULL;
277 277
278 pgdp = pgd_offset(mm, addr);278 pgdp = pgd_offset(mm, addr);
279 p4dp = p4d_offset(pgdp, addr);279 p4dp = p4d_alloc(mm, pgdp, addr);
280 if (!p4dp)
281 return NULL;
282
280 pudp = pud_alloc(mm, p4dp, addr);283 pudp = pud_alloc(mm, p4dp, addr);
281 if (!pudp)284 if (!pudp)
282 return NULL;285 return NULL;
arch/arm64/mm/pageattr.c+0−3
@@ -219,9 +219,6 @@ bool kernel_page_present(struct page *page) · 218 unmodified lines
219 pte_t *ptep;219 pte_t *ptep;
220 unsigned long addr = (unsigned long)page_address(page);220 unsigned long addr = (unsigned long)page_address(page);
221 221
222 if (!can_set_direct_map())
223 return true;
224
225 pgdp = pgd_offset_k(addr);222 pgdp = pgd_offset_k(addr);
226 if (pgd_none(READ_ONCE(*pgdp)))223 if (pgd_none(READ_ONCE(*pgdp)))
227 return false;224 return false;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t