Skip to content

Commit 5efb074

Browse files
authored
Merge pull request #77 from Freax13/bump/nightly-2024-10-19
bump rust nightly version
2 parents 93a9ae2 + cb69c2f commit 5efb074

File tree

8 files changed

+18
-23
lines changed

8 files changed

+18
-23
lines changed

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[toolchain]
2-
channel = "nightly-2024-09-10"
2+
channel = "nightly-2024-10-19"
33
targets = ["x86_64-unknown-none", "x86_64-unknown-linux-musl", "i686-unknown-linux-musl"]
44
components = ["clippy", "rust-src", "rustfmt"]

tee/kernel/src/exception.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
//! This module is responsible for handling CPU exceptions.
22
33
use core::mem::offset_of;
4-
use core::{alloc::Layout, arch::asm, ptr::null_mut};
4+
use core::{
5+
alloc::Layout,
6+
arch::{asm, naked_asm},
7+
ptr::null_mut,
8+
};
59

610
use crate::spin::lazy::Lazy;
711
use alloc::alloc::alloc;
@@ -165,7 +169,7 @@ pub fn load_idt() {
165169
#[naked]
166170
extern "x86-interrupt" fn divide_error_handler(frame: InterruptStackFrame) {
167171
unsafe {
168-
asm!(
172+
naked_asm!(
169173
// Check whether the exception happened in userspace.
170174
"test word ptr [rsp+16], 3",
171175
"je {kernel_divide_error_handler}",
@@ -180,7 +184,6 @@ extern "x86-interrupt" fn divide_error_handler(frame: InterruptStackFrame) {
180184
kernel_divide_error_handler = sym kernel_divide_error_handler,
181185
VECTOR_OFFSET = const offset_of!(PerCpu, vector),
182186
HANDLER_OFFSET = const offset_of!(PerCpu, userspace_exception_exit_point),
183-
options(noreturn),
184187
);
185188
}
186189
}
@@ -195,7 +198,7 @@ extern "x86-interrupt" fn page_fault_handler(
195198
error_code: PageFaultErrorCode,
196199
) {
197200
unsafe {
198-
asm!(
201+
naked_asm!(
199202
// Check whether the exception happened in userspace.
200203
"test word ptr [rsp+16], 3",
201204
"je 66f",
@@ -256,7 +259,6 @@ extern "x86-interrupt" fn page_fault_handler(
256259
VECTOR_OFFSET = const offset_of!(PerCpu, vector),
257260
ERROR_CODE_OFFSET = const offset_of!(PerCpu, error_code),
258261
HANDLER_OFFSET = const offset_of!(PerCpu, userspace_exception_exit_point),
259-
options(noreturn),
260262
);
261263
}
262264
}
@@ -300,7 +302,7 @@ extern "x86-interrupt" fn general_protection_fault_handler(
300302
error_code: u64,
301303
) {
302304
unsafe {
303-
asm!(
305+
naked_asm!(
304306
// Check whether the exception happened in userspace.
305307
"test word ptr [rsp+16], 3",
306308
"je {kernel_general_protection_fault_handler}",
@@ -317,7 +319,6 @@ extern "x86-interrupt" fn general_protection_fault_handler(
317319
VECTOR_OFFSET = const offset_of!(PerCpu, vector),
318320
ERROR_CODE_OFFSET = const offset_of!(PerCpu, error_code),
319321
HANDLER_OFFSET = const offset_of!(PerCpu, userspace_exception_exit_point),
320-
options(noreturn),
321322
);
322323
}
323324
}
@@ -336,7 +337,7 @@ extern "x86-interrupt" fn double_fault_handler(frame: InterruptStackFrame, code:
336337
#[naked]
337338
extern "x86-interrupt" fn vc_handler(frame: InterruptStackFrame, error_code: u64) {
338339
unsafe {
339-
asm!(
340+
naked_asm!(
340341
// Check whether the exception happened in userspace.
341342
"test word ptr [rsp+16], 3",
342343
"je {kernel_vc_handler}",
@@ -353,15 +354,14 @@ extern "x86-interrupt" fn vc_handler(frame: InterruptStackFrame, error_code: u64
353354
VECTOR_OFFSET = const offset_of!(PerCpu, vector),
354355
ERROR_CODE_OFFSET = const offset_of!(PerCpu, error_code),
355356
HANDLER_OFFSET = const offset_of!(PerCpu, userspace_exception_exit_point),
356-
options(noreturn),
357357
);
358358
}
359359
}
360360

361361
#[naked]
362362
extern "x86-interrupt" fn kernel_vc_handler(frame: InterruptStackFrame, code: u64) {
363363
unsafe {
364-
asm!(
364+
naked_asm!(
365365
"push r11",
366366
"push r10",
367367
"push r9",
@@ -390,7 +390,6 @@ extern "x86-interrupt" fn kernel_vc_handler(frame: InterruptStackFrame, code: u6
390390
"add rsp, 8", // skip error code.
391391
"iretq",
392392
kernel_vc_handler_impl = sym kernel_vc_handler_impl,
393-
options(noreturn)
394393
);
395394
}
396395
}
@@ -464,13 +463,12 @@ extern "x86-interrupt" fn int0x80_handler(frame: InterruptStackFrame) {
464463
// The code that entered userspace stored addresses where execution should
465464
// continue when userspace exits.
466465
unsafe {
467-
asm!(
466+
naked_asm!(
468467
"swapgs",
469468
"mov byte ptr gs:[{VECTOR_OFFSET}], 0x80",
470469
"jmp gs:[{HANDLER_OFFSET}]",
471470
VECTOR_OFFSET = const offset_of!(PerCpu, vector),
472471
HANDLER_OFFSET = const offset_of!(PerCpu, userspace_exception_exit_point),
473-
options(noreturn)
474472
);
475473
}
476474
}

tee/kernel/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
allocator_api,
77
btree_cursors,
88
cfg_sanitize,
9-
const_mut_refs,
109
core_intrinsics,
1110
drain_keep_rest,
1211
extract_if,

tee/kernel/src/memory/pagetable.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,7 @@ where
11651165
entry: &'a ActivePageTableEntry<L>,
11661166
}
11671167

1168-
impl<'a, L> Deref for ActivePageTableEntryGuard<'a, L>
1168+
impl<L> Deref for ActivePageTableEntryGuard<'_, L>
11691169
where
11701170
L: TableLevel,
11711171
ActivePageTableEntry<L>: ParentEntry,
@@ -1178,7 +1178,7 @@ where
11781178
}
11791179
}
11801180

1181-
impl<'a, L> Drop for ActivePageTableEntryGuard<'a, L>
1181+
impl<L> Drop for ActivePageTableEntryGuard<'_, L>
11821182
where
11831183
L: TableLevel,
11841184
ActivePageTableEntry<L>: ParentEntry,

tee/static-page-tables/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![no_std]
2-
#![feature(const_mut_refs, const_unsafecell_get_mut, const_ptr_is_null)]
2+
#![feature(const_ptr_is_null)]
33

44
use core::{
55
cell::UnsafeCell,

tee/supervisor-snp/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![no_std]
22
#![no_main]
33
#![feature(
4-
const_mut_refs,
54
core_intrinsics,
65
naked_functions,
76
pointer_is_aligned_to,

tee/supervisor-snp/src/reset_vector.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use core::arch::{asm, global_asm};
1+
use core::arch::{global_asm, naked_asm};
22

33
use crate::main;
44

@@ -12,15 +12,14 @@ extern "sysv64" fn start() -> ! {
1212
static mut STACK: [u8; STACK_SIZE] = [0; STACK_SIZE];
1313

1414
unsafe {
15-
asm!(
15+
naked_asm!(
1616
"lea rsp, [rip + {STACK} + {STACK_SIZE}]",
1717
"and rsp, ~15",
1818
"call {PREMAIN}",
1919
"int3",
2020
STACK = sym STACK,
2121
STACK_SIZE = const STACK_SIZE,
2222
PREMAIN = sym premain,
23-
options(noreturn)
2423
);
2524
}
2625
}

tee/supervisor-tdx/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![no_std]
22
#![no_main]
3-
#![feature(abi_x86_interrupt, const_mut_refs, core_intrinsics, sync_unsafe_cell)]
3+
#![feature(abi_x86_interrupt, core_intrinsics, sync_unsafe_cell)]
44
#![allow(internal_features)]
55

66
use exception::setup_idt;

0 commit comments

Comments
 (0)