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
|
|
|
[lib]
|
|
|
|
path = "src/crosvm.rs"
|
|
|
|
|
|
|
|
[[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-02-08 09:44:10 +00:00
|
|
|
# Reproduces the options used when building crosvm for Chrome OS.
|
|
|
|
[profile.chromeos]
|
|
|
|
inherits = "release"
|
|
|
|
opt-level = "s"
|
|
|
|
|
|
|
|
# Enables LTO to further reduce the size of the binary.
|
|
|
|
[profile.lto]
|
|
|
|
inherits = "chromeos"
|
|
|
|
lto = true
|
|
|
|
|
2021-06-23 18:06:38 +00:00
|
|
|
# We currently need to exclude some crates from the workspace to allow
|
|
|
|
# these crates to be independently built by portage. These crates will
|
|
|
|
# eventually be moved into separate repositories.
|
|
|
|
# The only workspace members that need to be explicitly specified here are those
|
|
|
|
# that are not dependencies of the crosvm root crate.
|
2017-11-09 01:33:46 +00:00
|
|
|
[workspace]
|
2020-11-10 17:34:56 +00:00
|
|
|
members = [
|
2021-10-27 18:04:03 +00:00
|
|
|
"aarch64",
|
|
|
|
"acpi_tables",
|
|
|
|
"arch",
|
2022-03-16 19:16:04 +00:00
|
|
|
"base",
|
2021-10-27 18:04:03 +00:00
|
|
|
"bit_field",
|
|
|
|
"crosvm-fuzz",
|
2022-03-16 19:16:04 +00:00
|
|
|
"crosvm_control",
|
2021-10-27 18:04:03 +00:00
|
|
|
"crosvm_plugin",
|
|
|
|
"devices",
|
|
|
|
"disk",
|
|
|
|
"fuse",
|
|
|
|
"gpu_display",
|
|
|
|
"hypervisor",
|
2020-11-10 17:34:56 +00:00
|
|
|
"integration_tests",
|
2021-10-27 18:04:03 +00:00
|
|
|
"kernel_cmdline",
|
|
|
|
"kernel_loader",
|
|
|
|
"kvm",
|
|
|
|
"kvm_sys",
|
2022-03-16 19:16:04 +00:00
|
|
|
"libcras_stub",
|
2021-10-27 18:04:03 +00:00
|
|
|
"libvda",
|
|
|
|
"linux_input_sys",
|
|
|
|
"net_sys",
|
|
|
|
"net_util",
|
|
|
|
"power_monitor",
|
|
|
|
"protos",
|
|
|
|
"qcow_utils",
|
|
|
|
"resources",
|
|
|
|
"rutabaga_gfx",
|
2022-03-16 19:16:04 +00:00
|
|
|
"system_api_stub",
|
2021-10-27 18:04:03 +00:00
|
|
|
"tpm2",
|
|
|
|
"tpm2-sys",
|
|
|
|
"usb_sys",
|
|
|
|
"usb_util",
|
|
|
|
"vfio_sys",
|
|
|
|
"vhost",
|
|
|
|
"virtio_sys",
|
|
|
|
"vm_control",
|
|
|
|
"vm_memory",
|
|
|
|
"x86_64",
|
2022-03-16 19:16:04 +00:00
|
|
|
"third_party/vmm_vhost",
|
2020-11-10 17:34:56 +00:00
|
|
|
]
|
2018-12-20 07:44:11 +00:00
|
|
|
exclude = [
|
2021-10-27 18:04:03 +00:00
|
|
|
"common/assertions",
|
|
|
|
"common/audio_streams",
|
2022-03-16 19:16:04 +00:00
|
|
|
"common/balloon_control",
|
2021-10-27 18:04:03 +00:00
|
|
|
"common/cros-fuzz",
|
|
|
|
"common/cros_async",
|
2021-07-13 06:14:25 +00:00
|
|
|
"common/cros_asyncv2",
|
2021-10-27 18:04:03 +00:00
|
|
|
"common/data_model",
|
|
|
|
"common/io_uring",
|
|
|
|
"common/p9",
|
|
|
|
"common/sync",
|
|
|
|
"common/sys_util",
|
2022-03-16 19:16:04 +00:00
|
|
|
"common/sys_util_core",
|
|
|
|
"common/win_sys_util",
|
|
|
|
"common/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]
|
2021-10-13 23:25:49 +00:00
|
|
|
all-linux = [
|
|
|
|
# TODO(b/203105868): Enable remaining features on linux builds.
|
|
|
|
"composite-disk",
|
|
|
|
"default",
|
|
|
|
"gdb",
|
|
|
|
"tpm",
|
|
|
|
"virgl_renderer_next",
|
|
|
|
"virgl_renderer",
|
|
|
|
"x",
|
|
|
|
]
|
2021-07-02 18:42:06 +00:00
|
|
|
audio = ["devices/audio"]
|
2021-06-23 18:34:31 +00:00
|
|
|
audio_cras = ["devices/audio_cras"]
|
2021-06-21 11:59:04 +00:00
|
|
|
chromeos = ["base/chromeos", "audio_cras", "devices/chromeos"]
|
2021-07-02 18:42:06 +00:00
|
|
|
composite-disk = ["protos/composite-disk", "protobuf", "disk/composite-disk"]
|
|
|
|
default = ["audio", "gpu", "usb"]
|
2018-05-10 17:25:58 +00:00
|
|
|
default-no-sandbox = []
|
2022-02-25 15:47:16 +00:00
|
|
|
direct = ["devices/direct", "x86_64/direct"]
|
2021-08-18 21:16:16 +00:00
|
|
|
gdb = ["gdbstub", "gdbstub_arch", "arch/gdb", "vm_control/gdb", "x86_64/gdb"]
|
2021-07-02 18:42:06 +00:00
|
|
|
gfxstream = ["devices/gfxstream"]
|
2017-09-14 02:15:43 +00:00
|
|
|
gpu = ["devices/gpu"]
|
2021-07-11 14:06:30 +00:00
|
|
|
libvda = ["devices/libvda"]
|
2022-03-10 00:25:29 +00:00
|
|
|
linux-armhf = [
|
|
|
|
"composite-disk",
|
|
|
|
"default",
|
|
|
|
"gdb",
|
|
|
|
"tpm",
|
|
|
|
]
|
|
|
|
linux-x86_64 = ["all-linux", "plugin"]
|
|
|
|
linux-aarch64 = ["all-linux"]
|
2020-06-21 04:45:32 +00:00
|
|
|
plugin = ["protos/plugin", "crosvm_plugin", "kvm", "kvm_sys", "protobuf"]
|
2020-11-10 09:24:04 +00:00
|
|
|
power-monitor-powerd = ["arch/power-monitor-powerd"]
|
2019-04-06 21:30:04 +00:00
|
|
|
tpm = ["devices/tpm"]
|
2021-05-21 20:55:10 +00:00
|
|
|
usb = ["devices/usb"]
|
2021-07-11 23:37:13 +00:00
|
|
|
video-decoder = ["devices/video-decoder"]
|
|
|
|
video-encoder = ["devices/video-encoder"]
|
2021-07-02 18:42:06 +00:00
|
|
|
virgl_renderer = ["devices/virgl_renderer"]
|
|
|
|
virgl_renderer_next = ["rutabaga_gfx/virgl_renderer_next"]
|
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
|
|
|
wl-dmabuf = ["devices/minigbm"]
|
2019-04-16 22:09:20 +00:00
|
|
|
x = ["devices/x"]
|
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" }
|
2021-10-27 18:04:03 +00:00
|
|
|
assertions = { path = "common/assertions" }
|
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" }
|
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" }
|
2021-11-05 23:07:59 +00:00
|
|
|
enumn = "0.1.0"
|
2021-08-04 18:44:49 +00:00
|
|
|
gdbstub = { version = "0.5.0", optional = true }
|
|
|
|
gdbstub_arch = { version = "0.1.0", 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 = "*"
|
2020-06-19 14:19:48 +00:00
|
|
|
minijail = "*" # provided by ebuild
|
2017-09-28 04:04:03 +00:00
|
|
|
net_util = { path = "net_util" }
|
2020-10-27 09:33:02 +00:00
|
|
|
p9 = "*"
|
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" }
|
2021-12-03 08:43:37 +00:00
|
|
|
scudo = { version = "0.1", optional = true }
|
2021-05-24 08:13:45 +00:00
|
|
|
serde_json = "*"
|
2021-10-27 18:04:03 +00:00
|
|
|
sync = { path = "common/sync" }
|
2021-09-22 20:10:11 +00:00
|
|
|
tempfile = "3"
|
2021-08-18 21:16:16 +00:00
|
|
|
thiserror = { version = "1.0.20" }
|
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" }
|
|
|
|
|
2018-01-17 01:59:03 +00:00
|
|
|
[dev-dependencies]
|
2020-08-03 03:09:41 +00:00
|
|
|
base = "*"
|
2018-12-20 07:44:11 +00:00
|
|
|
|
|
|
|
[patch.crates-io]
|
2021-10-27 18:04:03 +00:00
|
|
|
assertions = { path = "common/assertions" }
|
|
|
|
audio_streams = { path = "common/audio_streams" }
|
2022-03-16 19:16:04 +00:00
|
|
|
base = { path = "base" }
|
2022-01-31 23:18:10 +00:00
|
|
|
sys_util_core = { path = "common/sys_util_core" }
|
2021-10-27 18:04:03 +00:00
|
|
|
cros_async = { path = "common/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" }
|
|
|
|
sys_util = { path = "common/sys_util" }
|
2021-06-21 11:59:04 +00:00
|
|
|
system_api = { path = "system_api_stub" } # ignored by ebuild
|
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
|