Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f9b51e25 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "arm: mm: fix pte allocation with CONFIG_FORCE_PAGES feature"

parents 49ac74f2 2b024403
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -1579,8 +1579,25 @@ static noinline void split_pmd(pmd_t *pmd, unsigned long addr,
				const struct mem_type *type)
{
	pte_t *pte, *start_pte;
	pmd_t *base_pmd;

	base_pmd = pmd_offset(
			pud_offset(pgd_offset(&init_mm, addr), addr), addr);

	if (pmd_none(*base_pmd) || pmd_bad(*base_pmd)) {
		start_pte = early_alloc(PTE_HWTABLE_OFF + PTE_HWTABLE_SIZE);
#ifndef CONFIG_ARM_LPAE
		/*
		 * Following is needed when new pte is allocated for pmd[1]
		 * cases, which may happen when base (start) address falls
		 * under pmd[1].
		 */
		if (addr & SECTION_SIZE)
			start_pte += pte_index(addr);
#endif
	} else {
		start_pte = pte_offset_kernel(base_pmd, addr);
	}

	pte = start_pte;