aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* | vfs: employ vfs_ref_from_vp in statfs and fstatfsMateusz Guzik2021-02-211-11/+9
| | | | | | | | | | | | | | Avoids locking and unlocking the vnode. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D28695
* | vfs: add vfs_ref_from_vpMateusz Guzik2021-02-213-24/+40
| | | | | | | | | | | | | | This generalizes what vop_stdgetwritemount used to be doing. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D28695
* | amd64: implement strlen in assembly, take 2Mateusz Guzik2021-02-212-1/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tested with glibc test suite. The C variant in libkern performs excessive branching to find the zero byte instead of using the bsfq instruction. The same code patched to use it is still slower than the routine implemented here as the compiler keeps neglecting to perform certain optimizations (like using leaq). On top of that the routine can be used as a starting point for copyinstr which operates on words intead of bytes. The previous attempt had an instance of swapped operands to andq when dealing with fully aligned case, which had a side effect of breaking the code for certain corner cases. Noted by jrtc27. Sample results: $(perl -e "print 'A' x 3"): stock: 211198039 patched:338626619 asm: 465609618 $(perl -e "print 'A' x 100"): stock: 83151997 patched: 98285919 asm: 120719888 Reviewed by: jhb, kib Differential Revision: https://reviews.freebsd.org/D28779
* | jail: Improve locking when removing prisonsJamie Gritton2021-02-201-28/+41
| | | | | | | | | | | | | | | | | | Change the flow of prison_deref() so it doesn't let go of allprison_lock until it's completely done using it (except for a possible drop as part of an upgrade on its first try). Differential Revision: https://reviews.freebsd.org/D28458 MFC after: 3 days
* | PRR: use accurate rfc6675_pipe when enabledRichard Scheffenegger2021-02-201-3/+9
| | | | | | | | | | | | | | Reviewed By: #transport, tuexen MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28816
* | Add arp/ndp tests in addition to rtsock ll tests.Alexander V. Chernikov2021-02-204-2/+215
| |
* | Fix setting static entries for arp/ndp.Alexander V. Chernikov2021-02-202-0/+27
| | | | | | | | | | | | | | | | | | rtsock message validation changes committed in 2fe5a79425c7 did not take llinfo messages into account. Add a special validation case for RTA_GATEWAY llinfo messages. MFC after: 2 days
* | bsdinstall: add knob to set ASLR sysctlsEd Maste2021-02-201-0/+18
| | | | | | | | | | | | Reviewed by: mw Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28418
* | bsdinstall: replace multiple ifs with caseEd Maste2021-02-201-22/+24
| | | | | | | | | | | | | | Reduce copy-paste and use a more typical construct. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28417
* | pwrite(2): add a BUGS sectionGuangyuan Yang2021-02-201-1/+15
| | | | | | | | | | | | | | | | | | Add a BUGS section about using pwrite(2) when O_APPEND is set on the fd. MFC after: 3 days Submitted by: Ka Ho Ng <khng300@gmail.com> Reviewed by: gbe, yuripv Differential Revision: https://reviews.freebsd.org/D28372
* | libdtrace: Trivial style fixes to force dt_lex.c to be regeneratedMark Johnston2021-02-201-9/+10
| | | | | | | | | | | | | | | | | | After commit 8ba333e02e ("libdtrace: Stop relying on lex compatibility"), there have been several reports of incremental buildworlds failing since make does not know that dt_lex.c needs to be regenerated, and I want to avoid this when merging to stable/13. MFC with: 8ba333e02e
* | boot: remove gptboot.efifat, it never should have beenWarner Losh2021-02-191-1/+2
| | | | | | | | | | | | | | | | conical hat reduction: Make sure we also remove gotboot.efifat. It was created, briefly, and shouldn't have existed in the first place. Kill it at the same place we kill boot1.efifat. Pointy Hat to: imp@
* | cxgbetool(8): Add support for setting the hashfilter mode (filter mask).Navdeep Parhar2021-02-191-32/+46
| | | | | | | | | | Tighten up the validation of filter modes while here. Unrecognized keywords will be now be flagged as errors instead of being ignored.
* | cxgbe(4): Use the correct filter width for T5+.Navdeep Parhar2021-02-193-1/+6
| | | | | | | | | | | | | | | | | | T5 and above have extra bits for the optional filter fields. This is a correctness issue and not just a waste because a filter mode valid on a T4 (36b) may not be valid on a T5+ (40b). MFC after: 2 weeks Sponsored by: Chelsio Communications
* | cxgbe(4): Add a driver ioctl to set the filter mask.Navdeep Parhar2021-02-194-0/+48
| | | | | | | | | | | | | | | | | | | | Allow the filter mask (aka the hashfilter mode when hashfilters are in use) to be set any time it is safe to do so. The requested mask must be a subset of the filter mode already. The driver will not change the mode or ingress config just to support a new mask. MFC after: 2 weeks Sponsored by: Chelsio Communications
* | cxgbe(4): Use firmware commands to get/set filter configuration.Navdeep Parhar2021-02-196-129/+287
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Query the firmware for filter mode, mask, and related ingress config instead of trying to figure them out from hardware registers. Read configuration from the registers only when the firmware does not support this query. 2. Use the firmware to set the filter mode. This is the correct way to do it and is more flexible as well. The filter mode (and associated ingress config) can now be changed any time it is safe to do so. The user can specify a subset of a valid mode and the driver will enable enough bits to make sure that the mode is maxed out -- that is, it is not possible to set another bit without exceeding the total width for optional filter fields. This is a hardware requirement that was not enforced by the driver previously. MFC after: 2 weeks Sponsored by: Chelsio Communications
* | jail: Change both root and working directories in jail_attach(2)Jamie Gritton2021-02-194-5/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | jail_attach(2) performs an internal chroot operation, leaving it up to the calling process to assure the working directory is inside the jail. Add a matching internal chdir operation to the jail's root. Also ignore kern.chroot_allow_open_directories, and always disallow the operation if there are any directory descriptors open. Reported by: mjg Approved by: markj, kib MFC after: 3 days
* | iflib: Fix detach of pseudo interfacesMark Johnston2021-02-191-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 38bfc6dee33b we added an IFDI_DETACH() call to iflib_pseudo_deregister() since it looked like it was missing. One is present in the error-handling path of iflib_pseudo_register(). However, the detach actually comes from the DEVICE_DETACH() method for the above-mentioned device_t, so now we're calling IFDI_DETACH() twice when destroying a pseudo interface. Fix the problem by not calling IFDI_DETACH() from the device detach routine. This way we can ensure that iflib de-initialization always happens in a consistent order. It also ensures that you can't do silly things like "devctl detach <pseudo ifnet>", which would previously detach the driver without tearing down the corresponding ifnet. PR: 253541 Reviewed by: erj MFC after: 1 week Fixes: 38bfc6dee33b Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28774
* | Revert 3c4fd2463bb2 since upstream libcxxrt fixed it in another wayDimitry Andric2021-02-191-24/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 0ee0dbfb0d26cf4bc37f24f12e76c7f532b0f368 I imported a more recent libcxxrt snapshot, which includes an upstream fix for the padding of struct _Unwind_Exception: https://github.com/libcxxrt/libcxxrt/commit/e458560b7e22fff59af643dba363544b393bd8db However, we also had a similar fix in our tree as: https://cgit.freebsd.org/src/commit/?id=3c4fd2463bb29f65ef1404011fcb31e508cdf2e2 Since having both fixes makes the struct too large again, it leads to SIGBUSes when throwing exceptions on amd64 (or other LP64 arches). This is most easily tested by running kyua without any arguments. It looks like our fix is no longer needed now, so revert it to reduce diffs against upstream. PR: 253226 Reviewed by: arichardson, kp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28799
* | Fix arp/ndp deletion broken by 2fe5a79425c7.Alexander V. Chernikov2021-02-193-29/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes in the 2fe5a79425c7 moved dst sockaddr masking from the routing control plane to the rtsock code. It broke arp/ndp deletion. It turns out, arp/ndp perform RTM_GET request first to get an interface index necessary for the deletion. Then they simply stamp the reply with RTF_LLDATA and set the command to RTM_DELETE. As a result, kernel receives request with non-empty RTA_NETMASK and clears RTA_DST host bits before passing the message to the lla code. De facto, the only needed bits are RTA_DST, RTA_GATEWAY and the subset of rtm_flags. With that in mind, fix the interace by clearing RTA_NETMASK for every messages with RTF_LLDATA. While here, cleanup arp/ndp code a bit. MFC after: 1 day Reviewed by: gnn Differential Revision: https://reviews.freebsd.org/D28804
* | fbio: Use appropriate types for the physical and virtual framebuffer addressAlfredo Dal'Ava Junior2021-02-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Use appropriate types for the physical and virtual framebuffer address. Fixes framebuffers mapped above 4G physical on 32-bit systems that support physical address extensions like i386 and Book-E powerpc. Patch developed by bdragon Reviewed by: bdragon, luporl Relnotes: yes Differential Revision: https://reviews.freebsd.org/D28604
* | iflib: Cast the result of iflib_netmap_txq_init() to void.John Baldwin2021-02-191-1/+1
| | | | | | | | | | | | | | | | This fixes a warning from GCC for kernels without netmap since the return value is never used. Reviewed by: vmaffione, erj Differential Revision: https://reviews.freebsd.org/D28598
* | Microoptimize CTL I/O queues.Alexander Motin2021-02-196-80/+81
| | | | | | | | | | | | | | | | | | | | | | | | Switch OOA queue from TAILQ to LIST and change its direction, so that we traverse it forward, not backward. There is only one place where we really need other direction, and it is not critical. Use STAILQ_REMOVE_HEAD() instead of STAILQ_REMOVE() in backends. Replace few impossible conditions with assertions. MFC after: 1 month
* | Reimplement the arm64 dtrace_gethrtime(), which provides theRobert Watson2021-02-191-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | high-resolution nanosecond timestamp used for the DTrace 'timestamp' built-in variable. The new implementation uses the EL0 cycle counter and frequency registers in ARMv8-A. This replaces a previous implementation that relied on an instrumentation-safe implementation of getnanotime(), which provided only timer resolution. MFC after: 3 days Reviewed by: andrew, bsdimp (older version) Useful comments appreciated: jrtc27, emaste
* | ofwfb: fix incorrect colors on powerpc* and add new tunable parametersAlfredo Dal'Ava Junior2021-02-191-42/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Implements little-endian support (powerpc64le) - Adds 'hw.ofwfb.physaddr' kernel parameter so user can manually provide correct address if it's not detected correctly - Adds 'hw.ofwfb.argb32_pixel' so user can set it manually if colors are inverted due to incorrect pixel format (default = 1) - Automatically selects RGBA32 pixel format if NVidia graphic adapter is detected (sets hw.ofwfb.argb32_pixel=0) Machines equipped with NVidia graphic adapters tend to use RGBA32 pixel format. By default ARGB32 pixel format is used, proved to work on machines equipped with ATI graphic adapter and the onboard adapter used on Talos II and Blackbird machines from Raptor Computing Systems. Original patch developed by bdragon Reviewed by: bdragon, luporl MFC after: 3 days Relnotes: yes Differential Revision: https://reviews.freebsd.org/D28604
* | Remove __XSCALE__ checks from the arm codeAndrew Turner2021-02-192-11/+0
| | | | | | | | | | | | | | XScale support was removed over 2 years ago, remove the last __XSCALE__ checks from the arm MD code. Sponsored by: Innovate UK
* | Ensure cwnd doesn't shrink to zero with PRRRichard Scheffenegger2021-02-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | Under some circumstances, PRR may end up with a fully collapsed cwnd when finalizing the loss recovery. Reviewed By: #transport, kbowling Reported by: Liang Tian MFC after: 1 week Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28780
* | ports(7): Update instructions for package targetDaniel Ebdrup Jensen2021-02-191-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Packages default to ending up in a different location compared to the documentation, so catch up to the implementation by referring to the location where packages can usually be found if no environment variables have been set. While here, also update the mention of the file extension to match the txz format that packages use. PR: 253179, 224370 Reported by: rwatson, jeromer at fastmail dotnet
* | kern: net: remove TCP_LINGERTIMEKyle Evans2021-02-193-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TCP_LINGERTIME can be traced back to BSD 4.4 Lite and perhaps beyond, in exactly the same form that it appears here modulo slightly different context. It used to be the case that there was a single pr_usrreq method with requests dispatched to it; these exact two lines appeared in tcp_usrreq's PRU_ATTACH handling. The only purpose of this that I can find is to cause surprising behavior on accepted connections. Newly-created sockets will never hit these paths as one cannot set SO_LINGER prior to socket(2). If SO_LINGER is set on a listening socket and inherited, one would expect the timeout to be inherited rather than changed arbitrarily like this -- noting that SO_LINGER is nonsense on a listening socket beyond inheritance, since they cannot be 'connected' by definition. Neither Illumos nor Linux reset the timer like this based on testing and inspection of Illumos, and testing of Linux. Reviewed by: rscheff, tuexen Differential Revision: https://reviews.freebsd.org/D28265
* | Save context switch per I/O for iSCSI and IOCTL frontends.Alexander Motin2021-02-196-25/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce new CTL core KPI ctl_run(), preprocessing I/Os in the caller context instead of scheduling another thread just for that. This call may sleep, that is not acceptable for some frontends like the original CAM/FC one, but iSCSI already has separate sleepable per-connection RX threads, and another thread scheduling is mostly just a waste of time. IOCTL frontend actually waits for the I/O completion in the caller thread, so the use of another thread for this has even less sense. With this change I can measure ~5% IOPS improvement on 4KB iSCSI I/Os to ZFS. MFC after: 1 month
* | tests/sys/audit: force PIE offEd Maste2021-02-191-0/+1
| | | | | | | | | | | | | | | | df093aa9463b linked against libprivateauditd.a, but that is currently (and incorrectly) built as position-dependent. For now just force PIE off for this test to fix the WITH_PIE build. Sponsored by: The FreeBSD Foundation
* | pass UNAME_r to fix building 14.x ports on 13.xGlen Barber2021-02-181-1/+1
| | | | | | | | | | MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate")
* | nvdimm(4): Export NVDIMM health flags via sysctlRavi Pokala2021-02-183-1/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ACPI NFIT specification defines a set of "NVDIMM State Flags". These flags are already reported by `acpidump -t', but this change makes them available on a per-device basis, in a format that is more easily parsed. To simplify this, introduce acpi_nfit_get_memory_maps_by_dimm(), which locates the (ACPI_NFIT_MEMORY_MAP)s associated with a given (nfit_handle_t). Reviewed by: mav, cem Tested by: mav, rpokala (version for stable/12) MFC after: 3 days Sponsored by: Panasas
* | nfs-over-tls: add rc scripts for rpc.tlsclntd and rpc.tlsservdRick Macklem2021-02-184-0/+54
| | | | | | | | | | | | | | | | | | Add rc.d scripts that control the recently committed rpc.tlsclntd(8) and rpc.tlsservd(8) daemons. Reviewed by: gbe MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28432
* | nfs-over-tls: add user space daemons rpc.tlsclntd and rpc.tlsservdRick Macklem2021-02-189-0/+2588
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The kernel changes needed for nfs-over-tls have been committed to main. However, nfs-over-tls requires user space daemons to handle the TLS handshake and other non-application data TLS records. There is one daemon (rpc.tlsclntd) for the client side and one daemon (rpc.tlsservd) for the server side, although they share a fair amount of code found in rpc.tlscommon.c and rpc.tlscommon.h. They use a KTLS enabled OpenSSL to perform the actual work and, as such, are only built when MK_OPENSSL_KTLS is set. Communication with the kernel is done via upcall RPCs done on AF_LOCAL sockets and the custom system call rpctls_syscall. Reviewed by: gbe (man pages only), jhb (usr.sbin/Makefile only) Comments by: jhb MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28430 Relnotes: yes
* | Move XPT_IMMEDIATE_NOTIFY handling out of periph lock.Alexander Motin2021-02-181-1/+2
| | | | | | | | | | | | It is a rare, but still better to not have lock dependencies. MFC after: 1 month
* | Merge libcxxrt master 8049924686b8414d8e652cbd2a52c763b48e8456Dimitry Andric2021-02-183-7/+20
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Interesting fixes: b3c73ba libelftc_dem_gnu3: Sync with elftoolchain r3877 7b2335c Mostly fix __cxa_demangle after #3 Reported by: arichardson PR: 253226 MFC after: 3 days
| * | Import libcxxrt master 8049924686b8414d8e652cbd2a52c763b48e8456vendor/libcxxrt/2021-02-18-8049924686b8414d8e652cbd2a52c763b48e8456Dimitry Andric2021-02-183-381/+824
| | | | | | | | | | | | | | | | | | Interesting fixes: b3c73ba libelftc_dem_gnu3: Sync with elftoolchain r3877 7b2335c Mostly fix __cxa_demangle after #3
* | | cgem: improve usage of busdma(9) KPIMitchell Horne2021-02-181-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUS_DMA_NOCACHE should only be used when one needs to guarantee the created mapping has uncached memory attributes, usually as a result of buggy hardware. Normal use cases should pass BUS_DMA_COHERENT, to create an appropriate mapping based on the flags passed to bus_dma_tag_create(). This should have no functional change, since the DMA tags in this driver are created without the BUS_DMA_COHERENT flag. Reported by: mmel Reviewed by: mmel, Thomas Skibo <thomas-bsd@skibo.net> MFC after: 3 days
* | | vis(1): Add EXAMPLES sectionFernando ApesteguĂ­a2021-02-181-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add three examples showing the use of `-h`, `-l`, `-t`, `-w` christos@netbsd.org to be notified. Reviewed by: bcr@, gbe@, imp@ Approved by: bcr@, gbe@ (mentor), imp@ Differential Revision: https://reviews.freebsd.org/D25242
* | | mq_unlink(3): Add manual pageFernando ApesteguĂ­a2021-02-182-0/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add a succinct manual page for mq_unlink Mostly borrowed from https://pubs.opengroup.org/onlinepubs/9699959099/ and hence, the disclaimer note at the bottom. PR: 243174 Reported by: rfg-freebsd@tristatelogic.com Reviewed by: gbe@, yuripv@ Approved by: gbe@ (mentor), yuripv@ Differential Revision: https://reviews.freebsd.org/D28593
* | | cryptosoft: Support per-op keys for AES-GCM and AES-CCM.John Baldwin2021-02-181-0/+6
| | | | | | | | | | | | | | | | | | Reviewed by: cem Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D28752
* | | Add Chacha20-Poly1305 support in the OCF backend for KTLS.John Baldwin2021-02-181-21/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | This supports Chacha20-Poly1305 for both send and receive for TLS 1.2 and for send in TLS 1.3. Reviewed by: gallatin Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27841
* | | Add Chacha20-Poly1305 as a KTLS cipher suite.John Baldwin2021-02-182-14/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Chacha20-Poly1305 for TLS is an AEAD cipher suite for both TLS 1.2 and TLS 1.3 (RFCs 7905 and 8446). For both versions, Chacha20 uses the server and client IVs as implicit nonces xored with the record sequence number to generate the per-record nonce matching the construction used with AES-GCM for TLS 1.3. Reviewed by: gallatin Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27839
* | | cryptocheck: Add Chacha20-Poly1305 AEAD coverage.John Baldwin2021-02-181-19/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Make openssl_gcm_encrypt generic to AEAD ciphers (aside from CCM) and use it for Chacha20-Poly1305. - Use generic AEAD control constants instead of GCM/CCM specific names. Reviewed by: cem Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27838
* | | Add an implementation of CHACHA20_POLY1305 to cryptosoft.John Baldwin2021-02-185-5/+335
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This uses the chacha20 IETF and poly1305 implementations from libsodium. A seperate auth_hash is created for the auth side whose Setkey method derives the poly1305 key from the AEAD key and nonce as described in RFC 8439. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27837
* | | Add an OCF algorithm for ChaCha20-Poly1305 AEAD.John Baldwin2021-02-188-8/+68
| | | | | | | | | | | | | | | | | | | | | | | | Note that this algorithm implements the mode defined in RFC 8439. Reviewed by: cem Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27836
* | | git-arc: Preserve the commit author when staging commitsMark Johnston2021-02-181-2/+3
| | | | | | | | | | | | Reported by: jhb
* | | git-arc: Globally save and restore the git checkout headMark Johnston2021-02-181-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This script uses -e, so it's prone to exiting in awkward places. In particular, if arc diff fails, the script just exits without restoring the checkout. Mitigate this for now by using a global variable to record the previous checkout and use a trap handler to restore it in the face of errors. A better solution might be to use arc diff's --head parameter but that will require more testing. Reported by: kevans Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D28631
* | | ddb: fix show devmap output on 32-bit armThomas Skibo2021-02-181-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | The output has been broken since 1b6dd6d772ca. Casting to uintmax_t before the call to printf is necessary to ensure that 32-bit addresses are interpreted correctly. PR: 243236 MFC after: 3 days