crosvm/hypervisor
Chuanxiao Dong e2d00176e5 VFIO: set user memory region with page size aligned size
For some PCI device, its MMIO bar size may not be page size aligned.
When setting user memory region for such bar with not aligned size, KVM
will report failure back and failed to map that bar. As current crosvm
can continue run with this failure, the performance will be hurt as each
time when guest is accessing this bar, it will trap to hypervisor.

To resolve this, extend the size to be page size aligned when setting
user memory region in KVM and do DMA map. This should be safe to extend
because the mmap actually rounds up the mmap size to be page aligned.

BUG=None
TEST=boot vm with a passthrough device whose bar has unaligned size

Change-Id: Ic816984ec503edf7f12da4893b78d996ebf93976
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2717448
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dylan Reid <dgreid@chromium.org>
2021-03-19 18:51:32 +00:00
..
src VFIO: set user memory region with page size aligned size 2021-03-19 18:51:32 +00:00
Cargo.toml make hypervisor traits object safe 2020-10-15 14:31:20 +00:00