arm32: Align arguments of sync_icache() syscall to cacheline size.

Otherwise, we may miss synchronization of the last cacheline.
MFC after:	3 days
This commit is contained in:
Michal Meloun 2021-02-09 11:36:36 +01:00
parent a26f735858
commit ec090f4a67

View File

@ -68,12 +68,9 @@ sync_icache(uintptr_t addr, size_t len)
size_t size;
vm_offset_t rv;
/*
* Align starting address to even number because value of "1"
* is used as return value for success.
*/
len += addr & 1;
addr &= ~1;
/* Align starting address to cacheline size */
len += addr & cpuinfo.dcache_line_mask;
addr &= ~cpuinfo.dcache_line_mask;
/* Break whole range to pages. */
do {