diff --git a/Cargo.lock b/Cargo.lock index 8fac9d5..c7f4e29 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -76,11 +76,11 @@ checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" [[package]] name = "buddy_system_allocator" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a0108968a3a2dab95b089c0fc3f1afa7759aa5ebe6f1d86d206d6f7ba726eb" +checksum = "b672b945a3e4f4f40bfd4cd5ee07df9e796a42254ce7cd6d2599ad969244c44a" dependencies = [ - "spin 0.9.8", + "spin", ] [[package]] @@ -135,16 +135,6 @@ dependencies = [ "syn", ] -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - [[package]] name = "log" version = "0.4.29" @@ -184,7 +174,7 @@ dependencies = [ "log", "percore", "smccc", - "spin 0.10.0", + "spin", "virtio-drivers", ] @@ -224,12 +214,6 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - [[package]] name = "smccc" version = "0.2.2" @@ -239,15 +223,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] - [[package]] name = "spin" version = "0.10.0" diff --git a/Cargo.toml b/Cargo.toml index 409655e..5f752fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ arm-gic = "0.7.1" arm-pl011-uart = "0.4.0" arrayvec = { version = "0.7.6", default-features = false } bitflags = "2.10.0" -buddy_system_allocator = { version = "0.11.0", default-features = false, features = [ +buddy_system_allocator = { version = "0.12.0", default-features = false, features = [ "alloc", "use_spin", ] } diff --git a/src/pagetable.rs b/src/pagetable.rs index f47b926..6e51537 100644 --- a/src/pagetable.rs +++ b/src/pagetable.rs @@ -63,7 +63,11 @@ impl Translation for IdTranslation { unsafe fn deallocate_table(&mut self, page_table: NonNull) { let layout = Layout::new::(); - self.page_allocator.dealloc(page_table.cast(), layout); + // SAFETY: Our caller promises that the page table was allocated by `allocate_table` and not + // yet deallocated, and it won't be used after this. + unsafe { + self.page_allocator.dealloc(page_table.cast(), layout); + } } fn physical_to_virtual(&self, pa: PhysicalAddress) -> NonNull {