- Always print the trap number so that we have something to start with for

mystery traps.  If we don't have a message for a given trap, just use
  UNKNOWN for the message.
- Add trap messages for T_XMMFLT and T_RESERVED.

MFC after:	1 week
This commit is contained in:
John Baldwin 2005-11-18 19:26:46 +00:00
parent f6232df7a4
commit 7d0a7ec90c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=152588
2 changed files with 19 additions and 9 deletions

View file

@ -100,7 +100,7 @@ static int trap_pfault(struct trapframe *, int);
static void trap_fatal(struct trapframe *, vm_offset_t);
void dblfault_handler(void);
#define MAX_TRAP_MSG 28
#define MAX_TRAP_MSG 30
static char *trap_msg[] = {
"", /* 0 unused */
"privileged instruction fault", /* 1 T_PRIVINFLT */
@ -131,6 +131,8 @@ static char *trap_msg[] = {
"segment not present fault", /* 26 T_SEGNPFLT */
"stack fault", /* 27 T_STKFLT */
"machine check trap", /* 28 T_MCHK */
"SIMD floating-point exception", /* 29 T_XMMFLT */
"reserved (unknown) fault", /* 30 T_RESERVED */
};
#ifdef KDB
@ -609,15 +611,18 @@ trap_fatal(frame, eva)
int code, type, ss;
long esp;
struct soft_segment_descriptor softseg;
char *msg;
code = frame->tf_err;
type = frame->tf_trapno;
sdtossd(&gdt[IDXSEL(frame->tf_cs & 0xffff)], &softseg);
if (type <= MAX_TRAP_MSG)
printf("\n\nFatal trap %d: %s while in %s mode\n",
type, trap_msg[type],
ISPL(frame->tf_cs) == SEL_UPL ? "user" : "kernel");
msg = trap_msg[type];
else
msg = "UNKNOWN";
printf("\n\nFatal trap %d: %s while in %s mode\n", type, msg,
ISPL(frame->tf_cs) == SEL_UPL ? "user" : "kernel");
#ifdef SMP
/* two separate prints in case of a trap on an unmapped page */
printf("cpuid = %d; ", PCPU_GET(cpuid));

View file

@ -110,7 +110,7 @@ void dblfault_handler(void);
extern inthand_t IDTVEC(lcall_syscall);
#define MAX_TRAP_MSG 28
#define MAX_TRAP_MSG 30
static char *trap_msg[] = {
"", /* 0 unused */
"privileged instruction fault", /* 1 T_PRIVINFLT */
@ -141,6 +141,8 @@ static char *trap_msg[] = {
"segment not present fault", /* 26 T_SEGNPFLT */
"stack fault", /* 27 T_STKFLT */
"machine check trap", /* 28 T_MCHK */
"SIMD floating-point exception", /* 29 T_XMMFLT */
"reserved (unknown) fault", /* 30 T_RESERVED */
};
#if defined(I586_CPU) && !defined(NO_F00F_HACK)
@ -782,16 +784,19 @@ trap_fatal(frame, eva)
{
int code, type, ss, esp;
struct soft_segment_descriptor softseg;
char *msg;
code = frame->tf_err;
type = frame->tf_trapno;
sdtossd(&gdt[IDXSEL(frame->tf_cs & 0xffff)].sd, &softseg);
if (type <= MAX_TRAP_MSG)
printf("\n\nFatal trap %d: %s while in %s mode\n",
type, trap_msg[type],
frame->tf_eflags & PSL_VM ? "vm86" :
ISPL(frame->tf_cs) == SEL_UPL ? "user" : "kernel");
msg = trap_msg[type];
else
msg = "UNKNOWN";
printf("\n\nFatal trap %d: %s while in %s mode\n", type, msg,
frame->tf_eflags & PSL_VM ? "vm86" :
ISPL(frame->tf_cs) == SEL_UPL ? "user" : "kernel");
#ifdef SMP
/* two separate prints in case of a trap on an unmapped page */
printf("cpuid = %d; ", PCPU_GET(cpuid));