aboutsummaryrefslogtreecommitdiff
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* cxgbe(4): check if the firmware supports FW_RI_FR_NSMR_TPTE_WR workNavdeep Parhar2019-12-181-0/+8
| | | | | | | | | | | | request. This is used by iw_cxgbe to figure out how best to register memory. MFC after: 1 month Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=355886
* oce: Tighten input validation in the SIOCGI2C handler.Mark Johnston2019-12-181-9/+8
| | | | | | | | | | | | | | Missing validation meant that it was possible to read 8 bytes beyond the end of sfp_vpd_dump_buffer. Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com> Reviewed by: delphij, ram MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22859 Notes: svn path=/head/; revision=355885
* When pmap_enter_{l2,pde}() are called to create a kernel mapping, they areAlan Cox2019-12-182-165/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | incrementing (and decrementing) the ref_count on kernel page table pages. They should not do this. Kernel page table pages are expected to have a fixed ref_count. Address this problem by refactoring pmap_alloc{_l2,pde}() and their callers. This also eliminates some duplicated code from the callers. Correctly implement PMAP_ENTER_NOREPLACE in pmap_enter_{l2,pde}() on kernel mappings. Reduce code duplication by defining a function, pmap_abort_ptp(), for handling a common error case. Handle a possible page table page leak in pmap_copy(). Suppose that we are determining whether to copy a superpage mapping. If we abort because there is already a mapping in the destination pmap at the current address, then simply decrementing the page table page's ref_count is correct, because the page table page must have a ref_count > 1. However, if we abort because we failed to allocate a PV entry, this might be a just allocated page table page that has a ref_count = 1, so we should call pmap_abort_ptp(). Simplify error handling in pmap_enter_quick_locked(). Reviewed by: kib, markj (an earlier) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D22763 Notes: svn path=/head/; revision=355883
* Drop a sleepable lock when we plan on sleepingWarner Losh2019-12-181-2/+6
| | | | | | | | | | | | | g_io_speedup waits for the completion of the speedup request before proceeding using biowait(), but check_clear_deps is called with the softdeps lock held (which is non-sleepable). It's safe to drop this lock around the call to speedup, so do that. Submitted by: Peter Holm Reviewed by: kib@ Notes: svn path=/head/; revision=355882
* Leave multicast group before reaping and committing state for bothHans Petter Selasky2019-12-182-14/+14
| | | | | | | | | | | | | | | | | | IPv4 and IPv6. This fixes a regression issue after r349369. When trying to exit a multicast group before closing the socket, a multicast leave packet should be sent. Differential Revision: https://reviews.freebsd.org/D22848 PR: 242677 Reviewed by: bz (network) Tested by: Aleksandr Fedorov <aleksandr.fedorov@itglobal.com> MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=355881
* Restore important comment in RCU/EPOCH support in FreeBSD after r355784.Hans Petter Selasky2019-12-182-0/+16
| | | | | | | Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=355879
* acpi(4): Add _CID to PNP info stringConrad Meyer2019-12-181-2/+5
| | | | | | | | | | | | | | While a given ACPI device may have 0-N compatibility IDs, in practice most seem to have 0 or 1. If one is present, emit it as part of the PNP info string associated with a device. This could enable MODULE_PNP_INFO-based automatic kldload for ACPI drivers associated with a given _CID (but without a good _HID or _UID identifier). Reviewed by: imp, jhb Differential Revision: https://reviews.freebsd.org/D22846 Notes: svn path=/head/; revision=355876
* bcm2835_vcbus: add legacy compat mappingsKyle Evans2019-12-181-0/+14
| | | | | | | | | | I've opted for just duplicating the two entries needed for this, rather than writing any other mechanism for maintaining two root compat entries to map to one config, for simplicity. We'll eventually declare these legacy DTB unsupported, but let's not do that yet while there's no real burden. Notes: svn path=/head/; revision=355875
* Fix the aflag shift on big-endian platforms after r355672.Mark Johnston2019-12-181-1/+5
| | | | | | | | | | The structure offset is zero regardless of endianness. Reported by: brooks Pointy hat: markj Notes: svn path=/head/; revision=355874
* Add support for TLS 1.3 using AES-GCM to the OCF backend for KTLS.John Baldwin2019-12-181-18/+142
| | | | | | | | | Reviewed by: gallatin Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D22802 Notes: svn path=/head/; revision=355873
* Add a structure for the AAD used in TLS 1.3.John Baldwin2019-12-181-2/+12
| | | | | | | | | | | | While here, add RFC numbers to comments about nonce and AAD data for TLS 1.2. Reviewed by: gallatin Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D22801 Notes: svn path=/head/; revision=355872
* arm: add SOC_BRCM_BCM2837 option, include it in GENERICKyle Evans2019-12-173-2/+4
| | | | | | | | | | | | | | | | | | | | | | We use armv7/GENERIC for the RPI2 images. The original RPI2 is actually a 32-bit BCM2836, but v1.2 was upgraded to the 64-bit BCM2837. The project continues to provide the RPI2 image as armv7, as it's the lowest common denominator of the two. Historically, we've just kind of implicitly acknowledged this by including some bcm2837 bits on a SOC_BCM2836 kernel config -- this worked until r354875 added code that actually cared. Acknowledge formally that BCM2837 is valid in arm32. This name is inconsistent with the other BCM* SOC on !arm64 for two reasons: 1. It's a pre-existing option on arm64, and 2. the naming convention on arm/ should've arguably changed to include BRCM #1 seems to be a convincing enough argument to maintain the existing name for it. Notes: svn path=/head/; revision=355867
* Revert r355833Warner Losh2019-12-171-8/+11
| | | | | | | | While it works on nda, it fails on ada and/or da for at least zfs with a modify after free issue on a trim BIO. Revert while I rework it to fix those devices. Notes: svn path=/head/; revision=355865
* an(4): Require privileges for all SIOCGAIRONET requests.Mark Johnston2019-12-171-8/+15
| | | | | | | | | | | | | | | | SIOCGAIRONET allows userspace to query an(4) for various device properties and configuration, which appears to potentially include sensitive information such as WEP keys (an(4) seems to predate WPA). Also avoid races by copying in the request structure to a temporary buffer before locking and modifying the device softc. Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com> MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=355864
* Remove unnecessary MODULE_DEPEND() from imx_i2c.c, and also from rk_i2cIan Lepore2019-12-172-2/+0
| | | | | | | where it got copied to. Notes: svn path=/head/; revision=355860
* This commit is a bit of a re-arrange of deck chairs. ItRandall Stewart2019-12-179-75/+187
| | | | | | | | | | | | | | gets both rack and bbr ready for the completion of the STATs framework in FreeBSD. For now if you don't have both NF_stats and stats on it disables them. As soon as the rest of the stats framework lands we can remove that restriction and then just uses stats when defined. Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D22479 Notes: svn path=/head/; revision=355859
* Update owc_gpiobus (one-wire over gpio) to the modern gpio_pin interface.Ian Lepore2019-12-171-105/+88
| | | | | | | | | | | | | | | | | | It used to be required that a device be a child of gpiobus(4) to manipulate gpio pins. That requirement didn't work well for FDT-based systems with many cross-hierarchy users of gpio, so a more modern framework was created that removed the old hierarchy requirement. These changes adapt the owc_gpiobus driver to use the newer gpio_pin_* functions to acquire, release, and manipulate gpio pins. This allows a single driver to work for both hinted-attachment and fdt-based systems, and removes the requirement that any one-wire fdt nodes must appear at the root of the devicetree. Differential Revision: https://reviews.freebsd.org/D22710 Notes: svn path=/head/; revision=355858
* Convert zpcpu_* inlines to macros and add zpcpu_replace.Mateusz Guzik2019-12-171-13/+15
| | | | | | | | This allows them to do basic type casting internally, effectively relieving consumers from having to cast on their own. Notes: svn path=/head/; revision=355855
* arm64: rockchip: rk_gpio: Fix pin numberEmmanuel Vadot2019-12-171-1/+1
| | | | | | | | | | | The maxpin counter starts at 0, fix one by one error. This is still not totally correct for some banks in some SoC that have fewer pins but this will be dealt with in another commit. MFC after: 3 days Notes: svn path=/head/; revision=355853
* arm64: rockchip: rk_pinctrl: Fix clear bits in SYSCON_MODIFYEmmanuel Vadot2019-12-171-2/+2
| | | | | | | | | | | | | r351187 change the SYSCON_WRITE to SYSCON_MODIFY but didn't changed the mask variable that used to hold the bitmask in the upper 16 bits of the register that control which bits are changed. So we ended up clearing bit from the upper 16bits half which are always 0 after a read. Use the correct bit mask for bits that we want to clear. MFC after: 3 days Notes: svn path=/head/; revision=355852
* Revert r355831Warner Losh2019-12-171-11/+0
| | | | | | | | It wasn't supposed to change the defaults, but actually does. Back this out until that can be sorted out. Notes: svn path=/head/; revision=355843
* kbd: const'ify a couple of keyboard_driver fieldsKyle Evans2019-12-171-4/+9
| | | | | | | | | | Nothing modifies these things, but const'ify out of an abundance of caution. If we could const'ify the definition in each keyboard driver, I likely would- improper mutations here can lead to misbehavior or slightly more annoying to debug state. Notes: svn path=/head/; revision=355842
* Two minor issues:Warner Losh2019-12-171-1/+7
| | | | | | | | | (1) Don't define load/store 64 atomics for o32. They aren't atomic there. (2) Add comment about why we need 64 atomic define on n32 only. Notes: svn path=/head/; revision=355841
* Convert routing statistics to VNET_PCPUSTAT.Gleb Smirnoff2019-12-172-16/+21
| | | | | | | | | Submitted by: ocochard Reviewed by: melifaro, glebius Differential Revision: https://reviews.freebsd.org/D22834 Notes: svn path=/head/; revision=355840
* Implement bio_speedupWarner Losh2019-12-171-2/+37
| | | | | | | | | | | | | | | | | | | | | | | React to the BIO_SPEED command in the cam io scheduler by completing as successful BIO_DELETE commands that are pending, up to the length passed down in the BIO_SPEEDUP cmomand. The length passed down is a hint for how much space on the drive needs to be recovered. By completing the BIO_DELETE comomands, this allows the upper layers to allocate and write to the blocks that were about to be trimmed. Since FreeBSD implements TRIMSs as advisory, we can eliminliminate them and go directly to writing. The biggest benefit from TRIMS coomes ffrom the drive being able t ooptimize its free block pool inthe log run. There's little nto no bene3efit in the shoort term. , sepeciall whn the trim is followed by a write. Speedup lets us make this tradeoff. Reviewed by: kirk, kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D18351 Notes: svn path=/head/; revision=355837
* Add BIO_SPEEDUP signalling to UFSWarner Losh2019-12-171-2/+16
| | | | | | | | | | | | | When we have a resource shortage in UFS, send down a BIO_SPEEDUP to give the CAM I/O scheduler a heads up that we have a resource shortage and that it should bias its decisions knowing that. Reviewed by: kirk, kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D18351 Notes: svn path=/head/; revision=355836
* Add BIO_SPEEDUPWarner Losh2019-12-173-0/+41
| | | | | | | | | | | | | | | | | | | Add BIO_SPEEDUP bio command and g_io_speedup wrapper. It tells the lower layers that the upper layers are dealing with some shortage (dirty pages and/or disk blocks). The lower layers should do what they can to speed up anything that's been delayed. The first use will be to tell the CAM I/O scheduler that any TRIM shaping should be short-circuited because the system needs blocks. We'll also call it when there's too many resources used by UFS. Reviewed by: kirk, kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D18351 Notes: svn path=/head/; revision=355835
* Eliminate the TRIM_ACTIVE flag.Warner Losh2019-12-171-11/+8
| | | | | | | | | | | Rather than a trim active flag, have a counter that can be used to have a absolute limit on the number of trims in flight independent of any I/O limiting factors. Sponsored by: Netflix Notes: svn path=/head/; revision=355834
* Tweak the ddb show cam iosched command a bit.Warner Losh2019-12-171-3/+3
| | | | | | | | | | | For each of the different queue types, list the name of the queue. While it can be worked out from context, this makes it more useful and clearer. Sponsored by: Netflix Notes: svn path=/head/; revision=355833
* Add rate limiters to TRIM.Warner Losh2019-12-171-2/+42
| | | | | | | | | | | | Add rate limiters to trims. Trims are a bit different than reads or writes in that they can be combined, so some care needs to be taken where we rate limit them. Additional work will be needed to push the working rate limit below the I/O quanta rate for things like IOPS. Sponsored by: Netflix Notes: svn path=/head/; revision=355832
* NVME trim stuff.Warner Losh2019-12-171-0/+11
| | | | | | | | | | | | | | | | | | | Add two sysctls to control pacing of nvme trims. kern.cam.nda.X.goal_trim is the number of upper layer BIO_DEELETE requests to try to collecet before sending TRIM down too the nvme drive. trim_ticks is the number of ticks, at mosot, to wait for at least goal_trim BIOS_DELEETE requests to come in. Trim pacing is useful when a large number off disjoint trims are comoing in from the upper layers. Since we have no way to chain toogether trims from the upper layers that are sent down, this acts as a hueristic to group trims into reasonable sized chunks. What's reasonable varies from drive to drive. Sponsored by: Netflix Notes: svn path=/head/; revision=355831
* Avoid a tautological bitwise compare.Brooks Davis2019-12-171-1/+1
| | | | | | | | | | | | | | This looks like a bit of debugging code that sliped into the initial import of the new ATA framework. This changes the behavior to omit a line of output that appears to have been intended for omission. Reviewed by: mav MFC after: 3 days Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22845 Notes: svn path=/head/; revision=355830
* [atheros] [mips] Add the GPIO driver (back) to the TL-WDR3600/TL-WDR4300 kernel.Adrian Chadd2019-12-171-0/+7
| | | | | | | | | | | | | | | | | | | | So it turns out that sometime in the past I removed the GPIO bits here and was going to move it into a module in order to save a little space. However, it turns out that was a mistake on this particular AP - it uses a pair of GPIO lines to control the two receive LNAs on the 2GHz radio and without them enabled the radio is a LOT DEAF. With this re-introduced (and some replacement userland tools to save space, *cough* cpio/libarchive) I can actually use these chipsets again as a 2G station. Without the LNA the AP was seeing a per-radio RSSI upstairs here of around 3-5dB, with the LNA on it's around 15dB, more than enough to actually use wifi upstairs and also in line with the other Atheros / Intel devices I have up here. Big oopsie to Adrian. Big, big oopsie. Notes: svn path=/head/; revision=355829
* Double the size of ARG_MAX on LP64 platforms.Pedro F. Giffuni2019-12-161-1/+5
| | | | | | | | | | | | | | | | | | | | | | | As modern software keeps growing in size, we get requests to update the value of ARG_MAX in order to link the resulting object files. Other OSs have much higher values but Increasiong ARG_MAX has a multiplied effect on KVA, so just bumping this value is dangerous in some archs like ARM32 that can exhaust KVA rather easily. While it would be better to have a unique value for all archs, other OSs (Illumos in partidular) can have different ARG_MAX limits depending on the platform, For now we want to be really conservative so we are avoidng the change on ILP32 and in the alternative case we only double it since that seems to work well enough for recent Code Aster. I was planning to bump the _FreeBSD_version but it was bumped recently (r355798) so we can reuse the 1300068 value for this change. PR: 241710 MFC after: 5 days Notes: svn path=/head/; revision=355828
* Add back accidentally dropped masking...Warner Losh2019-12-161-3/+2
| | | | | | | | | | | | | | - PCI_MASK_CONFIG(sc->dev, CBBR_BRIDGECTRL, - & ~CBBM_BRIDGECTRL_INTR_IREQ_ISA_EN, 2); was accidentally dropped from r355822 in the refactor. Restore it since 16-bit cards may fail without it (some bridges autodetect this properly, so my laptop worked when I tested it). Noticed by: rpokala@ Notes: svn path=/head/; revision=355827
* Move attachment of pccard children into exca library. Attach theWarner Losh2019-12-162-13/+14
| | | | | | | | cardbus and pccard children before the sysctls are added rather than after. Notes: svn path=/head/; revision=355824
* Add slot number ivar to return which slot number the child is attached to.Warner Losh2019-12-162-0/+18
| | | | | | | | This will always be 0 for pccbb, but may be non-zero for other kinds of bridges, should they show up in the tree. Make querying it generic. Notes: svn path=/head/; revision=355823
* We'll never have multiple slots a cardbus bridge. So, replace excaWarner Losh2019-12-165-44/+39
| | | | | | | | | | | array with a singleton. Also, pccbb isa attachment is never going to happen, do disconnect it from the build (will delete this in future commit). It would need to be updated as well, but since this code is effectively dead code, remove it from the build instead. Notes: svn path=/head/; revision=355822
* Add a hack to make ^T work for Linux binaries, enabled withEdward Tomasz Napierala2019-12-164-0/+11
| | | | | | | | | | | 'compat.linux.preserve_vstatus=1' sysctl. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21967 Notes: svn path=/head/; revision=355820
* Repeat the spinlock_enter/exit pattern from amd64 on other architectures toJeff Roberson2019-12-166-17/+22
| | | | | | | | | | | | | | | | fix an assert violation introduced in r355784. Without this spinlock_exit() may see owepreempt and switch before reducing the spinlock count. amd64 had been optimized to do a single critical enter/exit regardless of the number of spinlocks which avoided the problem and this optimization had not been applied elsewhere. Reported by: emaste Suggested by: rlibby Discussed with: jhb, rlibby Tested by: manu (arm64) Notes: svn path=/head/; revision=355819
* Add compat.linux.emul_path, so it can be set to something otherEdward Tomasz Napierala2019-12-166-12/+19
| | | | | | | | | | | | | | than "/compat/linux". Useful when you have several compat directories with different Linux versions and you don't want to clash with files installed by linux-c7 packages. Reviewed by: bcr (manpages) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22574 Notes: svn path=/head/; revision=355818
* Revert r355813Warner Losh2019-12-162-20/+2
| | | | | | | | It was extracted from a larger tree and is incomplete. Will resubmit after reworking. Notes: svn path=/head/; revision=355817
* Implement a system-wide limit or da and ada devices for delete.Warner Losh2019-12-162-2/+20
| | | | | | | | | | | Excesively large TRIMs can result in timeouts, which cause big problems. Limit trims to 1GB to mititgate these issues. Reviewed by: scottl Differential Revision: https://reviews.freebsd.org/D22809 Notes: svn path=/head/; revision=355813
* Don't use K&R definitions. No functional changes.Edward Tomasz Napierala2019-12-161-6/+2
| | | | | | | | | Reported by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=355807
* kbd drivers: don't double register keyboard driversKyle Evans2019-12-166-0/+28
| | | | | | | | | | | | | | | | | | Keyboard drivers are generally registered via linker set. In these cases, they're also available as kmods which use KPI for registering/unregistering keyboard drivers outside of the linker set. For built-in modules, we still fire off MOD_LOAD and maybe even MOD_UNLOAD if an error occurs, leading to registration via linker set and at MOD_LOAD time. This is a minor optimization at best, but it keeps the internal kbd driver tidy as a future change will merge the linker set driver list into its internal keyboard_drivers list via SYSINIT and simplify driver lookup by removing the need to consult the linker set. Notes: svn path=/head/; revision=355806
* Fix gcc build after r355790Li-Wen Hsu2019-12-161-2/+0
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=355802
* [PPC] Handle qOffsets packetLeandro Lupori2019-12-163-0/+32
| | | | | | | | | | | | | | On PowerPC, this is needed in order for the debugger to find out the memory offset where the kernel image was loaded on the remote target. This fixes symbol resolution when remote debugging a PowerPC kernel. Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D22767 Notes: svn path=/head/; revision=355801
* kbd: patch linker set methods, tooKyle Evans2019-12-161-0/+17
| | | | | | | | | | This is needed after r355796. Some double-registration of kbd drivers needs to be sorted out, then this sysinit will simply add these drivers into the normal list and kill off any other bits in the driver that are aware of the linker set, for simplicity. Notes: svn path=/head/; revision=355799
* kbd: remove kbdsw, store pointer to driver in each keyboard_tKyle Evans2019-12-163-93/+78
| | | | | | | | | | | | | | | | | | The previous implementation relied on a kbdsw array that mirrored the global keyboards array. This is fine, but also requires extra locking consideration when accessing to ensure that it's not being resized as new keyboards are added. The extra pointer costs little in a struct that there are relatively few of on any given system, and simplifies locking requirements ever-so-slightly as we only need to consider the locking requirements of whichever method is being invoked. __FreeBSD_version is bumped as any kbd modules will need rebuilt following this change. Notes: svn path=/head/; revision=355798
* chrome_kb: remove default get_fkeystr/diag implementationsKyle Evans2019-12-161-2/+0
| | | | | | | This file was missed in r355796, but no harm would have come from this. Notes: svn path=/head/; revision=355797