Skip to content

Commit 05c5c31

Browse files
ardbiesheuvelwilldeacon
authored andcommitted
arm64: mm: Permit contiguous descriptors to be manipulated
Currently, pgattr_change_is_safe() is overly pedantic when it comes to descriptors with the contiguous hint attribute set, as it rejects assignments even if the old and the new value are the same. In fact, as per ARM ARM RJQQTC, manipulating descriptors with the contiguous bit set is safe as long as the bit itself does not change value, in the sense that no TLB conflict aborts or other exceptions may be raised as a result. Inconsistent permission attributes within the contiguous region may result in any of the alternatives to be taken to apply to the entire region, which might be a programming error, but it does not constitute an unsafe manipulation in terms of what pgattr_change_is_safe() is intended to detect. So drop the special PTE_CONT check, but still omit PTE_CONT from 'mask' so that modifying the bit is still regarded as unsafe. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Will Deacon <will@kernel.org>
1 parent ecda73a commit 05c5c31

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

arch/arm64/mm/mmu.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,6 @@ bool pgattr_change_is_safe(pteval_t old, pteval_t new)
134134
if (pte_pfn(__pte(old)) != pte_pfn(__pte(new)))
135135
return false;
136136

137-
/* live contiguous mappings may not be manipulated at all */
138-
if ((old | new) & PTE_CONT)
139-
return false;
140-
141137
/* Transitioning from Non-Global to Global is unsafe */
142138
if (old & ~new & PTE_NG)
143139
return false;

0 commit comments

Comments
 (0)