crosvm/devices
Xiong Zhang ed1572d78c Pcie: Reserve bridge window and prefetch window for pcie rp
For bridge's memroy and prefetch memory window, current the limit is
smaller than the base, this means pcie rp doesn't support this window,
but OS still allocates 2M memroy window and 2M prefetch memory window
for it, this has two problems:
a. kernel allocates mmio, but crosvm's system allocator doesn't capture
this allocation and crosvm still use system allocator to allocate mmio
for hotplug in device, so it may have conflict between kernel and crosvm.
b. the 2MB window is too small, as the added device behind this bridge
is allocated mmio from this window by kernel, if device required mmio
is large than 2MB, the device couldn't work.

This commit preallocates 8MB memory window and 64MB prefetch memory window
for one pcie rp, and let kernel allocate mmio for its children devices
from this window, kernel also maintains the allocation and free of this
window, crosvm system allocator doesn't care about which device own the
segment of this window.

BUG=b:185084350
TEST=Boot a guest and check pcie rp bridge window's base, limit and size

Change-Id: I566a2d81b458da1d2d5f07b689fa898453586adc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3319706
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-01-06 23:32:52 +00:00
..
src Pcie: Reserve bridge window and prefetch window for pcie rp 2022-01-06 23:32:52 +00:00
.build_test_serial devices: Add simple test for proxy device 2020-11-17 21:05:51 +00:00
Cargo.toml vhost: user: Move from getopts to argh. 2022-01-06 21:16:50 +00:00