aboutsummaryrefslogtreecommitdiff
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* Untie nmi_handle_intr() from DEV_ISA.Alexander Motin2020-07-222-8/+0
| | | | | | | | | | The only part of nmi_handle_intr() depending on ISA is isa_nmi(), which is already wrapped. Entering debugger on NMI does not really depend on ISA. MFC after: 2 weeks Notes: svn path=/head/; revision=363431
* mmccam: Add support for 1.2V and 1.8V eMMCEmmanuel Vadot2020-07-221-4/+71
| | | | | | | | | If the card reports that it support 1.2V or 1.8V signaling switch to this voltage. Submitted by: kibab Notes: svn path=/head/; revision=363428
* mmccam: Add support for 1.8V sdcardEmmanuel Vadot2020-07-222-3/+49
| | | | | | | | | | If the card reports that it support 1.8V signaling switch to this voltage. While here update the list of mode for mmccam. Submitted by: kibab Notes: svn path=/head/; revision=363427
* aw_mmc: Start a mmccam discovery when the CD handler is called.Emmanuel Vadot2020-07-221-0/+4
| | | | | | | Submitted by: kibab Notes: svn path=/head/; revision=363426
* mmccam: Add a generic mmccam_start_discovery functionEmmanuel Vadot2020-07-223-44/+27
| | | | | | | | | | | This is a generic function start a scan request for the given cam_sim. Other driver can now just use this function to request a new rescan. Submitted by: kibab Notes: svn path=/head/; revision=363425
* mmccam: Use a sbuf for the mmc ident functionEmmanuel Vadot2020-07-221-21/+41
| | | | | | | While here fix a typo. Notes: svn path=/head/; revision=363424
* mmc_xpt: Fix debug messagesEmmanuel Vadot2020-07-221-1/+2
| | | | | | | | | | PROBE_RESET was printed for PROBE_IDENTIFY, fix this. While here add one for the PROBE_RESET. Submitted by: kibab Notes: svn path=/head/; revision=363422
* usb(4): Stop checking for failures from malloc(M_WAITOK).Mark Johnston2020-07-2212-60/+19
| | | | | | | | | | | | | | Handle the fact that parts of usb(4) can be compiled into the boot loader, where M_WAITOK does not guarantee a successful allocation. PR: 240545 Submitted by: Andrew Reiter <arr@watson.org> (original version) Reviewed by: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25706 Notes: svn path=/head/; revision=363420
* lockmgr: add adaptive spinningMateusz Guzik2020-07-223-18/+114
| | | | | | | | | | | | | | | | | | | | | | It is very conservative. Only spinning when LK_ADAPTIVE is passed, only on exclusive lock and never when any waiters are present. buffer cache is remains not spinning. This reduces total sleep times during buildworld etc., but it does not shorten total real time (culprits are contention in the vm subsystem along with slock + upgrade which is not covered). For microbenchmarks: open3_processes -t 52 (open/close of the same file for writing) ops/s: before: 258845 after: 801638 Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D25753 Notes: svn path=/head/; revision=363415
* Consistently use gctl_get_provider instead of home-grown variants.Xin LI2020-07-2210-202/+62
| | | | | | | | | Reviewed by: cem, imp MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D25739 Notes: svn path=/head/; revision=363411
* gctl_get_class, gctl_get_geom and gctl_get_provider: provide feedbackXin LI2020-07-221-6/+11
| | | | | | | | | | | when the requested argument is missing. Reviewed by: cem MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D25738 Notes: svn path=/head/; revision=363410
* INTRNG: only shuffle for !EARLY_AP_STARTUPMitchell Horne2020-07-212-5/+10
| | | | | | | | | | | | | | | | | | | | | | | During device attachment, all interrupt sources will bind to the BSP, as it is the only processor online. This means interrupts must be redistributed ("shuffled") later, during SI_SUB_SMP. For the EARLY_AP_STARTUP case, this is no longer true. SI_SUB_SMP will execute much earlier, meaning APs will be online and available before devices begin attachment, and there will therefore be nothing to shuffle. All PIC-conforming interrupt controllers will handle this early distribution properly, except for RISC-V's PLIC. Make the necessary tweak to the PLIC driver. While here, convert irq_assign_cpu from a boolean_t to a bool. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D25693 Notes: svn path=/head/; revision=363404
* Transition from rtrequest1_fib() to rib_action().Alexander V. Chernikov2020-07-219-154/+92
| | | | | | | | | | | | Remove all variations of rtrequest <rtrequest1_fib, rtrequest_fib, in6_rtrequest, rtrequest_fib> and their uses and switch to to rib_action(). This is part of the new routing KPI. Submitted by: Neel Chauhan <neel AT neelc DOT org> Differential Revision: https://reviews.freebsd.org/D25546 Notes: svn path=/head/; revision=363403
* Fix geli's null cipher, and add a test caseAlan Somers2020-07-212-6/+10
| | | | | | | | | | | PR: 247954 Submitted by: jhb (sys), asomers (tests) Reviewed by: jhb (tests), asomers (sys) MFC after: 2 weeks Sponsored by: Axcient Notes: svn path=/head/; revision=363402
* Avoid code duplicaiton by using ipi_selected().Alexander Motin2020-07-212-14/+2
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=363399
* Fix style and comment around concave/convex regions in TCP cubic.Richard Scheffenegger2020-07-211-3/+2
| | | | | | | | | | | | | | | | | In cubic, the concave region is when snd_cwnd starts growing slower towards max_cwnd (cwnd at the time of the congestion event), and the convex region is when snd_cwnd starts to grow faster and eventually appearing like slow-start like growth. PR: 238478 Reviewed by: tuexen (mentor), rgrimes (mentor) Approved by: tuexen (mentor), rgrimes (mentor) MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D24657 Notes: svn path=/head/; revision=363397
* lockmgr: denote recursion with a bit in lock valueMateusz Guzik2020-07-212-7/+12
| | | | | | | | | This reduces excessive reads from the lock. Tested by: pho Notes: svn path=/head/; revision=363394
* lockmgr: rewrite upgrade to stop always dropping the lockMateusz Guzik2020-07-211-36/+34
| | | | | | | This matches rw and sx locks. Notes: svn path=/head/; revision=363393
* lockmgr: add a helper for reading the lock valueMateusz Guzik2020-07-212-17/+18
| | | | Notes: svn path=/head/; revision=363392
* Only write to VIRTIO_MMIO_GUEST_PAGE_SIZE with virtio mmio version 1Andrew Turner2020-07-211-4/+8
| | | | | | | | | | This register is only defined for the legacy v1 interface so only write to it when interacting with a legacy device. Sponsored by: Innovate UK Notes: svn path=/head/; revision=363390
* Move sys/iommu.h to dev/iommu/ as a part of generic IOMMU busdma backend.Ruslan Bukin2020-07-214-3/+3
| | | | | | | | | Reviewed by: kib Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D25750 Notes: svn path=/head/; revision=363388
* Move the Intel DMAR busdma backend to a generic place soRuslan Bukin2020-07-2112-13/+13
| | | | | | | | | | | it can be used on other IOMMU systems. Reviewed by: kib Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D25720 Notes: svn path=/head/; revision=363387
* dtrace/fbt: fix return probe arguments on armAndriy Gapon2020-07-212-7/+13
| | | | | | | | | | | | | | | | | | | | | arg0 should be an offset of the return point within the function, arg1 should be the return value. Previously the return probe had arguments as if for the entry probe. Tested on armv7. andrew noted that the same problem seems to be present on arm64, mips, and riscv. I am not sure if I will get around to fixing those. So, platform users or anyone looking to make a contribution please be aware of this opportunity. Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25685 Notes: svn path=/head/; revision=363383
* gpioiic: never drive lines active highAndriy Gapon2020-07-211-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | I2C communication is done by a combination of driving a line low or letting it float, so that it is either pulled up or driven low by another party. r355276 besides the stated goal of the change -- using the new GPIO API -- also changed the logic, so that active state is signaled by actively driving a line. That worked with iicbb prior to r362042, but stopped working after that commit on at least some hardware. My guess that the breakage was related to getting an ACK bit. A device expected to be able to drive SDA actively low, but controller was actively driving it high for some time. Anyway, this change seems to fix the problem. Tested using gpioiic on Orange Pi PC Plus with HTU21 sensor. Reported by: Nick Kostirya <nikolay.kostirya@i11.co> Reviewed by: manu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25684 Notes: svn path=/head/; revision=363382
* Add MODULE_VERSION to TCP loadable congestion control modules.Richard Scheffenegger2020-07-208-1/+8
| | | | | | | | | | | | | | | | | | Without versioning information, using preexisting loader / linker code is not easily possible when another module may have dependencies on pre-loaded modules, and also doesn't allow the automatic loading of dependent modules. No functional change of the actual modules. Reviewed by: tuexen (mentor), rgrimes (mentor) Approved by: tuexen (mentor), rgrimes (mentor) MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D25744 Notes: svn path=/head/; revision=363380
* Don't dynamically allocate data structures for KTLS crypto requests.John Baldwin2020-07-201-70/+64
| | | | | | | | | | | | | | | Allocate iovec arrays and struct cryptop and struct ocf_operation objects on the stack to reduce avoid the overhead of malloc(). These structures are all small enough to fit on the stack of the KTLS worker threads. Reviewed by: gallatin Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D25692 Notes: svn path=/head/; revision=363379
* iflib: initialize netmap with the correct number of descriptorsVincenzo Maffione2020-07-201-22/+38
| | | | | | | | | | | | | | | | | | In case the network device has a RX or TX control queue, the correct number of TX/RX descriptors is contained in the second entry of the isc_ntxd (or isc_nrxd) array, rather than in the first entry. This case is correctly handled by iflib_device_register() and iflib_pseudo_register(), but not by iflib_netmap_attach(). If the first entry is larger than the second, this can result in a panic. This change fixes the bug by introducing two helper functions that also lead to some code simplification. PR: 247647 MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D25541 Notes: svn path=/head/; revision=363378
* crypto(9): Stop checking for failures from malloc(M_WAITOK).Mark Johnston2020-07-201-5/+1
| | | | | | | | | | | PR: 240545 Submitted by: Andrew Reiter <arr@watson.org> Reviewed by: cem, delphij, jhb MFC after: 1 week Event: July 2020 Bugathon Notes: svn path=/head/; revision=363374
* Fix a memory leak in dsl_scan_visitbp().Mark Johnston2020-07-201-1/+1
| | | | | | | | | | | | This should be triggered only if arc_read() fails, i.e., quite rarely. The same logic is already present in OpenZFS. PR: 247445 Submitted by: jdolecek@NetBSD.org MFC after: 1 week Notes: svn path=/head/; revision=363373
* padlock: fix Via Padlock with 192-bit keysAlan Somers2020-07-201-1/+1
| | | | | | | | | | | | It's been broken since a typo in r359374 Reviewed by: jhb MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D25710 Notes: svn path=/head/; revision=363368
* ext2fs: Stop checking for failures from malloc(M_WAITOK).Mark Johnston2020-07-205-30/+0
| | | | | | | | | | | PR: 240545 Submitted by: Andrew Reiter <arr@watson.org> Reviewed by: fsu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25707 Notes: svn path=/head/; revision=363367
* Fix indent for if clause.Xin LI2020-07-201-1/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=363360
* riscv: look for bootargs in FDTMitchell Horne2020-07-191-0/+16
| | | | | | | | | | | | | | The FDT may contain a short /chosen/bootargs string which we should pass to boot_parse_cmdline. Notably, this allows the use of qemu's -append option to pass things like -s to boot to single user mode. Submitted by: Nathaniel Filardo <nwf20@cl.cam.ac.uk> Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25544 Notes: svn path=/head/; revision=363345
* Make efirt module dependent on MK_EFIMitchell Horne2020-07-191-2/+6
| | | | | | | | | | | MK_EFI was added to kern.opts.mk in r331099, but is currently unused. Take advantage of that fact and gate the build of efirt behind it. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D24673 Notes: svn path=/head/; revision=363339
* The ds3231 RTC chip bitmask values for 12- versus 24-hour mode were reversed,Ian Lepore2020-07-191-2/+2
| | | | | | | | | | flip them so that times in the 20:00:00 to 23:59:59 range read correctly. Reported by: Dr. Rolf Jansen <freebsd-rj@obsigna.com> Pointy hat: ian@ Notes: svn path=/head/; revision=363330
* Simplify non-pti syscall entry on amd64.Konstantin Belousov2020-07-191-3/+2
| | | | | | | | | | | | | Limit manipulations to use %rax as scratch to the pti portion of the syscall entry code. Submitted by: alc Reviewed by: markj MFC after: 1 week Differential revision: https://reviews.freebsd.org/D25722 Notes: svn path=/head/; revision=363329
* [if_an] unbreak!Adrian Chadd2020-07-191-1/+1
| | | | | | | | | .. I missed this when checking drivers. Differential Revision: https://reviews.freebsd.org/D25723 Notes: svn path=/head/; revision=363328
* [net80211] missing from last commit, le whoopsAdrian Chadd2020-07-191-2/+4
| | | | | | | Differential Revision:https://reviews.freebsd.org/D25630 Notes: svn path=/head/; revision=363327
* [net80211] Add new privileges; restrict what can be done in a jail.Adrian Chadd2020-07-193-7/+19
| | | | | | | | | | | | | | | | | | | | | | Split the MANAGE privilege into MANAGE, SETMAC and CREATE_VAP. + VAP_MANAGE is everything but setting the MAC and creating a VAP. + VAP_SETMAC is setting the MAC address of the VAP. Typically you wouldn't want the jail to be able to modify this. + CREATE_VAP is to create a new VAP. Again, you don't want to be doing this in a jail, but this DOES stop being able to run some corner cases like Dynamic WDS (DWDS) AP in a jail/vnet. We can figure this bit out later. This allows me to run wpa_supplicant in a jail after transferring a STA VAP into it. I unfortunately can't currently set the wlan debugging inside the jail; that would be super useful! Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D25630 Notes: svn path=/head/; revision=363325
* Add reference counts for inp/stcb/net when timers are running.Michael Tuexen2020-07-195-82/+153
| | | | | | | | | | | This avoids a use-after-free reported for the userland stack. Thanks to Taylor Brandstetter for suggesting a patch for the userland stack. MFC after: 1 week Notes: svn path=/head/; revision=363323
* Make linux(4) support the BLKPBSZGET ioctl. Oracle uses it.Edward Tomasz Napierala2020-07-192-3/+25
| | | | | | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25694 Notes: svn path=/head/; revision=363322
* Temporarly revert r363319 to unbreak the build.Alexander V. Chernikov2020-07-198-72/+148
| | | | | | | | Reported by: CI Pointy hat to: melifaro Notes: svn path=/head/; revision=363320
* Transition from rtrequest1_fib() to rib_action().Alexander V. Chernikov2020-07-198-148/+72
| | | | | | | | | | | | Remove all variations of rtrequest <rtrequest1_fib, rtrequest_fib, in6_rtrequest, rtrequest_fib> and their uses and switch to to rib_action(). This is part of the new routing KPI. Submitted by: Neel Chauhan <neel AT neelc DOT org> Differential Revision: https://reviews.freebsd.org/D25546 Notes: svn path=/head/; revision=363319
* amd64 pmap: microoptimize local shootdowns for PCID PTI configurationsKonstantin Belousov2020-07-187-110/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When pmap operates in PTI mode, we must reload %cr3 on return to userspace. In non-PCID mode the reload always flushes all non-global TLB entries and we take advantage of it by only invalidating the KPT TLB entries (there is no cached UPT entries at all). In PCID mode, we flush both KPT and UPT TLB explicitly, but we can take advantage of the fact that PCID mode command to reload %cr3 includes a flag to flush/not flush target TLB. In particular, we can avoid the flush for UPT, instead record that load of pc_ucr3 into %cr3 on return to usermode should be flushing. This is done by providing either all-1s or ~CR3_PCID_MASK in pc_ucr3_load_mask. The mask is automatically reset to all-1s on return to usermode. Similarly, we can avoid flushing UPT TLB on context switch, replacing it by setting pc_ucr3_load_mask. This unifies INVPCID and non-INVPCID PTI ifunc, leaving only 4 cases instead of 6. This trick is also applicable both to the TLB shootdown IPI handlers, since handlers interrupt the target thread. But then we need to check pc_curpmap in handlers, and this would reopen the same race for INVPCID machines as was fixed in r306350 for non-INVPCID. To not introduce the same bug, unconditionally do spinlock_enter() in pmap_activate(). Reviewed by: alc, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Differential revision: https://reviews.freebsd.org/D25483 Notes: svn path=/head/; revision=363311
* o Move iommu_test_boundary() to sys/iommu.hRuslan Bukin2020-07-186-26/+38
| | | | | | | | | | | | | o Rename DMAR -> IOMMU in comments o Add IOMMU_PAGE_SIZE / IOMMU_PAGE_MASK macroses o x86 only: dmar_quirks_pre_use() / dmar_instantiate_rmrr_ctxs() Reviewed by: kib Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D25665 Notes: svn path=/head/; revision=363310
* Remove code which is not needed.Michael Tuexen2020-07-181-3/+0
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=363309
* bridge: Don't sleep during epochKristof Provost2020-07-181-9/+9
| | | | | | | | | | | | While it doesn't trigger INVARIANTS or WITNESS on head it does in stable/12. There's also no reason for it, as we can easily report the out of memory error to the caller (i.e. userspace). All of these can already fail. PR: 248046 MFC after: 3 days Notes: svn path=/head/; revision=363308
* Make linux fallocate(2) return EOPNOTSUPP, not ENOSYS, on unsupported mode,Edward Tomasz Napierala2020-07-181-1/+1
| | | | | | | | | | as documented in the man page. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=363307
* Bump the default linux version from 3.2.0 to 3.10.0, which correspondsEdward Tomasz Napierala2020-07-181-1/+1
| | | | | | | | | | | | to RHEL 7. Required for DB2. Reviewed by: emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25656 Notes: svn path=/head/; revision=363306
* Regen after r363304.Edward Tomasz Napierala2020-07-1812-12/+160
| | | | | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=363305