summaryrefslogtreecommitdiffstats
path: root/sys/sparc64
Commit message (Collapse)AuthorAgeFilesLines
* As it turns out r227960 may still be insufficient with PREEMPTIONmarius2012-01-282-16/+42
| | | | | | | | | | | | | | | | | | so try harder to get the CDMA sync interrupt delivered and also in a more efficient way: - wrap the whole process of sending and receiving the CDMA sync interrupt in a critical section so we don't get preempted, - send the CDMA sync interrupt to the CPU that is actually waiting for it to happen so we don't take a detour via another CPU, - instead of waiting for up to 15 seconds for the interrupt to trigger try the whole process for up to 15 times using a one second timeout (the code was also changed to just ignore belated interrupts of a previous tries should they appear). According to testing done by Peter Jeremy with the debugging also added as part of this commit the first two changes apparently are sufficient to now properly get the CDMA sync interrupts delivered at the first try though.
* Fully disable interrupts while we fiddle with the FP context in themarius2012-01-281-9/+9
| | | | | | VIS-based block copy/zero implementations. While with 4BSD it's sufficient to just disable the tick interrupts, with ULE+PREEMPTION it's otherwise also possible that these are preempted via IPIs.
* Commit file missed in r230633.marius2012-01-271-18/+19
|
* Now that we have a working OF_printf() since r230631 and a OF_panic()marius2012-01-274-90/+25
| | | | | | | | | | | | | | | | helper since r230632, use these for output and panicing during the early cycles and move cninit() until after the static per-CPU data has been set up. This solves a couple of issue regarding the non- availability of the static per-CPU data: - panic() not working and only making things worse when called, - having to supply a special DELAY() implementation to the low-level console drivers, - curthread accesses of mutex(9) usage in low-level console drivers that aren't conditional due to compiler optimizations (basically, this is the problem described in r227537 but in this case for keyboards attached via uart(4)). [1] PR: 164123 [1]
* - Now that we have a working OF_printf() since r230631, use it formarius2012-01-272-2/+17
| | | | | | implementing a simple OF_panic() that may be used during the early cycles when panic() isn't available, yet. - Mark cpu_{exit,shutdown}() as __dead2 as appropriate.
* For machines where the kernel address space is unrestricted increasemarius2012-01-271-1/+1
| | | | | | | | | | VM_KMEM_SIZE_SCALE to 2, awaiting more insight from alc@. As it turns out, the VM apparently has problems with machines that have large holes in the physical address space, causing the kmem_suballoc() call in kmeminit() to fail with a VM_KMEM_SIZE_SCALE of 1. Using a value of 2 allows these, namely Blade 1500 with 2GB of RAM, to boot. PR: 164227
* Mark cpu_{halt,reset}() as __dead2 as appropriate.marius2012-01-271-2/+2
|
* Add C11 macros describing subnormal numbers to float.h.das2012-01-231-0/+15
| | | | Reviewed by: bde
* Add the CAM Target Layer (CTL).ken2012-01-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CTL is a disk and processor device emulation subsystem originally written for Copan Systems under Linux starting in 2003. It has been shipping in Copan (now SGI) products since 2005. It was ported to FreeBSD in 2008, and thanks to an agreement between SGI (who acquired Copan's assets in 2010) and Spectra Logic in 2010, CTL is available under a BSD-style license. The intent behind the agreement was that Spectra would work to get CTL into the FreeBSD tree. Some CTL features: - Disk and processor device emulation. - Tagged queueing - SCSI task attribute support (ordered, head of queue, simple tags) - SCSI implicit command ordering support. (e.g. if a read follows a mode select, the read will be blocked until the mode select completes.) - Full task management support (abort, LUN reset, target reset, etc.) - Support for multiple ports - Support for multiple simultaneous initiators - Support for multiple simultaneous backing stores - Persistent reservation support - Mode sense/select support - Error injection support - High Availability support (1) - All I/O handled in-kernel, no userland context switch overhead. (1) HA Support is just an API stub, and needs much more to be fully functional. ctl.c: The core of CTL. Command handlers and processing, character driver, and HA support are here. ctl.h: Basic function declarations and data structures. ctl_backend.c, ctl_backend.h: The basic CTL backend API. ctl_backend_block.c, ctl_backend_block.h: The block and file backend. This allows for using a disk or a file as the backing store for a LUN. Multiple threads are started to do I/O to the backing device, primarily because the VFS API requires that to get any concurrency. ctl_backend_ramdisk.c: A "fake" ramdisk backend. It only allocates a small amount of memory to act as a source and sink for reads and writes from an initiator. Therefore it cannot be used for any real data, but it can be used to test for throughput. It can also be used to test initiators' support for extremely large LUNs. ctl_cmd_table.c: This is a table with all 256 possible SCSI opcodes, and command handler functions defined for supported opcodes. ctl_debug.h: Debugging support. ctl_error.c, ctl_error.h: CTL-specific wrappers around the CAM sense building functions. ctl_frontend.c, ctl_frontend.h: These files define the basic CTL frontend port API. ctl_frontend_cam_sim.c: This is a CTL frontend port that is also a CAM SIM. This frontend allows for using CTL without any target-capable hardware. So any LUNs you create in CTL are visible in CAM via this port. ctl_frontend_internal.c, ctl_frontend_internal.h: This is a frontend port written for Copan to do some system-specific tasks that required sending commands into CTL from inside the kernel. This isn't entirely relevant to FreeBSD in general, but can perhaps be repurposed. ctl_ha.h: This is a stubbed-out High Availability API. Much more is needed for full HA support. See the comments in the header and the description of what is needed in the README.ctl.txt file for more details. ctl_io.h: This defines most of the core CTL I/O structures. union ctl_io is conceptually very similar to CAM's union ccb. ctl_ioctl.h: This defines all ioctls available through the CTL character device, and the data structures needed for those ioctls. ctl_mem_pool.c, ctl_mem_pool.h: Generic memory pool implementation used by the internal frontend. ctl_private.h: Private data structres (e.g. CTL softc) and function prototypes. This also includes the SCSI vendor and product names used by CTL. ctl_scsi_all.c, ctl_scsi_all.h: CTL wrappers around CAM sense printing functions. ctl_ser_table.c: Command serialization table. This defines what happens when one type of command is followed by another type of command. ctl_util.c, ctl_util.h: CTL utility functions, primarily designed to be used from userland. See ctladm for the primary consumer of these functions. These include CDB building functions. scsi_ctl.c: CAM target peripheral driver and CTL frontend port. This is the path into CTL for commands from target-capable hardware/SIMs. README.ctl.txt: CTL code features, roadmap, to-do list. usr.sbin/Makefile: Add ctladm. ctladm/Makefile, ctladm/ctladm.8, ctladm/ctladm.c, ctladm/ctladm.h, ctladm/util.c: ctladm(8) is the CTL management utility. It fills a role similar to camcontrol(8). It allow configuring LUNs, issuing commands, injecting errors and various other control functions. usr.bin/Makefile: Add ctlstat. ctlstat/Makefile ctlstat/ctlstat.8, ctlstat/ctlstat.c: ctlstat(8) fills a role similar to iostat(8). It reports I/O statistics for CTL. sys/conf/files: Add CTL files. sys/conf/NOTES: Add device ctl. sys/cam/scsi_all.h: To conform to more recent specs, the inquiry CDB length field is now 2 bytes long. Add several mode page definitions for CTL. sys/cam/scsi_all.c: Handle the new 2 byte inquiry length. sys/dev/ciss/ciss.c, sys/dev/ata/atapi-cam.c, sys/cam/scsi/scsi_targ_bh.c, scsi_target/scsi_cmds.c, mlxcontrol/interface.c: Update for 2 byte inquiry length field. scsi_da.h: Add versions of the format and rigid disk pages that are in a more reasonable format for CTL. amd64/conf/GENERIC, i386/conf/GENERIC, ia64/conf/GENERIC, sparc64/conf/GENERIC: Add device ctl. i386/conf/PAE: The CTL frontend SIM at least does not compile cleanly on PAE. Sponsored by: Copan Systems, SGI and Spectra Logic MFC after: 1 month
* Add "options CAPABILITY_MODE" and "options CAPABILITIES" to GENERIC kernelrwatson2011-12-291-0/+2
| | | | | | | | | | configurations for various architectures in FreeBSD 10.x. This allows basic Capsicum functionality to be used in the default FreeBSD configuration on non-embedded architectures; process descriptors are not yet enabled by default. MFC after: 3 months Sponsored by: Google, Inc
* Eliminate vestiges of page coloring.alc2011-12-151-2/+1
|
* Replace __signed by signed.ed2011-12-131-1/+1
| | | | | The signed keyword is an integral part of the C syntax. There's no need to use __signed.
* Revert r225889 a bit. While it's correct that in total store order there'smarius2011-12-031-1/+4
| | | | | | no need to additionally add CPU memory barriers to the acquire variants of atomic(9), these are documented to also include compiler memory barriers. So add the latter, which were previously included by using membar(), back.
* Fix OF_finddevice error return value in case of FDT.jchandra2011-12-022-2/+2
| | | | | | | | | | | | | | | | | | | According to the open firmware standard, finddevice call has to return a phandle with value of -1 in case of error. This commit is to: - Fix the FDT implementation of this interface (ofw_fdt_finddevice) to return (phandle_t)-1 in case of error, instead of 0 as it does now. - Fix up the callers of OF_finddevice() to compare the return value with -1 instead of 0 to check for errors. - Since phandle_t is unsigned, the return value of OF_finddevice should be checked with '== -1' rather than '<= 0' or '> 0', fix up these cases as well. Reported by: nwhitehorn Reviewed by: raj Approved by: raj, nwhitehorn
* Update comment.marius2011-11-271-8/+7
|
* For sparc64 also adjust the geometry of da(4) driven disks to not overflowmarius2011-11-272-3/+78
| | | | | | | | | | | the 16-bit cylinders field of the VTOC8 disk label (at around 502GB). The geometry chosen for disks above that limit allows to use disks up to 2TB, which is the limit of the extended VTOC8 format. The geometry used for disks smaller than the 16-bit cylinders limit stays the same as used by cam_calc_geometry(9) for extended translation. Thanks to Hans-Joerg Sirtl for providing hardware for testing this change. MFC after: 3 days
* Move to SCHED_ULE by default. Since r226057 SCHED_ULE and sparc64 aremarius2011-11-251-1/+1
| | | | | | | | | compatible with each other and since r227539 the last issue seen when using SCHED_ULE is fixed. At least on UP and 2-way machines SCHED_4BSD still performs better than SCHED_ULE, however, the optimizations done in r225889 pretty much compensate that so there's at least no net regression. Thanks go to Peter Jeremy for extensive testing.
* Increase the CDMA sync timeout for Schizo bridges to 15 seconds as used bymarius2011-11-241-1/+1
| | | | | | | | OpenSolaris. One second turned out to be not enough for certain loads while 10 seconds were sufficient. Reported by: Peter Jeremy MFC after: 3 days
* s,KOBJMETHOD_END,DEVMETHOD_END,g in order to fully hide the explicit mentionmarius2011-11-2217-19/+19
| | | | of kobj(9) from device drivers.
* - There's no need to overwrite the default device method with the defaultmarius2011-11-224-11/+6
| | | | | | | | | | one. Interestingly, these are actually the default for quite some time (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9) since r52045) but even recently added device drivers do this unnecessarily. Discussed with: jhb, marcel - While at it, use DEVMETHOD_END. Discussed with: jhb - Also while at it, use __FBSDID.
* Fix make universe.pjd2011-11-161-1/+1
|
* Define curthread as an inline function that loads the thread pointermarius2011-11-151-0/+10
| | | | | | | | directly from g7, the pcpu pointer. This guarantees correct behavior when the thread migrates to a different CPU. Commit message stolen from r205431. Additional testing by Peter Jeremy. MFC after: 3 days
* Introduce the option VFS_ALLOW_NONMPSAFE and turn it on by default onattilio2011-11-081-0/+3
| | | | | | | | | | | | | | all the architectures. The option allows to mount non-MPSAFE filesystem. Without it, the kernel will refuse to mount a non-MPSAFE filesytem. This patch is part of the effort of killing non-MPSAFE filesystems from the tree. No MFC is expected for this patch. Tested by: gianni Reviewed by: kib
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.ed2011-11-072-2/+2
| | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static.
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.ed2011-11-071-1/+1
| | | | This means that their use is restricted to a single C file.
* Add a PCI front-end to esp(4) allowing it to support AMD Am53C974 andmarius2011-11-011-1/+1
| | | | | | | | | | | | | replace amd(4) with the former in the amd64, i386 and pc98 GENERIC kernel configuration files. Besides duplicating functionality, amd(4), which previously also supported the AMD Am53C974, unlike esp(4) is no longer maintained and has accumulated enough bit rot over time to always cause a panic during boot as long as at least one target is attached to it (see PR 124667). PR: 124667 Obtained from: NetBSD (based on) MFC after: 3 days
* Actually, limit to 32-bit DMA for the transfer buffers as the address ismarius2011-10-301-2/+2
| | | | written into a 32-bit register.
* Correct the DMA constraints, the LSI64854 isn't limited to 32-bit DMA.marius2011-10-301-3/+3
|
* - Use device_t rather than the NetBSDish struct device.marius2011-10-302-104/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move esp_devclass to ncr53c9x.c in order to allow different bus front-ends to use it. - Use KOBJMETHOD_END. - Remove the gl_clear_latched_intr hook as it's not needed for any of the chips nor the front-ends supported in FreeBSD and likely never will be. - Correct the DMA constraints used in the SBus front-end, the LSI64854 isn't limited to 32-bit DMA. - The ESP200 also only supports up to 64k transfers. - Don't let the DMA and SBus front-end supply a maximum transfer size larger than MAXPHYS as that's the maximum the upper layers use and we otherwise just waste resources unnecessarily. - Initialize the ECB callout and don't zero the handle when returning ECBs to the free list so that ncr53c9x_callout() actually is called with the driver lock held. - On detach the driver lock should be held across cam_sim_free() according to isp(4) and a panic received. - Check the return value of NCRDMA_SETUP(), i.e. bus_dmamap_load(9), and try to handle failures gracefully. - In ncr53c9x_action() replace N calls to xpt_done() in a switch with just one at the end. - On XPT_PATH_INQ report "NCR" rather than "Sun" as the vendor as the former is somewhat more correct as well as the maximum supported transfer size via maxio in order to take advantage of controllers that that can handle more than DFLTPHYS. - Print the number of MESSAGE (EXTENDED) rejected. - Fix the path encoded in the multiple inclusion protection of ncr53c9xvar.h. - Correct the DMA constraints used in the LSI64854 core to not exceed the maximum supported transfer size and include the boundary so we don't need to check on every setup of a DMA transfer. - Let the bus DMA map callbacks do nothing in case of an error. - Correctly handle > 64k transfers for FAS366 in the LSI64854. A new feature flag NCR_F_LARGEXFER was introduced so we just need to check for this one and not for individual controllers supporting large transfers in several places. - Let the LSI64854 core load transfer buffers using BUS_DMA_NOWAIT as the NCR53C9x core can't handle EINPROGRESS. Due to lack of bounce buffers support, sparc64 doesn't actually use EINPROGRESS and likely never will, as an example for writing additional front-ends for the NCR53C9x core it makes sense to set BUS_DMA_NOWAIT anyway though. - Some minor cleanup.
* Adjust the debugger options slightly. This should help me do the rightkensmith2011-10-271-1/+4
| | | | | | | | thing when changing the debugging options as part of head becoming a new stable branch. It may also help people who for one reason or another want to run head but don't want it slowed down by the debugging support. Reviewed by: kib
* People porting FreeBSD to new architectures ought not have todas2011-10-211-0/+11
| | | | | | | | | | | | | implement a deprecated FPU control interface in addition to the standard one. To make this clearer, further deprecate ieeefp.h by not declaring the function prototypes except on architectures that implement them already. Currently i386 and amd64 implement the ieeefp.h interface for compatibility, and for fp[gs]etprec(), which doesn't exist on most other hardware. Powerpc, sparc64, and ia64 partially implement it and probably shouldn't, and other architectures don't implement it at all.
* Add a warning about why sbp(4) is commented out so that curious folkskensmith2011-10-191-0/+1
| | | | | | | are forewarned they might wind up with a hole in their foot if they decide to give it a try. Suggested by: dougb
* Comment out the sbp(4) driver for architectures that support it.kensmith2011-10-181-1/+1
| | | | | | | | | | | As part of the 8.0-RELEASE cycle this was done in stable/8 (r199112) but was left alone in head so people could work on fixing an issue that caused boot failure on some motherboards. Apparently nobody has worked on it and we are getting reports of boot failure with the 9.0 test builds. So this time I'll comment out the driver in head (still hoping someone will work on it) and MFC to stable/9. Submitted by: Alberto Villa <avilla at FreeBSD dot org>
* Trace attempts to call restricted MD syscalls.des2011-10-181-0/+4
|
* Merge from NetBSD:marius2011-10-152-16/+20
| | | | | | | - Remove clause 3 and 4 from TNF licenses. - Fix memset usage. - Various cleanup. - Kill caddr_t.
* Remove unused define.kib2011-10-071-1/+0
| | | | MFC after: 1 month
* - Use atomic operations rather than sched_lock for safely assigning pm_activemarius2011-10-063-27/+129
| | | | | | | | and pc_pmap for SMP. This is key to allowing adding support for SCHED_ULE. Thanks go to Peter Jeremy for additional testing. - Add support for SCHED_ULE to cpu_switch(). Committed from: 201110DevSummit
* Actually enable NEW_PCIB by default, missed in r225931.marius2011-10-021-1/+1
|
* Make sparc64 compatible with NEW_PCIB and enable it:marius2011-10-0220-499/+630
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Implement bus_adjust_resource() methods as far as necessary and in non-PCI bridge drivers as far as feasible without rototilling them. - As NEW_PCIB does a layering violation by activating resources at layers above pci(4) without previously bubbling up their allocation there, move the assignment of bus tags and handles from the bus_alloc_resource() to the bus_activate_resource() methods like at least the other NEW_PCIB enabled architectures do. This is somewhat unfortunate as previously sparc64 (ab)used resource activation to indicate whether SYS_RES_MEMORY resources should be mapped into KVA, which is only necessary if their going to be accessed via the pointer returned from rman_get_virtual() but not for bus_space(9) as the later always uses physical access on sparc64. Besides wasting KVA if we always map in SYS_RES_MEMORY resources, a driver also may deliberately not map them in if the firmware already has done so, possibly in a special way. So in order to still allow a driver to decide whether a SYS_RES_MEMORY resource should be mapped into KVA we let it indicate that by calling bus_space_map(9) with BUS_SPACE_MAP_LINEAR as actually documented in the bus_space(9) page. This is implemented by allocating a separate bus tag per SYS_RES_MEMORY resource and passing the resource via the previously unused bus tag cookie so we later on can call rman_set_virtual() in sparc64_bus_mem_map(). As a side effect this now also allows to actually indicate that a SYS_RES_MEMORY resource should be mapped in as cacheable and/or read-only via BUS_SPACE_MAP_CACHEABLE and BUS_SPACE_MAP_READONLY respectively. - Do some minor cleanup like taking advantage of rman_init_from_resource(), factor out the common part of bus tag allocation into a newly added sparc64_alloc_bus_tag(), hook up some missing newbus methods and replace some homegrown versions with the generic counterparts etc. - While at it, let apb_attach() (which can't use the generic NEW_PCIB code as APB bridges just don't have the base and limit registers implemented) regarding the config space registers cached in pcib_softc and the SYSCTL reporting nodes set up.
* Remove obsolete macros.marius2011-10-011-6/+0
|
* Nuke SUN4U #ifdef's which with the demise of sun4v no longer serve anymarius2011-10-011-15/+1
| | | | purpose.
* Also allocate space for the PIL counters. Given that no machine actuallymarius2011-10-011-4/+4
| | | | uses IV_MAX interrupt vectors this wasn't a problem in practice though.
* Re-reading the Schizo errata suggests that it's actually tolerable tomarius2011-10-011-3/+3
| | | | | | also use the streaming buffer of pre version 5/revision 2.3 hardware as long as we stay away from context flushes (which iommu(4) so far doesn't take advantage of). OpenSolaris does the same.
* - Add protective parentheses to macros as far as possible.marius2011-10-011-41/+41
| | | | | - Move {r,w,}mb() to the top of this file where they live on most of the other architectures.
* In total store which we use for running the kernel and all of the userlandmarius2011-10-011-8/+9
| | | | | | | | | | | atomic operations behave as if the were followed by a memory barrier so there's no need to include ones in the acquire variants of atomic(9). Removing these results a small performance improvement, specifically this is sufficient to compensate the performance loss seen in the worldstone benchmark seen when using SCHED_ULE instead of SCHED_4BSD. This change is inspired by Linux even more radically doing the equivalent thing some time ago. Thanks go to Peter Jeremy for additional testing.
* Add a comment about why contrary to what once would think running all ofmarius2011-09-301-0/+4
| | | | userland with total store order actually is appropriate.
* Use the extended integer condition code when comparing 64-bit values. Givenmarius2011-09-301-1/+1
| | | | that ATOMIC_INC_LONG currently is unused this happened to not be fatal.
* - Right-justify backslashes as suggested by style(9).marius2011-09-301-55/+55
| | | | | - Rename ATOMIC_INC_ULONG to ATOMIC_INC_LONG in order to be consistent with the names of the other macros in this file an adjust accordingly.
* Remove locking of the vm page queues from several pmaps, which onlykib2011-09-281-2/+1
| | | | | | | | | protected the dirty mask updates. The dirty mask updates are handled by atomics after the r225840. Submitted by: alc Tested by: flo (sparc64) MFC after: 2 weeks
* It is safe to initialize locks even on early boot (and it is the sameattilio2011-09-192-8/+1
| | | | | | | | | | | thing all the other architectures already do) thus just initialize kernel_pmap in pmap_bootstrap(). Reported by: alc Reviewed by: alc, marius Tested by: flo, marius Approved by: re (kib) MFC after: 1 week
OpenPOWER on IntegriCloud