PERFORCE change 724682 for review
Robert Watson
rwatson at FreeBSD.org
Mon Sep 16 07:55:35 UTC 2013
http://p4web.freebsd.org/@@724682?ac=10
Change 724682 by rwatson at 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
More information about the p4-projects
mailing list