aboutsummaryrefslogtreecommitdiff
path: root/sys/conf/options
Commit message (Collapse)AuthorAgeFilesLines
* Remove RADIX_MPATH config option.Alexander V. Chernikov2020-11-291-1/+0
| | | | | | | | | | | | ROUTE_MPATH is the new config option controlling new multipath routing implementation. Remove the last pieces of RADIX_MPATH-related code and the config option. Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D27244 Notes: svn path=/head/; revision=368164
* Make MAXPHYS tunable. Bump MAXPHYS to 1M.Konstantin Belousov2020-11-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace MAXPHYS by runtime variable maxphys. It is initialized from MAXPHYS by default, but can be also adjusted with the tunable kern.maxphys. Make b_pages[] array in struct buf flexible. Size b_pages[] for buffer cache buffers exactly to atop(maxbcachebuf) (currently it is sized to atop(MAXPHYS)), and b_pages[] for pbufs is sized to atop(maxphys) + 1. The +1 for pbufs allow several pbuf consumers, among them vmapbuf(), to use unaligned buffers still sized to maxphys, esp. when such buffers come from userspace (*). Overall, we save significant amount of otherwise wasted memory in b_pages[] for buffer cache buffers, while bumping MAXPHYS to desired high value. Eliminate all direct uses of the MAXPHYS constant in kernel and driver sources, except a place which initialize maxphys. Some random (and arguably weird) uses of MAXPHYS, e.g. in linuxolator, are converted straight. Some drivers, which use MAXPHYS to size embeded structures, get private MAXPHYS-like constant; their convertion is out of scope for this work. Changes to cam/, dev/ahci, dev/ata, dev/mpr, dev/mpt, dev/mvs, dev/siis, where either submitted by, or based on changes by mav. Suggested by: mav (*) Reviewed by: imp, mav, imp, mckusick, scottl (intermediate versions) Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D27225 Notes: svn path=/head/; revision=368124
* Remove NO_EVENTTIMERS supportMark Johnston2020-11-191-1/+0
| | | | | | | | | | | | | | The arm configs that required it have been removed from the tree. Removing this option makes the callout code easier to read and discourages developers from adding new configs without eventtimer drivers. Reviewed by: ian, imp, mav Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27270 Notes: svn path=/head/; revision=367826
* Add "Fenestras X" alternative /dev/random implementationConrad Meyer2020-10-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fortuna remains the default; no functional change to GENERIC. Big picture: - Scalable entropy generation with per-CPU, buffered local generators. - "Push" system for reseeding child generators when root PRNG is reseeded. (Design can be extended to arc4random(9) and userspace generators.) - Similar entropy pooling system to Fortuna, but starts with a single pool to quickly bootstrap as much entropy as possible early on. - Reseeding from pooled entropy based on time schedule. The time interval starts small and grows exponentially until reaching a cap. Again, the goal is to have the RNG state depend on as much entropy as possible quickly, but still periodically incorporate new entropy for the same reasons as Fortuna. Notable design choices in this implementation that differ from those specified in the whitepaper: - Blake2B instead of SHA-2 512 for entropy pooling - Chacha20 instead of AES-CTR DRBG - Initial seeding. We support more platforms and not all of them use loader(8). So we have to grab the initial entropy sources in kernel mode instead, as much as possible. Fortuna didn't have any mechanism for this aside from the special case of loader-provided previous-boot entropy, so most of these sources remain TODO after this commit. Reviewed by: markm Approved by: csprng (markm) Differential Revision: https://reviews.freebsd.org/D22837 Notes: svn path=/head/; revision=366620
* Introduce scalable route multipath.Alexander V. Chernikov2020-10-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change is based on the nexthop objects landed in D24232. The change introduces the concept of nexthop groups. Each group contains the collection of nexthops with their relative weights and a dataplane-optimized structure to enable efficient nexthop selection. Simular to the nexthops, nexthop groups are immutable. Dataplane part gets compiled during group creation and is basically an array of nexthop pointers, compiled w.r.t their weights. With this change, `rt_nhop` field of `struct rtentry` contains either nexthop or nexthop group. They are distinguished by the presense of NHF_MULTIPATH flag. All dataplane lookup functions returns pointer to the nexthop object, leaving nexhop groups details inside routing subsystem. User-visible changes: The change is intended to be backward-compatible: all non-mpath operations should work as before with ROUTE_MPATH and net.route.multipath=1. All routes now comes with weight, default weight is 1, maximum is 2^24-1. Current maximum multipath group width is statically set to 64. This will become sysctl-tunable in the followup changes. Using functionality: * Recompile kernel with ROUTE_MPATH * set net.route.multipath to 1 route add -6 2001:db8::/32 2001:db8::2 -weight 10 route add -6 2001:db8::/32 2001:db8::3 -weight 20 netstat -6On Nexthop groups data Internet6: GrpIdx NhIdx Weight Slots Gateway Netif Refcnt 1 ------- ------- ------- --------------------------------------- --------- 1 13 10 1 2001:db8::2 vlan2 14 20 2 2001:db8::3 vlan2 Next steps: * Land outbound hashing for locally-originated routes ( D26523 ). * Fix net/bird multipath (net/frr seems to work fine) * Add ROUTE_MPATH to GENERIC * Set net.route.multipath=1 by default Tested by: olivier Reviewed by: glebius Relnotes: yes Differential Revision: https://reviews.freebsd.org/D26449 Notes: svn path=/head/; revision=366390
* Rename kernel option ACPI_DMAR to IOMMU.Ruslan Bukin2020-09-291-1/+3
| | | | | | | | | | | This is mostly needed for a common arm64/amd64 iommu code. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D26587 Notes: svn path=/head/; revision=366267
* geom(4): Kill GEOM_PART_EBR_COMPAT optionConrad Meyer2020-07-011-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Take advantage of Warner's nice new real GEOM aliasing system and use it for aliased partition names that actually work. Our canonical EBR partition name is the weird, not-default-on-x86-prior-to- this-revision "da1p4+00001234." However, if compatibility mode (tunable kern.geom.part.ebr.compat_aliases) is enabled (1, default), we continue to provide the alias names like "da1p5" in addition to the weird canonical names. Naming partition providers was just one aspect of the COMPAT knob; in addition it limited mutability, in part because it did not preserve existing EBR header content aside from that of LBA 0. This change saves the EBR header for LBA 0, as well as for every EBR partition encountered. That way, when we write out the EBR partition table on modification, we can restore any bootloader or other metadata in both LBA0 (the first data-containing EBR may start after 0) as well as every logical EBR we read from the disk, and only update the geometry metadata and linked list pointers that describe the actual partitioning. (This change does not add support for the 'bootcode' verb to EBR.) PR: 232463 Reported by: Manish Jain <bourne.identity AT hotmail.com> Discussed with: ae (no objection) Relnotes: maybe Differential Revision: https://reviews.freebsd.org/D24939 Notes: svn path=/head/; revision=362823
* Add the SCTP_SUPPORT kernel option.Mark Johnston2020-06-181-0/+1
| | | | | | | | | | | | | This is in preparation for enabling a loadable SCTP stack. Analogous to IPSEC/IPSEC_SUPPORT, the SCTP_SUPPORT kernel option must be configured in order to support a loadable SCTP implementation. Discussed with: tuexen MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=362338
* Update vt(4) config option names to chase r303043.Mark Johnston2020-06-041-2/+2
| | | | | | | | | PR: 246080 Submitted by: David Marec <david@lapinbilly.eu> MFC after: 1 week Notes: svn path=/head/; revision=361792
* Remove ubsec(4).John Baldwin2020-05-111-5/+0
| | | | | | | | | | | | This driver was previously marked for deprecation in r360710. Approved by: csprng (cem, gordon, delphij) Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24766 Notes: svn path=/head/; revision=360918
* Split XDR into separate kernel module. Make krpc depend on xdr.Gleb Smirnoff2020-04-171-0/+1
| | | | | | | | Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D24408 Notes: svn path=/head/; revision=360036
* Add queue(2) debug macros as build optionsConrad Meyer2020-04-121-2/+4
| | | | | | | | | | | | | Add QUEUE_MACRO_DEBUG_TRACE and QUEUE_MACRO_DEBUG_TRASH as proper kernel options. While here, alpha-sort the debug section of sys/conf/options. Enable QUEUE_MACRO_DEBUG_TRASH in amd64 GENERIC (but not GENERIC-NODEBUG) kernels. It is similar in nature and cost to other use-after-free pointer trashing we do in GENERIC. It is probably reasonable to enable in any arch GENERIC kernel that defines INVARIANTS. Notes: svn path=/head/; revision=359829
* Finish removal of bktrWarner Losh2020-03-011-21/+0
| | | | | | | | | | Remove the old ioctl .h files Remove copying/linking ioctl .h files in instasllworld Remove bktr from lint Add now-removed files with ObsoleteFiles Notes: svn path=/head/; revision=358500
* Remove vpo.4Warner Losh2020-02-021-1/+0
| | | | | | | | | | | | | | | | The Parallel Port SCSI adapter was interesting for 100MB ZIP drives, but is no longer used or maintained. Remove it from the tree. The Parallel Port microsequencer (microseq.9) is now mostly unused in the tree, but remains. PPI still refrences it, but doesn't use its full functionality. Relnotes: Yes Reviewed by: rgrimes@, Ihor Antonov Discussed on: arch@ Differential Revision: https://reviews.freebsd.org/D23389 Notes: svn path=/head/; revision=357394
* UMA NUMA flag day. UMA_ZONE_NUMA was a source of confusion. Make the namesJeff Roberson2020-01-041-2/+0
| | | | | | | | | | | | | | | | | | more consistent with other NUMA features as UMA_ZONE_FIRSTTOUCH and UMA_ZONE_ROUNDROBIN. The system will now pick a select a default depending on kernel configuration. API users need only specify one if they want to override the default. Remove the UMA_XDOMAIN and UMA_FIRSTTOUCH kernel options and key only off of NUMA. XDOMAIN is now fast enough in all cases to enable whenever NUMA is. Reviewed by: markj Discussed with: rlibby Differential Revision: https://reviews.freebsd.org/D22831 Notes: svn path=/head/; revision=356351
* Port the NetBSD KCSAN runtime to FreeBSD.Andrew Turner2019-11-211-0/+1
| | | | | | | | | | | | | | | | Update the NetBSD Kernel Concurrency Sanitizer (KCSAN) runtime to work in the FreeBSD kernel. It is a useful tool for finding data races between threads executing on different CPUs. This can be enabled by enabling KCSAN in the kernel config, or by using the GENERIC-KCSAN amd64 kernel. It works on amd64 and arm64, however the later needs a compiler change to allow -fsanitize=thread that KCSAN uses. Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22315 Notes: svn path=/head/; revision=354942
* Actually hook CAM_IO_STATS up to the buildAlan Somers2019-11-161-0/+1
| | | | | | | | | | | | | It's still disabled by default, but now it can be enabled with config(5) and it will be build in LINT. Reviewed by: imp MFC after: 1 week Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D22383 Notes: svn path=/head/; revision=354779
* Implement NetGDB(4)Conrad Meyer2019-10-171-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NetGDB(4) is a component of a system using a panic-time network stack to remotely debug crashed FreeBSD kernels over the network, instead of traditional serial interfaces. There are three pieces in the complete NetGDB system. First, a dedicated proxy server must be running to accept connections from both NetGDB and gdb(1), and pass bidirectional traffic between the two protocols. Second, the NetGDB client is activated much like ordinary 'gdb' and similarly to 'netdump' in ddb(4) after a panic. Like other debugnet(4) clients (netdump(4)), the network interface on the route to the proxy server must be online and support debugnet(4). Finally, the remote (k)gdb(1) uses 'target remote <proxy>:<port>' (like any other TCP remote) to connect to the proxy server. The NetGDB v1 protocol speaks the literal GDB remote serial protocol, and uses a 1:1 relationship between GDB packets and sequences of debugnet packets (fragmented by MTU). There is no encryption utilized to keep debugging sessions private, so this is only appropriate for local segments or trusted networks. Submitted by: John Reimer <john.reimer AT emc.com> (earlier version) Discussed some with: emaste, markj Relnotes: sure Differential Revision: https://reviews.freebsd.org/D21568 Notes: svn path=/head/; revision=353700
* Split out a more generic debugnet(4) from netdump(4)Conrad Meyer2019-10-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Debugnet is a simplistic and specialized panic- or debug-time reliable datagram transport. It can drive a single connection at a time and is currently unidirectional (debug/panic machine transmit to remote server only). It is mostly a verbatim code lift from netdump(4). Netdump(4) remains the only consumer (until the rest of this patch series lands). The INET-specific logic has been extracted somewhat more thoroughly than previously in netdump(4), into debugnet_inet.c. UDP-layer logic and up, as much as possible as is protocol-independent, remains in debugnet.c. The separation is not perfect and future improvement is welcome. Supporting INET6 is a long-term goal. Much of the diff is "gratuitous" renaming from 'netdump_' or 'nd_' to 'debugnet_' or 'dn_' -- sorry. I thought keeping the netdump name on the generic module would be more confusing than the refactoring. The only functional change here is the mbuf allocation / tracking. Instead of initiating solely on netdump-configured interface(s) at dumpon(8) configuration time, we watch for any debugnet-enabled NIC for link activation and query it for mbuf parameters at that time. If they exceed the existing high-water mark allocation, we re-allocate and track the new high-water mark. Otherwise, we leave the pre-panic mbuf allocation alone. In a future patch in this series, this will allow initiating netdump from panic ddb(4) without pre-panic configuration. No other functional change intended. Reviewed by: markj (earlier version) Some discussion with: emaste, jhb Objection from: marius Differential Revision: https://reviews.freebsd.org/D21421 Notes: svn path=/head/; revision=353685
* Introduce stats(3), a flexible statistics gathering API.Edward Tomasz Napierala2019-10-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This provides a framework to define a template describing a set of "variables of interest" and the intended way for the framework to maintain them (for example the maximum, sum, t-digest, or a combination thereof). Afterwards the user code feeds in the raw data, and the framework maintains these variables inside a user-provided, opaque stats blobs. The framework also provides a way to selectively extract the stats from the blobs. The stats(3) framework can be used in both userspace and the kernel. See the stats(3) manual page for details. This will be used by the upcoming TCP statistics gathering code, https://reviews.freebsd.org/D20655. The stats(3) framework is disabled by default for now, except in the NOTES kernel (for QA); it is expected to be enabled in amd64 GENERIC after a cool down period. Reviewed by: sef (earlier version) Obtained from: Netflix Relnotes: yes Sponsored by: Klara Inc, Netflix Differential Revision: https://reviews.freebsd.org/D20477 Notes: svn path=/head/; revision=353283
* Move EPOCH_TRACE to opt_global.h, so that any external modules thatGleb Smirnoff2019-09-261-1/+1
| | | | | | | | | | | | use epoch don't need Makefile tweaks. The downside is that any developer who wants EPOCH_TRACE needs to rebuild kernel in full, but that's fine. Reviewed by: imp Notes: svn path=/head/; revision=352778
* Add debugging facility EPOCH_TRACE that checks that epochs entered areGleb Smirnoff2019-09-251-0/+2
| | | | | | | | | | | | | | properly nested and warns about recursive entrances. Unlike with locks, there is nothing fundamentally wrong with such use, the intent of tracer is to help to review complex epoch-protected code paths, and we mean the network stack here. Reviewed by: hselasky Sponsored by: Netflix Pull Request: https://reviews.freebsd.org/D21610 Notes: svn path=/head/; revision=352707
* Add kernel-side support for in-kernel TLS.John Baldwin2019-08-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | KTLS adds support for in-kernel framing and encryption of Transport Layer Security (1.0-1.2) data on TCP sockets. KTLS only supports offload of TLS for transmitted data. Key negotation must still be performed in userland. Once completed, transmit session keys for a connection are provided to the kernel via a new TCP_TXTLS_ENABLE socket option. All subsequent data transmitted on the socket is placed into TLS frames and encrypted using the supplied keys. Any data written to a KTLS-enabled socket via write(2), aio_write(2), or sendfile(2) is assumed to be application data and is encoded in TLS frames with an application data type. Individual records can be sent with a custom type (e.g. handshake messages) via sendmsg(2) with a new control message (TLS_SET_RECORD_TYPE) specifying the record type. At present, rekeying is not supported though the in-kernel framework should support rekeying. KTLS makes use of the recently added unmapped mbufs to store TLS frames in the socket buffer. Each TLS frame is described by a single ext_pgs mbuf. The ext_pgs structure contains the header of the TLS record (and trailer for encrypted records) as well as references to the associated TLS session. KTLS supports two primary methods of encrypting TLS frames: software TLS and ifnet TLS. Software TLS marks mbufs holding socket data as not ready via M_NOTREADY similar to sendfile(2) when TLS framing information is added to an unmapped mbuf in ktls_frame(). ktls_enqueue() is then called to schedule TLS frames for encryption. In the case of sendfile_iodone() calls ktls_enqueue() instead of pru_ready() leaving the mbufs marked M_NOTREADY until encryption is completed. For other writes (vn_sendfile when pages are available, write(2), etc.), the PRUS_NOTREADY is set when invoking pru_send() along with invoking ktls_enqueue(). A pool of worker threads (the "KTLS" kernel process) encrypts TLS frames queued via ktls_enqueue(). Each TLS frame is temporarily mapped using the direct map and passed to a software encryption backend to perform the actual encryption. (Note: The use of PHYS_TO_DMAP could be replaced with sf_bufs if someone wished to make this work on architectures without a direct map.) KTLS supports pluggable software encryption backends. Internally, Netflix uses proprietary pure-software backends. This commit includes a simple backend in a new ktls_ocf.ko module that uses the kernel's OpenCrypto framework to provide AES-GCM encryption of TLS frames. As a result, software TLS is now a bit of a misnomer as it can make use of hardware crypto accelerators. Once software encryption has finished, the TLS frame mbufs are marked ready via pru_ready(). At this point, the encrypted data appears as regular payload to the TCP stack stored in unmapped mbufs. ifnet TLS permits a NIC to offload the TLS encryption and TCP segmentation. In this mode, a new send tag type (IF_SND_TAG_TYPE_TLS) is allocated on the interface a socket is routed over and associated with a TLS session. TLS records for a TLS session using ifnet TLS are not marked M_NOTREADY but are passed down the stack unencrypted. The ip_output_send() and ip6_output_send() helper functions that apply send tags to outbound IP packets verify that the send tag of the TLS record matches the outbound interface. If so, the packet is tagged with the TLS send tag and sent to the interface. The NIC device driver must recognize packets with the TLS send tag and schedule them for TLS encryption and TCP segmentation. If the the outbound interface does not match the interface in the TLS send tag, the packet is dropped. In addition, a task is scheduled to refresh the TLS send tag for the TLS session. If a new TLS send tag cannot be allocated, the connection is dropped. If a new TLS send tag is allocated, however, subsequent packets will be tagged with the correct TLS send tag. (This latter case has been tested by configuring both ports of a Chelsio T6 in a lagg and failing over from one port to another. As the connections migrated to the new port, new TLS send tags were allocated for the new port and connections resumed without being dropped.) ifnet TLS can be enabled and disabled on supported network interfaces via new '[-]txtls[46]' options to ifconfig(8). ifnet TLS is supported across both vlan devices and lagg interfaces using failover, lacp with flowid enabled, or lacp with flowid enabled. Applications may request the current KTLS mode of a connection via a new TCP_TXTLS_MODE socket option. They can also use this socket option to toggle between software and ifnet TLS modes. In addition, a testing tool is available in tools/tools/switch_tls. This is modeled on tcpdrop and uses similar syntax. However, instead of dropping connections, -s is used to force KTLS connections to switch to software TLS and -i is used to switch to ifnet TLS. Various sysctls and counters are available under the kern.ipc.tls sysctl node. The kern.ipc.tls.enable node must be set to true to enable KTLS (it is off by default). The use of unmapped mbufs must also be enabled via kern.ipc.mb_use_ext_pgs to enable KTLS. KTLS is enabled via the KERN_TLS kernel option. This patch is the culmination of years of work by several folks including Scott Long and Randall Stewart for the original design and implementation; Drew Gallatin for several optimizations including the use of ext_pgs mbufs, the M_NOTREADY mechanism for TLS records awaiting software encryption, and pluggable software crypto backends; and John Baldwin for modifications to support hardware TLS offload. Reviewed by: gallatin, hselasky, rrs Obtained from: Netflix Sponsored by: Netflix, Chelsio Communications Differential Revision: https://reviews.freebsd.org/D21277 Notes: svn path=/head/; revision=351522
* Remove deprecated GEOM classesConrad Meyer2019-08-131-5/+0
| | | | | | | | | | | | | | Follow-up on r322318 and r322319 and remove the deprecated modules. Shift some now-unused kernel files into userspace utilities that incorporate them. Remove references to removed GEOM classes in userspace utilities. Reviewed by: imp (earlier version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D21249 Notes: svn path=/head/; revision=351001
* Add two new kernel options to control memory locality on NUMA hardware.Jeff Roberson2019-08-061-0/+2
| | | | | | | | | | | | | | | | - UMA_XDOMAIN enables an additional per-cpu bucket for freed memory that was freed on a different domain from where it was allocated. This is only used for UMA_ZONE_NUMA (first-touch) zones. - UMA_FIRSTTOUCH sets the default UMA policy to be first-touch for all zones. This tries to maintain locality for kernel memory. Reviewed by: gallatin, alc, kib Tested by: pho, gallatin Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20929 Notes: svn path=/head/; revision=350659
* Add support for extended descriptor format to Altera mSGDMA driver.Ruslan Bukin2019-06-271-0/+6
| | | | | | | | | | | | The format to use depends on hardware configuration (synthesis-time), so make it compile-time kernel option. Extended format allows DMA engine to operate with 64-bit memory addresses. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=349466
* Remove a couple of harmless stray references to nandfs.Warner Losh2019-06-251-1/+0
| | | | | | | Submitted by: tsoome@ Notes: svn path=/head/; revision=349374
* sys: Remove DEV_RANDOM device optionConrad Meyer2019-06-211-1/+0
| | | | | | | | | | | | | | Remove 'device random' from kernel configurations that reference it (most). Replace perhaps mistaken 'nodevice random' in two MIPS configs with 'options RANDOM_LOADABLE' instead. Document removal in UPDATING; update NOTES and random.4. Reviewed by: delphij, markm (previous version) Approved by: secteam(delphij) Differential Revision: https://reviews.freebsd.org/D19918 Notes: svn path=/head/; revision=349253
* Add a COMPAT_FREEBSD12 kernel option.Conrad Meyer2019-05-021-0/+1
| | | | | | | | | | | Use it wherever COMPAT_FREEBSD11 is currently specified, like r309749. Reviewed by: imp, jhb, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20120 Notes: svn path=/head/; revision=347029
* Make TMPFS_PAGES_MINRESERVED a kernel optionAllan Jude2019-03-251-0/+3
| | | | | | | | | | | | | | | | TMPFS_PAGES_MINRESERVED controls how much memory is reserved for the system and not used by tmpfs. On very small memory systems, the default value may be too high and this prevents these small memory systems from using reroot, which is required for them to install firmware updates. Submitted by: Hiroki Mori <yamori813@yahoo.co.jp> Reviewed by: mizhka Differential Revision: https://reviews.freebsd.org/D13583 Notes: svn path=/head/; revision=345491
* Allow using TPM as entropy source.Marcin Wojtas2019-03-231-0/+3
| | | | | | | | | | | | | | | | | TPM has a built-in RNG, with its own entropy source. The driver was extended to harvest 16 random bytes from TPM every 10 seconds. A new build option "TPM_HARVEST" was introduced - for now, however, it is not enabled by default in the GENERIC config. Submitted by: Kornel Duleba <mindal@semihalf.com> Reviewed by: markm, delphij Approved by: secteam Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D19620 Notes: svn path=/head/; revision=345438
* Rename fuse(4) to fusefs(4)Alan Somers2019-03-201-1/+1
| | | | | | | | | | | | | | This makes it more consistent with other filesystems, which all end in "fs", and more consistent with its mount helper, which is already named "mount_fusefs". Reviewed by: cem, rgrimes MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19649 Notes: svn path=/head/; revision=345350
* gcov supportMatt Macy2019-02-231-0/+4
| | | | | | | | | | | | add gcov support and export results as files in debugfs Reviewed by: hps@ MFC after: 1 week Sponsored by: iX Systems Differential Revision: https://reviews.freebsd.org/D19260 Notes: svn path=/head/; revision=344487
* Connect the restored dumb and sc terminal emulators to the kernel build.Bruce Evans2019-02-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add or fix options to control static and dynamic configuration. Keep the default of scteken, but default to statically configuring all available emulators (now 3 instead of 1). The dumb emulator is almost usable. libedit and libreadline handle dumb terminals perfectly for at least shell history. less(1) works as well as possible except on exit. But curses programs make messes. The dumb emulator has strange color support, with 2 dumb colors for normal output but fancy colorization for the cursor, mouse pointer and (with a non-dumb initial emulator) for low-level console output. Using the sc emulator instead of the default of scteken fixes at least the following bugs: - NUL is a printing character in cons25 but not in teken - teken doesn't support fixed colors for "reverse" video. - The best versions of sc are about 10 times faster than scteken (for printing to the frame buffer). This version is only about 5 times faster. Fix configuration features: - make SC_DFLT_TERM (for setting the initial emulator) a normal option. Add configuration features: - negative options SC_NO_TERM_* for omitting emulators in the static config. Modules for emulators might work, but I don't know of any - vidcontrol -e shows the available emulators - vidcontrol -E <emulator> sets the active emulator. Notes: svn path=/head/; revision=344458
* Retire SPX_HACK option unused after r342244Ed Maste2019-02-061-1/+0
| | | | Notes: svn path=/head/; revision=343839
* Extract the coverage sanitizer KPI to a new file.Andrew Turner2019-01-291-1/+2
| | | | | | | | | | | | | | | | | | | | This will allow multiple consumers of the coverage data to be compiled into the kernel together. The only requirement is only one can be registered at a given point in time, however it is expected they will only register when the coverage data is needed. A new kernel conflig option COVERAGE is added. This will allow kcov to become a module that can be loaded as needed, or compiled into the kernel. While here clean up the #include style a little. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18955 Notes: svn path=/head/; revision=343550
* Garbage collect AH_SUPPORT_AR5416 config option.Andriy Voskoboinyk2019-01-251-1/+0
| | | | | | | It does nothing since r318857. Notes: svn path=/head/; revision=343427
* Remove IEEE80211_AMPDU_AGE config option.Andriy Voskoboinyk2019-01-201-1/+0
| | | | | | | It is noop since r297774. Notes: svn path=/head/; revision=343219
* Allocate pager bufs from UMA instead of 80-ish mutex protected linked list.Gleb Smirnoff2019-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o In vm_pager_bufferinit() create pbuf_zone and start accounting on how many pbufs are we going to have set. In various subsystems that are going to utilize pbufs create private zones via call to pbuf_zsecond_create(). The latter calls uma_zsecond_create(), and sets a limit on created zone. After startup preallocate pbufs according to requirements of all pbuf zones. Subsystems that used to have a private limit with old allocator now have private pbuf zones: md(4), fusefs, NFS client, smbfs, VFS cluster, FFS, swap, vnode pager. The following subsystems use shared pbuf zone: cam(4), nvme(4), physio(9), aio(4). They should have their private limits, but changing that is out of scope of this commit. o Fetch tunable value of kern.nswbuf from init_param2() and while here move NSWBUF_MIN to opt_param.h and eliminate opt_swap.h, that was holding only this option. Default values aren't touched by this commit, but they probably should be reviewed wrt to modern hardware. This change removes a tight bottleneck from sendfile(2) operation, that uses pbufs in vnode pager. Other pagers also would benefit from faster allocation. Together with: gallatin Tested by: pho Notes: svn path=/head/; revision=343030
* Add support for the Clang Coverage Sanitizer in the kernel (KCOV).Andrew Turner2019-01-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building with KCOV enabled the compiler will insert function calls to probes allowing us to trace the execution of the kernel from userspace. These probes are on function entry (trace-pc) and on comparison operations (trace-cmp). Userspace can enable the use of these probes on a single kernel thread with an ioctl interface. It can allocate space for the probe with KIOSETBUFSIZE, then mmap the allocated buffer and enable tracing with KIOENABLE, with the trace mode being passed in as the int argument. When complete KIODISABLE is used to disable tracing. The first item in the buffer is the number of trace event that have happened. Userspace can write 0 to this to reset the tracing, and is expected to do so on first use. The format of the buffer depends on the trace mode. When in PC tracing just the return address of the probe is stored. Under comparison tracing the comparison type, the two arguments, and the return address are traced. The former method uses on entry per trace event, while the later uses 4. As such they are incompatible so only a single mode may be enabled. KCOV is expected to help fuzzing the kernel, and while in development has already found a number of issues. It is required for the syzkaller system call fuzzer [1]. Other kernel fuzzers could also make use of it, either with the current interface, or by extending it with new modes. A man page is currently being worked on and is expected to be committed soon, however having the code in the kernel now is useful for other developers to use. [1] https://github.com/google/syzkaller Submitted by: Mitchell Horne <mhorne063@gmail.com> (Earlier version) Reviewed by: kib Testing by: tuexen Sponsored by: DARPA, AFRL Sponsored by: The FreeBSD Foundation (Mitchell Horne) Differential Revision: https://reviews.freebsd.org/D14599 Notes: svn path=/head/; revision=342962
* Add NETGRAPH_CHECKSUM.Maxim Sobolev2018-12-121-0/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=342002
* Port the NetBSD ubsan runtime to the FreeBSD kernel.Andrew Turner2018-11-061-0/+3
| | | | | | | | | | | | | | This allows us to build the ubsan code added in r340189 into the kernel with the KUBSAN option. This will report when undefined behaviour is detected in the currently running kernel. As it can be large, the kernel is 65MB on arm64, loader may not be able to load the kernel on all architectures so is disabled by default for now. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=340191
* Introduce an EXPERIMENTAL option for both src.conf(5) and the kernel.Bjoern A. Zeeb2018-10-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | In the last decade(s) we have seen both short term or long term projects committed to the tree which were considered or even marked "experimental". While out-of-tree development has become easier than it used to be in CVS times, there still is a need to have the code shipping with HEAD but not enabled by default. While people may think about VIMAGE as one of the recent larger, long term projects, early protocol implementations (before they are standardised) are others. (Free)BSD historically was one of the operating systems which would have running code at early stages and help develop and influence standardisation and the industry. Give developers an opportunity to be more pro-active for early adoption or running large scale code changes stumbling over each others but not the user's feet. I have not added the option to NOTES in order to avoid breaking supported option builds, which require constant compile testing. Discussed with: people in the corridor Notes: svn path=/head/; revision=339922
* Remove the long obsolete SYM_SETUP_LP_PROBE_MAP option. It's not beenWarner Losh2018-10-221-5/+0
| | | | | | | | | | needed for almost 20 years, and is totally useless now that ncr(4) has been removed. Relnotes: yes Notes: svn path=/head/; revision=339575
* Remove the ncr(4) drive.Warner Losh2018-10-221-6/+0
| | | | | | | | | | | This driver has been obsolete since the FreeBSD 4.x. It should have been removed then since the sym(4) driver had subsumed it. The driver was commented out of GENERIC in 2000. RelNotes: Yes Notes: svn path=/head/; revision=339574
* Retire dpt(4)Warner Losh2018-10-221-4/+0
| | | | | | | | | | Marked as gone in 12 and not relevant since the early 90s. No sightings in nycbug's dmesg database. Relnotes: yes Notes: svn path=/head/; revision=339569
* Remove adv(4) and adw(4)Warner Losh2018-10-221-1/+0
| | | | | | | | | | | Remove the advanssy drivers (both adv and adw). They were tagged as gone in 12 a while qgo. The nycbug dmesg database shows this was last seen in 6 and there were only a few adv sightings then (none for adw). Relnotes: yes Notes: svn path=/head/; revision=339567
* Retire IPFIREWALL_NAT64_DIRECT_OUTPUT kernel option. And add abilityAndrey V. Elsukov2018-10-211-1/+0
| | | | | | | | | | | | | | | | | | to switch the output method in run-time. Also document some sysctl variables that can by changed for NAT64 module. NAT64 had compile time option IPFIREWALL_NAT64_DIRECT_OUTPUT to use if_output directly from nat64 module. By default is used netisr based output method. Now both methods can be used, but they require different handling by rules. Obtained from: Yandex LLC MFC after: 3 weeks Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D16647 Notes: svn path=/head/; revision=339542
* Remove the Yarrow PRNG algorithm option in accordance with due noticeMark Murray2018-08-261-3/+0
| | | | | | | | | | | | | | | | | | | given in random(4). This includes updating of the relevant man pages, and no-longer-used harvesting parameters. Ensure that the pseudo-unit-test still does something useful, now also with the "other" algorithm instead of Yarrow. PR: 230870 Reviewed by: cem Approved by: so(delphij,gtetlow) Approved by: re(marius) Differential Revision: https://reviews.freebsd.org/D16898 Notes: svn path=/head/; revision=338324
* KASSERT: Make runtime optionality optionalConrad Meyer2018-08-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Add an option, KASSERT_PANIC_OPTIONAL, that allows runtime KASSERT() behavior changes. When this option is not enabled, code that allows KASSERTs to become optional is not enabled, and all violated assertions cause termination. The runtime KASSERT behavior was added in r243980. One important distinction here is that panic has __dead2 ("attribute((noreturn))"), while kassert_panic does not. Static analyzers like Coverity understand __dead2. Without it, KASSERTs go misunderstood, resulting in many false positives that result from violation of program invariants. Reviewed by: jhb, jtl, np, vangyzen Relnotes: yes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D16835 Notes: svn path=/head/; revision=338214