Skip to content

Commit

Permalink
rmm: add test exceptions
Browse files Browse the repository at this point in the history
Signed-off-by: Bokdeuk Jeong <[email protected]>
  • Loading branch information
bokdeuk-jeong committed Dec 12, 2024
1 parent 40c37c5 commit c3df02f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions rmm/.cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
target = "aarch64-unknown-none-softfloat"
rustflags = [
"-C", "target-feature=+ecv",
"-C", "target-feature=+sme",
"-C", "target-feature=+tlb-rmi"
]
1 change: 1 addition & 0 deletions rmm/src/exception/trap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ pub extern "C" fn handle_lower_exception(
rec.context.simd.is_used = true;
unsafe {
if rec.context.simd.is_saved {
#[cfg(not(any(miri, test)))]
match Syndrome::from(esr) {
Syndrome::FPU => simd::restore_fpu(&rec.context.simd.fpu),
Syndrome::SVE | Syndrome::SME => {
Expand Down
2 changes: 2 additions & 0 deletions rmm/src/realm/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ impl Context {
TPIDR_EL2.set(rec as *const _ as u64);
gic::restore_state(rec);
timer::restore_state(rec);
#[cfg(not(any(test, miri)))]
simd::restore_state(rec);
}

Expand All @@ -96,6 +97,7 @@ impl Context {
pub unsafe fn from_current(rec: &mut Rec<'_>) {
gic::save_state(rec);
timer::save_state(rec);
#[cfg(not(any(test, miri)))]
simd::save_state(rec);
}
}
Expand Down
3 changes: 3 additions & 0 deletions rmm/src/simd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ lazy_static! {
let mut sme_en: bool = false;

trace!("Reading simd features");
#[cfg(not(any(test, miri)))]
if ID_AA64PFR0_EL1.is_set(ID_AA64PFR0_EL1::SVE) {
trace!("SVE is set");
// Get effective vl
Expand All @@ -101,6 +102,7 @@ lazy_static! {
}

// init sme
#[cfg(not(any(test, miri)))]
if ID_AA64PFR1_SME_EL1.is_set(ID_AA64PFR1_SME_EL1::SME) {
trace!("SME is set");
// Find the architecturally permitted SVL
Expand Down Expand Up @@ -258,6 +260,7 @@ pub fn save_state(rec: &mut Rec<'_>) {
rec_simd.sve.zcr_el2 = ZCR_EL2.get();
rec_simd.sve.zcr_el12 = ZCR_EL1.get();
ZCR_EL2.set(ns_simd.sve.zcr_el2);
unimplemented!();
} else {
unsafe {
if rec_simd.is_used {
Expand Down

0 comments on commit c3df02f

Please sign in to comment.