summaryrefslogtreecommitdiffstats
path: root/sys/i386
Commit message (Collapse)AuthorAgeFilesLines
* guard function decls with _KERNEL so user code can include this filesam2006-02-221-1/+2
| | | | MFC after: 1 week
* Close some races between procfs/ptrace and exit(2):jhb2006-02-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Reorder the events in exit(2) slightly so that we trigger the S_EXIT stop event earlier. After we have signalled that, we set P_WEXIT and then wait for any processes with a hold on the vmspace via PHOLD to release it. PHOLD now KASSERT()'s that P_WEXIT is clear when it is invoked, and PRELE now does a wakeup if P_WEXIT is set and p_lock drops to zero. - Change proc_rwmem() to require that the processing read from has its vmspace held via PHOLD by the caller and get rid of all the junk to screw around with the vmspace reference count as we no longer need it. - In ptrace() and pseudofs(), treat a process with P_WEXIT set as if it doesn't exist. - Only do one PHOLD in kern_ptrace() now, and do it earlier so it covers FIX_SSTEP() (since on alpha at least this can end up calling proc_rwmem() to clear an earlier single-step simualted via a breakpoint). We only do one to avoid races. Also, by making the EINVAL error for unknown requests be part of the default: case in the switch, the various switch cases can now just break out to return which removes a _lot_ of duplicated PRELE and proc unlocks, etc. Also, it fixes at least one bug where a LWP ptrace command could return EINVAL with the proc lock still held. - Changed the locking for ptrace_single_step(), ptrace_set_pc(), and ptrace_clear_single_step() to always be called with the proc lock held (it was a mixed bag previously). Alpha and arm have to drop the lock while the mess around with breakpoints, but other archs avoid extra lock release/acquires in ptrace(). I did have to fix a couple of other consumers in kern_kse and a few other places to hold the proc lock and PHOLD. Tested by: ps (1 mostly, but some bits of 2-4 as well) MFC after: 1 week
* Rounding addr upwards to next 4M or 2M boundary in pmap_growkernel() couldtegge2006-02-161-0/+14
| | | | | | | cause addr to become 0, resulting in an early return without populating the last PDE. Reviewed by: alc
* It seems bit 5 of cpu_feature2 is the VMX (Virtual Machine Extensions)dwmalone2006-02-151-2/+2
| | | | | bit. While I'm here, delete a comment that was cut and past from the cpu_features code that doesn't belong here.
* CPU time accounting speedup (step 2)phk2006-02-112-0/+16
| | | | | | | | | | | | | | | | | | | Keep accounting time (in per-cpu) cputicks and the statistics counts in the thread and summarize into struct proc when at context switch. Don't reach across CPUs in calcru(). Add code to calibrate the top speed of cpu_tickrate() for variable cpu_tick hardware (like TSC on power managed machines). Don't enforce monotonicity (at least for now) in calcru. While the calibrated cpu_tickrate ramps up it may not be true. Use 27MHz counter on i386/Geode. Use TSC on amd64 & i386 if present. Use tick counter on sparc64
* Cleaned the memory initialization up, moved some defines from the framebufferrink2006-02-103-20/+18
| | | | | | | to an include file. Reviewed by: imp Approved by: imp (mentor)
* Avoid calling CPUID function 0x02 if the CPU reports no support foryar2006-02-091-48/+23
| | | | | | | | | | | it. The former code used to hang older Intel CPUs by trying to get non-existent TLB info 2^32 times. Reduce code duplication around the calls to CPUID 0x02 by using do-while loops. PR: i386/92977 Tested by: cy
* Simplify system time accounting for profiling.phk2006-02-081-6/+4
| | | | | | | | | | Rename struct thread's td_sticks to td_pticks, we will need the other name for more appropriately named use shortly. Reduce it from uint64_t to u_int. Clear td_pticks whenever we enter the kernel instead of recording its value as reference for userret(). Use the absolute value of td->pticks in userret() and eliminate third argument.
* Modify the way we account for CPU time spent (step 1)phk2006-02-071-1/+1
| | | | | | | | | | | | | | | | Keep track of time spent by the cpu in various contexts in units of "cputicks" and scale to real-world microsec^H^H^H^H^H^H^H^Hclock_t only when somebody wants to inspect the numbers. For now "cputicks" are still derived from the current timecounter and therefore things should by definition remain sensible also on SMP machines. (The main reason for this first milestone commit is to verify that hypothesis.) On slower machines, the avoided multiplications to normalize timestams at every context switch, comes out as a 5-7% better score on the unixbench/context1 microbenchmark. On more modern hardware no change in performance is seen.
* Regenerate.rwatson2006-02-061-49/+49
|
* Assign audit event identifiers to ibcs2 system calls.rwatson2006-02-061-50/+50
| | | | Obtained from: TrustedBSD Project
* - Always call exec_free_args() in kern_execve() instead of doing it in alljhb2006-02-062-3/+0
| | | | | | the callers if the exec either succeeds or fails early. - Move the code to call exit1() if the exec fails after the vmspace is gone to the bottom of kern_execve() to cut down on some code duplication.
* Add a kern_eaccess() function and use it to implement xenix_eaccess()jhb2006-02-061-1/+1
| | | | | | rather than kern_access(). Suggested by: rwatson
* Regenerate.rwatson2006-02-063-164/+164
|
* Assign audit event identifiers to Linux i386 system calls.rwatson2006-02-061-169/+177
| | | | Obtained from: TrustedBSD Project
* Regenerate.rwatson2006-02-053-13/+13
|
* Assign audit event identfiers to Xenix system calls. Note: AUE_EACCESSrwatson2006-02-051-10/+10
| | | | | | | | | is assigned to xenix_eaccess() instead of AUE_ACCESS, as that is the intended meaning of the system call. xenix_eaccess() should be reimplemented using our native eaccess() implementation so that it works as intended. Obtained from: TrustedBSD Project
* Correct help line: list targets, not names of files generated by targetsrwatson2006-02-051-1/+1
| | | | | | when no argument is provided to make. MFC after: 1 week
* Regenerate (accidentally also committed in commit that updatedrwatson2006-02-052-2/+2
| | | | syscalls.isc).
* Assign audit event identifiers to ibcs2 ISC system calls.rwatson2006-02-052-28/+29
| | | | Obtained from: TrustedBSD Project
* Move asr driver from global NOTES to i386-specific NOTES. Requestorkensmith2006-02-051-0/+6
| | | | | | reports it is neither endian-clean or 64-bit clean. :-) Requested by: scottl
* Hook up the audit system to system call entry and exit. System calls willwsalamon2006-02-041-0/+3
| | | | | | | now be audited. Obtained from: TrustedBSD Project Approved by: rwatson (mentor)
* Patch to allow XBox-users to use the onboard nve(4) nForce ethernet driver.rink2006-02-042-1/+29
| | | | | | | | | | | | | | The patch crudely forces the NIC out of operating mode before the nve(4) driver can initialize it; this is required to properly initialize the NIC. It is XBox-specific, as this condition can only occur on XBoxes (Most loaders will simply leave the NIC running, forcing us to use a crude workaround like this to get it in a workable condition). Due to the XBox-only aspect, this has been solved in XBox-specific initialization code and not within nve(4). Reviewed by: imp Approved by: imp (mentor) No objection: bz@, obrien@, q@ontheweb.com.au
* Clear carry flag in get_mcontext so that setcontext does notdavidxu2006-02-031-1/+2
| | | | | | return a bogus error. PR: misc/92110
* Under verbose mode, correctly report L2 cache informationdavidxu2006-02-021-1/+7
| | | | | | for CPU which supports CPUID function 8000_0006h. Tested on: Pentum-M 750
* Fix bug in L2 cache size detection code for CPU which supports CPUIDdavidxu2006-02-021-3/+8
| | | | | | function 8000_0006h. Tested on: Pentum-M 750
* Correctly report L2 cache size according to its code comment.davidxu2006-02-021-2/+2
| | | | Tested on my Dual PIII machine.
* Attach ce(4) to the build.rik2006-01-311-0/+4
| | | | MFC after: 3 days
* Prepare for sconfig(8) update.rik2006-01-301-4/+74
| | | | Change also my e-mail.
* Call WITNESS_CHECK() in the page fault handler and immediately assume itjhb2006-01-271-3/+11
| | | | | | | | | | | is a fatal fault if we are holding any non-sleepable locks. This should cut down on the number of bogus LORs we currently get when the kernel panics due to a NULL (or bogus) pointer dereference that goes wandering off into the VM system which tries to acquire locks and then kicks off the spurious LORs. This should probably be ported to all the archs at some point. Tested on: i386
* Fix race conditions.ups2006-01-231-33/+57
| | | | | Tested by: kris@ MFC after: 3 days
* Remove the commented out entry of the old ISA-only le(4) driver whichmarius2006-01-211-3/+0
| | | | | | was retired 22 months ago. MFC after: 1 day
* Eliminate a stale instruction introduced in revision 1.136.davidxu2006-01-181-1/+0
|
* Free the newtag if we exit with a failure from alloc_bounce_zone().scottl2006-01-141-1/+6
| | | | Found by: Coverity Prevent(tm)
* Move the old BSD4.3 tty compatibility from (!BURN_BRIDGES && COMPAT_43)phk2006-01-101-0/+1
| | | | | | | | | | | | to COMPAT_43TTY. Add COMPAT_43TTY to NOTES and */conf/GENERIC Compile tty_compat.c only under the new option. Spit out #warning "Old BSD tty API used, please upgrade." if ioctl_compat.h gets #included from userland.
* By popular demand, move __HAVE_ACPI and __PCI_REROUTE_INTERRUPT intoimp2006-01-092-2/+3
| | | | | | | | param.h. Per request, I've placed these just after the _NO_NAMESPACE_POLLUTION ifndef. I've not renamed anything yet, but may since we don't need the __. Submitted by: bde, jhb, scottl, many others.
* - Make pcib_devclass private to sys/dev/pci/pci_pci.c and change all thejhb2006-01-062-28/+13
| | | | | | | various pcib drivers to use their own private devclass_t variables for their modules. - Use the DEFINE_CLASS_0() macro to declare drivers for the various pcib drivers while I'm here.
* Fix various places that were testing td_critnest to see if interruptsjhb2006-01-061-3/+3
| | | | | should remain disabled during a trap or not to check td_md.md_spinlock_count instead.
* We don't support I386_CPU in 6.0 and later. This file can be cleanednetchild2006-01-041-16/+0
| | | | | | | | up some to assume that '#if defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU)' is true. Suggested by: jhb Reviewed by: jhb
* - Make sure the cpu_exthigh variable is initialized (page coloring case). [1]netchild2006-01-041-19/+39
| | | | | | | | - Remove a conditional in the AMD cache detection, it's always false. [2] - Don't try to detect a cache if only compiled for i386. Analyzed by: Antoine Brodin <antoine.brodin@laposte.net> [1] Submitted by: Antoine Brodin <antoine.brodin@laposte.net> [2]
* Use ttyalloc() instead of ttymalloc()phk2006-01-042-3/+4
|
* Fix a couple of issues with the ibcs2 module event handler. First, returnjhb2006-01-031-1/+4
| | | | | | | | | | | | success instead of EOPNOTSUPP when being loaded. Secondly, if there are no ibcs2 processes running when a MOD_UNLOAD request is made, break out to return success instead of falling through into the default case which returns EOPNOTSUPP. With these fixes, I can now kldload and subsequently kldunload the ibcs2 module. PR: kern/82026 (and several duplicates) Reported by: lots of folks MFC after: 1 week
* - Explicitly validate an empty filter to match bpf_filter() comment[1].jkim2006-01-031-0/+4
| | | | | | - Do not use BPF JIT compiler for an empty filter. [1] Pointed out by: darrenr
* Define __HAVE_ACPI and/or __PCI_REROUTE_INTERRUPT, as appropriate forimp2006-01-011-0/+2
| | | | | each platform. These will be used in the pci code in preference to the complicated #ifdefs we have there now.
* MI changes:netchild2005-12-311-0/+466
| | | | | | | | | | | | | | | | | | | | | | | | | | - provide an interface (macros) to the page coloring part of the VM system, this allows to try different coloring algorithms without the need to touch every file [1] - make the page queue tuning values readable: sysctl vm.stats.pagequeue - autotuning of the page coloring values based upon the cache size instead of options in the kernel config (disabling of the page coloring as a kernel option is still possible) MD changes: - detection of the cache size: only IA32 and AMD64 (untested) contains cache size detection code, every other arch just comes with a dummy function (this results in the use of default values like it was the case without the autotuning of the page coloring) - print some more info on Intel CPU's (like we do on AMD and Transmeta CPU's) Note to AMD owners (IA32 and AMD64): please run "sysctl vm.stats.pagequeue" and report if the cache* values are zero (= bug in the cache detection code) or not. Based upon work by: Chad David <davidc@acns.ab.ca> [1] Reviewed by: alc, arch (in 2004) Discussed with: alc, Chad David, arch (in 2004)
* Remove pcb_switchout, it has not been used for a long time.davidxu2005-12-293-8/+0
|
* Remove kern.elf32.can_exec_dyn sysctl. Instead extend Brandinfo structuresobomax2005-12-262-0/+4
| | | | | | | | | | with flags bitfield and set BI_CAN_EXEC_DYN flag for all brands that usually allow executing elf dynamic binaries (aka shared libraries). When it is requested to execute ET_DYN elf image check if this flag is on after we know the elf brand allowing execution if so. PR: kern/87615 Submitted by: Marcin Koziej <creep@desk.pl>
* Move global variable private_tss into per-cpu area.davidxu2005-12-265-10/+10
| | | | Reviewed by: jhb
* - Improve the INKERNEL macro such that it can no longer give false positives.jeff2005-12-231-1/+6
| | | | | | This fixes the stack(9) functionality. Submitted by: Antoine Brodin <antoine.brodin@laposte.net>
* Tweak how the MD code calls the fooclock() methods some. Instead ofjhb2005-12-228-44/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | passing a pointer to an opaque clockframe structure and requiring the MD code to supply CLKF_FOO() macros to extract needed values out of the opaque structure, just pass the needed values directly. In practice this means passing the pair (usermode, pc) to hardclock() and profclock() and passing the boolean (usermode) to hardclock_cpu() and hardclock_process(). Other details: - Axe clockframe and CLKF_FOO() macros on all architectures. Basically, all the archs were taking a trapframe and converting it into a clockframe one way or another. Now they can just extract the PC and usermode values directly out of the trapframe and pass it to fooclock(). - Renamed hardclock_process() to hardclock_cpu() as the latter is more accurate. - On Alpha, we now run profclock() at hz (profhz == hz) rather than at the slower stathz. - On Alpha, for the TurboLaser machines that don't have an 8254 timecounter, call hardclock() directly. This removes an extra conditional check from every clock interrupt on Alpha on the BSP. There is probably room for even further pruning here by changing Alpha to use the simplified timecounter we use on x86 with the lapic timer since we don't get interrupts from the 8254 on Alpha anyway. - On x86, clkintr() shouldn't ever be called now unless using_lapic_timer is false, so add a KASSERT() to that affect and remove a condition to slightly optimize the non-lapic case. - Change prototypeof arm_handler_execute() so that it's first arg is a trapframe pointer rather than a void pointer for clarity. - Use KCOUNT macro in profclock() to lookup the kernel profiling bucket. Tested on: alpha, amd64, arm, i386, ia64, sparc64 Reviewed by: bde (mostly)
OpenPOWER on IntegriCloud