Add TODOs for mapping PTI properly

I think we need to reimplement these functions in assembly :(
This commit is contained in:
jD91mZM2
2020-07-14 09:14:16 +02:00
parent 701c31cee0
commit ca3ddcdeca

View File

@@ -299,9 +299,7 @@ macro_rules! interrupt_stack {
$code
}
$crate::arch::x86_64::pti::map();
[<__interrupt_inner_ $name>](&mut *$stack);
$crate::arch::x86_64::pti::unmap();
}
function!(stringify!($name) => {
@@ -311,10 +309,16 @@ macro_rules! interrupt_stack {
push_preserved!(),
push_fs!(),
// TODO: Map PTI
// $crate::arch::x86_64::pti::map();
// Call inner function with pointer to stack
"mov rdi, rsp\n",
"call __interrupt_", stringify!($name), "\n",
// TODO: Unmap PTI
// $crate::arch::x86_64::pti::unmap();
// Restore all userspace registers
pop_fs!(),
pop_preserved!(),
@@ -340,9 +344,7 @@ macro_rules! interrupt {
$code
}
$crate::arch::x86_64::pti::map();
[<__interrupt_inner_ $name>]();
$crate::arch::x86_64::pti::unmap();
}
function!(stringify!($name) => {
@@ -351,9 +353,15 @@ macro_rules! interrupt {
push_scratch!(),
push_fs!(),
// TODO: Map PTI
// $crate::arch::x86_64::pti::map();
// Call inner function with pointer to stack
"call __interrupt_", stringify!($name), "\n",
// TODO: Unmap PTI
// $crate::arch::x86_64::pti::unmap();
// Restore all userspace registers
pop_fs!(),
pop_scratch!(),
@@ -378,9 +386,7 @@ macro_rules! interrupt_error {
$code
}
$crate::arch::x86_64::pti::map();
[<__interrupt_inner_ $name>](&mut *$stack);
$crate::arch::x86_64::pti::unmap();
}
function!(stringify!($name) => {
@@ -396,10 +402,16 @@ macro_rules! interrupt_error {
// Put code in, it's now in rax
"push rax\n",
// TODO: Map PTI
// $crate::arch::x86_64::pti::map();
// Call inner function with pointer to stack
"mov rdi, rsp\n",
"call __interrupt_", stringify!($name), "\n",
// TODO: Unmap PTI
// $crate::arch::x86_64::pti::unmap();
// Pop code
"add rsp, 8\n",