aboutsummaryrefslogtreecommitdiff
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* Revert redundant parts of r329440 after recent devmatch(8) changes.Hans Petter Selasky2018-02-171-9/+1
| | | | | | | Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=329454
* Undo LOCK_PROFILING pessimisation after r313454 and r313455Mateusz Guzik2018-02-173-12/+14
| | | | | | | | | | | | | | | | | With the option used to compile the kernel both sx and rw shared ops would always go to the slow path which added avoidable overhead even when the facility is disabled. Furthermore the increased time spent doing uncontested shared lock acquire would be bogusly added to total wait time, somewhat skewing the results. Restore old behaviour of going there only when profiling is enabled. This change is a no-op for kernels without LOCK_PROFILING (which is the default). Notes: svn path=/head/; revision=329451
* exit: stop doing PROC_SLOCK just to call proc_reapMateusz Guzik2018-02-171-3/+0
| | | | | | | It immediately does PROC_SUNLOCK anyway and the lock plays no role. Notes: svn path=/head/; revision=329449
* exit: get rid of PROC_SLOCK when checking a process to reportMateusz Guzik2018-02-171-7/+0
| | | | | | | All accessed fields are protected with already held process lock. Notes: svn path=/head/; revision=329448
* Compile fix for GCC in the LinuxKPI.Hans Petter Selasky2018-02-171-4/+4
| | | | | | | | | | | | Older versions of GCC don't allow flexible array members in a union. Use a zero length array instead. MFC after: 1 week Reported by: jbeich@ Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=329447
* Correct the PNP information generated by the usb driver to match theWarner Losh2018-02-172-5/+13
| | | | | | | | | | | | artificial NOMATCH usb does in lieu of creating a device_t for devices with no drivers. Also, correct bus to be 'uhub' since where USB devices attach, even though 'usb' is more logical, we need the physical bus here. Submitted by: hps@ Notes: svn path=/head/; revision=329440
* Fixup minor nits in the PNP_INFO protocol.Warner Losh2018-02-171-1/+1
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=329437
* On process exit signal the parent after dropping the proctree lock.Mateusz Guzik2018-02-171-7/+16
| | | | Notes: svn path=/head/; revision=329422
* Unref the prison after proctree is dropped.Mateusz Guzik2018-02-171-3/+3
| | | | Notes: svn path=/head/; revision=329421
* Postpone sx_sunlock(&proctree_lock) on fork until after allproc is dropped.Mateusz Guzik2018-02-171-3/+2
| | | | | | | | There is a significant contention on the lock during -j 128 package build. This change drops total wait time on this lock by 60%. Notes: svn path=/head/; revision=329420
* Tidy up kern_wait6Mateusz Guzik2018-02-171-10/+10
| | | | | | | | | - don't relock curproc in msleep - don't relock proctree if P_STATCHILD is spotted - reformat the proc_to_reap call in the main loop Notes: svn path=/head/; revision=329419
* Remove unused symbols.Konstantin Belousov2018-02-161-9/+0
| | | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=329416
* zfs: fix formatting in a log statementAlan Somers2018-02-161-1/+1
| | | | | | | | | Submitted by: Dave Baukus <daveb@spectralogic.com> MFC after: 3 weeks Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=329412
* xen/pv: remove the attach of the ISA bus from the Xen PV busRoger Pau Monné2018-02-161-11/+7
| | | | | | | | | There's no need to attach the ISA bus from the Xen PV one. Sponsored by: Citrix Systems R&D Notes: svn path=/head/; revision=329389
* Define CK_MD_TSO for the relevant arches (i386, amd64 and sparc64).Olivier Houchard2018-02-161-4/+9
| | | | | | | | | | | | | | | Defaulting to CK_MD_RMO has the unfortunate side effect of generating memory barriers that are useless on those arches, and the even more unfortunate side effect of generating lfence/sfence/mfence on i386, even if older CPUs don't support it. This should fix the panic reported when using IPFW on a Pentium 3. Note that mfence and sfence might still be used in a few case, but that shouldn't happen in FreeBSD right now, and should be fixed upstream first. MFC after: 1 week Notes: svn path=/head/; revision=329388
* Handle generic pathconf attributes in the .zfs ctldirAlan Somers2018-02-161-2/+6
| | | | | | | | | | | | MFC instructions: change the value of _PC_LINK_MAX to INT_MAX Reported by: jhb MFC after: 19 days X-MFC-With: 329265 Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=329384
* Implement mutex_trylock_recursive() in the LinuxKPI.Hans Petter Selasky2018-02-161-0/+15
| | | | | | | | | MFC after: 1 week Submitted by: Johannes Lundberg <johalun0@gmail.com> Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=329378
* Implement memdup_user_nul() in the LinuxKPI.Hans Petter Selasky2018-02-161-0/+16
| | | | | | | | | MFC after: 1 week Submitted by: Johannes Lundberg <johalun0@gmail.com> Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=329377
* Implement tasklet_enable() and tasklet_disable() in the LinuxKPI.Hans Petter Selasky2018-02-162-0/+21
| | | | | | | | | MFC after: 1 week Requested by: Johannes Lundberg <johalun0@gmail.com> Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=329376
* Fix a memory leak introduced in r328426.Mark Johnston2018-02-165-1/+15
| | | | | | | | | | | | | | ffs_sbget() may return a superblock buffer even if it fails, so the caller must be prepared to free it in this case. Moreover, when tasting alternate superblock locations in a loop, ffs_sbget()'s readfunc callback must free the previously allocated buffer. Reported and tested by: pho Reviewed by: kib (previous version) Differential Revision: https://reviews.freebsd.org/D14390 Notes: svn path=/head/; revision=329375
* Use the conventional name for an array of pages.Mark Johnston2018-02-161-26/+26
| | | | | | | | | | No functional change intended. Discussed with: kib MFC after: 3 days Notes: svn path=/head/; revision=329374
* Correct module symbol export handlingEd Maste2018-02-161-2/+2
| | | | | | | | | | | | | | | EXPORT_SYMS can be set to YES, NO, a list of symbols to export from a module, or to a filename containing such a list. For the case that it is set to a symbol list, replace spaces in the list with newlines, so the created file is in the format expected by kmod_syms.awk. Reviewed by: imp, jhb MFC after: 1 month Sponsored by: Turing Robotic Industries Inc. Differential Revision: https://reviews.freebsd.org/D14284 Notes: svn path=/head/; revision=329373
* Implement enable_irq() and disable_irq() in the LinuxKPI.Hans Petter Selasky2018-02-161-0/+32
| | | | | | | | | MFC after: 1 week Submitted by: Johannes Lundberg <johalun0@gmail.com> Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=329372
* Allow the cmpxchg() macro in the LinuxKPI to work on pointers withoutHans Petter Selasky2018-02-161-30/+35
| | | | | | | | | | generating compiler warnings, -Wint-conversion . Requested by: Johannes Lundberg <johalun0@gmail.com> Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=329371
* Rationalize license text on Linuxolator filesEd Maste2018-02-1614-210/+182
| | | | | | | | | | | | | | | Many licenses on Linuxolator files contained small variations from the standard FreeBSD license text. To avoid license proliferation switch to the standard 2-clause FreeBSD license for those files where I have permission from each of the listed copyright holders. Additional files waiting on permission from others are listed in review D14210. Approved by: kan, marcel, sos, rdivacky MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=329370
* Use local symbol for offset.Konstantin Belousov2018-02-161-4/+4
| | | | | | | | | | | | Small global symbols confuse ddb which matches them against small unrelated displacements and makes the disassembly ugly. Reported by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=329365
* move vintr_intercept_enabled under INVARIANTSAndriy Gapon2018-02-161-0/+2
| | | | | | | | | The function is not used outside of INVARIANTS since r328622. MFC after: 1 week Notes: svn path=/head/; revision=329364
* read-behind / read-ahead support for zfs_getpages()Andriy Gapon2018-02-163-52/+240
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ZFS caches blocks it reads in its ARC, so in general the optional pages are not as useful as with filesystems that read the data directly into the target pages. But still the optional pages are useful to reduce the number of page faults and associated VM / VFS / ZFS calls. Another case that gets optimized (as a side effect) is paging in from a hole. ZFS DMU does not currently provide a convenient API to check for a hole. Instead it creates a temporary zero-filled block and allows accessing it as if it were a normal data block. Getting multiple pages one by one from a hole results in repeated creation and destruction of the temporary block (and an associated ARC header). Tested with fsx using various supported blocks sizes from 512 bytes to 128 KB and additionally 1 MB. Please note that in illumos and ZoL they do not do the range-locking in the page-in path. This is because ZFS has a double-caching problem between ARC and page cache and that requires zfs_read() and zfs_write() to consult pages in the page cache. So, in those functions they first lock a range and then lock pages corresponding to the range. While in the page-in (and maybe page-out) path they first lock the pages and then would lock the range. So, they would have a deadlock. I believe that FreeBSD does not have that problem, because the page-in deals only with invalid pages while zfs_read() and zfs_write() need to access only valid pages. They do not wait on a busy page unless it's already valid. Reviewed by: kib MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D14263 Notes: svn path=/head/; revision=329363
* This change fixes duplicate detection of same IOMMU/AMD-Vi device for Ryzen ↵Anish Gupta2018-02-164-93/+308
| | | | | | | | | | | | | | with EFR support. IVRS can have entry of type legacy and non-legacy present at same time for same AMD-Vi device. ivhd driver will ignore legacy if new IVHD type is present as specified in AMD-Vi specification. Earlier both of IVHD entries used and two ivhd devices were created. Add support for new IVHD type 0x11 and 0x40 in ACPI. Create new struct of type acpi_ivrs_hardware_new for these new type of IVHDs. Legacy type 0x10 will continue to use acpi_ivrs_hardware. Reviewed by: avg Approved by: grehan Differential Revision:https://reviews.freebsd.org/D13160 Notes: svn path=/head/; revision=329360
* Get rid of the requirement to include SysV IPC headers with _KERNELBrooks Davis2018-02-164-23/+37
| | | | | | | | | | | defined in ipcrm by introducing _WANT_SYSVxxx_INTERNALS defines. Reviewed by: jhb Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14271 Notes: svn path=/head/; revision=329348
* Reduce duplication in __acl_*_(file|link).Brooks Davis2018-02-151-54/+64
| | | | | | | | | | | | Add const to new kern_ functions and push down as required. Reviewed by: rwatson Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14174 Notes: svn path=/head/; revision=329342
* Change size of padding to reflect reality. No functional change.Jung-uk Kim2018-02-151-1/+1
| | | | | | | Discussed with: kib Notes: svn path=/head/; revision=329340
* Report the number of remaining retries when we have an error thatWarner Losh2018-02-151-2/+5
| | | | | | | we're retrying. Notes: svn path=/head/; revision=329337
* Reduce duplication in __mac_*_(file|link)(2) implementation.Brooks Davis2018-02-151-97/+27
| | | | | | | | | | Reviewed by: rwatson Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14175 Notes: svn path=/head/; revision=329336
* Regen after r329322.Brooks Davis2018-02-155-17/+9
| | | | Notes: svn path=/head/; revision=329333
* Remove freebsd32_getdirentries(), it will be unused after the nextBrooks Davis2018-02-151-19/+0
| | | | | | | commit. Notes: svn path=/head/; revision=329332
* Revert r329323. I missed something in my testing.Brooks Davis2018-02-155-9/+17
| | | | Notes: svn path=/head/; revision=329328
* Fix the test for SET_FOREACH termination.Mark Johnston2018-02-151-1/+1
| | | | | | | | Unlike the queue(3) _FOREACH macros, the iterator for a SET_FOREACH is not NULL after the end of the set is reached. Notes: svn path=/head/; revision=329325
* Regen after r329322: Fix getdirentries(2) under 32-bit compat.Brooks Davis2018-02-155-17/+9
| | | | | | | | Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14379 Notes: svn path=/head/; revision=329323
* Fix getdirentries(2) under 32-bit compat.Brooks Davis2018-02-151-2/+2
| | | | | | | | | | | | | | The latest version of getdirentries (syscall 554) takes a pointer an an off_t as the last argument. The old version which copies out an int32_t was being used instead. Use the standard sys_getdirentries() implementation instead. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14379 Notes: svn path=/head/; revision=329322
* Rename the ACPI variant of the gicv2m driver from "gicv2m" to "gicv2m_acpi".Olivier Houchard2018-02-151-1/+1
| | | | | | | | | | | The FDT variant is called "gicv2m" too, and as both would try to register on gic, only one of them would succeed, while we want them both in a GENERIC kernel. Reviewed by: andrew Notes: svn path=/head/; revision=329317
* MFV r329313: 8857 zio_remove_child() panic due to already destroyed parent zioAndriy Gapon2018-02-152-20/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | illumos/illumos-gate@d6e1c446d7897003fd9fd36ef5aa7da350b7f6af https://github.com/illumos/illumos-gate/commit/d6e1c446d7897003fd9fd36ef5aa7da350b7f6af https://www.illumos.org/issues/8857 I had an OS panic on one of our servers: ffffff01809128c0 vpanic() ffffff01809128e0 mutex_panic+0x58(fffffffffb94c904, ffffff597dde7f80) ffffff0180912950 mutex_vector_enter+0x347(ffffff597dde7f80) ffffff01809129b0 zio_remove_child+0x50(ffffff597dde7c58, ffffff32bd901ac0, ffffff3373370908) ffffff0180912a40 zio_done+0x390(ffffff32bd901ac0) ffffff0180912a70 zio_execute+0x78(ffffff32bd901ac0) ffffff0180912b30 taskq_thread+0x2d0(ffffff33bae44140) ffffff0180912b40 thread_start+8() It panicked here: http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/fs/zfs/ zio.c#430 pio->io_lock is DEAD, thus a panic. Further analysis shows the "pio" (parent zio of "cio") has already been destroyed. Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Andriy Gapon <avg@FreeBSD.org> Reviewed by: Youzhong Yang <youzhong@gmail.com> Approved by: Dan McDonald <danmcd@omniti.com> Author: George Wilson <george.wilson@delphix.com> PR: 223803 Tested by: shiva.bhanujan@quorum.com MFC after: 2 weeks Notes: svn path=/head/; revision=329314
* xen: fix smp boot after r328157Mateusz Guzik2018-02-151-0/+3
| | | | | | | mce_stack was left unset leading to early crashes Notes: svn path=/head/; revision=329297
* mxge(4) should pass unhandled ioctls to ether_ioctl()Ravi Pokala2018-02-151-6/+2
| | | | | | | | | | | | | | | | | | | | | | | Panasas discovered that ioctl(SIOCGLAGGPORT) returns ENOTTY for mxge(4) when the NIC is not a member of a lagg. This came as a surprise, because the SIOCGLAGGPORT handler in if_lagg.c only returns ENOENT (if run against the laggX interface, rather than a physical port) or EINVAL (if run against a non-member physical port). This behavior was not seen with other drivers, such as bge(4), igb(4), and cxl(4). When I compared their respective ioctl handlers, I found that they all called ether_ioctl() for the default (i.e. unhandled) case; by contrast, mxge(4) only calls ether_ioctl() for two specific cases, and returns ENOTTY for the default case. Remove the two cases which explicitly call ether_ioctl(), and let the default case call it instead. This matches what the vast majority of the NIC drivers do. Reviewed by: kmacy MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14381 Notes: svn path=/head/; revision=329295
* x86 pmap: Make memory mapped via pmap_qenter() non-executableConrad Meyer2018-02-142-1/+5
| | | | | | | | | | | | | | | | | | | The idea is, the pmap_qenter() API is now defined to not produce executable mappings. If you need executable mappings, use another API. Add pg_nx flag in pmap_qenter on x86 to make kernel pages non-executable. Other architectures that support execute-specific permissons on page table entries should subsequently be updated to match. Submitted by: Darrick Lew <darrick.freebsd AT gmail.com> Reviewed by: markj Discussed with: alc, jhb, kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D14062 Notes: svn path=/head/; revision=329281
* ng_pppoe(8): add support for user-supplied Host-Uniq tag.Eugene Grosbein2018-02-142-40/+303
| | | | | | | | | | | | | | | | | | | | | A few ISP filter PADI requests based on such tag, to force the use of their own routers. The custom Host-Uniq tag is passed in the NGM_PPPOE_CONNECT control message, so it can be used with FreeBSD ppp(8) and mpd without any other change. Add support to send and receive PADM messages, HURL and MOTM, often used by service providers to provide ACS information and other configuration settings to the user CPE. Submitted by: ale Approved by: mav (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D9270 Notes: svn path=/head/; revision=329279
* rwlock: diff-reduction of runlock compared to sx sunlockMateusz Guzik2018-02-141-14/+12
| | | | Notes: svn path=/head/; revision=329276
* gpart: append partition name to the underlying provider's physical pathAlan Somers2018-02-141-1/+35
| | | | | | | | | | | | | If the underlying provider's physical path is null, then the gpart device's physical path will be, too. Otherwise, it will append the partition name, such as "/p1" or "/s1/a". This will make gpart work better with zfsd(8). PR: 224965 MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D14010 Notes: svn path=/head/; revision=329275
* geli: append "/eli" to the underlying provider's physical pathAlan Somers2018-02-141-1/+14
| | | | | | | | | | | | | If the underlying provider's physical path is null, then the geli device's physical path will be, too. Otherwise, it will append "/eli". This will make geli work better with zfsd(8). PR: 224962 MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D13979 Notes: svn path=/head/; revision=329273
* nanosleep(2): Fix bogus incrementing of rmtp by tc_tick_sbt on [EINTR].Bryan Drewery2018-02-141-1/+2
| | | | | | | | | | | | | | | | | | | | | sbt is the time in the future that the tsleep_sbt() is expected to be completed at. sbtt is the current time. Depending on the precision with sysctl kern.timecounter.alloweddeviation the start time may be incremented by tc_tick_sbt. The same increment is needed for the current time of sbtt before calculating the difference. The impact of missing this increment is that rmtp may increase by one tc_tick_sbt on every early [EINTR] return. If the same struct is passed in for rqtp as rmtp this can result in rqtp effectively incrementing by tc_tick_sbt and sleeping longer than originally intended. This problem was introduced in r247797. Reviewed by: kib, markj, vangyzen (all on an older version of the test) MFC after: 2 weeks Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D14362 Notes: svn path=/head/; revision=329271