From 338b98e0d2f9e41985ecaadbff0072dd176bc960 Mon Sep 17 00:00:00 2001 From: Peter Rugg Date: Mon, 16 May 2022 11:40:13 +0100 Subject: [PATCH] Remove tag-assertions when manipulating capabilities --- src_Core/RISCY_OOO/procs/lib/Decode.bsv | 12 ------------ src_Core/RISCY_OOO/procs/lib/Exec.bsv | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src_Core/RISCY_OOO/procs/lib/Decode.bsv b/src_Core/RISCY_OOO/procs/lib/Decode.bsv index b9d84df..f5616cc 100644 --- a/src_Core/RISCY_OOO/procs/lib/Decode.bsv +++ b/src_Core/RISCY_OOO/procs/lib/Decode.bsv @@ -957,7 +957,6 @@ function DecodeResult decode(Instruction inst, Bool cap_mode); dInst.capFunc = CapModify (ModifyOffset (IncOffset)); end f3_cap_CSetBoundsImmediate: begin - dInst.capChecks.src1_tag = True; dInst.capChecks.src1_unsealed = True; dInst.capChecks.check_enable = True; @@ -998,7 +997,6 @@ function DecodeResult decode(Instruction inst, Bool cap_mode); dInst.capFunc = CapModify (SpecialRW (scrType)); end f7_cap_CSetBounds: begin - dInst.capChecks.src1_tag = True; dInst.capChecks.src1_unsealed = True; dInst.capChecks.check_enable = True; @@ -1014,7 +1012,6 @@ function DecodeResult decode(Instruction inst, Bool cap_mode); dInst.capFunc = CapModify (SetBounds (SetBounds)); end f7_cap_CSetBoundsExact: begin - dInst.capChecks.src1_tag = True; dInst.capChecks.src1_unsealed = True; dInst.capChecks.cap_exact = True; @@ -1058,7 +1055,6 @@ function DecodeResult decode(Instruction inst, Bool cap_mode); dInst.capFunc = CapModify (ModifyOffset (IncOffset)); end f7_cap_CSeal: begin - dInst.capChecks.src1_tag = True; dInst.capChecks.src2_tag = True; dInst.capChecks.src1_unsealed = True; dInst.capChecks.src2_unsealed = True; @@ -1078,8 +1074,6 @@ function DecodeResult decode(Instruction inst, Bool cap_mode); dInst.capFunc = CapModify (Seal); end f7_cap_CCSeal: begin - dInst.capChecks.src1_tag = True; - dInst.capChecks.src1_unsealed = True; dInst.capChecks.src2_unsealed = True; dInst.capChecks.src2_addr_valid_type = True; @@ -1131,7 +1125,6 @@ function DecodeResult decode(Instruction inst, Bool cap_mode); endcase end f7_cap_CUnseal: begin - dInst.capChecks.src1_tag = True; dInst.capChecks.src2_tag = True; dInst.capChecks.src1_sealed_with_type = True; dInst.capChecks.src2_unsealed = True; @@ -1166,7 +1159,6 @@ function DecodeResult decode(Instruction inst, Bool cap_mode); dInst.capFunc = CapInspect (SetEqualExact); end f7_cap_CCopyType: begin - dInst.capChecks.src2_tag = True; dInst.capChecks.src2_unsealed = True; dInst.capChecks.check_enable = True; @@ -1183,7 +1175,6 @@ function DecodeResult decode(Instruction inst, Bool cap_mode); dInst.capFunc = CapModify (SetAddr (Src1Type)); end f7_cap_CAndPerm: begin - dInst.capChecks.src1_tag = True; dInst.capChecks.src1_unsealed = True; dInst.iType = Cap; @@ -1218,7 +1209,6 @@ function DecodeResult decode(Instruction inst, Bool cap_mode); dInst.capFunc = CapInspect (ToPtr); end f7_cap_CFromPtr: begin - dInst.capChecks.src2_tag = True; dInst.capChecks.src2_unsealed = True; dInst.capChecks.cfromptr_bypass = True; @@ -1238,7 +1228,6 @@ function DecodeResult decode(Instruction inst, Bool cap_mode); dInst.execFunc = Alu (Sub); end f7_cap_CBuildCap: begin - dInst.capChecks.src2_tag = True; dInst.capChecks.src2_unsealed = True; dInst.capChecks.src1_perm_subset_src2 = True; dInst.capChecks.src1_derivable = True; @@ -1349,7 +1338,6 @@ function DecodeResult decode(Instruction inst, Bool cap_mode); dInst.capFunc = CapInspect (GetAddr); end f5rs2_cap_CSealEntry: begin - dInst.capChecks.src1_tag = True; dInst.capChecks.src1_unsealed = True; dInst.capChecks.src1_permit_x = True; diff --git a/src_Core/RISCY_OOO/procs/lib/Exec.bsv b/src_Core/RISCY_OOO/procs/lib/Exec.bsv index de79c83..f250f8f 100644 --- a/src_Core/RISCY_OOO/procs/lib/Exec.bsv +++ b/src_Core/RISCY_OOO/procs/lib/Exec.bsv @@ -274,7 +274,7 @@ function Tuple2#(CapPipe,Bool) capModify(CapPipe a, CapPipe b, CapModifyFunc fun tagged FromPtr : t(getAddr(a) == 0 ? nullCap : setOffset(b, getAddr(a)).value); tagged BuildCap : - t(setKind(setValidCap(a, True), getKind(a)==SENTRY ? SENTRY : UNSEALED)); + t(setKind(setValidCap(a, isValidCap(b)), getKind(a)==SENTRY ? SENTRY : UNSEALED)); tagged Move : t(a); tagged ClearTag :