Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Sep 2013 07:55:35 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 724682 for review
Message-ID:  <201309160755.r8G7tZkf082372@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@724682?ac=10

Change 724682 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/09/16 07:55:19

	When performing CCall/CReturn tests, (for now) print out the
	values of $k0 and $k1 after the instructions in question return.
	This gives us an (often correct) hint as to which kernel code path
	was taken.

Affected files ...

.. //depot/projects/ctsrd/cheribsd/src/bin/cheritest/cheritest.c#17 edit

Differences ...

==== //depot/projects/ctsrd/cheribsd/src/bin/cheritest/cheritest.c#17 (text+ko) ====

@@ -101,6 +101,7 @@
 static void
 cheritest_ccall(void)
 {
+	register_t k0, k1;
 
 	/*-
 	 * Construct a code capability in $c10, and a data capability in $c11,
@@ -127,14 +128,33 @@
 	
 	/* Invoke capability. */
 	CHERI_CCALL(10, 11);
+
+	/*
+	 * XXXRW: Rely on a side channel out of our test handler to see
+	 * whether it was a CCall or CReturn.
+	 */
+	 __asm__ __volatile__ ("move %0, $k0" : "=r" (k0));
+	 __asm__ __volatile__ ("move %0, $k1" : "=r" (k1));
+	printf("MIPS K0: %016jx\n", k0);
+	printf("MIPS K1: %016jx\n", k1);
 }
 
 static void
 cheritest_creturn(void)
 {
+	register_t k0, k1;
 
 	/* XXXRW: Temporary nop semantics. */
 	CHERI_CRETURN();
+
+	/*
+	 * XXXRW: Rely on a side channel out of our test handler to see
+	 * whether it was a CCall or CReturn.
+	 */
+	__asm__ __volatile__ ("move %0, $k0" : "=r" (k0));
+	__asm__ __volatile__ ("move %0, $k1" : "=r" (k1));
+	printf("MIPS K0: %016jx\n", k0);
+	printf("MIPS K1: %016jx\n", k1);
 }
 
 static void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309160755.r8G7tZkf082372>