summaryrefslogtreecommitdiffstats
path: root/sys/sparc64
Commit message (Collapse)AuthorAgeFilesLines
* Allocate memory for a DMA method table only in case we need to overridemarius2011-03-292-9/+18
| | | | | | | the iommu(4) provided one, i.e. in case of Hummingbird and Sabre bridges, otherwise just use the iommu(4) one. This also fixes a bug introduced in r220039 which caused an empty DMA method table to be used for the second of a pair of Psycho bridges.
* - A closer inspection of the OpenSolaris code indicates that the DMAmarius2011-03-262-158/+52
| | | | | | | | | | | syncing for Hummingbird and Sabre bridges should be applied with every BUS_DMASYNC_POSTREAD instead of in a wrapper around interrupt handlers for devices behind PCI-PCI bridges only as suggested by the documentation (code for the latter actually exists in OpenSolaris but is disabled by default), which also makes more sense. - Take advantage of the ofw_pci_setup_device method introduced in r220038 for disabling bus parking for certain EBus bridges in order to - Mark some unused parameters as such.
* - Merge the *_SET macros from fire(4) which generally print out themarius2011-03-266-257/+308
| | | | | | | | | | | | | | | | | | | | | | | | | register changes when compiled with SCHIZO_DEBUG and take advantage of them. - Add support for the XMITS Fireplane/Safari to PCI-X bridges. I tought I'd need this for a Sun Fire 3800, which then turned out to not being equipped with such a bridge though. The support for these should be complete but given that it hasn't actually been tested probing is disabled for now. This required a way to alter the XMITS configuration in case a PCI-X device is found further down the device tree so the sparc64 specific ofw_pci kobj was revived with a ofw_pci_setup_device method, which is called by the ofw_pcibus code for every device added. - A closer inspection of the OpenSolaris code indicates that consistent DMA flushing/syncing as well as the block store workaround should be applied with every BUS_DMASYNC_POSTREAD instead of in a wrapper around interrupt handlers for devices behind PCI-PCI bridges only as suggested by the documentation (code for the latter actually exists in OpenSolaris but is disabled by default), which also makes more sense. - Add a workaround for Casinni/Skyhawk combinations. Chances are that this solves the crashes seen when using the the on-board Casinni NICs of Sun Fire V480 equipped with centerplanes other than 501-6780 or 501-6790. This also takes advantage of the ofw_pci_setup_device method. - Mark some unused parameters as such.
* - Make a panic message better reflect the actual problem.marius2011-03-191-13/+15
| | | | | | - A closer inspection of the OpenSolaris code indicates the block store workaround is only necessary in case of BUS_DMASYNC_POSTREAD. - Mark some unused parameters as such.
* On Serengeti-class machines the OFW root isn't the parent of the CPUmarius2011-03-191-2/+2
| | | | nodes.
* In case reading PCIR_MINGNT fails don't use it for calculating themarius2011-03-191-1/+1
| | | | | latency. This is more or less a theoretical problem though as it typically indicates way bigger problems.
* Remove the advertising clause from the UCB license according to themarius2011-03-135-20/+0
| | | | July 22, 1999 addendum.
* Sync licenses and the corresponding RCS IDs with NetBSD, mainly switchingmarius2011-03-1222-199/+213
| | | | | | the licenses of Matthew R. Green and the TNF to 2-clause. Obtained from: NetBSD
* - Add support for TLS relocations.marius2011-03-111-8/+62
| | | | | | - Emitt an error when encountering an unsupported and in case of the kernel also for unaligned relocations. - Fix R_SPARC_LOX10 relocations. Apparently these are hardly ever used.
* - Remove clause 3 and 4 from TNF licenses. [1]marius2011-03-111-43/+33
| | | | | | | | | | | - Add the _RF_X committed in r212998 also to the tables in the sparc64 reloc.c in order reduce differences between the kernel and the userland source. This results in no functional change though. - Fix further inconsistencies in the abbreviations of the names of the relocations. - Further whitespace fixes. Obtained from: NetBSD [1]
* Revert the binutils workaround committed in r219340, the underlyingmarius2011-03-111-8/+1
| | | | problem has been fixed in r219530.
* Mostly revert r219468, as I had misremembered the C standard regardingmdf2011-03-111-1/+1
| | | | | | the size of an extern array. Keep one change from strncpy to strlcpy.
* Use MAXPATHLEN rather than the size of an extern array when copying themdf2011-03-101-1/+1
| | | | | | kernel name. Also consistenly use strlcpy(). Suggested by: Warner Losh
* Add a small change to the comment in the GENRIC config files that include udbpjulian2011-03-091-1/+1
| | | | | Submitted by: Chris Forgron, cforgeron at acsi dot ca MFC after: 1 week
* Extend struct sysvec with new method sv_schedtail, which is used for andchagin2011-03-081-0/+1
| | | | | | | | | | | | | | | explicit process at fork trampoline path instead of eventhadler(schedtail) invocation for each child process. Remove eventhandler(schedtail) code and change linux ABI to use newly added sysvec method. While here replace explicit comparing of module sysentvec structure with the newly created process sysentvec to detect the linux ABI. Discussed with: kib MFC after: 2 Week
* - With the addition of TLS support binutils started to make the addendmarius2011-03-061-1/+11
| | | | | | | | | | values for resolved symbols relative to relocbase instead of sections so detect this case and handle as appropriate, which allows using kernel modules linked with affected versions of binutils. Actually I think this is a bug in binutils but given that apparently nobody complained for nearly six years and powerpc has basically the same workaround I decided to put it in for the sparc64 kernel, too. - Fix R_SPARC_HIX22 relocations. Apparently these are hardly ever used.
* - Consistently abbreviate the names of the relocations.marius2011-03-061-14/+14
| | | | | - End sentences with dots. - Fix whitespace.
* Resurrect ofw_pci_if.m from r178578.marius2011-02-211-0/+53
|
* Fix typos - remove duplicate "the".brucec2011-02-213-3/+3
| | | | | | PR: bin/154928 Submitted by: Eitan Adler <lists at eitanadler.com> MFC after: 3 days
* Remove pmap fields that are either unused or not fully implemented.alc2011-02-171-2/+0
| | | | Discussed with: kib
* Set td_kstack_pages for thread0.marius2011-02-081-0/+1
|
* Take advantage of accessing the kernel TSB via ASI_ATOMIC_QUAD_LDD_PHYSmarius2011-02-081-1/+2
| | | | on SPARC64-V, too. Tested by: Michael Moll
* Put the general logic for being a CPU hog into a new functionmdf2011-02-021-2/+1
| | | | | | | | | | should_yield(). Use this in various places. Encapsulate the common case of check-and-yield into a new function maybe_yield(). Change several checks for a magic number of iterations to use should_yield() instead. MFC after: 1 week
* Make MSGBUF_SIZE kernel option a loader tunable kern.msgbufsize.pluknet2011-01-212-4/+2
| | | | | | | Submitted by: perryh pluto.rain.com (previous version) Reviewed by: jhb Approved by: kib (mentor) Tested by: universe
* For architectures not using direct map , and requiring real KVA page forkib2011-01-181-1/+1
| | | | | | | | | | | | | | sf buf allocation, use wakeup() instead of wakeup_one() to notify sf buffer waiters about free buffer. sf_buf_alloc() calls msleep(PCATCH) when SFB_CATCH flag was given, and for simultaneous wakeup and signal delivery, msleep() returns EINTR/ERESTART despite the thread was selected for wakeup_one(). As result, we loose a wakeup, and some other waiter will not be woken up. Reported and tested by: az Reviewed by: alc, jhb MFC after: 1 week
* Remove empty dev_mem_md_init() stubs.jkim2011-01-171-6/+0
|
* Add reader/writer lock around mem_range_attr_get() and mem_range_attr_set().jkim2011-01-171-1/+4
| | | | | | | | | Compile sys/dev/mem/memutil.c for all supported platforms and remove now unnecessary dev_mem_md_init(). Consistently define mem_range_softc from mem.c for all platforms. Add missing #include guards for machine/memdev.h and sys/memrange.h. Clean up some nearby style(9) nits. MFC after: 1 month
* In order to save instructions the MMU trap handlers assumed that the kernelmarius2011-01-172-34/+72
| | | | | | | | | | | TSB is located within the 32-bit address space, which held true as long as we were using virtual addresses magic-mapped before the location of the kernel for addressing it. However, with r216803 in place when possible we address it via its physical address instead, which on machines like Sun Fire V880 have no physical memory in the 32-bit address space at all requires to use 64-bit addressing. When using physical addressing it still should be safe to assume that we can just ignore the lowest 10 bits of the address as a minor optimization as we did before r216803.
* Remove unneeded includes of <sys/linker_set.h>. Other headers that usejhb2011-01-114-4/+0
| | | | | | it internally contain nested includes. Reviewed by: bde
* Move repeated MAXSLP definition from machine/vmparam.h to sys/vmmeter.h.kib2011-01-091-11/+0
| | | | | | | Update the outdated comments describing MAXSLP and the process selection algorithm for swap out. Comments wording and reviewed by: alc
* Fix the value for DECIMAL_DIG on UltraSparcs. The previous value ofdas2011-01-091-1/+1
| | | | | 35 wasn't quite big enough to ensure correct rounding for very-close- to-halfway cases.
* On mixed 32/64 bit architectures (mips, powerpc) use __LP64__ rather thantijl2011-01-081-2/+2
| | | | | | | | | | | | | architecture macros (__mips_n64, __powerpc64__) when 64 bit types (and corresponding macros) are different from 32 bit. [1] Correct the type of INT64_MIN, INT64_MAX and UINT64_MAX. Define (U)INTMAX_C as an alias for (U)INT64_C matching the type definition for (u)intmax_t. Do this on all architectures for consistency. Suggested by: bde [1] Approved by: kib (mentor)
* Fix types of some values in machine/_limits.h.tijl2011-01-081-9/+7
| | | | | | | | | | | | | | | | | On some architectures UCHAR_MAX and USHRT_MAX had type unsigned int. However, lacking integer suffixes for types smaller than int, their type should correspond to that of an object of type unsigned char (or short) when used in an expression with objects of type int. In that case unsigned char (short) are promoted to int (i.e. signed) so the type of UCHAR_MAX and USHRT_MAX should also be int. Where MIN/MAX constants implicitly have the correct type the suffix has been removed. While here, correct some comments. Reviewed by: bde Approved by: kib (mentor)
* Add AT_STACKPROT elf aux vector. Will be used to inform rtld about thekib2011-01-071-1/+2
| | | | initial stack protection set by the kernel image activator.
* Remove an unused variable accidentally added in r216803.marius2011-01-061-1/+0
|
* Inherit the APB and the generic OFW PCI-PCI bridge driver from the genericmarius2011-01-042-38/+5
| | | | PCI-PCI bridge driver in order to safe some code.
* Reserve INTR_MD[1-4] similarly to what BUS_DMA_BUS[1-4] are intended formarius2011-01-046-10/+12
| | | | | | | | | and switch sparc64 to use the first one for bus error filter handlers of bridge drivers instead of (ab)using INTR_FAST for that so we eventually can get rid of the latter. Reviewed by: jhb MFC after: 1 month
* Extend the section in which interrupts are disabled in the TLB demapmarius2011-01-021-6/+6
| | | | | | | | | | | functions, otherwise if we get preempted after checking whether a certain pmap is active on the current CPU but before disabling interrupts we might operate on an outdated state as the pmap might have been deactivated in the meantime. As the same issue may arises when the TLB demap function is interrupted by a TLB demap IPI, just entering a critical section before the check isn't sufficient so we have to fully disable interrupts instead. MFC after: 3 days
* On UltraSPARC-III+ and greater take advantage of ASI_ATOMIC_QUAD_LDD_PHYS,marius2010-12-297-112/+294
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | which takes an physical address instead of an virtual one, for loading TTEs of the kernel TSB so we no longer need to lock the kernel TSB into the dTLB, which only has a very limited number of lockable dTLB slots. The net result is that we now basically can handle a kernel TSB of any size and no longer need to limit the kernel address space based on the number of dTLB slots available for locked entries. Consequently, other parts of the trap handlers now also only access the the kernel TSB via its physical address in order to avoid nested traps, as does the PMAP bootstrap code as we haven't taken over the trap table at that point, yet. Apart from that the kernel TSB now is accessed via a direct mapping when we are otherwise taking advantage of ASI_ATOMIC_QUAD_LDD_PHYS so no further code changes are needed. Most of this is implemented by extending the patching of the TSB addresses and mask as well as the ASIs used to load it into the trap table so the runtime overhead of this change is rather low. Currently the use of ASI_ATOMIC_QUAD_LDD_PHYS is not yet enabled on SPARC64 CPUs due to lack of testing and due to the fact it might require minor adjustments there. Theoretically it should be possible to use the same approach also for the user TSB, which already is not locked into the dTLB, avoiding nested traps. However, for reasons I don't understand yet OpenSolaris only does that with SPARC64 CPUs. On the other hand I think that also addressing the user TSB physically and thus avoiding nested traps would get us closer to sharing this code with sun4v, which only supports trap level 0 and 1, so eventually we could have a single kernel which runs on both sun4u and sun4v (as does Linux and OpenBSD). Developed at and committed from: 27C3
* - Move the macros for generating load and store instructions to asmacros.hmarius2010-12-292-24/+24
| | | | | | so they can be shared by different source files and extend them by a variant for atomic compare and swap. - Consistently use EMPTY.
* Rename the "xor" parameter to "xorval" as the former is a reserved keywordmarius2010-12-291-13/+13
| | | | | | in C++. Submitted by: gahr
* Extend the hack of r182730 to trick GAS/GCC into compiling access tomarius2010-12-212-4/+6
| | | | | | STICK/STICK_COMPARE independently of the selected instruction set by TICK_COMPARE so tick.c as of r214358 once again can be compiled with gcc -mcpu=v9 for reference purposes.
* Revert r216080 so kmem_map is capped at 3/5 of the currently rather modestmarius2010-12-211-1/+2
| | | | | | | | | | kernel address space in order to leave space for the buffer cache, pipes, thread stacks, etc on machines with more physical memory until we take advantage of ASI_ATOMIC_QUAD_LDD_PHYS on CPUs providing it so we don't need to lock the kernel TSB pages into the dTLB, basically making the entire 64-bit kernel address space available on relevant machines. Submitted by: alc
* Revert r216134. This checkin broke platforms where bus_space are macros:brucec2010-12-031-59/+56
| | | | | they need to be a single statement, and do { } while (0) doesn't work in this situation so revert until a solution can be devised.
* Disallow passing in a count of zero bytes to the bus_space(9) functions.brucec2010-12-021-56/+59
| | | | | | | | | Passing a count of zero on i386 and amd64 for [I386|AMD64]_BUS_SPACE_MEM causes a crash/hang since the 'loop' instruction decrements the counter before checking if it's zero. PR: kern/80980 Discussed with: jhb
* Change VM_KMEM_SIZE_MAX to be just (VM_MAX_KERNEL_ADDRESS - ↵fjoe2010-11-301-2/+1
| | | | | | VM_MIN_KERNEL_ADDRESS) Suggested by: marius
* Define VM_KMEM_SIZE_MAX on sparc64. Otherwise kernel built withfjoe2010-11-281-0/+8
| | | | | | | | DEBUG_MEMGUARD panics early in kmeminit() with the message "kmem_suballoc: bad status return of 1" because of zero "size" argument passed to kmem_suballoc() due to "vm_kmem_size_max" being zero. The problem also exists on ia64.
* Convert drivers somehow missed in r200874 to multipass probing.marius2010-11-152-2/+4
|
* Enable reservation-based physical memory allocation. Even without thealc2010-11-101-2/+9
| | | | | | | | | creation of large page mappings in the pmap, it can provide modest performance benefits. In particular, for a "buildworld" on a 2x 1GHz Ultrasparc IIIi it reduced the wall clock time by 2.2% and the system time by 12.6%. Tested by: marius@
* - Remove <machine/mutex.h>. Most of the headers were empty, and thejhb2010-11-091-32/+0
| | | | | | | | | | | | contents of the ones that were not empty were stale and unused. - Now that <machine/mutex.h> no longer exists, there is no need to allow it to override various helper macros in <sys/mutex.h>. - Rename various helper macros for low-level operations on mutexes to live in the _mtx_* or __mtx_* namespaces. While here, change the names to more closely match the real API functions they are backing. - Drop support for including <sys/mutex.h> in assembly source files. Suggested by: bde (1, 2)
OpenPOWER on IntegriCloud