Refine log for #UD exception and file open
This commit is contained in:
parent
ad6cab55f9
commit
836513687a
@ -253,9 +253,12 @@ pub fn setup_cpuid_info() {
|
||||
}
|
||||
|
||||
pub fn handle_cpuid_exception(user_context: &mut CpuContext) -> Result<isize> {
|
||||
debug!("handle CPUID exception");
|
||||
let leaf = user_context.rax as u32;
|
||||
let subleaf = user_context.rcx as u32;
|
||||
debug!(
|
||||
"handle CPUID exception: leaf = 0x{:x?}, subleaf = 0x{:x?}",
|
||||
leaf, subleaf
|
||||
);
|
||||
let cpuid_result = CPUID.get_cpuid_info(leaf, subleaf);
|
||||
trace!("cpuid result: {:?}", cpuid_result);
|
||||
user_context.rax = cpuid_result.eax as u64;
|
||||
|
@ -5,8 +5,6 @@ use sgx_types::*;
|
||||
pub const SYSCALL_OPCODE: u16 = 0x050F;
|
||||
|
||||
pub fn handle_syscall_exception(user_context: &mut CpuContext) -> ! {
|
||||
debug!("handle SYSCALL exception");
|
||||
|
||||
// SYSCALL instruction saves RIP into RCX and RFLAGS into R11. This is to
|
||||
// comply with hardware's behavoir. Not useful for us.
|
||||
user_context.rcx = user_context.rip;
|
||||
@ -19,6 +17,7 @@ pub fn handle_syscall_exception(user_context: &mut CpuContext) -> ! {
|
||||
|
||||
let num = user_context.rax as u32;
|
||||
assert!(num != SyscallNum::HandleException as u32);
|
||||
debug!("handle SYSCALL exception: syscall number = {:?}", num);
|
||||
|
||||
// FIXME: occlum syscall must use Linux ABI
|
||||
occlum_syscall(user_context);
|
||||
|
@ -19,5 +19,7 @@ pub fn do_openat(fs_path: &FsPath, flags: u32, mode: FileMode) -> Result<FileDes
|
||||
let creation_flags = CreationFlags::from_bits_truncate(flags);
|
||||
current.add_file(file_ref, creation_flags.must_close_on_spawn())
|
||||
};
|
||||
|
||||
debug!("openat: result fd: {:?}", fd);
|
||||
Ok(fd)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user