x86_64: add 32-bit bzImage support

If the provided x86 guest kernel is a valid bzImage but does not have
the XLF_KERNEL_64 flag (meaning it is a 32-bit kernel), boot it in
32-bit protected mode instead of 64-bit long mode.

This eliminates the error case previously added in commit 42ca575b74e7
("x86_64: verify bzImage has a 64-bit entry point"), since crosvm can
now successfully run these kernels.

TEST=Boot Debian i386 netinst kernel + initrd

Change-Id: Ia4565d775d58255f66210ada5b0d0ae79ca10183
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5742404
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
3 files changed
tree: 9d9611f10e51ce506958b99c72a18b6e9d9278ee
  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. devices/
  26. disk/
  27. docs/
  28. e2e_tests/
  29. ext2/
  30. fuse/
  31. fuzz/
  32. gpu_display/
  33. hypervisor/
  34. infra/
  35. io_uring/
  36. jail/
  37. kernel_cmdline/
  38. kernel_loader/
  39. kvm/
  40. kvm_sys/
  41. libcras_stub/
  42. linux_input_sys/
  43. logo/
  44. media/
  45. metrics/
  46. metrics_events/
  47. net_sys/
  48. net_util/
  49. perfetto/
  50. power_monitor/
  51. prebuilts/
  52. proto_build_tools/
  53. protos/
  54. resources/
  55. riscv64/
  56. rutabaga_gfx/
  57. sandbox/
  58. serde_keyvalue/
  59. src/
  60. swap/
  61. system_api/
  62. tests/
  63. third_party/
  64. tools/
  65. tube_transporter/
  66. usb_sys/
  67. usb_util/
  68. vendor/
  69. vfio_sys/
  70. vhost/
  71. virtio_sys/
  72. vm_control/
  73. vm_memory/
  74. win_audio/
  75. win_util/
  76. x86_64/
  77. .dockerignore
  78. .envrc
  79. .gitattributes
  80. .gitignore
  81. .gitmodules
  82. .rustfmt.toml
  83. ARCHITECTURE.md
  84. Cargo.lock
  85. Cargo.toml
  86. CONTRIBUTING.md
  87. DIR_METADATA
  88. LICENSE
  89. mypy.ini
  90. OWNERS
  91. OWNERS_COUNCIL
  92. PRESUBMIT.cfg
  93. pyproject.toml
  94. README.chromeos.md
  95. README.md
  96. 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