From 1aa8a926b8af0fbf3e5093f546d71859059200dc Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Tue, 6 Mar 2018 15:51:59 +0000 Subject: [PATCH] Unbreak amd64 FBT after r330539. X-MFC with: r330539 --- sys/cddl/dev/fbt/x86/fbt_isa.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/cddl/dev/fbt/x86/fbt_isa.c b/sys/cddl/dev/fbt/x86/fbt_isa.c index 3f4d8c58ad0d..007ff5cdfb3f 100644 --- a/sys/cddl/dev/fbt/x86/fbt_isa.c +++ b/sys/cddl/dev/fbt/x86/fbt_isa.c @@ -34,6 +34,8 @@ #include +#include + #include "fbt.h" #define FBT_PUSHL_EBP 0x55 @@ -143,8 +145,15 @@ fbt_invop(uintptr_t addr, struct trapframe *frame, uintptr_t rval) 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