x86_64: only read bzImage setup_header, not all of boot_params

The Linux x86 64-bit Boot Protocol documentation specifies that a
bootloader should initialize a cleared (zeroed) boot_params structure
and only read the setup_header area from the bzImage file.

This ensures that all unknown fields in boot_params will be initialized
to zero, including the `sentinel` field used in the sanitize_boot_params
function to detect broken bootloaders. With this change applied, crosvm
no longer needs the sanitization workaround (validated by inserting an
undefined instruction into the sanitize_boot_params kernel function).

Additionally, the `e820_entries` field will always start at 0 due to the
default initialization of boot_params, which ensures we fill the
`e820_table` array from the beginning.

<https://www.kernel.org/doc/Documentation/x86/boot.txt>

BUG=b:303128596
TEST=tools/dev_container tools/presubmit
TEST=boot x86-64 bzImage kernel (Linux 6.6-rc4)

Change-Id: If9d40e335881f6862a5c9b25ef3187617f18a57a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4906858
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Morg <morg@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
3 files changed
tree: 7a14645dee60e41dcd67f1bea3c677fe3f38891f
  1. .cargo/
  2. .config/
  3. .devcontainer/
  4. .github/
  5. .vscode/
  6. aarch64/
  7. acpi_tables/
  8. arch/
  9. argh_helpers/
  10. audio_streams_conformance_test/
  11. audio_util/
  12. base/
  13. bit_field/
  14. broker_ipc/
  15. common/
  16. cros_async/
  17. cros_fdt/
  18. cros_tracing/
  19. cros_tracing_types/
  20. crosvm_cli/
  21. crosvm_control/
  22. crosvm_plugin/
  23. devices/
  24. disk/
  25. docs/
  26. e2e_tests/
  27. fuse/
  28. fuzz/
  29. gpu_display/
  30. hypervisor/
  31. infra/
  32. io_uring/
  33. jail/
  34. kernel_cmdline/
  35. kernel_loader/
  36. kvm/
  37. kvm_sys/
  38. libcras_stub/
  39. linux_input_sys/
  40. logo/
  41. media/
  42. metrics/
  43. net_sys/
  44. net_util/
  45. perfetto/
  46. power_monitor/
  47. prebuilts/
  48. proto_build_tools/
  49. protos/
  50. resources/
  51. riscv64/
  52. rutabaga_gfx/
  53. sandbox/
  54. serde_keyvalue/
  55. src/
  56. swap/
  57. system_api/
  58. tests/
  59. third_party/
  60. tools/
  61. tube_transporter/
  62. usb_sys/
  63. usb_util/
  64. vendor/
  65. vfio_sys/
  66. vhost/
  67. virtio_sys/
  68. vm_control/
  69. vm_memory/
  70. win_audio/
  71. win_util/
  72. x86_64/
  73. .dockerignore
  74. .envrc
  75. .gitignore
  76. .gitmodules
  77. .rustfmt.toml
  78. ARCHITECTURE.md
  79. Cargo.lock
  80. Cargo.toml
  81. CONTRIBUTING.md
  82. DIR_METADATA
  83. LICENSE
  84. mypy.ini
  85. OWNERS
  86. OWNERS_COUNCIL
  87. PRESUBMIT.cfg
  88. pyproject.toml
  89. README.chromeos.md
  90. README.md
  91. rust-toolchain
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