Verified Commit 266d7817 authored by jD91mZM2's avatar jD91mZM2

Disallow changing CS which contains CPL

parent 8c6e1d05
......@@ -281,7 +281,9 @@ impl InterruptStack {
self.scratch.rcx = all.rcx;
self.scratch.rax = all.rax;
self.iret.rip = all.rip;
self.iret.cs = all.cs;
// These should probably be restricted
// self.iret.cs = all.cs;
// self.iret.rflags = all.eflags;
}
/// Enables the "Trap Flag" in the FLAGS register, causing the CPU
......
......@@ -26,20 +26,6 @@ use core::{
};
use spin::{Mutex, RwLock};
#[derive(Clone, Copy)]
enum RegsKind {
Float,
Int
}
#[derive(Clone)]
enum Operation {
Memory(VirtualAddress),
Regs(RegsKind),
Trace {
clones: Vec<ContextId>
}
}
fn with_context<F, T>(pid: ContextId, callback: F) -> Result<T>
where F: FnOnce(&Context) -> Result<T>
{
......@@ -101,6 +87,20 @@ fn try_stop_context<F, T>(pid: ContextId, restart_after: bool, mut callback: F)
}
}
#[derive(Clone, Copy)]
enum RegsKind {
Float,
Int
}
#[derive(Clone)]
enum Operation {
Memory(VirtualAddress),
Regs(RegsKind),
Trace {
clones: Vec<ContextId>
}
}
#[derive(Clone, Copy)]
struct Info {
pid: ContextId,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment