Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Mar 2018 15:51:59 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r330541 - head/sys/cddl/dev/fbt/x86
Message-ID:  <201803061551.w26FpxXj065413@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Tue Mar  6 15:51:59 2018
New Revision: 330541
URL: https://svnweb.freebsd.org/changeset/base/330541

Log:
  Unbreak amd64 FBT after r330539.
  
  X-MFC with:	r330539

Modified:
  head/sys/cddl/dev/fbt/x86/fbt_isa.c

Modified: head/sys/cddl/dev/fbt/x86/fbt_isa.c
==============================================================================
--- head/sys/cddl/dev/fbt/x86/fbt_isa.c	Tue Mar  6 14:31:15 2018	(r330540)
+++ head/sys/cddl/dev/fbt/x86/fbt_isa.c	Tue Mar  6 15:51:59 2018	(r330541)
@@ -34,6 +34,8 @@
 
 #include <sys/dtrace.h>
 
+#include <machine/cpufunc.h>
+
 #include "fbt.h"
 
 #define	FBT_PUSHL_EBP		0x55
@@ -143,8 +145,15 @@ fbt_invop(uintptr_t addr, struct trapframe *frame, uin
 void
 fbt_patch_tracepoint(fbt_probe_t *fbt, fbt_patchval_t val)
 {
+	u_long cr0save;
+	register_t intr;
 
+	intr = intr_disable();
+	cr0save = rcr0();
+	load_cr0(cr0save & ~CR0_WP);
 	*fbt->fbtp_patchpoint = val;
+	load_cr0(cr0save);
+	intr_restore(intr);
 }
 
 int



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