mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-24 12:34:31 +00:00
base: Round up when calculating cache flush count
When dividing target length by the cache line size, round up to make sure we flush the entire target region. BUG=b:316402315 TEST=tast run asurada arc.Boot.vm Change-Id: I66938bb51e1ce58f17e4bb28ec7b8f1e14a4fc6d Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5437515 Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org> Commit-Queue: David Stevens <stevensd@chromium.org>
This commit is contained in:
parent
e81dfd2740
commit
d4d9fad2ee
1 changed files with 1 additions and 1 deletions
|
@ -394,7 +394,7 @@ impl MemoryMapping {
|
|||
let mut next: *const u8 = unsafe { addr.add(offset) };
|
||||
|
||||
let cacheline_size = get_cacheline_size();
|
||||
let cacheline_count = len / cacheline_size;
|
||||
let cacheline_count = len.div_ceil(cacheline_size);
|
||||
|
||||
for _ in 0..cacheline_count {
|
||||
// SAFETY:
|
||||
|
|
Loading…
Reference in a new issue