summaryrefslogtreecommitdiffstats
path: root/sys (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Use per-CPU counters for fault and stats counters reached in uvm_fault().mpi2020-12-286-57/+149
| | | | ok kettenis@, dlg@
* Add support for the PCIe controller found on Amlogic G12A/G12B/SM1 SoCs.kettenis2020-12-281-11/+119
| | | | ok patrick@
* regenkettenis2020-12-282-2/+14
|
* Add Synopsys vendor and their DesignWare PCIe bridge.kettenis2020-12-281-1/+5
|
* acpi_map_address() cannot be wrapped by SMALL_KERNEL anymore, asderaadt2020-12-271-3/+3
| | | | it is used by acpihpet.c
* Enable acpihpet on install media, because otherwise clock initializationderaadt2020-12-274-8/+8
| | | | | is just too different from GENERIC or GENERIC.MP pointed out by jsg
* Remove debug printf.kettenis2020-12-271-2/+1
|
* Add PCIe support.kettenis2020-12-271-48/+68
|
* Add PCIe power domain.kettenis2020-12-271-1/+14
|
* Make NET_LOCK() assertions conditional to DIAGNOSTICvisa2020-12-271-1/+8
| | | | | | This saves about 2.5 KiB off amd64's RAMDISK after gzip compression. OK deraadt@, mpi@, cheloha@
* have mcx_process_txeof return the number of slots it processed.dlg2020-12-271-7/+8
| | | | | | | it used a pointer in an argument to communicate that back to the caller, while being a void functon. this seems more natural and brings it in line with how the rx completion function returns free slots to its caller too.
* do a bus space barrier after arming the eq.dlg2020-12-271-2/+2
| | | | ok jmatthew@
* disable timestamping a little bit harder to avoid divide by 0.dlg2020-12-271-1/+5
| | | | | hrvoje popovski reports the current code faults on some boxes. i'm working on it, but the code isn't being used right now.
* shuffle filling the rx ring so the sw prod is updated before the hw.dlg2020-12-271-24/+19
| | | | ok jmatthew@
* bpf(4): bpf_d struct: replace bd_rdStart member with bd_nreaders membercheloha2020-12-262-35/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bd_rdStart is strange. It nominally represents the start of a read(2) on a given bpf(4) descriptor, but there are several problems with it: 1. If there are multiple readers, the bd_rdStart is not set by subsequent readers, so their timeout is screwed up. The read timeout should really be tracked on a per-thread basis in bpfread(). 2. We set bd_rdStart for poll(2), select(2), and kevent(2), even though that makes no sense. We should not be setting bd_rdStart in bpfpoll() or bpfkqfilter(). 3. bd_rdStart is buggy. If ticks is 0 when the read starts then bpf_catchpacket() won't wake up the reader. This is a problem inherent to the design of bd_rdStart: it serves as both a boolean and a scalar value, even though 0 is a valid value in the scalar range. So let's replace it with a better struct member. "bd_nreaders" is a count of threads sleeping in bpfread(). It is incremented before a thread goes to sleep in bpfread() and decremented when a thread wakes up. If bd_nreaders is greater than zero when we reach bpf_catchpacket() and fbuf is non-NULL we wake up all readers. The read timeout, if any, is now tracked locally by the thread in bpfread(). Unlike bd_rdStart, bpfpoll() and bpfkqfilter() don't touch bd_nreaders. Prompted by mpi@. Basic idea from dlg@. Lots of input from dlg@. Tested by dlg@ with tcpdump(8) (blocking read) and flow-collector (https://github.com/eait-itig/flow-collector, non-blocking read). ok dlg@
* Simplify parameters of pselregister().visa2020-12-261-8/+5
| | | | OK mpi@
* reuse the calculated vector as the argument to pci_intr_map_msix.dlg2020-12-261-2/+2
| | | | doing the maths again feels error prone.
* add bus_dmamap_sync ops around the eq.dlg2020-12-261-6/+27
| | | | ok jmatthew@
* add some bus_dmamap_syncs around the rq.dlg2020-12-261-2/+16
| | | | ok jmatthew@
* sprinkle some bus_dmamap_syncs around the cq handling.dlg2020-12-261-1/+14
| | | | ok jmatthew@
* sprinkle some bus_dmamap_syncs around the sq.dlg2020-12-261-2/+17
| | | | ok jmatthew@
* better manage the lifetime of the dmamem used for various rings.dlg2020-12-261-36/+65
| | | | ok jmatthew@
* sdmmc(4): sdmmc_io_function_enable(): don't sleep on lboltcheloha2020-12-261-2/+2
| | | | | | | | Just sleep for 1 second on the nowake channel instead. With input from kettenis@, mpi@, and claudio@. ok kettenis@
* expose the mcx timer as a timecounter.dlg2020-12-251-1/+30
| | | | | | | | | | this is mostly to help me better understand where i accumulate error when trying to sync the chip to the kernel clocks. ie, if im using mcx as the kernel clock source and my attempts to sync to it still produce errors, then my code is very wrong instead of slightly wrong. it's also fun and a tiny amount of code.
* match on Gemini Lake I2Cjsg2020-12-251-1/+9
| | | | | Makes touchpad work on Joel Carnat's Teclast F7 Plus laptop. Patch from James Hastings.
* Refactor klist insertion and removalvisa2020-12-2535-122/+144
| | | | | | | | | | | | Rename klist_{insert,remove}() to klist_{insert,remove}_locked(). These functions assume that the caller has locked the klist. The current state of locking remains intact because the kernel lock is still used with all klists. Add new functions klist_insert() and klist_remove() that lock the klist internally. This allows some code simplification. OK mpi@
* Small smr_grace_wait() optimizationvisa2020-12-252-7/+28
| | | | | | | | | | | | Make the SMR thread maintain an explicit system-wide grace period and make CPUs observe the current grace period when crossing a quiescent state. This lets the SMR thread avoid a forced context switch for CPUs that have already entered the latest grace period. This change provides a small improvement in smr_grace_wait()'s performance in terms of context switching. OK mpi@, anton@
* Do proper accounting of zero length TDs. Currently a specific numbermglocker2020-12-242-2/+6
| | | | | | | | | | | | of zero length TDs can cause our free TRBs to run out, causing xhci(4) to return USBD_NOMEM to the USB stack. The issue was reported by Jonathon Fletcher <jonathon.fletcher () gmail ! com> -- Thanks! Reviewed/suggestions by patrick@. ok mpi@
* Extract clock frequency from _DSD properties.patrick2020-12-241-1/+3
| | | | ok kettenis@
* Implement capability register overrides based on _DSD properties.kettenis2020-12-241-2/+11
| | | | ok patrick@
* regenjsg2020-12-242-4/+76
|
* add some NVMe devices and Intel Comet Lake host bridgesjsg2020-12-241-2/+18
|
* Initialize mips64 pmap pool using IPL_VM.visa2020-12-241-2/+2
| | | | | This moves the pmap closer to MP-safety. A similar change has already been made on some other architectures.
* ramdisks do not contain WOLderaadt2020-12-241-1/+3
|
* handle reported core clock frequency of 0 on newer Intel Comet Lakejsg2020-12-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | The 'nominal core crystal clock frequency' from cpuid 0x15 is 0 on Intel model 0xa5 (CML-H CML-S62 CML-S102) and 0xa6 (CML-U62). So act as if 24 MHz was reported like we do on other Skylake/Kaby Lake variants. Comet Lake processors with model 0x8e (CML-U42 CML-Y42) use the same model number used by Kaby Lake and many other parts which was already handled. While we could approximate the crystal frequency with 'Processor Base Frequency' from cpuid 0x16 eax like FreeBSD and Linux do, kettenis@ couldn't get ntpd to sync a clock on a Skylake machine with: CPUID 0x15: eax=2, ebx=134, khz=0 CPUID 0x16: eax=1600, ebx=1600, ecx=100, edx=0 with reported crystal frequency changing from 24000 kHz to 23880 kHz (cpuid 0x16 eax * 1000 * cpuid 0x15 eax / cpuid 0x15 ebx) and TSC frequency changing from 1608000000 to 1599960000. Cannon Lake, Ice Lake, and Tiger Lake are known to return non-zero frequency in cpuid 0x15 so hopefully no other model ids have to be added. James Cook reported hangs on bsd.rd with i7-10710U 06-a6-00 (CML-U62) (which does not have acpihpet) but not with bsd.mp (which does) and has confirmed that both approaches fixed the problem.
* tsleep(9): add global "nowake" channel for threads avoiding wakeup(9)cheloha2020-12-242-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It would be convenient if there were a channel a thread could sleep on to indicate they do not want any wakeup(9) broadcasts. The easiest way to do this is to add an "int nowake" to kern_synch.c and extern it in sys/systm.h. You use it like this: #include <sys/systm.h> tsleep_nsec(&nowait, ...); There is now no need to handroll a local dead channel, e.g. int chan; tsleep_nsec(&chan, ...); which expands the stack. Local dead channels will be replaced with &nowake in later patches. One possible problem with this "one global channel" approach is sleep queue congestion. If you have lots of threads sleeping on &nowake you might slow down a wakeup(9) on a different channel that hashes into the same queue. Unsure how much of problem this actually is, if at all. NetBSD and FreeBSD have a "pause" interface in the kernel that chooses a suitable channel automatically. To keep things simple and avoid adding a new interface we will start with this global channel. Discussed with mpi@, claudio@, kettenis@, and deraadt@. Basically designed by kettenis@, who vetoed my other proposals. Bugs caught by deraadt@, tb@, and patrick@.
* Add Wake on LAN support to rge(4).kevlo2020-12-242-3/+86
| | | | Tested by otto@ and myself.
* sigsuspend(2): change wmesg from "pause" to "sigsusp"cheloha2020-12-231-2/+2
| | | | | | | | Make it obvious where the thread is blocked. "pause" is ambiguous. Tweaked by kettenis@. Probably ok kettenis@.
* nanosleep(2): shorten wmesg from "nanosleep" to "nanoslp"cheloha2020-12-231-2/+2
| | | | | | | We only see 8 characters of wmesg in e.g. top(1), so shorten the string to fit. Indirectly prompted by kettenis@.
* Use IPL_VM for the pmap pool like we do on amd64.kettenis2020-12-231-2/+2
|
* Ensure that filt_dead() takes effectvisa2020-12-231-1/+2
| | | | | | | | Invoke dead_filtops' f_event callback in klist_invalidate() to ensure that filt_dead() modifies every invalidated knote. If a knote has EV_ONESHOT set in its event flags, kqueue_scan() will not call f_event. OK mpi@
* Clear error before each iteration in kqueue_scan()visa2020-12-231-1/+3
| | | | | | | This fixes a regression where kqueue_scan() may incorrectly return EWOULDBLOCK after a timeout. OK mpi@
* Fix regulators that use "active-low" polarity. Our implementation nowkettenis2020-12-231-9/+16
| | | | | | | | | ignores the presence "enable-active-high" property and relies on the encode polarity of the GPIO in the flags in the device tree instead. This might not be the case for older device trees; such device trees should be fixed. ok patrick@
* Handle a few more userland traps that would lead to a kernel panic.kettenis2020-12-231-2/+19
|
* have the ifrxr info stuff report the buffer size the hw handles.dlg2020-12-221-2/+2
| | | | this makes it more consistent with other drivers.
* Use SIGILL for the Facility Unavailable Interrupt in usermode.gkoehler2020-12-221-1/+6
| | | | ok kettenis@
* Add PCIe clocks.kettenis2020-12-221-1/+5
|
* For a while the kerrnel reports EACCES to userland if pf blocks abluhm2020-12-221-3/+3
| | | | | | packet. IPv6 still had the old EHOSTUNREACH code. Use the same errno for dropped IPv6 packets as in IPv4. OK kn@ phessler@ claudio@ florian@ sashan@
* Implement select(2) and pselect(2) on top of kqueue.mpi2020-12-221-55/+148
| | | | | | | | | | | | | | | | The given set of fds are converted to equivalent kevents using EV_SET(2) and passed to the scanning internals of kevent(2): kqueue_scan(). ktrace(1) will now output the converted kevents on top of the usuals set bits to be able to find possible error in the convertion. This switch implies that select(2) and pselect(2) will now query the underlying kqfilters instead of the *_poll() routines. Based on similar work done on DragonFlyBSD with inputs from from visa@, millert@, anton@, cheloha@, thanks! ok visa@
* Defer hardware initialization in order to give things like PCIe PHYskettenis2020-12-221-15/+31
| | | | | | a chance to attach. Needed for future support of PCIe on Amlogic SoCs. ok patrick@