Skip to content

Commit a25c1cd

Browse files
committed
fixup! amd64: move processor control structures to snapshot region
Fixing minor nits Signed-off-by: Lucy Menon <168595099+syntactically@users.noreply.github.com>
1 parent c756cf2 commit a25c1cd

8 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/hyperlight_guest_bin/src/arch/amd64/exn/entry.rs renamed to src/hyperlight_guest_bin/src/arch/amd64/exception/entry.rs

File renamed without changes.

src/hyperlight_guest_bin/src/arch/amd64/exn/handle.rs renamed to src/hyperlight_guest_bin/src/arch/amd64/exception/handle.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ pub(crate) extern "C" fn hl_exception_handler(
110110
}
111111
}
112112

113-
let bytes_near_rip = unsafe { (saved_rip as *const [u8; 8]).read_volatile() };
113+
let bytes_at_rip = unsafe { (saved_rip as *const [u8; 8]).read_volatile() };
114114

115115
// begin abort sequence by writing the error code
116116
let mut w = HyperlightAbortWriter;
@@ -119,11 +119,11 @@ pub(crate) extern "C" fn hl_exception_handler(
119119
w,
120120
"Exception vector: {}\n\
121121
Faulting Instruction: {:#x}\n\
122-
Bytes Around Instruction: {:?}\n\
122+
Bytes At Faulting Instruction: {:?}\n\
123123
Page Fault Address: {:#x}\n\
124124
Error code: {:#x}\n\
125125
Stack Pointer: {:#x}",
126-
exception_number, saved_rip, bytes_near_rip, page_fault_address, error_code, stack_pointer
126+
exception_number, saved_rip, bytes_at_rip, page_fault_address, error_code, stack_pointer
127127
);
128128
if write_res.is_err() {
129129
write_abort("exception message format failed".as_bytes());
File renamed without changes.

src/hyperlight_guest_bin/src/arch/amd64/init.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
use core::arch::asm;
1818
use core::mem;
1919

20-
use super::exn::entry::init_idt;
20+
use super::exception::entry::init_idt;
2121
use super::machine::{GDT, GdtEntry, GdtPointer, ProcCtrl, TSS};
2222

2323
#[repr(C)]

src/hyperlight_guest_bin/src/arch/amd64/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ limitations under the License.
1515
*/
1616

1717
pub(crate) mod context;
18-
pub mod exn;
18+
pub mod exception;
1919
mod init;
2020
mod layout;
2121
pub(crate) mod machine;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ limitations under the License.
1616

1717
pub mod arch {
1818
pub use crate::arch::context::Context;
19-
pub use crate::arch::exn::handle::HANDLERS;
19+
pub use crate::arch::exception::handle::HANDLERS;
2020
pub use crate::arch::machine::ExceptionInfo;
2121
}

src/hyperlight_guest_bin/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ mod arch;
3939
// this should be replaced with something a bit more abstract in the
4040
// near future.
4141
#[cfg(target_arch = "x86_64")]
42-
pub mod exn;
42+
pub mod exception;
4343
pub mod guest_function {
4444
pub(super) mod call;
4545
pub mod definition;

src/tests/rust_guests/simpleguest/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use hyperlight_common::flatbuffer_wrappers::guest_log_level::LogLevel;
4343
use hyperlight_common::flatbuffer_wrappers::util::get_flatbuffer_result;
4444
use hyperlight_guest::error::{HyperlightGuestError, Result};
4545
use hyperlight_guest::exit::{abort_with_code, abort_with_code_and_message};
46-
use hyperlight_guest_bin::exn::arch::{Context, ExceptionInfo};
46+
use hyperlight_guest_bin::exception::arch::{Context, ExceptionInfo};
4747
use hyperlight_guest_bin::guest_function::definition::GuestFunctionDefinition;
4848
use hyperlight_guest_bin::guest_function::register::register_function;
4949
use hyperlight_guest_bin::host_comm::{
@@ -130,7 +130,7 @@ fn test_exception_handler(
130130
/// Install handler for a specific vector
131131
#[guest_function("InstallHandler")]
132132
fn install_handler(vector: i32) {
133-
hyperlight_guest_bin::exn::arch::HANDLERS[vector as usize]
133+
hyperlight_guest_bin::exception::arch::HANDLERS[vector as usize]
134134
.store(test_exception_handler as usize as u64, Ordering::Release);
135135
}
136136

0 commit comments

Comments
 (0)