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
This commit is contained in:
Konstantin Belousov 2009-09-21 09:41:51 +00:00
parent 65553dd979
commit a1bfaca761
2 changed files with 10 additions and 0 deletions

View File

@ -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

View File

@ -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.