From owner-p4-projects@FreeBSD.ORG Mon Sep 16 07:55:35 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 949C3B2C; Mon, 16 Sep 2013 07:55:35 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 56C0BB2A for ; Mon, 16 Sep 2013 07:55:35 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [8.8.178.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4378124AF for ; Mon, 16 Sep 2013 07:55:35 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.7/8.14.7) with ESMTP id r8G7tZYJ082375 for ; Mon, 16 Sep 2013 07:55:35 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.7/8.14.6/Submit) id r8G7tZkf082372 for perforce@freebsd.org; Mon, 16 Sep 2013 07:55:35 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Mon, 16 Sep 2013 07:55:35 GMT Message-Id: <201309160755.r8G7tZkf082372@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 724682 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2013 07:55:35 -0000 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