crosvm/hypervisor/src
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
..
kvm VFIO: set user memory region with page size aligned size 2021-03-19 18:51:32 +00:00
aarch64.rs Enable KVM_CAP_ARM_PROTECTED_VM when --protected-vm is passed. 2021-03-02 19:04:43 +00:00
caps.rs Enable KVM_CAP_ARM_PROTECTED_VM when --protected-vm is passed. 2021-03-02 19:04:43 +00:00
lib.rs enable_raw_capability and kvm_enable_cap are unsafe 2021-03-03 02:20:49 +00:00
x86_64.rs gdb: Support single-step execution and HW breakpoints for x86_64 2020-11-12 08:48:01 +00:00