From bad23161a2b1e69645f8f91d0364a66923ed7da0 Mon Sep 17 00:00:00 2001 From: Guillume DIDIER Date: Thu, 10 Jun 2021 11:24:28 +0200 Subject: [PATCH] Rust nightly update - dendrobates --- Cargo.lock | 155 ++++++++++++++++++++++++++++------------------ Cargo.toml | 8 +-- src/interrupts.rs | 10 +-- src/main.rs | 5 +- 4 files changed, 105 insertions(+), 73 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8dd2a3f..de78945 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "aes-t-tables" version = "0.1.0" @@ -17,9 +19,14 @@ dependencies = [ [[package]] name = "ahash" -version = "0.4.5" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0adac150c2dd5a9c864d054e07bda5e6bc010cd10036ea5f17e82a2f5867f735" +checksum = "43bb833f0bf979d8475d38fbf09ed3b8a55e1885fe93ad3f93239fc6a4f17b98" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] [[package]] name = "arrayref" @@ -72,9 +79,9 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "bootloader" -version = "0.9.10" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c5c959bf675ba4d842740373760b2aeb5b8f5457451cd18370b4c339d4926e9" +checksum = "7a3c1ceed1cd9e61c7998100cc18c13d413aa40d018992b871ab8e7435ce6372" dependencies = [ "bit_field 0.10.1", ] @@ -105,15 +112,15 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.60" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef611cc68ff783f18535d77ddd080185275713d852c4f5cbb6122c462a7a825c" +checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" [[package]] name = "cfg-if" -version = "0.1.10" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "covert_channels_benchmark" @@ -157,7 +164,7 @@ dependencies = [ "linked_list_allocator", "polling_serial", "vga_buffer", - "volatile 0.4.1", + "volatile 0.4.4", "x86_64", ] @@ -206,9 +213,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "getrandom" -version = "0.1.15" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" +checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" dependencies = [ "cfg-if", "libc", @@ -217,18 +224,18 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.9.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ "ahash", ] [[package]] name = "itertools" -version = "0.9.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf" dependencies = [ "either", ] @@ -239,47 +246,47 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" dependencies = [ - "spin", + "spin 0.5.2", ] [[package]] name = "libc" -version = "0.2.77" +version = "0.2.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f96b10ec2560088a8e76961b00d47107b3a625fecb76dedb29ee7ccbf98235" +checksum = "5600b4e6efc5421841a2138a6b082e07fe12f9aaa12783d50e5d13325b26b4fc" [[package]] name = "linked_list_allocator" -version = "0.8.6" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84565678e403453d1a27a0886882b3b271701e65146d972d9d7d9a4c4a0ff498" +checksum = "d0b725207570aa16096962d0b20c79f8a543df2280bd3c903022b9b0b4d7ea68" dependencies = [ "spinning_top", ] [[package]] name = "lock_api" -version = "0.3.4" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" +checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb" dependencies = [ "scopeguard", ] [[package]] name = "memmap2" -version = "0.1.0" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b70ca2a6103ac8b665dc150b142ef0e4e89df640c9e6cf295d189c3caebe5a" +checksum = "723e3ebdcdc5c023db1df315364573789f8857c11b631a2fdfad7c00f5c046b4" dependencies = [ "libc", ] [[package]] name = "nix" -version = "0.18.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83450fe6a6142ddd95fb064b746083fc4ef1705fe81f64a64e1d4b39f54a1055" +checksum = "fa9b4819da1bc61c0ea48b63b7bc8604064dd43013e7cc325df098d49cd7c18a" dependencies = [ "bitflags", "cc", @@ -288,24 +295,30 @@ dependencies = [ ] [[package]] -name = "openssl" -version = "0.10.30" +name = "once_cell" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d575eff3665419f9b83678ff2815858ad9d11567e082f5ac1814baba4e2bcb4" +checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" + +[[package]] +name = "openssl" +version = "0.10.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d7830286ad6a3973c0f1d9b73738f69c76b739301d0229c4b96501695cbe4c8" dependencies = [ "bitflags", "cfg-if", "foreign-types", - "lazy_static", "libc", + "once_cell", "openssl-sys", ] [[package]] name = "openssl-sys" -version = "0.9.58" +version = "0.9.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" +checksum = "b6b0d6fb7d80f877617dfcb014e605e2b5ab2fb0afdf27935219bb6bd984cb98" dependencies = [ "autocfg", "cc", @@ -316,39 +329,43 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" +checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" [[package]] name = "polling_serial" version = "0.1.0" dependencies = [ "lazy_static", - "spin", + "spin 0.9.0", "x86_64", ] [[package]] name = "ppv-lite86" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" [[package]] name = "prefetcher_reverse" version = "0.1.0" dependencies = [ + "basic_timing_cache_channel", + "cache_side_channel", "cache_utils", + "flush_flush", + "nix", + "rand", ] [[package]] name = "rand" -version = "0.7.3" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" dependencies = [ - "getrandom", "libc", "rand_chacha", "rand_core", @@ -357,9 +374,9 @@ dependencies = [ [[package]] name = "rand_chacha" -version = "0.2.2" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", "rand_core", @@ -367,18 +384,18 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.5.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" dependencies = [ "getrandom", ] [[package]] name = "rand_hc" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" dependencies = [ "rand_core", ] @@ -396,10 +413,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] -name = "spinning_top" -version = "0.1.1" +name = "spin" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "047031d6df5f5ae0092c97aa4f6bb04cfc9c081b4cd4cb9cdb38657994279a00" +checksum = "b87bbf98cb81332a56c1ee8929845836f85e8ddd693157c30d76660196014478" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spinning_top" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75adad84ee84b521fb2cca2d4fd0f1dab1d8d026bda3c5bea4ca63b5f9f9293c" dependencies = [ "lock_api", ] @@ -416,43 +442,50 @@ version = "0.1.0" [[package]] name = "vcpkg" -version = "0.2.10" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" +checksum = "025ce40a007e1907e58d5bc1a594def78e5573bb0b1160bc389634e8f12e4faa" + +[[package]] +name = "version_check" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" [[package]] name = "vga_buffer" version = "0.1.0" dependencies = [ "lazy_static", - "spin", - "volatile 0.3.0", + "spin 0.9.0", + "volatile 0.2.7", ] [[package]] name = "volatile" -version = "0.3.0" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8e76fae08f03f96e166d2dfda232190638c10e0383841252416f9cfe2ae60e6" +checksum = "f6b06ad3ed06fef1713569d547cdbdb439eafed76341820fb0e0344f29a41945" [[package]] name = "volatile" -version = "0.4.1" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e000a949a4c792c46417a637bdf18ed39cfc70184318f609979e0fa03ab334c8" +checksum = "e4c2dbd44eb8b53973357e6e207e370f0c1059990df850aca1eca8947cf464f0" [[package]] name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "x86_64" -version = "0.12.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5b4b42dbabe13b69023e1a1407d395f1a1a33df76e9a9efdbe303acc907e292" +checksum = "b7c54a17492391c594753ce2a180142bec7ad2876543565c2a08aa11cddef251" dependencies = [ "bit_field 0.9.0", "bitflags", + "volatile 0.4.4", ] diff --git a/Cargo.toml b/Cargo.toml index 1e22037..ba0c902 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,11 +34,11 @@ test-success-exit-code = 33 # (0x10 << 1) | 1 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -x86_64 = "0.12.2" +x86_64 = "0.14.3" vga_buffer = { path = "vga_buffer" } polling_serial = { path = "polling_serial" } -volatile = "0.4.1" -linked_list_allocator = "0.8.6" +volatile = "0.4.4" +linked_list_allocator = "0.9.0" cache_utils = { path = "cache_utils", features = ["no_std"], default-features = false } arrayref = "0.3.6" @@ -47,7 +47,7 @@ version = "1.4.0" features = ["spin_no_std"] [dependencies.bootloader] -version = "0.9.10" +version = "0.9.16" features = ["sse", "map_physical_memory"] #[patch.crates-io] diff --git a/src/interrupts.rs b/src/interrupts.rs index 130640c..3835bce 100644 --- a/src/interrupts.rs +++ b/src/interrupts.rs @@ -26,13 +26,13 @@ pub fn init_idt() { } // For now. -extern "x86-interrupt" fn breakpoint_handler(stack_frame: &mut InterruptStackFrame) { +extern "x86-interrupt" fn breakpoint_handler(stack_frame: InterruptStackFrame) { serial_println!("EXCEPTION: BREAKPOINT\n{:#?}", stack_frame); println!("EXCEPTION: BREAKPOINT\n{:#?}", stack_frame); x86_64::instructions::bochs_breakpoint(); } -extern "x86-interrupt" fn double_fault_handler(sf: &mut InterruptStackFrame, e: u64) -> ! { +extern "x86-interrupt" fn double_fault_handler(mut sf: InterruptStackFrame, e: u64) -> ! { // LLVM bug causing misaligned stacks when error codes are present. // This code realigns the stack and then grabs the correct values by doing some pointer arithmetic let stack_frame: &mut InterruptStackFrame; @@ -40,7 +40,7 @@ extern "x86-interrupt" fn double_fault_handler(sf: &mut InterruptStackFrame, e: unsafe { llvm_asm!("push rax" :::: "intel"); - let s = sf as *mut InterruptStackFrame; + let s = (&mut sf) as *mut InterruptStackFrame; stack_frame = &mut *((s as *mut u64).offset(1) as *mut InterruptStackFrame); error_code = *(&e as *const u64).offset(1); } @@ -62,7 +62,7 @@ extern "x86-interrupt" fn double_fault_handler(sf: &mut InterruptStackFrame, e: use x86_64::instructions::bochs_breakpoint; use x86_64::structures::idt::PageFaultErrorCode; -extern "x86-interrupt" fn page_fault_handler(sf: &mut InterruptStackFrame, e: PageFaultErrorCode) { +extern "x86-interrupt" fn page_fault_handler(mut sf: InterruptStackFrame, e: PageFaultErrorCode) { // LLVM bug causing misaligned stacks when error codes are present. // This code realigns the stack and then grabs the correct values by doing some pointer arithmetic let stack_frame: &mut InterruptStackFrame; @@ -72,7 +72,7 @@ extern "x86-interrupt" fn page_fault_handler(sf: &mut InterruptStackFrame, e: Pa unsafe { llvm_asm!("push rax" :::: "intel"); - let s = sf as *mut InterruptStackFrame; + let s = (&mut sf) as *mut InterruptStackFrame; stack_frame = &mut *((s as *mut u64).offset(1) as *mut InterruptStackFrame); error_code = *(&e as *const PageFaultErrorCode).offset(1) as PageFaultErrorCode; } diff --git a/src/main.rs b/src/main.rs index eba619a..8d20bf0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,9 +28,8 @@ use dendrobates_tinctoreus_azureus::memory; #[cfg(not(test))] use vga_buffer::{set_colors, Color, ForegroundColor}; use x86_64::structures::paging::frame::PhysFrameRange; -use x86_64::structures::paging::{ - Mapper, MapperAllSizes, Page, PageSize, PageTableFlags, PhysFrame, Size4KiB, -}; +use x86_64::structures::paging::Translate; +use x86_64::structures::paging::{Mapper, Page, PageSize, PageTableFlags, PhysFrame, Size4KiB}; use x86_64::PhysAddr; use x86_64::VirtAddr;