aboutsummaryrefslogtreecommitdiff
path: root/sys/sys
Commit message (Collapse)AuthorAgeFilesLines
* Introduce an architecture-agnostic <sys/_stdarg.h> to reducePoul-Henning Kamp2017-12-251-0/+69
| | | | | | | | | | | | | platform divergence. Only architectures which pass arguments in registers (mips) and platforms which use really weird compilers (any?) would need to augment the contents of <sys/_stdarg.h> Convert x86, arm and arm64 architectures to use <sys/_stdarg.h> Notes: svn path=/head/; revision=327182
* Use resume_cpus() instead of restart_cpus() to resume from ACPI suspension.Bruce Evans2017-12-211-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | restart_cpus() worked well enough by accident. Before this set of fixes, resume_cpus() used the same cpuset (started_cpus, meaning CPUs directed to restart) as restart_cpus(). resume_cpus() waited for the wrong cpuset (stopped_cpus) to become empty, but since mixtures of stopped and suspended CPUs are not close to working, stopped_cpus must be empty when resuming so the wait is null -- restart_cpus just allows the other CPUs to restart and returns without waiting. Fix resume_cpus() to wait on a non-wrong cpuset for the ACPI case, and add further kludges to try to keep it working for the XEN case. It was only used for XEN. It waited on suspended_cpus. This works for XEN. However, for ACPI, resuming is a 2-step process. ACPI has already woken up the other CPUs and removed them from suspended_cpus. This fix records the move by putting them in a new cpuset resuming_cpus. Waiting on suspended_cpus would give the same null wait as waiting on stopped_cpus. Wait on resuming_cpus instead. Add a cpuset toresume_cpus to map the CPUs being told to resume to keep this separate from the cpuset started_cpus for mapping the CPUs being told to restart. Mixtures of stopped and suspended/resuming CPUs are still far from working. Describe new and some old cpusets in comments. Add further kludges to cpususpend_handler() to try to avoid breaking it for XEN. XEN doesn't use resumectx(), so it doesn't use the second return path for savectx(), and it goes from the suspended state directly to the restarted state, while ACPI resume goes through the resuming state. Enter the resuming state early for all cases so that resume_cpus can test for being in this state and not have to worry about the intermediate !suspended state for ACPI only. Reviewed by: kib Notes: svn path=/head/; revision=327056
* Revert r327005 - SPDX tags for license similar to BSD-2-Clause.Pedro F. Giffuni2017-12-202-4/+0
| | | | | | | | | | | | | | | | | | After consultation with SPDX experts and their matching guidelines[1], the licensing doesn't exactly match the BSD-2-Clause. It yet remains to be determined if they are equivalent or if there is a recognized license that matches but it is safer to just revert the tags. Let this also be a reminder that on FreeBSD, SPDX tags are only advisory and have no legal value (but IANAL). Pointyhat to: pfg Thanks to: Rodney Grimes, Gary O'Neall [1] https://spdx.org/spdx-license-list/matching-guidelines Notes: svn path=/head/; revision=327040
* SPDX: These are fundamentally BSD-2-Clause.Pedro F. Giffuni2017-12-192-2/+2
| | | | | | | They just omit the introductory line and numbering. Notes: svn path=/head/; revision=327005
* Add a custom VOP_PATHCONF method for fdescfs.John Baldwin2017-12-191-0/+1
| | | | | | | | | | | | | | | The method handles NAME_MAX and LINK_MAX explicitly. For all other pathconf variables, the method passes the request down to the underlying file descriptor. This requires splitting a kern_fpathconf() syscallsubr routine out of sys_fpathconf(). Also, to avoid lock order reversals with vnode locks, the fdescfs vnode is unlocked around the call to kern_fpathconf(), but with the usecount of the vnode bumped. MFC after: 1 month Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=326986
* Update Matthew Macy contact infoStephen Hurd2017-12-191-1/+1
| | | | | | | | | | Email address has changed, uses consistent name (Matthew, not Matt) Reported by: Matthew Macy <mmacy@mattmacy.io> Differential Revision: https://reviews.freebsd.org/D13537 Notes: svn path=/head/; revision=326984
* Add atomic_load(9) and atomic_store(9) operations.Konstantin Belousov2017-12-191-0/+73
| | | | | | | | | | | | | | | | | | | | | | | They provide relaxed-ordered atomic access semantic. Due to the FreeBSD memory model, the operations are syntaxical wrappers around the volatile accesses. The volatile qualifier is used to ensure that the access not optimized out and in turn depends on the volatile semantic as implemented by supported compilers. The motivation for adding the operation is to help people coming from other systems or knowing the C11/C++ standards where atomics have special type and require use of the special access operations. It is still the case that FreeBSD requires plain load and stores of aligned integer types to be atomic. Suggested by: jhb Reviewed by: alc, jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13534 Notes: svn path=/head/; revision=326971
* SPDX: some uses of the RSA-MD license.Pedro F. Giffuni2017-12-132-0/+4
| | | | Notes: svn path=/head/; revision=326828
* SPDX: mostly fixes to previous changes.Pedro F. Giffuni2017-12-1327-5/+51
| | | | | | | | Introduce the recently approved BSD-1-Clause and replace 0BSD which never did fit well our use cases. Notes: svn path=/head/; revision=326823
* Pass the trap frame to fasttrap hooks.Mark Johnston2017-12-111-3/+2
| | | | | | | | | | | | | The DTrace fasttrap entry points expect a struct reg containing the register values of the calling thread. Perform the conversion in fasttrap rather than in the trap handler: this reduces the number of ifdefs and avoids wasting stack space for traps that don't involve DTrace. MFC after: 2 weeks Notes: svn path=/head/; revision=326774
* Use correct field in the description for the lock after r319722.Bjoern A. Zeeb2017-12-071-1/+1
| | | | | | | | Reviewed by: glebius Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=326665
* Use unsigned intptr_t type for framebuffer addressesJustin Hibbits2017-12-061-2/+2
| | | | | | | | | | | | | | | | | Summary: Some architectures (powerpc Book-E) have a vm_paddr_t larger than intptr_t. Casting from the intptr_t to vm_paddr_t causes sign extension, leading to a potentially invalid address. This was seen when running X on a PowerPC P1022 machine, which mapped the backing framebuffer at 0xc1800000. When mmap()d by X, this yielded an invalid address of 0xffffffffc1800000, or, as the hardware would see it, 0xfc1800000. Reviewed By: ray Differential Revision: https://reviews.freebsd.org/D13332 Notes: svn path=/head/; revision=326611
* use @@@ instead of @@ in __sym_defaultEd Maste2017-12-051-2/+2
| | | | | | | | | | | | | | | | | | | | Using .symver foo,foo@@VER causes foo and foo@@VER to be output to the .o file. This requires foo to be weak since the linker handles foo@@VER as foo. Using .symver foo,foo@@@VER causes just foo@@ver to be output and avoid the need for making foo weak. It also reduces the constraint on how exactly a linker has to handle foo and foo@@VER being present. Submitted by: Rafael EspĂ­ndola Reviewed by: dim, kib Differential Revision: https://reviews.freebsd.org/D11653 Notes: svn path=/head/; revision=326576
* Allow this file to be used in libsa without warning...Warner Losh2017-12-031-1/+1
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=326489
* We don't need both _STAND and _STANDALONE. There's more places thatWarner Losh2017-12-021-1/+1
| | | | | | | | | use _STANDALONE, so change the former to the latter. Sponsored by: Netflix Notes: svn path=/head/; revision=326443
* SPDX: use the Beerware identifier.Pedro F. Giffuni2017-11-303-0/+6
| | | | Notes: svn path=/head/; revision=326408
* SPDX: Fix some cases wrongly attributed to MIT.Pedro F. Giffuni2017-11-303-3/+3
| | | | | | | | In the cases of BSD-style license variants without clauses, use 0BSD for the time being in lack of a better description. Notes: svn path=/head/; revision=326398
* Eliminate kmem_arena and kmem_object in preparation for further NUMA commits.Jeff Roberson2017-11-281-0/+6
| | | | | | | | | | | | | | | | | | | | The arena argument to kmem_*() is now only used in an assert. A follow-up commit will remove the argument altogether before we freeze the API for the next release. This replaces the hard limit on kmem size with a soft limit imposed by UMA. When the soft limit is exceeded we periodically wakeup the UMA reclaim thread to attempt to shrink KVA. On 32bit architectures this should behave much more gracefully as we exhaust KVA. On 64bit the limits are likely never hit. Reviewed by: markj, kib (some objections) Discussed with: alc Tested by: pho Sponsored by: Netflix / Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D13187 Notes: svn path=/head/; revision=326347
* Make kdb_reenter() silent when explicitly called from db_error().Edward Tomasz Napierala2017-11-281-0/+1
| | | | | | | | | | | | | This removes the useless backtrace on various ddb(4) user errors. Reviewed by: jhb@ Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D13212 Notes: svn path=/head/; revision=326314
* sys/sys: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-27157-4/+318
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326256
* Convert in-kernel thread_lock_flags calls to thread_lock when debug is disabledMateusz Guzik2017-11-251-0/+6
| | | | | | | The flags argument is not used in this case. Notes: svn path=/head/; revision=326199
* Decode kevent structures logged via ktrace(2) in kdump.John Baldwin2017-11-252-1/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add a new KTR_STRUCT_ARRAY ktrace record type which dumps an array of structures. The structure name in the record payload is preceded by a size_t containing the size of the individual structures. Use this to replace the previous code that dumped the kevent arrays dumped for kevent(). kdump is now able to decode the kevent structures rather than dumping their contents via a hexdump. One change from before is that the 'changes' and 'events' arrays are not marked with separate 'read' and 'write' annotations in kdump output. Instead, the first array is the 'changes' array, and the second array (only present if kevent doesn't fail with an error) is the 'events' array. For kevent(), empty arrays are denoted by an entry with an array containing zero entries rather than no record. - Move kevent decoding tables from truss to libsysdecode. This adds three new functions to decode members of struct kevent: sysdecode_kevent_filter, sysdecode_kevent_flags, and sysdecode_kevent_fflags. kdump uses these helper functions to pretty-print kevent fields. - Move structure definitions for freebsd11 and freebsd32 kevent structures to <sys/event.h> so that they can be shared with userland. The 32-bit structures are only exposed if _WANT_KEVENT32 is defined. The freebsd11 structures are only exposed if _WANT_FREEBSD11_KEVENT is defined. The 32-bit freebsd11 structure requires both. - Decode freebsd11 kevent structures in truss for the compat11.kevent() system call. - Log 32-bit kevent structures via ktrace for 32-bit compat kevent() system calls. - While here, constify the 'void *data' argument to ktrstruct(). Reviewed by: kib (earlier version) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D12470 Notes: svn path=/head/; revision=326184
* Add rudimentary support for building FreeBSD/arm64 with COMPAT_FREEBSD32.Ed Schouten2017-11-241-1/+1
| | | | | | | | | | | | | | | | | | | | Right now I'm using two Raspberry Pi's (2 and 3) to test CloudABI support for armv6, armv7 and aarch64. It would be nice if I could restrict this to just a single instance when testing smaller changes. This is why I'd like to get COMPAT_CLOUDABI32 to work on arm64. As COMPAT_CLOUDABI32 depends on COMPAT_FREEBSD32, at least for the ELF loading, this change adds all of the bits necessary to at least build a kernel with COMPAT_FREEBSD32. All of the machine dependent system calls are still stubbed out, for the reason that implementations for these are only useful if actual support for running FreeBSD binaries is added. This is outside the scope of this work. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D13144 Notes: svn path=/head/; revision=326165
* Remove lint support from system headers and MD x86 headers.Konstantin Belousov2017-11-233-20/+3
| | | | | | | | | | Reviewed by: dim, jhb Discussed with: imp Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D13156 Notes: svn path=/head/; revision=326123
* Kill all descendants of the reaper, even if they are descendants of aKonstantin Belousov2017-11-231-0/+1
| | | | | | | | | | | | | | | | subordinate reaper. Also, mark reapers when listing pids. Reported by: Michael Zuo <muh.muhten@gmail.com> PR: 223745 Reviewed by: bapt Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13183 Notes: svn path=/head/; revision=326122
* locks: pass the found lock value to unlock slow pathMateusz Guzik2017-11-223-17/+23
| | | | | | | | | This avoids an explicit read later. While here whack the cheaply obtainable 'tid' argument. Notes: svn path=/head/; revision=326107
* locks: remove the file + line argument from internal primitives when not usedMateusz Guzik2017-11-224-17/+63
| | | | | | | | | | | | | The pair is of use only in debug or LOCKPROF kernels, but was passed (zeroed) for many locks even in production kernels. While here whack the tid argument from wlock hard and xlock hard. There is no kbi change of any sort - "external" primitives still accept the pair. Notes: svn path=/head/; revision=326106
* Clean up the SYSINIT_FLAGS definitions for rwlock(9) and rmlock(9).Mark Johnston2017-11-212-35/+7
| | | | | | | | | | Avoid duplication in their macro definitions, and document them. No functional change intended. MFC after: 1 week Notes: svn path=/head/; revision=326060
* sys: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2098-0/+196
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326023
* spdx: initial adoption of licensing ID tags.Pedro F. Giffuni2017-11-185-0/+10
| | | | | | | | | | | | | | | | | | | | The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Initially, only tag files that use BSD 4-Clause "Original" license. RelNotes: yes Differential Revision: https://reviews.freebsd.org/D13133 Notes: svn path=/head/; revision=325966
* Rename P_OSREL_CK_CLYGRP to P_OSREL_CK_CYLGRPScott Long2017-11-171-1/+1
| | | | Notes: svn path=/head/; revision=325934
* Only try to enable CK_CLYGRP if we're running on kernel newer thanWarner Losh2017-11-161-0/+1
| | | | | | | | | | | | | | 1200046, the first version that supports this feature. If we set it, then use an old kernel, we'll break the 'contract' of having checksummed cylinder groups this flag signifies. To avoid creating something with an inconsistent state, don't turn the flag on in these cases. The first full fsck with a new kernel will turn this on. Spnsored by: Netflix Differential Revision: https://reviews.freebsd.org/D13114 Notes: svn path=/head/; revision=325903
* vmtotal: extend memory counters to accomodate for current and futureKonstantin Belousov2017-11-152-15/+19
| | | | | | | | | | | | | | | | | | | | | hardware sizes. 32bit counters already overflow on approachable virtual memory page counts, and soon would overflow on the physical pages counts as well. Bump sizes to 64bit types. Bump __FreeBSD_version. It is impossible to provide perfect backward ABI compat for this change. If a program requests an old structure, it can be detected by size. But if it queries the size first by passing NULL old req pointer, there is almost nothing we can do to detect the desired ABI. As a partial solution, check p_osrel of the quering process when selecting the size to report. Submitted by: Pawel Biernacki <pawel.biernacki@gmail.com> Differential revision: https://reviews.freebsd.org/D13018 Notes: svn path=/head/; revision=325852
* Use #if instead of #ifdef for __BSD_VISIBLE tests.John Baldwin2017-11-142-2/+2
| | | | | | | | | | | | | | __BSD_VISIBLE is always defined and it's value instead needs to be tested via #if to determine if FreeBSD-specific APIs should be exposed. PR: 196226, 223481 (exp-run) Submitted by: pluknet MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D12977 Notes: svn path=/head/; revision=325835
* Add __BEGIN_DECLS and __END_DECLS to <sys/umtx.h>Eric van Gyzen2017-11-131-0/+4
| | | | | | | | | | This allows C++ programs to call _umtx_op(). MFC after: 3 days Sponsored by: Dell EMC Notes: svn path=/head/; revision=325764
* Add pfind_anyMateusz Guzik2017-11-111-0/+1
| | | | | | | | It looks for both regular and zombie processes. This avoids allproc relocking previously seen with pfind -> zpfind calls. Notes: svn path=/head/; revision=325721
* systm.h: Include cdefs.h firstConrad Meyer2017-11-101-1/+1
| | | | | | | | | | | | | | | | | | Ever since r143063, machine/atomic.h requires cdefs.h. So, include it first. Weak support: style(9) tells us to include cdefs.h first. Argument against: since code that includes systm.h still compiles, compilation units that include systm.h must already include cdefs.h. So, an argument could be made that the cdefs.h include could just be removed entirely. That is maybe a bigger change and not one I am interested in bikeshedding. Universe compiles. Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325625
* Introduce EVENTHANDLER_LIST and some users.Matt Joras2017-11-091-8/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a facility to EVENTHANDLER(9) for explicitly defining a reference to an event handler list. This is useful since previously all invokers of events had to do a locked traversal of the global list of event handler lists in order to find the appropriate event handler list. By keeping a pointer to the appropriate list an invoker can avoid this traversal completely. The pointer is initialized with SYSINIT(9) during the eventhandler stage. Users registering interest in events do not need to know if the event is backed by such a list, since the list is added to the global list of lists. As with lists that are not pre-defined it is safe to register for the events before the list has been created. This converts the process_* and thread_* events to using the new facility, as these are events whose locked traversals end up showing up significantly in ports build workflows (and presumably other workflows with many short lived threads/procs). It may be advantageous to convert other events to using the new facility. The el_flags field is now unused, but leave it be so that this revision can be MFC'd. Reviewed by: bdrewery, markj, mjg Approved by: rstone (mentor) In collaboration with: ian MFC after: 4 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12814 Notes: svn path=/head/; revision=325621
* Bump __FreeBSD_version after struct mbuf KBI breakage in r325506.Konstantin Belousov2017-11-071-1/+1
| | | | | | | Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=325509
* Use hardware timestamps to report packet timestamps for SO_TIMESTAMPKonstantin Belousov2017-11-071-0/+11
| | | | | | | | | | | | | | | | | | | and other similar socket options. Provide new control message SCM_TIME_INFO to supply information about timestamp. Currently it indicates that the timestamp was hardware-assisted and high-precision, for software timestamps the message is not returned. Reserved fields are added to ABI to report additional info about it, it is expected that raw hardware clock value might be useful for some applications. Reviewed by: gallatin (previous version), hselasky Sponsored by: Mellanox Technologies MFC after: 2 weeks X-Differential revision: https://reviews.freebsd.org/D12638 Notes: svn path=/head/; revision=325507
* Add a place for a driver to report rx timestamps in nanoseconds fromKonstantin Belousov2017-11-071-8/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | boot for the received packets. The rcv_tstmp field overlaps the place of Ln header length indicators, not used by received packets. The basic pkthdr rearrangement change in sys/mbuf.h was provided by gallatin. There are two accompanying M_ flags: M_TSTMP means that there is the timestamp (and it was generated by hardware). Another flag M_TSTMP_HPREC indicates that the timestamp is high-precision. Practically M_TSTMP_HPREC means that hardware provided additional precision comparing with the stamps when the flag is not set. E.g., for ConnectX all packets are stamped by hardware when PCIe transaction to write out the completion descriptor is performed, but PTP packet are stamped on port. For Intel cards, when PTP assist is enabled, only PTP packets are stamped in the limited number of registers, so if Intel cards ever start support this mechanism, they would always set M_TSTMP | M_TSTMP_HPREC if hardware timestamp is present for the given packet. Add IFCAP_HWRXTSTMP interface capability to indicate the support for hardware rx timestamping, and ifconfig(8) command to toggle it. Based on the patch by: gallatin Reviewed by: gallatin (previous version), hselasky Sponsored by: Mellanox Technologies MFC after: 2 weeks (? mbuf KBI issue) X-Differential revision: https://reviews.freebsd.org/D12638 Notes: svn path=/head/; revision=325506
* Do not run pmclog_configure_log() without pmc_sx protection.Konstantin Belousov2017-11-011-0/+2
| | | | | | | | | | | | | | | | | | The r195005 unlocked pmc_sx before calling into pmclog_configure_log() to avoid the LOR, but it allows flush or closelog to run in parallel with the configuration, causing many failure modes. Revert r195005. Pre-create the logging process, allowing it to run after the set up succeeded, otherwise the process terminates itself. Reported and tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D12882 Notes: svn path=/head/; revision=325277
* Add a #define RESOURCE_SPEC_END. Similar to DEVMETHOD_END andIan Lepore2017-10-281-0/+1
| | | | | | | | KOBJMETHOD_END, this is to serve as the end marker in an array of resource_spec structures. Notes: svn path=/head/; revision=325060
* Discard the correct thread event reported for a ptrace stop.John Baldwin2017-10-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When multiple threads wish to report a tracing event to a debugger, both threads call ptracestop() and one thread will win the race to be the reporting thread (p->p_xthread). The debugger uses PT_LWPINFO with the process ID to determine which thread / LWP is reporting an event and the details of that event. This event is cleared as a side effect of the subsequent ptrace event that resumed the process (PT_CONTINUE, PT_STEP, etc.). However, ptrace() was clearing the event identified by the LWP ID passed to the resume request even if that wasn't the 'p_xthread'. This could result in clearing an event that had not yet been observed by the debugger and leaving the existing event for 'p_thread' pending so that it was reported a second time. Specifically, if the debugger stopped due to a software breakpoint in one thread, but then switched to another thread that was used to resume (e.g. if the user switched to a different thread and issued a step), the resume request (PT_STEP) cleared a pending event (if any) for the thread being stepped. However, the process immediately stopped and the first thread reported it's breakpoint event a second time. The debugger decremented the PC for "both" breakpoint events which resulted in the PC now pointing into the middle of an instruction (on x86) and a SIGILL fault when the process was resumed a second time. To fix, always clear the pending event for 'p_xthread' when resuming a process. ptrace() still honors the requested LWP ID when enabling single-stepping (PT_STEP) or setting a different PC (PT_CONTINUE). Reported by: GDB testsuite (gdb.threads/continue-pending-status.exp) Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D12794 Notes: svn path=/head/; revision=325028
* Various IPMI watchdog timer improvementsWarner Losh2017-10-261-0/+7
| | | | | | | | | | | | | | | | o Make hw.ipmi.on a tuneable o Changes to keep shutdown from hanging indefinitately after the wd would normally have been disabled. o Add support for setting pretimeout (which fires an interrupt some time before the actual watchdog expires) o Allow refinement of the actions to take when the watchdog expires o Allow special startup timeout to keep us from hanging in boot before watchdogd is started, but after we've loaded the kernel. Obtained From: Netflix OCA Firmware Notes: svn path=/head/; revision=325024
* Introduce cnvlist_name() and cnvlist_type() functions.Mariusz Zaborski2017-10-261-0/+6
| | | | | | | | | | Those function can be used when we are iterating over nvlist to reduce amount of extra variables we need to declare. MFC after: 1 month Notes: svn path=/head/; revision=325019
* Implement IPMI support for RB_POWRECYCLEWarner Losh2017-10-251-0/+17
| | | | | | | | | | | | | | | Some BMCs support power cycling the chassis via the chassis control command 2 subcommand 2 (ipmitool called it 'chassis power cycle'). If the BMC supports the chassis device, register a shutdown_final handler that sends the power cycle command if request and waits up to 10s for it to take effect. To minimize stack strain, we preallocate a ipmi request in the softc. At the moment, we're verbose about what we're doing. Sponsored by: Netflix Notes: svn path=/head/; revision=324990
* Define RB_POWERCYCLEWarner Losh2017-10-251-0/+1
| | | | | | | | | | | RB_POWERCYCLE instructs the platform to power off and then power back on a short time later, if that's possible. Otherwise, degrade to the RB_POWEROFF behavior. Sponsored by: Netflix Notes: svn path=/head/; revision=324983
* Add support for compressed kernel dumps.Mark Johnston2017-10-254-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using a kernel built with the GZIO config option, dumpon -z can be used to configure gzip compression using the in-kernel copy of zlib. This is useful on systems with large amounts of RAM, which require a correspondingly large dump device. Recovery of compressed dumps is also faster since fewer bytes need to be copied from the dump device. Because we have no way of knowing the final size of a compressed dump until it is written, the kernel will always attempt to dump when compression is configured, regardless of the dump device size. If the dump is aborted because we run out of space, an error is reported on the console. savecore(8) is modified to handle compressed dumps and save them to vmcore.<index>.gz, as it does when given the -z option. A new rc.conf variable, dumpon_flags, is added. Its value is added to the boot-time dumpon(8) invocation that occurs when a dump device is configured in rc.conf. Reviewed by: cem (earlier version) Discussed with: def, rgrimes Relnotes: yes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D11723 Notes: svn path=/head/; revision=324965
* Remove resource_set_*() declarations from sys/bus.h.Mark Johnston2017-10-231-7/+0
| | | | | | | | | | | The corresponding definitions were removed in r78135. PR: 223189 Submitted by: marc.priggemeyer@gmail.com MFC after: 1 week Notes: svn path=/head/; revision=324923