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

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

Merge "arm64: Enforce BBM for huge IO/VMAP mappings"

parents 10171d10 690da77a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -823,6 +823,10 @@ int __init arch_ioremap_pmd_supported(void)

int pud_set_huge(pud_t *pud, phys_addr_t phys, pgprot_t prot)
{
	/* ioremap_page_range doesn't honour BBM */
	if (pud_present(READ_ONCE(*pud)))
		return 0;

	BUG_ON(phys & ~PUD_MASK);
	set_pud(pud, __pud(phys | PUD_TYPE_SECT | pgprot_val(mk_sect_prot(prot))));
	return 1;
@@ -830,6 +834,10 @@ int pud_set_huge(pud_t *pud, phys_addr_t phys, pgprot_t prot)

int pmd_set_huge(pmd_t *pmd, phys_addr_t phys, pgprot_t prot)
{
	/* ioremap_page_range doesn't honour BBM */
	if (pmd_present(READ_ONCE(*pmd)))
		return 0;

	BUG_ON(phys & ~PMD_MASK);
	set_pmd(pmd, __pmd(phys | PMD_TYPE_SECT | pgprot_val(mk_sect_prot(prot))));
	return 1;