Move to semantics suggested by Jess where we throw the exception on the
type of the code capability (src1, hopefully?) if the type is reserved.
This commit is contained in:
@@ -16,6 +16,6 @@
|
||||
`CAP_CHECK_FIELD(src2_permit_seal,"src2_permit_seal")
|
||||
`CAP_CHECK_FIELD(src2_points_to_src1_type,"src2_points_to_src1_type")
|
||||
`CAP_CHECK_FIELD(src2_addr_valid_type,"src2_addr_valid_type")
|
||||
`CAP_CHECK_FIELD(src2_type_not_reserved,"src2_type_not_reserved")
|
||||
`CAP_CHECK_FIELD(src1_type_not_reserved,"src1_type_not_reserved")
|
||||
`CAP_CHECK_FIELD(src1_perm_subset_src2,"src1_perm_subset_src2")
|
||||
`CAP_CHECK_FIELD(src1_derivable,"src1_derivable")
|
||||
|
||||
@@ -1018,7 +1018,7 @@ function DecodeResult decode(Instruction inst, Bool cap_mode);
|
||||
dInst.capChecks.src1_sealed = True;
|
||||
dInst.capChecks.src2_sealed = True;
|
||||
dInst.capChecks.src1_src2_types_match = True;
|
||||
dInst.capChecks.src2_type_not_reserved = True;
|
||||
dInst.capChecks.src1_type_not_reserved = True;
|
||||
dInst.capChecks.src1_permit_x = True;
|
||||
dInst.capChecks.src2_no_permit_x = True;
|
||||
dInst.capChecks.src1_permit_ccall = True;
|
||||
|
||||
@@ -71,8 +71,8 @@ function Maybe#(CSR_XCapCause) capChecks(CapPipe a, CapPipe b, CapPipe ddc, CapC
|
||||
result = e2(TypeViolation);
|
||||
else if (toCheck.src2_addr_valid_type && !validAsType(b, truncate(getAddr(b))))
|
||||
result = e2(LengthViolation);
|
||||
else if (toCheck.src2_type_not_reserved && !validAsType(b, zeroExtend(getType(b))))
|
||||
result = e2(TypeViolation);
|
||||
else if (toCheck.src1_type_not_reserved && !validAsType(a, zeroExtend(getType(a))))
|
||||
result = e1(TypeViolation);
|
||||
else if (toCheck.src1_perm_subset_src2 && (getPerms(a) & getPerms(b)) != getPerms(a))
|
||||
result = e2(SoftwarePermViolation);
|
||||
else if (toCheck.src1_derivable && !isDerivable(a))
|
||||
|
||||
Reference in New Issue
Block a user