From e37339b14727f71f2785c65796cd97031b694772 Mon Sep 17 00:00:00 2001 From: Peter Rugg Date: Mon, 16 May 2022 11:42:35 +0100 Subject: [PATCH] Return 0 on CToPtr if authority tag unset --- src_Core/RISCY_OOO/procs/lib/Decode.bsv | 1 - src_Core/RISCY_OOO/procs/lib/Exec.bsv | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src_Core/RISCY_OOO/procs/lib/Decode.bsv b/src_Core/RISCY_OOO/procs/lib/Decode.bsv index f5616cc..55109a7 100644 --- a/src_Core/RISCY_OOO/procs/lib/Decode.bsv +++ b/src_Core/RISCY_OOO/procs/lib/Decode.bsv @@ -1194,7 +1194,6 @@ function DecodeResult decode(Instruction inst, Bool cap_mode); end f7_cap_CToPtr: begin dInst.capChecks.src1_unsealed = True; - dInst.capChecks.src2_tag = True; dInst.iType = Cap; regs.dst = Valid(tagged Gpr rd); diff --git a/src_Core/RISCY_OOO/procs/lib/Exec.bsv b/src_Core/RISCY_OOO/procs/lib/Exec.bsv index f250f8f..3918bae 100644 --- a/src_Core/RISCY_OOO/procs/lib/Exec.bsv +++ b/src_Core/RISCY_OOO/procs/lib/Exec.bsv @@ -320,7 +320,7 @@ function Data capInspect(CapPipe a, CapPipe b, CapInspectFunc func); tagged SEALED_WITH_TYPE .t: zeroExtend(t); endcase tagged ToPtr : - (isValidCap(a) ? (getAddr(a) - getBase(b)) : 0); + (isValidCap(a) && isValidCap(b) ? (getAddr(a) - getBase(b)) : 0); default: ?; endcase); return res;