build: Bump vmm-sys-util crate and its consumers

This patch bumps the following crates, including `kvm-bindings@0.7.0`*,
`kvm-ioctls@0.16.0`**, `linux-loader@0.11.0`, `versionize@0.2.0`,
`versionize_derive@0.1.6`***, `vhost@0.10.0`,
`vhost-user-backend@0.13.1`, `virtio-queue@0.11.0`, `vm-memory@0.14.0`,
`vmm-sys-util@0.12.1`, and the latest of `vfio-bindings`, `vfio-ioctls`,
`mshv-bindings`,`mshv-ioctls`, and `vfio-user`.

* A fork of the `kvm-bindings` crate is being used to support
serialization of various structs for migration [1]. Also, code changes
are made to accommodate the updated `struct xsave` from the Linux
kernel. Note: these changes related to `struct xsave` break
live-upgrade.

** The new `kvm-ioctls` crate introduced breaking changes for
the `get/set_one_reg` API on `aarch64` [2], so code changes are made to
the new APIs.

*** A fork of the `versionize_derive` crate is being used to support
versionize on packed structs [3].

[1] https://github.com/cloud-hypervisor/kvm-bindings/tree/ch-v0.7.0
[2] https://github.com/rust-vmm/kvm-ioctls/pull/223
[3] https://github.com/cloud-hypervisor/versionize_derive/tree/ch-0.1.6

Fixes: #6072

Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
Bo Chen 2024-01-23 09:29:40 -08:00 committed by Rob Bradford
parent 6cb1d908bf
commit 3ce0fef7fd
27 changed files with 305 additions and 290 deletions

124
Cargo.lock generated
View File

