aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Remove all the RELEASE_CRUNCH defines, they are useless.Warner Losh2019-12-162-9/+1
| | | | | | | | RELEASE_CRUNCH has been broken for a very long time. Remove the last remants from the tree. Notes: svn path=/head/; revision=355821
* Add a hack to make ^T work for Linux binaries, enabled withEdward Tomasz Napierala2019-12-165-0/+19
| | | | | | | | | | | 'compat.linux.preserve_vstatus=1' sysctl. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21967 Notes: svn path=/head/; revision=355820
* Repeat the spinlock_enter/exit pattern from amd64 on other architectures toJeff Roberson2019-12-166-17/+22
| | | | | | | | | | | | | | | | fix an assert violation introduced in r355784. Without this spinlock_exit() may see owepreempt and switch before reducing the spinlock count. amd64 had been optimized to do a single critical enter/exit regardless of the number of spinlocks which avoided the problem and this optimization had not been applied elsewhere. Reported by: emaste Suggested by: rlibby Discussed with: jhb, rlibby Tested by: manu (arm64) Notes: svn path=/head/; revision=355819
* Add compat.linux.emul_path, so it can be set to something otherEdward Tomasz Napierala2019-12-167-13/+24
| | | | | | | | | | | | | | than "/compat/linux". Useful when you have several compat directories with different Linux versions and you don't want to clash with files installed by linux-c7 packages. Reviewed by: bcr (manpages) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22574 Notes: svn path=/head/; revision=355818
* Revert r355813Warner Losh2019-12-162-20/+2
| | | | | | | | It was extracted from a larger tree and is incomplete. Will resubmit after reworking. Notes: svn path=/head/; revision=355817
* UPDATING: remove outdated caution against make -jEd Maste2019-12-161-8/+3
| | | | | | | | | Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22836 Notes: svn path=/head/; revision=355816
* Implement a system-wide limit or da and ada devices for delete.Warner Losh2019-12-162-2/+20
| | | | | | | | | | | Excesively large TRIMs can result in timeouts, which cause big problems. Limit trims to 1GB to mititgate these issues. Reviewed by: scottl Differential Revision: https://reviews.freebsd.org/D22809 Notes: svn path=/head/; revision=355813
* Don't use K&R definitions. No functional changes.Edward Tomasz Napierala2019-12-161-6/+2
| | | | | | | | | Reported by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=355807
* kbd drivers: don't double register keyboard driversKyle Evans2019-12-166-0/+28
| | | | | | | | | | | | | | | | | | Keyboard drivers are generally registered via linker set. In these cases, they're also available as kmods which use KPI for registering/unregistering keyboard drivers outside of the linker set. For built-in modules, we still fire off MOD_LOAD and maybe even MOD_UNLOAD if an error occurs, leading to registration via linker set and at MOD_LOAD time. This is a minor optimization at best, but it keeps the internal kbd driver tidy as a future change will merge the linker set driver list into its internal keyboard_drivers list via SYSINIT and simplify driver lookup by removing the need to consult the linker set. Notes: svn path=/head/; revision=355806
* Fix LLVM libunwnwind _Unwind_Backtrace symbol version for ARM.Michal Meloun2019-12-165-3/+15
| | | | | | | | | | | | | | | | | In original GNU libgcc, _Unwind_Backtrace is published with GCC_3.3 version for all architectures but ARM. For ARM should be publishes with GCC_4.3.0 version. This was originally omitted in r255095, fixed in r318024 and omitted aging in LLVM libunwind implementation in r354347. For ARM _Unwind_Backtrace should be published as default with GCC_4.3.0 version , (because this is right original version) and again as normal(not-default) with GCC_3.3 version (to maintain ABI compatibility compiled/linked with wrong pre r318024 libgcc) PR: 233664 Notes: svn path=/head/; revision=355803
* Fix gcc build after r355790Li-Wen Hsu2019-12-161-2/+0
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=355802
* [PPC] Handle qOffsets packetLeandro Lupori2019-12-163-0/+32
| | | | | | | | | | | | | | On PowerPC, this is needed in order for the debugger to find out the memory offset where the kernel image was loaded on the remote target. This fixes symbol resolution when remote debugging a PowerPC kernel. Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D22767 Notes: svn path=/head/; revision=355801
* Install missing pcap(3) manual pages and add missing manpageHans Petter Selasky2019-12-161-3/+12
| | | | | | | | | | | | section substitutions. Submitted by: Martin Beran <martin@mber.cz> PR: 237893 MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=355800
* kbd: patch linker set methods, tooKyle Evans2019-12-161-0/+17
| | | | | | | | | | This is needed after r355796. Some double-registration of kbd drivers needs to be sorted out, then this sysinit will simply add these drivers into the normal list and kill off any other bits in the driver that are aware of the linker set, for simplicity. Notes: svn path=/head/; revision=355799
* kbd: remove kbdsw, store pointer to driver in each keyboard_tKyle Evans2019-12-163-93/+78
| | | | | | | | | | | | | | | | | | The previous implementation relied on a kbdsw array that mirrored the global keyboards array. This is fine, but also requires extra locking consideration when accessing to ensure that it's not being resized as new keyboards are added. The extra pointer costs little in a struct that there are relatively few of on any given system, and simplifies locking requirements ever-so-slightly as we only need to consider the locking requirements of whichever method is being invoked. __FreeBSD_version is bumped as any kbd modules will need rebuilt following this change. Notes: svn path=/head/; revision=355798
* chrome_kb: remove default get_fkeystr/diag implementationsKyle Evans2019-12-161-2/+0
| | | | | | | This file was missed in r355796, but no harm would have come from this. Notes: svn path=/head/; revision=355797
* kbd: provide default implementations of get_fkeystr/diagKyle Evans2019-12-1610-20/+9
| | | | | | | | | Most keyboard drivers are using the genkbd implementations as it is; formally use them for any that aren't set and make genkbd_get_fkeystr/genkbd_diag private. Notes: svn path=/head/; revision=355796
* keyboard switch definitions: standardize on c99 initializersKyle Evans2019-12-164-76/+76
| | | | | | | | | A future change will provide default implementations for some of these where it makes sense and most of them are already using the genkbd implementation (e.g. get_fkeystr, diag). Notes: svn path=/head/; revision=355794
* kbd drivers: use kbdd_* indirection for diag invocationKyle Evans2019-12-164-4/+4
| | | | | | | | | | | These invocations were directly calling enkbd_diag(), rather than indirection back through kbdd_diag/kbdsw. While they're functionally equivent, invoking kbdd_diag where feasible (i.e. not in a diag implementation) makes it easier to visually identify locking needs in these other drivers. Notes: svn path=/head/; revision=355793
* Remove a declaration of sched_clock() redundant after r355779.Mark Johnston2019-12-161-1/+0
| | | | Notes: svn path=/head/; revision=355792
* vfs: allow tail call optimisation in vops in the common caseMateusz Guzik2019-12-161-7/+11
| | | | | | | | | | | | | | | Most frequently used vops boil down to checking SDT probes, doing the call and checking again. There is no vop_post/pre in their case but the check after the call prevents tail call optimisation from taking place. Instead, check once upfront. Kernels with debug or vops with non-empty vop_post still don't short circuit. Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D22739 Notes: svn path=/head/; revision=355791
* vfs: flatten vop vectorsMateusz Guzik2019-12-1627-5/+96
| | | | | | | | | | | | | | | This eliminates the following loop from all VOP calls: while(vop != NULL && \ vop->vop_spare2 == NULL && vop->vop_bypass == NULL) vop = vop->vop_default; Reviewed by: jeff Tesetd by: pho Differential Revision: https://reviews.freebsd.org/D22738 Notes: svn path=/head/; revision=355790
* mtx: eliminate recursion support from thread lockMateusz Guzik2019-12-161-22/+10
| | | | | | | | | | | | Now that it is not used after schedlock changes got merged. Note the unlock routine temporarily still checks for it on account of just using regular spin unlock. This is a prelude towards a general clean up. Notes: svn path=/head/; revision=355789
* Properly detect ATA sanitize errors.Alexander Motin2019-12-151-3/+19
| | | | | | | | | | It seems I read specifications not careful enough. There are devices not setting successful completion bit, causing previous code report false error. MFC after: 1 week Notes: svn path=/head/; revision=355788
* Apply a small optimization to pmap_remove_l3_range(). Specifically, hoist aAlan Cox2019-12-151-2/+4
| | | | | | | | | | | | PHYS_TO_VM_PAGE() operation that always returns the same vm_page_t out of the loop. (Since arm64 is configured as VM_PHYSSEG_SPARSE, the implementation of PHYS_TO_VM_PAGE() is more costly than that of VM_PHYSSEG_DENSE platforms, like amd64.) MFC after: 1 week Notes: svn path=/head/; revision=355787
* loader: rewrite zfs vdev initializationToomas Soome2019-12-153-267/+450
| | | | | | | | | | | | | | | | In some cases the pool discovery will get stuck in infinite loop while setting up the vdev children. To fix, we split the vdev setup into two parts, first we create vdevs based on configuration we do get from pool label, then, we process pool config from MOS and update the pool config if needed. Testing done: confirm previously hung loader is not hung any more. MFC after: 1 week Notes: svn path=/head/; revision=355786
* schedlock 4/4Jeff Roberson2019-12-1518-172/+99
| | | | | | | | | | | | | | | | | | | | | Don't hold the scheduler lock while doing context switches. Instead we unlock after selecting the new thread and switch within a spinlock section leaving interrupts and preemption disabled to prevent local concurrency. This means that mi_switch() is entered with the thread locked but returns without. This dramatically simplifies scheduler locking because we will not hold the schedlock while spinning on blocked lock in switch. This change has not been made to 4BSD but in principle it would be more straightforward. Discussed with: markj Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D22778 Notes: svn path=/head/; revision=355784
* powerpc/powernv: Set the PTCR for the Nest MMUJustin Hibbits2019-12-152-0/+12
| | | | | | | | | | | | The Nest MMU manages address translation for accelerators on the POWER9. To do so, it needs a page table, so export the system page table to the Nest MMU. This will quietly fail on pre-POWER9 systems that do not have a NMMU. The NMMU is currently unused, so this change is currently effectively a NOP, but the NMMU and VAS will eventually be used. Notes: svn path=/head/; revision=355783
* schedlock 3/4Jeff Roberson2019-12-151-14/+36
| | | | | | | | | | | | | Eliminate lock recursion from turnstiles. This was simply used to avoid tracking the top-level turnstile lock. explicitly check for it before picking up and dropping locks. Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D22746 Notes: svn path=/head/; revision=355782
* schedlock 2/4Jeff Roberson2019-12-152-48/+31
| | | | | | | | | | | Do all sleepqueue post-processing in sleepq_remove_thread() so that we do not require the thread lock after a context switch. Reviewed by: jhb, kib Differential Revision: https://reviews.freebsd.org/D22745 Notes: svn path=/head/; revision=355781
* Rewrite arm kernel stack unwind code to work when unwinding through modules.Ian Lepore2019-12-156-72/+312
| | | | | | | | | | | | | | | | | | | | | | | | | | | The arm kernel stack unwinder has apparently never been able to unwind when the path of execution leads through a kernel module. There was code that tried to handle modules by looking for the unwind data in them, but it did so by trying to find symbols which have never existed in arm kernel modules. That caused the unwind code to panic, and because part of panic handling calls into the unwind code, that just created a recursion loop. Locating the unwind data in a loaded module requires accessing the Elf section headers to find the SHT_ARM_EXIDX section. For preloaded modules those headers are present in a metadata blob. For dynamically loaded modules, the headers are present only while the loading is in progress; the memory is freed once the module is ready to use. For that reason, there is new code in kern/link_elf.c, wrapped in #ifdef __arm__, to extract the unwind info while the headers are loaded. The values are saved into new fields in the linker_file structure which are also conditional on __arm__. In arm/unwind.c there is new code to locally cache the per-module info needed to find the unwind tables. The local cache is crafted for lockless read access, because the unwind code often needs to run in context where sleeping is not allowed. A large comment block describes the local cache list, so I won't repeat it all here. Notes: svn path=/head/; revision=355780
* schedlock 1/4Jeff Roberson2019-12-1527-239/+360
| | | | | | | | | | | | | | | Eliminate recursion from most thread_lock consumers. Return from sched_add() without the thread_lock held. This eliminates unnecessary atomics and lock word loads as well as reducing the hold time for scheduler locks. This will eventually allow for lockless remote adds. Discussed with: kib Reviewed by: jhb Tested by: pho Differential Revision: https://reviews.freebsd.org/D22626 Notes: svn path=/head/; revision=355779
* powerpc/mpc85xx: Clean up Freescale SATA driver a littleJustin Hibbits2019-12-151-30/+5
| | | | | | | | * Remove unused ATA_IN/OUT macros, they just clutter up the file. * Fix some RID management bits for the channel memory resource. Notes: svn path=/head/; revision=355778
* Support --all-repeats in uniq(1) for compatibility with gnu coreutils.Ian Lepore2019-12-152-11/+57
| | | | | | | | | | | | | | | | | | | | This adds a new -D/--all-repeats option to uniq(1), which outputs each copy of any repeated lines (as opposed to a single copy of a repeated line). You can specify a separator option to output a blank line before or after each group of repeated lines. This adds compatibility with the GNU coreutils version of uniq(1). This change also re-groups the -c, -d, -D, -u options in the usage display and man page to indicate that they are mutally exclusive of each other. This matches the posix/opengroup definition of uniq(1) command line args. Note that this change does NOT actually enforce the mutual exclusion in the code, for now, it simply documents that the arguments should be considered exclusive with each other. Differential Revision: https://reviews.freebsd.org/D22262 Notes: svn path=/head/; revision=355777
* Revert r355760, r355759Conrad Meyer2019-12-153-14/+1
| | | | | | | | | | | And remove the inline/deprecated attribute use entirely in stdlib.h, from r355747. The intent was to provide a buildable API transitionary period, but clearly that was counter-productive. Reported by: delphij, imp, others Notes: svn path=/head/; revision=355776
* kbd: convert kbdd_* macros to inline functionsKyle Evans2019-12-151-47/+140
| | | | | | | | This reduces the noise when interested parties wish to de-Giant kbd; these accesses to kbdsw will need to be properly locked. Notes: svn path=/head/; revision=355775
* Properly synchronize completion DMA buffers.Michal Meloun2019-12-151-5/+9
| | | | | | | | | | | Within command completion processing the callback function may access DMAed data buffer. Synchronize it before use, not after. This allows to use NVMe disk on non-DMA coherent arm64 system. MFC after: 3 weeks Notes: svn path=/head/; revision=355774
* loader: zfsimpl.c cstyle cleanupToomas Soome2019-12-151-117/+139
| | | | | | | | | No functional changes intended. MFC after: 1 week Notes: svn path=/head/; revision=355773
* Fix a mistake in r355765. We need to activate the page if it is not yetJeff Roberson2019-12-151-1/+3
| | | | | | | | | on a pagequeue. Reported by: pho Notes: svn path=/head/; revision=355771
* kbd: drop _KERNEL #ifdef in kbdreg.hKyle Evans2019-12-151-4/+0
| | | | | | | | | | This #ifdef is misleading as there are actually no user-serviceable parts inside and, as far as I can tell, there is no pollution leading from userland to this header. Furthermore, it becomes a slight nuisance when attempting to move things around in this header. Notes: svn path=/head/; revision=355769
* Previously we did not support invalid pages in default objects. This meansJeff Roberson2019-12-152-57/+79
| | | | | | | | | | | | | | | | | | that if fault fails to progress and needs to restart the loop it must free the page it is working on and allocate again on restart. Resolve the few places that need to be modified to support this condition and simply deactivate the page. Presently, we only permit this when fault restarts for busy contention. This has an added benefit of removing some object trylocking in this case. While here consolidate some page cleanup logic into fault_page_free() and fault_page_release() to reduce redundant code and automate some teardown. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D22653 Notes: svn path=/head/; revision=355766
* Add a deferred free mechanism for freeing swap space that does not requireJeff Roberson2019-12-159-67/+182
| | | | | | | | | | | | | | | | | | | | | | an exclusive object lock. Previously swap space was freed on a best effort basis when a page that had valid swap was dirtied, thus invalidating the swap copy. This may be done inconsistently and requires the object lock which is not always convenient. Instead, track when swap space is present. The first dirty is responsible for deleting space or setting PGA_SWAP_FREE which will trigger background scans to free the swap space. Simplify the locking in vm_fault_dirty() now that we can reliably identify the first dirty. Discussed with: alc, kib, markj Differential Revision: https://reviews.freebsd.org/D22654 Notes: svn path=/head/; revision=355765
* Slightly optimize locking in vm_map_copy_swap_entry(). Anonymous objectsJeff Roberson2019-12-151-9/+12
| | | | | | | | | | | | require the object lock to synchronize collapse. Other swap objects such as tmpfs do not. Reported by: mjg Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D22747 Notes: svn path=/head/; revision=355764
* Handle pagein clustering in vm_page_grab_valid() so that it can be used byJeff Roberson2019-12-152-69/+43
| | | | | | | | | | | | exec_map_first_page(). This will also enable pagein clustering for other interested consumers (tmpfs, md, etc). Discussed with: alc Approved by: kib Differential Revision: https://reviews.freebsd.org/D22731 Notes: svn path=/head/; revision=355763
* cdefs: use more accurate GCC version for the deprecated attribute.Pedro F. Giffuni2019-12-151-1/+1
| | | | | | | | | | | The message argument in the "deprecated" attribute was introduced in GCC 4.5 *. Use the accurate version number for consistency, as done already with other attributes. * https://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Function-Attributes.html Notes: svn path=/head/; revision=355762
* <unistd.h>: remove redundant __BSD_VISIBLEKyle Evans2019-12-151-2/+0
| | | | | | | | | This bit is already inside of a larger __BSD_VISIBLE block. Reported by: vangyzen Notes: svn path=/head/; revision=355761
* linuxkpi: Drop incompatible __deprecated definitionConrad Meyer2019-12-141-1/+0
| | | | | | | | | | | | | | Probably all of these linuxkpi stubs should be '#ifndef' guarded, but maybe that would prevent people from noticing when they are defined. Introduced in r355759. For some reason I only ran a buildworld and not a kernel. Mea culpa. Reported by: Mark Millard X-MFC-with: r355759 Notes: svn path=/head/; revision=355760
* cdefs: Add __deprecated(message) function attribute macroConrad Meyer2019-12-142-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | The legacy version of GCC4 currently in base does not support the parameterized form of this function attribute, as recent introduced in stdlib.h (r355747). As we have done for other function attributes with similar compatibility problems, add a version-compatibile definition in sys/cdefs.h. Note that Clang defines itself to be GCC 4, so one must check for __clang__ in addition to __GNUC__ version. On legacy GCC 4, the macro expands to just the __deprecated__ attribute; on modern GCC or Clang, the macro expands to the parameterized variant with the message. Ignoring legacy or unsupported compilers, the macro is also beneficial in that it is a bit more ergonomic than the full __attribute__((__deprecated__())) boilerplate. Reported by: CI (but not tinderbox); imp and others Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D22817 Notes: svn path=/head/; revision=355759
* Update the mount_nfs.8 man page to include NFSv4.2.Rick Macklem2019-12-141-11/+16
| | | | | | | | | | | r355677 added NFSv4.2 support to the NFS client. This patch updates the mount_nfs.8 man page to reflect that. It also clarifies that the "nolockd" option does not apply to NFSv4 mounts. This is a content change. Notes: svn path=/head/; revision=355758
* Simplify the processing a leaf mask to find big-enough ranges of setDoug Moore2019-12-141-66/+35
| | | | | | | | | | | | | | | | | | | | | bits, by storing and modifying the complement of the original leaf mask, and by avoiding some unnecessary intermediate variables in computing the shift amounts. The logic is similar to what has recently been committed to sys/sys/bitstring.h. Compute better hint updates for the case when the cursor starts in mid-leaf, and eliminates some otherwise viable solutions. Assume the worst case, that all the eliminated offsets could have been solutions, and you can still compute a better hint than we use now. Eliminate some unnecessary conditional control flow. Approved by: alc Tested by: pho Differential Revision: https://reviews.freebsd.org/D22666 Notes: svn path=/head/; revision=355757