From 85f1c223b39c92c49e8b7c6c7ad39d3e42a27574 Mon Sep 17 00:00:00 2001 From: bsd Date: Sun, 20 Feb 2000 20:51:23 +0000 Subject: Don't forget to reset the hardware debug registers when a process that was using them exits. Don't allow a user process to cause the kernel to take a TRCTRAP on a user space address. Reviewed by: jlemon, sef Approved by: jkh --- sys/amd64/amd64/vm_machdep.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sys/amd64/amd64/vm_machdep.c') diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index d7fa73b1..cdcc278 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -246,6 +246,13 @@ cpu_exit(p) #ifdef USER_LDT user_ldt_free(pcb); #endif + if (pcb->pcb_flags & PCB_DBREGS) { + /* + * disable all hardware breakpoints + */ + reset_dbregs(); + pcb->pcb_flags &= ~PCB_DBREGS; + } cnt.v_swtch++; cpu_switch(p); panic("cpu_exit"); -- cgit v1.1