------------------------------------------------------------------------ r367603 | dim | 2020-11-11 14:18:24 -0800 (Wed, 11 Nov 2020) | 38 lines MFC r367485: Merge commit 354d3106c from llvm git (by Kai Luo): [PowerPC] Skip combining (uint_to_fp x) if x is not simple type Current powerpc64le backend hits ``` Combining: t7: f64 = uint_to_fp t6 llc: llvm-project/llvm/include/llvm/CodeGen/ValueTypes.h:291: llvm::MVT llvm::EVT::getSimpleVT() const: Assertion `isSimple() && "Expected a SimpleValueType!"' failed. ``` This patch fixes it by skipping combination if `t6` is not simple type. Fixed https://bugs.llvm.org/show_bug.cgi?id=47660. Reviewed By: #powerpc, steven.zhang Differential Revision: https://reviews.llvm.org/D88388 This should fix the llvm assertion mentioned above when building the following ports for powerpc64le: * audio/traverso * databases/percona57-pam-for-mysql * databases/percona57-server * emulators/citra * emulators/citra-qt5 * games/7kaa * graphics/dia * graphics/mandelbulber * graphics/pcl-pointclouds * net-p2p/libtorrent-rasterbar * textproc/htmldoc Requested by: pkubaj ------------------------------------------------------------------------ r367620 | bz | 2020-11-12 09:26:19 -0800 (Thu, 12 Nov 2020) | 9 lines MFC r367538: arm64: bs_sr_ take II In r367327 generic_bs_sr_ were derived from mips. Given we are calling generic_bs_w_ and no write directly, we do not have to do the address calculations ourselves as eneric_bs_w_ will do a str val [bsh, offset]. All we actually have to do is increment offset. ------------------------------------------------------------------------ r367633 | 0mp | 2020-11-13 01:48:54 -0800 (Fri, 13 Nov 2020) | 4 lines MFC r367567: Address a mandoc warning ------------------------------------------------------------------------ r367637 | mjg | 2020-11-13 05:36:46 -0800 (Fri, 13 Nov 2020) | 5 lines MFC r367352,r367353: pipe: fix POLLHUP handling if no events were specified pipe: whitespace nit in previous ------------------------------------------------------------------------ r367638 | mjg | 2020-11-13 05:38:08 -0800 (Fri, 13 Nov 2020) | 4 lines MFC r367572: Allow rtprio_thread to operate on threads of any process ------------------------------------------------------------------------ r367656 | kevans | 2020-11-13 16:59:55 -0800 (Fri, 13 Nov 2020) | 10 lines MFC r367076: diff: don't force the format to 'context' with -p immediately Instead, leave the fomat as unspecified (if it hasn't been) and use the -p flag as a hint to 'context' if no other formatting option is specified. This fixes `diff -purw`, used frequently by emaste, and matches the behavior of its GNU counterpart. PR: 250015 ------------------------------------------------------------------------ r367657 | kevans | 2020-11-13 17:28:04 -0800 (Fri, 13 Nov 2020) | 115 lines MFC imgact_binmisc housecleaning: r367361, r367439, r367441-r367442, r367444, r367452, r367456, r367477 r367361: imgact_binmisc: fix up some minor nits - Removed a bunch of redundant headers - Don't explicitly initialize to 0 - The !error check prior to setting imgp->interpreter_name is redundant, all error paths should and do return or go to 'done'. We have larger problems otherwise. r367439: imgact_binmisc: minor re-organization of imgact_binmisc_exec exits Notably, streamline error paths through the existing 'done' label, making it easier to quickly verify correct cleanup. Future work might add a kernel-only flag to indicate that a interpreter uses #a. Currently, all executions via imgact_binmisc pay the penalty of constructing sname/fname, even if they will not use it. qemu-user-static doesn't need it, the stock rc script for qemu-user-static certainly doesn't use it, and I suspect these are the vast majority of (if not the only) current users. r367441: binmiscctl(8): miscellaneous cleanup - Bad whitespace in Makefile. - Reordered headers, sys/ first. - Annotated fatal/usage __dead2 to help `make analyze` out a little bit. - Spell a couple of sizeof constructs as "nitems" and "howmany" instead. r367442: imgact_binmisc: validate flags coming from userland We may want to reserve bits in the future for kernel-only use, so start rejecting any that aren't the two that we're currently expecting from userland. r367444: imgact_binmisc: abstract away the list lock (NFC) This module handles relatively few execs (initial qemu-user-static, then qemu-user-static handles exec'ing itself for binaries it's already running), but all execs pay the price of at least taking the relatively expensive sx/slock to check for a match when this module is loaded. Future work will almost certainly swap this out for another lock, perhaps an rmslock. The RLOCK/WLOCK phrasing was chosen based on what the callers are really wanting, rather than using the verbiage typically appropriate for an sx. r367452: imgact_binmisc: reorder members of struct imgact_binmisc_entry (NFC) This doesn't change anything at the moment since the out-of-order elements were a pair of uint32_t, but future additions may have caused unnecessary padding by following the existing precedent. r367456: imgact_binmisc: move some calculations out of the exec path The offset we need to account for in the interpreter string comes in two variants: 1. Fixed - macros other than #a that will not vary from invocation to invocation 2. Variable - #a, which is substitued with the argv0 that we're replacing Note that we don't have a mechanism to modify an existing entry. By recording both of these offset requirements when the interpreter is added, we can avoid some unnecessary calculations in the exec path. Most importantly, we can know up-front whether we need to grab calculate/grab the the filename for this interpreter. We also get to avoid walking the string a first time looking for macros. For most invocations, it's a swift exit as they won't have any, but there's no point entering a loop and searching for the macro indicator if we already know there will not be one. While we're here, go ahead and only calculate the argv0 name length once per invocation. While it's unlikely that we'll have more than one #a, there's no reason to recalculate it every time we encounter an #a when it will not change. I have not bothered trying to benchmark this at all, because it's arguably a minor and straightforward/obvious improvement. r367477: imgact_binmisc: limit the extent of match on incoming entries imgact_binmisc matches magic/mask from imgp->image_header, which is only a single page in size mapped from the first page of an image. One can specify an interpreter that matches on, e.g., --offset 4096 --size 256 to read up to 256 bytes past the mapped first page. The limitation is that we cannot specify a magic string that exceeds a single page, and we can't allow offset + size to exceed a single page either. A static assert has been added in case someone finds it useful to try and expand the size, but it does seem a little unlikely. While this looks kind of exploitable at a sideways squinty-glance, there are a couple of mitigating factors: 1.) imgact_binmisc is not enabled by default, 2.) entries may only be added by the superuser, 3.) trying to exploit this information to read what's mapped past the end would be worse than a root canal or some other relatably painful experience, and 4.) there's no way one could pull this off without it being completely obvious. The first page is mapped out of an sf_buf, the implementation of which (or lack thereof) depends on your platform. ------------------------------------------------------------------------ r367662 | kevans | 2020-11-13 17:55:54 -0800 (Fri, 13 Nov 2020) | 23 lines MFC r367440: epoch: support non-preemptible epochs checking in_epoch() Previously, non-preemptible epochs could not check; in_epoch() would always fail, usually because non-preemptible epochs don't imply THREAD_NO_SLEEPING. For default epochs, it's easy enough to verify that we're in the given epoch: if we're in a critical section and our record for the given epoch is active, then we're in it. This patch also adds some additional INVARIANTS bookkeeping. Notably, we set and check the recorded thread in epoch_enter/epoch_exit to try and catch some edge-cases for the caller. It also checks upon freeing that none of the records had a thread in the epoch, which may make it a little easier to diagnose some improper use if epoch_free() took place while some other thread was inside. This version differs slightly from what was just previously reviewed by the below-listed, in that in_epoch() will assert that no CPU has this thread recorded even if it *is* currently in a critical section. This is intended to catch cases where the caller might have somehow messed up critical section nesting, we can catch both if they exited the critical section or if they exited, migrated, then re-entered (on the wrong CPU). ------------------------------------------------------------------------ r367663 | kevans | 2020-11-13 17:58:33 -0800 (Fri, 13 Nov 2020) | 14 lines MFC r367448: vt: resolve conflict between VT_ALT_TO_ESC_HACK and DBG When using the ALT+CTRL+ESC sequence to break into kdb, the keyboard is completely borked when you return. watch(8) shows that it's working, but it's inserting escape sequences. Further investigation revealed that VT_ALT_TO_ESC_HACK is the default and directly conflicts with this sequence, so upon return from the debugger ALKED is set. If they triggered the break to debugger, it's safe to assume they didn't mean to use VT_ALT_TO_ESC_HACK, so just unset it to reduce the surprise when the keyboard seems non-functional upon return. ------------------------------------------------------------------------ r367664 | kevans | 2020-11-13 18:00:50 -0800 (Fri, 13 Nov 2020) | 11 lines MFC r366430: ngctl: add -c (compact output) for the dot command The output of "ngctl dot" is suitable for small netgraph networks. Even moderate complex netgraph setups (about a dozen nodes) are hard to understand from the .dot output, because each node and each hook are shown as a full blown structure. This patch allows to generate much more compact output and graphs by omitting the extra structures for the individual hooks. Instead the names of the hooks are labels to the edges. ------------------------------------------------------------------------ r367665 | kevans | 2020-11-13 18:03:34 -0800 (Fri, 13 Nov 2020) | 8 lines MFC r366275: Makefile.inc1: sysent: parallel subordinate sysent targets makesyscalls.lua (and indeed makesyscalls.sh) are both safe to be run in parallel, so let's do it. This is a trivial difference because runtime per-target is pretty small, but I like seeing it run in parallel when my muscle memory types `make -sj4`. ------------------------------------------------------------------------ r367666 | kevans | 2020-11-13 18:11:04 -0800 (Fri, 13 Nov 2020) | 17 lines MFC r366435: lualoader: improve the design of the brand-/logo- mechanism In the previous world order, any brand/logo was forced to pull in the drawer and call drawer.add{Brand,Logo} with the name their brand/logo is taking and a table describing it. In the new world order, these files just need to return a table that maps out graphics types to a table of the exact same format as what was previously being passed back into the drawer. The appeal here is not needing to grab a reference back to the drawer module and having a cleaner data-driven looking format for these. The format has been renamed to 'gfx-*' prefixes and each one can provide a logo and a brand. drawer.addBrand/drawer.addLogo will remain in place until FreeBSD 13, as there's no overhead to them and it's not yet worth the break in compatibility with any pre-existing brands and logos. ------------------------------------------------------------------------ r367667 | kevans | 2020-11-13 18:11:56 -0800 (Fri, 13 Nov 2020) | 2 lines MFC r366770: libc: typo fix (s/involes/involves) ------------------------------------------------------------------------ r367675 | wulf | 2020-11-14 03:48:28 -0800 (Sat, 14 Nov 2020) | 4 lines MFC r367230: ig4(4): Add PCI IDs for Intel Comet Lake I2C controllers. ------------------------------------------------------------------------ r367676 | wulf | 2020-11-14 03:51:37 -0800 (Sat, 14 Nov 2020) | 9 lines MFC r367237: devmatch(8): Respect mask field when matching strings of Z type. While here, add debug output for this action. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D26823 ------------------------------------------------------------------------ r367677 | wulf | 2020-11-14 04:02:50 -0800 (Sat, 14 Nov 2020) | 21 lines MFC r367239-367241: r367239: Add plug and play information macroses for ACPI and I2C buses. Matching table format is compatible with ACPI_ID_PROBE bus method. Note that while ACPI_ID_PROBE matches against _HID and all _CIDs, current acpi_pnpinfo_str() exports only _HID and first _CID. That means second and further _CIDs should be added to both acpi_pnpinfo_str() and ACPICOMPAT_PNP_INFO if device matching against them is required. r367240: acpi_wmi(4): Add ACPI_PNP_INFO r367241: acpi_dock(4): Add ACPI_PNP_INFO Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D26824 ------------------------------------------------------------------------ r367679 | gbe | 2020-11-14 06:15:49 -0800 (Sat, 14 Nov 2020) | 8 lines MFC r366580: bpf(4): Update the man page to reflect reality PR: 131918 Submitted by: guy at alum dot mit dot edu Reviewed by: gnn, gbe Approved by: gnn Differential Revision: https://reviews.freebsd.org/D25993 ------------------------------------------------------------------------ r367681 | kevans | 2020-11-14 07:19:36 -0800 (Sat, 14 Nov 2020) | 10 lines MFC r366769: MFC r366760: lua: update to 5.3.6 This release contains some minor bugfixes; notably: - 2x minor Makefile fixes (not used in base) - Long brackets with a huge number of '=' overflow some internal buffer arithmetic. - Joining an upvalue with itself can cause a use-after-free crash. See here for examples: http://www.lua.org/bugs.html#5.3.5 ------------------------------------------------------------------------ r367682 | kevans | 2020-11-14 07:21:20 -0800 (Sat, 14 Nov 2020) | 12 lines MFC r366820-r366821: libbe(3) documentation improvements r366820: libbe(3): document be_snapshot() While toying around with lua bindings for libbe(3), I discovered that I apparently never documented this, despite having documented be_is_auto_snapshot_name that references it. r366821: libbe(3): install MLINKS for all of the functions provided ------------------------------------------------------------------------ r367683 | kevans | 2020-11-14 07:26:18 -0800 (Sat, 14 Nov 2020) | 5 lines MFC r366819: libbe(3): const'ify a couple arguments libbe will never need to mutate these as we either process them into a local buffer or we just don't touch them and write to a separate out argument. ------------------------------------------------------------------------ r367684 | kevans | 2020-11-14 07:33:39 -0800 (Sat, 14 Nov 2020) | 6 lines MFC r367604: umtx: drop incorrect timespec32 definition This works for amd64, but none others -- drop it, because we already have a proper definition in sys/compat/freebsd32/freebsd32.h that correctly uses time32_t. ------------------------------------------------------------------------ r367698 | kevans | 2020-11-14 12:44:34 -0800 (Sat, 14 Nov 2020) | 7 lines MFC r365883: pkgbase: use consistent annotation for object keys Everywhere else we use objects ("scripts", generally) we do specify the optional colon. Be consistent and do the same for directories. PR: 249273 ------------------------------------------------------------------------ r367699 | kevans | 2020-11-14 12:45:12 -0800 (Sat, 14 Nov 2020) | 4 lines MFC r366231: Address whitespace nits in subr_rtc.c These were separated out from a nearby patch from Andrew Gierth. ------------------------------------------------------------------------ r367704 | dim | 2020-11-15 03:28:02 -0800 (Sun, 15 Nov 2020) | 32 lines MFC r367623: Merge commit 8df4e6094 from llvm git (by Fangrui Song): [ELF] Don't consider SHF_ALLOC ".debug*" sections debug sections Fixes PR48071 * The Rust compiler produces SHF_ALLOC `.debug_gdb_scripts` (which normally does not have the flag) * `.debug_gdb_scripts` sections are removed from `inputSections` due to --strip-debug/--strip-all * When processing --gc-sections, pieces of a SHF_MERGE section can be marked live separately `=>` segfault when marking liveness of a `.debug_gdb_scripts` which is not split into pieces (because it is not in `inputSections`) This patch circumvents the problem by not treating SHF_ALLOC ".debug*" as debug sections (to prevent --strip-debug's stripping) (which is still useful on its own). Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D91291 This should fix lld segfaulting when linking the rust-based parts of the devel/py-maturin port. Reported by: Nick Venenga PR: 250783 ------------------------------------------------------------------------ r367705 | kp | 2020-11-15 03:46:44 -0800 (Sun, 15 Nov 2020) | 5 lines bridge: epoch-ification Undo the revert (r363568). This commit still violates epoch rules by sleeping within NET_EPOCH. That will be resolved in the following commit. ------------------------------------------------------------------------ r367706 | kp | 2020-11-15 03:56:16 -0800 (Sun, 15 Nov 2020) | 14 lines MFC r366500: bridge: call member interface ioctl() without NET_EPOCH We're not allowed to hold NET_EPOCH while sleeping, so when we call ioctl() handlers for member interfaces we cannot be in NET_EPOCH. We still need some protection of our CK_LISTs, so hold BRIDGE_LOCK instead. That requires changing BRIDGE_LOCK into a sleepable lock, and separating the BRIDGE_RT_LOCK, to protect bridge_rtnode lists. That lock is taken in the data path (while in NET_EPOCH), so it cannot be a sleepable lock. While here document the locking strategy. ------------------------------------------------------------------------ r367707 | 0mp | 2020-11-15 04:28:57 -0800 (Sun, 15 Nov 2020) | 8 lines MFC r367253: Document how to use sudo for SU_CMD It is rather common for the ports users to replace su(1) with sudo(8) within the SU_CMD variable. Let's document it in the manual page (so far it's been hidden in a comment within bsd.commands.mk). ------------------------------------------------------------------------ r367723 | 0mp | 2020-11-16 03:57:49 -0800 (Mon, 16 Nov 2020) | 7 lines MFC r367639: Reference setprogname(3) in setproctitle(3) The reference to setproctitle(3) in the setprogname(3) manual is already in place. ------------------------------------------------------------------------ r367727 | markj | 2020-11-16 08:53:46 -0800 (Mon, 16 Nov 2020) | 3 lines MFC r367617: qat: Fix nits reported by Coverity ------------------------------------------------------------------------ r367729 | mhorne | 2020-11-16 09:41:05 -0800 (Mon, 16 Nov 2020) | 3 lines MFC r367175: Slight refactor in vmimage.subr ------------------------------------------------------------------------ r367730 | mhorne | 2020-11-16 09:42:22 -0800 (Mon, 16 Nov 2020) | 3 lines MFC r367176: vmimage.subr: noisier failure for unsupported targets ------------------------------------------------------------------------ r367731 | mhorne | 2020-11-16 09:44:34 -0800 (Mon, 16 Nov 2020) | 3 lines MFC r367177: arm64: convert virtual machine images to GPT ------------------------------------------------------------------------ r367732 | mhorne | 2020-11-16 09:45:42 -0800 (Mon, 16 Nov 2020) | 3 lines MFC r367178: arm64: set the correct partition type in make-memstick.sh ------------------------------------------------------------------------ r367739 | mav | 2020-11-16 16:35:59 -0800 (Mon, 16 Nov 2020) | 2 lines MFC r367659: Add PMRCAP printing and fix earlier CAP_HI. ------------------------------------------------------------------------ r367740 | gnn | 2020-11-16 17:02:00 -0800 (Mon, 16 Nov 2020) | 10 lines MFC: 367628, 367635, 367645 An earlier commit effectively turned out the fast forwading path due to its lack of support for ICMP redirects. The following commit adds redirects to the fastforward path, again allowing for decent forwarding performance in the kernel. Reviewed by: ae, melifaro (also helped with the MFC) Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") ------------------------------------------------------------------------ r367747 | eugen | 2020-11-16 21:00:23 -0800 (Mon, 16 Nov 2020) | 8 lines MFC r367545: ng_nat: unbreak ABI The revision r342168 broke ABI of ng_nat needlessly and the change was merged to stable branches breaking ABI there, too. Unbreak it. PR: 250722 ------------------------------------------------------------------------ r367749 | mckusick | 2020-11-16 21:48:00 -0800 (Mon, 16 Nov 2020) | 11 lines MFC of 340927 and 367034. Move clear of UFS feature flags from ufs_mountfs() to ffs_sbget() to ensure that the appropriate feature flags get cleared by filesystem utilities as well as the kernel when they modify the filesystem. Note 340927 is relevant for this even though it was done for a different reason at the time. Sponsored by: Netflix ------------------------------------------------------------------------ r367750 | mckusick | 2020-11-16 21:59:55 -0800 (Mon, 16 Nov 2020) | 6 lines MFC of 367035. Require clean superblock for tunefs, growfs, and fsirand Sponsored by: Netflix ------------------------------------------------------------------------ r367751 | mckusick | 2020-11-16 22:04:16 -0800 (Mon, 16 Nov 2020) | 6 lines MFC of 367045. Avoid improper sign extension in Pass5 inumber checks. Sponsored by: Netflix ------------------------------------------------------------------------ r367752 | rscheff | 2020-11-17 00:03:49 -0800 (Tue, 17 Nov 2020) | 12 lines MFC r367007: tcp: move cwnd and ssthresh updates into cc modules This will pave the way of setting ssthresh differently in TCP CUBIC, according to RFC8312 section 4.7. Use dynamic tcp_maxseg() adjusting for tcp options instead of static t_maxseg. Submitted by: chengc_netapp.com Reviewed by: rrs, tuexen, rscheff Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26807 ------------------------------------------------------------------------ r367753 | rscheff | 2020-11-17 00:11:17 -0800 (Tue, 17 Nov 2020) | 10 lines MFC r367008: TCP Cubic: improve reaction to (and rollback from) RTO fix compliancy issue of CUBIC RTO handling according to RFC8312 section 4.7 add CUBIC CC_RTO_ERR handling Submitted by: chengc_netapp.com Reviewed by: rrs, tuexen, rscheff Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26808 ------------------------------------------------------------------------ r367780 | mav | 2020-11-17 18:05:59 -0800 (Tue, 17 Nov 2020) | 8 lines MFC r367600: Make CTL nicer to increased MAXPHYS. Before this CTL always allocated MAXPHYS-sized buffers, even for 4KB I/O, that is even more overkill for MAXPHYS of 1MB. This change limits maximum allocation to 512KB if MAXPHYS is bigger, plus if one is above 128KB, adds new 128KB UMA zone for smaller I/Os. The patch factors out alloc/free, so later we could make it use more zones or malloc() if we'd like. ------------------------------------------------------------------------ r367786 | 0mp | 2020-11-18 01:00:05 -0800 (Wed, 18 Nov 2020) | 8 lines MFC r367552: Do not document MOTIFLIB in ports(7) Perhaps it made sense in 1998 (r32836), but now it feels a bit out of place. We tend to avoid documenting non-essential ports variables in the manual page (we try to document them in the Porter's Handbook instead). ------------------------------------------------------------------------ r367790 | ae | 2020-11-18 05:52:13 -0800 (Wed, 18 Nov 2020) | 9 lines MFC r367594: Fix possible NULL pointer dereference. lagg(4) replaces if_output method of its child interfaces and expects that this method can be called only by child interfaces. But it is possible that lagg_port_output() could be called by children of child interfaces. In this case ifnet's if_lagg field is NULL. Add check that lp is not NULL. ------------------------------------------------------------------------ r367791 | markj | 2020-11-18 06:27:24 -0800 (Wed, 18 Nov 2020) | 3 lines MFC r367588: Fix a pair of races in SIGIO registration ------------------------------------------------------------------------ r367792 | markj | 2020-11-18 06:27:47 -0800 (Wed, 18 Nov 2020) | 3 lines MFC r367596: iflib: Free full mbuf chains when draining transmit queues ------------------------------------------------------------------------