summaryrefslogtreecommitdiffstats
path: root/sys/amd64
Commit message (Collapse)AuthorAgeFilesLines
* regen after addition of linux_utimes and linux_rt_sigtimedwaitnetchild2006-12-313-7/+11
|
* MFp4 (111746, 108671, 108945, 112352):netchild2006-12-312-4/+6
| | | | | | | | | - add linux utimes syscall [1] - add linux rt_sigtimedwait syscall [2] Submitted by: "Scot Hetzel" <swhetzel@gmail.com> [1] Submitted by: Bruce Becker <hostmaster@whois.gts.net> [2] PR: 93199 [2]
* Fixed some style bugs (mainly assorted errors in comments, and inconsistentbde2006-12-291-23/+23
| | | | spelling of `result').
* Fixed some style bugs (whitespace only).bde2006-12-291-30/+31
|
* Try harder to garbage-collect the "LOCORE" (really asm) version ofbde2006-12-291-6/+6
| | | | | | | | | | MPLOCKED. The cleaning in rev.1.25 was supposed to have been undone by rev.1.26, but 1.26 could never have actually affected asm files since atomic.h is full of C declarations so including it in asm files would just give syntax errors. The asm MPLOCKED is even less needed than when misplaced definitions of it were first removed, and is now unused in any asm file in the src tree except in anachronismns in sys/i386/i386/support.s.
* Regenerate.rwatson2006-12-293-17/+17
|
* Assign or clean up audit identifiers for a number of additional Linuxrwatson2006-12-291-18/+19
| | | | | | | | | system calls on the amd64 architecture. Some minor white space tweaks for consistency with other syscalls.master files. Obtained from: TrustedBSD Project
* Removed gratuitous cosmetic differences with the i386 version. Thisbde2006-12-281-7/+7
| | | | | | | | | | | mainly involves removing all __CC_SUPPORTS___INLINE__ ifdefs. These ifdefs are even less needed for amd64 than for i386, but the i386 atomic.h never had them. The ifdefs here were just an optimization of obsolescent compatibility cruft (__inline) for a null set of compilers. I think null sets of compilers should only be supported in cases where this is more than an optimization, doesn't require extensive ifdefs, and only involves not-so-obsolescent compatibility cruft (plain inline here).
* Avoid an instruction in atomic_cmpset_{int_long)() in most cases.bde2006-12-271-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These functions are used a lot for mutexes, so this reduces the text size of an average kernel by about 0.75%. This wasn't intended to be a significant optimization, but it somehow increased the maximum number of packets per second that can be transmitted by my bge hardware from 320000 to 460000 (this benchmark is CPU-bound and remarkably sensitive to changes in the text section). Details: we would prefer to leave the result of the cmpxchg in %al, but cannot tell gcc that it is there, so we have to convert it to an integer register. We converted to %al, then to %[re]ax, but the latter step is usually wasted since gcc usually only wants the condition code and can recover it from %al just as easily as from %[re]ax. Let gcc promote %al in the few cases where this is needed. Nearby style fixes; - let gcc manage the load of `res', and don't abuse `res' for a copy of `exp' - don't echo `res's name in comments - consistently spell the condition code as 'e' after comparison for equality - don't hard-code %al anywhere except in constraints - for the version that doesn't use cmpxchg, there is no requirement to use %al anywhere, so don't hard-code it in the constraints either. Style non-fix: - for the versions that use cmpxchg, keep using "a" (was %[re]ax, now %al) for the main output operand, although this is not required. The input and output operands that use the "a" constraint are now decoupled, and this makes things clearer except for the reason that the output register is hard-coded. It is now just a hack to tell gcc that the input "a" has been clobbered without increasing the number of operands.
* Fix a panic when rebooting a SMP machine, when option STOP_NMI is used,davidxu2006-12-231-0/+1
| | | | | | nmi handler is used to stop other processors, nmi hander calls trap(), however, trap() now accepts a pointer rather than a reference, this was changed by kmacy@.
* MFP4: 109655jkim2006-12-202-23/+2
| | | | | | | | - Move linux_nanosleep() from src/sys/amd64/linux32/linux32_machdep.c to src/sys/compat/linux/linux_time.c. - Validate timespec ranges before use as Linux kernel does. - Fix l_timespec structure. - Clean up style(9) nits.
* Add a lwpid field into per-cpu structure, the lwpid represents currentdavidxu2006-12-203-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | running thread's id on each cpu. This allow us to add in-kernel adaptive spin for user level mutex. While spinning in user space is possible, without correct thread running state exported from kernel, it hardly can be implemented efficiently without wasting cpu cycles, however exporting thread running state unlikely will be implemented soon as it has to design and stablize interfaces. This implementation is transparent to user space, it can be disabled dynamically. With this change, mutex ping-pong program's performance is improved massively on SMP machine. performance of mysql super-smack select benchmark is increased about 7% on Intel dual dual-core2 Xeon machine, it indicates on systems which have bunch of cpus and system-call overhead is low (athlon64, opteron, and core-2 are known to be fast), the adaptive spin does help performance. Added sysctls: kern.threads.umtx_dflt_spins if the sysctl value is non-zero, a zero umutex.m_spincount will cause the sysctl value to be used a spin cycle count. kern.threads.umtx_max_spins the sysctl sets upper limit of spin cycle count. Tested on: Athlon64 X2 3800+, Dual Xeon 5130
* Evidently neither GENERIC nor kan's config had isa in it :-0. Askmacy2006-12-171-1/+1
| | | | Doug Barton says, "embrace the LINT".
* Newer versions of gcc don't support treating structures passed by valuekmacy2006-12-179-79/+82
| | | | | | | | | | as if they were really passed by reference. Specifically, the dead stores elimination pass in the GCC 4.1 optimiser breaks the non-compliant behavior on which FreeBSD relied. This change brings FreeBSD up to date by switching trap frames to being explicitly passed by reference. Reviewed by: kan Tested by: kan
* Add msk(4) to the list of drivers supported by GENERIC kernel.yongari2006-12-131-0/+1
|
* Give Host-PCI bridge drivers their own pcib_alloc_msi() andjhb2006-12-122-5/+47
| | | | | | pcib_alloc_msix() methods instead of using the method from the generic PCI-PCI bridge driver as the PCI-PCI methods will be gaining some PCI-PCI specific logic soon.
* Sort function prototypes.jhb2006-12-121-1/+1
|
* Add a function to return the MD interrupt source cookie associated withjhb2006-12-121-3/+3
| | | | | an interrupt event. Use this in the x86 code to fixup the intrcnt names when an interrupt handler is removed.
* Allow machdep.cpu_idle_hlt to be set from the loader. This should allowsobomax2006-12-061-0/+1
| | | | | | | to workaround the problem with SMP kernels on Turion64 X2 processors described in kern/104678 and may be useful in other situations too. MFC after: 3 days
* Threading cleanup.. part 2 of several.julian2006-12-061-4/+0
| | | | | | | | | | | | | | | | | | | | | | Make part of John Birrell's KSE patch permanent.. Specifically, remove: Any reference of the ksegrp structure. This feature was never fully utilised and made things overly complicated. All code in the scheduler that tried to make threaded programs fair to unthreaded programs. Libpthread processes will already do this to some extent and libthr processes already disable it. Also: Since this makes such a big change to the scheduler(s), take the opportunity to rename some structures and elements that had to be moved anyhow. This makes the code a lot more readable. The ULE scheduler compiles again but I have no idea if it works. The 4bsd scheduler still reqires a little cleaning and some functions that now do ALMOST nothing will go away, but I thought I'd do that as a separate commit. Tested by David Xu, and Dan Eischen using libthr and libpthread.
* Use a different bitmask for superpages' base address so that itru2006-12-053-9/+6
| | | | | | | doesn't conflict with the PG_PDE_PAT bit. (We still don't mask off all the reserved bits but that's okay for now.) Reviewed by: alc
* MFP4 (110939):netchild2006-12-031-1/+1
| | | | | | MFi386: return EOPNOTSUPP for unknown module events. Submitted by: rdivacky
* Sync with i386 (remove the LINUX stuff) now that the module is usable.netchild2006-12-031-5/+0
|
* Optimized RTC accesses by avoiding null writes to the index registerbde2006-12-031-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | and by only delaying when an RTC register is written to. The delay after writing to the data register is now not just a workaround. This reduces the number of ISA accesses in the usual case from 4 to 1. The usual case is 2 rtcin()'s for each RTC interrupt. The index register is almost always RTC_INTR for this. The 3 extra ISA accesses were 1 for writing the index and 2 for delays. Some delays are needed in theory, but in practice they now just slow down slow accesses some more since almost eveyone including us does them wrong so modern systems enforce sufficient delays in hardware. I used to have the delays ifdefed out, but with the index register optimization the delays are rarely executed so the old magic ones can be kept or even implemented non- magically without significant cost. Optimizing RTC interrupt handling is more interesting than it used to be because RTC interrupts are currently needed to fix the more efficient apic timer interrupts on some systems. apic_timer_hz is normally 2000 so the RTC interrupt rate needs to be 2048 to keep the apic timer firing on such systems. Without these changes, each RTC interrupt normally took 10 ISA accesses (2 PIC accesses and 2 sets of 4 RTC accesses). Each ISA access takes 1-1.5uS so 10 of then at 2048 Hz takes 2-3% of a CPU. Now 4 of them take 0.8-1.2% of a CPU.
* Turn console printf buffering into a kernel option and only onjb2006-11-301-1/+0
| | | | | | | | | | | | | | | | | by default for sun4v where it is absolutely required. This change moves the buffer from struct pcpu to the stack to avoid using the critical section which created a LOR in a couple of cases due to interaction with the tty code and kqueue. The LOR can't be fixed with the critical section and the pcpu buffer can't be used without the critical section. Putting the buffer on the stack was my initial solution, but it was pointed out that the stress on the stack might cause problems depending on the call path. We don't have a way of creating tests for those possible cases, so it's best to leave this as an option for the time being. In time we may get enough data to enable this option more generally.
* Differentiate between data and instruction fetch in the fatalru2006-11-281-1/+2
| | | | | | page fault trap handler. Reviewed by: alc
* Use a define instead of a "magic" value.ru2006-11-231-1/+1
|
* Finish the PG_NX support at the pmap level.ru2006-11-231-3/+12
| | | | Reviewed by: alc
* It's been possible to build linprocfs as a module for some time now.ru2006-11-221-1/+1
| | | | Submitted by: rdivacky
* The global variable avail_end is redundant and only used once. Eliminatealc2006-11-193-10/+7
| | | | | it. Make avail_start static to the pmap on amd64. (It no longer exists on other architectures.)
* Add support for 8 byte hardware watches in long mode. Kernel hardwarejhb2006-11-173-5/+17
| | | | | watches support 8 byte watches. For userland, we disallow 8 byte watches for 32-bit tasks.
* - Add macro constants for the various fields in %dr7 and use them in placejhb2006-11-173-38/+54
| | | | | | | of various scattered magic values. - Pretty print the address of hardware watchpoints in 'show watch' rather than just displaying hex. - Expand address field width on amd64 for 64-bit pointers.
* Trim some noise from bootverbose:jhb2006-11-172-15/+14
| | | | | | | | | | | | - Drop the printf in intr_machdep.c when we assign an interrupt souce to a CPU. Each source already has a more detailed printf. - Don't output a line for each ioapic pin showing its initial state, this has outlived its usefulness. - When an APIC enumerator sets the bus, polarity, or trigger mode of an ioapic pin, just return success without printing anything if the new value matches the current one. MFC after: 2 weeks
* A few more style fixes.jhb2006-11-171-4/+3
|
* Various whitespace and style fixes.jhb2006-11-153-44/+44
|
* Fix a typo that broke MSI (MSI-X worked fine) in the later revisions ofjhb2006-11-151-1/+1
| | | | the MSI patches.
* MD support for PCI Message Signalled Interrupts on amd64 and i386:jhb2006-11-137-4/+656
| | | | | | | | | | | | | | | | | | | - Add a new apic_alloc_vectors() method to the local APIC support code to allocate N contiguous IDT vectors (aligned on a M >= N boundary). This function is used to allocate IDT vectors for a group of MSI messages. - Add MSI and MSI-X PICs. The PIC code here provides methods to manage edge-triggered MSI messages as x86 interrupt sources. In addition to the PIC methods, msi.c also includes methods to allocate and release MSI and MSI-X messages. For x86, we allow for up to 128 different MSI IRQs starting at IRQ 256 (IRQs 0-15 are reserved for ISA IRQs, 16-254 for APIC PCI IRQs, and IRQ 255 is reserved). - Add pcib_(alloc|release)_msi[x]() methods to the MD x86 PCI bridge drivers to bubble the request up to the nexus driver. - Add pcib_(alloc|release)_msi[x]() methods to the x86 nexus drivers that ask the MSI PIC code to allocate resources and IDT vectors. MFC after: 2 months
* Various fixes:jhb2006-11-131-83/+61
| | | | | | | | | | | | - Remove an extra entry from the array for 0x0f prefixed instruction groups. This fixes decoding of instructions where the second opcode >= 0x80. - Add support for the 64-bit immediate mov instructions. - When short_addr is enabled, don't parse the modr/m byte for a 16-bit address, but as a 32-bit address. - Support %rip relative addressing. - Don't print a displacement of 0 if there is a base or index register. MFC after: 3 days
* Fix NKPT comments to match reality. Note that the current valueru2006-11-131-2/+3
| | | | | | of NKPT is no longer enough to run amd64 with 16G of RAM, as it doesn't have space for mapping a kernel (16M kernel would require additionally 8 page tables).
* Fix a comment.ru2006-11-131-1/+1
|
* Make pmap_enter() responsible for setting PG_WRITEABLE insteadalc2006-11-121-1/+3
| | | | | of its caller. (As a beneficial side-effect, a high-contention acquisition of the page queues lock in vm_fault() is eliminated.)
* Regen.ru2006-11-111-1/+1
| | | | Forgotten by: trhodes
* Spelling.ru2006-11-071-1/+1
|
* Line up memory amount reporting that got broken when s/real/usable/.ru2006-11-071-2/+2
|
* Add a new 'union l_sigval' to use in place of 'union sigval' in thejhb2006-11-071-3/+6
| | | | | | | linux siginfo structure. l_sigval uses a l_uintptr_t for sival_ptr so that sival_ptr is the right size for linux32 on amd64. Since no code currently uses 'lsi_ptr' this is just a cosmetic nit rather than a bug fix.
* Remove duplicate IDTVEC macro definition, it's already defined injhb2006-11-071-2/+0
| | | | <machine/intr_machdep.h>.
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningrwatson2006-11-061-1/+2
| | | | | | | | | | | | | specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
* Remove the KDTRACE option again because of the complaints about havingjb2006-11-041-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | it as a default. For the record, the KDTRACE option caused _no_ additional source files to be compiled in; certainly no CDDL source files. All it did was to allow existing BSD licensed kernel files to include one or more CDDL header files. By removing this from DEFAULTS, the onus is on a kernel builder to add the option to the kernel config, possibly by including GENERIC and customising from there. It means that DTrace won't be a feature available in FreeBSD by default, which is the way I intended it to be. Without this option, you can't load the dtrace module (which contains the dtrace device and the DTrace framework). This is equivalent to requiring an option in a kernel config before you can load the linux emulation module, for example. I think it is a mistake to have DTrace ported to FreeBSD, but not to have it available to everyone, all the time. The only exception to this is the companies which distribute systems with FreeBSD embedded. Those companies will customise their systems anyway. The KDTRACE option was intended for them, and only them.
* Build in kernel support for loading DTrace modules by default. Thisjb2006-11-041-0/+3
| | | | | | | | | | | | | | adds the hooks that DTrace modules register with, and adds a few functions which have the dtrace_ prefix to allow the DTrace FBT (function boundary trace) provider to avoid tracing because they are called from the DTtrace probe context. Unlike other forms of tracing and debug, DTrace support in the kernel incurs negligible run-time cost. I think the only reason why anyone wouldn't want to have kernel support enabled for DTrace would be due to the license (CDDL) under which DTrace is released.
* Add a cnputs() function to write a string to the console withjb2006-11-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | a lock to prevent interspersed strings written from different CPUs at the same time. To avoid putting a buffer on the stack or having to malloc one, space is incorporated in the per-cpu structure. The buffer size if 128 bytes; chosen because it's the next power of 2 size up from 80 characters. String writes to the console are buffered up the end of the line or until the buffer fills. Then the buffer is flushed to all console devices. Existing low level console output via cnputc() is unaffected by this change. ithread calls to log() are also unaffected to avoid blocking those threads. A minor change to the behaviour in a panic situation is that console output will still be buffered, but won't be written to a tty as before. This should prevent interspersed panic output as a number of CPUs panic before we end up single threaded running ddb. Reviewed by: scottl, jhb MFC after: 2 weeks
OpenPOWER on IntegriCloud