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
1 file changed
tree: ef3e38bb7fbd4bb09b56c4023ee177d71d4fb634
  1. .cargo/
  2. .config/
  3. .devcontainer/
  4. .github/
  5. .vscode/
  6. aarch64/
  7. acpi_tables/
  8. android_audio/
  9. arch/
  10. argh_helpers/
  11. audio_streams_conformance_test/
  12. audio_util/
  13. base/
  14. base_tokio/
  15. bit_field/
  16. broker_ipc/
  17. common/
  18. cros_async/
  19. cros_fdt/
  20. cros_tracing/
  21. cros_tracing_types/
  22. crosvm_cli/
  23. crosvm_control/
  24. crosvm_plugin/
  25. cuttlefish/
  26. devices/
  27. disk/
  28. docs/
  29. e2e_tests/
  30. ext2/
  31. fuse/
  32. fuzz/
  33. gpu_display/
  34. hypervisor/
  35. infra/
  36. io_uring/
  37. jail/
  38. kernel_cmdline/
  39. kernel_loader/
  40. kvm/
  41. kvm_sys/
  42. libcras_stub/
  43. linux_input_sys/
  44. logo/
  45. media/
  46. metrics/
  47. metrics_events/
  48. net_sys/
  49. net_util/
  50. patches/
  51. perfetto/
  52. power_monitor/
  53. prebuilts/
  54. proto_build_tools/
  55. protos/
  56. resources/
  57. riscv64/
  58. rutabaga_gfx/
  59. sandbox/
  60. serde_keyvalue/
  61. src/
  62. swap/
  63. system_api/
  64. tests/
  65. third_party/
  66. tools/
  67. tube_transporter/
  68. usb_sys/
  69. usb_util/
  70. vendor/
  71. vfio_sys/
  72. vhost/
  73. virtio_sys/
  74. vm_control/
  75. vm_memory/
  76. win_audio/
  77. win_util/
  78. x86_64/
  79. .dockerignore
  80. .envrc
  81. .gitattributes
  82. .gitignore
  83. .rustfmt.toml
  84. android-fork-stats.sh
  85. android-merge-1-setup.sh
  86. android-merge-2-cargo-embargo.sh
  87. Android.bp
  88. ARCHITECTURE.md
  89. Cargo.lock
  90. Cargo.toml
  91. cargo2android_defaults.bp
  92. cargo2android_module.bp.patch
  93. cargo_embargo.json
  94. CONTRIBUTING.md
  95. DIR_METADATA
  96. LICENSE
  97. METADATA
  98. mypy.ini
  99. OWNERS
  100. OWNERS.android
  101. OWNERS_COUNCIL
  102. PRESUBMIT.cfg
  103. PREUPLOAD.cfg
  104. pyproject.toml
  105. README.chromeos.md
  106. README.md
  107. rust-toolchain
  108. TEST_MAPPING
README.md

crosvm - The ChromeOS Virtual Machine Monitor

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.

Logo