aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* flua: initial support for "require" in the base systemEd Maste2020-08-132-3/+7
| | | | | | | | | | | | | | | | | | | | Use /usr not /usr/local for base system components. Use /usr/lib/flua and /usr/share/flua (not lua) for consistency and to avoid the possibility that other software accidentally finds our base system modules. Also drop the version from the path, as flua represents an unspecified lua version that corresponds to the FreeBSD version it comes with. LUA_USE_DLOPEN is not yet enabled because some additional changes are needed wrt symbol visibility. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24605 Notes: svn path=/head/; revision=364182
* Check that the frame pointer is within the current stack.John Baldwin2020-08-121-5/+8
| | | | | | | | | | | | | | This same check is used on other architectures. Previously this would permit a stack frame to unwind into any arbitrary kernel address (including unmapped addresses). Reviewed by: mhorne Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25996 Notes: svn path=/head/; revision=364181
* Use uintptr_t instead of uint64_t for pointers in stack frames.John Baldwin2020-08-124-18/+18
| | | | | | | | | | Reviewed by: mhorne Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25995 Notes: svn path=/head/; revision=364180
* Report cpi->hba_* for nda(4) because why not.Alexander Motin2020-08-121-1/+5
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=364179
* Report proper stripesize for nda(4).Alexander Motin2020-08-121-1/+5
| | | | | | | | | Same as for nvd(4) report NPWG if present, otherise NOIOB. MFC after: 1 week Notes: svn path=/head/; revision=364178
* Report attachment for nvd same as reported for nda.Alexander Motin2020-08-121-2/+13
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=364177
* Correct padding length for RISC-V PCPU data.John Baldwin2020-08-122-1/+4
| | | | | | | | | | | | | There was an additional 7 bytes of compiler-inserted padding at the end of the structure visible via 'ptype /o' in gdb. Reviewed by: mhorne Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25867 Notes: svn path=/head/; revision=364176
* Use env pwd instead of pwd in crunchgen.cAlex Richardson2020-08-121-1/+1
| | | | | | | | | | | | | In r364166 I changed /bin/pwd to pwd, but pwd can be shell builtin that may not correctly return a real path. To ensure that all symlinks are resolved use `env pwd -P` instead (the -P flag is part of POSIX so should be supported everywhere). Reported By: rgrimes Suggested By: jrtc27 Notes: svn path=/head/; revision=364174
* Correctly set error in rt_mpath_unlinkMitchell Horne2020-08-121-1/+5
| | | | | | | | | | | | It is possible for rn_delete() to return NULL. If this happens, then set *perror to ESRCH, as is done in the rest of the function. Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D25871 Notes: svn path=/head/; revision=364172
* linprocfs: Fix some inaccuracies in meminfo.Mark Johnston2020-08-121-23/+17
| | | | | | | | | | | | | | | | - Fill out MemFree correctly. Delete an ancient comment suggesting that we don't want to advertise the true quantity of free memory. - Populate the Buffers field by reading vfs.bufspace. - The page cache consists of all pages in page queues, not just the inactive queue. PR: 248463 Reported and tested by: danfe MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=364168
* Fix stand/newvers.sh with zsh in sh modeAlex Richardson2020-08-121-2/+4
| | | | | | | | | | | | When building on macOS with sh==zsh, newvers.sh was producing an unterminated string literal due to \\n being turned as a newline. Fix this by using a here document instead. Reviewed By: imp Differential Revision: https://reviews.freebsd.org/D26036 Notes: svn path=/head/; revision=364167
* Fix crunchgen usage of mkstemp()Alex Richardson2020-08-121-10/+26
| | | | | | | | | | | | | | | | On Glibc systems mkstemp can only be used once with the same template string since it will be modified in-place and no longer contain any 'X' chars. It is fine to reuse the same file here but we need to be explicit and use open() instead of mkstemp() on the second use. While touching this file also avoid a hardcoded /bin/pwd since that may not work when building on non-FreeBSD systems. Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D25990 Notes: svn path=/head/; revision=364166
* iflib: netmap: improve rxsync to support IFLIB_HAS_RXCQVincenzo Maffione2020-08-122-12/+30
| | | | | | | | | | | | | | For drivers with IFLIB_HAS_RXCQ set, there is a separate completion queue. In this case, the netmap rxsync routine needs to update rxq->ifr_cq_cidx in the same way it is updated by iflib_rxeof(). This improves the situation for vmx(4) and bnxt(4) drivers, which use iflib and have the IFLIB_HAS_RXCQ bit set. PR: 248494 MFC after: 3 weeks Notes: svn path=/head/; revision=364165
* iflib: refactor netmap_fl_refill and fix off-by-one issueVincenzo Maffione2020-08-121-27/+21
| | | | | | | | | | | | | | First, fix the initialization of the fl->ifl_rxd_idxs array, which was affected by an off-by-one bug. Once there, refactor the function to use better names for local variables, optimize the variable assignments, and merge the bus_dmamap_sync() inner loop with the outer one. PR: 248494 MFC after: 3 weeks Notes: svn path=/head/; revision=364164
* hook cp2112.4 to the buildAndriy Gapon2020-08-121-0/+1
| | | | | | | | | Reported by: 0mp MFC after: 1 week X-MFC with: r364144 Notes: svn path=/head/; revision=364155
* hook gpiokeys.4 to the buildAndriy Gapon2020-08-121-0/+1
| | | | | | | | | Reported by: 0mp MFC after: 3 days X-MFC with: r363905 Notes: svn path=/head/; revision=364154
* Add support for Cortex-A76/Neoverse-N1 to hwpmcAndrew Turner2020-08-125-15/+92
| | | | | | | | | | | | | | This adds support for the Cortex-A76 and Neoverse-N1 PMU counters to pmc. While here add more PMCR_IDCODE values and check the implementers code is correct before setting the PMU type. Reviewed by: bz, emaste (looks reasonable to me) Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D25959 Notes: svn path=/head/; revision=364153
* aw_cir: in the pulse encoding the actual length is one greater than valueAndriy Gapon2020-08-121-12/+14
| | | | | | | | | | While here change type of some variables from long to int, it's sufficient. Also, add length reporting to a couple of debug printfs. MFC after: 3 weeks Notes: svn path=/head/; revision=364149
* aw_cir: lower activation threshold to support NECx protocolAndriy Gapon2020-08-121-5/+7
| | | | | | | | | | | | | | | | | | | | | | | In NECx the leading mark has length of 8T as opposed to 16T in NEC, where T is 562.5 us. So, 4.5 ms. Our threshold was set to 128 * 42.7 us (derived from the sampling frequency of 3/128 MHz). So, ~5.5 ms. The new threshold is set to AW_IR_L1_MIN. I think that's a good enough lower bound for detecting the leading pulse. Also, calculations of active_delay (which is activation delay) are fixed. Previously they would be wrong if AW_IR_ACTIVE_T was anything but zero, because the value was already bit-shifted. Finally, I am not sure why the activation delay was divided by two when calculating the initial pulse length. I have not found anything that would explain or justify it. So, I removed that division. MFC after: 3 weeks Notes: svn path=/head/; revision=364148
* aw_cir: minor cleanupsAndriy Gapon2020-08-121-2/+3
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=364147
* aw_cir: add support for allwinner,sun6i-a31-ir (found, e.g., on h3)Andriy Gapon2020-08-121-2/+7
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=364146
* gpiokeys: add evdev supportAndriy Gapon2020-08-121-25/+69
| | | | | | | | | | | | Only linux,code is supported as it maps 1:1 to evdev key codes. No reverse mapping for freebsd,code yet. Reviewed by: wulf MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D25940 Notes: svn path=/head/; revision=364145
* add a manual page for cp2112Andriy Gapon2020-08-121-0/+87
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=364144
* cp2112: a number of cleanups and improvementsAndriy Gapon2020-08-121-301/+379
| | | | | | | | | | | | | | | | | | | | - hoist all request / response structures from function level to top level - replace magic numeric literals with constants - regroup types, data and functions - remove setting of the id field in responses as they are completely overwritten with data from the device - centralize setting of the id field as it is always set to the value of request type - fix setting and querying of open-drain vs push-pull configuration of an output pin -- it's always in one of those configurations - detect special pin configurations: a pin in a special configuration is neither general purpose input or output - there is still no support for setting special configurations MFC after: 2 weeks Notes: svn path=/head/; revision=364143
* vfs: inline vrefcntMateusz Guzik2020-08-122-17/+6
| | | | Notes: svn path=/head/; revision=364141
* vfs: garbage collect vrefactnMateusz Guzik2020-08-122-14/+0
| | | | Notes: svn path=/head/; revision=364140
* vfs: reimplement vref on top of vgetMateusz Guzik2020-08-121-25/+3
| | | | | | | No change in generated assembly. Notes: svn path=/head/; revision=364139
* Fix a bug introduced by r363001 for the ext_pgs case.Rick Macklem2020-08-121-1/+1
| | | | | | | | | | | | r363001 added support for ext_pgs mbufs to nfsm_uiombuf(). By inspection, I noticed that "mlen" was not set non-zero and, as such, there would be an iteration of the loop that did nothing. This patch sets it. This bug would have no effect on the system, since the ext_pgs mbuf code is not yet enabled. Notes: svn path=/head/; revision=364138
* devfs: Abstract locking assertionsConrad Meyer2020-08-123-18/+21
| | | | | | | | | | | | | | | The conversion was largely mechanical: sed(1) with: -e 's|mtx_assert(&devmtx, MA_OWNED)|dev_lock_assert_locked()|g' -e 's|mtx_assert(&devmtx, MA_NOTOWNED)|dev_lock_assert_unlocked()|g' The definitions of these abstractions in fs/devfs/devfs_int.h are the only non-mechanical change. No functional change. Notes: svn path=/head/; revision=364135
* Back out unrelated changeConrad Meyer2020-08-121-1/+1
| | | | | | | | Reported by: kib, markj X-MFC-With: r364129 Notes: svn path=/head/; revision=364134
* When booting a system with WITHOUT_IPFILTER the following errorsCy Schubert2020-08-116-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | are encountered at boot time: rcorder: requirement `ipfs' in file `/etc/rc.d/netif' has no providers. rcorder: requirement `ipfilter' in file `/etc/rc.d/netif' has no providers. rcorder: requirement `ipfilter' in file `/etc/rc.d/netwait' has no providers. rcorder: requirement `ipfilter' in file `/etc/rc.d/net_watchdog' has no providers. rcorder: requirement `ipfilter' in file `/etc/rc.d/securelevel' has no providers. Listing its own requrements in BEFORE rather than use REQUIRE of non-optional scripts resolves this issue. The issue was discovered and patched by glebius at Netflix. Submitted by: glebius Reported by: glebius MFC after: 1 week Notes: svn path=/head/; revision=364133
* since kld_deb.py was removed a while back, this script isn't usefulJohn-Mark Gurney2020-08-111-67/+0
| | | | | | | anymore... Notes: svn path=/head/; revision=364132
* tput(1): Several enhancements for the manual pageGordon Bergling2020-08-111-19/+44
| | | | | | | | | | | | | | | | - a couple of descriptions are incomplete - synopsis doesn't show that all arguments are optional - missing an ENVIRONMENT section with TERM mentioned PR: 84670 Submitted by: Gary W. Swearingen <garys at opusnet dot com> Reviewed by: bcr Approved by: bcr MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26009 Notes: svn path=/head/; revision=364131
* smp.h: Reconcile definition and declaration of smp_ncpusConrad Meyer2020-08-111-1/+1
| | | | | | | | | | | The variable is defined unconditionally; declare it unconditionally as well. It is already initialized to the correct value (1) for !SMP builds. No functional change. Notes: svn path=/head/; revision=364130
* Add support for multithreading the inactive queue pageout within a domain.Conrad Meyer2020-08-115-27/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In very high throughput workloads, the inactive scan can become overwhelmed as you have many cores producing pages and a single core freeing. Since Mark's introduction of batched pagequeue operations, we can now run multiple inactive threads working on independent batches. To avoid confusing the pid and other control algorithms, I (Jeff) do this in a mpi-like fan out and collect model that is driven from the primary page daemon. It decides whether the shortfall can be overcome with a single thread and if not dispatches multiple threads and waits for their results. The heuristic is based on timing the pageout activity and averaging a pages-per-second variable which is exponentially decayed. This is visible in sysctl and may be interesting for other purposes. I (Jeff) have verified that this does indeed double our paging throughput when used with two threads. With four we tend to run into other contention problems. For now I would like to commit this infrastructure with only a single thread enabled. The number of worker threads per domain can be controlled with the 'vm.pageout_threads_per_domain' tunable. Submitted by: jeff (earlier version) Discussed with: markj Tested by: pho Sponsored by: probably Netflix (based on contemporary commits) Differential Revision: https://reviews.freebsd.org/D21629 Notes: svn path=/head/; revision=364129
* Allow linking the kernel with a linker that doesn't support -z ifunc-nopltAlex Richardson2020-08-112-0/+7
| | | | | | | | | | This can happen when linking with upstream LLD < 9.0. Reviewed By: markj Differential Revision: https://reviews.freebsd.org/D25985 Notes: svn path=/head/; revision=364125
* Fix libdtrace build with zsh as /bin/shAlex Richardson2020-08-114-54/+46
| | | | | | | | | | | | When zsh runs in POSIX sh mode it does not support the -e flag to echo. Use printf instead of echo to avoid the "-e" characters being printed. Obtained from: CheriBSD Reviewed By: markj Differential Revision: https://reviews.freebsd.org/D26026 Notes: svn path=/head/; revision=364124
* Fix -DBUILD_WITH_STRICT_TMPPATH dtrace buildsAlex Richardson2020-08-115-1/+9
| | | | | | | | | | | | | | | | | | | Some of the scripts used for libdtrace invoke nawk instead of awk (for example cddl/contrib/opensolaris/lib/libdtrace/common/mknames.sh). When bootstrapping all tools, we get the nawk -> awk link while building usr.bin/awk, but when linking/copying the dependencies from the host we were only adding awk but not nawk. This was silently generating invalid files when building libdtrace with BUILD_WITH_STRICT_TMPPATH=1 since those scripts invoke nawk instead of awk. In addition to adding the missing link this commit also adds set -e to those scripts to catch errors like this in the future. Reviewed By: markj, emaste Differential Revision: https://reviews.freebsd.org/D26025 Notes: svn path=/head/; revision=364123
* Add CLANG/LLD/LLD to BROKEN_OPTIONS when building on non-FreeBSDAlex Richardson2020-08-111-0/+8
| | | | | | | | | | | | | These tools require a bootstrap llvm-tblgen/clang-tblgen and that cannot be built with the current make infrastructure: the config header is not correct for Linux/macOS and we don't include the CMakeLists.txt in contrib so we can't generate one that would be correct. Reviewed By: emaste, imp, dim Differential Revision: https://reviews.freebsd.org/D14245 Notes: svn path=/head/; revision=364122
* Fix bootstrapping of pwd_mkdb after r364049Alex Richardson2020-08-111-1/+1
| | | | | | | | I moved the bootstrap pwd.h to a subdirectory in r364049 but forgot to adjust the #include path. Notes: svn path=/head/; revision=364121
* Fix bootstrapping ldd after r362152Alex Richardson2020-08-111-0/+6
| | | | | | | | r362152 started using DF_1_PIE, which is not present in older versions of sys/elf_common.h. To fix this include the ELF headers as part of -legacy. Notes: svn path=/head/; revision=364120
* Allow overriding the tool used for stripping binariesAlex Richardson2020-08-115-6/+7
| | | | | | | | | | | | | | | | | | | Since the make variable STRIP is already used for other purposes, this uses STRIPBIN (which is also used for the same purpose by install(1). This allows using LLVM objcopy to strip binaries instead of the in-tree elftoolchain objcopy. We make use of this in CheriBSD since passing binaries generated by our toolchain to elftoolchain strip sometimes results in assertion failures. This allows working around https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248516 by specifying STRIPBIN=/path/to/llvm-strip Obtained from: CheriBSD Reviewed By: emaste, brooks Differential Revision: https://reviews.freebsd.org/D25988 Notes: svn path=/head/; revision=364119
* Remove sys/compat/netbsd.Mark Johnston2020-08-111-67/+0
| | | | | | | | It contained only a header used by ncv(4), which was mainly used on pc98 systems. Both ncv(4) and pc98 support have long been removed. Notes: svn path=/head/; revision=364118
* ipfw: make the "frag" keyword accept additional options "mf",Gleb Smirnoff2020-08-113-11/+60
| | | | | | | | | | | | | "df", "rf" and "offset". This allows to match on specific bits of ip_off field. For compatibility reasons lack of keyword means "offset". Reviewed by: ae Differential Revision: https://reviews.freebsd.org/D26021 Notes: svn path=/head/; revision=364117
* devfs: rework si_usecount to track opensMateusz Guzik2020-08-117-210/+158
| | | | | | | | | | | This removes a lot of special casing from the VFS layer. Reviewed by: kib (previous version) Tested by: pho (previous version) Differential Revision: https://reviews.freebsd.org/D25612 Notes: svn path=/head/; revision=364113
* script: Minor cleanups.Mark Johnston2020-08-111-10/+9
| | | | | | | | | | | | | | | - Instead of using isatty() to decide whether to call tcgetattr(), just call tcgetattr() directly, since that's all that isatty() does anyway. - Simplify error handling in termset(). Check for errno != ENOTTY from tcgetattr() to handle errors that may be raised while running script(1) under a debugger. PR: 248377 Submitted by: Soumendra Ganguly <soumendraganguly@gmail.com> MFC after: 1 week Notes: svn path=/head/; revision=364112
* Use atomic_clear_rel_long() to implement clear_bit_unlock() in the LinuxKPIHans Petter Selasky2020-08-111-7/+3
| | | | | | | | | | | after r363842. Suggested by: alc@ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=364110
* Need to clone the task struct fields related to RCU aswell in theHans Petter Selasky2020-08-113-10/+15
| | | | | | | | | | | | | | | | LinuxKPI after r359727. This fixes a minor regression issue. Else the priority tracking won't work properly when both sleepable and non-sleepable RCU is in use on the same thread. Bump the __FreeBSD_version to force recompilation of external kernel modules. PR: 242272 MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=364109
* pkgbase: Replace / with | for PKG_WWWEmmanuel Vadot2020-08-112-3/+3
| | | | | | | | | PKG_WWW contain / char, replace the delimiter by a '|'. Reported by: 0mp Notes: svn path=/head/; revision=364104
* pkgbase: Add PKG_NAME_PREFIX, PKG_MAINTAINER and PKG_WWWEmmanuel Vadot2020-08-1117-45/+61
| | | | | | | | | This is useful for downstream users to customize the packages. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D26019 Notes: svn path=/head/; revision=364103