Skip to content

Commit

Permalink
(lib/model) fix: TTBR0 in the EL2 regime must have a 0 ASID
Browse files Browse the repository at this point in the history
  • Loading branch information
bensimner committed Feb 4, 2025
1 parent 103b553 commit 9bca38a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib/src/model.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,14 @@ static void step_msr(struct ghost_hw_step *step)
ghost_assert(ret);
root = ttbr_extract_baddr(step->msr_data.val);
id = ttbr_extract_id(step->msr_data.val);

/* TTBR0_EL2 in non-VHE mode has a Res0 ASID */
if (step->msr_data.sysreg == SYSREG_TTBR_EL2) {
if (id != 0) {
GHOST_MODEL_CATCH_FIRE("TTBR0_EL2 ASID is reserved 0");
}
}

roots = (stage == ENTRY_STAGE1) ? &the_ghost_state->roots_s1 : &the_ghost_state->roots_s2;

/* if that root with that id exists already, were just context switching */
Expand Down

0 comments on commit 9bca38a

Please sign in to comment.