ARM: mmu: skip cacheable page flushes for empty ranges
PATCH v2 1/1 ARM: mmu: skip cacheable page flushes for empty ranges
If we end here with a size of zero, region_end will become -1 and is a sure way to lead into confusing issues.
__arch_remap_range() skips 0-sized regions, so do likewise here, so all of arch_remap_range() is 0-size-region safe.
---
v1 -> v2:
- early exit instead of panic
- Add Fixes: tag
--- arch/arm/cpu/flush_cacheable_pages.h | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/cpu/flush_cacheable_pages.h +3 -0
@@ -28,6 +28,9 @@ static void flush_cacheable_pages(void *start, size_t size)size_t block_size;mmu_addr_t *ttb; +if (!size) +return ; + region_start =PAGE_ALIGN_DOWN ((ulong )start); region_end =PAGE_ALIGN (region_start + size) -1 ;
Signature · 1 line
2.47.3
Sascha Hauer
AppliedQuoted 8 lines · Ahmad Fatoum
If we end here with a size of zero,
region_endwill become -1 and is a sure way to lead into confusing issues.
__arch_remap_range()skips 0-sized regions, so do likewise here, so all ofarch_remap_range()is 0-size-region safe.[...]
Applied, thanks!
[1/1] ARM: mmu: skip cacheable page flushes for empty ranges
https://git.pengutronix.de/cgit/barebox/commit/?id=95ff4d5058ac (link may not be stable)
Best regards,
Signature · 1 line
Sascha Hauer <[email protected]>