diff --git a/Cargo.lock b/Cargo.lock index f95d9c5ffb6..cf18c4387dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,8 +8,8 @@ version = "0.1.0" dependencies = [ "displaydoc", "thiserror", - "vm-memory", - "zerocopy 0.8.6", + "vm-memory 0.16.0", + "zerocopy 0.8.7", ] [[package]] @@ -64,9 +64,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "23a1e53f0f5d86382dafe1cf314783b2044280f406e7e1506368220ad11b1338" dependencies = [ "anstyle", "anstyle-parse", @@ -79,36 +79,36 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "8365de52b16c035ff4fcafe0092ba9390540e3e352870ac09933bebcaa2c8c56" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -412,9 +412,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "cpu-template-helper" @@ -636,9 +636,9 @@ checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" [[package]] name = "gdbstub" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbcc892208d6998fb57e7c3e05883def66f8130924bba066beb0cfe71566a9f6" +checksum = "31c683a9f13de31432e6097131d5f385898c7f0635c0f392b9d0fa165063c8ac" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -822,9 +822,9 @@ dependencies = [ [[package]] name = "kvm-bindings" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2efe3f1a4437bffe000e6297a593b98184213cd27486776c335f95ab53d48e3a" +checksum = "fa4933174d0cc4b77b958578cd45784071cc5ae212c2d78fbd755aaaa6dfa71a" dependencies = [ "serde", "vmm-sys-util", @@ -833,9 +833,9 @@ dependencies = [ [[package]] name = "kvm-ioctls" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92c2176b91f68903b54ac8c6185bada7d607ca6110998976ff15c032f88a7d39" +checksum = "337d1afa126368bbd6a5c328048f71a69a737e9afe7e436b392a8f8d770c9171" dependencies = [ "bitflags 2.6.0", "kvm-bindings", @@ -873,17 +873,17 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "linux-loader" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d379d0089d0fbf4161c35a4fdfd76125923f1a93632c49195f5372b4c0b1472" +checksum = "870c3814345f050991f99869417779f6062542bcf4ed81db7a1b926ad1306638" dependencies = [ - "vm-memory", + "vm-memory 0.16.0", ] [[package]] @@ -1057,9 +1057,9 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.24" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "910d41a655dac3b764f1ade94821093d3610248694320cd072303a8eedcf221d" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", "syn", @@ -1067,9 +1067,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.88" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -1152,9 +1152,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -1187,9 +1187,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "aa260229e6538e52293eeb577aabd09945a09d6d9cc0fc550ed7529056c2e32a" dependencies = [ "bitflags 2.6.0", "errno", @@ -1239,18 +1239,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", @@ -1323,9 +1323,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.82" +version = "2.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83540f837a8afc019423a8edb95b52a8effe46957ee402287f4292fae35be021" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" dependencies = [ "proc-macro2", "quote", @@ -1334,18 +1334,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", @@ -1487,7 +1487,7 @@ dependencies = [ "serde", "serde_json", "thiserror", - "vm-memory", + "vm-memory 0.16.0", "vmm-sys-util", ] @@ -1521,14 +1521,14 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "vhost" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c1c4c6c9f79fbe3150d9a403008ca416d34c489897effdda28b646f09900aad" +checksum = "79e9f0c62b0e4d5adbb7a9dc138b6003bdf823f196a927daf7ca0ae93cafd8ce" dependencies = [ "bitflags 2.6.0", "libc", "uuid", - "vm-memory", + "vm-memory 0.15.0", "vmm-sys-util", ] @@ -1559,6 +1559,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "vm-memory" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2919f87420b6998a131eb7c78843890295e91a3f8f786ccc925c8d387b75121" +dependencies = [ + "libc", + "thiserror", + "winapi", +] + [[package]] name = "vm-superio" version = "0.8.0" @@ -1607,10 +1618,10 @@ dependencies = [ "vhost", "vm-allocator", "vm-fdt", - "vm-memory", + "vm-memory 0.16.0", "vm-superio", "vmm-sys-util", - "zerocopy 0.8.6", + "zerocopy 0.8.7", ] [[package]] @@ -1787,11 +1798,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a65238aacd5fb83fb03fcaf94823e71643e937000ec03c46e7da94234b10c870" +checksum = "bb3da5f7220f919a6c7af7c856435a68ee1582fd7a77aa72936257d8335bd6f6" dependencies = [ - "zerocopy-derive 0.8.6", + "zerocopy-derive 0.8.7", ] [[package]] @@ -1807,9 +1818,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ca22c4ad176b37bd81a565f66635bde3d654fe6832730c3e52e1018ae1655ee" +checksum = "2e5f54f3cc93cd80745404626681b4b9fca9a867bad5a8424b618eb0db1ae6ea" dependencies = [ "proc-macro2", "quote", diff --git a/src/acpi-tables/Cargo.toml b/src/acpi-tables/Cargo.toml index a8310913092..abf511c0c06 100644 --- a/src/acpi-tables/Cargo.toml +++ b/src/acpi-tables/Cargo.toml @@ -8,9 +8,9 @@ license = "Apache-2.0" [dependencies] displaydoc = "0.2.5" -thiserror = "1.0.64" -vm-memory = { version = "0.15.0", features = ["backend-mmap", "backend-bitmap"] } -zerocopy = { version = "0.8.6", features = ["derive"] } +thiserror = "1.0.65" +vm-memory = { version = "0.16.0", features = ["backend-mmap", "backend-bitmap"] } +zerocopy = { version = "0.8.7", features = ["derive"] } [lib] bench = false diff --git a/src/clippy-tracing/Cargo.toml b/src/clippy-tracing/Cargo.toml index 9b49bf6475d..4dcd08e42eb 100644 --- a/src/clippy-tracing/Cargo.toml +++ b/src/clippy-tracing/Cargo.toml @@ -12,9 +12,9 @@ bench = false [dependencies] clap = { version = "4.5.20", features = ["derive"] } itertools = "0.13.0" -proc-macro2 = { version = "1.0.88", features = ["span-locations"] } +proc-macro2 = { version = "1.0.89", features = ["span-locations"] } quote = "1.0.37" -syn = { version = "2.0.82", features = ["full", "extra-traits", "visit", "visit-mut", "printing"] } +syn = { version = "2.0.85", features = ["full", "extra-traits", "visit", "visit-mut", "printing"] } walkdir = "2.5.0" [dev-dependencies] diff --git a/src/cpu-template-helper/Cargo.toml b/src/cpu-template-helper/Cargo.toml index 7e5e5110dfc..4e5a746647e 100644 --- a/src/cpu-template-helper/Cargo.toml +++ b/src/cpu-template-helper/Cargo.toml @@ -14,9 +14,9 @@ clap = { version = "4.5.20", features = ["derive", "string"] } displaydoc = "0.2.5" libc = "0.2.161" log-instrument = { path = "../log-instrument", optional = true } -serde = { version = "1.0.210", features = ["derive"] } +serde = { version = "1.0.214", features = ["derive"] } serde_json = "1.0.132" -thiserror = "1.0.64" +thiserror = "1.0.65" vmm = { path = "../vmm" } vmm-sys-util = "0.12.1" diff --git a/src/firecracker/Cargo.toml b/src/firecracker/Cargo.toml index 231050dbd9f..9efd00098d0 100644 --- a/src/firecracker/Cargo.toml +++ b/src/firecracker/Cargo.toml @@ -23,10 +23,10 @@ log-instrument = { path = "../log-instrument", optional = true } micro_http = { git = "https://github.com/firecracker-microvm/micro-http" } seccompiler = { path = "../seccompiler" } -serde = { version = "1.0.210", features = ["derive"] } +serde = { version = "1.0.214", features = ["derive"] } serde_derive = "1.0.136" serde_json = "1.0.132" -thiserror = "1.0.64" +thiserror = "1.0.65" timerfd = "1.6.0" utils = { path = "../utils" } vmm = { path = "../vmm" } @@ -35,16 +35,16 @@ vmm-sys-util = { version = "0.12.1", features = ["with-serde"] } [dev-dependencies] cargo_toml = "0.20.5" libc = "0.2.161" -regex = { version = "1.11.0", default-features = false, features = ["std", "unicode-perl"] } +regex = { version = "1.11.1", default-features = false, features = ["std", "unicode-perl"] } # Dev-Dependencies for uffd examples -serde = { version = "1.0.210", features = ["derive"] } +serde = { version = "1.0.214", features = ["derive"] } userfaultfd = "0.8.1" [build-dependencies] bincode = "1.2.1" seccompiler = { path = "../seccompiler" } -serde = { version = "1.0.210" } +serde = { version = "1.0.214" } serde_json = "1.0.132" [features] diff --git a/src/jailer/Cargo.toml b/src/jailer/Cargo.toml index b6499d0e73b..02a2c40fed5 100644 --- a/src/jailer/Cargo.toml +++ b/src/jailer/Cargo.toml @@ -15,8 +15,8 @@ bench = false libc = "0.2.161" log-instrument = { path = "../log-instrument", optional = true } nix = { version = "0.29.0", default-features = false, features = ["dir"] } -regex = { version = "1.11.0", default-features = false, features = ["std"] } -thiserror = "1.0.64" +regex = { version = "1.11.1", default-features = false, features = ["std"] } +thiserror = "1.0.65" vmm-sys-util = "0.12.1" utils = { path = "../utils" } diff --git a/src/log-instrument-macros/Cargo.toml b/src/log-instrument-macros/Cargo.toml index 85185601d60..fd25f4ffe08 100644 --- a/src/log-instrument-macros/Cargo.toml +++ b/src/log-instrument-macros/Cargo.toml @@ -11,9 +11,9 @@ proc-macro = true bench = false [dependencies] -proc-macro2 = "1.0.88" +proc-macro2 = "1.0.89" quote = "1.0.37" -syn = { version = "2.0.82", features = ["full", "extra-traits"] } +syn = { version = "2.0.85", features = ["full", "extra-traits"] } [lints] workspace = true diff --git a/src/rebase-snap/Cargo.toml b/src/rebase-snap/Cargo.toml index 42850d0413f..227dd50a128 100644 --- a/src/rebase-snap/Cargo.toml +++ b/src/rebase-snap/Cargo.toml @@ -13,7 +13,7 @@ bench = false displaydoc = "0.2.5" libc = "0.2.161" log-instrument = { path = "../log-instrument", optional = true } -thiserror = "1.0.64" +thiserror = "1.0.65" vmm-sys-util = "0.12.1" utils = { path = "../utils" } diff --git a/src/seccompiler/Cargo.toml b/src/seccompiler/Cargo.toml index 85198ece731..a00febe4b63 100644 --- a/src/seccompiler/Cargo.toml +++ b/src/seccompiler/Cargo.toml @@ -20,9 +20,9 @@ bincode = "1.2.1" displaydoc = "0.2.5" libc = "0.2.161" log-instrument = { path = "../log-instrument", optional = true } -serde = { version = "1.0.210", features = ["derive"] } +serde = { version = "1.0.214", features = ["derive"] } serde_json = "1.0.132" -thiserror = "1.0.64" +thiserror = "1.0.65" utils = { path = "../utils" } diff --git a/src/snapshot-editor/Cargo.toml b/src/snapshot-editor/Cargo.toml index 68f470dfde8..b7832164fc9 100644 --- a/src/snapshot-editor/Cargo.toml +++ b/src/snapshot-editor/Cargo.toml @@ -17,7 +17,7 @@ fc_utils = { package = "utils", path = "../utils" } libc = "0.2.161" log-instrument = { path = "../log-instrument", optional = true } semver = "1.0.23" -thiserror = "1.0.64" +thiserror = "1.0.65" vmm = { path = "../vmm" } vmm-sys-util = "0.12.1" diff --git a/src/utils/Cargo.toml b/src/utils/Cargo.toml index 451a8ee72cc..aa0fd23e4fd 100644 --- a/src/utils/Cargo.toml +++ b/src/utils/Cargo.toml @@ -13,9 +13,9 @@ derive_more = { version = "1.0.0", default-features = false, features = ["from"] displaydoc = "0.2.5" libc = "0.2.161" log-instrument = { path = "../log-instrument", optional = true } -serde = { version = "1.0.210", features = ["derive"] } -thiserror = "1.0.64" -vm-memory = { version = "0.15.0", features = ["backend-mmap", "backend-bitmap"] } +serde = { version = "1.0.214", features = ["derive"] } +thiserror = "1.0.65" +vm-memory = { version = "0.16.0", features = ["backend-mmap", "backend-bitmap"] } vmm-sys-util = "0.12.1" [dev-dependencies] diff --git a/src/vmm/Cargo.toml b/src/vmm/Cargo.toml index 4fc2551190e..a55cf721e43 100644 --- a/src/vmm/Cargo.toml +++ b/src/vmm/Cargo.toml @@ -20,13 +20,13 @@ crc64 = "2.0.0" derive_more = { version = "1.0.0", default-features = false, features = ["from", "display"] } displaydoc = "0.2.5" event-manager = "0.4.0" -gdbstub = { version = "0.7.2", optional = true } +gdbstub = { version = "0.7.3", optional = true } gdbstub_arch = { version = "0.3.1", optional = true } -kvm-bindings = { version = "0.9.1", features = ["fam-wrappers", "serde"] } -kvm-ioctls = "0.18.0" +kvm-bindings = { version = "0.10.0", features = ["fam-wrappers", "serde"] } +kvm-ioctls = "0.19.0" lazy_static = "1.5.0" libc = "0.2.161" -linux-loader = "0.12.0" +linux-loader = "0.13.0" log = { version = "0.4.22", features = ["std", "serde"] } log-instrument = { path = "../log-instrument", optional = true } memfd = "0.6.3" @@ -34,19 +34,19 @@ micro_http = { git = "https://github.com/firecracker-microvm/micro-http" } seccompiler = { path = "../seccompiler" } semver = { version = "1.0.23", features = ["serde"] } -serde = { version = "1.0.210", features = ["derive", "rc"] } +serde = { version = "1.0.214", features = ["derive", "rc"] } serde_json = "1.0.132" slab = "0.4.7" -thiserror = "1.0.64" +thiserror = "1.0.65" timerfd = "1.5.0" userfaultfd = "0.8.1" utils = { path = "../utils" } -vhost = { version = "0.12.0", features = ["vhost-user-frontend"] } +vhost = { version = "0.12.1", features = ["vhost-user-frontend"] } vm-allocator = "0.1.0" -vm-memory = { version = "0.15.0", features = ["backend-mmap", "backend-bitmap"] } +vm-memory = { version = "0.16.0", features = ["backend-mmap", "backend-bitmap"] } vm-superio = "0.8.0" vmm-sys-util = { version = "0.12.1", features = ["with-serde"] } -zerocopy = { version = "0.8.6" } +zerocopy = { version = "0.8.7" } [target.'cfg(target_arch = "aarch64")'.dependencies] vm-fdt = "0.3.0" diff --git a/src/vmm/src/arch/aarch64/gic/gicv2/regs/mod.rs b/src/vmm/src/arch/aarch64/gic/gicv2/regs/mod.rs index 6e85b144a26..a0c0e2c8fac 100644 --- a/src/vmm/src/arch/aarch64/gic/gicv2/regs/mod.rs +++ b/src/vmm/src/arch/aarch64/gic/gicv2/regs/mod.rs @@ -41,6 +41,8 @@ pub fn restore_state(fd: &DeviceFd, mpidrs: &[u64], state: &GicState) -> Result< #[cfg(test)] mod tests { + #![allow(clippy::undocumented_unsafe_blocks)] + use kvm_ioctls::Kvm; use super::*; @@ -79,7 +81,9 @@ mod tests { addr: &val as *const u32 as u64, flags: 0, }; - gic_fd.get_device_attr(&mut gic_dist_attr).unwrap(); + unsafe { + gic_fd.get_device_attr(&mut gic_dist_attr).unwrap(); + } // The second value from the list of distributor registers is the value of the GICD_STATUSR // register. We assert that the one saved in the bitmap is the same with the one we diff --git a/src/vmm/src/arch/aarch64/gic/gicv3/regs/mod.rs b/src/vmm/src/arch/aarch64/gic/gicv3/regs/mod.rs index ba1c78dadc9..31261f647fc 100644 --- a/src/vmm/src/arch/aarch64/gic/gicv3/regs/mod.rs +++ b/src/vmm/src/arch/aarch64/gic/gicv3/regs/mod.rs @@ -46,6 +46,8 @@ pub fn restore_state(fd: &DeviceFd, mpidrs: &[u64], state: &GicState) -> Result< #[cfg(test)] mod tests { + #![allow(clippy::undocumented_unsafe_blocks)] + use kvm_ioctls::Kvm; use super::*; @@ -81,7 +83,9 @@ mod tests { addr: &val as *const u32 as u64, flags: 0, }; - gic_fd.get_device_attr(&mut gic_dist_attr).unwrap(); + unsafe { + gic_fd.get_device_attr(&mut gic_dist_attr).unwrap(); + } // The second value from the list of distributor registers is the value of the GICD_STATUSR // register. We assert that the one saved in the bitmap is the same with the one we diff --git a/src/vmm/src/arch/aarch64/gic/regs.rs b/src/vmm/src/arch/aarch64/gic/regs.rs index 88c4d68c15c..60987cc973d 100644 --- a/src/vmm/src/arch/aarch64/gic/regs.rs +++ b/src/vmm/src/arch/aarch64/gic/regs.rs @@ -81,8 +81,12 @@ pub(crate) trait VgicRegEngine { let mut data = Vec::with_capacity(reg.iter::().count()); for offset in reg.iter::() { let mut val = Self::RegChunk::default(); - fd.get_device_attr(&mut Self::kvm_device_attr(offset, &mut val, mpidr)) - .map_err(|err| GicError::DeviceAttribute(err, false, Self::group()))?; + // SAFETY: `val` is a mutable memory location sized correctly for the attribute we're + // requesting + unsafe { + fd.get_device_attr(&mut Self::kvm_device_attr(offset, &mut val, mpidr)) + .map_err(|err| GicError::DeviceAttribute(err, false, Self::group()))?; + } data.push(val); } diff --git a/src/vmm/src/devices/virtio/queue.rs b/src/vmm/src/devices/virtio/queue.rs index b80b2571c12..39ccef1f1ee 100644 --- a/src/vmm/src/devices/virtio/queue.rs +++ b/src/vmm/src/devices/virtio/queue.rs @@ -700,7 +700,6 @@ mod verification { use std::mem::ManuallyDrop; use std::num::Wrapping; - use vm_memory::guest_memory::GuestMemoryIterator; use vm_memory::{GuestMemoryRegion, MemoryRegionAddress}; use super::*; @@ -717,13 +716,8 @@ mod verification { the_region: vm_memory::GuestRegionMmap, } - impl<'a> GuestMemoryIterator<'a, vm_memory::GuestRegionMmap> for ProofGuestMemory { - type Iter = std::iter::Once<&'a vm_memory::GuestRegionMmap>; - } - impl GuestMemory for ProofGuestMemory { type R = vm_memory::GuestRegionMmap; - type I = Self; fn num_regions(&self) -> usize { 1 @@ -735,7 +729,7 @@ mod verification { .map(|_| &self.the_region) } - fn iter(&self) -> >::Iter { + fn iter(&self) -> impl Iterator { std::iter::once(&self.the_region) }