Date: Sun, 4 Nov 2012 05:17:27 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 219543 for review Message-ID: <201211040517.qA45HRTo016697@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@219543?ac=10 Change 219543 by rwatson@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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211040517.qA45HRTo016697>