Rust nightly update - dendrobates

This commit is contained in:
Guillume DIDIER 2021-06-10 11:24:28 +02:00
parent 9c569fb7ec
commit bad23161a2
4 changed files with 105 additions and 73 deletions

155
Cargo.lock generated
View File

@ -1,5 +1,7 @@
# This file is automatically @generated by Cargo. # This file is automatically @generated by Cargo.
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3
[[package]] [[package]]
name = "aes-t-tables" name = "aes-t-tables"
version = "0.1.0" version = "0.1.0"
@ -17,9 +19,14 @@ dependencies = [
[[package]] [[package]]
name = "ahash" name = "ahash"
version = "0.4.5" version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0adac150c2dd5a9c864d054e07bda5e6bc010cd10036ea5f17e82a2f5867f735" checksum = "43bb833f0bf979d8475d38fbf09ed3b8a55e1885fe93ad3f93239fc6a4f17b98"
dependencies = [
"getrandom",
"once_cell",
"version_check",
]
[[package]] [[package]]
name = "arrayref" name = "arrayref"
@ -72,9 +79,9 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
[[package]] [[package]]
name = "bootloader" name = "bootloader"
version = "0.9.10" version = "0.9.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c5c959bf675ba4d842740373760b2aeb5b8f5457451cd18370b4c339d4926e9" checksum = "7a3c1ceed1cd9e61c7998100cc18c13d413aa40d018992b871ab8e7435ce6372"
dependencies = [ dependencies = [
"bit_field 0.10.1", "bit_field 0.10.1",
] ]
@ -105,15 +112,15 @@ dependencies = [
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.0.60" version = "1.0.68"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef611cc68ff783f18535d77ddd080185275713d852c4f5cbb6122c462a7a825c" checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787"
[[package]] [[package]]
name = "cfg-if" name = "cfg-if"
version = "0.1.10" version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]] [[package]]
name = "covert_channels_benchmark" name = "covert_channels_benchmark"
@ -157,7 +164,7 @@ dependencies = [
"linked_list_allocator", "linked_list_allocator",
"polling_serial", "polling_serial",
"vga_buffer", "vga_buffer",
"volatile 0.4.1", "volatile 0.4.4",
"x86_64", "x86_64",
] ]
@ -206,9 +213,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
[[package]] [[package]]
name = "getrandom" name = "getrandom"
version = "0.1.15" version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"libc", "libc",
@ -217,18 +224,18 @@ dependencies = [
[[package]] [[package]]
name = "hashbrown" name = "hashbrown"
version = "0.9.1" version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
dependencies = [ dependencies = [
"ahash", "ahash",
] ]
[[package]] [[package]]
name = "itertools" name = "itertools"
version = "0.9.0" version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf"
dependencies = [ dependencies = [
"either", "either",
] ]
@ -239,47 +246,47 @@ version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
dependencies = [ dependencies = [
"spin", "spin 0.5.2",
] ]
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.77" version = "0.2.96"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2f96b10ec2560088a8e76961b00d47107b3a625fecb76dedb29ee7ccbf98235" checksum = "5600b4e6efc5421841a2138a6b082e07fe12f9aaa12783d50e5d13325b26b4fc"
[[package]] [[package]]
name = "linked_list_allocator" name = "linked_list_allocator"
version = "0.8.6" version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84565678e403453d1a27a0886882b3b271701e65146d972d9d7d9a4c4a0ff498" checksum = "d0b725207570aa16096962d0b20c79f8a543df2280bd3c903022b9b0b4d7ea68"
dependencies = [ dependencies = [
"spinning_top", "spinning_top",
] ]
[[package]] [[package]]
name = "lock_api" name = "lock_api"
version = "0.3.4" version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb"
dependencies = [ dependencies = [
"scopeguard", "scopeguard",
] ]
[[package]] [[package]]
name = "memmap2" name = "memmap2"
version = "0.1.0" version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9b70ca2a6103ac8b665dc150b142ef0e4e89df640c9e6cf295d189c3caebe5a" checksum = "723e3ebdcdc5c023db1df315364573789f8857c11b631a2fdfad7c00f5c046b4"
dependencies = [ dependencies = [
"libc", "libc",
] ]
[[package]] [[package]]
name = "nix" name = "nix"
version = "0.18.0" version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83450fe6a6142ddd95fb064b746083fc4ef1705fe81f64a64e1d4b39f54a1055" checksum = "fa9b4819da1bc61c0ea48b63b7bc8604064dd43013e7cc325df098d49cd7c18a"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"cc", "cc",
@ -288,24 +295,30 @@ dependencies = [
] ]
[[package]] [[package]]
name = "openssl" name = "once_cell"
version = "0.10.30" version = "1.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index" 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 = [ dependencies = [
"bitflags", "bitflags",
"cfg-if", "cfg-if",
"foreign-types", "foreign-types",
"lazy_static",
"libc", "libc",
"once_cell",
"openssl-sys", "openssl-sys",
] ]
[[package]] [[package]]
name = "openssl-sys" name = "openssl-sys"
version = "0.9.58" version = "0.9.63"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" checksum = "b6b0d6fb7d80f877617dfcb014e605e2b5ab2fb0afdf27935219bb6bd984cb98"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"cc", "cc",
@ -316,39 +329,43 @@ dependencies = [
[[package]] [[package]]
name = "pkg-config" name = "pkg-config"
version = "0.3.18" version = "0.3.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c"
[[package]] [[package]]
name = "polling_serial" name = "polling_serial"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"lazy_static", "lazy_static",
"spin", "spin 0.9.0",
"x86_64", "x86_64",
] ]
[[package]] [[package]]
name = "ppv-lite86" name = "ppv-lite86"
version = "0.2.9" version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20" checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
[[package]] [[package]]
name = "prefetcher_reverse" name = "prefetcher_reverse"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"basic_timing_cache_channel",
"cache_side_channel",
"cache_utils", "cache_utils",
"flush_flush",
"nix",
"rand",
] ]
[[package]] [[package]]
name = "rand" name = "rand"
version = "0.7.3" version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e"
dependencies = [ dependencies = [
"getrandom",
"libc", "libc",
"rand_chacha", "rand_chacha",
"rand_core", "rand_core",
@ -357,9 +374,9 @@ dependencies = [
[[package]] [[package]]
name = "rand_chacha" name = "rand_chacha"
version = "0.2.2" version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
dependencies = [ dependencies = [
"ppv-lite86", "ppv-lite86",
"rand_core", "rand_core",
@ -367,18 +384,18 @@ dependencies = [
[[package]] [[package]]
name = "rand_core" name = "rand_core"
version = "0.5.1" version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7"
dependencies = [ dependencies = [
"getrandom", "getrandom",
] ]
[[package]] [[package]]
name = "rand_hc" name = "rand_hc"
version = "0.2.0" version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73"
dependencies = [ dependencies = [
"rand_core", "rand_core",
] ]
@ -396,10 +413,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
[[package]] [[package]]
name = "spinning_top" name = "spin"
version = "0.1.1" version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" 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 = [ dependencies = [
"lock_api", "lock_api",
] ]
@ -416,43 +442,50 @@ version = "0.1.0"
[[package]] [[package]]
name = "vcpkg" name = "vcpkg"
version = "0.2.10" version = "0.2.13"
source = "registry+https://github.com/rust-lang/crates.io-index" 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]] [[package]]
name = "vga_buffer" name = "vga_buffer"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"lazy_static", "lazy_static",
"spin", "spin 0.9.0",
"volatile 0.3.0", "volatile 0.2.7",
] ]
[[package]] [[package]]
name = "volatile" name = "volatile"
version = "0.3.0" version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8e76fae08f03f96e166d2dfda232190638c10e0383841252416f9cfe2ae60e6" checksum = "f6b06ad3ed06fef1713569d547cdbdb439eafed76341820fb0e0344f29a41945"
[[package]] [[package]]
name = "volatile" name = "volatile"
version = "0.4.1" version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e000a949a4c792c46417a637bdf18ed39cfc70184318f609979e0fa03ab334c8" checksum = "e4c2dbd44eb8b53973357e6e207e370f0c1059990df850aca1eca8947cf464f0"
[[package]] [[package]]
name = "wasi" 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" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
[[package]] [[package]]
name = "x86_64" name = "x86_64"
version = "0.12.2" version = "0.14.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5b4b42dbabe13b69023e1a1407d395f1a1a33df76e9a9efdbe303acc907e292" checksum = "b7c54a17492391c594753ce2a180142bec7ad2876543565c2a08aa11cddef251"
dependencies = [ dependencies = [
"bit_field 0.9.0", "bit_field 0.9.0",
"bitflags", "bitflags",
"volatile 0.4.4",
] ]

