summaryrefslogtreecommitdiffstats
path: root/sys/amd64
Commit message (Collapse)AuthorAgeFilesLines
* Initialize mutexes needed early on all in the same place so that thejhb2001-06-181-15/+6
| | | | | | startup routine more closely matches that of alpha and ia64. At some point the common mutexes shared across all platforms probably should move into sys/kern_mutex.c.
* - Add support for decoding syscall names. (Brought over from the new alphajhb2001-06-181-37/+61
| | | | | | | | | | | | trace code that was brought over from NetBSD.) - Check for "syscall_with_err_pushed" as the label prior to a syscall trap frame rather than "Xlcall_syscall" and "Xint0x80_syscall". We don't have a valid trapframe during the short range of code that those two symbols now cover. - Simplify db_next_frame() to avoid duplicating the code for the different trap frame types. - Don't try to trace a swapped-out process. (Brought over from NetBSD via the new alpha trace code.)
* Include sys/pcpu.h to get the prototype for globaldata_register() to quietjhb2001-06-183-0/+3
| | | | a warning.
* Don't assume that resource type is ioport and rid equal 0.nyan2001-06-171-5/+6
|
* Fix "alignemnt" typo.alex2001-06-163-3/+3
|
* Fix warnings:peter2001-06-152-6/+6
| | | | | 908: warning: long unsigned int format, unsigned int arg (arg 3) 887: warning: `timezero' defined but not used
* Hints overhaul:peter2001-06-122-3/+3
| | | | | | | | | - Replace some very poorly thought out API hacks that should have been fixed a long while ago. - Provide some much more flexible search functions (resource_find_*()) - Use strings for storage instead of an outgrowth of the rather inconvenient temporary ioconf table from config(). We already had a fallback to using strings before malloc/vm was running anyway.
* Fix style of defines.obrien2001-06-091-38/+38
|
* Don't hold sched_lock across addupc_task().jhb2001-06-061-1/+1
| | | | | Reported by: David Taylor <davidt@yadt.co.uk> Submitted by: bde
* Properly wrap mtx_intr_enable() macro in "do $bla while (0)"phk2001-06-021-1/+1
|
* Clean up the code exporting interrupt statistics via sysctl a bit:tmm2001-06-016-7/+2
| | | | | | | | | | | | | - move the sysctl code to kern_intr.c - do not use INTRCNT_COUNT, but rather eintrcnt - intrcnt to determine the length of the intrcnt array - move the declarations of intrnames, eintrnames, intrcnt and eintrcnt from machine-dependent include files to sys/interrupt.h - remove the hw.nintr sysctl, it is not needed. - fix various style bugs Requested by: bde Reviewed by: bde (some time ago)
* Quiet warnings by adding a prototype for set_user_ldt_rv() and making itjhb2001-05-301-1/+6
| | | | conditional on #ifdef SMP.
* We can't grab the sched_lock in set_user_ldt() because when it is calledjhb2001-05-302-6/+25
| | | | | | | | | | | from cpu_switch(), curproc has been changed, but the sched_lock owner will not be updated until we return to mi_switch(), thus we deadlock against ourselves. As a workaround, push the acquire and release of sched_lock out to the callers of set_user_ldt(). Note that we can't use a mtx_assert() in set_user_ldt for the same reason. Sleuting by: tmm Tested by: tmm, dougb
* move wx to be part of miibus requiring chipsetsmjacob2001-05-301-1/+1
|
* Remove MFS options from all example kernel configs.phk2001-05-291-1/+0
|
* Remove pcm hints here now that it's gone from GENERIC.jkh2001-05-261-4/+0
| | | | Reminded-by: bde
* Take pcm (audio) back out of GENERIC; there appears to be somejkh2001-05-251-3/+0
| | | | | | | concensus, most notably among the maintainers, that it's better loaded as a module. Finally-pushed-over-the-edge-by-the-anguished-cries-of: rwatson
* Don't acquire Giant just to call trap_fatal(), we are about to panicjhb2001-05-231-4/+0
| | | | | anyway so we'd rather see the printf's then block if the system is hosed.
* pmap_mapdev needs the vm_mtx, aquire it if not already lockedalfred2001-05-231-0/+8
|
* lock vm while playing with pmapalfred2001-05-231-0/+9
|
* Convert npx interrupts into traps instead of vice versa. This is muchbde2001-05-228-214/+187
| | | | | | | | simpler for npx exceptions that start as traps (no assembly required...) and works better for npx exceptions that start as interrupts (there is no longer a problem for nested interrupts). Submitted by: original (pre-SMPng) version by luoqi
* Remove a few more spl's I missed earlier.jhb2001-05-221-2/+0
| | | | | Reported by: Michael Harnois <mdharnois@home.com> Pointy hat: me
* Sort includes.jhb2001-05-212-2/+2
|
* Axe unneeded spl()'s.jhb2001-05-211-3/+0
|
* Throw away the complications in npxsave() and their infrastructure.bde2001-05-202-106/+46
| | | | | | | | | | | | npxsave() went to great lengths to excecute fnsave with interrupts enabled in case executing it froze the CPU. This case can't happen, at least for Intel CPU/NPX's. Spurious IRQ13's don't imply spurious freezes. Anyway, the complications were usually no-ops because IRQ13 is not used on i486's and newer CPUs, and because SMPng broke them in rev.1.84. Forcible enabling of interrupts was changed to write_eflags(old_eflags), but since SMPng usually calls npxsave() from cpu_switch() with interrupts disabled, write_eflags() usually just kept interrupts disabled.
* Use a critical region to protect almost everything in npxinit().bde2001-05-202-0/+12
| | | | | | | | | | | npxinit() didn't have the usual race because it doesn't save to curpcb, but it may have had a worse form of it since it uses the npx when it doesn't "own" it. I'm not sure if locking prevented this. npxinit() is normally caled with the proc lock but not sched_lock. Use a critical region to protect pushing of curproc's npx state to curpcb in npxexit(). Not doing so was harmless since it at worst saved a wrong state to a dieing pcb.
* Use a critical region to protect saving of the npx state in savectx().bde2001-05-202-2/+8
| | | | | | | | Not doing this was fairly harmless because savectx() is only called for panic dumps and the bug could at worse reset the state. savectx() is still missing saving of (volatile) debug registers, and still isn't called for core dumps.
* Introduce a global lock for the vm subsystem (vm_mtx).alfred2001-05-196-15/+45
| | | | | | | | | | | | | | | | | | | vm_mtx does not recurse and is required for most low level vm operations. faults can not be taken without holding Giant. Memory subsystems can now call the base page allocators safely. Almost all atomic ops were removed as they are covered under the vm mutex. Alpha and ia64 now need to catch up to i386's trap handlers. FFS and NFS have been tested, other filesystems will need minor changes (grabbing the vm lock when twiddling page properties). Reviewed (partially) by: jake, jhb
* - Move the setting of bootverbose to a MI SI_SUB_TUNABLES SYSINIT.jhb2001-05-171-5/+1
| | | | | | | | - Attach a writable sysctl to bootverbose (debug.bootverbose) so it can be toggled after boot. - Move the printf of the version string to a SI_SUB_COPYRIGHT SYSINIT just afer the display of the copyright message instead of doing it by hand in three MD places.
* - Axe the IMEN_BITS and APIC_IMEN_BITS constants.jhb2001-05-171-4/+3
| | | | | | - Add back in a definition of NHWI which is preferred over ICU_LEN. Submitted by: bde
* Remove unneeded includes of sys/ipl.h and machine/ipl.h.jhb2001-05-1517-17/+0
|
* Move the definition of HWI_MASK to the i386/isa/icu.h header right next tojhb2001-05-151-0/+2
| | | | the definition of ICU_LEN.
* - Use ICU_LEN rather than NHWI for the size of the array of ithreads.jhb2001-05-151-2/+1
| | | | - Remove unneeded include of sys/ipl.h.
* Convert DEVFS from an "opt-in" to an "opt-out" option.phk2001-05-131-1/+0
| | | | | | | | | If for some reason DEVFS is undesired, the "NODEVFS" option is needed now. Pending any significant issues, DEVFS will be made mandatory in -current on july 1st so that we can start reaping the full benefits of having it.
* Use a critical region to protect pushing of the parent's npx state to thebde2001-05-131-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | pcb for fork(). It was possible for the state to be saved twice when an interrupt handler saved it concurrently. This corrupted (reset) the state because fnsave has the (in)convenient side effect of doing an implicit fninit. Mundane null pointer bugs were not possible, because we save to an "arbitrary" process's pcb and not to the "right" place (npxproc). Push the parent's %gs to the pcb for fork(). Changes to %gs before fork() were not preserved in the child unless an accidental context switch did the pushing. Updated the list of pcb contents which is supposed to inhibit bugs like this. pcb_dr*, pcb_gs and pcb_ext were missing. Copying is correct for pcb_dr*, and pcb_ext is already handled specially (although XXX'ly). Reducing the savectx() call to an npxsave() call in rev.1.80 was a mistake. The above bugs are duplicated in many places, including in savectx() itself. The arbitraryness of the parent process pointer for the fork() subroutines, the pcb pointer for savectx(), and the save87 pointer for npxsave(), is illusory. These functions don't work "right" unless the pointers are precisely curproc, curpcb, and the address of npxproc's save87 area, respectively, although the special context in which they are called allows savectx(&dumppcb) to sort of work and npxsave(&dummy) to work. cpu_fork() just doesn't work unless the parent process pointer is curproc, or the caller has pushed %gs to the pcb, or %gs happens to already be in the pcb.
* Revert part of last commit. Instead of using %fs for KSD/TSD, we'lldeischen2001-05-121-0/+1
| | | | | | follow Linux' convention and use %gs. This adds back the setting of %fs to a sane value in sendsig(). The value of %gs remains preserved to whatever it was in user context.
* Simplify the vm fault trap handling code a bit by using if-else instead ofjhb2001-05-111-29/+15
| | | | | duplicating code in the then case and then using a goto to jump around the else case.
* Un-swap irq/link byte values so that printf works.msmith2001-05-111-1/+1
|
* - Split out the support for per-CPU data from the SMP code. UP kernelsjhb2001-05-102-3/+3
| | | | | | | have per-CPU data and gdb on the i386 at least needs access to it. - Clean up includes in kern_idle.c and subr_smp.c. Reviewed by: jake
* - Use sched_lock and critical regions to ensure that LDT updates are threadjhb2001-05-103-31/+50
| | | | | | | safe from preemption and concurrent access to the LDT. - Move the prototype for i386_extend_pcb() to <machine/pcb_ext.h>. Reviewed by: silence on -hackers
* When setting up the frame to invoke a signal handler, preserve thedeischen2001-05-061-2/+0
| | | | | | | | | | | | | | | %fs and %gs registers instead of setting them to known sane values. %fs is going to be used for thread/KSE specific data by the new threads library; we'll want it to be valid inside of signal handlers. According to bde, Linux preserves the state of %fs and %gs when setting up signal handlers, so there is precedent for doing this. The same changes should be made in the Linux emulator, but when made, they seem to break (at least one version of) the IBM JDK for Linux (reported by drew). Approved by: bde
* Fixed panics in npx exception handling. When using IRQ13 exceptionbde2001-05-022-14/+36
| | | | | | | | | | | | | | | | | | handling, SMPng always switches the npx context away from curproc before calling the handler, so the handler always paniced. When using exception 16 exception handling, SMPng sometimes switches the npx context away from curproc before calling the handler, so the handler sometimes paniced. Also, we didn't lock the context while using it, so we sometimes didn't detect the switch and then paniced in a less controlled way. Just lock the context while using it, and return without doing anything except clearing the busy latch if the context is not for curproc. This fixes the exception 16 case and makes the IRQ13 case harmless. In both cases, the instruction that caused the exception is restarted and the exception repeats. In the exception 16 case, we soon get an exception that can be handled without doing anything special. In the IRQ13 case, we get an easy to kill hung process.
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-019-58/+63
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* Revert consequences of changes to mount.h, part 2.grog2001-04-292-4/+0
| | | | Requested by: bde
* Add in a missing call to forward_hardclock() in the SMP case.jhb2001-04-282-0/+6
| | | | Submitted by: bde
* Overhaul of the SMP code. Several portions of the SMP kernel support havejhb2001-04-2716-1839/+302
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | been made machine independent and various other adjustments have been made to support Alpha SMP. - It splits the per-process portions of hardclock() and statclock() off into hardclock_process() and statclock_process() respectively. hardclock() and statclock() call the *_process() functions for the current process so that UP systems will run as before. For SMP systems, it is simply necessary to ensure that all other processors execute the *_process() functions when the main clock functions are triggered on one CPU by an interrupt. For the alpha 4100, clock interrupts are delievered in a staggered broadcast fashion, so we simply call hardclock/statclock on the boot CPU and call the *_process() functions on the secondaries. For x86, we call statclock and hardclock as usual and then call forward_hardclock/statclock in the MD code to send an IPI to cause the AP's to execute forwared_hardclock/statclock which then call the *_process() functions. - forward_signal() and forward_roundrobin() have been reworked to be MI and to involve less hackery. Now the cpu doing the forward sets any flags, etc. and sends a very simple IPI_AST to the other cpu(s). AST IPIs now just basically return so that they can execute ast() and don't bother with setting the astpending or needresched flags themselves. This also removes the loop in forward_signal() as sched_lock closes the race condition that the loop worked around. - need_resched(), resched_wanted() and clear_resched() have been changed to take a process to act on rather than assuming curproc so that they can be used to implement forward_roundrobin() as described above. - Various other SMP variables have been moved to a MI subr_smp.c and a new header sys/smp.h declares MI SMP variables and API's. The IPI API's from machine/ipl.h have moved to machine/smp.h which is included by sys/smp.h. - The globaldata_register() and globaldata_find() functions as well as the SLIST of globaldata structures has become MI and moved into subr_smp.c. Also, the globaldata list is only available if SMP support is compiled in. Reviewed by: jake, peter Looked over by: eivind
* Remove a leading underscore that prevented I386_CPU kernels fromjake2001-04-262-2/+2
| | | | | | | compiling. Submitted by: Alexander N. Kabaev <ak03@gte.com> PR: kern/26858
* Correct #includes to work with fixed sys/mount.h.grog2001-04-232-0/+4
|
* Make the ap_boot_mtx mutex static.jhb2001-04-203-3/+3
|
* Split up the db_printf's for 'show pcpu' so that we only output at most onejhb2001-04-201-2/+4
| | | | | line for each db_printf(). Also, just use spaces to line the columns up rather than trying to be fancy with tabs.
OpenPOWER on IntegriCloud