diff options
author | bde <bde@FreeBSD.org> | 1999-02-13 17:45:15 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1999-02-13 17:45:15 +0000 |
commit | 1a7fd044d4902579b740e87cc579fc857b207078 (patch) | |
tree | 231376a66c097ad31f2fc4821097bebbdcd8bd51 | |
parent | d6fcbb03bca3399e98f8f7b95cd12229b7d228bb (diff) | |
download | FreeBSD-src-1a7fd044d4902579b740e87cc579fc857b207078.zip FreeBSD-src-1a7fd044d4902579b740e87cc579fc857b207078.tar.gz |
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
-rw-r--r-- | sys/amd64/amd64/machdep.c | 10 | ||||
-rw-r--r-- | sys/i386/i386/machdep.c | 10 |
2 files changed, 16 insertions, 4 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index b785ebf..c5ac17a 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -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 */ diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index b785ebf..c5ac17a 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -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 */ |