summaryrefslogtreecommitdiff
path: root/sys/kern/subr_smp.c
Commit message (Collapse)AuthorAgeFilesLines
* Staticize.Eivind Eklund1998-02-091-5/+7
| | | | Notes: svn path=/head/; revision=33181
* Add support for low resolution SMP kernel profiling.Tor Egge1997-12-151-1/+6
| | | | | | | | | | | | | | | - A nonprofiling version of s_lock (called s_lock_np) is used by mcount. - When profiling is active, more registers are clobbered in seemingly simple assembly routines. This means that some callers needed to save/restore extra registers. - The stack pointer must have space for a 'fake' return address in idle, to avoid stack underflow. Notes: svn path=/head/; revision=31723
* Don't forward hardclock or statclock to stopped cpus. Disable forwardingTor Egge1997-12-151-10/+17
| | | | | | | when a panic has occured. Notes: svn path=/head/; revision=31720
* Add needed #include.Tor Egge1997-12-121-1/+4
| | | | | | | Problem found by: Bruce Evans <bde@zeta.org.au> Notes: svn path=/head/; revision=31689
* The improvements to clock statistics by Tor EggeSteve Passe1997-12-081-1/+315
| | | | | | | | | | Wrappered and enabled by the define BETTER_CLOCK (on by default in smpyests.h) Reviewed by: smp@csn.net Submitted by: Tor Egge <Tor.Egge@idi.ntnu.no> Notes: svn path=/head/; revision=31639
* Use UPAGES when setting up private pages for SMP (which includes idle stack).Tor Egge1997-11-071-7/+7
| | | | Notes: svn path=/head/; revision=31030
* Removed unused #includes.Bruce Evans1997-10-281-2/+1
| | | | Notes: svn path=/head/; revision=30813
* Try and fix some style problemsPeter Wemm1997-10-121-15/+18
| | | | Notes: svn path=/head/; revision=30343
* Convert the VM86 option from a global option to an option only dependedPeter Wemm1997-10-101-1/+2
| | | | | | | | on by the files that use it. Changing the VM86 option now only causes a recompile of a dozen files or so rather than the entire kernel. Notes: svn path=/head/; revision=30265
* It is possible that MB's with really broken bios's not set up more ofJohn Dyson1997-10-061-0/+8
| | | | | | | the mtrr registers. This just fills in more of the registers. Notes: svn path=/head/; revision=30136
* Make sure that the memory type registers are the same for each CPUJohn Dyson1997-10-051-1/+53
| | | | | | | | | in a P6 SMP system. Some MB bios'es don't set the registers up correctly for the AP's. Additionally, set the memory between 0xa0000 and 0xbffff as write combining. Notes: svn path=/head/; revision=30112
* Implement the parts needed for VM86 under SMP.Peter Wemm1997-09-211-7/+11
| | | | Notes: svn path=/head/; revision=29663
* Add support for more than 1 page of idle process stack on SMP systems.John Dyson1997-09-211-14/+24
| | | | Notes: svn path=/head/; revision=29655
* General cleanup of the lock pushdown code. They are grouped and enabledSteve Passe1997-09-071-9/+13
| | | | | | | | | | | | from machine/smptests.h: #define PUSHDOWN_LEVEL_1 #define PUSHDOWN_LEVEL_2 #define PUSHDOWN_LEVEL_3 #define PUSHDOWN_LEVEL_4_NOT Notes: svn path=/head/; revision=29213
* Cleanup.Steve Passe1997-09-011-8/+10
| | | | Notes: svn path=/head/; revision=28999
* Move closer to supporting VM86 under SMP.Bruce Evans1997-09-011-1/+9
| | | | | | | | | LINT now compiles but doesn't link. Other link-time breakage for LINT is now visible (SMP is incompatible with SIMPLELOCK_DEBUG). Submitted by: jlemon Notes: svn path=/head/; revision=28984
* Debug version of simple_lock. This will store the CPU id of theSteve Passe1997-08-311-20/+11
| | | | | | | | | | | | | holding CPU along with the lock. When a CPU fails to get the lock it compares its own id to the holder id. If they are the same it panic()s, as simple locks are binary, and this would cause a deadlock. Controlled by smptests.h: SL_DEBUG, ON by default. Some minor cleanup. Notes: svn path=/head/; revision=28951
* Another round of lock pushdown.Steve Passe1997-08-301-3/+19
| | | | | | | | | | | | Add a simplelock to deal with disable_intr()/enable_intr() as used in UP kernel. UP kernel expects that this is enough to guarantee exclusive access to regions of code bracketed by these 2 functions. Add a simplelock to bracket clock accesses in clock.c: clock_lock. Help from: Bruce Evans <bde@zeta.org.au> Notes: svn path=/head/; revision=28921
* Correct some things I forgot about until it was too late with smp_active.Peter Wemm1997-08-261-4/+7
| | | | | | | | | | smp_active = 1 used to indicate that the system had frozen previously started AP's, while smp_active = 0 was "AP's not yet started". I have split this into smp_started (which is set when the AP's come online), and smp_active is left for turning on/off AP scheduling. Notes: svn path=/head/; revision=28809
* Clean up the SMP AP bootstrap and eliminate the wretched idle procs.Peter Wemm1997-08-261-34/+140
| | | | | | | | | | | | | | | | | | | | | | | - 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. Notes: svn path=/head/; revision=28808
* Removed a bogus comment.Bruce Evans1997-08-251-2/+2
| | | | Notes: svn path=/head/; revision=28743
* A clean fix for the spl "deadlock before smp_active" problem.Steve Passe1997-08-241-1/+3
| | | | | | | | | | | Added a new variable, 'bsp_apic_ready', which is set as soon as the bootstrap CPU has initialized its local APIC. Conditionalize the GENSPLR functions to call ss_lock ONLY after bsp_apic_ready is TRUE; This should prevent any problems with races between the time the 1st AP becomes ready and the time smp_active is set. Notes: svn path=/head/; revision=28669
* Made PEND_INTS default.Steve Passe1997-08-211-1/+13
| | | | | | | | | | | | | Made NEW_STRATEGY default. Removed misc. old cruft. Centralized simple locks into mp_machdep.c Centralized simple lock macros into param.h More cleanup in the direction of making splxx()/cpl MP-safe. Notes: svn path=/head/; revision=28487
* Preperation for moving cpl into critical region access.Steve Passe1997-08-201-1/+20
| | | | | | | | | | | 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). Notes: svn path=/head/; revision=28442
* Cheap fix for kern/4255.Steve Passe1997-08-101-4/+10
| | | | | | | If the problem is seen this fix suggests a compile-time work-around then panics. Notes: svn path=/head/; revision=28041
* Some fixes towards making "default configs" work again.Steve Passe1997-08-091-13/+15
| | | | | | | | | Still not fixed, no idea why. Debug help from: "Thomas D. Dean" <tomdean@ix.netcom.com> Notes: svn path=/head/; revision=28027
* Converted the TEST_LOPRIO code to default.Steve Passe1997-07-311-2/+2
| | | | | | | | Created mplock functions that save/restore NO registers. Minor cleanup. Notes: svn path=/head/; revision=27780
* Modified the PEND_INTS algorithm to fix the ISA INT loss problem.Steve Passe1997-07-281-4/+4
| | | | | | | Noticed by: dave adkins <adkin003@gold.tc.umn.edu> and others. Notes: svn path=/head/; revision=27728
* mpapic.c & mp_machdep:Steve Passe1997-07-261-13/+2
| | | | | | | | | | | | | - removed TEST_ALTTIMER. - removed APIC_PIN0_TIMER. - removed TIMER_ALL. mplock.s: - minor update of try_mplock for new algorithm where a CPU uses try_mplock instead of get_mplock in the ISRs. Notes: svn path=/head/; revision=27697
* New simple_lock code in asm:Steve Passe1997-07-231-10/+22
| | | | | | | | | | | | | | | | | | - s_lock_init() - s_lock() - s_lock_try() - s_unlock() Created lock for IO APIC and apic_imen (SMP version of imen) - imen_lock Code to use imen_lock for access from apic_ipl.s and apic_vector.s. Moved this code *outside* of mp_lock. It seems to work!!! Notes: svn path=/head/; revision=27634
* Developed a new strategy for handling the 8254/8259/APIC issue.Steve Passe1997-07-201-3/+5
| | | | Notes: svn path=/head/; revision=27563
* Minor cleanup.Steve Passe1997-07-201-3/+3
| | | | | | | | Pass string arg to apic_dump. Moved bootverbose printing of SMP enabled INTs from clock.c to autoconf.c Notes: svn path=/head/; revision=27561
* Removed unused #includes.Bruce Evans1997-07-201-6/+1
| | | | Notes: svn path=/head/; revision=27535
* Added code to support #define APIC_PIN0_TIMER.Steve Passe1997-07-191-2/+6
| | | | | | | | This code ALWAYS runs the 8254 timer thru the 8259 ICU. It depricates the usage of "options SMP_TIMER_NC" in the config file. Notes: svn path=/head/; revision=27523
* Split TEST_CPUSTOP code into CPUSTOP_ON_DDBBREAK and mainline code.Steve Passe1997-07-181-34/+3
| | | | Notes: svn path=/head/; revision=27517
* printf cleanup.Steve Passe1997-07-181-3/+3
| | | | Notes: svn path=/head/; revision=27489
* Hopefully fix a few problems that could cause hangs in SMP mode.John Dyson1997-07-171-1/+5
| | | | | | | | | | | | | | | 1) Make sure that the region mapped by a 4MB page is properly aligned. 2) Don't turn on the PG_G flag in locore for SMP. I plan to do that later in startup anyway. 3) Make sure the 2nd processor has PSE enabled, so that 4MB pages don't hose it. We don't use PG_G yet on SMP -- there is work to be done to make that work correctly. It isn't that important anyway... Notes: svn path=/head/; revision=27484
* new code to control other CPUs: stop_cpus()/restart_cpus()/_XstopcpuSteve Passe1997-07-131-64/+23
| | | | | | | | | | this code is controlled by smptests.h: TEST_CPUSTOP, OFF by default new code for handling mixed-mode 8259/APIC programming without 'ExtInt' this code is controlled by smptests.h: TEST_ALTTIMER, ON by default Notes: svn path=/head/; revision=27353
* General cleanup of APIC code.Steve Passe1997-07-081-44/+46
| | | | | | | stop_cpus()/restart_cpus() STILL not working! Notes: svn path=/head/; revision=27289
* stop_cpus(), currently BROKEN! (turned off in smptests.h by default).Steve Passe1997-07-071-10/+59
| | | | | | | restart_cpus(), currently BROKEN! (turned off in smptests.h by default). Notes: svn path=/head/; revision=27255
* Added POST code output to various points of the startup code.Steve Passe1997-06-271-20/+173
| | | | | | | | | | | | | | | General cleanup. New functions to stop/start CPUs via IPIs: - int stop_cpus( u_int map ); - int restart_cpus( u_int map ); Turned off by default, enabled via smptests.h:TEST_CPUSTOP. Current version has a BUG, perhaps a deadlock? Notes: svn path=/head/; revision=27005
* Program lint1 to handle NMIs.Steve Passe1997-06-271-2/+24
| | | | | | | | | Till now NMIs would be ignored. Now an NMI is caught by the BSP. APs still ignore NMI, am working on code to allow a CPU to stop other CPUs via an IPI. Notes: svn path=/head/; revision=27001
* Merged/renamed functions:Steve Passe1997-06-251-82/+56
| | | | | | | | | - get_isa_apic_mask() -> isa_apic_mask() - get_isa_apic_irq() && get_eisa_apic_irq() -> isa_apic_pin() - get_pci_apic_irq() -> pci_apic_pin() Notes: svn path=/head/; revision=26950
* Ensure that the boot CPU honours write protection in kernel mode.Tor Egge1997-06-241-1/+9
| | | | | | | This fixes one of the problems noted in PR kern/3688. Notes: svn path=/head/; revision=26896
* Fix calculation of initial mplock value.Steve Passe1997-06-241-2/+2
| | | | | | | We now use LOGICAL, not PHYSICAL, IDs to calculate the mplock. Notes: svn path=/head/; revision=26886
* Fixed breakage for "default" configurations in mptable_pass1().Steve Passe1997-06-241-2/+2
| | | | Notes: svn path=/head/; revision=26882
* Preliminary support for per-cpu data pages.Peter Wemm1997-06-221-45/+109
| | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=26812
* Change isa_device.h to intr_machdep.hDoug Rabson1997-06-021-2/+2
| | | | Notes: svn path=/head/; revision=26379
* Code such as apic_base[APIC_ID] converted to lapic__idSteve Passe1997-05-291-16/+16
| | | | | | | | | Changes to pmap.c for lapic_t lapic && ioapic_t ioapic pointers, currently equal to apic_base && io_apic_base, will stand alone with the private page mapping. Notes: svn path=/head/; revision=26270
* minor style police (recent divergence from KNF code)Peter Wemm1997-05-291-5/+5
| | | | Notes: svn path=/head/; revision=26266