Remove exceptions from CUnseal

This commit is contained in:
Peter Rugg
2023-06-20 12:32:49 +01:00
parent ca711eab2a
commit f3ac024b73
2 changed files with 2 additions and 12 deletions

View File

@@ -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);

View File

@@ -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 :