summaryrefslogtreecommitdiffstats
path: root/sys/amd64/amd64/trap.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove the vm86 support as an LKM, and link it directly into the kerneljlemon1997-08-281-4/+5
| | | | | if 'options "VM86"' is in the config file. The LKM was really for development, and has probably outlived its usefulness.
* Clean up the SMP AP bootstrap and eliminate the wretched idle procs.peter1997-08-261-1/+6
| | | | | | | | | | | | | | | | | | | | - We now have enough per-cpu idle context, the real idle loop has been revived (cpu's halt now with nothing to do). - Some preliminary support for running some operations outside the global lock (eg: zeroing "free but not yet zeroed pages") is present but appears to cause problems. Off by default. - the smp_active sysctl now behaves differently. It's merely a 'true/false' option. Setting smp_active to zero causes the AP's to halt in the idle loop and stop scheduling processes. - bootstrap is a lot safer. Instead of sharing a statically compiled in stack a number of times (which has caused lots of problems) and then abandoning it, we use the idle context to boot the AP's directly. This should help >2 cpu support since the bootlock stuff was in doubt. - print physical apic id in traps.. helps identify private pages getting out of sync. (You don't want to know how much hair I tore out with this!) More cleanup to follow, this is more of a checkpoint than a 'finished' thing.
* Revert my previous commit about using CS_SECURE macro.charnier1997-08-211-5/+5
| | | | Requested by: Bruce.
* Preperation for moving cpl into critical region access.fsmp1997-08-201-1/+9
| | | | | | | | Several new fine-grained locks. New FAST_INTR() methods: - separate simplelock for FAST_INTR, no more giant lock. - FAST_INTR()s no longer checks ipending on way out of ISR. sio made MP-safe (I hope).
* Use CS_SECURE macro.charnier1997-08-181-5/+5
| | | | Reviewed by: John Dyson
* Back out a part of the disk scheduling "improvements" :-(. Let me knowdyson1997-08-121-2/+2
| | | | how the system works now!!!
* Modify the scheduling policy to take into account disk I/O waitsdyson1997-08-091-1/+14
| | | | | | as chargeable CPU usage. This should mitigate the problem of processes doing disk I/O hogging the CPU. Various users have reported the problem, and test code shows that the problem should now be gone.
* VM86 kernel support.dyson1997-08-091-5/+20
| | | | | | | Work done by BSDI, Jonathan Lemon <jlemon@americantv.com>, Mike Smith <msmith@gsoft.com.au>, Sean Eric Fagan <sef@kithrup.com>, and probably alot of others. Submitted by: Jnathan Lemon <jlemon@americantv.com>
* Removed unused #includes.bde1997-07-201-5/+1
|
* Preliminary support for per-cpu data pages.peter1997-06-221-15/+4
| | | | | | | | | | | | | | | | This eliminates a lot of #ifdef SMP type code. Things like _curproc reside in a data page that is unique on each cpu, eliminating the expensive macros like: #define curproc (SMPcurproc[cpunumber()]) There are some unresolved bootstrap and address space sharing issues at present, but Steve is waiting on this for other work. There is still some strictly temporary code present that isn't exactly pretty. This is part of a larger change that has run into some bumps, this part is standalone so it should be safe. The temporary code goes away when the full idle cpu support is finished. Reviewed by: fsmp, dyson
* Preserve %fs and %gs across context switches. This has a relatively lowbde1997-06-071-1/+20
| | | | | | | cost since it is only done in cpu_switch(), not for every exception. The extra state is kept in the pcb, and handled much like the npx state, with similar deficiencies (the state is not preserved across signal handlers, and error handling loses state).
* Move interrupt handling code from isa.c to a new file. This should makedfr1997-06-021-2/+2
| | | | | | | isa.c (slightly) more portable and will make my life developing the really portable version much easier. Reviewed by: peter, fsmp
* Include file updates.. <machine/spl.h> -> <machine/ipl.h>, addpeter1997-05-311-1/+2
| | | | | <machine/ipl.h> to those files that were depending on getting SWI_* implicitly via <machine/cpufunc.h>
* remove opt_smp.h and fix the reason it was needed.peter1997-05-291-3/+2
|
* md_regs is now a struct trapframe *peter1997-05-071-3/+3
|
* Make sure that *fork() always returns with %edx == 1 in thedyson1997-05-051-1/+2
| | | | | child. This was sometimes not happening correctly during my threads code work.
* Man the liferafts! Here comes the long awaited SMP -> -current merge!peter1997-04-261-1/+20
| | | | | | | | | | | | | | | | There are various options documented in i386/conf/LINT, there is more to come over the next few days. The kernel should run pretty much "as before" without the options to activate SMP mode. There are a handful of known "loose ends" that need to be fixed, but have been put off since the SMP kernel is in a moderately good condition at the moment. This commit is the result of the tinkering and testing over the last 14 months by many people. A special thanks to Steve Passe for implementing the APIC code!
* Fixed printing of registers in dbflalt_handler(). The registersbde1997-04-141-9/+7
| | | | | | | were always in a tss; that tss just changed from the one in the pcb to common_tss (who knows where it was when there was no curpcb?). Not using the pcb also fixed the problem that there is no pcb in idle(), so we now always get useful register values.
* The biggie: Get rid of the UPAGES from the top of the per-process addresspeter1997-04-071-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | space. (!) Have each process use the kernel stack and pcb in the kvm space. Since the stacks are at a different address, we cannot copy the stack at fork() and allow the child to return up through the function call tree to return to user mode - create a new execution context and have the new process begin executing from cpu_switch() and go to user mode directly. In theory this should speed up fork a bit. Context switch the tss_esp0 pointer in the common tss. This is a lot simpler since than swithching the gdt[GPROC0_SEL].sd.sd_base pointer to each process's tss since the esp0 pointer is a 32 bit pointer, and the sd_base setting is split into three different bit sections at non-aligned boundaries and requires a lot of twiddling to reset. The 8K of memory at the top of the process space is now empty, and unmapped (and unmappable, it's higher than VM_MAXUSER_ADDRESS). Simplity the pmap code to manage process contexts, we no longer have to double map the UPAGES, this simplifies and should measuably speed up fork(). The following parts came from John Dyson: Set PG_G on the UPAGES that are now in kernel context, and invalidate them when swapping them out. Move the upages object (upobj) from the vmspace to the proc structure. Now that the UPAGES (pcb and kernel stack) are out of user space, make rfork(..RFMEM..) do what was intended by sharing the vmspace entirely via reference counting rather than simply inheriting the mappings.
* No longer use an i386tss as the basis of our pcb - it wasn't particularlypeter1997-04-071-4/+4
| | | | | | | | | | | | | | | | convenient and makes life difficult for my next commit. We still need an i386tss to point to for the tss slot in the gdt, so we use a common tss shared between all processes. Note that this is going to break debugging until this series of commits is finished. core dumps will change again too. :-( we really need a more modern core dump format that doesn't depend on the pcb/upages. This change makes VM86 mode harder, but the following commits will remove a lot of constraints for the VM86 system, including the possibility of extending the pcb for an IO port map etc. Obtained from: bde
* Fix the gdb executable modify problem. Thanks to the detective workdyson1997-04-061-7/+7
| | | | | | | | | | | | by Alan Cox <alc@cs.rice.edu>, and his description of the problem. The bug was primarily in procfs_mem, but the mistake likely happened due to the lack of vm system support for the operation. I added better support for selective marking of page dirty flags so that vm_map_pageable(wiring) will not cause this problem again. The code in procfs_mem is now less bogus (but maybe still a little so.)
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* This is the kernel Lite/2 commit. There are some requisite userlanddyson1997-02-101-1/+1
| | | | | | | | | | | | | | | changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu <hsu@freebsd.org>
* Remove some dead code from trapwrite.dyson1997-01-231-3/+1
| | | | Submitted by: Stephen McKay <syssgm@devetir.qld.gov.au>
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Only handle copyin/out/etc faults when not in an interrupt handler.bde1996-12-181-8/+9
| | | | | | This makes unexpected faults (in an interrupt handler) more likely to crash properly. It could be done even better (more robustly and more efficiently) using lazy fault handling.
* Updated #includes to 4.4Lite style.bde1996-09-101-3/+3
|
* Change an splclock that needs to be an splhigh into an splhigh.dg1996-09-011-2/+2
| | | | Reviewed by: bde
* 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...
OpenPOWER on IntegriCloud