PERFORCE change 219543 for review

Robert Watson rwatson at FreeBSD.org
Sun Nov 4 05:17:29 UTC 2012


http://p4web.freebsd.org/@@219543?ac=10

Change 219543 by rwatson at rwatson_svr_ctsrd_mipsbuild on 2012/11/04 05:16:43

	Until the CheriBSD kernel's bcopy()/memcpy() become capability-oblivious,
	use an explicit capability-aware context initialisation function when
	copying saved register files during fork().

Affected files ...

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

Differences ...

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

@@ -59,6 +59,9 @@
 
 #include <machine/asm.h>
 #include <machine/cache.h>
+#ifdef CPU_CHERI
+#include <machine/cheri.h>
+#endif
 #include <machine/clock.h>
 #include <machine/cpu.h>
 #include <machine/md_var.h>
@@ -129,6 +132,16 @@
 	 */
 	bcopy(td1->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,
+	    &td1->td_pcb->pcb_cheriframe);
+#endif
+
 	/* Point mdproc and then copy over td1's contents
 	 * md_proc is empty for MIPS
 	 */


More information about the p4-projects mailing list