Skip to content
Snippets Groups Projects

Always clear DF when entering the kernel

Merged Jacob Lorentzon requested to merge 4lDO2/kernel:fix_df into master
2 files
+ 36
2
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -407,6 +407,9 @@ macro_rules! interrupt_stack {
@@ -407,6 +407,9 @@ macro_rules! interrupt_stack {
}
}
}
}
core::arch::asm!(concat!(
core::arch::asm!(concat!(
 
// Clear direction flag, required by ABI when running any Rust code in the kernel.
 
"cld;",
 
// Backup all userspace registers to stack
// Backup all userspace registers to stack
$save1!(),
$save1!(),
"push rax\n",
"push rax\n",
@@ -463,6 +466,9 @@ macro_rules! interrupt {
@@ -463,6 +466,9 @@ macro_rules! interrupt {
}
}
core::arch::asm!(concat!(
core::arch::asm!(concat!(
 
// Clear direction flag, required by ABI when running any Rust code in the kernel.
 
"cld;",
 
// Backup all userspace registers to stack
// Backup all userspace registers to stack
swapgs_iff_ring3_fast!(),
swapgs_iff_ring3_fast!(),
"push rax\n",
"push rax\n",
@@ -518,6 +524,9 @@ macro_rules! interrupt_error {
@@ -518,6 +524,9 @@ macro_rules! interrupt_error {
}
}
core::arch::asm!(concat!(
core::arch::asm!(concat!(
 
// Clear direction flag, required by ABI when running any Rust code in the kernel.
 
"cld;",
 
swapgs_iff_ring3_fast_errorcode!(),
swapgs_iff_ring3_fast_errorcode!(),
// Move rax into code's place, put code in last instead (to be
// Move rax into code's place, put code in last instead (to be
// compatible with InterruptStack)
// compatible with InterruptStack)
Loading