Skip to content

Commit 0bc0bc6

Browse files
committed
Use is_upper in the tlbi-effect check
1 parent 30109ed commit 0bc0bc6

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ArchSemArm/VMPromising.v

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -719,8 +719,11 @@ Definition prefix (lvl : Level) := bv (level_length lvl).
719719
Definition va_to_vpn {n : N} (va : bv 64) : bv n :=
720720
bv_extract 12 n va.
721721

722-
Definition prefix_to_va {n : N} (p : bv n) : bv 64 :=
723-
bv_concat 64 (bv_0 16) (bv_concat 48 p (bv_0 (48 - n))).
722+
Definition prefix_to_va {n : N} (is_upper : bool) (p : bv n) : bv 64 :=
723+
if is_upper then
724+
bv_concat 64 (bv_1 16) (bv_concat 48 p (bv_0 (48 - n)))
725+
else
726+
bv_concat 64 (bv_0 16) (bv_concat 48 p (bv_0 (48 - n))).
724727

725728
Definition level_prefix {n : N} (va : bv n) (lvl : Level) : prefix lvl :=
726729
bv_extract (12 + 9 * (3 - lvl)) (9 * (lvl + 1)) va.
@@ -1204,7 +1207,7 @@ Module TLB.
12041207
| (ev, t) :: tl =>
12051208
match ev with
12061209
| Ev.Tlbi tlbi =>
1207-
let va := prefix_to_va (Ctxt.va ctxt) in
1210+
let va := prefix_to_va (Entry.is_upper te) (Ctxt.va ctxt) in
12081211
if decide (is_te_invalidated_by_tlbi tlbi tid ctxt te) then
12091212
mret (Some t)
12101213
else

0 commit comments

Comments
 (0)