aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Implement need_resched() in the LinuxKPI.Hans Petter Selasky2017-04-061-0/+2
| | | | | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=316564
* Fix implementation of task_pid_group_leader() in the LinuxKPI.Hans Petter Selasky2017-04-062-2/+32
| | | | | | | | | | | | | In FreeBSD thread IDs and procedure IDs have distinct number spaces. When asking for the group leader task ID in the LinuxKPI, return the procedure ID and let this resolve to the first task in the procedure having a valid LinuxKPI task structure pointer. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=316563
* Implement proper support for memory map operations in the LinuxKPI,Hans Petter Selasky2017-04-063-39/+284
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | like open, close and fault using the character device pager. Some notes about the implementation: 1) Linux drivers set the vm_ops and vm_private_data fields during a mmap() call to indicate that the driver wants to use the LinuxKPI VM operations. Else these operations are not used. 2) The vm_private_data pointer is associated with a VM area structure and inserted into an internal LinuxKPI list. If the vm_private_data pointer already exists, the existing VM area structure is used instead of the allocated one which gets freed. 3) The LinuxKPI's vm_private_data pointer is used as the callback handle for the FreeBSD VM object. The VM subsystem in FreeBSD has a similar list to identify equal handles and will only call the character device pager's close function once. 4) All LinuxKPI VM operations are serialized through the mmap_sem sempaphore, which is per procedure, which prevents simultaneous access to the shared VM area structure when receiving page faults. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=316562
* Before registering a new mm_struct in the LinuxKPI check if otherHans Petter Selasky2017-04-061-6/+43
| | | | | | | | | | | | | | | | tasks in the belonging procedure already have a valid mm_struct and reference that instead. The mm_struct in the LinuxKPI should be shared among all tasks belonging to the same procedure. This has to do with with the mmap_sem semaphore which should serialize all VM operations inside a given procedure. Linux based drivers depend on this behaviour. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=316561
* Use __FBSDID instead of the license agreement to embed the $FreeBSD$ RCS keywordEnji Cooper2017-04-064-8/+12
| | | | | | | | | | | Reminded by a comment made by markj w.r.t. using __FBSDID in .c files ala a past Phabricator review. MFC after: 2 months Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316558
* sbuf(3): add some basic functional tests for the libraryEnji Cooper2017-04-067-0/+716
| | | | | | | | | | | | | | | | | | Areas not covered still [positive functionality wise] are: - sbuf_{clear,get,set}_flags - sbuf_new (in particular, with fixed buffers, etc). Some basic negative testing has been added, but more will be added in the future. This work was in part to validate work done by cem in r288223, and ian before that. MFC after: 2 months Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316557
* sbuf(9): add MLINKS for sbuf_{clear,get,set}_flags(9)Enji Cooper2017-04-061-0/+3
| | | | | | | | | | These functions were added in r279992. MFC after: 2 months Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316554
* sbuf(3): expose sbuf_{clear,get,set}_flags(3) via libsbufEnji Cooper2017-04-061-0/+3
| | | | | | | | | | | These functions were added to sbuf(9) in r279992, but never exposed to userspace. Expose them now so they can be used/tested. MFC after: 2 months Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316553
* atf-c: fix documentation description for atf_utils_wait(3)Enji Cooper2017-04-061-2/+2
| | | | | | | | | | | atf_utils_wait(3) should be used in combination with atf_utils_fork(3), not itself (atf_utils_wait(3)). MFC after: 2 months Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316552
* sbuf(9): clarify kernel-only APIsEnji Cooper2017-04-061-12/+16
| | | | | | | | | | | | | - move sbuf_bcopyin(9) and sbuf_copyin(9) near sbuf_new_for_sysctl(9), as all three functions are kernel-only APIs. - add #ifdef _KERNEL around sbuf_*copyin and sbuf_new_for_sysctl(9) to make it visually clear that they are kernel-only APIs. MFC after: 2 months Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316551
* sbuf(9): convert SYNOPSIS section from .Fn entries to .Fo/.Fa/.Fc entriesEnji Cooper2017-04-061-28/+113
| | | | | | | | | | | | | This shortens the column count on many lines considerably. While here, add "(void)" to sbuf_new_auto(3) for consistency with style(9) recommendations. MFC after: 2 months Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316550
* Add sys/types.h #include to EXAMPLE to provide a complete functionalEnji Cooper2017-04-061-1/+2
| | | | | | | | | | standalone example program MFC after: 2 months Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316549
* Quiet 450.status-security when *_inline="YES"Alan Somers2017-04-063-21/+39
| | | | | | | | | | | | | | | | | | | | Previously, 450.status-security would always set rc=3 in inline mode, because it doesn't know whether "periodic security" is going to find anything interesting. But this annoyingly results in daily reports that simply say "Security check: \n\n-- End of daily output --". This change fixes that by testing whether "periodic security" printed anything, and setting 450.status-security's exit status to 3 if it did. An alternative would be to change the exit status of periodic(8) to be the worst of its scripts' exit statuses, but that would be a more intrusive change. Reviewed by: brian MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D10267 Notes: svn path=/head/; revision=316548
* [net80211] refactor out the A-MPDU dispatch routine.Adrian Chadd2017-04-061-28/+29
| | | | | | | | | | | | | | The "dispatch a frame from the A-MPDU reorder buffer" code is essentially duplicated in a couple of places. This refactors it out into a single place in preparation for A-MSDU in A-MPDU offload support, where multiple A-MSDUs are decap'ed in hardware to 802.3/802.11 frames, but with the same sequence number. Reviewed by: avos Differential Revision: https://reviews.freebsd.org/D10240 Notes: svn path=/head/; revision=316547
* Revert r316516. des@ asked that r316516 be reverted so that he can spendCy Schubert2017-04-061-3/+0
| | | | | | | | | a little more time getting r316487 right. Requested by: des@ Notes: svn path=/head/; revision=316546
* makefs: zero memoryEd Maste2017-04-061-0/+2
| | | | | | | | | | NetBSD revs: ffs/buf.c 1.14 Obtained from: NetBSD Notes: svn path=/head/; revision=316545
* Don't overrite vf->flags variable at the end of ixgbe(4) ixgbe_add_vf().Sean Bruno2017-04-051-1/+1
| | | | | | | | | | | Found by PVS-Studio Static code analyzer. PR: 217748 Submitted by: razmyslov@viva64.com MFC after: 1 week Notes: svn path=/head/; revision=316544
* bsdgrep: Handle special case of single-byte NUL patternEd Maste2017-04-051-1/+5
| | | | | | | | | | PR: 202022 Submitted by: Kyle Evans <kevans91 at ksu.edu> MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D10102 Notes: svn path=/head/; revision=316542
* Fix a double free in ixgbe_rxeof()Sean Bruno2017-04-051-21/+9
| | | | | | | | | Submitted by: rstone MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D10255 Notes: svn path=/head/; revision=316541
* Fix the linker emulation setting for riscv.John Baldwin2017-04-051-1/+1
| | | | | | | | | Reported by: lwhsu MFC after: 1 week Sponsored by: DARPA / AFRL Notes: svn path=/head/; revision=316537
* bsdgrep: create additional tests for coverage on recent fixesEd Maste2017-04-0518-1/+148
| | | | | | | | | | | | | | | | | | Create additional tests to cover regressions that were discovered by PRs linked to reviews D10098, D10102, and D10104. It is worth noting that neither bsdgrep(1) nor gnugrep(1) in the base system currently pass all of these tests, and gnugrep(1) not quite being up to snuff was also noted in at least one of the PRs. PR: 175314 202022 195763 180990 197555 197531 181263 209116 Submitted by: Kyle Evans <kevans91@ksu.edu> Reviewed by: cem, ngie, emaste MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D10112 Notes: svn path=/head/; revision=316536
* Fix memory leak in "gpart bootcode"Alan Somers2017-04-051-2/+3
| | | | | | | | | | | | Also, annotate that gpart_issue never returns Reported by: Coverity CID: 1007105 MFC after: 3 weeks Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=316535
* Stop building assym.o into the module.Bryan Drewery2017-04-051-15/+1
| | | | | | | | | | | | | | | | | | DTrace includes assym.s, to build this we build assym.o, however this is unneeded as assym.s only contains macros. Remove the need to build this by removing it from OBJS, but keep assym.s in the module dependencies via DPSRCS. This fixes the build when there is no assembler, e.g. on arm64 without the external binutils. Submitted by: andrew MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D10041 Notes: svn path=/head/; revision=316534
* Support assym.s in DPSRCS to depend on it but not link it in.Bryan Drewery2017-04-051-1/+1
| | | | | | | | | Reported by: andrew MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316533
* Make nfs pageout coherent with the dirty state of the buffers.Konstantin Belousov2017-04-051-28/+9
| | | | | | | | | | | | | | | | | Write out the dirty pages using VOP_WRITE() instead of directly calling ncl_writerpc(). The state of the buffers now reflects the write, fixing some hard to diagnose consistency and write order issues. The change also allowed to remove remapping of paged out pages into kernel space and related allocation of the phys buffer. Reviewed by: markj, rmacklem Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D10241 Notes: svn path=/head/; revision=316532
* Handle nfs IO_ASYNC write requests asynchronously.Konstantin Belousov2017-04-051-1/+1
| | | | | | | | | | | Reviewed by: markj, rmacklem Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks X-Differential revision: https://reviews.freebsd.org/D10241 Notes: svn path=/head/; revision=316531
* Fix clearing geom metadata if DIOCGSECTORSIZE failsAlan Somers2017-04-051-3/+2
| | | | | | | | | | | | | An unhandled error case would result in passing SIZE_MAX to malloc. While I'm here, remove an unnecessary NULL check before free Reported by: Coverity CID: 1017793 MFC after: 3 weeks Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=316530
* Handle possible vnode reclamation after ncl_vinvalbuf() call.Konstantin Belousov2017-04-052-22/+53
| | | | | | | | | | | | | | | | | ncl_vinvalbuf() might need to upgrade vnode lock, allowing the vnode to be reclaimed by other thread. Handle the situation, indicated by the returned error zero and VI_DOOMED iflag set, converting it into EBADF. Handle all calls, even where the vnode is exclusively locked right now. Reviewed by: markj, rmacklem Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks X-Differential revision: https://reviews.freebsd.org/D10241 Notes: svn path=/head/; revision=316529
* Add V_VMIO flag for vinvalbuf(9) to indicate that the flush requestKonstantin Belousov2017-04-052-8/+11
| | | | | | | | | | | | | | | was issued during VM-initiated i/o (pageout), so that the function does not try to flush or remove pages or wait for the vm object paging-in-progress counter. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week X-Differential revision: https://reviews.freebsd.org/D10241 Notes: svn path=/head/; revision=316528
* Revert the optimization from r304436Ryan Stone2017-04-051-8/+1
| | | | | | | | | | | | r304436 attempted to optimize the handling of incoming UDP packet by only making an expensive call to in_broadcast() if the mbuf was marked as an broadcast packet. Unfortunately, this cannot work in the case of point-to- point L2 protocols like PPP, which have no notion of "broadcast". The optimization has been disabled for several months now with no progress towards fixing it, so it needs to go. Notes: svn path=/head/; revision=316527
* Extract calculation of ioflags from the vm_pager_putpages flags into aKonstantin Belousov2017-04-052-19/+28
| | | | | | | | | | | | | helper. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week X-Differential revision: https://reviews.freebsd.org/D10241 Notes: svn path=/head/; revision=316526
* Some style fixes for vnode_pager_generic_putpages(), in the localKonstantin Belousov2017-04-051-7/+2
| | | | | | | | | | | | | declaration block. Reviewed by: markj (as part of the larger patch) Tested by: pho (as part of the larger patch) Sponsored by: The FreeBSD Foundation MFC after: 1 week X-Differential revision: https://reviews.freebsd.org/D10241 Notes: svn path=/head/; revision=316525
* Use int instead of boolean_t for flags argument type inKonstantin Belousov2017-04-051-2/+1
| | | | | | | | | | | | | | vnode_pager_generic_putpages() prototype; change the argument name to reflect that it is flags. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week X-Differential revision: https://reviews.freebsd.org/D10241 Notes: svn path=/head/; revision=316524
* Remove a duplicate fclose() that snuck into r316501Alan Somers2017-04-051-1/+0
| | | | | | | | | | | Reported by: Coverity CID: 1373338 MFC after: 20 days X-MFC-With: 316501 Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=316523
* Unify error handling when si_drv1 is NULL in the LinuxKPI.Hans Petter Selasky2017-04-051-25/+16
| | | | | | | | | | | Make sure the character device poll callback function does not return an error code, but a POLLXXX value, in case of failure. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=316522
* Implement down_write_killable() in the LinuxKPI.Hans Petter Selasky2017-04-051-0/+1
| | | | | | | | MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=316521
* hyperv/hn: Fixat RNDIS rxfilter after the successful RNDIS init.Sepherosa Ziehau2017-04-053-31/+103
| | | | | | | | | | | | | | | | | Under certain conditions on certain versions of Hyper-V, the RNDIS rxfilter is _not_ zero on the hypervisor side after the successful RNDIS initialization, which breaks the assumption of any following code (well, it breaks the RNDIS API contract actually). Clear the RNDIS rxfilter explicitly, drain packets sneaking through, and drain the interrupt taskqueues scheduled due to the stealth packets. Reported by: dexuan@ MFC after: 3 days Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D10230 Notes: svn path=/head/; revision=316520
* hyperv/storvsc: Fixup SRB status.Sepherosa Ziehau2017-04-052-8/+8
| | | | | | | | | | | | | This unbreaks GEN2 Hyper-V cd support. Submitted by: Hongjiang Zhang <honzhan microsoft com> Reviewed by: dexuan@ MFC after: 3 days Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D10212 Notes: svn path=/head/; revision=316519
* r316487 altered the defined values of rc_force from "yes" (for yes)Cy Schubert2017-04-051-0/+3
| | | | | | | | | | | | | | | | | and NULL (for no) to "no" (for no) and no change to the definition of yes. Two rc.d scripts, dhclient and bgfsck check rc_force for yesi, using test -n, and no, using test -z. The redefinition of yes and no by r316487 caused rc.d/dhclient, when invoked by devd using a devd.conf rule, to assign DHCP assigned IP addresses for interfaces with statically assigned interfaces, breaking boot. Point of breakage was at line 25 of etc/rc.d/dhclient (r301068) where $rc_force needs to be NULL. MFC after: 3 weeks X-MFC with: r316487 Notes: svn path=/head/; revision=316516
* hyperv/kbd: Add support for synthetic keyboard.Sepherosa Ziehau2017-04-054-0/+1202
| | | | | | | | | | | | Synthetic keyboard is the only supported keyboard on GEN2 Hyper-V. Submitted by: Hongjiang Zhang <honzhan microsoft com> MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D10196 Notes: svn path=/head/; revision=316515
* Always pass the linker emulation via -m when linking modules and kernels.John Baldwin2017-04-054-9/+10
| | | | | | | | | | | | | | | | Previously the linker emulation was only passed when building binary objects for firmware modules. This change always passes the desired output format for kernel modules and kernels rather than requiring the toolchain's default output format to match the desired output format. This in turn permits use of external toolchains whose default output format does not match the desired output format. Reviewed by: imp, emaste Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D10085 Notes: svn path=/head/; revision=316514
* Sync SYSTEM_LD in Makefile.arm with kern.pre.mk.John Baldwin2017-04-051-2/+3
| | | | | | | | | | | | - Add --no-warn-mismatch. - Use same whitespace to make future updates simpler. Reviewed by: imp (part of a larger change) Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D10085 Notes: svn path=/head/; revision=316513
* Use correct linker emulation name for armeb.John Baldwin2017-04-051-1/+1
| | | | | | | | | MFC after: 1 week Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D10085 Notes: svn path=/head/; revision=316512
* Add an implementation of __ffssi2() derived from __ffsdi2().John Baldwin2017-04-053-0/+31
| | | | | | | | | | | | | Newer versions of GCC include an __ffssi2() symbol in libgcc and the compiler can emit calls to it in generated code. This is true for at least GCC 6.2 when compiling world for mips and mips64. Reviewed by: jmallett, dim Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D10086 Notes: svn path=/head/; revision=316511
* Don't leak a session and lock if a GMAC key has an invalid length.John Baldwin2017-04-051-1/+4
| | | | | | | | | Reviewed by: delphij (secteam) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D10273 Notes: svn path=/head/; revision=316510
* ufs: Export UFS_MAXNAMLEN to pathconf, statfsConrad Meyer2017-04-052-2/+3
| | | | | | | | | | | | | | Rather than the global NAME_MAX constant. This change is required to support systems with a NAME_MAX/MAXNAMLEN that differs from UFS_MAXNAMLEN. This was missed in r313475 due to the alternative spelling ("NAME_MAX") of MAXNAMLEN. This change is also similar in spirit to r313780. Reported by: ngie@ Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316509
* Use unique SPI.Andrey V. Elsukov2017-04-041-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=316508
* In the example section show that TCP-MD5 connection needs SA for bothAndrey V. Elsukov2017-04-041-1/+2
| | | | | | | | | | directions. Submitted by: Mike Tancsa <mike at sentex net> MFC after: 1 week Notes: svn path=/head/; revision=316507
* cxgbe(4): Program the global RSS key once instead of once per ifnet.Navdeep Parhar2017-04-041-9/+12
| | | | | | | | MFC after: 3 days Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=316506
* Don't assume NAME_MAX is 255Enji Cooper2017-04-041-1/+6
| | | | | | | | | | Query the filesystem limit via getconf(3) instead MFC after: 2 months Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316505