aboutsummaryrefslogtreecommitdiff
path: root/sys/alpha
Commit message (Collapse)AuthorAgeFilesLines
...
* Reimplement the reclamation of PV entries. Specifically, performAlan Cox2005-11-091-30/+41
| | | | | | | | | | | | | | | | | | | | | reclamation synchronously from get_pv_entry() instead of asynchronously as part of the page daemon. Additionally, limit the reclamation to inactive pages unless allocation from the PV entry zone or reclamation from the inactive queue fails. Previously, reclamation destroyed mappings to both inactive and active pages. get_pv_entry() still, however, wakes up the page daemon when reclamation occurs. The reason being that the page daemon may move some pages from the active queue to the inactive queue, making some new pages available to future reclamations. Print the "reclaiming PV entries" message at most once per minute, but don't stop printing it after the fifth time. This way, we do not give the impression that the problem has gone away. Reviewed by: tegge Notes: svn path=/head/; revision=152224
* Add uart(4). When both sio(4) and uart(4) can handle a serial port,Marcel Moolenaar2005-11-051-2/+3
| | | | | | | | | | | sio(4) will claim it. This change therefore only affects how ports are handled when they are not claimed by sio(4), and in principle will improve hardware support. MFC after: 2 months Notes: svn path=/head/; revision=152102
* Begin and end the initialization of pvzone in pmap_init().Alan Cox2005-11-041-17/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, pvzone's initialization was split between pmap_init() and pmap_init2(). This split initialization was the underlying cause of some UMA panics during initialization. Specifically, if the UMA boot pages was exhausted before the pvzone was fully initialized, then UMA, through no fault of its own, would use an inappropriate back-end allocator leading to a panic. (Previously, as a workaround, we have increased the UMA boot pages.) Fortunately, there is no longer any reason that pvzone's initialization cannot be completed in pmap_init(). Eliminate a check for whether pv_entry_high_water has been initialized or not from get_pv_entry(). Since pvzone's initialization is completed in pmap_init(), this check is no longer needed. Use cnt.v_page_count, the actual count of available physical pages, instead of vm_page_array_size to compute the maximum number of pv entries. Introduce the vm.pmap.pv_entries tunable on alpha and ia64. Eliminate some unnecessary white space. Discussed with: tegge (item #1) Tested by: marcel (ia64) Notes: svn path=/head/; revision=152042
* Add stoppcbs[] arrays on Alpha and sparc64 and have each CPU save itsJohn Baldwin2005-11-032-4/+7
| | | | | | | | | | | current context in the IPI_STOP handler so that we can get accurate stack traces of threads on other CPUs on these two archs like we do now on i386 and amd64. Tested on: alpha, sparc64 Notes: svn path=/head/; revision=152022
* Instead of a panic()ing in pmap_insert_entry() if get_pv_entry() fails,Alan Cox2005-11-021-1/+50
| | | | | | | reclaim a pv entry by destroying a mapping to an inactive page. Notes: svn path=/head/; revision=151964
* MFamd64/i386Alan Cox2005-10-311-7/+0
| | | | | | | Eliminate unneeded diagnostic code. Notes: svn path=/head/; revision=151898
* Reorganize the interrupt handling code a bit to make a few things cleanerJohn Baldwin2005-10-252-34/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and increase flexibility to allow various different approaches to be tried in the future. - Split struct ithd up into two pieces. struct intr_event holds the list of interrupt handlers associated with interrupt sources. struct intr_thread contains the data relative to an interrupt thread. Currently we still provide a 1:1 relationship of events to threads with the exception that events only have an associated thread if there is at least one threaded interrupt handler attached to the event. This means that on x86 we no longer have 4 bazillion interrupt threads with no handlers. It also means that interrupt events with only INTR_FAST handlers no longer have an associated thread either. - Renamed struct intrhand to struct intr_handler to follow the struct intr_foo naming convention. This did require renaming the powerpc MD struct intr_handler to struct ppc_intr_handler. - INTR_FAST no longer implies INTR_EXCL on all architectures except for powerpc. This means that multiple INTR_FAST handlers can attach to the same interrupt and that INTR_FAST and non-INTR_FAST handlers can attach to the same interrupt. Sharing INTR_FAST handlers may not always be desirable, but having sio(4) and uhci(4) fight over an IRQ isn't fun either. Drivers can always still use INTR_EXCL to ask for an interrupt exclusively. The way this sharing works is that when an interrupt comes in, all the INTR_FAST handlers are executed first, and if any threaded handlers exist, the interrupt thread is scheduled afterwards. This type of layout also makes it possible to investigate using interrupt filters ala OS X where the filter determines whether or not its companion threaded handler should run. - Aside from the INTR_FAST changes above, the impact on MD interrupt code is mostly just 's/ithread/intr_event/'. - A new MI ddb command 'show intrs' walks the list of interrupt events dumping their state. It also has a '/v' verbose switch which dumps info about all of the handlers attached to each event. - We currently don't destroy an interrupt thread when the last threaded handler is removed because it would suck for things like ppbus(8)'s braindead behavior. The code is present, though, it is just under #if 0 for now. - Move the code to actually execute the threaded handlers for an interrrupt event into a separate function so that ithread_loop() becomes more readable. Previously this code was all in the middle of ithread_loop() and indented halfway across the screen. - Made struct intr_thread private to kern_intr.c and replaced td_ithd with a thread private flag TDP_ITHREAD. - In statclock, check curthread against idlethread directly rather than curthread's proc against idlethread's proc. (Not really related to intr changes) Tested on: alpha, amd64, i386, sparc64 Tested on: arm, ia64 (older version of patch by cognet and marcel) Notes: svn path=/head/; revision=151658
* Specifically panic() in the case where pmap_insert_entry() fails toAde Lovett2005-10-211-0/+2
| | | | | | | | | | | | | | | get a new pv under high system load where the available pv entries have been exhausted before the pagedaemon has a chance to wake up to reclaim some. Prior to this, the NULL pointer dereference ended up causing secondary panics with rather less than useful resulting tracebacks. Reviewed by: alc, jhb MFC after: 1 week Notes: svn path=/head/; revision=151543
* Make ttyconsolemode() call ttsetwater() so that drivers don't have to.Poul-Henning Kamp2005-10-162-2/+0
| | | | Notes: svn path=/head/; revision=151388
* 1. Change prototype of trapsignal and sendsig to use ksiginfo_t *, mostDavid Xu2005-10-145-39/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | changes in MD code are trivial, before this change, trapsignal and sendsig use discrete parameters, now they uses member fields of ksiginfo_t structure. For sendsig, this change allows us to pass POSIX realtime signal value to user code. 2. Remove cpu_thread_siginfo, it is no longer needed because we now always generate ksiginfo_t data and feed it to libpthread. 3. Add p_sigqueue to proc structure to hold shared signals which were blocked by all threads in the proc. 4. Add td_sigqueue to thread structure to hold all signals delivered to thread. 5. i386 and amd64 now return POSIX standard si_code, other arches will be fixed. 6. In this sigqueue implementation, pending signal set is kept as before, an extra siginfo list holds additional siginfo_t data for signals. kernel code uses psignal() still behavior as before, it won't be failed even under memory pressure, only exception is when deleting a signal, we should call sigqueue_delete to remove signal from sigqueue but not SIGDELSET. Current there is no kernel code will deliver a signal with additional data, so kernel should be as stable as before, a ksiginfo can carry more information, for example, allow signal to be delivered but throw away siginfo data if memory is not enough. SIGKILL and SIGSTOP have fast path in sigqueue_add, because they can not be caught or masked. The sigqueue() syscall allows user code to queue a signal to target process, if resource is unavailable, EAGAIN will be returned as specification said. Just before thread exits, signal queue memory will be freed by sigqueue_flush. Current, all signals are allowed to be queued, not only realtime signals. Earlier patch reviewed by: jhb, deischen Tested on: i386, amd64 Notes: svn path=/head/; revision=151316
* Remove the hack to clear the owepreempt flag after running a fastJohn Baldwin2005-09-291-17/+16
| | | | | | | | | | | interrupt handler from Alpha. Instead, expand the scheduler pinning in the interrupt handling code so that curthread is pinned while executing fast interrupt handlers. MFC after: 1 week Notes: svn path=/head/; revision=150726
* Back out alpha/alpha/trap.c:1.124, osf1_ioctl.c:1.14, osf1_misc.c:1.57,Robert Watson2005-09-284-34/+6
| | | | | | | | | | | | | | | | | | | | | | | osf1_signal.c:1.41, amd64/amd64/trap.c:1.291, linux_socket.c:1.60, svr4_fcntl.c:1.36, svr4_ioctl.c:1.23, svr4_ipc.c:1.18, svr4_misc.c:1.81, svr4_signal.c:1.34, svr4_stat.c:1.21, svr4_stream.c:1.55, svr4_termios.c:1.13, svr4_ttold.c:1.15, svr4_util.h:1.10, ext2_alloc.c:1.43, i386/i386/trap.c:1.279, vm86.c:1.58, unaligned.c:1.12, imgact_elf.c:1.164, ffs_alloc.c:1.133: Now that Giant is acquired in uprintf() and tprintf(), the caller no longer leads to acquire Giant unless it also holds another mutex that would generate a lock order reversal when calling into these functions. Specifically not backed out is the acquisition of Giant in nfs_socket.c and rpcclnt.c, where local mutexes are held and would otherwise violate the lock order with Giant. This aligns this code more with the eventual locking of ttys. Suggested by: bde Notes: svn path=/head/; revision=150663
* Add a new atomic_fetchadd() primitive that atomically adds a value to aJohn Baldwin2005-09-271-0/+22
| | | | | | | | | | | | variable and returns the previous value of the variable. Tested on: i386, alpha, sparc64, arm (cognet) Reviewed by: arch@ Submitted by: cognet (arm) MFC after: 1 week Notes: svn path=/head/; revision=150627
* Replace __RMAN_RESOURCE_VISIBLE with calls to public entry pointsPoul-Henning Kamp2005-09-258-33/+28
| | | | | | | in rman module. Notes: svn path=/head/; revision=150548
* Substitute rman_get_start() for __RMAN_RESOURCE_VISIBLEPoul-Henning Kamp2005-09-251-7/+7
| | | | Notes: svn path=/head/; revision=150544
* This file never needed to see what is in the internal struct resource,Poul-Henning Kamp2005-09-251-9/+7
| | | | | | | all it needed was a call to rman_get_start(). Notes: svn path=/head/; revision=150543
* Try to avoid crashes during kernel startup by limiting the # of EISAWilko Bulte2005-09-241-0/+3
| | | | | | | | | | | | | | slots to probe. Problems have been reported in this area, lets hope this bandaid helps. !! Owners of EISA-equipped Alpha machines are requested to at least !! boot-test a 6-BETA build and report back to the Alpha list. Thanks! Approved by: re (scottl) Suggested by: ticso Notes: svn path=/head/; revision=150517
* Protect includes for kernel specific use from userland.Bernd Walter2005-09-191-0/+2
| | | | Notes: svn path=/head/; revision=150352
* Add GIANT_REQUIRED and WITNESS sleep warnings to uprintf() and tprintf(),Robert Watson2005-09-194-6/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as they both interact with the tty code (!MPSAFE) and may sleep if the tty buffer is full (per comment). Modify all consumers of uprintf() and tprintf() to hold Giant around calls into these functions. In most cases, this means adding an acquisition of Giant immediately around the function. In some cases (nfs_timer()), it means acquiring Giant higher up in the callout. With these changes, UFS no longer panics on SMP when either blocks are exhausted or inodes are exhausted under load due to races in the tty code when running without Giant. NB: Some reduction in calls to uprintf() in the svr4 code is probably desirable. NB: In the case of nfs_timer(), calling uprintf() while holding a mutex, or even in a callout at all, is a bad idea, and will generate warnings and potential upset. This needs to be fixed, but was a problem before this change. NB: uprintf()/tprintf() sleeping is generally a bad ideas, as is having non-MPSAFE tty code. MFC after: 1 week Notes: svn path=/head/; revision=150335
* Relocate direct map specs into struct alpha_chipset.Bernd Walter2005-09-1911-33/+76
| | | | | | | | Prepare for PCI Scatter-Gather map. Panic if driver tries alpha_XXX_dmamap() out of range. Notes: svn path=/head/; revision=150323
* Introduce a kernel config for the Mandatory Access Control framework.Christian S.J. Peron2005-09-181-0/+28
| | | | | | | | | | | This kernel config briefly describes some of the major MAC policies available on FreeBSD. The hope is that this will raise the awareness about MAC and get more people interested. Discussed with: scottl Notes: svn path=/head/; revision=150270
* Stop using the '+' constraint modifier with inline assembly. The '+'John Baldwin2005-09-151-36/+36
| | | | | | | | | | | | | constraint is actually only allowed for register operands. Instead, use separate input and output memory constraints. Education from: alc Reviewed by: alc Tested on: i386, alpha MFC after: 1 week Notes: svn path=/head/; revision=150182
* Add a memory barrier for PREWRITE operations to ensure all writes by theJohn Baldwin2005-09-151-0/+4
| | | | | | | | | CPU have drained before further writes to kick off the operation. MFC after: 1 week Notes: svn path=/head/; revision=150170
* Eliminate unused definitions.Alan Cox2005-09-112-8/+1
| | | | Notes: svn path=/head/; revision=150008
* Move the prototypes of db_md_set_watchpoint(), db_md_clr_watchpoint()Marcel Moolenaar2005-09-101-5/+0
| | | | | | | and db_md_list_watchpoints() to ddb/ddb.h. Notes: svn path=/head/; revision=149925
* Pass a value of type vm_prot_t to pmap_enter_quick() so that it determineAlan Cox2005-09-031-2/+2
| | | | | | | whether the mapping should permit execute access. Notes: svn path=/head/; revision=149768
* Move MINSIGSTKSZ from <machine/signal.h> to <machine/_limits.h> and renameStefan Farfeleder2005-08-202-8/+6
| | | | | | | | | | | | | it to __MINSIGSTKSZ. Define MINSIGSTKSZ in <sys/signal.h>. This is done in order to use MINSIGSTKSZ for the macro PTHREAD_STACK_MIN in <pthread.h> (soon <limits.h>) without having to include the whole <sys/signal.h> header. Discussed with: bde Notes: svn path=/head/; revision=149337
* Add hints for uart(4). These are the same as for sio(4) and make itMarcel Moolenaar2005-08-061-0/+7
| | | | | | | easier to switch from sio(4) to uart(4). Notes: svn path=/head/; revision=148803
* - Add support for saving stack traces and displaying them via printf(9)Jeff Roberson2005-08-031-0/+41
| | | | | | | | | | and KTR. Contributed by: Antoine Brodin <antoine.brodin@laposte.net> Concept code from: Neal Fachan <neal@isilon.com> Notes: svn path=/head/; revision=148666
* Move MODULE_DEPEND() statements for SYSVIPC dependencies to linux_ipc.cJohn Baldwin2005-07-291-4/+1
| | | | | | | | so that they aren't duplicated 3 times and are also in the same file as the code that depends on the SYSVIPC modules. Notes: svn path=/head/; revision=148540
* Convert the atomic_ptr() operations over to operating on uintptr_tJohn Baldwin2005-07-151-61/+18
| | | | | | | | | | | | | variables rather than void * variables. This makes it easier and simpler to get asm constraints and volatile keywords correct. MFC after: 3 days Tested on: i386, alpha, sparc64 Compiled on: ia64, powerpc, amd64 Kernel toolchain busted on: arm Notes: svn path=/head/; revision=148067
* Add recently invented COMPAT_FREEBSD5 option.Ken Smith2005-07-141-0/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=147991
* Add a 'sysent' target that depends on the various files built fromJohn Baldwin2005-07-131-1/+3
| | | | | | | | | | | syscalls.master for the master list and the Alpha/OSF1 compat ABI to be consistent with all the other compat ABIs where 'make sysent' already works. MFC after: 3 days Notes: svn path=/head/; revision=147977
* Regen.John Baldwin2005-07-136-205/+205
| | | | Notes: svn path=/head/; revision=147975
* Make a pass through all the compat ABIs sychronizing the MP safe flagsJohn Baldwin2005-07-132-200/+200
| | | | | | | | | | with the master syscall table as well as marking several ABI wrapper functions safe. MFC after: 1 week Notes: svn path=/head/; revision=147974
* Validate if the value written into {FS,GS}.base is a canonicalDavid Xu2005-07-101-1/+2
| | | | | | | | | | | | address, writting non-canonical address can cause kernel a panic, by restricting base values to 0..VM_MAXUSER_ADDRESS, ensuring only canonical values get written to the registers. Reviewed by: peter, Josepha Koshy < joseph.koshy at gmail dot com > Approved by: re (scottl) Notes: svn path=/head/; revision=147889
* Some cleanups and tweaks to some of the atomic.h files in preparation forJohn Baldwin2005-07-091-91/+99
| | | | | | | | | | | | | | | | | | further changes and fixes in the future: - Use aliases via macros rather than duplicated inlines wherever possible. - Move all the aliases to the bottom of these files and the inline functions to the top. - Add various comments. - On alpha, drop atomic_{load_acq,store_rel}_{8,char,16,short}(). - On i386 and amd64, don't duplicate the extern declarations for functions in the two non-inline cases (KLD_MODULE and compiler doesn't do inlines), instead, consolidate those two cases. - Some whitespace fixes. Approved by: re (scottl) Notes: svn path=/head/; revision=147855
* - Remove spl's from osf1_usleep_thread().John Baldwin2005-07-071-8/+4
| | | | | | | | | | - Fix the calculation of the 'slept' timeval returned by osf1_usleep_thread() which has been broken since 1.1. Approved by: re (scottl) Notes: svn path=/head/; revision=147815
* Add .cvsignore files just like in sys/<arch>/compiled, this keeps CVS fromDavid E. O'Brien2005-06-201-0/+1
| | | | | | | | | questing kernel config files not in CVS. Approved by: re(kensmith) Notes: svn path=/head/; revision=147504
* Do not allocate memory based on not-checked argument from userland.Pawel Jakub Dawidek2005-06-111-6/+2
| | | | | | | | | | | | | | It can be used to panic the kernel by giving too big value. Fix it by moving allocation and size verification into kern_getfsstat(). This even simplifies kern_getfsstat() consumers, but destroys symmetry - memory is allocated inside kern_getfsstat(), but has to be freed by the caller. Found by: FreeBSD Kernel Stress Test Suite: http://www.holm.cc/stress/ Reported by: Peter Holm <peter@holm.cc> Notes: svn path=/head/; revision=147302
* Fix copy&paste bug.Pawel Jakub Dawidek2005-06-111-1/+1
| | | | Notes: svn path=/head/; revision=147299
* Introduce a procedure, pmap_page_init(), that initializes theAlan Cox2005-06-101-31/+19
| | | | | | | | | | | | | | | | | | | | | | vm_page's machine-dependent fields. Use this function in vm_pageq_add_new_page() so that the vm_page's machine-dependent and machine-independent fields are initialized at the same time. Remove code from pmap_init() for initializing the vm_page's machine-dependent fields. Remove stale comments from pmap_init(). Eliminate the Boolean variable pmap_initialized from the alpha, amd64, i386, and ia64 pmap implementations. Its use is no longer required because of the above changes and earlier changes that result in physical memory that is being mapped at initialization time being mapped without pv entries. Tested by: cognet, kensmith, marcel Notes: svn path=/head/; revision=147217
* MFP4:Joseph Koshy2005-06-091-0/+13
| | | | | | | | | | | | | | | | | | | - Implement sampling modes and logging support in hwpmc(4). - Separate MI and MD parts of hwpmc(4) and allow sharing of PMC implementations across different architectures. Add support for P4 (EMT64) style PMCs to the amd64 code. - New pmcstat(8) options: -E (exit time counts) -W (counts every context switch), -R (print log file). - pmc(3) API changes, improve our ability to keep ABI compatibility in the future. Add more 'alias' names for commonly used events. - bug fixes & documentation. Notes: svn path=/head/; revision=147191
* Avoid code duplication in serval places by introducing universalPawel Jakub Dawidek2005-06-091-44/+26
| | | | | | | | | kern_getfsstat() function. Obtained from: jhb Notes: svn path=/head/; revision=147178
* Regen after addition of linux_getpriority wrapper.Maxim Sobolev2005-06-083-4/+10
| | | | | | | | | PR: kern/81951 Submitted by: Andriy Gapon <avg@icyb.net.ua> MFC after: 1 week Notes: svn path=/head/; revision=147142
* Properly convert FreeBSD priority values into Linux values in theMaxim Sobolev2005-06-081-1/+1
| | | | | | | | | | getpriority(2) syscall. PR: kern/81951 Submitted by: Andriy Gapon <avg@icyb.net.ua> Notes: svn path=/head/; revision=147141
* Until someone who owns the various TGA-based cards has time to fix theWilko Bulte2005-06-061-1/+2
| | | | | | | | driver it is better to not include the driver in GENERIC as it panics the system on probing a TGA. Notes: svn path=/head/; revision=147050
* Rebuild generated system call definition files following the addition ofRobert Watson2005-05-306-685/+687
| | | | | | | | | | the audit event field to the syscalls.master file format. Submitted by: wsalamon Obtained from: TrustedBSD Project Notes: svn path=/head/; revision=146807
* Introduce a new field in the syscalls.master file format to hold theRobert Watson2005-05-302-757/+924
| | | | | | | | | | | | | | | | audit event identifier associated with each system call, which will be stored by makesyscalls.sh in the sy_auevent field of struct sysent. For now, default the audit identifier on all system calls to AUE_NULL, but in the near future, other BSM event identifiers will be used. The mapping of system calls to event identifiers is many:one due to multiple system calls that map to the same end functionality across compatibility wrappers, ABI wrappers, etc. Submitted by: wsalamon Obtained from: TrustedBSD Project Notes: svn path=/head/; revision=146806
* Create nexus in configure_first() instead of in configure(). ThisMarcel Moolenaar2005-05-291-2/+2
| | | | | | | | makes sure that sysinit tasks that run after configure_first(), but before configure() have a nexus to hang devices off. Notes: svn path=/head/; revision=146794