summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2022-08-10Remove alpha kernel code to process userland misaligned accesses, and theMiod Vallat
machdep.unaligned_* sysctl to control its behaviour. Such code made sense more than 20 years ago where a lot of code was not 64-bit clean, but this is no longer the case those days. ok jsg@ millert@ deraadt@
2022-08-10Remove netlock assertion from vlan_ioctl(). Now (*if_ioctl)() calledVitaliy Makkoveev
without netlock for SIOC{G,S}IFMEDIA commands. ok bluhm@
2022-08-10match other archs use %s for version printfJonathan Gray
2022-08-09Backout "Call getuptime() just once per function"Klemens Nanni
This caused stuck ndp cache entries as found by naddy, sorry.
2022-08-09Sync inflateGetHeader() fix from userlandTheo Buehler
2022-08-09riscv64: trigger deferred timer interrupts from splx(9)Scott Soule Cheloha
In order to move riscv64 to a machine-independent clock interrupt subsystem, the riscv64 clock interrupt code needs to function without any specific knowledge of the clock interrupt schedule. The easiest way to achieve this (as we just did with powerpc and powerpc64) is, if the timer interrupt fires while the CPU is at or above IPL_CLOCK, defer clock interrupt work until the the timer interrupt is logically unmasked in splx(9). In particular, trigger the timer interrupt from plic_setipl() so the interrupt, if any, is pending before we handle soft interrupts. Because we're no longer deferring work until the next tick, we don't need to count pending statclock ticks in struct cpu_info. kettenis@ notes that the timer triggering code should be refactored into more generic code when we add support for a non-plic(4) riscv64 machine. Graciously fixed, compiled, and tested by jca@. Link: https://marc.info/?l=openbsd-tech&m=165931635410276&w=2 ok kettenis@
2022-08-09powerpc64: trigger deferred DEC interrupts from splx(9)Scott Soule Cheloha
In order to move to a machine-independent clock interrupt subsystem, the powerpc64 clock interrupt code needs to work without knowing anything about the clock interrupt schedule. The easiest way to do this is, if the DEC fires while the CPU's IPL is at or above IPL_CLOCK, to postpone clock interrupt work until the clock interrupt is logically unmasked from splx(9). Because we no longer defer work until the next tick, we don't need to keep track of pending statclock ticks in the cpu_info struct. With input from kettenis@. Graciously compiled and tested by gkoehler@ and kettenis@. Link: https://marc.info/?l=openbsd-tech&m=165862522102767&w=2 ok kettenis@ gkoehler@.
2022-08-08If interface drivers had enabled transmit offloading of the payloadAlexander Bluhm
checksum, IPv6 fragments contained invalid checksum. For fragments the protocol checksum has to be calculated before fragmentation. Hardware cannot do this as it is too late. Do it earlier in software. tested and OK mbuhl@
2022-08-08Constify in6_addr pointer arguments in nd6_*() functionsKlemens Nanni
All of them are passed to inspect/copy out fields, none of the functions writes to the struct. This makes it easier to argue about code (in MP context). OK bluhm
2022-08-08Call getuptime() just once per functionKlemens Nanni
IPv6 pendant to bluhm's sys/netinet/if_ether.c r1.249: Instead of calling getuptime() all the time in ARP code, do it only once per function. This gives a more consistent time value. OK claudio@ miod@ mvs@ OK bluhm
2022-08-08remove unused arm and armv7 headersJonathan Gray
ok miod@
2022-08-08remove mouse.h last used by pre-wscons driversJonathan Gray
ok miod@ millert@
2022-08-08To make protocol input functions MP safe, internet PCB need protection.Alexander Bluhm
Use their reference counter in more places. The in_pcb lookup functions hold the PCBs in hash tables protected by table->inpt_mtx mutex. Whenever a result is returned, increment the ref count before releasing the mutex. Then the inp can be used as long as neccessary. Unref it at the end of all functions that call in_pcb lookup. As a shortcut, pf may also hold a reference to the PCB. When pf_inp_lookup() returns it, it also incements the ref count and the caller can handle it like the inp from table lookup. OK sashan@
2022-08-08Change branch condition inverted to realize original intention inKenji Aoyama
comment. Found by Tetsuya Isaki at NetBSD and nono project, during investigating work-in-progress NetBSD/luna88k. It originally comes from Mach luna88k port, more than 30 years ago:-) Tested by me, "That's much better!" miod@
2022-08-08Before ypconnect(2) addition, "getpw" was a horrible "hole" that triggeredTheo de Raadt
on libc trying to open /var/run/ypbind.lock, so pledge had to BYPASSUNVEIL accesses to this file. We accepted the opening of that file for a small period for build cross-over, but that waiting period ends now.
2022-08-07Start to add annotations to the cpu_info members, doing I/a/o forPhilip Guenther
immutable/atomic/owned ala <sys/proc.h>. Move CPUF_USERSEGS and CPUF_USERXSTATE, which really are private to the CPU, into a new ci_pflags and rename s/CPUF_/CPUPF_/. Make all (remaining) ci_flags alterations via atomic_{set,clear}bits_int(), so its annotation isn't a lie. Delete ci_info member as unused all the way from rev 1.1 ok jsg@ mlarkin@
2022-08-07Use PMAP_PREFER_ALIGN() == 0 rather than !defined(PMAP_PREFER) to enable theMiod Vallat
fast path in the pager code; this benefits most mips64 platforms. ok kettenis@ mpi@
2022-08-07Move fallback PMAP_PREFER definitions from uvm_map.c to uvm_pmap.h for themMiod Vallat
to be available to other files. NFC ok kettenis@ mpi@
2022-08-07Fix fallout from netlock removal in media ioctl. The bridge doesAlexander Bluhm
not support media parameter, so just skip these ioctls. Do not release a netlock that was not taken. panic found and fix tested by Michael Graves; OK mvs@
2022-08-06Clean up the netlock macros. Merge NET_RLOCK_IN_SOFTNET andAlexander Bluhm
NET_RLOCK_IN_IOCTL, which have the same implementation. The R and W are hard to see, call the new macro NET_LOCK_SHARED. Rename the opposite assertion from NET_ASSERT_WLOCKED to NET_ASSERT_LOCKED_EXCLUSIVE. Update some outdated comments about net locking. OK mpi@ mvs@
2022-08-06Refactor readdoslabel() into a more readable form using variousKenneth R Westerback
helper functions. The refactored code ensures disklabels are read from/written to disk only from/to unused space or an OpenBSD partition. This prevents accidental damage to filesystems that start immediately following an MBR or GPT. The refactored code also finds the disklabel present on the i386/amd64 floppyXX.img, rather than spoofing the media as a single MSDOS partition. Tweak and positive comments from jmatthew@
2022-08-06blist: use swblk_t type (defined in sys/blist.h)Sebastien Marie
reduce the diff with DragonFlyBSD by using swblk_t and u_swblk_t types. while here, move bitmap type (u_swblk_t) to u_int64_t on all archs. it makes the regress the same on 64 and 32bits archs (and it success on both). ok mpi@
2022-08-06remove swblk_t type from sys/types.hSebastien Marie
- it is currently unused (except in some regress) - it is non-standard - it shouldn't have been visible in first place ok jca@ mpi@ todd@ deraadt@
2022-08-06Fix backpointer.Mark Kettenis
ok jsg@
2022-08-06Prevent buffer overflow in OF_getpropintarray().Mark Kettenis
ok jsg@
2022-08-05Fix bounds check in ucc_add_key(); ok anton@Miod Vallat
2022-08-05The netlock for SIOCSIFMEDIA and SIOCGIFMEDIA ioctl is not necessary.Alexander Bluhm
Legacy drivers run with kernel lock, interface media is MP safe or has kernel lock. Assert kernel lock in ix(4) and ixl(4). OK kettenis@
2022-08-05Skip disabled nodes.Mark Kettenis
2022-08-05put ci_mutex_level inside DIAGNOSTICRobert Nagy
2022-08-04Use 16 bit variable to store more fragment flag. This avoids lossAlexander Bluhm
of significant bits on big endian machines. Bug has been introduced in previous commit by removing the =! 0 check. OK mvs@
2022-08-04Default to softraid on boot-device iff foundKlemens Nanni
root on softraid on sparc64 currently requires explicitly passing the volume name as part of the boot arguments, e.g. boot-file=sr0 boot-file=sr0a:/bsd or {ok} boot my-devalias sr0: (ofwboot always probes for softraid devices, assembles them but continues to ignore such volumes unless specified.) This is inconsistent with softraid support on other platforms and has further drawbacks when it comes to sysupgrade logic. Unless an explicit root disk was given, make ofwboot default to the softraid volume on the boot device to make root on softraid work out of the box without having to set variables or pass arguments in OpenBoot. Eventually, ofwboot's disk discovery and softraid assembly machinery will be fixed and boot-file won't be misused for softraid purposes anymore. Remove the quirky softraid paragraph from boot_sparc64(8) now that it is purely optional, expecting users from now on to either leave boot-file empty or pass a kernel filename alone. Tested on T4-2 guest domains with and without root on softraid. Feedback claudio kettenis stsp OK kettenis (previous diff) OK stsp
2022-08-03Add aplaudio(4) and aplmca(4). The aplmca(4) driver controls the hardwareMark Kettenis
block that takes data from apldma(4), serializes it and sends it out on the i2s ports. The aplaudio(4) driver ties together aplmca(4) and various codecs to present an audio(4) interface to the system. This is still WIP, but good enough to play back audio on the speaker in the M1 mini. ok patrick@
2022-08-03Clear active state when we attach.Mark Kettenis
ok patrick@
2022-08-03Bug was reported by Chriss Cappucio. It has turned out my earlier changeAlexandr Nedvedicky
to pf_lb.c was not complete. We must add a test to determine number of addresses defined by pool, so we don't treat pool definition 172.16.0.0/16 as a single IP address in pool. If pool is defined as 172.16.0.0/16, then we don't want to fall back to PF_POOL_NONE. Missing this measure in pf_map_addr() may cause pf_get_sport() to enter infinite loop when source ports translation become depleted for the first address found in pool (like 172.16.0.1), because the bug prevents pf_map_addr() to move to next address in pool (like 172.16.0.2). while investigating issue I've also noticed an oddity for small random pools such as 192.168.1.32/28. One would expect the addresses for nat will be randomly picked from range .32 - .47 in this case. however the random selection yield significantly more (like 20%) addresses ending by .32 In order to fix it we make random pool to use arc4random_uniform(~mask + 1) instead of current arc4random(). feedback by claudio@ tested by hrvoje@
2022-08-03recognise IDT 92HD95/92HD95B now sold as TSI 92HD95BJonathan Gray
https://frame.work/blog/solving-for-silicon-shortages
2022-08-03drm/i915/adlp: Fix register corruption after DDI clock enablingJonathan Gray
From Imre Deak 59207e63801fbcd39ca68df6e2ba5ae90f76c0c3 in mainline linux
2022-08-02Correctly detect xmem operations faulting on missing pages on 88110.Miod Vallat
These must be handled as write faults rather than read faults, since xmem performs both a read and a write, and unlike on 88100, we don't have an easy bit to check. This solves libcrypto spinning on its locks on 88110.
2022-08-02Bring back the direct map optimization when PMAP_PREFER isn't defined.Martin Pieuchot
PMAP_PREFER is checked to prevent cache aliasing issues when the physical page is mapped at different virtual addresses. This speeds up file-based mmap faults. ok kettenis@
2022-08-02some ports bootstraps, and go internals, need a bit more time to adaptTheo de Raadt
to the padded syscalls going away.
2022-08-02match on Intel 600 Series LPJonathan Gray
2022-08-02regenJonathan Gray
2022-08-02add more Intel Alder Lake / 600 Series LP idsJonathan Gray
from: 12th Generation Intel Core Processors Datasheet, Volume 1 of 2, Doc. No.: 655258, Rev.: 008 Intel 600 Series Chipset Family On-Package Platform Controller Hub Datasheet, Volume 1 of 2, Doc. No.: 691222, Rev.: 002 and SanDisk SN850 while here
2022-08-01Allocate memory for collection translation tables for hardware that needsMark Kettenis
it. ok patrick@
2022-08-01Fix bogus indent. NFCMiod Vallat
2022-08-01drm/amd/display: Fix wrong format specifier in amdgpu_dm.cJonathan Gray
From Hayden Goodfellow c6e4817ab622f526d6afe9e02c6d85b177b3e846 in linux 5.15.y/5.15.58 655c167edc8c260b6df08bdcfaca8afde0efbeb6 in mainline linux
2022-08-01drm/amdgpu: Off by one in dm_dmub_outbox1_low_irq()Jonathan Gray
From Dan Carpenter ec9ec3bc08b18c5b1b2feafd306ea7c348013898 in linux 5.15.y/5.15.58 a35faec3db0e13aac8ea720bc1a3503081dd5a3d in mainline linux
2022-08-01drm/amd/display: invalid parameter check in dmub_hpd_callbackJonathan Gray
From Jose Exposito f85a6046f7718f11c6ad015a0ba25d897194b1ac in linux 5.15.y/5.15.58 978ffac878fd64039f95798b15b430032d2d89d5 in mainline linux
2022-08-01drm/amd/display: Don't lock connection_mutex for DMUB HPDJonathan Gray
From Nicholas Kazlauskas 760fe32034931a8c97c773edef2f1b7c7346f43a in linux 5.15.y/5.15.58 d82b3266ef88dc10fe0e7031b2bd8ba7eedb7e59 in mainline linux
2022-08-01drm/amd/display: Fix surface optimization regression on CarrizoJonathan Gray
From Nicholas Kazlauskas c2b484d784c8dfc3eb62fd4f9ff11515b6e78e19 in linux 5.15.y/5.15.58 62e5a7e2333a9f5395f6a9db766b7b06c949fe7a in mainline linux
2022-08-01drm/amd/display: Optimize bandwidth on following fast updateJonathan Gray
From Nicholas Kazlauskas 9581511948582a0ed8da03fb91d2ab658087283d in linux 5.15.y/5.15.58 34316c1e561db0b24e341029f04a5a5bead9a7bc in mainline linux