fix fdt location when static swiotlb is enabled
In commit 7ddec973f562 ("fix memory size when static swiotlb is
enabled"), swiotlb moved so that the total memory size is equal to
components.memory_size. When fdt location is at the end of memory, the
swiotlb and fdt end up at overlapping location because the fdt address
computation did not account for the shrunken main memory size.
Add the main_memory_size adjustment into build_vm and adjust the
location of fdt_address when it is placed at the end of memory. I also
noticed the initrd_max_size also need to be adjusted.
Fixes: 7ddec973f562 ("fix memory size when static swiotlb is enabled")
Change-Id: Ic6ba46bdefdc99a0537342e09bb6dc3583438c63
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
(cherry picked from commit a0db4972c4bd6ff6f5d6730448955071d4e9b7f1)
Bug: 406411530 # This fixes AVF tests in xTS-on-GSI
Test: manual # b/406411530#comment96
crosvm is a virtual machine monitor (VMM) based on Linux’s KVM hypervisor, with a focus on simplicity, security, and speed. crosvm is intended to run Linux guests, originally as a security boundary for running native applications on the ChromeOS platform. Compared to QEMU, crosvm doesn’t emulate architectures or real hardware, instead concentrating on paravirtualized devices, such as the virtio standard.
crosvm is currently used to run Linux/Android guests on ChromeOS devices.