summaryrefslogtreecommitdiffstats
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* sys/sys/limits.h:kan2003-05-1915-30/+32
| | | | | | | | | | | | | | | - Fix visibilty test for LONG_BIT and WORD_BIT. `#if defined(__FOO_VISIBLE)' is alays wrong because __FOO_VISIBLE is always defined (to 0 for invisibility). sys/<arch>/include/limits.h sys/<arch>/include/_limits.h: - Style fixes. Submitted by: bde Reviewed by: bsdmike Approved by: re (scottl)
* Print the right position on disk errorssos2003-05-191-3/+4
| | | | Approved by: re@
* Unbork the chip locating code.sos2003-05-191-8/+3
| | | | Approved by: re@
* Turn pmap_install_pte() into a critical section. We better not getmarcel2003-05-191-6/+12
| | | | | | | | | | interrupted while writing into the VHPT table. While here, make sure memory accesses a properly ordered. Tag invalidation must happen first so that the hardware VHPT walker will not be able to match this entry while we're updating it and we have to make sure the new new tag gets written only after the PTE is completely updated. Approved by: re (blanket)
* Unconditionally set pcb_current_pmap. WIP versions of the codemarcel2003-05-191-1/+2
| | | | | | | | | | | | | | previously committed cleared pcb_current_pmap prior to changing the region registers, but that was removed before committing. Since we don't normally (at all?) pass a NULL pointer, the bug was mostly harmless. Fix it while I'm here... I'm here because we need to have data serialization after writing to the region registers. Not doing so was likely the cause of the hangs we were experiencing. General exceptions in cpu_switch may also be caused by the lack of serialization. Approved by: re (blanket)
* pmap_install() needs to be atomic WRT to context switching. Protectmarcel2003-05-193-37/+39
| | | | | | | | | | | | | | switching user regions (region 0-4) with schedlock. Avoid unnecessary recursion on schedlock by moving the core functionality to another function (pmap_switch()) where we assert schedlock is held. Turn pmap_install() into a wrapper that grabs schedlock. This minimizes the number of callsites that need to be changed. Since we already have schedlock in cpu_switch() and cpu_throw(), have them call pmap_switch() directly. These were also the only two calls to pmap_install() outside pmap.c, so make pmap_install() static and remove its prototype from pmap.h Approved by: re (blanket)
* print_config:grog2003-05-191-6/+14
| | | | | | | | | Change config format slightly to save plex preferences correctly. vinum_scandisk: reinitialise volatile pointer after function call. This is the "deafc0de" bug. Approved by: re (scottl)
* If we seem to be out of VM, don't allow the pagedaemon to killdas2003-05-191-7/+8
| | | | | | | | | | | | | processes in the first pass. Among other things, this will give us a chance to launder vnode-backed pages before concluding that we need more swap. This is particularly useful for systems that have no swap. While here, update a comment and remove some long-unused code. Reported by: Lucky Green <shamrock@cypherpunks.to> Suggested by: dillon Approved by: re (rwatson)
* Lock the vm object when performing vm_object_page_clean().alc2003-05-181-1/+4
| | | | Approved by: re (rwatson)
* Recreate devnodes on USB_SET_ALTINTERFACE ioctl.ticso2003-05-181-0/+11
| | | | | | | | This fixes net/pppoa port for Alcatel Speedtouch devices. Submitted by: Jay Cornwall <jay@evilrealms.net> Tested by: Francois Rogler <francois@rogler.org> Approved by: re (scottl)
* There's just no reason to not have these in GENERIC.ru2003-05-182-0/+3
| | | | | Found by: release/*/drivers.conf cleaning script Approved by: re (scottl)
* Support the ICH5 SATA part.sos2003-05-182-45/+73
| | | | | | | | Fix HPT374 UDMA133 timing. Fix Promise ID. Cosmetics on probe print for Promise & HPT. Approved by: re
* Add string for SATA150sos2003-05-181-0/+1
| | | | Approved by: re
* Add define for SATA150sos2003-05-181-0/+1
| | | | Approved by: re
* Reduce the size of a vm object by converting its shadow list from a TAILQalc2003-05-182-24/+12
| | | | | | to a LIST. Approved by: re (rwatson)
* Add the MUTEX_NOINLINE option that explicitely de-inlines the mutexscottl2003-05-182-3/+4
| | | | | | operations. Submitted by: jhb
* Fixed the markup and wording of the kern.ipc.nsfbufs tunable.ru2003-05-171-3/+5
| | | | | | (It does not modify NSFBUFS, but just overrides it if set.) Approved by: re (blanket)
* Remove unused files. cpu_switch() and cpu_throw(), normally in swtch.s,marcel2003-05-172-820/+0
| | | | | | can be found in machdep.c. Approved: re@
* Actually get all the bits for sd_hibase.. it was 16 bits short. oops.peter2003-05-171-1/+1
| | | | Approved by: re (amd64/* blanket)
* Fix a bug in the AMD64 trampoline. I misunderstood the implicitpeter2003-05-171-1/+1
| | | | | | 32->64 bit zero extend. This changes a movl to an orq. Approved by: re (amd64 bits)
* Revamp of the syscall path, exception and context handling. Themarcel2003-05-1641-5796/+3269
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | prime objectives are: o Implement a syscall path based on the epc inststruction (see sys/ia64/ia64/syscall.s). o Revisit the places were we need to save and restore registers and define those contexts in terms of the register sets (see sys/ia64/include/_regset.h). Secundairy objectives: o Remove the requirement to use contigmalloc for kernel stacks. o Better handling of the high FP registers for SMP systems. o Switch to the new cpu_switch() and cpu_throw() semantics. o Add a good unwinder to reconstruct contexts for the rare cases we need to (see sys/contrib/ia64/libuwx) Many files are affected by this change. Functionally it boils down to: o The EPC syscall doesn't preserve registers it does not need to preserve and places the arguments differently on the stack. This affects libc and truss. o The address of the kernel page directory (kptdir) had to be unstaticized for use by the nested TLB fault handler. The name has been changed to ia64_kptdir to avoid conflicts. The renaming affects libkvm. o The trapframe only contains the special registers and the scratch registers. For syscalls using the EPC syscall path no scratch registers are saved. This affects all places where the trapframe is accessed. Most notably the unaligned access handler, the signal delivery code and the debugger. o Context switching only partly saves the special registers and the preserved registers. This affects cpu_switch() and triggered the move to the new semantics, which additionally affects cpu_throw(). o The high FP registers are either in the PCB or on some CPU. context switching for them is done lazily. This affects trap(). o The mcontext has room for all registers, but not all of them have to be defined in all cases. This mostly affects signal delivery code now. The *context syscalls are as of yet still unimplemented. Many details went into the removal of the requirement to use contigmalloc for kernel stacks. The details are mostly CPU specific and limited to exception_save() and exception_restore(). The few places where we create, destroy or switch stacks were mostly simplified by not having to construct physical addresses and additionally saving the virtual addresses for later use. Besides more efficient context saving and restoring, which of course yields a noticable speedup, this also fixes the dreaded SMP bootup problem as a side-effect. The details of which are still not fully understood. This change includes all the necessary backward compatibility code to have it handle older userland binaries that use the break instruction for syscalls. Support for break-based syscalls has been pessimized in favor of a clean implementation. Due to the overall better performance of the kernel, this will still be notived as an improvement if it's noticed at all. Approved by: re@ (jhb)
* Detect that a vnode has been reclaimed while vflush() was waiting to locktruckman2003-05-161-0/+11
| | | | | | | | | the vnode and restart the loop. Vflush() is vulnerable since it does not hold a reference to the vnode and it holds no other locks while waiting for the vnode lock. The vnode will no longer be on the list when the loop is restarted. Approved by: re (rwatson)
* o In pmap_install, don't prevent switching the pmap if we'remarcel2003-05-161-15/+13
| | | | | | | | switching to kernel_pmap. The pmap is not special enough. o Clear the active bit on the pmap we're switching out. o Fix some nearby style(9) bugs. Approved by: re@
* Use vm_object_deallocate(), not vm_pager_deallocate(), to destroy aalc2003-05-161-2/+2
| | | | | | | vm object. (vm_pager_deallocate() does not, in fact, destroy a vm object.) Approved by: re (scottl) Reviewed by: phk
* Indent a comment. This makes 1.100.marcel2003-05-161-1/+1
| | | | Still approved by: re@ (blanket)
* Turn pmap_growkernel() into a critical section. While here, initializemarcel2003-05-161-22/+14
| | | | | | | | | | | kernel_vm_end in pmap_bootstrap. Don't delay the initialization until we need to grow the kernel VM space. This BTW happens twice before we enter either single- or multi-user mode. Don't adjust kernel_vm_end while growing based on whether the KPT contains a non-NULL entry. We trust kernel_vm_end to be correct and we make sure it's still correct after growing. Define virtual_avail and virtual_end in terms of VM_MIN_KERNEL_ADDRESS and VM_MAX_KERNEL_ADDRESS (resp). Don't hardcode region knowledge.
* Revamp the RID allocation code:marcel2003-05-161-42/+60
| | | | | | | | | | | | | | | | | | | o Limit the size of the region ID map to 64KB. This gives a bitmap that is large enough to keep track of 2^19 numbers. The minimal map size is 32KB. The reason we limit the map size is that processor models may have implemented a 24-bit region ID, which would give a 2MB bitmap while the maximum number of allocations is always less than PID_MAX*5, which is less than 2^19. o Allocate all region IDs up-front. The slight downside of reserving more RIDs then a process needs (3 for ia64 native and 1 for ia32) is preferable over the call to pmap_ensure_rid() where RIDs are allocated on demand. On SMP systems this may lead to a race condition. o When allocating a region ID, don't use arc4random(). We're not interested in randomness or uniform distribution across the spectrum. We only need uniqueness. Random numbers may easily collide when the number of allocated RIDs is high, creating a possibly unbounded retry rate.
* Move the conditional definition of KSTACK_MAX_PAGES up ahead wheremarcel2003-05-161-4/+4
| | | | | | it's more visible. Approved by: re@ (blanket)
* Sync the linker script with the one used by default for userland. Sincemarcel2003-05-161-76/+82
| | | | | | | ia64 only uses relocations with addend, remove the sections specific to non-addend relocations (.rel.*). Also remove C++ specific sections. Approved by: re@ (blanket)
* Add variables for missing network drivers.murray2003-05-161-0/+6
| | | | | | PR: kern/51911 Submitted by: David Yeske <dyeske@yahoo.com> Approved by: re
* Add E-Tech ISA PnP modem ID.murray2003-05-161-0/+1
| | | | | | | PR: kern/36692 Submitted by: Theo van Klaveren <t.vanklaveren@student.utwente.nl> Approved by: re (murray) MFC After: 3 days
* Run $S/kern/genassym.sh with the correct NM.obrien2003-05-161-1/+1
| | | | Approved by: re(blanket)
* Fix long standing bug that prevents the PT_CONTINUE, PT_KILL andobrien2003-05-161-9/+10
| | | | | | | | | | | | | | | | PT_DETACH ptrace(2) requests from functioning as advertised in the manual page. As described in kern/35175, the PT_DETACH request will, under certain circumstances, pass an unwanted signal on to the traced process upan detaching from it. The PT_CONTINUE request will sometimes fail if you make it pass a signal that has "properties" that differ from the properties of the signal that origionally caused the traced process to be stopped. Since PT_KILL is nothing than PT_CONTINUE with SIGKILL, it is broken too. In the PT_KILL case, this leads to an unkillable process. PR: 44011 Submitted by: Mark Kettenis <kettenis@chello.nl> Approved by: re(jhb)
* Add a tunable/sysctl "hw.fxp_noflow" which disables flow control supportrwatson2003-05-161-1/+5
| | | | | | | | | | | | | on if_fxp cards. When flow control is enabled, if the operating system doesn't acknowledge the packet buffer filling, the card will begin to generate ethernet quench packets, but appears to get into a feedback loop of some sort, hosing local switches. This is a temporary workaround for 5.1: the ability to configure flow control should probably be exposed by some or another management interface on ethernet link layer devices. Approved by: re (bmah) Reviewed by: mux
* In cpu_fork(), initialize pcb_psl for the new process to PSL_KERNEL,tmm2003-05-161-1/+1
| | | | | | | | | | | | instead of taking the (userland) eflags from the trap frame and masking out PSL_I. There is no need to inherit any flags from the forking process; the old method however can cause flags set in userland for the forking process to be bogusly set in kernel mode when the newly forked process runs for the first time (in particular PSL_T, which is set for userland when the process is single-stepped; this would cause trace traps in kernel mode). Approved by: re (jhb)
* VOP_PATHCONF() requires a vnode lock; this patch adds locking torwatson2003-05-151-0/+2
| | | | | | | | fpathconf(). The lock is held for direct calls to VOP_PATHCONF() in pathconf() already. Approved by: re (jhb) Pointed out by: DEBUG_VFS_LOCKS
* This change grabs the vnode lock for NFS client vnodes when callingrwatson2003-05-152-1/+7
| | | | | | | | | | VOP_SETATTR() or VOP_GETATTR(); without these locks (a) VFS_DEBUG_LOCKS will panic, and (b) it may be possible to corrupt entries in the cached vnode attributes in the nfsnode, since nfsnode attribute cache data is also protected by the vnode lock. Approved by: re (jhb) Pointed out by: VFS_DEBUG_LOCKS
* Jeff added locking assertions that the VV_ flags on vnodes were modifiedrwatson2003-05-151-5/+11
| | | | | | | | | | | | | only while holding appropriate vnode locks. This patch slides the lock release for ufs_extattr_enable() to continue to hold the active vnode lock on a backing file until after the flag change; it also acquires a vnode lock when disabling an attribute and hence clearing a flag on the backing vnode. This permits VFS_DEBUG_LOCKS to run UFS1 extended attributes without panicking, as well as preventing a potential race and vnode flag problem. Approved by: re (jhb) Pointed out by: DEBUG_VFS_LOCKS
* Make the mb_alloc low-watermark sysctl-tunable read-only and makebmilekic2003-05-151-2/+5
| | | | | | | | netstat(1) not display it for now because its effects are not yet completely implemented and we're about to cut 5.2-RELEASE. This is temporary. Approved by: re (scottl, rwatson)
* fix a cut-n-paste error.julian2003-05-151-1/+1
| | | | | | | | in the case where the bridge node was closed down but a timeout still applied to it, the final reference to the node was freeing the private data structure using the wrong malloc type. Approved by: re@
* Generalize a quirk for Asahi Optical-based cameras (i.e. Pentax). It appearsnjl2003-05-151-2/+1
| | | | | | | | all of the Optio series have the same problems. It might be a better approach eventually to add wildcard support to USB quirks. PR: kern/50271, kern/46369 Approved by: re (rwatson)
* Add a quirk for OTi USB flash key.njl2003-05-151-0/+8
| | | | | PR: kern/51825 Approved by: re (rwatson)
* Miscellaneous fixes:tmm2003-05-152-6/+59
| | | | | | | | | | | | | | | | | - Fix compilation without GEM_DEBUG. - Do not #define GEM_DEBUG by default; it adds overhead (due to bzero()ing RX space) and is not needed any more, since the driver is quite stable now. - Fix watchdog timeouts when failing to load TX packets. - Do not forcibly limit the number of descriptors used for a packet to GEM_NTXSEGS, by passing this number to bus_dma_tag_create(). There is no requirement for a limit any lower than the total number of available descriptors, and the present limit caused network problems due to mbuf chains requiring more descriptors. GEM_NTXSEGS is still used to estimate the interrupt window size, for which we just need an estimate. Approved by: re (rwatson)
* Only use a SIA/SYM media info block if no MII block is detected.mbr2003-05-152-4/+52
| | | | | | | | | The submitter of PR 32118 told me that this patch also fixes autoselecting for znyx 4 port cards (10baseT, 100baseTX did work already). PR: 32118 Reviewed by: imp Approved by: rwatson (re)
* This file creates register sets based on the runtime specification.marcel2003-05-151-0/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The advantage of using register sets is that you don't focus on each register seperately, but instead instroduce a level of abstraction. This reduces the chance of errors, and also simplifies the code. The register sers form the basis of everything register. The sets in this file are: struct _special contains all of the control related registers, such as instruction pointer and stack pointer. It also contains interrupt specific registers like the faulting address. The set is roughly split in 3 groups. The first contains the registers that define a context or thread. This is the only group that the kernel needs to switch threads. The second group contains registers needed in addition to the first group needed to switch userland threads. This group contains the thread pointer and the FP control register. The third group contains those registers we need for execption handling and are used on top of the first two groups. struct _callee_saved, struct _callee_saved_fp These sets contain the preserved registers, including the NaT after spilling. The general registers (including branch registers) are seperated from the FP registers for ptrace(2). struct _caller_saved, struct _caller_saved_fp These sets contain the scratch registers based on SDM 2.1, This means that both ar.csd and ar.ccd are included here, even though they contain ia32 segment register descriptions. We keep seperate NaT bits for scratch and preserved registers, because they are never saved/restored at the same time. struct _high_fp The upper 96 FP registers that can be enabled/disabled seperately on the CPU from the lower 32 FP registers. Due to the size of this set, we treat them specially, even though they are defined as scratch registers. CVS ----------------------------------------------------------------------
* This file contains elementary context related functions used tomarcel2003-05-152-0/+1608
| | | | | | | | | | | | | | | | | save and restore "sets" of registers in various places. The restorectx and swapctx functions are used by cpu_switch() and deal with the special registers, as well as the preserved registers. The *callee_saved* functions are used to save and restore the preserved registers (integer and floating-point). They are useful for signal delivery and ptrace support. The save_high_fp and restore_high_fp functions are used to "load" and "unload" to and from the CPU as part of lazy context switching. The ia32 specific context functions have been kept with the ia32 code. Approved by: re@ (blanket)
* This file contains the code that implements the syscall path basedmarcel2003-05-152-0/+1130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on the epc instruction. The epc instruction, given the permissions of the page in which the epc is located, allows the privilege level to be increased with little or no overhead. The previous privilege level is recorded in the current frame marker and is restored by a regular (function) return. Since the epc instruction has to live in a page with non-standard properties, we hardwire a "gateway" page in the address space. The address of the gateway page is exported to userland in ar.k7. This allows us to rewire the page without breaking the ABI. The syscall stubs in libc are regular function calls that slightly differ from the normal runtime. The difference is mostly to simplify the stubs themselves by by moving some of the logic to the kernel. The libc stubs call into the gateway page (offset 0), from where the kernel trampolines to the code that sets up a minimal trapframe and arranges to execute from the kernel stack. The way back is basicly the same. The kernel returns to the gateway page, whereby privilege is dropped, and jumps back to the syscall stub. Only the special registers are saved in the trapframe. None of the scratch registers are preserved and since the kernel follows the same runtime model, none of the preserved registers are saved. Future enhancements can include the implementation of lightweight syscalls, where kernel functions are performed without setting up a trapframe. Good candidates are the *context syscalls for example. Now that there's a gateway page from which code can be executed in a non-privileged context, we also have the ideal place to put the signal trampolines. By moving the signal trampolines from the user stack to the gateway page, we open up the doors to unexecutable stacks. The gateway page contains signal trampolines for both the "legacy" break-based syscall code and the new and improved epc- based syscall code. Approved: re@ (blanket)
* Initialize logical_cpus_mask when the logical CPUs are enumerated inalc2003-05-156-12/+30
| | | | | | | | the mptable. (Previously, logical_cpus_mask was only initialized if the hyperthreading fixup was executed.) Approved by: re (jhb) Reviewed by: ps
* This commit was generated by cvs2svn to compensate for changes in r115013,marcel2003-05-1529-0/+5320
|\ | | | | | | which included commits to RCS files with non-trunk default branches.
| * This is beta4 of libuwx; an ia64 stack unwinder. This code is mademarcel2003-05-1529-0/+5320
| | | | | | | | | | | | | | | | | available by Hewlett-Packard under the MIT license. The unwinder is small, clean and fast and needed little adaptation for use in the kernel. This import has embedded in it the changes needed to make it build in a kernel environment. To optimize the common case, the kernel will minimize the number of registers saved by not saving the preserved registers. In case access to preserved registers is needed (signal handling, ptrace) the kernel will unwind to the context of the syscall or exception. For this we need an unwinder. Approved by: re (blanket)
OpenPOWER on IntegriCloud