@ -92,7 +92,7 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
name = "api_client"
version = "0.1.0"
dependencies = [
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
@ -120,7 +120,7 @@ dependencies = [
"vm-fdt",
"vm-memory",
"vm-migration",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
@ -354,7 +354,7 @@ dependencies = [
"virtio-queue",
"vm-memory",
"vm-virtio",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
@ -463,7 +463,7 @@ dependencies = [
"tracer",
"vm-memory",
"vmm",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
"wait-timeout",
"zbus",
]
@ -512,9 +512,9 @@ dependencies = [
[[package]]
name = "crc64"
version = "1.0.0"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55626594feae15d266d52440b26ff77de0e22230cf0c113abe619084c1ddc910"
checksum = "2707e3afba5e19b75d582d88bc79237418f2a2a2d673d01cf9b03633b46e98f3"
[[package]]
name = "crossbeam-utils"
@ -603,7 +603,7 @@ dependencies = [
"vm-device",
"vm-memory",
"vm-migration",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
@ -1023,7 +1023,7 @@ dependencies = [
"thiserror",
"vfio-ioctls",
"vm-memory",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
@ -1145,22 +1145,24 @@ dependencies = [
[[package]]
name = "kvm-bindings"
version = "0.6.0"
source = "git+https://github.com/cloud-hypervisor/kvm-bindings?branch=ch-v0.6.0-tdx#7d9ffb47e5b9b1989577258800a0f57c93f1445f"
version = "0.7.0"
source = "git+https://github.com/cloud-hypervisor/kvm-bindings?branch=ch-v0.7.0#2dcf85d4f8aa55befcaa996b699ddb18ec9ed059"
dependencies = [
"serde",
"serde_derive",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
name = "kvm-ioctls"
version = "0.13.0"
source = "git+https://github.com/rust-vmm/kvm-ioctls?branch=main#23a3bb045a467e60bb00328a0b13cea13b5815d0"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9002dff009755414f22b962ec6ae6980b07d6d8b06e5297b1062019d72bd6a8c"
dependencies = [
"bitflags 2.4.1",
"kvm-bindings",
"libc",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
@ -1203,9 +1205,9 @@ dependencies = [
[[package]]
name = "linux-loader"
version = "0.10.0"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "132a531b85b3a164012ab682c72f8f2cce7757f187be5f60782fd2b4cda9cb34"
checksum = "eb68dd3452f25a8defaf0ae593509cff0c777683e4d8924f59ac7c5f89267a83"
dependencies = [
"vm-memory",
]
@ -1265,7 +1267,7 @@ version = "0.1.0"
source = "git+https://github.com/firecracker-microvm/micro-http?branch=main#e75dfa1eeea23b69caa7407bc2c3a76d7b7262fb"
dependencies = [
"libc",
"vmm-sys-util 0.12.1",
"vmm-sys-util",
]
[[package]]
@ -1290,23 +1292,23 @@ dependencies = [
[[package]]
name = "mshv-bindings"
version = "0.1.1"
source = "git+https://github.com/rust-vmm/mshv?branch=main#0dd4d3452a7f2e95199f4b58380acc41458474de"
source = "git+https://github.com/rust-vmm/mshv?branch=main#9d0c11fe9fedfbcf56a5d62fbf4bad80cdf91340"
dependencies = [
"libc",
"serde",
"serde_derive",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
"zerocopy",
]
[[package]]
name = "mshv-ioctls"
version = "0.1.1"
source = "git+https://github.com/rust-vmm/mshv?branch=main#0dd4d3452a7f2e95199f4b58380acc41458474de"
source = "git+https://github.com/rust-vmm/mshv?branch=main#9d0c11fe9fedfbcf56a5d62fbf4bad80cdf91340"
dependencies = [
"libc",
"mshv-bindings",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
@ -1322,7 +1324,7 @@ dependencies = [
name = "net_gen"
version = "0.1.0"
dependencies = [
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
@ -1347,7 +1349,7 @@ dependencies = [
"virtio-queue",
"vm-memory",
"vm-virtio",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
@ -1534,7 +1536,7 @@ dependencies = [
"vm-device",
"vm-memory",
"vm-migration",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
@ -1784,7 +1786,7 @@ dependencies = [
"libc",
"log",
"thiserror",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
@ -2162,7 +2164,7 @@ dependencies = [
"serde",
"serde_json",
"ssh2",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
"wait-timeout",
]
@ -2219,7 +2221,7 @@ dependencies = [
"log",
"net_gen",
"thiserror",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
@ -2315,9 +2317,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
[[package]]
name = "versionize"
version = "0.1.10"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dca4b7062e7e6d685901e815c35f9671e059de97c1c0905eeff8592f3fff442f"
checksum = "62929d59c7f6730b7298fcb363760550f4db6e353fbac4076d447d0e82799d6d"
dependencies = [
"bincode",
"crc64",
@ -2327,13 +2329,13 @@ dependencies = [
"serde_derive",
"syn 1.0.109",
"versionize_derive",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
name = "versionize_derive"
version = "0.1.4"
source = "git+https://github.com/cloud-hypervisor/versionize_derive?branch=ch#e502b1d4aabab342386f0c53780d49f21a6a1df6"
version = "0.1.6"
source = "git+https://github.com/cloud-hypervisor/versionize_derive?branch=ch-0.1.6#7906da996152e2d0ab08f5526440683bf3ca7834"
dependencies = [
"proc-macro2",
"quote",
@ -2343,15 +2345,15 @@ dependencies = [
[[package]]
name = "vfio-bindings"
version = "0.4.0"
source = "git+https://github.com/rust-vmm/vfio?branch=main#59c604fa6e42080f0a47c124ba29454fe4cb7475"
source = "git+https://github.com/rust-vmm/vfio?branch=main#0daff4d4c159e842cf18b8b90457a45032b2df5a"
dependencies = [
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
name = "vfio-ioctls"
version = "0.2.0"
source = "git+https://github.com/rust-vmm/vfio?branch=main#59c604fa6e42080f0a47c124ba29454fe4cb7475"
source = "git+https://github.com/rust-vmm/vfio?branch=main#0daff4d4c159e842cf18b8b90457a45032b2df5a"
dependencies = [
"byteorder",
"kvm-bindings",
@ -2363,13 +2365,13 @@ dependencies = [
"thiserror",
"vfio-bindings",
"vm-memory",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
name = "vfio_user"
version = "0.1.0"
source = "git+https://github.com/rust-vmm/vfio-user?branch=main#6c72e997e61d9e84b8ee691ad63ece6c717cf5aa"
source = "git+https://github.com/rust-vmm/vfio-user?branch=main#a1f6e52829e069b6d698b2cfeecac742e4653186"
dependencies = [
"bitflags 1.3.2",
"libc",
@ -2380,26 +2382,26 @@ dependencies = [
"thiserror",
"vfio-bindings",
"vm-memory",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
name = "vhost"
version = "0.9.0"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "289adfce099c71f8310f895932ccd978f352ca494ea47496dbe20d4241888b82"
checksum = "2b64e816d0d49769fbfaa1494eb77cc2a3ddc526ead05c7f922cb7d64106286f"
dependencies = [
"bitflags 2.4.1",
"libc",
"vm-memory",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
name = "vhost-user-backend"
version = "0.11.0"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61255322e3ebe93fb77d9f6d99577eca7089bbea4174076c5353a8024a463061"
checksum = "72c8c447d076ac508d78cb45664d203df7989e891656dce260a7e93d72352c9a"
dependencies = [
"libc",
"log",
@ -2407,7 +2409,7 @@ dependencies = [
"virtio-bindings",
"virtio-queue",
"vm-memory",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
@ -2426,7 +2428,7 @@ dependencies = [
"virtio-bindings",
"virtio-queue",
"vm-memory",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
@ -2444,7 +2446,7 @@ dependencies = [
"vhost-user-backend",
"virtio-bindings",
"vm-memory",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
@ -2484,19 +2486,19 @@ dependencies = [
"vm-memory",
"vm-migration",
"vm-virtio",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
name = "virtio-queue"
version = "0.10.0"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73a01db2cfb6c4b9bc20608b1336263d16714ea8db05de9fec2a254e076f9385"
checksum = "e3f69a13d6610db9312acbb438b0390362af905d37634a2106be70c0f734986d"
dependencies = [
"log",
"virtio-bindings",
"vm-memory",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
@ -2518,7 +2520,7 @@ dependencies = [
"thiserror",
"vfio-ioctls",
"vm-memory",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
]
[[package]]
@ -2528,9 +2530,9 @@ source = "git+https://github.com/rust-vmm/vm-fdt?branch=main#77212bd0d62913e445c
[[package]]
name = "vm-memory"
version = "0.13.1"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5376c9ee5ebe2103a310d8241936cfb93c946734b0479a4fa5bdf7a64abbacd8"
checksum = "74ffc42216c32c35f858fa4bfdcd9b61017dfd691e0240268fdc85dbf59e5459"
dependencies = [
"arc-swap",
"libc",
@ -2614,23 +2616,11 @@ dependencies = [
"vm-memory",
"vm-migration",
"vm-virtio",
"vmm-sys-util 0.11.1",
"vmm-sys-util",
"zbus",
"zerocopy",
]
[[package]]
name = "vmm-sys-util"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd64fe09d8e880e600c324e7d664760a17f56e9672b7495a86381b49e4f72f46"
dependencies = [
"bitflags 1.3.2",
"libc",
"serde",
"serde_derive",
]
[[package]]
name = "vmm-sys-util"
version = "0.12.1"
@ -2639,6 +2629,8 @@ checksum = "1d1435039746e20da4f8d507a72ee1b916f7b4b05af7a91c093d2c6561934ede"
dependencies = [
"bitflags 1.3.2",
"libc",
"serde",
"serde_derive",
]
[[package]]

View File

@ -46,15 +46,14 @@ thiserror = "1.0.52"
tpm = { path = "tpm"}
tracer = { path = "tracer" }
vmm = { path = "vmm" }
vmm-sys-util = "0.11.0"
vm-memory = "0.13.1"
vmm-sys-util = "0.12.1"
vm-memory = "0.14.0"
zbus = { version = "3.11.1", optional = true }
# List of patched crates
[patch.crates-io]
kvm-bindings = { git = "https://github.com/cloud-hypervisor/kvm-bindings", branch = "ch-v0.6.0-tdx" }
kvm-ioctls = { git = "https://github.com/rust-vmm/kvm-ioctls", branch = "main" }
versionize_derive = { git = "https://github.com/cloud-hypervisor/versionize_derive", branch = "ch" }
kvm-bindings = { git = "https://github.com/cloud-hypervisor/kvm-bindings", branch = "ch-v0.7.0" }
versionize_derive = { git = "https://github.com/cloud-hypervisor/versionize_derive", branch = "ch-0.1.6" }
[dev-dependencies]
dirs = "5.0.0"

View File

@ -5,4 +5,4 @@ authors = ["The Cloud Hypervisor Authors"]
edition = "2021"
[dependencies]
vmm-sys-util = "0.11.0"
vmm-sys-util = "0.12.1"

View File

@ -14,16 +14,16 @@ anyhow = "1.0.79"
byteorder = "1.4.3"
hypervisor = { path = "../hypervisor" }
libc = "0.2.147"
linux-loader = { version = "0.10.0", features = ["elf", "bzimage", "pe"] }
linux-loader = { version = "0.11.0", features = ["elf", "bzimage", "pe"] }
log = "0.4.20"
serde = { version = "1.0.168", features = ["rc", "derive"] }
thiserror = "1.0.52"
uuid = "1.3.4"
versionize = "0.1.10"
versionize_derive = "0.1.4"
vm-memory = { version = "0.13.1", features = ["backend-mmap", "backend-bitmap"] }
versionize = "0.2.0"
versionize_derive = "0.1.6"
vm-memory = { version = "0.14.0", features = ["backend-mmap", "backend-bitmap"] }
vm-migration = { path = "../vm-migration" }
vmm-sys-util = { version = "0.11.0", features = ["with-serde"] }
vmm-sys-util = { version = "0.12.1", features = ["with-serde"] }
[target.'cfg(target_arch = "aarch64")'.dependencies]
fdt_parser = { version = "0.1.4", package = "fdt" }

View File

@ -18,10 +18,10 @@ remain = "0.2.11"
smallvec = "1.11.0"
thiserror = "1.0.52"
uuid = { version = "1.3.4", features = ["v4"] }
versionize = "0.1.10"
versionize_derive = "0.1.4"
versionize = "0.2.0"
versionize_derive = "0.1.6"
virtio-bindings = { version = "0.2.0", features = ["virtio-v5_0_0"] }
virtio-queue = "0.10.0"
vm-memory = { version = "0.13.1", features = ["backend-mmap", "backend-atomic", "backend-bitmap"] }
virtio-queue = "0.11.0"
vm-memory = { version = "0.14.0", features = ["backend-mmap", "backend-atomic", "backend-bitmap"] }
vm-virtio = { path = "../vm-virtio" }
vmm-sys-util = "0.11.0"
vmm-sys-util = "0.12.1"

View File

@ -17,13 +17,13 @@ log = "0.4.20"
pci = { path = "../pci" }
thiserror = "1.0.52"
tpm = { path = "../tpm" }
versionize = "0.1.10"
versionize_derive = "0.1.4"
versionize = "0.2.0"
versionize_derive = "0.1.6"
vm-allocator = { path = "../vm-allocator" }
vm-device = { path = "../vm-device" }
vm-memory = "0.13.1"
vm-memory = "0.14.0"
vm-migration = { path = "../vm-migration" }
vmm-sys-util = "0.11.0"
vmm-sys-util = "0.12.1"
[target.'cfg(target_arch = "aarch64")'.dependencies]
arch = { path = "../arch" }

105
fuzz/Cargo.lock generated
View File

@ -68,7 +68,7 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
name = "api_client"
version = "0.1.0"
dependencies = [
"vmm-sys-util 0.11.2",
"vmm-sys-util",
]
[[package]]
@ -102,7 +102,7 @@ dependencies = [
"vm-fdt",
"vm-memory",
"vm-migration",
"vmm-sys-util 0.11.2",
"vmm-sys-util",
]
[[package]]
@ -151,7 +151,7 @@ dependencies = [
"virtio-queue",
"vm-memory",
"vm-virtio",
"vmm-sys-util 0.11.2",
"vmm-sys-util",
]
[[package]]
@ -230,7 +230,7 @@ dependencies = [
"tracer",
"vm-memory",
"vmm",
"vmm-sys-util 0.11.2",
"vmm-sys-util",
]
[[package]]
@ -255,7 +255,7 @@ dependencies = [
"vm-migration",
"vm-virtio",
"vmm",
"vmm-sys-util 0.11.2",
"vmm-sys-util",
]
[[package]]
@ -275,9 +275,9 @@ dependencies = [
[[package]]
name = "crc64"
version = "1.0.0"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55626594feae15d266d52440b26ff77de0e22230cf0c113abe619084c1ddc910"
checksum = "2707e3afba5e19b75d582d88bc79237418f2a2a2d673d01cf9b03633b46e98f3"
[[package]]
name = "darling"
@ -336,7 +336,7 @@ dependencies = [
"vm-device",
"vm-memory",
"vm-migration",
"vmm-sys-util 0.11.2",
"vmm-sys-util",
]
[[package]]
@ -425,7 +425,7 @@ dependencies = [
"thiserror",
"vfio-ioctls",
"vm-memory",
"vmm-sys-util 0.11.2",
"vmm-sys-util",
]
[[package]]
@ -470,23 +470,24 @@ dependencies = [
[[package]]
name = "kvm-bindings"
version = "0.6.0"
source = "git+https://github.com/cloud-hypervisor/kvm-bindings?branch=ch-v0.6.0-tdx#7d9ffb47e5b9b1989577258800a0f57c93f1445f"
version = "0.7.0"
source = "git+https://github.com/cloud-hypervisor/kvm-bindings?branch=ch-v0.7.0#2dcf85d4f8aa55befcaa996b699ddb18ec9ed059"
dependencies = [
"serde",
"serde_derive",
"vmm-sys-util 0.11.2",
"vmm-sys-util",
]
[[package]]
name = "kvm-ioctls"
version = "0.13.0"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8f8dc9c1896e5f144ec5d07169bc29f39a047686d29585a91f30489abfaeb6b"
checksum = "9002dff009755414f22b962ec6ae6980b07d6d8b06e5297b1062019d72bd6a8c"
dependencies = [
"bitflags 2.4.1",
"kvm-bindings",
"libc",
"vmm-sys-util 0.11.2",
"vmm-sys-util",
]
[[package]]
@ -508,9 +509,9 @@ dependencies = [
[[package]]
name = "linux-loader"
version = "0.10.0"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "132a531b85b3a164012ab682c72f8f2cce7757f187be5f60782fd2b4cda9cb34"
checksum = "eb68dd3452f25a8defaf0ae593509cff0c777683e4d8924f59ac7c5f89267a83"
dependencies = [
"vm-memory",
]
@ -537,7 +538,7 @@ version = "0.1.0"
source = "git+https://github.com/firecracker-microvm/micro-http?branch=main#e75dfa1eeea23b69caa7407bc2c3a76d7b7262fb"
dependencies = [
"libc",
"vmm-sys-util 0.12.1",
"vmm-sys-util",
]
[[package]]
@ -553,7 +554,7 @@ dependencies = [
name = "net_gen"
version = "0.1.0"
dependencies = [
"vmm-sys-util 0.11.2",
"vmm-sys-util",
]
[[package]]
@ -574,7 +575,7 @@ dependencies = [
"virtio-queue",
"vm-memory",
"vm-virtio",
"vmm-sys-util 0.11.2",
"vmm-sys-util",
]
[[package]]
@ -607,7 +608,7 @@ dependencies = [
"vm-device",
"vm-memory",
"vm-migration",
"vmm-sys-util 0.11.2",
"vmm-sys-util",
]
[[package]]
@ -656,7 +657,7 @@ dependencies = [
"libc",
"log",
"thiserror",
"vmm-sys-util 0.11.2",
"vmm-sys-util",
]
[[package]]
@ -855,7 +856,7 @@ dependencies = [
"log",
"net_gen",
"thiserror",
"vmm-sys-util 0.11.2",
"vmm-sys-util",
]
[[package]]
@ -892,9 +893,9 @@ dependencies = [
[[package]]
name = "versionize"
version = "0.1.10"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dca4b7062e7e6d685901e815c35f9671e059de97c1c0905eeff8592f3fff442f"
checksum = "62929d59c7f6730b7298fcb363760550f4db6e353fbac4076d447d0e82799d6d"
dependencies = [
"bincode",
"crc64",
@ -904,13 +905,13 @@ dependencies = [
"serde_derive",
"syn 1.0.109",
"versionize_derive",
"vmm-sys-util 0.11.2",
"vmm-sys-util",
]
[[package]]
name = "versionize_derive"
version = "0.1.4"
source = "git+https://github.com/cloud-hypervisor/versionize_derive?branch=ch#e502b1d4aabab342386f0c53780d49f21a6a1df6"
version = "0.1.6"
source = "git+https://github.com/cloud-hypervisor/versionize_derive?branch=ch-0.1.6#7906da996152e2d0ab08f5526440683bf3ca7834"
dependencies = [
"proc-macro2",
"quote",
@ -920,15 +921,15 @@ dependencies = [
[[package]]
name = "vfio-bindings"
version = "0.4.0"
source = "git+https://github.com/rust-vmm/vfio?branch=main#59c604fa6e42080f0a47c124ba29454fe4cb7475"
source = "git+https://github.com/rust-vmm/vfio?branch=main#0daff4d4c159e842cf18b8b90457a45032b2df5a"
dependencies = [
"vmm-sys-util 0.11.2",
"vmm-sys-util",
]
[[package]]
name = "vfio-ioctls"
version = "0.2.0"
source = "git+https://github.com/rust-vmm/vfio?branch=main#59c604fa6e42080f0a47c124ba29454fe4cb7475"
source = "git+https://github.com/rust-vmm/vfio?branch=main#0daff4d4c159e842cf18b8b90457a45032b2df5a"
dependencies = [
"byteorder",
"kvm-bindings",
@ -938,13 +939,13 @@ dependencies = [
"thiserror",
"vfio-bindings",
"vm-memory",
"vmm-sys-util 0.11.2",
"vmm-sys-util",
]
[[package]]
name = "vfio_user"
version = "0.1.0"
source = "git+https://github.com/rust-vmm/vfio-user?branch=main#6c72e997e61d9e84b8ee691ad63ece6c717cf5aa"
source = "git+https://github.com/rust-vmm/vfio-user?branch=main#a1f6e52829e069b6d698b2cfeecac742e4653186"
dependencies = [
"bitflags 1.3.2",
"libc",
@ -955,19 +956,19 @@ dependencies = [
"thiserror",
"vfio-bindings",
"vm-memory",
"vmm-sys-util 0.11.2",
"vmm-sys-util",
]
[[package]]
name = "vhost"
version = "0.9.0"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "289adfce099c71f8310f895932ccd978f352ca494ea47496dbe20d4241888b82"
checksum = "2b64e816d0d49769fbfaa1494eb77cc2a3ddc526ead05c7f922cb7d64106286f"
dependencies = [
"bitflags 2.4.1",
"libc",
"vm-memory",
"vmm-sys-util 0.11.2",
"vmm-sys-util",
]
[[package]]
@ -1007,19 +1008,19 @@ dependencies = [
"vm-memory",
"vm-migration",
"vm-virtio",
"vmm-sys-util 0.11.2",
"vmm-sys-util",
]
[[package]]
name = "virtio-queue"
version = "0.10.0"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73a01db2cfb6c4b9bc20608b1336263d16714ea8db05de9fec2a254e076f9385"
checksum = "e3f69a13d6610db9312acbb438b0390362af905d37634a2106be70c0f734986d"
dependencies = [
"log",
"virtio-bindings",
"vm-memory",
"vmm-sys-util 0.11.2",
"vmm-sys-util",
]
[[package]]
@ -1041,7 +1042,7 @@ dependencies = [
"thiserror",
"vfio-ioctls",
"vm-memory",
"vmm-sys-util 0.11.2",
"vmm-sys-util",
]
[[package]]
@ -1051,9 +1052,9 @@ source = "git+https://github.com/rust-vmm/vm-fdt?branch=main#c5a99ab71b130435927
[[package]]
name = "vm-memory"
version = "0.13.1"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5376c9ee5ebe2103a310d8241936cfb93c946734b0479a4fa5bdf7a64abbacd8"
checksum = "74ffc42216c32c35f858fa4bfdcd9b61017dfd691e0240268fdc85dbf59e5459"
dependencies = [
"arc-swap",
"libc",
@ -1128,22 +1129,10 @@ dependencies = [
"vm-memory",
"vm-migration",
"vm-virtio",
"vmm-sys-util 0.11.2",
"vmm-sys-util",
"zerocopy",
]
[[package]]
name = "vmm-sys-util"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48b7b084231214f7427041e4220d77dfe726897a6d41fddee450696e66ff2a29"
dependencies = [
"bitflags 1.3.2",
"libc",
"serde",
"serde_derive",
]
[[package]]
name = "vmm-sys-util"
version = "0.12.1"
@ -1152,6 +1141,8 @@ checksum = "1d1435039746e20da4f8d507a72ee1b916f7b4b05af7a91c093d2c6561934ede"
dependencies = [
"bitflags 1.3.2",
"libc",
"serde",
"serde_derive",
]
[[package]]

View File

@ -17,16 +17,16 @@ devices = { path = "../devices" }
epoll = "4.3.1"
libc = "0.2.152"
libfuzzer-sys = "0.4.7"
linux-loader = { version = "0.10.0", features = ["elf", "bzimage", "pe"] }
linux-loader = { version = "0.11.0", features = ["elf", "bzimage", "pe"] }
micro_http = { git = "https://github.com/firecracker-microvm/micro-http", branch = "main" }
net_util = { path = "../net_util" }
once_cell = "1.19.0"
seccompiler = "0.4.0"
virtio-devices = { path = "../virtio-devices" }
virtio-queue = "0.10.0"
virtio-queue = "0.11.0"
vmm = { path = "../vmm" }
vmm-sys-util = "0.11.2"
vm-memory = "0.13.1"
vmm-sys-util = "0.12.1"
vm-memory = "0.14.0"
vm-migration = { path = "../vm-migration" }
vm-device = { path = "../vm-device" }
vm-virtio = { path = "../vm-virtio" }
@ -35,8 +35,8 @@ vm-virtio = { path = "../vm-virtio" }
path = ".."
[patch.crates-io]
kvm-bindings = { git = "https://github.com/cloud-hypervisor/kvm-bindings", branch = "ch-v0.6.0-tdx" }
versionize_derive = { git = "https://github.com/cloud-hypervisor/versionize_derive", branch = "ch" }
kvm-bindings = { git = "https://github.com/cloud-hypervisor/kvm-bindings", branch = "ch-v0.7.0" }
versionize_derive = { git = "https://github.com/cloud-hypervisor/versionize_derive", branch = "ch-0.1.6" }
# Prevent this from interfering with workspaces
[workspace]

View File

@ -18,15 +18,15 @@ igvm_defs = { git = "https://github.com/microsoft/igvm", branch = "main", packag
igvm_parser = { git = "https://github.com/microsoft/igvm", branch = "main", package = "igvm", optional = true }
libc = "0.2.147"
log = "0.4.20"
kvm-ioctls = { version = "0.13.0", optional = true }
kvm-bindings = { git = "https://github.com/cloud-hypervisor/kvm-bindings", branch = "ch-v0.6.0-tdx", features = ["with-serde", "fam-wrappers"], optional = true }
kvm-ioctls = { version = "0.16.0", optional = true }
kvm-bindings = { git = "https://github.com/cloud-hypervisor/kvm-bindings", branch = "ch-v0.7.0", features = ["with-serde", "fam-wrappers"], optional = true }
mshv-bindings = { git = "https://github.com/rust-vmm/mshv", branch = "main", features = ["with-serde", "fam-wrappers"], optional = true }
mshv-ioctls = { git = "https://github.com/rust-vmm/mshv", branch = "main", optional = true}
serde = { version = "1.0.168", features = ["rc", "derive"] }
serde_with = { version = "3.4.0", default-features = false, features = ["macros"] }
vfio-ioctls = { git = "https://github.com/rust-vmm/vfio", branch = "main", default-features = false }
vm-memory = { version = "0.13.1", features = ["backend-mmap", "backend-atomic"] }
vmm-sys-util = { version = "0.11.0", features = ["with-serde"] }
vm-memory = { version = "0.14.0", features = ["backend-mmap", "backend-atomic"] }
vmm-sys-util = { version = "0.12.1", features = ["with-serde"] }
thiserror = "1.0.52"
[target.'cfg(target_arch = "x86_64")'.dependencies.iced-x86]

View File

@ -311,3 +311,17 @@ pub struct MsrEntry {
pub index: u32,
pub data: u64,
}
#[serde_with::serde_as]
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct XsaveState {
#[serde_as(as = "[_; 1024usize]")]
pub region: [u32; 1024usize],
}
impl Default for XsaveState {
fn default() -> Self {
// SAFETY: this is plain old data structure
unsafe { ::std::mem::zeroed() }
}
}

View File

@ -47,7 +47,7 @@ use vmm_sys_util::eventfd::EventFd;
pub mod x86_64;
#[cfg(target_arch = "x86_64")]
use crate::arch::x86::{
CpuIdEntry, FpuState, LapicState, MsrEntry, SpecialRegisters, StandardRegisters,
CpuIdEntry, FpuState, LapicState, MsrEntry, SpecialRegisters, StandardRegisters, XsaveState,
NUM_IOAPIC_PINS,
};
#[cfg(target_arch = "x86_64")]
@ -66,7 +66,7 @@ use kvm_bindings::{
#[cfg(target_arch = "x86_64")]
use x86_64::check_required_kvm_extensions;
#[cfg(target_arch = "x86_64")]
pub use x86_64::{CpuId, ExtendedControlRegisters, MsrEntries, VcpuKvmState, Xsave};
pub use x86_64::{CpuId, ExtendedControlRegisters, MsrEntries, VcpuKvmState};
// aarch64 dependencies
#[cfg(target_arch = "aarch64")]
pub mod aarch64;
@ -1210,71 +1210,64 @@ impl cpu::Vcpu for KvmVcpu {
// These actually are the general-purpose registers of the Armv8-a
// architecture (i.e x0-x30 if used as a 64bit register or w0-30 when used as a 32bit register).
for i in 0..31 {
state.regs.regs[i] = self
.fd
.get_one_reg(arm64_core_reg_id!(KVM_REG_SIZE_U64, off))
.map_err(|e| cpu::HypervisorCpuError::GetCoreRegister(e.into()))?
.try_into()
.unwrap();
let mut bytes = [0_u8; 8];
self.fd
.get_one_reg(arm64_core_reg_id!(KVM_REG_SIZE_U64, off), &mut bytes)
.map_err(|e| cpu::HypervisorCpuError::GetCoreRegister(e.into()))?;
state.regs.regs[i] = u64::from_le_bytes(bytes);
off += std::mem::size_of::<u64>();
}
// We are now entering the "Other register" section of the ARMv8-a architecture.
// First one, stack pointer.
let off = offset_of!(user_pt_regs, sp);
state.regs.sp = self
.fd
.get_one_reg(arm64_core_reg_id!(KVM_REG_SIZE_U64, off))
.map_err(|e| cpu::HypervisorCpuError::GetCoreRegister(e.into()))?
.try_into()
.unwrap();
let mut bytes = [0_u8; 8];
self.fd
.get_one_reg(arm64_core_reg_id!(KVM_REG_SIZE_U64, off), &mut bytes)
.map_err(|e| cpu::HypervisorCpuError::GetCoreRegister(e.into()))?;
state.regs.sp = u64::from_le_bytes(bytes);
// Second one, the program counter.
let off = offset_of!(user_pt_regs, pc);
state.regs.pc = self
.fd
.get_one_reg(arm64_core_reg_id!(KVM_REG_SIZE_U64, off))
.map_err(|e| cpu::HypervisorCpuError::GetCoreRegister(e.into()))?
.try_into()
.unwrap();
let mut bytes = [0_u8; 8];
self.fd
.get_one_reg(arm64_core_reg_id!(KVM_REG_SIZE_U64, off), &mut bytes)
.map_err(|e| cpu::HypervisorCpuError::GetCoreRegister(e.into()))?;
state.regs.pc = u64::from_le_bytes(bytes);
// Next is the processor state.
let off = offset_of!(user_pt_regs, pstate);
state.regs.pstate = self
.fd
.get_one_reg(arm64_core_reg_id!(KVM_REG_SIZE_U64, off))
.map_err(|e| cpu::HypervisorCpuError::GetCoreRegister(e.into()))?
.try_into()
.unwrap();
let mut bytes = [0_u8; 8];
self.fd
.get_one_reg(arm64_core_reg_id!(KVM_REG_SIZE_U64, off), &mut bytes)
.map_err(|e| cpu::HypervisorCpuError::GetCoreRegister(e.into()))?;
state.regs.pstate = u64::from_le_bytes(bytes);
// The stack pointer associated with EL1
let off = offset_of!(kvm_regs, sp_el1);
state.sp_el1 = self
.fd
.get_one_reg(arm64_core_reg_id!(KVM_REG_SIZE_U64, off))
.map_err(|e| cpu::HypervisorCpuError::GetCoreRegister(e.into()))?
.try_into()
.unwrap();
let mut bytes = [0_u8; 8];
self.fd
.get_one_reg(arm64_core_reg_id!(KVM_REG_SIZE_U64, off), &mut bytes)
.map_err(|e| cpu::HypervisorCpuError::GetCoreRegister(e.into()))?;
state.sp_el1 = u64::from_le_bytes(bytes);
// Exception Link Register for EL1, when taking an exception to EL1, this register
// holds the address to which to return afterwards.
let off = offset_of!(kvm_regs, elr_el1);
state.elr_el1 = self
.fd
.get_one_reg(arm64_core_reg_id!(KVM_REG_SIZE_U64, off))
.map_err(|e| cpu::HypervisorCpuError::GetCoreRegister(e.into()))?
.try_into()
.unwrap();
let mut bytes = [0_u8; 8];
self.fd
.get_one_reg(arm64_core_reg_id!(KVM_REG_SIZE_U64, off), &mut bytes)
.map_err(|e| cpu::HypervisorCpuError::GetCoreRegister(e.into()))?;
state.elr_el1 = u64::from_le_bytes(bytes);
// Saved Program Status Registers, there are 5 of them used in the kernel.
let mut off = offset_of!(kvm_regs, spsr);
for i in 0..KVM_NR_SPSR as usize {
state.spsr[i] = self
.fd
.get_one_reg(arm64_core_reg_id!(KVM_REG_SIZE_U64, off))
.map_err(|e| cpu::HypervisorCpuError::GetCoreRegister(e.into()))?
.try_into()
.unwrap();
let mut bytes = [0_u8; 8];
self.fd
.get_one_reg(arm64_core_reg_id!(KVM_REG_SIZE_U64, off), &mut bytes)
.map_err(|e| cpu::HypervisorCpuError::GetCoreRegister(e.into()))?;
state.spsr[i] = u64::from_le_bytes(bytes);
off += std::mem::size_of::<u64>();
}
@ -1282,30 +1275,29 @@ impl cpu::Vcpu for KvmVcpu {
// https://elixir.free-electrons.com/linux/v4.9.62/source/arch/arm64/include/uapi/asm/kvm.h#L53
let mut off = offset_of!(kvm_regs, fp_regs) + offset_of!(user_fpsimd_state, vregs);
for i in 0..32 {
state.fp_regs.vregs[i] = self
.fd
.get_one_reg(arm64_core_reg_id!(KVM_REG_SIZE_U128, off))
let mut bytes = [0_u8; 16];
self.fd
.get_one_reg(arm64_core_reg_id!(KVM_REG_SIZE_U128, off), &mut bytes)
.map_err(|e| cpu::HypervisorCpuError::GetCoreRegister(e.into()))?;
state.fp_regs.vregs[i] = u128::from_le_bytes(bytes);
off += mem::size_of::<u128>();
}
// Floating-point Status Register
let off = offset_of!(kvm_regs, fp_regs) + offset_of!(user_fpsimd_state, fpsr);
state.fp_regs.fpsr = self
.fd
.get_one_reg(arm64_core_reg_id!(KVM_REG_SIZE_U32, off))
.map_err(|e| cpu::HypervisorCpuError::GetCoreRegister(e.into()))?
.try_into()
.unwrap();
let mut bytes = [0_u8; 4];
self.fd
.get_one_reg(arm64_core_reg_id!(KVM_REG_SIZE_U32, off), &mut bytes)
.map_err(|e| cpu::HypervisorCpuError::GetCoreRegister(e.into()))?;
state.fp_regs.fpsr = u32::from_le_bytes(bytes);
// Floating-point Control Register
let off = offset_of!(kvm_regs, fp_regs) + offset_of!(user_fpsimd_state, fpcr);
state.fp_regs.fpcr = self
.fd
.get_one_reg(arm64_core_reg_id!(KVM_REG_SIZE_U32, off))
.map_err(|e| cpu::HypervisorCpuError::GetCoreRegister(e.into()))?
.try_into()
.unwrap();
let mut bytes = [0_u8; 4];
self.fd
.get_one_reg(arm64_core_reg_id!(KVM_REG_SIZE_U32, off), &mut bytes)
.map_err(|e| cpu::HypervisorCpuError::GetCoreRegister(e.into()))?;
state.fp_regs.fpcr = u32::from_le_bytes(bytes);
Ok(state)
}
@ -1334,7 +1326,7 @@ impl cpu::Vcpu for KvmVcpu {
self.fd
.set_one_reg(
arm64_core_reg_id!(KVM_REG_SIZE_U64, off),
state.regs.regs[i].into(),
&state.regs.regs[i].to_le_bytes(),
)
.map_err(|e| cpu::HypervisorCpuError::SetCoreRegister(e.into()))?;
off += std::mem::size_of::<u64>();
@ -1344,7 +1336,7 @@ impl cpu::Vcpu for KvmVcpu {
self.fd
.set_one_reg(
arm64_core_reg_id!(KVM_REG_SIZE_U64, off),
state.regs.sp.into(),
&state.regs.sp.to_le_bytes(),
)
.map_err(|e| cpu::HypervisorCpuError::SetCoreRegister(e.into()))?;
@ -1352,7 +1344,7 @@ impl cpu::Vcpu for KvmVcpu {
self.fd
.set_one_reg(
arm64_core_reg_id!(KVM_REG_SIZE_U64, off),
state.regs.pc.into(),
&state.regs.pc.to_le_bytes(),
)
.map_err(|e| cpu::HypervisorCpuError::SetCoreRegister(e.into()))?;
@ -1360,7 +1352,7 @@ impl cpu::Vcpu for KvmVcpu {
self.fd
.set_one_reg(
arm64_core_reg_id!(KVM_REG_SIZE_U64, off),
state.regs.pstate.into(),
&state.regs.pstate.to_le_bytes(),
)
.map_err(|e| cpu::HypervisorCpuError::SetCoreRegister(e.into()))?;
@ -1368,7 +1360,7 @@ impl cpu::Vcpu for KvmVcpu {
self.fd
.set_one_reg(
arm64_core_reg_id!(KVM_REG_SIZE_U64, off),
state.sp_el1.into(),
&state.sp_el1.to_le_bytes(),
)
.map_err(|e| cpu::HypervisorCpuError::SetCoreRegister(e.into()))?;
@ -1376,7 +1368,7 @@ impl cpu::Vcpu for KvmVcpu {
self.fd
.set_one_reg(
arm64_core_reg_id!(KVM_REG_SIZE_U64, off),
state.elr_el1.into(),
&state.elr_el1.to_le_bytes(),
)
.map_err(|e| cpu::HypervisorCpuError::SetCoreRegister(e.into()))?;
@ -1385,7 +1377,7 @@ impl cpu::Vcpu for KvmVcpu {
self.fd
.set_one_reg(
arm64_core_reg_id!(KVM_REG_SIZE_U64, off),
state.spsr[i].into(),
&state.spsr[i].to_le_bytes(),
)
.map_err(|e| cpu::HypervisorCpuError::SetCoreRegister(e.into()))?;
off += std::mem::size_of::<u64>();
@ -1396,7 +1388,7 @@ impl cpu::Vcpu for KvmVcpu {
self.fd
.set_one_reg(
arm64_core_reg_id!(KVM_REG_SIZE_U128, off),
state.fp_regs.vregs[i],
&state.fp_regs.vregs[i].to_le_bytes(),
)
.map_err(|e| cpu::HypervisorCpuError::SetCoreRegister(e.into()))?;
off += mem::size_of::<u128>();
@ -1406,7 +1398,7 @@ impl cpu::Vcpu for KvmVcpu {
self.fd
.set_one_reg(
arm64_core_reg_id!(KVM_REG_SIZE_U32, off),
state.fp_regs.fpsr.into(),
&state.fp_regs.fpsr.to_le_bytes(),
)
.map_err(|e| cpu::HypervisorCpuError::SetCoreRegister(e.into()))?;
@ -1414,7 +1406,7 @@ impl cpu::Vcpu for KvmVcpu {
self.fd
.set_one_reg(
arm64_core_reg_id!(KVM_REG_SIZE_U32, off),
state.fp_regs.fpcr.into(),
&state.fp_regs.fpcr.to_le_bytes(),
)
.map_err(|e| cpu::HypervisorCpuError::SetCoreRegister(e.into()))?;
Ok(())
@ -1655,7 +1647,7 @@ impl cpu::Vcpu for KvmVcpu {
Ok(cpu::VmExit::Shutdown)
} else {
Err(cpu::HypervisorCpuError::RunVcpu(anyhow!(
"Unexpected system event with type 0x{:x}, flags 0x{:x}",
"Unexpected system event with type 0x{:x}, flags 0x{:x?}",
event_type,
flags
)))
@ -1819,12 +1811,11 @@ impl cpu::Vcpu for KvmVcpu {
| KVM_REG_ARM64_SYSREG_CRN_MASK
| KVM_REG_ARM64_SYSREG_CRM_MASK
| KVM_REG_ARM64_SYSREG_OP2_MASK)) as u64);
Ok(self
.fd
.get_one_reg(id)
.map_err(|e| cpu::HypervisorCpuError::GetSysRegister(e.into()))?
.try_into()
.unwrap())
let mut bytes = [0_u8; 8];
self.fd
.get_one_reg(id, &mut bytes)
.map_err(|e| cpu::HypervisorCpuError::GetSysRegister(e.into()))?;
Ok(u64::from_le_bytes(bytes))
}
///
@ -1851,7 +1842,7 @@ impl cpu::Vcpu for KvmVcpu {
self.fd
.set_one_reg(
arm64_core_reg_id!(KVM_REG_SIZE_U64, pstate),
PSTATE_FAULT_BITS_64.into(),
&PSTATE_FAULT_BITS_64.to_le_bytes(),
)
.map_err(|e| cpu::HypervisorCpuError::SetCoreRegister(e.into()))?;
@ -1860,7 +1851,10 @@ impl cpu::Vcpu for KvmVcpu {
// Setting the PC (Processor Counter) to the current program address (kernel address).
let pc = offset_of!(user_pt_regs, pc) + kreg_off;
self.fd
.set_one_reg(arm64_core_reg_id!(KVM_REG_SIZE_U64, pc), boot_ip.into())
.set_one_reg(
arm64_core_reg_id!(KVM_REG_SIZE_U64, pc),
&boot_ip.to_le_bytes(),
)
.map_err(|e| cpu::HypervisorCpuError::SetCoreRegister(e.into()))?;
// Last mandatory thing to set -> the address pointing to the FDT (also called DTB).
@ -1871,7 +1865,7 @@ impl cpu::Vcpu for KvmVcpu {
self.fd
.set_one_reg(
arm64_core_reg_id!(KVM_REG_SIZE_U64, regs0),
fdt_start.into(),
&fdt_start.to_le_bytes(),
)
.map_err(|e| cpu::HypervisorCpuError::SetCoreRegister(e.into()))?;
}
@ -2036,14 +2030,13 @@ impl cpu::Vcpu for KvmVcpu {
// register list, we are simply calling KVM_GET_ONE_REG.
let indices = reg_list.as_slice();
for index in indices.iter() {
let mut bytes = [0_u8; 8];
self.fd
.get_one_reg(*index, &mut bytes)
.map_err(|e| cpu::HypervisorCpuError::GetSysRegister(e.into()))?;
sys_regs.push(kvm_bindings::kvm_one_reg {
id: *index,
addr: self
.fd
.get_one_reg(*index)
.map_err(|e| cpu::HypervisorCpuError::GetSysRegister(e.into()))?
.try_into()
.unwrap(),
addr: u64::from_le_bytes(bytes),
});
}
@ -2153,7 +2146,7 @@ impl cpu::Vcpu for KvmVcpu {
// Set system registers
for reg in &state.sys_regs {
self.fd
.set_one_reg(reg.id, reg.addr.into())
.set_one_reg(reg.id, &reg.addr.to_le_bytes())
.map_err(|e| cpu::HypervisorCpuError::SetSysRegister(e.into()))?;
}
@ -2326,19 +2319,22 @@ impl KvmVcpu {
///
/// X86 specific call that returns the vcpu's current "xsave struct".
///
fn get_xsave(&self) -> cpu::Result<Xsave> {
self.fd
fn get_xsave(&self) -> cpu::Result<XsaveState> {
Ok(self
.fd
.get_xsave()
.map_err(|e| cpu::HypervisorCpuError::GetXsaveState(e.into()))
.map_err(|e| cpu::HypervisorCpuError::GetXsaveState(e.into()))?
.into())
}
#[cfg(target_arch = "x86_64")]
///
/// X86 specific call that sets the vcpu's current "xsave struct".
///
fn set_xsave(&self, xsave: &Xsave) -> cpu::Result<()> {
fn set_xsave(&self, xsave: &XsaveState) -> cpu::Result<()> {
let xsave: kvm_bindings::kvm_xsave = (*xsave).clone().into();
self.fd
.set_xsave(xsave)
.set_xsave(&xsave)
.map_err(|e| cpu::HypervisorCpuError::SetXsaveState(e.into()))
}

View File

@ -10,7 +10,7 @@
use crate::arch::x86::{
CpuIdEntry, DescriptorTable, FpuState, LapicState, MsrEntry, SegmentRegister, SpecialRegisters,
StandardRegisters, CPUID_FLAG_VALID_INDEX,
StandardRegisters, XsaveState, CPUID_FLAG_VALID_INDEX,
};
use crate::kvm::{Cap, Kvm, KvmError, KvmResult};
use serde::{Deserialize, Serialize};
@ -23,7 +23,7 @@ pub use {
kvm_bindings::kvm_lapic_state, kvm_bindings::kvm_mp_state as MpState,
kvm_bindings::kvm_msr_entry, kvm_bindings::kvm_regs, kvm_bindings::kvm_segment,
kvm_bindings::kvm_sregs, kvm_bindings::kvm_vcpu_events as VcpuEvents,
kvm_bindings::kvm_xcrs as ExtendedControlRegisters, kvm_bindings::kvm_xsave as Xsave,
kvm_bindings::kvm_xcrs as ExtendedControlRegisters, kvm_bindings::kvm_xsave,
kvm_bindings::CpuId, kvm_bindings::MsrList, kvm_bindings::Msrs as MsrEntries,
kvm_bindings::KVM_CPUID_FLAG_SIGNIFCANT_INDEX,
};
@ -64,7 +64,7 @@ pub struct VcpuKvmState {
pub sregs: kvm_sregs,
pub fpu: FpuState,
pub lapic_state: LapicState,
pub xsave: Xsave,
pub xsave: XsaveState,
pub xcrs: ExtendedControlRegisters,
pub mp_state: MpState,
pub tsc_khz: Option<u32>,
@ -330,3 +330,18 @@ impl From<MsrEntry> for kvm_msr_entry {
}
}
}
impl From<kvm_xsave> for XsaveState {
fn from(s: kvm_xsave) -> Self {
Self { region: s.region }
}
}
impl From<XsaveState> for kvm_xsave {
fn from(s: XsaveState) -> Self {
Self {
region: s.region,
extra: Default::default(),
}
}
}

View File

@ -5,4 +5,4 @@ authors = ["The Chromium OS Authors"]
edition = "2021"
[dependencies]
vmm-sys-util = "0.11.0"
vmm-sys-util = "0.12.1"

View File

@ -13,13 +13,13 @@ net_gen = { path = "../net_gen" }
rate_limiter = { path = "../rate_limiter" }
serde = "1.0.168"
thiserror = "1.0.52"
versionize = "0.1.10"
versionize_derive = "0.1.4"
versionize = "0.2.0"
versionize_derive = "0.1.6"
virtio-bindings = "0.2.0"
virtio-queue = "0.10.0"
vm-memory = { version = "0.13.1", features = ["backend-mmap", "backend-atomic", "backend-bitmap"] }
virtio-queue = "0.11.0"
vm-memory = { version = "0.14.0", features = ["backend-mmap", "backend-atomic", "backend-bitmap"] }
vm-virtio = { path = "../vm-virtio" }
vmm-sys-util = "0.11.0"
vmm-sys-util = "0.12.1"
[dev-dependencies]
once_cell = "1.19.0"

View File

@ -17,14 +17,14 @@ vfio-bindings = { git = "https://github.com/rust-vmm/vfio", branch = "main", fea
vfio-ioctls = { git = "https://github.com/rust-vmm/vfio", branch = "main", default-features = false }
vfio_user = { git = "https://github.com/rust-vmm/vfio-user", branch = "main" }
vmm-sys-util = "0.11.0"
vmm-sys-util = "0.12.1"
libc = "0.2.147"
log = "0.4.20"
serde = { version = "1.0.168", features = ["derive"] }
thiserror = "1.0.52"
versionize = "0.1.10"
versionize_derive = "0.1.4"
versionize = "0.2.0"
versionize_derive = "0.1.6"
vm-allocator = { path = "../vm-allocator" }
vm-device = { path = "../vm-device" }
vm-memory = { version = "0.13.1", features = ["backend-mmap", "backend-atomic", "backend-bitmap"] }
vm-memory = { version = "0.14.0", features = ["backend-mmap", "backend-atomic", "backend-bitmap"] }
vm-migration = { path = "../vm-migration" }

View File

@ -8,4 +8,4 @@ epoll = "4.3.3"
libc = "0.2.147"
log = "0.4.20"
thiserror = "1.0.40"
vmm-sys-util = "0.11.0"
vmm-sys-util = "0.12.1"

View File

@ -12,5 +12,5 @@ once_cell = "1.19.0"
serde = { version = "1.0.168", features = ["rc", "derive"] }
serde_json = "1.0.109"
ssh2 = { version = "0.9.4", features = ["vendored-openssl"] }
vmm-sys-util = "0.11.0"
vmm-sys-util = "0.12.1"
wait-timeout = "0.2.0"

View File

@ -9597,43 +9597,51 @@ mod live_migration {
}
#[test]
#[ignore = "See #6134"]
fn test_live_upgrade_basic() {
_test_live_migration(true, false)
}
#[test]
#[ignore = "See #6134"]
fn test_live_upgrade_local() {
_test_live_migration(true, true)
}
#[test]
#[ignore = "See #6134"]
#[cfg(not(feature = "mshv"))]
fn test_live_upgrade_numa() {
_test_live_migration_numa(true, false)
}
#[test]
#[ignore = "See #6134"]
#[cfg(not(feature = "mshv"))]
fn test_live_upgrade_numa_local() {
_test_live_migration_numa(true, true)
}
#[test]
#[ignore = "See #6134"]
fn test_live_upgrade_watchdog() {
_test_live_migration_watchdog(true, false)
}
#[test]
#[ignore = "See #6134"]
fn test_live_upgrade_watchdog_local() {
_test_live_migration_watchdog(true, true)
}
#[test]
#[ignore = "See #6134"]
fn test_live_upgrade_balloon() {
_test_live_migration_balloon(true, false)
}
#[test]
#[ignore = "See #6134"]
fn test_live_upgrade_balloon_local() {
_test_live_migration_balloon(true, true)
}
@ -9669,6 +9677,7 @@ mod live_migration {
}
#[test]
#[ignore = "See #5532"]
#[cfg(target_arch = "x86_64")]
#[cfg(not(feature = "mshv"))]
fn test_live_upgrade_ovs_dpdk_local() {

View File

@ -12,4 +12,4 @@ libc = "0.2.138"
log = "0.4.17"
net_gen = { path = "../net_gen" }
thiserror = "1.0.37"
vmm-sys-util = "0.11.0"
vmm-sys-util = "0.12.1"

View File

@ -13,9 +13,9 @@ epoll = "4.3.3"
libc = "0.2.147"
log = "0.4.20"
option_parser = { path = "../option_parser" }
vhost = { version = "0.9.0", features = ["vhost-user-backend"] }
vhost-user-backend = "0.11.0"
vhost = { version = "0.10.0", features = ["vhost-user-backend"] }
vhost-user-backend = "0.13.1"
virtio-bindings = "0.2.0"
virtio-queue = "0.10.0"
vm-memory = "0.13.1"
vmm-sys-util = "0.11.0"
virtio-queue = "0.11.0"
vm-memory = "0.14.0"
vmm-sys-util = "0.12.1"

View File

@ -13,9 +13,8 @@ libc = "0.2.147"
log = "0.4.20"
net_util = { path = "../net_util" }
option_parser = { path = "../option_parser" }
vhost = { version = "0.9.0", features = ["vhost-user-backend"] }
vhost-user-backend = "0.11.0"
vhost = { version = "0.10.0", features = ["vhost-user-backend"] }
vhost-user-backend = "0.13.1"
virtio-bindings = "0.2.0"
vm-memory = "0.13.1"
vmm-sys-util = "0.11.0"
vm-memory = "0.14.0"
vmm-sys-util = "0.12.1"

View File

@ -25,14 +25,14 @@ serde = { version = "1.0.168", features = ["derive"] }
serde_json = "1.0.109"
serial_buffer = { path = "../serial_buffer" }
thiserror = "1.0.52"
versionize = "0.1.10"
versionize_derive = "0.1.4"
vhost = { version = "0.9.0", features = ["vhost-user-frontend", "vhost-user-backend", "vhost-kern", "vhost-vdpa"] }
versionize = "0.2.0"
versionize_derive = "0.1.6"
vhost = { version = "0.10.0", features = ["vhost-user-frontend", "vhost-user-backend", "vhost-kern", "vhost-vdpa"] }
virtio-bindings = { version = "0.2.0", features = ["virtio-v5_0_0"] }
virtio-queue = "0.10.0"
virtio-queue = "0.11.0"
vm-allocator = { path = "../vm-allocator" }
vm-device = { path = "../vm-device" }
vm-memory = { version = "0.13.1", features = ["backend-mmap", "backend-atomic", "backend-bitmap"] }
vm-memory = { version = "0.14.0", features = ["backend-mmap", "backend-atomic", "backend-bitmap"] }
vm-migration = { path = "../vm-migration" }
vm-virtio = { path = "../vm-virtio" }
vmm-sys-util = "0.11.0"
vmm-sys-util = "0.12.1"

View File

@ -6,7 +6,7 @@ edition = "2021"
[dependencies]
libc = "0.2.147"
vm-memory = "0.13.1"
vm-memory = "0.14.0"
[target.'cfg(target_arch = "aarch64")'.dependencies]
arch = { path = "../arch" }

View File

@ -15,5 +15,5 @@ hypervisor = { path = "../hypervisor" }
thiserror = "1.0.52"
serde = { version = "1.0.168", features = ["rc", "derive"] }
vfio-ioctls = { git = "https://github.com/rust-vmm/vfio", branch = "main", default-features = false }
vm-memory = { version = "0.13.1", features = ["backend-mmap"] }
vmm-sys-util = "0.11.0"
vm-memory = { version = "0.14.0", features = ["backend-mmap"] }
vmm-sys-util = "0.12.1"

View File

@ -9,6 +9,6 @@ anyhow = "1.0.79"
thiserror = "1.0.52"
serde = { version = "1.0.168", features = ["rc", "derive"] }
serde_json = "1.0.109"
versionize = "0.1.10"
versionize_derive = "0.1.4"
vm-memory = { version = "0.13.1", features = ["backend-mmap", "backend-atomic"] }
versionize = "0.2.0"
versionize_derive = "0.1.6"
vm-memory = { version = "0.14.0", features = ["backend-mmap", "backend-atomic"] }

View File

@ -9,5 +9,5 @@ default = []
[dependencies]
log = "0.4.20"
virtio-queue = "0.10.0"
vm-memory = { version = "0.13.1", features = ["backend-mmap", "backend-atomic", "backend-bitmap"] }
virtio-queue = "0.11.0"
vm-memory = { version = "0.14.0", features = ["backend-mmap", "backend-atomic", "backend-bitmap"] }

View File

@ -38,7 +38,7 @@ hypervisor = { path = "../hypervisor" }
igvm_defs = { git = "https://github.com/microsoft/igvm", branch = "main", package = "igvm_defs", optional = true }
igvm_parser = { git = "https://github.com/microsoft/igvm", branch = "main", package = "igvm", optional = true }
libc = "0.2.147"
linux-loader = { version = "0.10.0", features = ["elf", "bzimage", "pe"] }
linux-loader = { version = "0.11.0", features = ["elf", "bzimage", "pe"] }
log = "0.4.20"
micro_http = { git = "https://github.com/firecracker-microvm/micro-http", branch = "main" }
mshv-bindings = { git = "https://github.com/rust-vmm/mshv", branch = "main", features = ["with-serde", "fam-wrappers"], optional = true }
@ -56,17 +56,17 @@ signal-hook = "0.3.17"
thiserror = "1.0.52"
tracer = { path = "../tracer" }
uuid = "1.3.4"
versionize = "0.1.10"
versionize_derive = "0.1.4"
versionize = "0.2.0"
versionize_derive = "0.1.6"
vfio-ioctls = { git = "https://github.com/rust-vmm/vfio", branch = "main", default-features = false }
vfio_user = { git = "https://github.com/rust-vmm/vfio-user", branch = "main" }
virtio-devices = { path = "../virtio-devices" }
virtio-queue = "0.10.0"
virtio-queue = "0.11.0"
vm-allocator = { path = "../vm-allocator" }
vm-device = { path = "../vm-device" }
vm-memory = { version = "0.13.1", features = ["backend-mmap", "backend-atomic", "backend-bitmap"] }
vm-memory = { version = "0.14.0", features = ["backend-mmap", "backend-atomic", "backend-bitmap"] }
vm-migration = { path = "../vm-migration" }
vm-virtio = { path = "../vm-virtio" }
vmm-sys-util = { version = "0.11.0", features = ["with-serde"] }
vmm-sys-util = { version = "0.12.1", features = ["with-serde"] }
zbus = { version = "3.11.1", optional = true }
zerocopy = { version = "0.7.31", features = ["alloc","derive"] }