View File

@ -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 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
x86_64 = "0.12.2" x86_64 = "0.14.3"
vga_buffer = { path = "vga_buffer" } vga_buffer = { path = "vga_buffer" }
polling_serial = { path = "polling_serial" } polling_serial = { path = "polling_serial" }
volatile = "0.4.1" volatile = "0.4.4"
linked_list_allocator = "0.8.6" linked_list_allocator = "0.9.0"
cache_utils = { path = "cache_utils", features = ["no_std"], default-features = false } cache_utils = { path = "cache_utils", features = ["no_std"], default-features = false }
arrayref = "0.3.6" arrayref = "0.3.6"
@ -47,7 +47,7 @@ version = "1.4.0"
features = ["spin_no_std"] features = ["spin_no_std"]
[dependencies.bootloader] [dependencies.bootloader]
version = "0.9.10" version = "0.9.16"
features = ["sse", "map_physical_memory"] features = ["sse", "map_physical_memory"]
#[patch.crates-io] #[patch.crates-io]

View File

@ -26,13 +26,13 @@ pub fn init_idt() {
} }
// For now. // 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); serial_println!("EXCEPTION: BREAKPOINT\n{:#?}", stack_frame);
println!("EXCEPTION: BREAKPOINT\n{:#?}", stack_frame); println!("EXCEPTION: BREAKPOINT\n{:#?}", stack_frame);
x86_64::instructions::bochs_breakpoint(); 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. // 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 // This code realigns the stack and then grabs the correct values by doing some pointer arithmetic
let stack_frame: &mut InterruptStackFrame; let stack_frame: &mut InterruptStackFrame;
@ -40,7 +40,7 @@ extern "x86-interrupt" fn double_fault_handler(sf: &mut InterruptStackFrame, e:
unsafe { unsafe {
llvm_asm!("push rax" :::: "intel"); 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); stack_frame = &mut *((s as *mut u64).offset(1) as *mut InterruptStackFrame);
error_code = *(&e as *const u64).offset(1); 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::instructions::bochs_breakpoint;
use x86_64::structures::idt::PageFaultErrorCode; 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. // 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 // This code realigns the stack and then grabs the correct values by doing some pointer arithmetic
let stack_frame: &mut InterruptStackFrame; let stack_frame: &mut InterruptStackFrame;
@ -72,7 +72,7 @@ extern "x86-interrupt" fn page_fault_handler(sf: &mut InterruptStackFrame, e: Pa
unsafe { unsafe {
llvm_asm!("push rax" :::: "intel"); 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); stack_frame = &mut *((s as *mut u64).offset(1) as *mut InterruptStackFrame);
error_code = *(&e as *const PageFaultErrorCode).offset(1) as PageFaultErrorCode; error_code = *(&e as *const PageFaultErrorCode).offset(1) as PageFaultErrorCode;
} }

View File

@ -28,9 +28,8 @@ use dendrobates_tinctoreus_azureus::memory;
#[cfg(not(test))] #[cfg(not(test))]
use vga_buffer::{set_colors, Color, ForegroundColor}; use vga_buffer::{set_colors, Color, ForegroundColor};
use x86_64::structures::paging::frame::PhysFrameRange; use x86_64::structures::paging::frame::PhysFrameRange;
use x86_64::structures::paging::{ use x86_64::structures::paging::Translate;
Mapper, MapperAllSizes, Page, PageSize, PageTableFlags, PhysFrame, Size4KiB, use x86_64::structures::paging::{Mapper, Page, PageSize, PageTableFlags, PhysFrame, Size4KiB};
};
use x86_64::PhysAddr; use x86_64::PhysAddr;
use x86_64::VirtAddr; use x86_64::VirtAddr;