aboutsummaryrefslogtreecommitdiff
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* Implement ability to turn on/off PHYs for AHCI devices.Warner Losh2018-11-032-3/+49
| | | | | | | | | | | | | | | | | | As part of Chuck's work on fixing kernel crashes caused by disk I/O errors, it is useful to be able to trigger various kinds of errors. This patch allows causing an AHCI-attached disk to disappear, by having the driver keep the PHY disabled when the driver would otherwise enable the PHY. It also allows making the disk reappear by having the driver go back to setting the PHY enable/disable state as it normal would and simulating the hardware event that causes a bus rescan. Submitted by: Chuck Silvers Sponsored by: Netflix, Inc Differential Revision: https://reviews.freebsd.org/D16043 Notes: svn path=/head/; revision=340092
* MFV: r339981Jung-uk Kim2018-11-0226-108/+493
|\ | | | | | | | | | | | | Merge ACPICA 20181031. Notes: svn path=/head/; revision=340090
* | newvers.sh: fix git false positive -dirty tagEd Maste2018-11-021-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Assuming that any output from `git diff-index --name-only` implies changes in the working tree results in false positives: files with metadata, but not content, changes are also listed. Check that content differences exist before adding the -dirty tag to the git hash. PR: 229230 Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D15968 Notes: svn path=/head/; revision=340083
* | embed_mfs.sh: replace some compound statements with conventional ifsEd Maste2018-11-021-3/+12
| | | | | | | | | | | | | | Use the more readable form - there's no need to try being clever. Notes: svn path=/head/; revision=340082
* | Regen after r340080: Add const to input-only char * arguments.Brooks Davis2018-11-024-318/+318
| | | | | | | | | | | | | | | | Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17812 Notes: svn path=/head/; revision=340081
* | Add const to input-only char * arguments.Brooks Davis2018-11-0211-216/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These arguments are mostly paths handled by NAMEI*() macros which already take const char * arguments. This change improves the match between syscalls.master and the public declerations of system calls. Reviewed by: kib (prior version) Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17812 Notes: svn path=/head/; revision=340080
* | sys/types.h: avoid using terse macro _MEd Maste2018-11-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Although _M is reserved for use by the implemenation it is rather non- descriptive and conflicted with a libc++ test. Just rename to _Major and _Minor to avoid conflicts. Reviewed by: dim Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D16734 Notes: svn path=/head/; revision=340079
* | pf: Fix build if INVARIANTS is not setKristof Provost2018-11-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | r340061 included a number of assertions pf_frent_remove(), but these assertions were the only use of the 'prev' variable. As a result builds without INVARIANTS had an unused variable, and failed. Reported by: vangyzen@ Notes: svn path=/head/; revision=340078
* | m_pulldown() may reallocate n. Update the oip pointer after theJonathan T. Looney2018-11-021-0/+1
| | | | | | | | | | | | | | | | | | | | m_pulldown() call. MFC after: 2 weeks Sponsored by: Netflix Notes: svn path=/head/; revision=340077
* | Define NT_FREEBSD_FEATURE_CTL ELF note typeEd Maste2018-11-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This ELF note will be used to allow binaries to opt out of, or in to, upcoming vulnerability mitigation and other features. Committing the definition and readelf change separately to allow independent MFC. MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=340076
* | Add sysctl_usec_to_sbintime and sysctl_msec_to_sbintime.Warner Losh2018-11-022-0/+86
| | | | | | | | | | | | | | | | | | | | These functions are used to present a sbintime_t as either a number of microseconds or a number of milliseconds respectively. Sponsored by: Netflix Notes: svn path=/head/; revision=340074
* | pf: Keep a reference to struct ifnets we're usingKristof Provost2018-11-021-1/+7
| | | | | | | | | | | | | | | | Ensure that the struct ifnet we use can't go away until we're done with it. Notes: svn path=/head/; revision=340073
* | pfsync: Add missing unlockKristof Provost2018-11-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | If we fail to set up the multicast entry for pfsync and return an error we must release the pfsync lock first. MFC after: 2 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D17506 Notes: svn path=/head/; revision=340072
* | Adjust SiS 966/968 HDA controller naming.Alexander Motin2018-11-021-1/+1
| | | | | | | | | | | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> Notes: svn path=/head/; revision=340071
* | pfsync: Allow module to be unloadedKristof Provost2018-11-021-6/+0
| | | | | | | | | | | | | | | | | | MFC after: 2 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D17505 Notes: svn path=/head/; revision=340070
* | pfsync: Handle syncdev going awayKristof Provost2018-11-024-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the syncdev is removed we no longer need to clean up the multicast entry we've got set up for that device. Pass the ifnet detach event through pf to pfsync, and remove our multicast handle, and mark us as no longer having a syncdev. Note that this callback is always installed, even if the pfsync interface is disabled (and thus it's not a per-vnet callback pointer). MFC after: 2 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D17502 Notes: svn path=/head/; revision=340068
* | pfsync: Ensure uninit is done before pfKristof Provost2018-11-021-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | pfsync touches pf memory (for pf_state and the pfsync callback pointers), not the other way around. We need to ensure that pfsync is torn down before pf. MFC after: 2 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D17501 Notes: svn path=/head/; revision=340067
* | Notify that the ifnet will go away, even on vnet shutdownKristof Provost2018-11-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pf subscribes to ifnet_departure_event events, so it can clean up the ifg_pf_kif and if_pf_kif pointers in the ifnet. During vnet shutdown interfaces could go away without sending the event, so pf ends up cleaning these up as part of its shutdown sequence, which happens after the ifnet has already been freed. Send the ifnet_departure_event during vnet shutdown, allowing pf to clean up correctly. MFC after: 2 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D17500 Notes: svn path=/head/; revision=340066
* | pfsync: Make pfsync callbacks per-vnetKristof Provost2018-11-024-54/+62
| | | | | | | | | | | | | | | | | | | | | | | | The callbacks are installed and removed depending on the state of the pfsync device, which is per-vnet. The callbacks must also be per-vnet. MFC after: 2 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D17499 Notes: svn path=/head/; revision=340065
* | Initialize the eflags field of vm_map headers.Mark Johnston2018-11-023-18/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Initializing the eflags field of the map->header entry to a value with a unique new bit set makes a few comparisons to &map->header unnecessary. Submitted by: Doug Moore <dougm@rice.edu> Reviewed by: alc, kib Tested by: pho MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D14005 Notes: svn path=/head/; revision=340064
* | cxgbe/iw_cxgbe: Suppress spurious "Unexpected streaming data ..."Navdeep Parhar2018-11-022-5/+46
| | | | | | | | | | | | | | | | | | | | | | messages. Submitted by: Krishnamraju Eraparaju @ Chelsio MFC after: 1 month Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=340063
* | pf: Limit the fragment entry queue length to 64 per bucket.Kristof Provost2018-11-022-5/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | So we have a global limit of 1024 fragments, but it is fine grained to the region of the packet. Smaller packets may have less fragments. This costs another 16 bytes of memory per reassembly and devides the worst case for searching by 8. Obtained from: OpenBSD Differential Revision: https://reviews.freebsd.org/D17734 Notes: svn path=/head/; revision=340062
* | pf: Split the fragment reassembly queue into smaller partsKristof Provost2018-11-022-19/+168
| | | | | | | | | | | | | | | | | | | | | | | | Remember 16 entry points based on the fragment offset. Instead of a worst case of 8196 list traversals we now check a maximum of 512 list entries or 16 array elements. Obtained from: OpenBSD Differential Revision: https://reviews.freebsd.org/D17733 Notes: svn path=/head/; revision=340061
* | pf: Count holes rather than fragments for reassemblyKristof Provost2018-11-021-38/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | Avoid traversing the list of fragment entris to check whether the pf(4) reassembly is complete. Instead count the holes that are created when inserting a fragment. If there are no holes left, the fragments are continuous. Obtained from: OpenBSD Differential Revision: https://reviews.freebsd.org/D17732 Notes: svn path=/head/; revision=340060
* | Add new USB v2.0 PCI ID.Hans Petter Selasky2018-11-021-0/+3
| | | | | | | | | | | | | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=340059
* | Revert "pf: Limit the maximum number of fragments per packet"Kristof Provost2018-11-021-8/+0
| | | | | | | | | | | | | | | | This reverts commit r337969. We'll handle this the OpenBSD way, in upcoming commits. Notes: svn path=/head/; revision=340057
* | Make vop_symlink take a const target path.Brooks Davis2018-11-0212-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will enable callers to take const paths as part of syscall decleration improvements. Where doing so is easy and non-distruptive carry the const through implementations. In UFS the value is passed to an interface that must take non-const values. In ZFS, const poisoning would touch code shared with upstream and it's not worth adding diffs. Bump __FreeBSD_version for external API consumers. Reviewed by: kib (prior version) Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17805 Notes: svn path=/head/; revision=340055
* | - Add quirk for Samsung on Mac Mini 7,1Martin Wilke2018-11-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | PR: 201676 Submitted by: Ruben Kerkhof Approved by: araujo (mentor) Obtained from: TrueOS Sponsored by: iXsystems Inc. Differential Revision: https://review.freebsd.org/D17815 Notes: svn path=/head/; revision=340041
* | kern_poll: Restore explanatory comment removed in r177374Conrad Meyer2018-11-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The comment isn't stale. The check is bogus in the sense that poll(2) does not require pollfd entries to be unique in fd space, so there is no reason there cannot be more pollfd entries than open or even allowed fds. The check is mostly a seatbelt against accidental misuse or abuse. FD_SETSIZE, while usually unrelated to poll, is used as an arbitrary floor for systems with very low kern.maxfilesperproc. Additionally, document this possible EINVAL condition in the poll.2 manual. No functional change. Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D17671 Notes: svn path=/head/; revision=340038
* | Retire CLANG_NO_IAS34Ed Maste2018-11-014-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | CLANG_NO_IAS34 was introduced in r276696 to allow then-HEAD kernels to be built with clang 3.4 in FreeBSD 10. As FreeBSD 11 and later includes a version of Clang with a sufficiently capable integrated assembler we do not need the workaround any longer. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=340036
* | Regent after r340034: Use mode_t when the documented signature does.Brooks Davis2018-11-013-30/+30
| | | | | | | | | | | | | | | | Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17784 Notes: svn path=/head/; revision=340035
* | Use mode_t when the documented signature does.Brooks Davis2018-11-012-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | This is more clear and produces better results when generating function stubs from syscalls.master. Reviewed by: kib, emaste Obtained from: CheribSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17784 Notes: svn path=/head/; revision=340034
* | Restrict setting PTE execute permissions on RISC-V.John Baldwin2018-11-014-10/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, RISC-V was enabling execute permissions in PTEs for any readable page. Now, execute permissions are only enabled if they were explicitly specified (e.g. via PROT_EXEC to mmap). The one exception is that the initial kernel mapping in locore still maps all of the kernel RWX. While here, change the fault type passed to vm_fault and pmap_fault_fixup to only include a single VM_PROT_* value representing the faulting access to match other architectures rather than passing a bitmask. Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D17783 Notes: svn path=/head/; revision=340030
* | Set PTE_A and PTE_D for user mappings in pmap_enter().John Baldwin2018-11-011-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This assumes that an access according to the prot in 'flags' triggered a fault and is going to be retried after the fault returns, so the two flags are set preemptively to avoid refaulting on the retry. While here, only bother setting PTE_D for kernel mappings in pmap_enter for writable mappings. Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D17782 Notes: svn path=/head/; revision=340029
* | SBI calls expect a pointer to a u_long rather than a pointer.John Baldwin2018-11-012-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is just cosmetic. A weirder issue is that the SBI doc claims the hart mask pointer should be a physical address, not a virtual address. However, the implementation in bbl seems to just dereference the address directly. Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D17781 Notes: svn path=/head/; revision=340028
* | Don't allow debuggers to modify SSTATUS, only to read it.John Baldwin2018-11-011-1/+0
| | | | | | | | | | | | | | | | | | Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D17771 Notes: svn path=/head/; revision=340027
* | Implement ptrace_set_pc() and fail PT_*STEP requests explicitly.John Baldwin2018-11-011-3/+3
| | | | | | | | | | | | | | | | | | Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D17769 Notes: svn path=/head/; revision=340025
* | Add comments explaining what hold/unhold doWarner Losh2018-11-012-3/+10
| | | | | | | | | | | | | | | | They act as a simple one-deep semaphore to keep open/close/probe from running at the same time to avoid races that creates. Notes: svn path=/head/; revision=340024
* | Check cannot_use_txpkts() rather than needs_tso() in add_to_txpkts().John Baldwin2018-11-011-1/+4
| | | | | | | | | | | | | | | | | | | | | | Currently this is a no-op, but will matter in the future when cannot_use_txpkts() starts checking other conditions than just needs_tso(). Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=340023
* | Add support for port unit wiring to cxgbe(4).John Baldwin2018-11-011-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add a bus_child_location_str method to the nexus drivers that prints out 'port=N' as the location string exported via devinfo and the '%location' sysctl node. - We can't use a bus_hint_device_unit to wire the unit numbers of devices with a fixed devclass as the device gets assigned a unit in make_device() before the device creator can set softc, etc. Instead, when adding a child device, use a helper function much like a bus_hint_device_unit method to look for wiring hints or to return -1 to let the system choose a unit number. This function requires an "at" hint for the port pointing to the nexus device and a "port" hint listing the port number. For example: hint.cxl.4.at="t5nex0" hint.cxl.4.port="0" wires cxl4 to the first port on the t5nex0 adapter. Requested by: gallatin MFC after: 2 months Notes: svn path=/head/; revision=340022
* | Assert that reclaim_tx_descs() is always making forward progress.John Baldwin2018-11-011-0/+3
| | | | | | | | | | | | | | | | MFC after: 2 months Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=340021
* | Don't enter DDB for fatal traps before panic by default.John Baldwin2018-11-019-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new 'debugger_on_trap' knob separate from 'debugger_on_panic' and make the calls to kdb_trap() in MD fatal trap handlers prior to calling panic() conditional on this new knob instead of 'debugger_on_panic'. Disable the new knob by default. Developers who wish to recover from a fatal fault by adjusting saved register state and retrying the faulting instruction can still do so by enabling the new knob. However, for the more common case this makes the user experience for panics due to a fatal fault match the user experience for other panics, e.g. 'c' in DDB will generate a crash dump and reboot the system rather than being stuck in an infinite loop of fatal fault messages and DDB prompts. Reviewed by: kib, avg MFC after: 2 months Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D17768 Notes: svn path=/head/; revision=340020
* | Add the ARMv8.3 SCTLR_EL1 fields.Andrew Turner2018-11-012-7/+16
| | | | | | | | | | | | | | | | | | | | While here tag which architecture release fields were added and remove a field that only existed in very early releases of the ARMv8 spec. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=340013
* | ixl/iavf(4): Update remaining references of "num_queues" to "num_rx_queues"Eric Joyner2018-11-012-7/+3
| | | | | | | | | | | | | | | | | | | | This should fix a build issue when "options RSS" is set. Reported by: bz@ Sponsored by: Intel Corporation Notes: svn path=/head/; revision=340010
* | carpstats are the last virtualised variable in the file and end up at theBjoern A. Zeeb2018-11-011-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | end of the vnet_set. The generated code uses an absolute relocation at one byte beyond the end of the carpstats array. This means the relocation for the vnet does not happen for carpstats initialisation and as a result the kernel panics on module load. This problem has only been observed with carp and only on i386. We considered various possible solutions including using linker scripts to add padding to all kernel modules for pcpu and vnet sections. While the symbols (by chance) stay in the order of appearance in the file adding an unused non-file-local variable at the end of the file will extend the size of set_vnet and hence make the absolute relocation for carpstats work (think of this as a single-module set_vnet padding). This is a (tmporary) hack. It is the least intrusive one as we need a timely solution for the upcoming release. We will revisit the problem in HEAD. For a lot more information and the possible alternate solutions please see the PR and the references therein. PR: 230857 MFC after: 3 days Notes: svn path=/head/; revision=340009
* | Add the ARMv8.3 HCR_EL2 register fields.Andrew Turner2018-11-011-0/+11
| | | | | | | | | | | | | | | | MFC after: 1 month Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=340008
* | Remove redundant checks for a NULL lbgroup table.Mark Johnston2018-11-012-14/+4
| | | | | | | | | | | | | | | | | | | | | | No functional change intended. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17108 Notes: svn path=/head/; revision=340005
* | Improve style in in_pcbinslbgrouphash() and related subroutines.Mark Johnston2018-11-011-30/+17
| | | | | | | | | | | | | | | | | | | | | | No functional change intended. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17107 Notes: svn path=/head/; revision=340004
* | linuxkpi: Add GFP flags needed for ttm driversBen Widawsky2018-11-011-0/+2
| | | | | | | | | | | | | | | | | | | | Submitted by: Johannes Lundberg <johalun0@gmail.com> Requested by: bwidawsk MFC after: 3 days Approved by: emaste (mentor) Notes: svn path=/head/; revision=340000
* | Fix NFS client vnode locking to avoid a crash during forced dismount.Rick Macklem2018-11-011-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A crash was reported where the crash occurred in nfs_advlock() when the NFS_ISV4(vp) macro was being executed. This was caused by the vnode being VI_DOOMED due to a forced dismount in progress. This patch fixes the problem by locking the vnode before executing the NFS_ISV4() macro. Tested by: rlibby PR: 232673 Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D17757 Notes: svn path=/head/; revision=339999