Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Nov 2012 21:15:11 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 219772 for review
Message-ID:  <201211132115.qADLFBQZ041134@skunkworks.freebsd.org>

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

Change 219772 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2012/11/13 21:15:00

	When initialising the PCB of a new thread, use a CHERI copy
	routine so that tags are propagated.  This is ineffficient
	(we should use a capability-aware copy routine) but may well
	work.

Affected files ...

.. //depot/projects/ctsrd/cheribsd/src/sys/mips/mips/vm_machdep.c#6 edit

Differences ...

==== //depot/projects/ctsrd/cheribsd/src/sys/mips/mips/vm_machdep.c#6 (text+ko) ====

@@ -413,6 +413,16 @@
 	 */
 	bcopy(td0->td_pcb, pcb2, sizeof(*pcb2));
 
+#ifdef CPU_CHERI
+	/*
+	 * XXXRW: We're copying this memory twice -- once in the bcopy()
+	 * above, and once here using capabilities.  Once bcopy() is
+	 * capability-oblivious, we can lose this.
+	 */
+	cheri_context_copy(&pcb2->pcb_cheriframe,
+	    &td0->td_pcb->pcb_cheriframe);
+#endif
+
 	/*
 	 * Set registers for trampoline to user mode.
 	 */



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