Remove traps for CBuildCap
This will be very expensive in terms of area and possibly timing. Ideally this instruction would be multi-cycle or optimised to reduce the overhead.
This commit is contained in:
@@ -1140,15 +1140,6 @@ function DecodeResult decode(Instruction inst, Bool cap_mode);
|
||||
dInst.execFunc = Alu (Sub);
|
||||
end
|
||||
f7_cap_CBuildCap: begin
|
||||
dInst.capChecks.src1_perm_subset_src2 = True;
|
||||
dInst.capChecks.src1_derivable = True;
|
||||
|
||||
dInst.capChecks.check_enable = True;
|
||||
dInst.capChecks.check_authority_src = Src2;
|
||||
dInst.capChecks.check_low_src = Src1Base;
|
||||
dInst.capChecks.check_high_src = Src1Top;
|
||||
dInst.capChecks.check_inclusive = True;
|
||||
|
||||
// Swap arguments so SCR possibly goes in RS2
|
||||
dInst.iType = Cap;
|
||||
regs.dst = Valid(tagged Gpr rd);
|
||||
|
||||
@@ -258,6 +258,7 @@ function CapPipe capModify(CapPipe a, CapPipe b, CapModifyFunc func);
|
||||
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);
|
||||
Bool buildCapIllegal = !isValidCap(b) || getKind(b) != UNSEALED || !isDerivable(a) || (getPerms(a) & getPerms(b)) != getPerms(a) || getBase(a) < getBase(b) || getTop(a) > getTop(b); // XXX needs optimisation
|
||||
CapPipe res = (case(func) matches
|
||||
tagged ModifyOffset .offsetOp :
|
||||
modifyOffset(a_mut, getAddr(b), offsetOp == IncOffset).value;
|
||||
@@ -290,7 +291,7 @@ function CapPipe capModify(CapPipe a, CapPipe b, CapModifyFunc func);
|
||||
tagged FromPtr :
|
||||
(getAddr(a) == 0 ? nullCap : setOffset(b_mut, getAddr(a)).value);
|
||||
tagged BuildCap :
|
||||
setKind(setValidCap(a_mut, isValidCap(b_mut)), getKind(a)==SENTRY ? SENTRY : UNSEALED);
|
||||
setKind(setValidCap(a_mut, !buildCapIllegal), getKind(a)==SENTRY ? SENTRY : UNSEALED);
|
||||
tagged Move :
|
||||
a;
|
||||
tagged ClearTag :
|
||||
|
||||
Reference in New Issue
Block a user