summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2020-08-17Panic on an attempt to access user-space unless it is done usingMark Kettenis
an "unpriviliged" load/store instruction. This makes sure we catch PAN violations and might even catch some incorrect user-space access cases on systems without PAN. ok drahn@, jsg@
2020-08-17Fix typo in commentgnezdo
From Paul de Weerd
2020-08-16Remove sc_maxgpe from acpi_softc which was never read fromgnezdo
Remove a dead conditional from acpi_init_gpes while there. ok jcs@
2020-08-16Properly implement setting of the signal voltage.Mark Kettenis
2020-08-16Don't include scsi_debug.h via scsiconf.h. Nobody but scsi/* should be using theKenneth R Westerback
contents thereof. Compile tests by martjn@ (alpha), visa@ (sgi) jmatthew@ (sparc64) aoyama@ (luna88k)
2020-08-15The last SET()s of CDF_WAITING, SDF_WAITING, and ST_WAITING died in the greatKenneth R Westerback
XS_NO_CCB purge of 2017. Nuke pointless ISSET()/CLR() checks and the #define's.
2020-08-15Print ddr52 and hs200 indicators if those modes are supported.Mark Kettenis
ok stsp@
2020-08-15Remove unused headersVisa Hankala
2020-08-15Inline handling of receive checksum offloadVisa Hankala
2020-08-14Re-commit Exar XR17V35x serial port support previously backed out:Joshua Stein
The Exar XR17V354 has 4 ports that have a 256-byte FIFO, use a frequency of 125Mhz, and have a unique sleep register. A custom interrupt handler is setup in puc for these ports so it can check a register which reports which ports triggered the interrupt, rather than having to run comintr for every port every time. To avoid probing for these ports in com_attach_subr which requires access to registers that may be reserved on certain platforms, pass the sc_uarttype from com_puc_attach since the port type is already known based on the puc device vendor/id. Input from kettenis, tested in snaps
2020-08-14Remove "for all XXX platforms" from comment. Fixes the issue pointed outMark Kettenis
by miod@ where the powerpc64 claimed to be "for all AArch64 platforms". ok patrick@
2020-08-14Redistribute and tweak the scsi_[attach|probe|detach]_[bus|target|lun]() code toKenneth R Westerback
make the three variants more similar and easier to understand. Ensures consistent error checks and eliminates pointless adapter_buswidth checks when processing the list of scsi_links.
2020-08-14Implement tuning and enable HS200 mode. On my ODROID-N2 I see very poorMark Kettenis
performance at 200 MHz, so restrict the maximum frequency to 150 MHz for now. This also makes the eMMC on the ODROID-C4 work properly.
2020-08-14Add support for eMMC HS200 mode. Loosely based on code from NetBSD.Mark Kettenis
ok patrick@
2020-08-14Zap LOOPALIVECNTkn
Unused since r1.138 from 2015: "remove cisco hdlc code from sppp(4)". OK mpi
2020-08-14Fix typo.Mark Kettenis
Spotted by miod@
2020-08-14Initialize local variable that was supposed to hold the value of curcpu().Mark Kettenis
Spotted by miod@
2020-08-14When detaching common remote coverage, do not clear any fields. Instead,anton
let kr_free() do the work. Otherwise a thread currently inside a remote section could end up not decrementing the number of ongoing sections while exiting the same remote section. Reported-by: syzbot+1252e696865efc29b767@syzkaller.appspotmail.com
2020-08-14Set `IFXF_MPSAFE' bit to pppx(4) related `ifnet'. This moves pppx(4)mvs
packets output out of KERNEL_LOCK. pppx(4) and pipex(4) are ready to this. ok yasuoka@ mpi@
2020-08-13Give SCSIBUS_B probing a chance to work with better logic inKenneth R Westerback
SCSI_IS_SCSIBUS_B(). i.e. return true when 'A' is finished probing (sc_child != NULL) and the sc_link->bus is != sc_child.
2020-08-13Always set `dtpr_size' to the total size required to hold all probe entries.Martin Pieuchot
2020-08-13qlw_xs_bus() must return 0 while bus 0 is being probed.Kenneth R Westerback
Found the hard way by martijn@ on his alpha.
2020-08-13Add __multi3 from compiler_rt-8.xJeremie Courreges-Anglas
Needed to build a sparc64 kernel with clang 10. ok kettenis@
2020-08-13Move compiler_rt type definitions to a separate headerJeremie Courreges-Anglas
so that we can reuse them in other compiler_rt routines. ok kettenis@
2020-08-13Add a ROUTE_FLAGFILTER socket option for routing sockets, allowingJonathan Matthew
filtering out messages for routes with flags matching any bit in a mask. This allows routing daemons to opt out of receiving messages for L2 and broadcast route entries, which they currently discard. ok dlg@ sthen@ deraadt@
2020-08-13Use rtm_miss() rather than the simpler rtm_send() to send route deleteJonathan Matthew
messages, and save the route flags before deleting the route. For L2 route entries, the RTF_LLINFO flag is cleared during deletion, so saving the flags beforehand means they're correct in the routing socket message. ok mpi@
2020-08-12getitimer(2): delay TIMESPEC_TO_TIMEVAL(9) conversion until copyout(9)cheloha
setitimer(2) works with timespecs in its critical section. It will be easier to merge the two critical sections if getitimer(2) also works with timespecs. In particular, we currently read the uptime clock *twice* during a setitimer(2) swap: we call getmicrouptime(9) in sys_getitimer() and then call getnanouptime(9) in sys_setitimer(). This means that swapping one timer in for another is not atomic with respect to the uptime clock. It also means the two operations are working with different time structures and resolutions, which is potentially confusing. If both critical sections work with timespecs we can combine the two getnanouptime(9) calls into a single call at the start of the combined critical section in a future patch, making the swap atomic with respect to the clock. So, in preparation, move the TIMESPEC_TO_TIMEVAL conversions in getitimer(2) after the ITIMER_REAL conversion from absolute to relative time, just before copyout(9). The ITIMER_REAL conversion must then be done with timespec macros and getnanouptime(9), just like in setitimer(2).
2020-08-12setitimer(2): ITIMER_REAL: don't call timeout_del(9) before timeout_add(9)cheloha
If we're replacing the current ITIMER_REAL timer with a new one we don't need to call timeout_del(9) before calling timeout_add(9). timeout_add(9) does the work of timeout_del(9) implicitly if the timeout in question is already pending. This saves us an extra trip through the timeout_mutex.
2020-08-12Reduce stack usage of kqueue_scan()Visa Hankala
Reuse the kev[] array of sys_kevent() in kqueue_scan() to lower stack usage. The code has reset kevp, but not nkev, whenever the retry branch is taken. However, the resetting is unnecessary because retry should be taken only if no events have been collected. Make this clearer by adding KASSERTs. OK mpi@
2020-08-12Remove interface statistics update for outgoing packets. We shouldn'tmvs
count them because `if_snd' does this. ok yasuoka@
2020-08-12skip trying to read disabled bios on RV610Jonathan Gray
Reading the disabled bios on two Dell machines with RV610 passes initial checks but later fails atombios specific checks. This occurs when running amd64 but not i386. Returning early when reading the disabled bios will result in calling radeon_read_platform_bios() and using the bios at 0xc0000 which works for both systems this was reported for semarie@ on Dell OptiPlex 755 RV610 0x1002:0x94C3 0x1028:0x0402 0x00 Andy Bradford on Dell DXP051 RV610 0x1002:0x94C1 0x1028:0x0D02 0x00
2020-08-12drm/drm_fb_helper: fix fbdev with sparc64Jonathan Gray
From Sam Ravnborg cea0a7943a30a6d0320c8558a844dd27e8f0aa8b in linux 5.7.y/5.7.15 2a1658bf922ffd9b7907e270a7d9cdc9643fc45d in mainline linux
2020-08-11Run start routing without KERNEL_LOCK()kn
pfsyncstart() does not require the big lock, make it use the ifq API. OK mvs
2020-08-11setitimer(2): write new timer value in one placecheloha
Rearrange the critical section in setitimer(2) to match that of getitimer(2). This will make it easier to merge the two critical sections in a subsequent diff. In particular, we want to write the new timer value in *one* place in the code, regardless of which timer we're setting. ok millert@
2020-08-11setitimer(2): consolidate copyin(9), input validation, input conversioncheloha
For what are probably historical reasons, setitimer(2) does not validate its input (itv) immediately after copyin(9). Instead, it waits until after (possibly) performing a getitimer(2) to copy out the state of the timer. Consolidating copyin(9), input validation, and input conversion into a single block before the getitimer(2) operation makes setitimer(2) itself easier to read. It will also simplify merging the critical sections of setitimer(2) and getitimer(2) in a subsequent patch. This changes setitimer(2)'s behavior in the EINVAL case. Currently, if your input (itv) is invalid, we return EINVAL *after* modifying the output (olditv). With the patch we will now return EINVAL *before* modifying the output. However, any code dependent upon this behavior is broken: the contents of olditv are undefined in all setitimer(2) error cases. ok millert@
2020-08-11getitimer(2): don't enter itimer_mtx to read ITIMER_REAL itimerspeccheloha
The ITIMER_REAL per-process interval timer is protected by the kernel lock. The ITIMER_REAL timeout (ps_realit_to), setitimer(2), and getitimer(2) all run under the kernel lock. Entering itimer_mtx during getitimer(2) when reading the ITIMER_REAL ps_timer state is superfluous and misleading.
2020-08-11Explicitly #include <scsi/scsi_debug.h> rather than assuming scsiconf.h will doKenneth R Westerback
it. Prepares for removal of #include <scsi/scsi_debug.h> from scsiconf.h as soon as the alpha tester digs out from hurricane to compile last untested files.
2020-08-11struct process: annotate locking for getitimer(2), setitimer(2)cheloha
The ITIMER_REAL itimerspec (ps_timer[0]) and timeout (ps_realit_to) are protected by the kernel lock. Annotate them with "K". The ITIMER_VIRTUAL and ITIMER_PROF itimerspecs (ps_timer[1], ps_timer[2]) are protected by itimer_mtx. Annotate them with "T", for "timer". With input from kettenis@ and anton@. ok kettenis@, anton@
2020-08-10Get Elantech v1 touchpad with fw version 0x20022 working.Marcus Glocker
From sxvghd (at) firemail (dot) cc, on tech@
2020-08-10Do not block IPIs when acquiring the rendezvous mutex. Otherwise theVisa Hankala
system would deadlock when a CPU gets blocked by the mutex while another CPU is waiting for the first CPU to finish a rendezvous request. This possibly fixes some hangs on sgi. There should be no effect on loongson and octeon because their interrupt code is sloppy with masking of IPIs. While here, rename the rendezvous mutex to better reflect its use.
2020-08-10Minor code shuffle to get all *_activate(), *_probe() and *_detach() functionsKenneth R Westerback
nestled together. Rename scsibusprint() to scsibussubprint() since it is used with scsibussubmatch().
2020-08-10Set `IFXF_MPSAFE' bit to pppac(4) related `ifnet'. This moves pppac(4)mvs
packets output out of KERNEL_LOCK. pppac(4) and pipex(4) are ready to this. ok yasuoka@
2020-08-10remove #if 0'd ufs2 magic error which predates ffs2 supportJonathan Gray
ok kn@
2020-08-10use EROFS when attempting to mount a 4.2BSD fs without MNT_RDONLYJonathan Gray
This is the documented behaviour which was changed by pedro in rev 1.81 which was partially backed out in rev 1.82.
2020-08-10consistently return EINVAL on invalid BPBJonathan Gray
reverts changes from msdosfs_vfsops.c rev 1.7 Prompted by a patch from John Carmack to add an an error path when exFAT is detected on mount to give a more helpful error message. Returning EINVAL in the existing sanity checks will make mount_msdos(8) print "not an MSDOS filesystem" when attempting to mount exFAT and matches historic and documented behaviour. ok kn@
2020-08-10Remove the acpicpu_sc array and instead locate acpicpu instances usingJonathan Matthew
the ci_acpicpudev pointer in struct cpu_info. This simplifies matters when we have lots of cpus. ok kettenis@
2020-08-09hardclock(9): fix race with setitimer(2) for ITIMER_VIRTUAL, ITIMER_PROFcheloha
The ITIMER_VIRTUAL and ITIMER_PROF per-process interval timers are updated from hardclock(9). If a timer for the parent process is enabled the hardclock(9) thread calls itimerdecr() to update and reload it as needed. However, in itimerdecr(), after entering itimer_mtx, the thread needs to double-check that the timer in question is still enabled. While the hardclock(9) thread is entering itimer_mtx a thread in setitimer(2) can take the mutex and disable the timer. If the timer is disabled, itimerdecr() should return 1 to indicate that the timer has not expired and that no action needs to be taken. ok kettenis@
2020-08-09More code shuffling. Fix a rename missed in previous.Kenneth R Westerback
2020-08-09vether(4) is pretty dummy. It contains nothing requires to be protected.mvs
So set `IFXF_MPSAFE' bit. This allows to discard outgoing packets without kernel lock. ok kn@
2020-08-09Shuffle functions and declarations around to more logical grouping. Nuke someKenneth R Westerback
leading whitespace. Rename some local functions.