aboutsummaryrefslogtreecommitdiff
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
...
* arm64: Use new arm_kernel_boothdr script for generating booti images.Michal Meloun2020-12-302-47/+20
|
* sys/tools: Add a tool for generating arm and arm64 kernel images.Michal Meloun2020-12-301-0/+190
| | | | | | | | This tool can generate kernel images without changing the offsets in the final executable. It replaces the ELF header by properly sized zeroed block then emits a relative jump to _start(for 'v7jump' or 'v8jump' option) or the booti header (for 'v8booti' option) to the beginning of the converted file. Submited by: ian
* xen: allow limiting the amount of duplicated pending xenstore watchesRoger Pau Monné2020-12-307-4/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Xenstore watches received are queued in a list and processed in a deferred thread. Such queuing was done without any checking, so a guest could potentially trigger a resource starvation against the FreeBSD kernel if such kernel is watching any user-controlled xenstore path. Allowing limiting the amount of pending events a watch can accumulate to prevent a remote guest from triggering this resource starvation issue. For the PV device backends and frontends this limitation is only applied to the other end /state node, which is limited to 1 pending event, the rest of the watched paths can still have unlimited pending watches because they are either local or controlled by a privileged domain. The xenstore user-space device gets special treatment as it's not possible for the kernel to know whether the paths being watched by user-space processes are controlled by a guest domain. For this reason watches set by the xenstore user-space device are limited to 1000 pending events. Note this can be modified using the max_pending_watch_events sysctl of the device. This is XSA-349. Sponsored by: Citrix Systems R&D MFC after: 3 days
* xen/xenstore: remove unused functionsRoger Pau Monné2020-12-302-98/+0
| | | | | | | Those helpers are not used, so remove them. No functional change. Sponsored by: Citrix Systems R&D MFC after: 3 days
* Tegra210: Connect to GENERIC kernel.Michal Meloun2020-12-301-2/+10
|
* Tegra210: Add lost-in-merge fixes:Michal Meloun2020-12-302-2/+2
| | | | | - misplaced '#ifdef notyet' in max77620.c - misnamed 'xusb_gate' clock in tegra210_clk_per.c
* cxgbe: replace zero sized array by flexible arrayToomas Soome2020-12-291-2/+2
| | | | | | | | The issue was found while building cxgbe with gcc 10 (in illumos), the array subscription check is warning us about outside the bounds access. See also: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
* kern: efirt: correct configuration table entry sizeKyle Evans2020-12-292-2/+2
| | | | | | | | | | | | | Each entry actually stores a native pointer, not a uint64_t quantity. While we're here, go ahead and export the pointer as-is rather than converting it to KVA. This may be more useful as consumers can map /dev/mem and observe the entry. For reference, see: sys/contrib/edk2/Include/Uefi/UefiSpec.h Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27669
* kern: efirt: enter runtime environment to deref efi_cfgtblKyle Evans2020-12-291-0/+7
| | | | | | | | This fixes an insta-panic when EFIIOC_GET_TABLE is used. Reviewed by: imp (earlier version), kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27669
* Streamline the infiniband code according to the ethernet code.Hans Petter Selasky2020-12-291-102/+201
| | | | | | | | | | Specifically implement the if_requestencap callback function for infiniband. Most of the changes are simply a cut and paste of the equivalent ethernet part. Reviewed by: melifaro @ Differential Revision: https://reviews.freebsd.org/D27631 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking
* Fix for IPoIB over lagg(4).Hans Petter Selasky2020-12-292-9/+8
| | | | | | | | | | Need to update both link layer address and broadcast address when active link changes for IP over infiniband. This is because the broadcast address contains the so-called P-key, which is interface dependent. Reviewed by: kib @ Differential Revision: https://reviews.freebsd.org/D27658 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking
* geom(4): make g_newprovider_event() return if G_P_WITHER is setEdward Tomasz Napierala2020-12-291-2/+2
| | | | | | | | | | | This fixes a failed assertion in scenario where the provider disappears, disk_gone() gets called, and at the exact same time something else closes the device node triggering a retaste. Reviewed By: mav Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D27330
* devfs(4): defer freeing until we drop devmtx ("cdev")Edward Tomasz Napierala2020-12-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before r332974 the old code would sometimes cause a rare lock order reversal against pagequeue, which looked roughly like this: witness_checkorder() __mtx_lock-flags() vm_page_alloc() uma_small_alloc() keg_alloc_slab() keg_fetch-slab() zone_fetch-slab() zone_import() zone_alloc_bucket() uma_zalloc_arg() bucket_alloc() uma_zfree_arg() free() devfs_metoo() devfs_populate_loop() devfs_populate() devfs_rioctl() VOP_IOCTL_APV() VOP_IOCTL() vn_ioctl() fo_ioctl() kern_ioctl() sys_ioctl() Since r332974 the original problem no longer exists, but it still makes sense to move things out of the - often congested - lock. Reviewed By: kib, markj Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D27334
* Move cp(4) module enable to SOURCELESS_HOSTEd Maste2020-12-291-1/+1
| | | | cp contains obfuscated code that runs on the host's processor
* kern.mk: drop flag only patched in-tree gcc understoodRyan Libby2020-12-281-1/+1
| | | | | | | | | | | | | | | -mno-align-long-strings was a flag maintained by FreeBSD for the now-deleted in-tree gcc. Upstream gcc has no such flag, so just drop it. The flag was originally submitted by bde and committed in 2002 (svn r97911 & r104455). However, upstream gcc did address this same issue in 2004 (gcc svn r76694 / git 4137ba7ab7a), reducing long string alignment in general, and to 1 with -Os. Reviewed by: kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D27768
* cache: work around corner case of dvp == tvp in cache_fplookup_final_modifyingMateusz Guzik2020-12-281-0/+13
| | | | | | | Fixes a panic where the kernel would unlock an unheld lock coming from rename looking up "foo/." as the source. Reported by: markj (syzkaller)
* fusefs: delete some dead codeAlan Somers2020-12-283-80/+24
| | | | | | | | | The original fusefs GSoC project seems to have envisioned exchanging two types of messages with FUSE servers. Perhaps vectored and non-vectored? But in practice only one type has ever been used. Delete the other type. Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D27770
* Correct font.h comment describing vfnt font mapsEd Maste2020-12-281-5/+7
| | | | | | | | | Commit 41fb06651122 doubled the number of glyph maps in the vfnt format from 2 to 4 to support double-width characters, but a comment describing the maps was not updated to match. MFC after: 1 week Sponsored by: The FreeBSD Foundation
* Collect statistics from all rate-limit queues in mlx5en(4).Hans Petter Selasky2020-12-281-0/+24
| | | | | MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking
* Improve error message printing in krping.Hans Petter Selasky2020-12-281-5/+4
| | | | | | | Don't print completion queue flush as an error. MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking
* ARM64: Port FreeBSD to Nvidia Jetson TX1 and Nano.Michal Meloun2020-12-2818-0/+10773
| | | | Add support for the Tergra210 SoC and its companion PMIC MAX77620.
* cache: reduce engrish in previous commitMateusz Guzik2020-12-281-2/+2
|
* cache: save on some branching in common case mount point traversalMateusz Guzik2020-12-281-7/+64
|
* vfs: stop open-coding setting WILLBEDIR flagMateusz Guzik2020-12-281-7/+7
|
* vfs: add FAILIFEXISTS flagMateusz Guzik2020-12-284-21/+48
| | | | | | | | | | | | | | | | | Both FreeBSD and Linux mkdir -p walk the tree up ignoring any EEXIST on the way and both are used a lot when building respective kernels. This poses a problem as spurious locking avoidably interferes with concurrent operations like getdirentries on affected directories. Work around the problem by adding FAILIFEXISTS flag. In case of lockless lookup this manages to avoid any work to begin with, there is no speed up for the locked case but perhaps this can be augmented later on. For simplicity the only supported semantics are as used by mkdir. Reviewed by: kib (previous version) Differential Revision: https://reviews.freebsd.org/D27789
* cache: simplify lockless dot lookupsMateusz Guzik2020-12-281-10/+9
|
* route: quiet -Wredundant-declsRyan Libby2020-12-281-1/+0
| | | | | | | | | Remove declaration duplicated in f5baf8bb12f39d0e8d64508c47eb6c4386ef716d Reviewed by: melifaro Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D27790
* Merge commit d8a09b3a0 from openzfs git (by Ryan Libby):Ryan Libby2020-12-271-4/+6
| | | | | | | | | | | | | | | | | | lua: avoid gcc -Wreturn-local-addr bug Avoid a bug with gcc's -Wreturn-local-addr warning with some obfuscation. In buggy versions of gcc, if a return value is an expression that involves the address of a local variable, and even if that address is legally converted to a non-pointer type, a warning may be emitted and the value of the address may be replaced with zero. Howerver, buggy versions don't emit the warning or replace the value when simply returning a local variable of non-pointer type. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90737 Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Libby <rlibby@FreeBSD.org> Closes #11337
* Merge commit 956f94010 from openzfs git (by Ryan Libby):Ryan Libby2020-12-271-1/+1
| | | | | | | | | | | | | | | | spa: avoid type narrowing warning Building the spa module for i386 caused gcc to emit -Wint-to-pointer-cast "cast to pointer from integer of different size" because spa.spa_did was uint64_t but pthread_join (via thread_join in spa_deactivate) takes a pointer (32-bit on i386). Define spa_did to be pointer-size instead. For now spa_did is in fact never non-zero and the thread_join could instead be ifdef'd out, but changing the size of spa_did may be more useful for the future. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Libby <rlibby@FreeBSD.org> Closes #11336
* Merge commit c7500ded3 from openzfs git (by Ryan Libby):Ryan Libby2020-12-271-1/+1
| | | | | | | | | | | | | | | FreeBSD libzfs: gcc requires __thread after static Building libzfs with gcc on FreeBSD failed because gcc is picky about the order of keywords in declarations with __thread, whereas clang is more relaxed. https://gcc.gnu.org/onlinedocs/gcc/Thread-Local.html Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Ryan Libby <rlibby@FreeBSD.org> Closes #11331
* Merge commit 3fcd73747 from openzfs git (by Adrian Chadd):Ryan Libby2020-12-271-12/+20
| | | | | | | | | | | | | | | | | | | | Fix compiling on FreeBSD + gcc - don't assume illmnos bits This looks like it was once from the illumnos compat code. FreeBSD doesn't have cmn_err as a compiler format attribute, so it definitely errors out. It doesn't show up on LLVM because it doesn't trigger at all. Add in the format flags but keep them behind #if 0 for now; there are too many format issues that trigger when one does format checking in the shared code. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: adrian chadd <adrian@freebsd.org> Closes #11068 Closes #11069
* Merge commit 79a357c2a from openzfs git (by Adrian Chadd):Ryan Libby2020-12-271-2/+2
| | | | | | | | | | | | | Fix pointer-is-uint64_t-sized assumption in the ioctl path This shows up when compiling freebsd-head on amd64 using gcc-6.4. The lib32 compat build ends up tripping over this assumption. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: adrian chadd <adrian@freebsd.org> Closes #11068 Closes #11069
* openzfs: fix gcc kernel module buildsRyan Libby2020-12-2716-1/+18
| | | | | | | | | | | | | | | | | - Suppress -Wredundant-decls. Ultimately this warning is harmless in any case, and it does not look like there is a simple way to avoid redundant declarations in this case without a lot of header pollution (e.g. having openzfs's shim param.h pulling in sys/kernel.h for hz). - Suppress -Wnested-externs, which is useless anyway. Unfortunately it was not sufficient just to modify OPENZFS_CFLAGS, because the warning suppressions need to appear on the command line after they are explicitly enabled by CWARNFLAGS from sys/conf/kern.mk, but OPENZFS_CFLAGS get added before due to use of -I for the shims. Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D27685
* msdosfs: Fix a leak of dirent padding bytesMark Johnston2020-12-271-0/+1
| | | | | | | | | | This was missed in r340856 / commit 6d2e2df764199f0a15fd743e79599391959cc17d. Three bytes from the kernel stack may be leaked when reading directory entries. Reported by: Syed Faraz Abrar <faraz@elttam.com> MFC after: 3 days Sponsored by: The FreeBSD Foundation
* vm: Fix some bugs in the page busying codeMark Johnston2020-12-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | In vm_page_busy_acquire(), load the object pointer using atomic_load_ptr() as we do elsewhere. Per the comment, the object identity must be consistent across sleeps. In vm_page_grab_sleep(), pass the correct pindex to _vm_page_busy_sleep(). The pindex is used to re-check the page's identity before going to sleep. In particular, vm_page_grab_sleep() is used in unlocked grab, so the object lock is not necessarily held when verifying the page's identity, and the pindex may change if the page is moved, or freed and re-allocated. I believe this can result in spurious VM_PAGER_FAILs from vm_page_grab_valid_unlocked() or early termination of vm_page_grab_pages_unlocked(). In vm_page_grab_pages(), pass the correct pindex to vm_page_grab_sleep(). Otherwise I believe vm_page_grab_pages() will effectively spin when attempting to busy a busy page after the first index in the range. Reviewed by: alc, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27607
* uma: Remove the MINBUCKET flag from the flag name listMark Johnston2020-12-271-1/+0
| | | | | | | | This should have been done in r368399 / commit f8b6c51538fab88a7a62a399fb0948806b06133c. Reported by: rlibby Sponsored by: The FreeBSD Foundation
* md: Set bio_completed properly in the face of errorsMark Johnston2020-12-271-1/+1
| | | | | | | | | | Account for any residual bytes. This is only relevant for vnode-backed md(4) devices. Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27738
* cache: modification and last entry filling support in lockless lookup v2Mateusz Guzik2020-12-271-16/+286
| | | | | | | | | The previous patch failed to set the ISDOTDOT flag when appropriate, which in turn fail to properly handle degenerate lookups. While here sprinkle some extra assertions. Tested by: pho (previous version)
* cache: assert internal flags are not passed by nameiMateusz Guzik2020-12-271-0/+6
|
* Revert "cache: modification and last entry filling support in lockless lookup"Mateusz Guzik2020-12-271-281/+16
| | | | | | This reverts commit 6dbb07ed6872ae7988b9b705e322c94658eba6d1. Some ports unreliably fail to build with rmdir getting ENOTEMPTY.
* Perform kernel linker ifunc test only for buildsEd Maste2020-12-271-1/+2
| | | | | | | | | | | | | | | | | dvl reported that "make installkernel" failed with "amd64/arm64/i386 kernel requires linker ifunc support." This test should apply to builds only; the linker is not used at install time. I think the same (ifunc-supporting) linker used to build the kernel should be detected at install time in usual cases (and so not trigger this error). However, there is no reason to disallow the install, if for some reason the expected linker isn't the one tested at install time. PR: 251580 Reported by: dvl MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
* cache: modification and last entry filling support in lockless lookupMateusz Guzik2020-12-271-16/+281
| | | | Tested by: pho (previous version)
* EXTRES: Ignore index modifier flags for table based clock dividers.Michal Meloun2020-12-271-23/+22
| | | | | | | The divider table already contains the correct HW divider value, it should not be modified by other flags such as 'CLK_DIV_ZERO_BASED'. MFC after: 4 weeks
* amd64 nmi handler: fix comment about %ebxKonstantin Belousov2020-12-271-2/+2
| | | | | Reported by: markj MFC after: 3 days
* amd64: preserve %cr2 in NMI/MCE/DBG handlers.Konstantin Belousov2020-12-272-7/+17
| | | | | | | | | | | | | These handlers could interrupt code which has interrupts disabled, and if a spurious page fault occurs during exception handler run, we get clobbered %cr2 in higher level stack. This is mostly a speculation, but it is based on hints from good sources. MFC after: 1 week Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27772
* Regen.Konstantin Belousov2020-12-2710-3/+77
|
* Expose eventfd in the native API/ABI using a new __specialfd syscallKonstantin Belousov2020-12-2714-330/+574
| | | | | | | | | | | | | | | | | | | | eventfd is a Linux system call that produces special file descriptors for event notification. When porting Linux software, it is currently usually emulated by epoll-shim on top of kqueues. Unfortunately, kqueues are not passable between processes. And, as noted by the author of epoll-shim, even if they were, the library state would also have to be passed somehow. This came up when debugging strange HW video decode failures in Firefox. A native implementation would avoid these problems and help with porting Linux software. Since we now already have an eventfd implementation in the kernel (for the Linuxulator), it's pretty easy to expose it natively, which is what this patch does. Submitted by: greg@unrelenting.technology Reviewed by: markj (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26668
* Remove useless ARGUSED annotations.Konstantin Belousov2020-12-271-10/+0
| | | | Submitted by: greg@unrelenting.technology
* Add SPDX tag.Konstantin Belousov2020-12-271-0/+2
| | | | Submitted by: greg@unrelenting.technology
* jail: add a missing lock around an osd_jail_call().Jamie Gritton2020-12-271-3/+9
| | | | | | | | | allprison_lock should be at least held shared when jail OSD methods are called. Add a shared lock around one such call where that wasn't the case. In another such call, change an exclusive lock grab to be shared in what is likely the more common case.