1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Don't pass PSL_NT to vm86 signal handlers. Some vm86/real mode

programs, including msdos, set PSL_NT in probes for old cpu types,
although PSL_NT doesn't do anything useful in vm86 or real mode.
PSL_NT is even less useful in the signal handlers.  It just causes
T_TSSFLT faults on return from syscalls made by the handlers.
These faults are fixed up lazily so that Xsyscall() doesn't have
to be slowed down to prevent them.  The fault handler recently
started complaining about these faults occurring "with interrupts
disabled".  It should not have, but the complaints pointed to this
bug.

PR:		9211
This commit is contained in:
Bruce Evans 1999-02-13 17:45:15 +00:00
parent acd904fcc3
commit 2088de1b49
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=43970
2 changed files with 16 additions and 4 deletions

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
* $Id: machdep.c,v 1.324 1999/02/03 14:10:50 dg Exp $
* $Id: machdep.c,v 1.325 1999/02/11 07:53:28 msmith Exp $
*/
#include "apm.h"
@ -614,8 +614,14 @@ sendsig(catcher, sig, mask, code)
* We should never have PSL_T set when returning from vm86
* mode. It may be set here if we deliver a signal before
* getting to vm86 mode, so turn it off.
*
* Clear PSL_NT to inhibit T_TSSFLT faults on return from
* syscalls made by the signal handler. This just avoids
* wasting time for our lazy fixup of such faults. PSL_NT
* does nothing in vm86 mode, but vm86 programs can set it
* almost legitimately in probes for old cpu types.
*/
tf->tf_eflags &= ~(PSL_VM | PSL_T | PSL_VIF | PSL_VIP);
tf->tf_eflags &= ~(PSL_VM | PSL_NT | PSL_T | PSL_VIF | PSL_VIP);
}
#endif /* VM86 */

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
* $Id: machdep.c,v 1.324 1999/02/03 14:10:50 dg Exp $
* $Id: machdep.c,v 1.325 1999/02/11 07:53:28 msmith Exp $
*/
#include "apm.h"
@ -614,8 +614,14 @@ sendsig(catcher, sig, mask, code)
* We should never have PSL_T set when returning from vm86
* mode. It may be set here if we deliver a signal before
* getting to vm86 mode, so turn it off.
*
* Clear PSL_NT to inhibit T_TSSFLT faults on return from
* syscalls made by the signal handler. This just avoids
* wasting time for our lazy fixup of such faults. PSL_NT
* does nothing in vm86 mode, but vm86 programs can set it
* almost legitimately in probes for old cpu types.
*/
tf->tf_eflags &= ~(PSL_VM | PSL_T | PSL_VIF | PSL_VIP);
tf->tf_eflags &= ~(PSL_VM | PSL_NT | PSL_T | PSL_VIF | PSL_VIP);
}
#endif /* VM86 */