diff options
| -rw-r--r-- | arch/arm64/mm/mmu.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 3161b853f29e..84a019f55022 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c | |||
| @@ -933,6 +933,11 @@ int pud_set_huge(pud_t *pudp, phys_addr_t phys, pgprot_t prot) | |||
| 933 | { | 933 | { |
| 934 | pgprot_t sect_prot = __pgprot(PUD_TYPE_SECT | | 934 | pgprot_t sect_prot = __pgprot(PUD_TYPE_SECT | |
| 935 | pgprot_val(mk_sect_prot(prot))); | 935 | pgprot_val(mk_sect_prot(prot))); |
| 936 | |||
| 937 | /* ioremap_page_range doesn't honour BBM */ | ||
| 938 | if (pud_present(READ_ONCE(*pudp))) | ||
| 939 | return 0; | ||
| 940 | |||
| 936 | BUG_ON(phys & ~PUD_MASK); | 941 | BUG_ON(phys & ~PUD_MASK); |
| 937 | set_pud(pudp, pfn_pud(__phys_to_pfn(phys), sect_prot)); | 942 | set_pud(pudp, pfn_pud(__phys_to_pfn(phys), sect_prot)); |
| 938 | return 1; | 943 | return 1; |
| @@ -942,6 +947,11 @@ int pmd_set_huge(pmd_t *pmdp, phys_addr_t phys, pgprot_t prot) | |||
| 942 | { | 947 | { |
| 943 | pgprot_t sect_prot = __pgprot(PMD_TYPE_SECT | | 948 | pgprot_t sect_prot = __pgprot(PMD_TYPE_SECT | |
| 944 | pgprot_val(mk_sect_prot(prot))); | 949 | pgprot_val(mk_sect_prot(prot))); |
| 950 | |||
| 951 | /* ioremap_page_range doesn't honour BBM */ | ||
| 952 | if (pmd_present(READ_ONCE(*pmdp))) | ||
| 953 | return 0; | ||
| 954 | |||
| 945 | BUG_ON(phys & ~PMD_MASK); | 955 | BUG_ON(phys & ~PMD_MASK); |
| 946 | set_pmd(pmdp, pfn_pmd(__phys_to_pfn(phys), sect_prot)); | 956 | set_pmd(pmdp, pfn_pmd(__phys_to_pfn(phys), sect_prot)); |
| 947 | return 1; | 957 | return 1; |
