From 4a529712e3b14cfcc0a242095e4cbc3f7f017dbe Mon Sep 17 00:00:00 2001 From: Marno van der Maas Date: Thu, 19 Dec 2024 17:30:18 +0000 Subject: [PATCH] Tag test now also tests CSC writing a zero tag --- sw/cheri/checks/tag_test.S | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/sw/cheri/checks/tag_test.S b/sw/cheri/checks/tag_test.S index b6871c05..68eae03c 100644 --- a/sw/cheri/checks/tag_test.S +++ b/sw/cheri/checks/tag_test.S @@ -89,6 +89,32 @@ captags: clc ct1, 16(ct0) cgettag t2, ct1 bnez t2, fail + // Store valid capabilities + csc ct0, 0(ct0) + csc ct0, 8(ct0) + csc ct0, 16(ct0) + // Check that tags are all valid + clc ct1, 0(ct0) + cgettag t2, ct1 + beqz t2, fail + clc ct1, 8(ct0) + cgettag t2, ct1 + beqz t2, fail + clc ct1, 16(ct0) + cgettag t2, ct1 + beqz t2, fail + // Store null cap to second capability + csc cnull, 8(ct0) + // Check that tags are 1,0,1 + clc ct1, 0(ct0) + cgettag t2, ct1 + beqz t2, fail + clc ct1, 8(ct0) + cgettag t2, ct1 + bnez t2, fail + clc ct1, 16(ct0) + cgettag t2, ct1 + beqz t2, fail // Test for revocation tags revtags: