diff options
author | Daniel Prilik <prilik@google.com> | 2019-03-29 10:48:57 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-04-12 14:50:03 -0700 |
commit | d49adc9005a300dbae60bd8ecb12ea620fc0fd31 (patch) | |
tree | 21bd0290bccf00dd7ba09e4ee359e3ade86b0140 /aarch64/src | |
parent | c211a6ccc69dbf090002e58822846c2b4a69519c (diff) | |
download | crosvm-d49adc9005a300dbae60bd8ecb12ea620fc0fd31.tar crosvm-d49adc9005a300dbae60bd8ecb12ea620fc0fd31.tar.gz crosvm-d49adc9005a300dbae60bd8ecb12ea620fc0fd31.tar.bz2 crosvm-d49adc9005a300dbae60bd8ecb12ea620fc0fd31.tar.lz crosvm-d49adc9005a300dbae60bd8ecb12ea620fc0fd31.tar.xz crosvm-d49adc9005a300dbae60bd8ecb12ea620fc0fd31.tar.zst crosvm-d49adc9005a300dbae60bd8ecb12ea620fc0fd31.zip |
sys_util: add MemoryMappingArena
There is a hard-limit to the number of MemoryMaps that can be added to a KVM VM, a arch-dependent number defined as KVM_USER_MEM_SLOTS. e.g: on x86 this is 509 (512 - 3 internal slots). For most purposes, this isn't too much of an issue, but there are some cases where one might want to share a lot of mmaps with a Guest. e.g: virtio-fs uses a large cache region for mapping in slices of file fds directly into guest memory. If one tries to add a new KVM memory region for each mmap, the number of available slots is quickly exhausted. MemoryMappingArena is a way to work around this limitation by allocating a single KVM memory region for a large slice of memory, and then using mmap with MAP_FIXED to override slices of this "arena" hostside, thereby achieving the same effect without quickly exhausting the number of KVM memory region slots. BUG=chromium:936567 TEST=cargo test -p sys_util Change-Id: I89cc3b22cdba6756b2d76689176d7147cf238f07 Reviewed-on: https://chromium-review.googlesource.com/1546600 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
Diffstat (limited to 'aarch64/src')
0 files changed, 0 insertions, 0 deletions