aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* MFOpenZFS: Fix zpool history unbounded memory usageMark Johnston2020-07-233-26/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In original implementation, zpool history will read the whole history before printing anything, causing memory usage goes unbounded. We fix this by breaking it into read-print iterations. Reviewed-by: Tom Caputi <tcaputi@datto.com> Reviewed-by: Matt Ahrens <matt@delphix.com> Reviewed-by: Igor Kozhukhov <igor@dilos.org> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Chunwei Chen <david.chen@nutanix.com> Closes #9516 Note, this change changes the libzfs.so ABI by modifying the prototype of zpool_get_history(). Since libzfs is effectively private to the base system it is anticipated that this will not be a problem. PR: 247557 Obtained from: OpenZFS Reported and tested by: Sam Vaughan <samjvaughan@gmail.com> Discussed with: freqlabs MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25745 openzfs/zfs@7125a109dcc55628336ff3f58e59e503f4d7694d Notes: svn path=/head/; revision=363447
* cuse: Stop checking for failures from malloc(M_WAITOK).Mark Johnston2020-07-231-13/+0
| | | | | | | | | | | PR: 240545 Submitted by: Andrew Reiter <arr@watson.org> Reviewed by: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25765 Notes: svn path=/head/; revision=363446
* ntb: Stop checking for failures from malloc(M_WAITOK).Mark Johnston2020-07-231-25/+4
| | | | | | | | | | | PR: 240545 Submitted by: Andrew Reiter <arr@watson.org> Reviewed by: cem, mav MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25768 Notes: svn path=/head/; revision=363445
* vm: annotate swap_reserved with __exclusive_cache_lineMateusz Guzik2020-07-231-1/+1
| | | | | | | | | | | | | The counter keeps being updated all the time and variables read afterwards share the cacheline. Note this still fundamentally does not scale and needs to be replaced, in the meantime gets a bandaid. brk1_processes -t 52 ops/s: before: 8598298 after: 9098080 Notes: svn path=/head/; revision=363444
* Detect and handle an invalid reassembly constellation, which results inMichael Tuexen2020-07-232-23/+33
| | | | | | | | | | | | a memory leak. Thanks to Felix Weinrank for finding this issue using fuzz testing the userland stack. MFC after: 1 week Notes: svn path=/head/; revision=363440
* Correct a type-mismatch between xdr_long and the variable "bad".Brooks Davis2020-07-221-1/+2
| | | | | | | | | | | | | | | | | Way back in r28911 (August 1997, CVS rev 1.22) we imported a NetBSD information leak fix via OpenBSD. Unfortunatly we failed to track the followup commit that fixed the type of the error code. Apply the change from int to long now. Reviewed by: emaste Found by: CHERI Obtained from: CheriBSD MFC after: 3 days Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25779 Notes: svn path=/head/; revision=363439
* Use SI_ORDER_(FOURTH|FIFTH) rather than bespoke versions.Brooks Davis2020-07-221-4/+4
| | | | | | | | | | | | | | | No functional change. When these SYSINITs were added these macros didn't exist. Reviewed by: imp Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25758 Notes: svn path=/head/; revision=363438
* Modify writing to mirrored pNFS DSs to prepare for use of ext_pgs mbufs.Rick Macklem2020-07-222-74/+98
| | | | | | | | | | | | | | | | | | | This patch modifies writing to mirrored pNFS DSs slightly so that there is only one m_copym() call for a mirrored pair instead of two of them. This call replaces the custom nfsm_copym() call, which is no longer needed and deleted by this patch. The patch does introduce a new nfsm_split() function that only calls m_split() for the non-ext_pgs case. The semantics of nfsm_uiombuflist() is changed to include code that nul pads the generated mbuf list. This was done by nfsm_copym() prior to this patch. The main reason for this change is that it allows the data to be a list of ext_pgs mbufs, since the m_copym() is for the entire mbuf list. This support will be added in a future commit. This patch only affects writing to mirrored flexible file layout pNFS servers. Notes: svn path=/head/; revision=363437
* Add missing space after switch.John Baldwin2020-07-222-4/+4
| | | | | | | | | Reviewed by: br, emaste Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25778 Notes: svn path=/head/; revision=363436
* Avoid reading one byte before the path buffer.Brooks Davis2020-07-221-2/+2
| | | | | | | | | | | | | | | | | | | This happens when there's only one component (e.g. "/foo"). This (mostly-harmless) bug has been present since June 1990 when it was commited to mountd.c SCCS version 5.9. Note: the bug is on the second changed line, the first line is changed for visual consistency. Reviewed by: cem, emaste, mckusick, rmacklem Found with: CHERI Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25759 Notes: svn path=/head/; revision=363435
* Untie nmi_handle_intr() from DEV_ISA.Alexander Motin2020-07-222-8/+0
| | | | | | | | | | The only part of nmi_handle_intr() depending on ISA is isa_nmi(), which is already wrapped. Entering debugger on NMI does not really depend on ISA. MFC after: 2 weeks Notes: svn path=/head/; revision=363431
* mmccam: Add support for 1.2V and 1.8V eMMCEmmanuel Vadot2020-07-221-4/+71
| | | | | | | | | If the card reports that it support 1.2V or 1.8V signaling switch to this voltage. Submitted by: kibab Notes: svn path=/head/; revision=363428
* mmccam: Add support for 1.8V sdcardEmmanuel Vadot2020-07-222-3/+49
| | | | | | | | | | If the card reports that it support 1.8V signaling switch to this voltage. While here update the list of mode for mmccam. Submitted by: kibab Notes: svn path=/head/; revision=363427
* aw_mmc: Start a mmccam discovery when the CD handler is called.Emmanuel Vadot2020-07-221-0/+4
| | | | | | | Submitted by: kibab Notes: svn path=/head/; revision=363426
* mmccam: Add a generic mmccam_start_discovery functionEmmanuel Vadot2020-07-223-44/+27
| | | | | | | | | | | This is a generic function start a scan request for the given cam_sim. Other driver can now just use this function to request a new rescan. Submitted by: kibab Notes: svn path=/head/; revision=363425
* mmccam: Use a sbuf for the mmc ident functionEmmanuel Vadot2020-07-221-21/+41
| | | | | | | While here fix a typo. Notes: svn path=/head/; revision=363424
* Fix sys.geom.class.eli.onetime_test.onetime after r363402Li-Wen Hsu2020-07-221-1/+1
| | | | | | | | | PR: 247954 X-MFC with: r363402 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=363423
* mmc_xpt: Fix debug messagesEmmanuel Vadot2020-07-221-1/+2
| | | | | | | | | | PROBE_RESET was printed for PROBE_IDENTIFY, fix this. While here add one for the PROBE_RESET. Submitted by: kibab Notes: svn path=/head/; revision=363422
* pkg-bootstrap: complain on improper `pkg bootstrap` usageKyle Evans2020-07-221-1/+9
| | | | | | | | | | | | | | Right now, the bootstrap will gloss over things like pkg bootstrap -x or pkg bootstrap -f pkg. Make it more clear that this is incorrect, and hint at the correct formatting. Reported by: jhb (IIRC via IRC) Approved by: bapt, jhb, manu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24750 Notes: svn path=/head/; revision=363421
* usb(4): Stop checking for failures from malloc(M_WAITOK).Mark Johnston2020-07-2212-60/+19
| | | | | | | | | | | | | | Handle the fact that parts of usb(4) can be compiled into the boot loader, where M_WAITOK does not guarantee a successful allocation. PR: 240545 Submitted by: Andrew Reiter <arr@watson.org> (original version) Reviewed by: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25706 Notes: svn path=/head/; revision=363420
* Add tests for "add", "change" and "delete" functionality of /sbin/route.Tom Jones2020-07-225-0/+188
| | | | | | | | | | | | | | | | Add tests to cover "add", "change" and "delete" functionality of /sbin/route for ipv4 and ipv6. These tests for the existing route tool are the first step towards creating libroute. Submitted by: Ahsan Barkati Sponsored by: Google, Inc. (GSoC 2020) Reviewed by: kp, thj Approved by: bz (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D25220 Notes: svn path=/head/; revision=363417
* geli(8): Add missing commands in the EXAMPLES sectionGordon Bergling2020-07-221-2/+4
| | | | | | | | | | | | | - Add a missing 'geli attach' command - Fix the passphrase prompt for a 'geli attach' command Reported by: Fabian Keil <freebsd-listen at fabiankeil dot de> Reviewed by: bcr (mentor) Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D25761 Notes: svn path=/head/; revision=363416
* lockmgr: add adaptive spinningMateusz Guzik2020-07-223-18/+114
| | | | | | | | | | | | | | | | | | | | | | It is very conservative. Only spinning when LK_ADAPTIVE is passed, only on exclusive lock and never when any waiters are present. buffer cache is remains not spinning. This reduces total sleep times during buildworld etc., but it does not shorten total real time (culprits are contention in the vm subsystem along with slock + upgrade which is not covered). For microbenchmarks: open3_processes -t 52 (open/close of the same file for writing) ops/s: before: 258845 after: 801638 Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D25753 Notes: svn path=/head/; revision=363415
* Consistently use gctl_get_provider instead of home-grown variants.Xin LI2020-07-2210-202/+62
| | | | | | | | | Reviewed by: cem, imp MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D25739 Notes: svn path=/head/; revision=363411
* gctl_get_class, gctl_get_geom and gctl_get_provider: provide feedbackXin LI2020-07-221-6/+11
| | | | | | | | | | | when the requested argument is missing. Reviewed by: cem MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D25738 Notes: svn path=/head/; revision=363410
* libbe: annotate lbh as __unused in be_is_auto_snapshot_nameKyle Evans2020-07-221-1/+1
| | | | | | | | | | | | lbh is included for consistency with other functions and in case future work needs to use it, but it is currently unused. Mark it, and a post-OpenZFS-import world will be able to raise WARNS of libbe to the default (pending some minor changes to openzfs libzfs). MFC after: 3 days Notes: svn path=/head/; revision=363409
* getty appears to date from 3rd edition research unix. That's the oldest man pageWarner Losh2020-07-221-2/+2
| | | | | | | | on TUHS and its 'unix 1972' restoration effort has assembler sources that look like simpler version of what's in the 5th edition. Notes: svn path=/head/; revision=363408
* INTRNG: only shuffle for !EARLY_AP_STARTUPMitchell Horne2020-07-212-5/+10
| | | | | | | | | | | | | | | | | | | | | | | During device attachment, all interrupt sources will bind to the BSP, as it is the only processor online. This means interrupts must be redistributed ("shuffled") later, during SI_SUB_SMP. For the EARLY_AP_STARTUP case, this is no longer true. SI_SUB_SMP will execute much earlier, meaning APs will be online and available before devices begin attachment, and there will therefore be nothing to shuffle. All PIC-conforming interrupt controllers will handle this early distribution properly, except for RISC-V's PLIC. Make the necessary tweak to the PLIC driver. While here, convert irq_assign_cpu from a boolean_t to a bool. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D25693 Notes: svn path=/head/; revision=363404
* Transition from rtrequest1_fib() to rib_action().Alexander V. Chernikov2020-07-219-154/+92
| | | | | | | | | | | | Remove all variations of rtrequest <rtrequest1_fib, rtrequest_fib, in6_rtrequest, rtrequest_fib> and their uses and switch to to rib_action(). This is part of the new routing KPI. Submitted by: Neel Chauhan <neel AT neelc DOT org> Differential Revision: https://reviews.freebsd.org/D25546 Notes: svn path=/head/; revision=363403
* Fix geli's null cipher, and add a test caseAlan Somers2020-07-213-6/+55
| | | | | | | | | | | PR: 247954 Submitted by: jhb (sys), asomers (tests) Reviewed by: jhb (tests), asomers (sys) MFC after: 2 weeks Sponsored by: Axcient Notes: svn path=/head/; revision=363402
* Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmpDimitry Andric2020-07-212-5/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | 10.0.1 final (aka llvmorg-10.0.1-0-gef32c611aa2). There were no changes since rc2, except in the upstream regression tests, which we do not ship. Relnotes: yes MFC after: immediately (no material changes except tag) Notes: svn path=/head/; revision=363401
* | Avoid code duplicaiton by using ipi_selected().Alexander Motin2020-07-212-14/+2
| | | | | | | | | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=363399
* | [skip ci] document close_range(2) as async-signal-safeAlan Somers2020-07-211-1/+2
| | | | | | | | | | | | | | | | | | | | Reviewed by: bcr (manpages) MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D25513 Notes: svn path=/head/; revision=363398
* | Fix style and comment around concave/convex regions in TCP cubic.Richard Scheffenegger2020-07-211-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In cubic, the concave region is when snd_cwnd starts growing slower towards max_cwnd (cwnd at the time of the congestion event), and the convex region is when snd_cwnd starts to grow faster and eventually appearing like slow-start like growth. PR: 238478 Reviewed by: tuexen (mentor), rgrimes (mentor) Approved by: tuexen (mentor), rgrimes (mentor) MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D24657 Notes: svn path=/head/; revision=363397
* | netstat(1): Add EXAMPLES sectionFernando ApesteguĂ­a2020-07-211-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | * Add small EXAMPLES section * Fix warning reported by mandoc (./netstat.1:747:2: WARNING: skipping paragraph macro: Pp before Ss) Approved by: manpages (gbe) Differential Revision: https://reviews.freebsd.org/D25212 Notes: svn path=/head/; revision=363396
* | traceroute6: Fix most warnings at the default WARNS level.Mark Johnston2020-07-212-61/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix some style issues as well. Leave -Wno-cast-aligned set for now, as most of the warnings come casts of CMSG_DATA(), which does provide sufficient alignment in practice. Submitted by: Shubh Gupta <shubh@freebsd.org> Sponsored by: Google (GSOC 2020) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25603 Notes: svn path=/head/; revision=363395
* | lockmgr: denote recursion with a bit in lock valueMateusz Guzik2020-07-212-7/+12
| | | | | | | | | | | | | | | | | | This reduces excessive reads from the lock. Tested by: pho Notes: svn path=/head/; revision=363394
* | lockmgr: rewrite upgrade to stop always dropping the lockMateusz Guzik2020-07-211-36/+34
| | | | | | | | | | | | | | This matches rw and sx locks. Notes: svn path=/head/; revision=363393
* | lockmgr: add a helper for reading the lock valueMateusz Guzik2020-07-212-17/+18
| | | | | | | | Notes: svn path=/head/; revision=363392
* | Only write to VIRTIO_MMIO_GUEST_PAGE_SIZE with virtio mmio version 1Andrew Turner2020-07-211-4/+8
| | | | | | | | | | | | | | | | | | | | This register is only defined for the legacy v1 interface so only write to it when interacting with a legacy device. Sponsored by: Innovate UK Notes: svn path=/head/; revision=363390
* | Move sys/iommu.h to dev/iommu/ as a part of generic IOMMU busdma backend.Ruslan Bukin2020-07-214-3/+3
| | | | | | | | | | | | | | | | | | Reviewed by: kib Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D25750 Notes: svn path=/head/; revision=363388
* | Move the Intel DMAR busdma backend to a generic place soRuslan Bukin2020-07-2112-13/+13
| | | | | | | | | | | | | | | | | | | | | | it can be used on other IOMMU systems. Reviewed by: kib Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D25720 Notes: svn path=/head/; revision=363387
* | dtrace/fbt: fix return probe arguments on armAndriy Gapon2020-07-212-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arg0 should be an offset of the return point within the function, arg1 should be the return value. Previously the return probe had arguments as if for the entry probe. Tested on armv7. andrew noted that the same problem seems to be present on arm64, mips, and riscv. I am not sure if I will get around to fixing those. So, platform users or anyone looking to make a contribution please be aware of this opportunity. Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25685 Notes: svn path=/head/; revision=363383
* | gpioiic: never drive lines active highAndriy Gapon2020-07-211-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I2C communication is done by a combination of driving a line low or letting it float, so that it is either pulled up or driven low by another party. r355276 besides the stated goal of the change -- using the new GPIO API -- also changed the logic, so that active state is signaled by actively driving a line. That worked with iicbb prior to r362042, but stopped working after that commit on at least some hardware. My guess that the breakage was related to getting an ACK bit. A device expected to be able to drive SDA actively low, but controller was actively driving it high for some time. Anyway, this change seems to fix the problem. Tested using gpioiic on Orange Pi PC Plus with HTU21 sensor. Reported by: Nick Kostirya <nikolay.kostirya@i11.co> Reviewed by: manu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25684 Notes: svn path=/head/; revision=363382
* | Fix some regressions with the zgrep(1) wrapper.Craig Leres2020-07-203-13/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Handle whitespace with long flags that take arguments: echo 'foo bar' > test zgrep --regexp='foo bar' test - Do not hang reading from stdin with patterns in a file: echo foobar > test echo foo > pattern zgrep -f pattern test zgrep --file=pattern test - Handle any flags after -e: echo foobar > test zgrep -e foo --ignore-case < test These two are still outstanding problems: - Does not handle flags that take an argument if there is no whitespace: zgrep -enfs /etc/rpc - When more than one -e pattern used matching should occur for all patterns (similar to multiple patterns supplied with -f file). Instead only the last pattern is used for matching: zgrep -e rex -e nfs /etc/rpc (This problem is masked in the unpatched version by the "any flags after -e" problem.) Add tests for the above problems. Update the mange and add references to gzip(1) and zstd(1) and also document the remaining known problems. PR: 247126 Approved by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25613 Notes: svn path=/head/; revision=363381
* | Add MODULE_VERSION to TCP loadable congestion control modules.Richard Scheffenegger2020-07-208-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without versioning information, using preexisting loader / linker code is not easily possible when another module may have dependencies on pre-loaded modules, and also doesn't allow the automatic loading of dependent modules. No functional change of the actual modules. Reviewed by: tuexen (mentor), rgrimes (mentor) Approved by: tuexen (mentor), rgrimes (mentor) MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D25744 Notes: svn path=/head/; revision=363380
* | Don't dynamically allocate data structures for KTLS crypto requests.John Baldwin2020-07-201-70/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allocate iovec arrays and struct cryptop and struct ocf_operation objects on the stack to reduce avoid the overhead of malloc(). These structures are all small enough to fit on the stack of the KTLS worker threads. Reviewed by: gallatin Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D25692 Notes: svn path=/head/; revision=363379
* | iflib: initialize netmap with the correct number of descriptorsVincenzo Maffione2020-07-201-22/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case the network device has a RX or TX control queue, the correct number of TX/RX descriptors is contained in the second entry of the isc_ntxd (or isc_nrxd) array, rather than in the first entry. This case is correctly handled by iflib_device_register() and iflib_pseudo_register(), but not by iflib_netmap_attach(). If the first entry is larger than the second, this can result in a panic. This change fixes the bug by introducing two helper functions that also lead to some code simplification. PR: 247647 MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D25541 Notes: svn path=/head/; revision=363378
* | add a few tests for sendfile.Chuck Silvers2020-07-203-0/+305
| | | | | | | | | | | | | | | | | | Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D25431 Notes: svn path=/head/; revision=363377
* | libdwarf: Hide SHT_NOBITS sections.Mark Johnston2020-07-201-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gnu_debuglink external debug files will contain an .eh_frame section of type SHT_NOBITS. libdwarf does not handle such sections (or rather, it expects all debug sections to not have type SHT_NOBITS). Avoid loading SHT_NOBITS sections, to be consistent with SGI libdwarf's handling of this case. PR: 239516 Diagnosed by: Paco Pascal <me@pacopascal.com> Reviewed by: emaste (previous version) Event: July 2020 Bugathon MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25626 Notes: svn path=/head/; revision=363375