From 8cf77a71e3982c03548b2e6e77c662584ce1e97b Mon Sep 17 00:00:00 2001 From: tegge Date: Tue, 24 Jun 1997 17:26:07 +0000 Subject: Ensure that the boot CPU honours write protection in kernel mode. This fixes one of the problems noted in PR kern/3688. --- sys/kern/subr_smp.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sys/kern/subr_smp.c') diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index 049aa83..91e77c2 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: mp_machdep.c,v 1.19 1997/06/24 06:55:30 fsmp Exp $ + * $Id: mp_machdep.c,v 1.20 1997/06/24 07:48:02 fsmp Exp $ */ #include "opt_smp.h" @@ -47,6 +47,7 @@ #include #include /** TEST_DEFAULT_CONFIG */ #include +#include #include /* cngetc() */ @@ -437,6 +438,13 @@ mp_enable(u_int boot_addr) /* start each Application Processor */ start_all_aps(boot_addr); + + /* + * The init process might be started on a different CPU now, + * and the boot CPU might not call prepare_usermode to get + * cr0 correctly configured. Thus we initialize cr0 here. + */ + load_cr0(rcr0() | CR0_WP | CR0_AM); } -- cgit v1.1