mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-25 05:03:05 +00:00
3eeaf6a339
Rather than mapping past the end of the file when using a pmem backing file that is not 2 MiB aligned, use an anonymous mapping to fill the remaining part of the arena. This partially reverts https://crrev.com/c/2153103 while keeping the effective change: the anonymous mapping used to fill the padding is now added with the same protection as the file mapping. Also handle images that are not a multiple of the page size (typically 4096 bytes) - the memory mapping on the host will handle zero-filling reads and discarding writes past the end of the mapped file as long as we map a size containing the partial last page. BUG=chromium:1244217 TEST=Boot crosvm with non-2MB aligned pmem disk; read the last few bytes TEST=./test_all Change-Id: Ibe8da170175bb9befce924122b912a28a6dc0e7b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3131444 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Chirantan Ekbote <chirantan@chromium.org> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org> |
||
---|---|---|
.. | ||
poll_token_derive | ||
src | ||
.build_test_serial | ||
Cargo.toml |