2017-05-02 00:57:18 +00:00
|
|
|
[package]
|
|
|
|
name = "crosvm"
|
|
|
|
version = "0.1.0"
|
|
|
|
authors = ["The Chromium OS Authors"]
|
2022-03-08 01:16:09 +00:00
|
|
|
edition = "2021"
|
2021-04-05 19:17:11 +00:00
|
|
|
default-run = "crosvm"
|
2022-03-10 19:19:22 +00:00
|
|
|
# b:223855233
|
|
|
|
resolver = "1"
|
2017-05-02 00:57:18 +00:00
|
|
|
|
2019-08-01 00:07:27 +00:00
|
|
|
[[bin]]
|
|
|
|
name = "crosvm"
|
|
|
|
path = "src/main.rs"
|
|
|
|
|
2021-03-31 22:08:45 +00:00
|
|
|
[[bin]]
|
|
|
|
name = "crosvm-direct"
|
|
|
|
path = "src/main.rs"
|
|
|
|
required-features = [ "direct" ]
|
|
|
|
|
2017-05-02 00:57:18 +00:00
|
|
|
[profile.release]
|
|
|
|
panic = 'abort'
|
2018-10-15 22:40:09 +00:00
|
|
|
overflow-checks = true
|
2017-05-02 00:57:18 +00:00
|
|
|
|
2022-03-24 10:15:38 +00:00
|
|
|
[profile.release-test]
|
|
|
|
inherits = 'release'
|
|
|
|
panic = 'unwind'
|
|
|
|
|
2022-02-08 09:44:10 +00:00
|
|
|
# Reproduces the options used when building crosvm for Chrome OS.
|
|
|
|
[profile.chromeos]
|
|
|
|
inherits = "release"
|
|
|
|
opt-level = "s"
|
2022-11-01 05:43:56 +00:00
|
|
|
strip = "symbols"
|
2022-02-08 09:44:10 +00:00
|
|
|
|
|
|
|
# Enables LTO to further reduce the size of the binary.
|
|
|
|
[profile.lto]
|
|
|
|
inherits = "chromeos"
|
|
|
|
lto = true
|
|
|
|
|
2017-11-09 01:33:46 +00:00
|
|
|
[workspace]
|
2022-10-27 17:24:36 +00:00
|
|
|
# Explicitly list all crates of crosvm as workspace members since not all of them may be referenced
|
|
|
|
# by dependencies.
|
2020-11-10 17:34:56 +00:00
|
|
|
members = [
|
2021-10-27 18:04:03 +00:00
|
|
|
"aarch64",
|
|
|
|
"acpi_tables",
|
2022-07-15 19:21:42 +00:00
|
|
|
"anti_tamper",
|
2021-10-27 18:04:03 +00:00
|
|
|
"arch",
|
2022-05-27 00:11:55 +00:00
|
|
|
"argh_helpers",
|
2022-03-16 19:16:04 +00:00
|
|
|
"base",
|
2021-10-27 18:04:03 +00:00
|
|
|
"bit_field",
|
2022-05-13 22:14:15 +00:00
|
|
|
"broker_ipc",
|
2022-10-27 17:24:36 +00:00
|
|
|
"common/audio_streams",
|
|
|
|
"common/balloon_control",
|
|
|
|
"common/cros_asyncv2",
|
|
|
|
"common/cros-fuzz",
|
|
|
|
"common/data_model",
|
|
|
|
"common/p9",
|
|
|
|
"common/sync",
|
2022-09-23 19:06:38 +00:00
|
|
|
"crash_report",
|
2022-03-17 18:26:01 +00:00
|
|
|
"cros_async",
|
2022-10-18 19:50:50 +00:00
|
|
|
"cros_fdt",
|
2022-10-27 17:24:36 +00:00
|
|
|
"cros_tracing",
|
2022-10-17 20:42:19 +00:00
|
|
|
"crosvm_cli",
|
2022-03-16 19:16:04 +00:00
|
|
|
"crosvm_control",
|
2021-10-27 18:04:03 +00:00
|
|
|
"crosvm_plugin",
|
2022-11-11 00:40:22 +00:00
|
|
|
"crosvm-fuzz",
|
2021-10-27 18:04:03 +00:00
|
|
|
"devices",
|
|
|
|
"disk",
|
2022-11-03 21:28:42 +00:00
|
|
|
"e2e_tests",
|
2021-10-27 18:04:03 +00:00
|
|
|
"fuse",
|
|
|
|
"gpu_display",
|
|
|
|
"hypervisor",
|
2022-03-17 23:40:59 +00:00
|
|
|
"io_uring",
|
2021-10-27 18:04:03 +00:00
|
|
|
"kernel_cmdline",
|
|
|
|
"kernel_loader",
|
|
|
|
"kvm_sys",
|
2022-10-27 17:24:36 +00:00
|
|
|
"kvm",
|
|
|
|
"libcras_stub",
|
2021-10-27 18:04:03 +00:00
|
|
|
"linux_input_sys",
|
2022-11-08 22:23:49 +00:00
|
|
|
"media/cros-codecs",
|
|
|
|
"media/ffmpeg",
|
|
|
|
"media/libva",
|
|
|
|
"media/libvda",
|
2022-10-27 17:24:36 +00:00
|
|
|
"metrics",
|
2021-10-27 18:04:03 +00:00
|
|
|
"net_sys",
|
|
|
|
"net_util",
|
|
|
|
"power_monitor",
|
2022-10-01 03:44:29 +00:00
|
|
|
"prebuilts",
|
2021-10-27 18:04:03 +00:00
|
|
|
"protos",
|
2022-11-10 21:15:53 +00:00
|
|
|
"proto_build_tools",
|
2021-10-27 18:04:03 +00:00
|
|
|
"qcow_utils",
|
|
|
|
"resources",
|
|
|
|
"rutabaga_gfx",
|
2022-02-03 10:39:10 +00:00
|
|
|
"serde_keyvalue",
|
2022-09-14 05:18:14 +00:00
|
|
|
"swap",
|
2022-09-26 21:20:48 +00:00
|
|
|
"system_api",
|
2022-10-27 17:24:36 +00:00
|
|
|
"third_party/vmm_vhost",
|
2021-10-27 18:04:03 +00:00
|
|
|
"tpm2-sys",
|
2022-10-27 17:24:36 +00:00
|
|
|
"tpm2",
|
2021-10-27 18:04:03 +00:00
|
|
|
"usb_sys",
|
|
|
|
"usb_util",
|
|
|
|
"vfio_sys",
|
|
|
|
"vhost",
|
|
|
|
"virtio_sys",
|
|
|
|
"vm_control",
|
|
|
|
"vm_memory",
|
|
|
|
"x86_64",
|
2020-11-10 17:34:56 +00:00
|
|
|
]
|
2022-10-27 17:24:36 +00:00
|
|
|
|
|
|
|
# Exclude crates from crosvm builds completely. Avoid using this if possible as crates added here
|
|
|
|
# will not be tested in CI and may break at any time.
|
2018-12-20 07:44:11 +00:00
|
|
|
exclude = [
|
2022-07-27 05:19:25 +00:00
|
|
|
"sandbox",
|
2022-10-27 17:24:36 +00:00
|
|
|
"tools/audio_streams_conformance_test",
|
|
|
|
"tools/examples/baremetal",
|
2022-04-12 17:03:17 +00:00
|
|
|
"tube_transporter",
|
2022-10-27 17:24:36 +00:00
|
|
|
"win_audio",
|
2022-03-21 21:44:36 +00:00
|
|
|
"win_util",
|
2018-12-20 07:44:11 +00:00
|
|
|
]
|
2017-11-09 01:33:46 +00:00
|
|
|
|
2018-01-17 01:35:27 +00:00
|
|
|
[features]
|
2022-10-11 19:53:23 +00:00
|
|
|
## Default features of crosvm. This selection is somewhat arbitrary for historical reasons.
|
crosvm: add JSON configuration file support
Add a new `--cfg` command-line parameter, which allows a single (for
now) JSON configuration file to be specified and loaded as the base
configuration for the VM, if the `config-file` feature is enabled (the
default).
Configuration options in the file can be overriden or extended by the
regular command-line arguments. Typically, options that can be specified
only once are overriden, and options that can be specified several times
(like `--block`) are extended, allowing some devices of the same type to
be declared in a configuration file and some more on the command-line.
Due to a limitation in argh, which does not yet allow `Option<bool>`
fields to be used as switches, merging more than a single configuration
file is not reliable so we only support a single configuration file for
now. This has been addressed upstream but not yet in a released version.
Configuration file support for all the options of RunCommand increases
the crosvm binary size compiled with the `chromeos` profile by 250KB.
However, due to the currently limited set of options in the
configuration file, the present CL increases the binary size by just
78KB. Without the `config-file` feature, this CL does not incur any
binary size increase.
Supported parameters as of this commit:
* battery
* block
* executable-path
* initrd
* net
* params
* serial
* socket
BUG=b:218223240
TEST=`cargo run --features config-file -- run --cfg vm.json` boots the
VM with parameters defined in vm.json.
Change-Id: Ibb27556144ee766af81c178e5b94bd5117e102da
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3970368
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-10-20 06:40:27 +00:00
|
|
|
default = ["audio", "balloon", "config-file", "gpu", "qcow", "usb"]
|
2022-10-11 19:53:23 +00:00
|
|
|
|
|
|
|
## Enables cross-platform audio devices
|
|
|
|
audio = ["devices/audio"]
|
|
|
|
|
|
|
|
## Enables the virtio-balloon device which allows dynamic scaling of memory via vm_control commands.
|
|
|
|
## See [Balloon Device](https://crosvm.dev/book/devices/balloon.html) for more information.
|
|
|
|
balloon = ["devices/balloon", "vm_control/balloon"]
|
|
|
|
|
|
|
|
## Enables the composite-disk format, which adds protobufs as a dependency of the build. This format
|
|
|
|
## is intended to speed up crosvm's usage in CI environments that might otherwise have to
|
|
|
|
## concatenate large file system images into a single disk image.
|
|
|
|
composite-disk = ["protos/composite-disk", "protobuf", "disk/composite-disk"]
|
|
|
|
|
crosvm: add JSON configuration file support
Add a new `--cfg` command-line parameter, which allows a single (for
now) JSON configuration file to be specified and loaded as the base
configuration for the VM, if the `config-file` feature is enabled (the
default).
Configuration options in the file can be overriden or extended by the
regular command-line arguments. Typically, options that can be specified
only once are overriden, and options that can be specified several times
(like `--block`) are extended, allowing some devices of the same type to
be declared in a configuration file and some more on the command-line.
Due to a limitation in argh, which does not yet allow `Option<bool>`
fields to be used as switches, merging more than a single configuration
file is not reliable so we only support a single configuration file for
now. This has been addressed upstream but not yet in a released version.
Configuration file support for all the options of RunCommand increases
the crosvm binary size compiled with the `chromeos` profile by 250KB.
However, due to the currently limited set of options in the
configuration file, the present CL increases the binary size by just
78KB. Without the `config-file` feature, this CL does not incur any
binary size increase.
Supported parameters as of this commit:
* battery
* block
* executable-path
* initrd
* net
* params
* serial
* socket
BUG=b:218223240
TEST=`cargo run --features config-file -- run --cfg vm.json` boots the
VM with parameters defined in vm.json.
Change-Id: Ibb27556144ee766af81c178e5b94bd5117e102da
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3970368
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-10-20 06:40:27 +00:00
|
|
|
## Enables support for JSON configuration files that can be specified using `--cfg`.
|
|
|
|
config-file = []
|
|
|
|
|
2022-10-11 19:53:23 +00:00
|
|
|
## Enables using gdb to debug the guest kernel.
|
|
|
|
gdb = [
|
|
|
|
"aarch64/gdb",
|
|
|
|
"arch/gdb",
|
|
|
|
"gdbstub",
|
|
|
|
"gdbstub_arch",
|
|
|
|
"vm_control/gdb",
|
|
|
|
"x86_64/gdb",
|
|
|
|
]
|
|
|
|
|
|
|
|
## Enables a panic handler that writes panic info to the RUST_PANIC_SIG memfd.
|
|
|
|
panic-memfd = []
|
|
|
|
|
|
|
|
## Enables the use of the qcow format for block devices.
|
|
|
|
qcow = ["disk/qcow"]
|
|
|
|
|
2022-09-02 15:49:50 +00:00
|
|
|
## Enables vmm-swap of guest memory. This is only available on Linux.
|
|
|
|
swap = ["vm_control/swap", "dep:swap"]
|
|
|
|
|
2022-10-11 19:53:23 +00:00
|
|
|
## Enables collection of VM statistics.
|
|
|
|
stats = ["devices/stats"]
|
|
|
|
|
|
|
|
## Enables trusted platform module emulation for the guest. This relies on the software emulated
|
|
|
|
## TPM implementation from libtpm2 which is suited only for testing purposes.
|
|
|
|
tpm = ["devices/tpm"]
|
|
|
|
|
|
|
|
## Enables USB host device passthrough via an emulated XHCI controller.
|
2022-09-22 22:05:21 +00:00
|
|
|
## USB is supported only on unix/linux. The feature is a no-op on windows.
|
2022-10-11 19:53:23 +00:00
|
|
|
usb = ["devices/usb"]
|
|
|
|
|
|
|
|
## Enables the non-upstream virtio wayland protocol. This can be used in conjuction with the gpu
|
|
|
|
## feature to enable a zero-copy display pipeline.
|
|
|
|
wl-dmabuf = ["devices/minigbm"]
|
|
|
|
|
|
|
|
## Enables the usage of the X11 protocol for display on the host.
|
|
|
|
x = ["devices/x"]
|
|
|
|
|
|
|
|
#! ### Graphics features
|
|
|
|
|
|
|
|
## Enables basic virtio-gpu support. This includes basic display and input features, but lacks 3D
|
|
|
|
## acceleration in the absence of other crosvm features.
|
|
|
|
gpu = ["devices/gpu", "gpu_display", "vm_control/gpu"]
|
|
|
|
|
|
|
|
## Enables 3D acceleration for guest via the gfxstream protocol over virtio-gpu. This is used for
|
|
|
|
## compatibility with the Android Emulator. The protocol provides the best speed and compatibility
|
|
|
|
## with GL/vulkan versions by forwarding the guest's calls to the host's graphics libraries and GPU.
|
|
|
|
## However, this means the sandbox is not enabled for the virtio-gpu device.
|
|
|
|
gfxstream = ["devices/gfxstream"]
|
|
|
|
|
2022-10-19 23:27:42 +00:00
|
|
|
## Adds a stub implementation of gfxstream to allow us to compile the gfxstream feature without
|
|
|
|
## access to the gfxstream library.
|
|
|
|
## Note that this feature only allows compilation of gfxstream and will not be functional at
|
|
|
|
## runtime.
|
|
|
|
gfxstream_stub = ["rutabaga_gfx/gfxstream_stub"]
|
|
|
|
|
2022-10-11 19:53:23 +00:00
|
|
|
## Enables 3D acceleration for the guest via the virglrenderer library over virtio-gpu.
|
|
|
|
virgl_renderer = ["devices/virgl_renderer"]
|
|
|
|
|
|
|
|
## Enables in development features of virglrenderer to support newer OpenGL versions.
|
|
|
|
virgl_renderer_next = ["devices/virgl_renderer_next", "rutabaga_gfx/virgl_renderer_next"]
|
|
|
|
|
|
|
|
#! ### Video features
|
|
|
|
#!
|
|
|
|
#! See [Video Device](https://crosvm.dev/book/devices/video.html) for more information.
|
|
|
|
|
|
|
|
## Enables the video decoding device
|
|
|
|
video-decoder = ["devices/video-decoder"]
|
|
|
|
|
|
|
|
## Enables the video encoding device
|
|
|
|
video-encoder = ["devices/video-encoder"]
|
|
|
|
|
|
|
|
## Enables the ffmpeg backend of video devices.
|
|
|
|
ffmpeg = ["devices/ffmpeg"]
|
|
|
|
|
|
|
|
# Enables the VAAPI backend of video devices.
|
|
|
|
vaapi = ["devices/vaapi"]
|
|
|
|
|
|
|
|
#! ### Windows-specific feature flags
|
|
|
|
#!
|
|
|
|
#! These feature flags are only available on Windows builds of crosvm.
|
|
|
|
|
|
|
|
## Enables the use of the HAXM hypervisor
|
|
|
|
haxm = ["hypervisor/haxm"]
|
|
|
|
|
|
|
|
## Enables the use of the WHPX hypervisor
|
|
|
|
whpx = ["devices/whpx", "hypervisor/whpx"]
|
|
|
|
|
|
|
|
## Enables a libslirp based network device. Currently only supported on Windows.
|
|
|
|
slirp = ["devices/slirp", "net_util/slirp"]
|
|
|
|
|
|
|
|
|
|
|
|
#! ### Non-additive feature flags
|
|
|
|
#!
|
|
|
|
#! These feature flags change the behavior of crosvm instead of adding functionality.
|
|
|
|
#! This is deprecated and will be phased out.
|
|
|
|
|
|
|
|
## Run crosvm with --disable-sandbox by default.
|
|
|
|
default-no-sandbox = []
|
|
|
|
|
|
|
|
## Special build of crosvm for ChromeOS that only supports direct device passthrough.
|
|
|
|
direct = ["balloon", "devices/direct", "arch/direct", "x86_64/direct"]
|
|
|
|
|
|
|
|
#! ### Project specific features
|
|
|
|
#!
|
|
|
|
#! These features are specific to downstream projects and may not be functional or useful
|
|
|
|
#! for standard linux builds of crosvm.
|
|
|
|
#! They are however enabled in upstream builds for compile and test coverage in CI.
|
|
|
|
|
|
|
|
#! #### ChromeOS
|
|
|
|
#!
|
|
|
|
#! These features will only be functional in ChromeOS builds running on ChromeOS.
|
|
|
|
|
|
|
|
## Enables virtio-fs quota reporting for ARCVM. Requires access to the
|
|
|
|
## org.chromium.ArcQuota dbus service.
|
|
|
|
arc_quota = ["devices/arc_quota"]
|
|
|
|
|
|
|
|
## Enables use of the ChromeOS audio server. ChromeOS builds will replace libcras_stub with an
|
|
|
|
## implementation that talks to the audio server. In upstream builds, using this option will panic.
|
|
|
|
audio_cras = ["devices/audio_cras"]
|
|
|
|
|
|
|
|
## Enables the VDA backend of the video devices. This feature requires the ChromeOS only
|
|
|
|
## libvda library and can be compiled but not linked. See b/244619291.
|
|
|
|
libvda = ["devices/libvda"]
|
|
|
|
|
2022-10-12 03:18:50 +00:00
|
|
|
## Builds the VDA video backend with a set of no-ops stubs instead of linking with libvda, which is
|
|
|
|
## only available on ChromeOS.
|
|
|
|
libvda-stub = ["devices/libvda-stub"]
|
|
|
|
|
2022-10-11 19:53:23 +00:00
|
|
|
## Enables the crosvm plugin API where functionality is provided via a FFI plugin API.
|
|
|
|
## This feature is used to integrate Parallels with crosvm and is not functional upstream.
|
|
|
|
plugin = ["protos/plugin", "crosvm_plugin", "kvm", "kvm_sys", "protobuf"]
|
|
|
|
|
|
|
|
## Enables battery reporting via the ChromeOS powerd. Requires access to the
|
|
|
|
## org.chromium.PowerManager dbus service.
|
|
|
|
power-monitor-powerd = ["arch/power-monitor-powerd"]
|
|
|
|
|
|
|
|
## Enables a virtualized TPM device that uses the org.chromium.Vtpm dbus service.
|
|
|
|
vtpm = ["devices/vtpm"]
|
|
|
|
|
|
|
|
#! #### Windows-future
|
|
|
|
#!
|
|
|
|
#! These features will only be functional in future builds of windows crosvm.
|
|
|
|
|
|
|
|
## Enables reporting of crosvm crashes
|
|
|
|
crash-report = ["broker_ipc/crash-report", "crash_report"]
|
|
|
|
|
|
|
|
#! ### Platform Feature Sets
|
|
|
|
#!
|
|
|
|
#! These feature flags enable all features that are supported for a given platform.
|
|
|
|
#! Note that these may include project specific features that will not be functional at runtime but
|
|
|
|
#! are enabled for compile and test coverage.
|
|
|
|
|
|
|
|
## All features that are compiled and tested for aarch64
|
|
|
|
all-aarch64 = [
|
2022-09-26 21:45:39 +00:00
|
|
|
"arc_quota",
|
2022-09-21 18:48:02 +00:00
|
|
|
"audio_cras",
|
2022-10-11 19:53:23 +00:00
|
|
|
"chromeos",
|
2021-10-13 23:25:49 +00:00
|
|
|
"composite-disk",
|
2022-09-23 21:54:03 +00:00
|
|
|
"crash-report",
|
2021-10-13 23:25:49 +00:00
|
|
|
"default",
|
2022-09-20 20:21:24 +00:00
|
|
|
"ffmpeg",
|
2021-10-13 23:25:49 +00:00
|
|
|
"gdb",
|
2022-10-19 23:27:42 +00:00
|
|
|
"gfxstream",
|
|
|
|
"gfxstream_stub",
|
2022-10-12 03:18:50 +00:00
|
|
|
"libvda-stub",
|
2022-10-11 19:53:23 +00:00
|
|
|
"panic-memfd",
|
2022-09-20 18:07:14 +00:00
|
|
|
"power-monitor-powerd",
|
2022-09-23 21:54:03 +00:00
|
|
|
"slirp",
|
2022-09-14 05:18:14 +00:00
|
|
|
"swap",
|
2021-10-13 23:25:49 +00:00
|
|
|
"tpm",
|
2022-10-11 20:50:52 +00:00
|
|
|
"vaapi",
|
2022-09-20 20:21:24 +00:00
|
|
|
"video-decoder",
|
2022-10-13 17:54:20 +00:00
|
|
|
"video-encoder",
|
2021-10-13 23:25:49 +00:00
|
|
|
"virgl_renderer_next",
|
|
|
|
"virgl_renderer",
|
2022-10-11 19:53:23 +00:00
|
|
|
"vtpm",
|
2022-09-20 18:19:21 +00:00
|
|
|
"wl-dmabuf",
|
2021-10-13 23:25:49 +00:00
|
|
|
"x",
|
2022-08-31 11:51:38 +00:00
|
|
|
]
|
2022-10-11 19:53:23 +00:00
|
|
|
|
|
|
|
## All features that are compiled and tested for x86_64
|
2022-10-24 12:54:18 +00:00
|
|
|
all-x86_64 = ["all-aarch64", "plugin", "scudo"]
|
2022-10-11 19:53:23 +00:00
|
|
|
|
|
|
|
## All features that are compiled and tested for armhf
|
|
|
|
## Note: This platform is deprecated and will be phased out.
|
|
|
|
all-armhf = [
|
2022-03-10 00:25:29 +00:00
|
|
|
"composite-disk",
|
|
|
|
"default",
|
2022-11-09 01:54:20 +00:00
|
|
|
"gdb", # no effect because gdb is not supported for armhf
|
2022-11-03 21:43:47 +00:00
|
|
|
"libvda-stub",
|
2022-03-10 00:25:29 +00:00
|
|
|
"tpm",
|
|
|
|
]
|
2022-10-11 19:53:23 +00:00
|
|
|
|
|
|
|
## All features that are compiled and tested for mingw64
|
2022-09-22 22:05:21 +00:00
|
|
|
all-mingw64 = [ "audio", "balloon", "crash_report", "gpu", "haxm", "slirp", "stats" ]
|
2022-10-11 19:53:23 +00:00
|
|
|
|
|
|
|
## All features that are compiled and tested for msvc64
|
|
|
|
all-msvc64 = [ "all-mingw64" ]
|
|
|
|
|
|
|
|
## All features that are enabled in ChromeOS builds.
|
|
|
|
all-chromeos = ["base/chromeos", "audio_cras", "devices/chromeos", "panic-memfd", "arc_quota", "vtpm"]
|
|
|
|
|
|
|
|
# Deprecated feature flag. Remove after ChromeOS-side is updated.
|
|
|
|
chromeos = ["all-chromeos"]
|
2018-01-17 01:35:27 +00:00
|
|
|
|
2017-05-02 00:57:18 +00:00
|
|
|
[dependencies]
|
2021-08-16 22:37:11 +00:00
|
|
|
anyhow = "1.0.32"
|
2018-02-14 06:09:43 +00:00
|
|
|
arch = { path = "arch" }
|
2022-05-26 01:18:20 +00:00
|
|
|
argh = "0.1"
|
2022-05-27 00:11:55 +00:00
|
|
|
argh_helpers = { path = "argh_helpers" }
|
2019-01-07 18:33:48 +00:00
|
|
|
audio_streams = "*"
|
2020-08-03 03:09:41 +00:00
|
|
|
base = "*"
|
2018-05-22 18:22:13 +00:00
|
|
|
bit_field = { path = "bit_field" }
|
2022-05-13 22:14:15 +00:00
|
|
|
broker_ipc = { path = "broker_ipc" }
|
2021-12-20 15:49:10 +00:00
|
|
|
cfg-if = "1.0.0"
|
2022-09-23 21:54:03 +00:00
|
|
|
crash_report = { path = "crash_report", optional = true }
|
2022-08-19 04:31:38 +00:00
|
|
|
cros_async = { path = "cros_async" }
|
2022-10-17 20:42:19 +00:00
|
|
|
crosvm_cli = { path = "crosvm_cli" }
|
2019-04-06 21:30:04 +00:00
|
|
|
crosvm_plugin = { path = "crosvm_plugin", optional = true }
|
|
|
|
data_model = "*"
|
2017-10-06 22:26:46 +00:00
|
|
|
devices = { path = "devices" }
|
2019-07-02 23:54:05 +00:00
|
|
|
disk = { path = "disk" }
|
2022-10-11 19:53:23 +00:00
|
|
|
document-features = "0.2"
|
2021-11-05 23:07:59 +00:00
|
|
|
enumn = "0.1.0"
|
2022-07-25 12:28:01 +00:00
|
|
|
gdbstub = { version = "0.6.3", optional = true }
|
|
|
|
gdbstub_arch = { version = "0.2.4", optional = true }
|
rutabaga_gfx: rutabaga_gralloc: a shimmering beacon of hope
rutabaga_gralloc is a cross-platform, Rust-based buffer
manager.
The rationale for this change is:
1) For the {cross-domain, wayland} context type, we need to
have a good story for the crucial "wl-dmabuf" feature. As
minigbm has been thoroughly tested on ChromeOS and currently
powers the "wl-dmabuf" feature, it only makes sense for us to
have a path to minigbm for the cross-domain prototype. This
will be used by Sommelier.
2) While minigbm allocation works well on Chromebooks, it is
not sufficient for cross-platform purposes. For their Virtual
Graphics Interface (VGI) initiative, Android graphics
virtualization experts have expressed their desire for a Vulkan
based allocator. This will to go alongside cros_gralloc in
minigbm, which is considered by many to be the ""world's
premiere gralloc implementation".
3) Android graphics virtualization experts have expressed their
desire for vkMapMemory(..) to be used when crosvm is in
multi-process mode. Currently, only dma-buf mmap() is supported
for zero-copy blobs in multi-process mode. dma-buf mmap() is not
guaranteed to work on Nvidia (a "must have" for Cuttlefish) or
any other driver for that matter (we *make* it work for ChromeOS).
Possibly only solution: vkMapMemory ;-)
With these goals in mind, here's a summary of the revelant changes:
* Renamed the {gpu_allocator.rs, GpuMemoryAllocator trait} to be
{gralloc.rs, Gralloc trait}.
* Moved all GPU allocation out of the resources crate and into
the rutabaga_gfx crate. This will allow the resources crate to
be focused on managing resources for virtual machines.
* Moved the gpu_buffer crate into the gralloc module in the
rutabaga_gfx crate. The same functionality is now under
"minigbm.rs", "minigbm_bindings.rs" and "rendernode.rs"
* Added an optional dependency on vulkano.rs. vulkano.rs is a safe
Rust wrapper around the Vulkan api [a]. It's emphasis on type
safety makes a good fit for crosvm, though there are other high
quality crates out there (gfx-rs, ash.rs). Though development
has slowed down, it should satisfy goals (2) and (3) quite easily.
* Added a system_gralloc implementation based on memfd. This can be
used when minigbm or Vulkano features are not used, to replicate the
highly useful "wl-shm" feature in Sommelier. Astute observers will
note this can also enable seamless Wayland windowing without GPU
features for Android too. Some minor changes to the base crate were
needed.
* Cut down on the amount of DrmFormats to the subset needed by
Sommelier and cros_gralloc.
* Moved checked arithmetic into it's own file.
* Internally renamed to "wl-dmabuf" feature to be the "minigbm"
feature. This is because "wl-dmabuf" has a dependency on minigbm.
* Small rutabaga_gfx cleanups
[a] https://github.com/vulkano-rs/vulkano/blob/master/DESIGN.md
BUG=b:146066070, b:173630595, b:150239451
TEST=launch virtual machine with 2D mode
TEST=launch virtual machine with 3D mode
TEST=run sommelier with "wl-dmabuf" and "wl-shm"
Change-Id: I693a39cef64cd98e56d843d3c60caa7983d4d6e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2626487
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
2020-12-09 18:44:13 +00:00
|
|
|
rutabaga_gfx = { path = "rutabaga_gfx"}
|
2020-06-21 04:45:32 +00:00
|
|
|
hypervisor = { path = "hypervisor" }
|
2018-02-02 01:49:01 +00:00
|
|
|
kernel_cmdline = { path = "kernel_cmdline" }
|
2017-05-02 00:57:18 +00:00
|
|
|
kernel_loader = { path = "kernel_loader" }
|
2020-06-21 04:45:32 +00:00
|
|
|
kvm = { path = "kvm", optional = true }
|
|
|
|
kvm_sys = { path = "kvm_sys", optional = true }
|
2021-04-17 01:12:24 +00:00
|
|
|
libc = "0.2.93"
|
2019-01-22 07:22:25 +00:00
|
|
|
libcras = "*"
|
2022-04-27 18:27:52 +00:00
|
|
|
# Compile out trace statements in release builds
|
|
|
|
log = { version = "0", features = ["release_max_level_debug"]}
|
crosvm: add JSON configuration file support
Add a new `--cfg` command-line parameter, which allows a single (for
now) JSON configuration file to be specified and loaded as the base
configuration for the VM, if the `config-file` feature is enabled (the
default).
Configuration options in the file can be overriden or extended by the
regular command-line arguments. Typically, options that can be specified
only once are overriden, and options that can be specified several times
(like `--block`) are extended, allowing some devices of the same type to
be declared in a configuration file and some more on the command-line.
Due to a limitation in argh, which does not yet allow `Option<bool>`
fields to be used as switches, merging more than a single configuration
file is not reliable so we only support a single configuration file for
now. This has been addressed upstream but not yet in a released version.
Configuration file support for all the options of RunCommand increases
the crosvm binary size compiled with the `chromeos` profile by 250KB.
However, due to the currently limited set of options in the
configuration file, the present CL increases the binary size by just
78KB. Without the `config-file` feature, this CL does not incur any
binary size increase.
Supported parameters as of this commit:
* battery
* block
* executable-path
* initrd
* net
* params
* serial
* socket
BUG=b:218223240
TEST=`cargo run --features config-file -- run --cfg vm.json` boots the
VM with parameters defined in vm.json.
Change-Id: Ibb27556144ee766af81c178e5b94bd5117e102da
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3970368
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-10-20 06:40:27 +00:00
|
|
|
merge = "0.1.0"
|
2022-05-23 20:18:04 +00:00
|
|
|
metrics = { path = "metrics" }
|
2017-09-28 04:04:03 +00:00
|
|
|
net_util = { path = "net_util" }
|
2022-07-20 23:32:24 +00:00
|
|
|
once_cell = "1.7"
|
2019-04-11 00:59:15 +00:00
|
|
|
protobuf = { version = "2.3", optional = true }
|
2019-04-06 03:34:50 +00:00
|
|
|
protos = { path = "protos", optional = true }
|
2019-03-11 19:36:30 +00:00
|
|
|
remain = "*"
|
2019-04-06 21:30:04 +00:00
|
|
|
resources = { path = "resources" }
|
2022-10-26 23:41:14 +00:00
|
|
|
scudo = { version = "0.1", optional = true }
|
2022-06-01 19:31:29 +00:00
|
|
|
serde = "*"
|
2021-05-24 08:13:45 +00:00
|
|
|
serde_json = "*"
|
2022-06-01 19:31:29 +00:00
|
|
|
serde_keyvalue = { path = "serde_keyvalue", features = ["argh_derive"] }
|
2022-10-27 19:30:07 +00:00
|
|
|
static_assertions = "1.1"
|
2021-10-27 18:04:03 +00:00
|
|
|
sync = { path = "common/sync" }
|
2021-09-22 20:10:11 +00:00
|
|
|
tempfile = "3"
|
2022-03-29 05:14:25 +00:00
|
|
|
terminal_size = "0.1.17"
|
2021-08-18 21:16:16 +00:00
|
|
|
thiserror = { version = "1.0.20" }
|
2022-06-29 17:18:31 +00:00
|
|
|
uuid = { version = "0.8.2", features = [ "serde" ] }
|
2019-04-06 21:30:04 +00:00
|
|
|
vhost = { path = "vhost" }
|
|
|
|
vm_control = { path = "vm_control" }
|
2019-11-01 07:18:13 +00:00
|
|
|
acpi_tables = { path = "acpi_tables" }
|
2020-07-21 03:21:11 +00:00
|
|
|
vm_memory = { path = "vm_memory" }
|
2017-05-02 00:57:18 +00:00
|
|
|
|
2017-08-31 00:07:01 +00:00
|
|
|
[target.'cfg(target_arch = "x86_64")'.dependencies]
|
|
|
|
x86_64 = { path = "x86_64" }
|
2018-01-17 01:59:03 +00:00
|
|
|
|
2018-02-27 01:27:40 +00:00
|
|
|
[target.'cfg(any(target_arch = "aarch64", target_arch = "arm"))'.dependencies]
|
|
|
|
aarch64 = { path = "aarch64" }
|
|
|
|
|
2022-07-19 19:05:44 +00:00
|
|
|
[target.'cfg(unix)'.dependencies]
|
|
|
|
minijail = "*" # provided by ebuild
|
|
|
|
p9 = "*"
|
|
|
|
|
2022-09-14 05:18:14 +00:00
|
|
|
[target.'cfg(target_os="linux")'.dependencies]
|
|
|
|
swap = { path = "swap", optional = true }
|
|
|
|
|
2022-04-12 17:03:17 +00:00
|
|
|
[target.'cfg(windows)'.dependencies]
|
2022-07-20 23:32:24 +00:00
|
|
|
anti_tamper = { path = "anti_tamper" }
|
|
|
|
cros_async = { path = "cros_async" }
|
2022-08-03 05:35:19 +00:00
|
|
|
ctrlc = "*"
|
2022-07-20 23:32:24 +00:00
|
|
|
futures = "0.3"
|
|
|
|
gpu_display = { path = "gpu_display", optional = true }
|
|
|
|
rand = "0.8"
|
2022-07-27 05:19:25 +00:00
|
|
|
sandbox = { path = "sandbox" }
|
2022-10-14 22:14:39 +00:00
|
|
|
cros_tracing = { path = "cros_tracing" }
|
2022-04-12 17:03:17 +00:00
|
|
|
tube_transporter = { path = "tube_transporter" }
|
2022-07-20 23:32:24 +00:00
|
|
|
winapi = "*"
|
2022-10-17 21:24:42 +00:00
|
|
|
win_audio = { path = "win_audio"}
|
2022-07-20 23:32:24 +00:00
|
|
|
win_util = { path = "win_util"}
|
2022-04-12 17:03:17 +00:00
|
|
|
|
2022-07-20 00:26:21 +00:00
|
|
|
[build-dependencies]
|
|
|
|
cc = "*"
|
2022-11-02 01:16:50 +00:00
|
|
|
which = "4"
|
2022-07-20 00:26:21 +00:00
|
|
|
|
2018-01-17 01:59:03 +00:00
|
|
|
[dev-dependencies]
|
2020-08-03 03:09:41 +00:00
|
|
|
base = "*"
|
2022-10-06 20:17:00 +00:00
|
|
|
prebuilts = { path = "prebuilts" }
|
2018-12-20 07:44:11 +00:00
|
|
|
|
|
|
|
[patch.crates-io]
|
2021-10-27 18:04:03 +00:00
|
|
|
audio_streams = { path = "common/audio_streams" }
|
2022-03-16 19:16:04 +00:00
|
|
|
base = { path = "base" }
|
2022-03-17 18:26:01 +00:00
|
|
|
cros_async = { path = "cros_async" }
|
2021-07-23 17:06:40 +00:00
|
|
|
cros_fuzz = { path = "common/cros-fuzz" } # ignored by ebuild
|
2021-10-27 18:04:03 +00:00
|
|
|
data_model = { path = "common/data_model" }
|
2021-06-23 18:34:31 +00:00
|
|
|
libcras = { path = "libcras_stub" } # ignored by ebuild
|
2021-07-23 17:06:40 +00:00
|
|
|
p9 = { path = "common/p9" } # ignored by ebuild
|
2021-10-27 18:04:03 +00:00
|
|
|
sync = { path = "common/sync" }
|
2021-07-23 17:06:40 +00:00
|
|
|
wire_format_derive = { path = "common/p9/wire_format_derive" } # ignored by ebuild
|
2021-07-23 20:22:39 +00:00
|
|
|
minijail = { path = "third_party/minijail/rust/minijail" } # ignored by ebuild
|