From f3ac024b732f75fa20cccca13dc280d7354bf8e0 Mon Sep 17 00:00:00 2001 From: Peter Rugg Date: Tue, 20 Jun 2023 12:32:49 +0100 Subject: [PATCH] Remove exceptions from CUnseal --- src_Core/RISCY_OOO/procs/lib/Decode.bsv | 11 ----------- src_Core/RISCY_OOO/procs/lib/Exec.bsv | 3 ++- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src_Core/RISCY_OOO/procs/lib/Decode.bsv b/src_Core/RISCY_OOO/procs/lib/Decode.bsv index 557ba20..1c7b72b 100644 --- a/src_Core/RISCY_OOO/procs/lib/Decode.bsv +++ b/src_Core/RISCY_OOO/procs/lib/Decode.bsv @@ -1068,17 +1068,6 @@ function DecodeResult decode(Instruction inst, Bool cap_mode); endcase end f7_cap_CUnseal: begin - dInst.capChecks.src2_tag = True; - dInst.capChecks.src1_sealed_with_type = True; - dInst.capChecks.src2_points_to_src1_type = True; - dInst.capChecks.src2_permit_unseal = True; - - dInst.capChecks.check_enable = True; - dInst.capChecks.check_authority_src = Src2; - dInst.capChecks.check_low_src = Src2Addr; - dInst.capChecks.check_high_src = Src2Addr; - dInst.capChecks.check_inclusive = False; - dInst.iType = Cap; regs.dst = Valid(tagged Gpr rd); regs.src1 = Valid(tagged Gpr rs1); diff --git a/src_Core/RISCY_OOO/procs/lib/Exec.bsv b/src_Core/RISCY_OOO/procs/lib/Exec.bsv index ac5a8e6..1347f7a 100644 --- a/src_Core/RISCY_OOO/procs/lib/Exec.bsv +++ b/src_Core/RISCY_OOO/procs/lib/Exec.bsv @@ -257,6 +257,7 @@ function CapPipe capModify(CapPipe a, CapPipe b, CapModifyFunc func); match {.a_type, .a_res} = extractType(a); Bool sealPassthrough = !isValidCap(b) || getKind(a) != UNSEALED || !isInBounds(b, False) || getAddr(b) == otype_unsealed_ext; Bool sealIllegal = getKind(b) != UNSEALED || !getHardPerms(b).permitSeal || !validAsType(b, getAddr(b)); + Bool unsealIllegal = !isValidCap(b) || getKind(a) != UNSEALED || getKind(b) == UNSEALED || a_res || getAddr(b) != a_type || !getHardPerms(b).permitUnseal || !isInBounds(b, False); CapPipe res = (case(func) matches tagged ModifyOffset .offsetOp : modifyOffset(a_mut, getAddr(b), offsetOp == IncOffset).value; @@ -281,7 +282,7 @@ function CapPipe capModify(CapPipe a, CapPipe b, CapModifyFunc func); (sealPassthrough ? a : clearTagIf(setKind(a_mut, SEALED_WITH_TYPE (truncate(getAddr(b)))), sealIllegal)); tagged Unseal .src : - clearTagIf(setKind(((src == Src1) ? a:b), UNSEALED), (src == Src1) && (getKind(b) != UNSEALED)); + clearTagIf(setKind(((src == Src1) ? a:b), UNSEALED), (src == Src1) && sealIllegal); tagged AndPerm : setPerms(a_mut, pack(getPerms(a)) & truncate(getAddr(b))); tagged SetFlags :