From owner-svn-src-all@FreeBSD.ORG Mon Sep 21 09:41:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3481F1065672; Mon, 21 Sep 2009 09:41:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 234628FC13; Mon, 21 Sep 2009 09:41:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8L9fpNd084896; Mon, 21 Sep 2009 09:41:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8L9fpT7084893; Mon, 21 Sep 2009 09:41:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200909210941.n8L9fpT7084893@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 21 Sep 2009 09:41:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197389 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 09:41:53 -0000 Author: kib Date: Mon Sep 21 09:41:51 2009 New Revision: 197389 URL: http://svn.freebsd.org/changeset/base/197389 Log: If CPU happens to be in usermode when a T_RESERVED trap occured, then trapsignal is called with ksi.ksi_signo = 0. For debugging kernels, that should end up in panic, for non-debugging kernels behaviour is undefined. Do panic regardeless of execution mode at the moment of trap. Reviewed by: jhb MFC after: 1 month Modified: head/sys/amd64/amd64/trap.c head/sys/i386/i386/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Mon Sep 21 09:09:55 2009 (r197388) +++ head/sys/amd64/amd64/trap.c Mon Sep 21 09:41:51 2009 (r197389) @@ -253,6 +253,11 @@ trap(struct trapframe *frame) } #endif + if (type == T_RESERVED) { + trap_fatal(frame, 0); + goto out; + } + #ifdef HWPMC_HOOKS /* * CPU PMCs interrupt using an NMI. If the PMC module is Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Mon Sep 21 09:09:55 2009 (r197388) +++ head/sys/i386/i386/trap.c Mon Sep 21 09:41:51 2009 (r197389) @@ -225,6 +225,11 @@ trap(struct trapframe *frame) } #endif + if (type == T_RESERVED) { + trap_fatal(frame, 0); + goto out; + } + #ifdef HWPMC_HOOKS /* * CPU PMCs interrupt using an NMI so we check for that first.