diff --git a/Cargo.lock b/Cargo.lock index 5ef6c4761..72eed3c89 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -88,21 +88,21 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.102" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" +checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3" [[package]] name = "arrayvec" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +checksum = "f02882884d3e1bc524fb12c79f107f6ad0e1cfd498c536ffb494301740995dfe" [[package]] name = "autocfg" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" [[package]] name = "aws-lc-rs" @@ -139,7 +139,7 @@ version = "0.69.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "cexpr", "clang-sys", "itertools 0.12.1", @@ -149,7 +149,7 @@ dependencies = [ "quote", "regex", "rustc-hash", - "shlex", + "shlex 1.3.0", "syn", ] @@ -185,15 +185,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.11.1" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" +checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" [[package]] name = "bitvec" -version = "1.0.1" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +checksum = "ddcec3d12c579d40898fe0a9a358a803c23e9c52ca3c425707f81c9436211837" dependencies = [ "funty", "radium", @@ -204,9 +204,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.20.2" +version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" [[package]] name = "bytemuck" @@ -222,10 +222,11 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cargo_toml" -version = "0.22.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374b7c592d9c00c1f4972ea58390ac6b18cbb6ab79011f3bdc90a0b82ca06b77" +checksum = "aa61aec073ec94791433ddf3df2323ff9d1711557c2a0eefb0f99cb4f8dca520" dependencies = [ + "semver", "serde", "toml", ] @@ -238,14 +239,14 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.2.62" +version = "1.2.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1dce859f0832a7d088c4f1119888ab94ef4b5d6795d1ce05afb7fe159d79f98" +checksum = "e228eec9be7c17ccb640b59b36a5cd805ea2a564a4c5e162c2f659fea30d3b96" dependencies = [ "find-msvc-tools", "jobserver", "libc", - "shlex", + "shlex 2.0.1", ] [[package]] @@ -265,9 +266,9 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "chacha20" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" +checksum = "d524456ba66e72eb8b115ff89e01e497f8e6d11d78b70b1aa13c0fbd97540a81" dependencies = [ "cfg-if", "cpufeatures", @@ -366,7 +367,7 @@ name = "clippy-tracing" version = "0.1.0" dependencies = [ "clap", - "itertools 0.14.0", + "itertools 0.15.0", "proc-macro2", "quote", "syn", @@ -467,6 +468,38 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" +[[package]] +name = "defmt" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6e524506490a1953d237cb87b1cfc1e46f88c18f10a22dfe0f507dc6bfc7f7f" +dependencies = [ + "bitflags 1.3.2", + "defmt-macros", +] + +[[package]] +name = "defmt-macros" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0a27770e9c8f719a79d8b638281f4d828f77d8fd61e0bd94451b9b85e576a0b" +dependencies = [ + "defmt-parser", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "defmt-parser" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" +dependencies = [ + "thiserror 2.0.18", +] + [[package]] name = "derive_more" version = "2.1.1" @@ -498,9 +531,9 @@ checksum = "f18f717c5c7c2e3483feb64cccebd077245ad6d19007c2db0fd341d38595353c" [[package]] name = "displaydoc" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" dependencies = [ "proc-macro2", "quote", @@ -515,15 +548,15 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "either" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" [[package]] name = "env_filter" -version = "1.0.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e90c2accc4b07a8456ea0debdc2e7587bdd890680d71173a15d4ae604f6eef" +checksum = "900d271a03799a1ee8d1ca9b19893b48ca674a9284fefcfb85f05e74ed314217" dependencies = [ "log", "regex", @@ -531,9 +564,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.10" +version = "0.11.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0621c04f2196ac3f488dd583365b9c09be011a4ab8b9f37248ffcc8f6198b56a" +checksum = "de671bd27a75a797dc9ae289ba1e77276e75e2026408aab65185384e2d5cd3f6" dependencies = [ "anstream", "anstyle", @@ -644,7 +677,7 @@ version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5bafc7e33650ab9f05dcc16325f05d56b8d10393114e31a19a353b86fa60cfe7" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "cfg-if", "log", "managed", @@ -690,9 +723,9 @@ dependencies = [ [[package]] name = "glam" -version = "0.32.1" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f70749695b063ecbf6b62949ccccde2e733ec3ecbbd71d467dca4e5c6c97cca0" +checksum = "7f22fb22f065b308be0d8724e3706c7fa3fc2a6c7d6899df4cad7860e7a75436" [[package]] name = "glob" @@ -776,9 +809,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +checksum = "8b4baf93f58d4425749ca49a51c50ebab072c5df6994d08fed93541c331481dc" dependencies = [ "either", ] @@ -803,10 +836,11 @@ dependencies = [ [[package]] name = "jiff" -version = "0.2.24" +version = "0.2.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00b5dbd620d61dfdcb6007c9c1f6054ebd75319f163d886a9055cec1155073d" +checksum = "7d75ad598edda7c00a28de3073b8fce023305057001c46aac1fb4fa5e5fb01d7" dependencies = [ + "defmt", "jiff-static", "log", "portable-atomic", @@ -816,9 +850,9 @@ dependencies = [ [[package]] name = "jiff-static" -version = "0.2.24" +version = "0.2.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e000de030ff8022ea1da3f466fbb0f3a809f5e51ed31f6dd931c35181ad8e6d7" +checksum = "2db1a96e4a8748d93838d0b7a67377781e53ad0a168005a66aab6ae17edbadf3" dependencies = [ "proc-macro2", "quote", @@ -837,13 +871,12 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.98" +version = "0.3.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67df7112613f8bfd9150013a0314e196f4800d3201ae742489d999db2f979f08" +checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102" dependencies = [ "cfg-if", "futures-util", - "once_cell", "wasm-bindgen", ] @@ -864,7 +897,7 @@ version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "333f77a20344a448f3f70664918135fddeb804e938f28a99d685bd92926e0b19" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "kvm-bindings", "libc", "vmm-sys-util", @@ -921,9 +954,9 @@ checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" [[package]] name = "log" -version = "0.4.29" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" +checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" dependencies = [ "serde_core", ] @@ -954,9 +987,9 @@ checksum = "0ca88d725a0a943b096803bd34e73a4437208b6077654cc4ecb2947a5f91618d" [[package]] name = "memchr" -version = "2.8.0" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" +checksum = "88904434abc2901f197fe8cc55f0445e7ded921dba5911dad2e2b39b48e663c4" [[package]] name = "memfd" @@ -988,7 +1021,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "cfg-if", "libc", ] @@ -1042,9 +1075,9 @@ dependencies = [ [[package]] name = "pastey" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5a797f0e07bdf071d15742978fc3128ec6c22891c31a3a931513263904c982a" +checksum = "2ee67f1008b1ba2321834326597b8e186293b049a023cdef258527550b9935b4" [[package]] name = "pin-project-lite" @@ -1086,6 +1119,28 @@ dependencies = [ "syn", ] +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "proc-macro2" version = "1.0.106" @@ -1101,7 +1156,7 @@ version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "num-traits", "rand 0.9.4", "rand_chacha", @@ -1112,9 +1167,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.45" +version = "1.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368" dependencies = [ "proc-macro2", ] @@ -1200,9 +1255,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.12.3" +version = "1.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +checksum = "f1292b7759ae1cb9ec195452d1390a074f0cd8541ab7a5a8c31cd6db45d4a6ba" dependencies = [ "aho-corasick", "memchr", @@ -1223,9 +1278,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" [[package]] name = "rustc-hash" @@ -1248,7 +1303,7 @@ version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "errno", "libc", "linux-raw-sys", @@ -1326,9 +1381,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.149" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" dependencies = [ "itoa", "memchr", @@ -1352,6 +1407,12 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + [[package]] name = "slab" version = "0.4.12" @@ -1382,9 +1443,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.117" +version = "2.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422" dependencies = [ "proc-macro2", "quote", @@ -1449,9 +1510,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.9.12+spec-1.1.0" +version = "1.1.2+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" +checksum = "81f3d15e84cbcd896376e6730314d59fb5a87f31e4b038454184435cd57defee" dependencies = [ "indexmap", "serde_core", @@ -1459,14 +1520,14 @@ dependencies = [ "toml_datetime", "toml_parser", "toml_writer", - "winnow 0.7.15", + "winnow", ] [[package]] name = "toml_datetime" -version = "0.7.5+spec-1.1.0" +version = "1.1.1+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" dependencies = [ "serde_core", ] @@ -1477,7 +1538,7 @@ version = "1.1.2+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" dependencies = [ - "winnow 1.0.1", + "winnow", ] [[package]] @@ -1500,9 +1561,9 @@ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "unicode-segmentation" -version = "1.13.2" +version = "1.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" [[package]] name = "unicode-xid" @@ -1522,7 +1583,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b3a8a0cb358f7d1b7ee9b6784be122b6f51248a6d9e214d555beb9b44c72aea" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "cfg-if", "libc", "nix", @@ -1559,9 +1620,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.23.1" +version = "1.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd74a9687298c6858e9b88ec8935ec45d22e8fd5e6394fa1bd4e99a87789c76" +checksum = "bf80a72845275afea99e7f2b434723d3bc7e38470fcd1c7ed39a599c73319a53" dependencies = [ "getrandom 0.4.1", "js-sys", @@ -1575,7 +1636,7 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c76d90ce3c6b37d610a5304c9a445cfff580cf8b4b9fd02fb256aaf68552c28a" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "libc", "uuid", "vm-memory", @@ -1625,7 +1686,7 @@ dependencies = [ "aws-lc-rs", "base64", "bitcode", - "bitflags 2.11.1", + "bitflags 2.13.0", "bitvec", "byteorder", "crc64", @@ -1636,7 +1697,7 @@ dependencies = [ "event-manager", "gdbstub", "gdbstub_arch", - "itertools 0.14.0", + "itertools 0.15.0", "kvm-bindings", "kvm-ioctls", "libc", @@ -1687,9 +1748,9 @@ dependencies = [ [[package]] name = "wasip2" -version = "1.0.3+wasi-0.2.9" +version = "1.0.4+wasi-0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" dependencies = [ "wit-bindgen 0.57.1", ] @@ -1705,9 +1766,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.121" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49ace1d07c165b0864824eee619580c4689389afa9dc9ed3a4c75040d82e6790" +checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4" dependencies = [ "cfg-if", "once_cell", @@ -1718,9 +1779,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.121" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e68e6f4afd367a562002c05637acb8578ff2dea1943df76afb9e83d177c8578" +checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1728,9 +1789,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.121" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95a9ec35c64b2a7cb35d3fead40c4238d0940c86d107136999567a4703259f2" +checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e" dependencies = [ "bumpalo", "proc-macro2", @@ -1741,9 +1802,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.121" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4e0100b01e9f0d03189a92b96772a1fb998639d981193d7dbab487302513441" +checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24" dependencies = [ "unicode-ident", ] @@ -1776,7 +1837,7 @@ version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "hashbrown 0.15.5", "indexmap", "semver", @@ -1828,12 +1889,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "winnow" -version = "0.7.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" - [[package]] name = "winnow" version = "1.0.1" @@ -1904,7 +1959,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" dependencies = [ "anyhow", - "bitflags 2.11.1", + "bitflags 2.13.0", "indexmap", "log", "serde", @@ -1945,18 +2000,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.48" +version = "0.8.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +checksum = "ce1022995ff5ff5d841ad7d994facc23098cd40152f2c1d11cd607c6f530653f" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.48" +version = "0.8.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +checksum = "1ae7f38b72ec2a254e2b87ef277cf2cd4fb97cbebf944faa6f33354da0867930" dependencies = [ "proc-macro2", "quote", @@ -1965,9 +2020,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.8.2" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" +checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" [[package]] name = "zmij" diff --git a/src/clippy-tracing/Cargo.toml b/src/clippy-tracing/Cargo.toml index 55065714c..794125c8c 100644 --- a/src/clippy-tracing/Cargo.toml +++ b/src/clippy-tracing/Cargo.toml @@ -11,7 +11,7 @@ bench = false [dependencies] clap = { version = "4.6.1", features = ["derive"] } -itertools = "0.14.0" +itertools = "0.15.0" proc-macro2 = { version = "1.0.106", features = ["span-locations"] } quote = "1.0.45" syn = { version = "2.0.117", features = ["full", "extra-traits", "visit", "visit-mut", "printing"] } diff --git a/src/firecracker/Cargo.toml b/src/firecracker/Cargo.toml index 93d925271..90603f83e 100644 --- a/src/firecracker/Cargo.toml +++ b/src/firecracker/Cargo.toml @@ -40,7 +40,7 @@ serde = { version = "1.0.228" } serde_json = "1.0.149" [dev-dependencies] -cargo_toml = "0.22.3" +cargo_toml = "1.0.0" libc = "0.2.186" regex = { version = "1.12.3", default-features = false, features = [ "std", diff --git a/src/firecracker/src/api_server/mod.rs b/src/firecracker/src/api_server/mod.rs index ecc6a7217..045defc35 100644 --- a/src/firecracker/src/api_server/mod.rs +++ b/src/firecracker/src/api_server/mod.rs @@ -277,6 +277,7 @@ mod tests { snapshot_type: SnapshotType::Diff, snapshot_path: PathBuf::new(), mem_file_path: PathBuf::new(), + vmstate_only: false, })), start_time_us, ); @@ -290,6 +291,7 @@ mod tests { snapshot_type: SnapshotType::Diff, snapshot_path: PathBuf::new(), mem_file_path: PathBuf::new(), + vmstate_only: false, })), start_time_us, ); diff --git a/src/firecracker/src/api_server/request/snapshot.rs b/src/firecracker/src/api_server/request/snapshot.rs index e6640ac33..385d3a14c 100644 --- a/src/firecracker/src/api_server/request/snapshot.rs +++ b/src/firecracker/src/api_server/request/snapshot.rs @@ -112,6 +112,7 @@ fn parse_put_snapshot_load(body: &Body) -> Result { network_overrides: snapshot_config.network_overrides, vsock_override: snapshot_config.vsock_override, clock_realtime: snapshot_config.clock_realtime, + uffd_base_file: snapshot_config.uffd_base_file, }; // Construct the `ParsedRequest` object. @@ -147,6 +148,7 @@ mod tests { snapshot_type: SnapshotType::Diff, snapshot_path: PathBuf::from("foo"), mem_file_path: PathBuf::from("bar"), + vmstate_only: false, }; assert_eq!( vmm_action_from_request(parse_put_snapshot(&Body::new(body), Some("create")).unwrap()), @@ -161,6 +163,23 @@ mod tests { snapshot_type: SnapshotType::Full, snapshot_path: PathBuf::from("foo"), mem_file_path: PathBuf::from("bar"), + vmstate_only: false, + }; + assert_eq!( + vmm_action_from_request(parse_put_snapshot(&Body::new(body), Some("create")).unwrap()), + VmmAction::CreateSnapshot(expected_config) + ); + + let body = r#"{ + "snapshot_path": "foo", + "mem_file_path": "bar", + "vmstate_only": true + }"#; + let expected_config = CreateSnapshotParams { + snapshot_type: SnapshotType::Full, + snapshot_path: PathBuf::from("foo"), + mem_file_path: PathBuf::from("bar"), + vmstate_only: true, }; assert_eq!( vmm_action_from_request(parse_put_snapshot(&Body::new(body), Some("create")).unwrap()), @@ -191,6 +210,7 @@ mod tests { network_overrides: vec![], vsock_override: None, clock_realtime: false, + uffd_base_file: None, }; let mut parsed_request = parse_put_snapshot(&Body::new(body), Some("load")).unwrap(); assert!( @@ -223,6 +243,7 @@ mod tests { network_overrides: vec![], vsock_override: None, clock_realtime: false, + uffd_base_file: None, }; let mut parsed_request = parse_put_snapshot(&Body::new(body), Some("load")).unwrap(); assert!( @@ -255,6 +276,7 @@ mod tests { network_overrides: vec![], vsock_override: None, clock_realtime: false, + uffd_base_file: None, }; let mut parsed_request = parse_put_snapshot(&Body::new(body), Some("load")).unwrap(); assert!( @@ -296,6 +318,7 @@ mod tests { }], vsock_override: None, clock_realtime: false, + uffd_base_file: None, }; let mut parsed_request = parse_put_snapshot(&Body::new(body), Some("load")).unwrap(); assert!( @@ -325,6 +348,7 @@ mod tests { network_overrides: vec![], vsock_override: None, clock_realtime: false, + uffd_base_file: None, }; let parsed_request = parse_put_snapshot(&Body::new(body), Some("load")).unwrap(); assert_eq!( diff --git a/src/firecracker/swagger/firecracker.yaml b/src/firecracker/swagger/firecracker.yaml index d169ed194..fb39895c4 100644 --- a/src/firecracker/swagger/firecracker.yaml +++ b/src/firecracker/swagger/firecracker.yaml @@ -1624,6 +1624,11 @@ definitions: description: Type of snapshot to create. It is optional and by default, a full snapshot is created. + vmstate_only: + type: boolean + description: + Write only the microVM state file and skip the guest-memory leg + entirely (mem_file_path is ignored). Optional and defaults to false. NetworkOverride: type: object @@ -1710,6 +1715,16 @@ definitions: elapsed since the snapshot was taken. When false (default), kvmclock resumes from where it was at snapshot time. This option may be extended to other clock sources and CPU architectures in the future." + uffd_base_file: + type: string + description: + Unified-memory-substrate base backing (engrams ADR 0045 v2b). When set + with the Uffd memory backend, guest memory is created as MAP_PRIVATE of + this shmem file instead of anonymous, and the UFFD registration uses + MISSING|MINOR. The external handler resolves base-identical pages with + UFFDIO_CONTINUE (page-cache sharing across same-template microVMs) and + divergent pages with UFFDIO_COPY; guest writes COW natively. Invalid + with the File backend. Optional. TokenBucket: diff --git a/src/vmm/Cargo.toml b/src/vmm/Cargo.toml index 9486e00ed..2fb69cf70 100644 --- a/src/vmm/Cargo.toml +++ b/src/vmm/Cargo.toml @@ -46,7 +46,8 @@ serde = { version = "1.0.228", features = ["derive", "rc"] } serde_json = "1.0.149" slab = "0.4.12" thiserror = "2.0.18" -userfaultfd = "0.9.0" +# linux5_13: RegisterMode::MINOR for the ADR 0045 substrate (v2b) registration. +userfaultfd = { version = "0.9.0", features = ["linux5_13"] } utils = { path = "../utils" } uuid = "1.23.1" vhost = { version = "0.15.0", features = ["vhost-user-frontend"] } @@ -65,7 +66,7 @@ vm-fdt = "0.3.0" [dev-dependencies] criterion = { version = "0.8.2", default-features = false } device_tree = "1.1.0" -itertools = "0.14.0" +itertools = "0.15.0" proptest = { version = "1.11.0", default-features = false, features = ["std"] } [[bench]] diff --git a/src/vmm/src/persist.rs b/src/vmm/src/persist.rs index feb53c0e1..f5e5326cb 100644 --- a/src/vmm/src/persist.rs +++ b/src/vmm/src/persist.rs @@ -14,7 +14,7 @@ use std::sync::{Arc, Mutex}; use semver::Version; use serde::{Deserialize, Serialize}; -use userfaultfd::{FeatureFlags, Uffd, UffdBuilder}; +use userfaultfd::{FeatureFlags, RegisterMode, Uffd, UffdBuilder}; use vmm_sys_util::sock_ctrl_msg::ScmSocket; #[cfg(target_arch = "aarch64")] @@ -174,18 +174,23 @@ pub fn create_snapshot( snapshot_state_to_file(µvm_state, ¶ms.snapshot_path)?; - let kvm_vm = vmm.vm.as_kvm().ok_or_else(|| { - CreateSnapshotError::MicrovmState(MicrovmStateError::NotAllowed( - "snapshot requires KVM".into(), - )) - })?; - kvm_vm.snapshot_memory_to_file(¶ms.mem_file_path, params.snapshot_type)?; - - // We need to mark queues as dirty again for all activated devices. The reason we - // do it here is that we don't mark pages as dirty during runtime - // for queue objects. - vmm.device_manager - .mark_virtio_queue_memory_dirty(kvm_vm.guest_memory()); + // engram v3 (ADR 0045 C2): vmstate-only capture for post-copy live + // migration — skip the memory leg (and its dirty-queue correction, which + // only compensates for the memory dump) entirely. + if !params.vmstate_only { + let kvm_vm = vmm.vm.as_kvm().ok_or_else(|| { + CreateSnapshotError::MicrovmState(MicrovmStateError::NotAllowed( + "snapshot requires KVM".into(), + )) + })?; + kvm_vm.snapshot_memory_to_file(¶ms.mem_file_path, params.snapshot_type)?; + + // We need to mark queues as dirty again for all activated devices. The reason we + // do it here is that we don't mark pages as dirty during runtime + // for queue objects. + vmm.device_manager + .mark_virtio_queue_memory_dirty(kvm_vm.guest_memory()); + } Ok(()) } @@ -448,6 +453,12 @@ pub fn restore_from_snapshot( ) .into()); } + if params.uffd_base_file.is_some() { + return Err(RestoreFromSnapshotGuestMemoryError::Uffd( + GuestMemoryFromUffdError::BaseFileRequiresUffdBackend, + ) + .into()); + } ( guest_memory_from_file(mem_backend_path, mem_state, track_dirty_pages) .map_err(RestoreFromSnapshotGuestMemoryError::File)?, @@ -459,6 +470,7 @@ pub fn restore_from_snapshot( mem_state, track_dirty_pages, vm_resources.machine_config.huge_pages, + params.uffd_base_file.as_deref(), ) .map_err(RestoreFromSnapshotGuestMemoryError::Uffd)?, }; @@ -531,6 +543,14 @@ pub enum GuestMemoryFromUffdError { Connect(#[from] std::io::Error), /// Failed to sends file descriptor: {0} Send(#[from] vmm_sys_util::errno::Error), + /// `uffd_base_file` is only supported with the Uffd memory backend. + BaseFileRequiresUffdBackend, + /// `uffd_base_file` is not supported with hugetlbfs-backed snapshots (UFFD minor faults are shmem-only here). + BaseFileHugetlbfs, + /// Failed to open uffd_base_file: {0} + OpenBaseFile(std::io::Error), + /// Failed to map guest memory from uffd_base_file: {0} + BaseFileMap(MemoryError), } fn guest_memory_from_uffd( @@ -538,9 +558,10 @@ fn guest_memory_from_uffd( mem_state: &GuestMemoryState, track_dirty_pages: bool, huge_pages: HugePageConfig, + base_file: Option<&Path>, ) -> Result<(Vec, Option), GuestMemoryFromUffdError> { let (guest_memory, backend_mappings) = - create_guest_memory(mem_state, track_dirty_pages, huge_pages)?; + create_guest_memory(mem_state, track_dirty_pages, huge_pages, base_file)?; let mut uffd_builder = UffdBuilder::new(); @@ -557,8 +578,17 @@ fn guest_memory_from_uffd( .create() .map_err(GuestMemoryFromUffdError::Create)?; + // ADR 0045 substrate v2b: with a base file backing, register MISSING|MINOR + // so the handler can resolve base-identical pages with UFFDIO_CONTINUE + // (shared page cache) and divergent pages with UFFDIO_COPY (private). + // Without it, the stock MISSING-only registration is byte-identical. + let register_mode = if base_file.is_some() { + RegisterMode::MISSING | RegisterMode::MINOR + } else { + RegisterMode::MISSING + }; for mem_region in guest_memory.iter() { - uffd.register(mem_region.as_ptr().cast(), mem_region.size() as _) + uffd.register_with_mode(mem_region.as_ptr().cast(), mem_region.size() as _, register_mode) .map_err(GuestMemoryFromUffdError::Register)?; } @@ -571,8 +601,22 @@ fn create_guest_memory( mem_state: &GuestMemoryState, track_dirty_pages: bool, huge_pages: HugePageConfig, + base_file: Option<&Path>, ) -> Result<(Vec, Vec), GuestMemoryFromUffdError> { - let guest_memory = memory::anonymous(mem_state.regions(), track_dirty_pages, huge_pages)?; + let guest_memory = match base_file { + Some(path) => { + // ADR 0045 substrate v2b: MAP_PRIVATE of the shared base shm file. + // Read-only fd is enough — guest writes COW to private anon pages; + // only the external handler ever writes the base (by path). + if huge_pages.is_hugetlbfs() { + return Err(GuestMemoryFromUffdError::BaseFileHugetlbfs); + } + let file = std::fs::File::open(path).map_err(GuestMemoryFromUffdError::OpenBaseFile)?; + memory::snapshot_file(file, mem_state.regions(), track_dirty_pages) + .map_err(GuestMemoryFromUffdError::BaseFileMap)? + } + None => memory::anonymous(mem_state.regions(), track_dirty_pages, huge_pages)?, + }; let mut backend_mappings = Vec::with_capacity(guest_memory.len()); let mut offset = 0; for mem_region in guest_memory.iter() { @@ -777,7 +821,7 @@ mod tests { }; let (_, uffd_regions) = - create_guest_memory(&mem_state, false, HugePageConfig::None).unwrap(); + create_guest_memory(&mem_state, false, HugePageConfig::None, None).unwrap(); assert_eq!(uffd_regions.len(), 1); assert_eq!(uffd_regions[0].size, 0x20000); @@ -785,6 +829,62 @@ mod tests { assert_eq!(uffd_regions[0].page_size, HugePageConfig::None.page_size()); } + /// ADR 0045 substrate v2b: guest memory created over a base file maps it + /// MAP_PRIVATE — content reads through from the file (page-cache shared), + /// guest-side writes COW privately and never reach the file, and the + /// backend mappings carry the same sequential file offsets as the + /// anonymous path. + #[test] + fn test_create_guest_memory_with_base_file() { + use std::io::Write; + + let region_size: usize = 0x20000; + let base = TempFile::new().unwrap(); + let pattern: Vec = (0..region_size).map(|i| (i % 251) as u8).collect(); + base.as_file().write_all(&pattern).unwrap(); + + let mem_state = GuestMemoryState { + regions: vec![GuestMemoryRegionState { + base_address: 0, + size: region_size, + region_type: GuestRegionType::Dram, + plugged: vec![true], + }], + }; + + let (guest_memory, uffd_regions) = + create_guest_memory(&mem_state, false, HugePageConfig::None, Some(base.as_path())) + .unwrap(); + assert_eq!(uffd_regions.len(), 1); + assert_eq!(uffd_regions[0].size, region_size); + assert_eq!(uffd_regions[0].offset, 0); + + // Content reads through from the base file (no uffd registered yet, so + // plain page-cache faults serve these). + let ptr = guest_memory[0].as_ptr(); + // SAFETY: ptr covers region_size bytes of the mapping we just created. + let view = unsafe { std::slice::from_raw_parts_mut(ptr, region_size) }; + assert_eq!(&view[..64], &pattern[..64]); + assert_eq!(view[0x10000], pattern[0x10000]); + + // A write COWs privately: visible through the mapping, absent from the file. + view[0x10000] = 0xEE; + assert_eq!(view[0x10000], 0xEE); + let mut on_disk = vec![0u8; 4]; + std::os::unix::fs::FileExt::read_exact_at(base.as_file(), &mut on_disk, 0x10000).unwrap(); + assert_eq!(on_disk[0], pattern[0x10000], "guest write leaked into the base file"); + + // Hugetlbfs + base file is rejected. + let err = create_guest_memory( + &mem_state, + false, + HugePageConfig::Hugetlbfs2M, + Some(base.as_path()), + ) + .unwrap_err(); + assert!(matches!(err, GuestMemoryFromUffdError::BaseFileHugetlbfs)); + } + #[test] fn test_send_uffd_handshake() { #[allow(deprecated)] diff --git a/src/vmm/src/rpc_interface.rs b/src/vmm/src/rpc_interface.rs index 7693b305f..50a695c61 100644 --- a/src/vmm/src/rpc_interface.rs +++ b/src/vmm/src/rpc_interface.rs @@ -1240,6 +1240,7 @@ mod tests { snapshot_type: SnapshotType::Full, snapshot_path: PathBuf::new(), mem_file_path: PathBuf::new(), + vmstate_only: false, }, ))); #[cfg(target_arch = "x86_64")] @@ -1331,6 +1332,7 @@ mod tests { network_overrides: vec![], vsock_override: None, clock_realtime: false, + uffd_base_file: None, }, ))); check_unsupported(runtime_request(VmmAction::SetEntropyDevice( diff --git a/src/vmm/src/vmm_config/snapshot.rs b/src/vmm/src/vmm_config/snapshot.rs index 4f312f88f..d12d329ec 100644 --- a/src/vmm/src/vmm_config/snapshot.rs +++ b/src/vmm/src/vmm_config/snapshot.rs @@ -45,6 +45,13 @@ pub struct CreateSnapshotParams { pub snapshot_path: PathBuf, /// Path to the file that will contain the guest memory. pub mem_file_path: PathBuf, + /// Write only the microVM state file and skip the guest-memory leg + /// entirely (`mem_file_path` is ignored). The post-copy live-migration + /// blackout primitive for ADR 0045: the dirty memory never materializes + /// as a file — the destination demand-faults it from the paused source's + /// address space. + #[serde(default)] + pub vmstate_only: bool, } /// Allows for changing the mapping between tap devices and host devices @@ -85,6 +92,16 @@ pub struct LoadSnapshotParams { /// advancing kvmclock by the wall-clock time elapsed since the snapshot was taken. When false /// (default), kvmclock resumes from where it was at snapshot time. pub clock_realtime: bool, + /// ADR 0045 unified memory substrate (v2b). When set with the Uffd memory + /// backend, guest memory is created as `MAP_PRIVATE` of this file (a + /// tmpfs/shmem per-template base) instead of anonymous, and the UFFD + /// registration uses `MISSING | MINOR` instead of MISSING-only. The + /// external handler then resolves base-identical pages with + /// `UFFDIO_CONTINUE` (shared page cache across same-template microVMs) + /// and session-divergent pages with `UFFDIO_COPY` (private); guest writes + /// COW natively. Invalid with the File backend. Requires a kernel with + /// UFFD minor faults on shmem (>= 5.13). + pub uffd_base_file: Option, } /// Stores the configuration for loading a snapshot that is provided by the user. @@ -120,6 +137,11 @@ pub struct LoadSnapshotConfig { /// [x86_64 only] When set to true, passes `KVM_CLOCK_REALTIME` to `KVM_SET_CLOCK` on restore. #[serde(default)] pub clock_realtime: bool, + /// ADR 0045 substrate v2b: back Uffd-restored guest memory `MAP_PRIVATE` + /// by this shmem base file and register UFFD `MISSING | MINOR`. Top-level + /// (not inside `mem_backend`, which is `deny_unknown_fields`). + #[serde(skip_serializing_if = "Option::is_none")] + pub uffd_base_file: Option, } /// Stores the configuration used for managing snapshot memory. diff --git a/src/vmm/tests/integration_tests.rs b/src/vmm/tests/integration_tests.rs index 45bc3301c..eb8b15456 100644 --- a/src/vmm/tests/integration_tests.rs +++ b/src/vmm/tests/integration_tests.rs @@ -246,6 +246,7 @@ fn verify_create_snapshot( snapshot_type, snapshot_path: snapshot_file.as_path().to_path_buf(), mem_file_path: memory_file.as_path().to_path_buf(), + vmstate_only: false, }; controller @@ -317,6 +318,7 @@ fn verify_load_snapshot(snapshot_file: TempFile, memory_file: TempFile) { network_overrides: vec![], vsock_override: None, clock_realtime: false, + uffd_base_file: None, })) .unwrap(); @@ -344,6 +346,44 @@ fn test_create_and_load_snapshot() { } } +#[test] +fn test_create_snapshot_vmstate_only() { + let snapshot_file = TempFile::new().unwrap(); + let memory_file = TempFile::new().unwrap(); + + let (vmm, _) = create_vmm(Some(NOISY_KERNEL_IMAGE), false, true, false, false); + let vm_info = VmInfo::from(&*vmm.lock().unwrap()); + let mut controller = RuntimeApiController::new(vmm.clone()); + let mut event_manager = EventManager::new().unwrap(); + + thread::sleep(Duration::from_millis(200)); + + controller + .handle_request(VmmAction::Pause, &mut event_manager) + .unwrap(); + + // vmstate-only writes the state file and never touches the memory path. + controller + .handle_request( + VmmAction::CreateSnapshot(CreateSnapshotParams { + snapshot_type: SnapshotType::Full, + snapshot_path: snapshot_file.as_path().to_path_buf(), + mem_file_path: memory_file.as_path().to_path_buf(), + vmstate_only: true, + }), + &mut event_manager, + ) + .unwrap(); + + vmm.lock().unwrap().stop(FcExitCode::Ok); + + let restored_microvm_state: MicrovmState = + Snapshot::load(&mut snapshot_file.as_file()).unwrap().data; + assert_eq!(restored_microvm_state.vm_info, vm_info); + // The memory leg was skipped: the memfile is exactly as we created it. + assert_eq!(memory_file.as_file().metadata().unwrap().len(), 0); +} + #[test] fn test_snapshot_load_sanity_checks() { let microvm_state = get_microvm_state_from_snapshot(false); @@ -403,6 +443,7 @@ fn verify_load_snap_disallowed_after_boot_resources(res: VmmAction, res_name: &s network_overrides: vec![], vsock_override: None, clock_realtime: false, + uffd_base_file: None, }); let err = preboot_api_controller.handle_preboot_request(req); assert!(