summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_trap.c
Commit message (Collapse)AuthorAgeFilesLines
* Add support for i686 machine check trap.dg1996-08-111-2/+3
|
* Fixed cloned comments about npx traps to match context.bde1996-07-121-5/+8
|
* trap.c:bde1996-06-251-15/+7
| | | | | | | | | | | | | | | | | | | | | | | Fixed profiling of system times. It was pre-4.4Lite and didn't support statclocks. System times were too small by a factor of 8. Handle deferred profiling ticks the 4.4Lite way: use addupc_task() instead of addupc(). Call addupc_task() directly instead of using the ADDUPC() macro. Removed vestigial support for PROFTIMER. switch.s: Removed addupc(). resourcevar.h: Removed ADDUPC() and declarations of addupc(). cpu.h: Updated a comment. i386's never were tahoe's, and the deferred profiling tick became (possibly) multiple ticks in 4.4Lite. Obtained from: mostly from NetBSD
* A fast memory copy for Pentiums using floating point registers.asami1996-06-131-1/+9
| | | | | | | | | | | | | | | | | | It is called from copyin and copyout. The new routine is conditioned on I586_CPU and I586_FAST_BCOPY, so you need options "I586_FAST_BCOPY" (quotes essenstial) in your kernel config file. Also, if you have other kernel types configured in your kernel, an additional check to make sure it is running on a Pentium is inserted. (It is not clear why it doesn't help on P6s, it may be just that the Orion chipset doesn't prefetch as efficiently as Tritons and friends.) Bruce can now hack this away. :)
* Clean up -Wunused warnings.gpalmer1996-06-121-4/+1
| | | | Reviewed by: bde
* This set of commits to the VM system does the following, and containdyson1996-05-181-15/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | contributions or ideas from Stephen McKay <syssgm@devetir.qld.gov.au>, Alan Cox <alc@cs.rice.edu>, David Greenman <davidg@freebsd.org> and me: More usage of the TAILQ macros. Additional minor fix to queue.h. Performance enhancements to the pageout daemon. Addition of a wait in the case that the pageout daemon has to run immediately. Slightly modify the pageout algorithm. Significant revamp of the pmap/fork code: 1) PTE's and UPAGES's are NO LONGER in the process's map. 2) PTE's and UPAGES's reside in their own objects. 3) TOTAL elimination of recursive page table pagefaults. 4) The page directory now resides in the PTE object. 5) Implemented pmap_copy, thereby speeding up fork time. 6) Changed the pv entries so that the head is a pointer and not an entire entry. 7) Significant cleanup of pmap_protect, and pmap_remove. 8) Removed significant amounts of machine dependent fork code from vm_glue. Pushed much of that code into the machine dependent pmap module. 9) Support more completely the reuse of already zeroed pages (Page table pages and page directories) as being already zeroed. Performance and code cleanups in vm_map: 1) Improved and simplified allocation of map entries. 2) Improved vm_map_copy code. 3) Corrected some minor problems in the simplify code. Implemented splvm (combo of splbio and splimp.) The VM code now seldom uses splhigh. Improved the speed of and simplified kmem_malloc. Minor mod to vm_fault to avoid using pre-zeroed pages in the case of objects with backing objects along with the already existant condition of having a vnode. (If there is a backing object, there will likely be a COW... With a COW, it isn't necessary to start with a pre-zeroed page.) Minor reorg of source to perhaps improve locality of ref.
* Remove a now unnecessary prototype from pmap.c. Also remove nowdyson1996-03-281-30/+1
| | | | unnecessary vm_fault's of page table pages in trap.c.
* Print stack pointer and frame pointer in trap messages.bde1996-03-271-6/+17
| | | | | | Fixed "trace/trap" message. Reviewed by: davidg
* Mega-commit for Linux emulator update.. This has been stress tested underpeter1996-03-021-114/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | netscape-2.0 for Linux running all the Java stuff. The scrollbars are now working, at least on my machine. (whew! :-) I'm uncomfortable with the size of this commit, but it's too inter-dependant to easily seperate out. The main changes: COMPAT_LINUX is *GONE*. Most of the code has been moved out of the i386 machine dependent section into the linux emulator itself. The int 0x80 syscall code was almost identical to the lcall 7,0 code and a minor tweak allows them to both be used with the same C code. All kernels can now just modload the lkm and it'll DTRT without having to rebuild the kernel first. Like IBCS2, you can statically compile it in with "options LINUX". A pile of new syscalls implemented, including getdents(), llseek(), readv(), writev(), msync(), personality(). The Linux-ELF libraries want to use some of these. linux_select() now obeys Linux semantics, ie: returns the time remaining of the timeout value rather than leaving it the original value. Quite a few bugs removed, including incorrect arguments being used in syscalls.. eg: mixups between passing the sigset as an int, vs passing it as a pointer and doing a copyin(), missing return values, unhandled cases, SIOC* ioctls, etc. The build for the code has changed. i386/conf/files now knows how to build linux_genassym and generate linux_assym.h on the fly. Supporting changes elsewhere in the kernel: The user-mode signal trampoline has moved from the U area to immediately below the top of the stack (below PS_STRINGS). This allows the different binary emulations to have their own signal trampoline code (which gets rid of the hardwired syscall 103 (sigreturn on BSD, syslog on Linux)) and so that the emulator can provide the exact "struct sigcontext *" argument to the program's signal handlers. The sigstack's "ss_flags" now uses SS_DISABLE and SS_ONSTACK flags, which have the same values as the re-used SA_DISABLE and SA_ONSTACK which are intended for sigaction only. This enables the support of a SA_RESETHAND flag to sigaction to implement the gross SYSV and Linux SA_ONESHOT signal semantics where the signal handler is reset when it's triggered. makesyscalls.sh no longer appends the struct sysentvec on the end of the generated init_sysent.c code. It's a lot saner to have it in a seperate file rather than trying to update the structure inside the awk script. :-) At exec time, the dozen bytes or so of signal trampoline code are copied to the top of the user's stack, rather than obtaining the trampoline code the old way by getting a clone of the parent's user area. This allows Linux and native binaries to freely exec each other without getting trampolines mixed up.
* Fix a problem with tracking the modified bit. Eliminate thedyson1996-02-251-6/+7
| | | | ugly inline-asm code, and speed up the page-table-page tracking.
* Eliminated many redundant vm_map_lookup operations for vm_mmap.dyson1996-01-191-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Speed up for vfs_bio -- addition of a routine bqrelse to greatly diminish overhead for merged cache. Efficiency improvement for vfs_cluster. It used to do alot of redundant calls to cluster_rbuild. Correct the ordering for vrele of .text and release of credentials. Use the selective tlb update for 486/586/P6. Numerous fixes to the size of objects allocated for files. Additionally, fixes in the various pagers. Fixes for proper positioning of vnode_pager_setsize in msdosfs and ext2fs. Fixes in the swap pager for exhausted resources. The pageout code will not as readily thrash. Change the page queue flags (PG_ACTIVE, PG_INACTIVE, PG_FREE, PG_CACHE) into page queue indices (PQ_ACTIVE, PQ_INACTIVE, PQ_FREE, PQ_CACHE), thereby improving efficiency of several routines. Eliminate even more unnecessary vm_page_protect operations. Significantly speed up process forks. Make vm_object_page_clean more efficient, thereby eliminating the pause that happens every 30seconds. Make sequential clustered writes B_ASYNC instead of B_DELWRI even in the case of filesystems mounted async. Fix a panic with busy pages when write clustering is done for non-VMIO buffers.
* Convert DDB to new-style option.wollman1996-01-041-1/+2
|
* Converted two options over to the new scheme: USER_LDT and KTRACE.wollman1996-01-031-1/+3
|
* Corrected a typo in a comment.dg1995-12-191-2/+2
|
* Implemented a (sorely needed for years) double fault handler to catch stackdg1995-12-191-3/+31
| | | | | | | | | | overflows. It sure would be nice if there was an unmapped page between the PCB and the stack (and that the size of the stack was configurable!). With the way things are now, the PCB will get clobbered before the double fault handler gets control, making somewhat of a mess of things. Despite this, it is still fairly easy to poke around in the overflowed stack to figure out the cause.
* GENERIC/LINT: Remove redundant quoting on some option lines.peter1995-12-141-3/+3
| | | | | | | | | | | | LINT: add a couple of new/missing/undocumented options files.i386: add linux code so that you can compile a kernel with static linux emulation ("options LINUX") i386/*: use #if defined(COMPAT_LINUX) || defined(LINUX) to enable static support of linux emulation (just like "IBCS2" makes ibcs2 static) The main thing this is going to make obvious, is that the LINUX code (when compiled from LINT) has a lot of warnings, some of which dont look too pleasant..
* Make math_emulators LKMable.phk1995-12-141-7/+9
|
* Remove various unused symbols and procedures.phk1995-12-091-6/+6
|
* Untangled the vm.h include file spaghetti.dg1995-12-071-2/+9
|
* Remove unused functions and variables, make things static, and other cleanups.phk1995-10-281-4/+2
|
* Fix tracing of syscalls. The previous fix required the undocumentedbde1995-10-091-47/+48
| | | | | | | | | | | | | | | | option DDB_NO_LCALLS to stop ddb getting control and broke all ddb tracing. Now there is no option and no way for ddb to trace at address _Xsyscall or to _Xsyscall, but tracing everywhere else works. The previous fix did unnecessary things for Linux syscalls. Don't bother checking that syscall frames are for user mode. Make debugger traps inside the kernel (except at addresses _Xsyscall and _Xsyscall+1) fatal if ddb is not configured. They "can't happen". Add prototypes. Remove stupid comments, e.g., /*ARGSUSED*/ for args that are used.
* Submitted by: Juergen Lock <nox@jelal.hb.north.de>julian1995-10-041-3/+35
| | | | | | | | | | | Obtained from: other people on the net ? 1. stepping over syscalls (gdb ni) sends you to DDB, and returned to the wrong address afterwards, with or without DDB. patch in i386/i386/trap.c below. 2. the linux emulator (modload'ed) still causes panics with DIAGNOSTIC, re-applied a patch posted to one of the lists...
* A couple of micro optimizations to improve NULL syscall performance bydg1995-08-211-31/+20
| | | | about 2%.
* Fix a bug in my disabled version of trap_pfault()...curpcb may be NULL evendg1995-07-301-3/+3
| | | | | when curproc isn't. This condition occurs at system startup and perhaps at other times.
* This fixes a compiler warning, and a cosmetic problem with the linuxpeter1995-07-161-6/+2
| | | | | | | | emul code when compiling with "options KTRACE". ktrsyscall() was expecting an array of integers, this was passing the address of a structure containing an array of integers.. The cosmetic problem was that it was calling the "enter syscall" trace hook twice - this looks like a cut/paste error/typo.
* Include ``options POWERFAIL_NMI'' for owners of older (non-apm)joerg1995-07-161-5/+32
| | | | | | | notebooks where a powerfail condition (external power drop; battery state low) is signalled by an NMI. Makes it beep instead of panicing. Reviewed by: davidg
* Truncate the fault address to a page boundry when calling vm_fault(). Thedg1995-07-161-3/+3
| | | | | last change to fix the fault-twice bug with page tables wasn't quite complete.
* Fixed bug that caused page tables to be faulted twice instead of once.dg1995-07-141-4/+7
| | | | Submitted by: John Dyson
* Merge RELENG_2_0_5 into HEADrgrimes1995-06-111-21/+13
|
* Remove trailing whitespace.rgrimes1995-05-301-10/+10
|
* Added a new version of trap_pfault() that disallows kernel page faultsdg1995-03-211-1/+121
| | | | | | to the user address space unless pcb_onfault is set. The code is currently commented out because iBCS2 and process debugging parts of the kernel need to be changed/fixed first.
* Changed some #ifdef DIAGNOSTIC code that I added to be #ifdef DEBUG.dg1995-03-211-2/+2
|
* Add and move declarations to fix all of the warnings from `gcc -Wimplicit'bde1995-03-161-4/+3
| | | | | | (except in netccitt, netiso and netns) and most of the warnings from `gcc -Wnested-externs'. Fix all the bugs found. There were no serious ones.
* First attempt to run linux binaries. This is only the changes needed tosos1995-02-141-1/+116
| | | | | | the generic kernel. The actual emulator is a separate LKM. (not finished yet, sorry). Submitted by: sos@freebsd.org & sef@kithrup.com
* Removed unnecessary check for pr_scale in the AST/OWEUPC case.dg1995-02-101-2/+2
|
* Check P_PROFIL flag for profiling rather than pr_scale as it makes moredg1995-02-101-2/+5
| | | | sense.
* Changed buffer allocation policy (machdep.c)dg1995-01-241-14/+3
| | | | | | | | | | | Moved various pmap 'bit' test/set functions back into real functions; gcc generates better code at the expense of more of it. (pmap.c) Fixed a deadlock problem with pv entry allocations (pmap.c) Added a new, optional function 'pmap_prefault' that does clustered page table preloading (pmap.c) Changed the way that page tables are held onto (trap.c). Submitted by: John Dyson
* Fix security holes in sigreturn(), ptrace() and procfs. sigreturn()bde1995-01-141-16/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | attempted to check for insecure and fatal eflags and segment selectors, but missed many cases and got the IOPL check back to front. The other syscalls didn't check at all. sys_process.c, machdep.c: Only allow PT_WRITE_U to write to the registers (ordinary and FP). psl.h, locore.s, machdep.c: Eliminate PSL_MBZ, PSL_MBO and PSL_USERCLR. We are not supposed to assume anything about the reserved bits. Use PSL_USERCHANGE and PSL_KERNEL instead. Rename PSL_USERSET to PSL_USER. exception.s: Define a private label for use by doreti when returning to user mode fails. machdep.c: In syscalls, allow changing only the eflags that can be changed on 486's in user mode (no longer attempt to allow benign IOPL changes; allow changing the nasty PSL_NT; don't allow changing the i586 bits). Don't attempt to check all the cases involving invalid selectors and %eip's. Just check for privilege violations and let the invalid things cause a trap. procfs_machdep.c: Call the ptrace register functions to do all the work for reading and writing ordinary registers and for single stepping. trap.c: Ignore traps caused by PSL_NT being set. Previously, users could cause a fatal trap in user mode by setting PSL_NT and executing an iret, and a fatal trap in kernel mode by setting PSL_NT and making a syscall. PSL_NT was cleared too late and not in enough modes to fix the problem. Make all traps in user mode (except T_NMI) nonfatal. Recover from traps caused by attempting to load invalid user registers in doreti by restarting the traps so that they appear to occur in user mode. --- Fix bogons that I noticed while fixing the above: psl.h: Fix some comments. Uniformize idempotency ifdef. exception.s, machdep.c: Remove rsvd[0-14]. rsvd0 hasn't been reserved since the 486 came out. Replace rsvd0 by `align'. rsvd[0-11] used wrong (magic non-unique) trap numbers. Replace rsvd[1-14] by rsvd. locore.s: Enable alignment check flag on 486's and 586's. machdep.c: Use a better type for kstack[]. Use TFREGP() to find the registers. Reformat ptrace functions from SEF to something closer to KNF. procfs_machdep.c: The wrong pointer to the registers got fixed as a side effect. Implement reading and writing of FP registers. /proc/*/*regs now work (only) for processes that are in memory. Clean up comments. trap.c, trap.h: Remove unused trap types.
* These changes embody the support of the fully coherent merged VM buffer cache,dg1995-01-091-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | much higher filesystem I/O performance, and much better paging performance. It represents the culmination of over 6 months of R&D. The majority of the merged VM/cache work is by John Dyson. The following highlights the most significant changes. Additionally, there are (mostly minor) changes to the various filesystem modules (nfs, msdosfs, etc) to support the new VM/buffer scheme. vfs_bio.c: Significant rewrite of most of vfs_bio to support the merged VM buffer cache scheme. The scheme is almost fully compatible with the old filesystem interface. Significant improvement in the number of opportunities for write clustering. vfs_cluster.c, vfs_subr.c Upgrade and performance enhancements in vfs layer code to support merged VM/buffer cache. Fixup of vfs_cluster to eliminate the bogus pagemove stuff. vm_object.c: Yet more improvements in the collapse code. Elimination of some windows that can cause list corruption. vm_pageout.c: Fixed it, it really works better now. Somehow in 2.0, some "enhancements" broke the code. This code has been reworked from the ground-up. vm_fault.c, vm_page.c, pmap.c, vm_object.c Support for small-block filesystems with merged VM/buffer cache scheme. pmap.c vm_map.c Dynamic kernel VM size, now we dont have to pre-allocate excessive numbers of kernel PTs. vm_glue.c Much simpler and more effective swapping code. No more gratuitous swapping. proc.h Fixed the problem that the p_lock flag was not being cleared on a fork. swap_pager.c, vnode_pager.c Removal of old vfs_bio cruft to support the past pseudo-coherency. Now the code doesn't need it anymore. machdep.c Changes to better support the parameter values for the merged VM/buffer cache scheme. machdep.c, kern_exec.c, vm_glue.c Implemented a seperate submap for temporary exec string space and another one to contain process upages. This eliminates all map fragmentation problems that previously existed. ffs_inode.c, ufs_inode.c, ufs_readwrite.c Changes for merged VM/buffer cache. Add "bypass" support for sneaking in on busy buffers. Submitted by: John Dyson and David Greenman
* Obtained from: 1.1.5bde1994-12-241-4/+10
| | | | | | | Fix single-stepping of emulated FPU instructions. Don't panic if an FPU instruction is attempted but there is no FPU and no FPU emulator is configured.
* Fix selector arg to match the (missing) prototype for sdtossd().bde1994-10-301-2/+7
| | | | | | | | Cosmetic. Return from trap() if trap_fatal() returns. trap_fatal() isn't fatal if you have ddb. Returning from trap() is usually the right thing to do and much better than falling through.
* Make my ALLDEVS kernel compile (basically, LINT minus a lot of options).wollman1994-10-211-1/+4
|
* Ouch, fixed bug in errno translation (ibcs2 support).sos1994-10-111-2/+1
|
* Hmm, only translate errno when doing an actual return.sos1994-10-101-7/+7
| | | | Reviewed by: sef@freefall.cdrom.com
* Updated to convert errno return in syscall if conversion tabel present.sos1994-10-091-1/+7
|
* db_disasm.c: Unused var zapped.phk1994-10-081-9/+8
| | | | | | | pmap.c: tons of unused vars zapped, various other warnings silenced. trap.c: unused vars zapped. vm_machdep.c: A wrong argument, which by chance did the right thing, was corrected.
* Laptop Advanced Power Management support by HOSOKAWA Tatsumi.dg1994-10-011-2/+8
| | | | Submitted by: HOSOKAWA Tatsumi
* Be more careful about dereferencing curproc, p_vmspace, and curpcb,dg1994-09-111-12/+20
| | | | | | | | | otherwise the machine will overflow the stack in a recursive fault loop (causing the machine to spontaneously reboot because of the stack fault that ultimately happens). Submitted by: Inspired by Bruce Evans, but this change is different than what he suggested.
* Remove <machine/eflags.h> and all dependencies on it. eflags.h is justbde1994-09-081-8/+7
| | | | | | | the Mach/i386 version of the BSD/vax(?) <machine/psl.h>. The Mach version has slightly better names for many macros but is now out of date and little used. It was originally used even less (for spelling PSL_T as EFL_TF in <machine/db_machdep.h>).
* Don't test if a u_int is < 0. The remaining test is sufficient and thebde1994-08-281-2/+2
| | | | extra one caused a warning.
OpenPOWER on IntegriCloud