summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2022-12-27Ansify pxe_netif_close() and {,pxe}socktodesc()Jeremie Courreges-Anglas
To appease the clang 15 warning -Wdeprecated-non-prototype (turned on by -Wall). ok millert@
2022-12-27Fix array bounds mismatch with clang 15Jeremie Courreges-Anglas
New warning -Warray-parameter is a bit overzealous. ok millert@
2022-12-26vmd(8): provide a detailed e820 memory map.Dave Voutila
When booting guests with SeaBIOS, vmd(8) supplied details about the available guest memory via CMOS registers. Consequently, we've been carrying some patches in the ports tree to SeaBIOS to fetch this information like it's the 1990s. When a vm initializes memory ranges, we now track what each range represents. This information can be used to supply the e820 memory map to SeaBIOS via the fw_cfg interface allowing it to properly communicate memory ranges to a guest operating system. (This will also allow us to drop some patches from the port.) Given the ranges can now be marked with a purpose, this also allows vmm(4) to switch from hard-coded mmio ranges and instead let the information on the memory range dictate if vmm should be handling a page fault or sending to vmd for a memory assist. Tested by Mischa Peters and others. OK mlarkin@.
2022-12-26Replace two (void)copystr(..., NULL) with equivalent (void)strlcpy() calls.Miod Vallat
ok millert@
2022-12-26send_adb_cuda() would assume the returned value of splhigh() is the macintrMiod Vallat
interrupt enable register; this used to be true more than 20 years ago but the interrupt code has changed a lot since, and it is nevertheless bad practice from md drivers to know to much about spl*() return values. The check should become a "spl >= IPL_TTY", but management of the adb_polling variable is good enough to need this at all.
2022-12-26Update adb_polling in akbd_cnpollc rather than akbd_cngetc; repairs ddbMiod Vallat
input on adb machines.
2022-12-26Add close vmt.ASOU Masato
2022-12-24Hook up xhci(4)'s activate function to the FDT attachment driver. ThisPatrick Wildt
makes the USB ports work after a suspend/resume cycle on the x13s. ok kettenis@
2022-12-24Enable pcagpio(4), and also consistently pcamux(4) while we're at it. WithPatrick Wildt
this the SFP port on the ClearFog Base (CN9130) starts to work, as the SFP slot has some GPIOs routed through a GPIO extender. ok dlg@ kettenis@
2022-12-24fix and enable toeplitz hashing of pf_state_keys again.David Gwynne
the hash generated when setting up the pf pdesc struct uses outer addresses, while the addresses used in the state table goes through pf_state_key_addr_setup(), which does interesting things with some ipv6 icmp values. state lookups used pf_state_key_addr_setup(), but pf_state_key_setup copied the pdesc value, causing an inconsistency. pf_state_key_setup now calls pf_state_key_addr_setup(). found by anton@ tested by anton@ florian@
2022-12-23Add detection of EPAN feature bit.Mark Kettenis
ok deraadt@
2022-12-23Avoid using 1GB mappings for the identity map that we use in the earlyMark Kettenis
kernel bootstrap phase and when booting the secondary CPUs. This avoids accidentally mapping memory regions that should not be mapped (i.e. secure memory) as all mapped memory can be accessed speculatively. To allow the kernel to be loaded at arbitrary physical addresses (and arbitrary virtual addresses in the future) make sure the code that builds the page tables can handle mapping a block of memory that straddles a 1GB or 512GB boundary. This involves using two pagetable pages at all levels except the top level and changing the link_l1_pagetable function to accept an entry count just like link_l0_pagetable already does. ok patrick@
2022-12-23Prevent an iwx(4) firmware error when authentication to the AP times out.Stefan Sperling
Stop session protection before tearing down firmware state after failure to authenticate. Firmware will panic if we remove the MAC/PHY binding while session protection is active. test + ok kevlo@
2022-12-23disable the use of the has in the pf state key lookup (for now).David Gwynne
anton@ says the previous commit breaks ipv6 related regress tests. disabling the use of the hash in the state key compare gets it going again while i can figure out what's going on.
2022-12-23wrap a line betterTheo de Raadt
2022-12-22sparc64: move retry logic out of stickcmpr_set()Scott Soule Cheloha
In some cases, stickcmpr_set() fails to ensure that %STICK_CMPR leads %STICK before returning to the caller. Rewriting the retry logic in C trivially fixes the issue. So move the retry logic out into a new function, stick_rearm(). Issue discovered by miod@, fix tested by miod@. Link: https://marc.info/?l=openbsd-tech&m=167122933414238&w=2 ok kettenis@
2022-12-22Bring over various changes from the arm64 version of this code.Mark Kettenis
ok patrick@
2022-12-22use stoeplitz to generate a hash/flowid for state keys.David Gwynne
the hash will be used to partition work in pf and pfsync in the future, and right now it is used as the first comparison in the rb tree state lookup. using stoeplitz means that pf will hash traffic the same way that hardware using a stoeplitz key will hash incoming traffic on rings. stoeplitz is also used by the tcp stack to generate a flow id, which is used to pick which transmit ring is used on nics with multiple queues too. using the same algorithm throughout the stack encourages affinity of packets to rings and softnet threads the whole way through. using the hash as the first comparison in the state rb tree comparison should encourage faster traversal of the state tree by having all the address/port bits summarised into the single hash value. however, tests by hrvoje popovski don't show performance changing. on the plus side, if this change is free from a performance point of view then it makes the future steps more straightforward. discussed at length at h2k22 tested by sashan@ and hrvoje popovski ok tb@ sashan@ claudio@ jmatthew@
2022-12-22provide stoeplitz_n32()David Gwynne
2022-12-21Have the power button trigger a wakeup from suspend.Patrick Wildt
ok kettenis@
2022-12-21Implement wakeup interrupt handling. This makes sure that during suspendPatrick Wildt
we only have wakeup interrupts enabled, all others are disabled. ok kettenis@
2022-12-21Pull enabling/disabling wakeup interrupt handling out of the aplintc(4)Mark Kettenis
DVACT_SUSPEND/DVACT_RESUME handling and push it into the MD code that handles "suspend-to-idle". This way a failure in DVACT_SUSPEND handling will not result in hosed interrupts on the primary interrupt controller if we abort the suspend operation. requested by deraadt@ ok patrick@
2022-12-21Move duplicate code to new sr_find_discipline() helperKlemens Nanni
OK miod
2022-12-21The location of the aux info vector is now cached in ps_auxinfo of structClaudio Jeker
process. Use this information to access the vector. OK mpi@ mbuhl@ deraadt@
2022-12-21fix a mangled commentTheo de Raadt
2022-12-21tiny whitespace tweak.David Gwynne
2022-12-21consistently use the PF_REF wrappers around refcnts.David Gwynne
2022-12-21Update the Rx descriptor based on the vendor driver for Linux.Kevin Lo
This fixes a panic seen by Geoff Steckel on RTL8125 with MCLGETL. Tested by Geoff Steckel and Nick Owens. ok dlg@
2022-12-21prefix pf_state_key and pf_state_item struct bits to make them more unique.David Gwynne
this makes searching for the struct members easier, which in turn makes tweaking code around them a lot easier too. sk_refcnt in particular would have been a lot nicer to fiddle with than just refcnt because pf_state structs also have a refcnt, which is annoying. tweaks and ok sashan@ reads ok kn@
2022-12-19Remove unused *sd_scsibus_dev member from struct sr_disciplineKlemens Nanni
Under _KERNEL, dead since 2011 r1.100 Simplify softraid(4) to behave like other HBAs [...] OK krw
2022-12-19Invalidate ugen(4) knote lists after device detachVisa Hankala
This prevents the kernel from crashing when a ugen(4) device is detached while kqueue still holds a reference to that device. Crash reported and fix tested by xavier.s on bugs@. OK mpi@
2022-12-19Say "discipline" not "dis" in comment, latter looks like typoed "disk"Klemens Nanni
2022-12-19rework the synchronisation around suspend/resume.David Gwynne
the idea is that access to vmm from userland is gated by the vmm_softc sc_status field, and then accounted for by the refcnt. you take a read lock to check the gate, and if it is open then you can take a reference and do your thing. once you've finished the work then you rele the refcnt on the way out of the ioctl handler. the suspend code takes a write lock to close the sc_status gate, and then uses refcnt_finalise to wait for things in the ioctl handler to get out. on resume, the code takes the write lock, sets the refcnt up again for userland to use, and then opens the gate. tested by and ok dv@
2022-12-19move pf_state_item and pf_state_key structs from pfvar.h to pfvar_priv.h.David Gwynne
both of these are kernel private data structures and do not need to be visible to userland. moving them to pfvar_priv.h makes this explicit, and makes it leass scary to tweak them in the future. ok deraadt@ kn@ sashan@
2022-12-19Add WTRAPPED opiton for waitid(2) to control whether CMD_TRAPPEDPhilip Guenther
state changes are reported. That's the 6th bit, so switch to hex constants. Adjust #if tests for consistency ok kettenis@
2022-12-18spellingTheo de Raadt
2022-12-18regenDaniel Dickman
2022-12-18add two transmeta devicesDaniel Dickman
According to the "Efficeon BIOS Programmers Guide", the Efficeon processor has a virtual north bridge that can communicate with the south bridge over HyperTransport (device 0x0060) and with the graphics controller over an AGP bridge (device 0x0061). ok jsg@
2022-12-18Do not save bootdev and boothowto when invalid value has passed.Kenji Aoyama
This occurs the kernel has booted from old boot loader or directly booted by command line parameter on emulator. Tested by LUNA-88K2 and nono emulator.
2022-12-18Prevent detaching the boot volumeKlemens Nanni
bioctl(8)'s -d has no sanity checks and happily "deletes" any volume, whether currently in use or not. For now, refuse to detach the boot volume as a (too) simple safety guard, until proper logic around mounted file systems on top is implemented. Found the hard way through "bioctl -d sd1" with sd1 hosting /, after which it took both fsck(8) and installboot(8) from a miniroot USB to recover. regress/sys/dev/softraid also triggers it if root is on softraid. OK claudio op jsing
2022-12-18regenMark Kettenis
2022-12-18Add Union Memory NVMe devices.Mark Kettenis
ok jsg@
2022-12-18Disable the keyboard on the Samsung Galaxy Book Go until we can fix theMarcus Glocker
resulting interrupt storm. It's causing bad system performance, and breaks the installer.
2022-12-17regen after minherit(2) unlockKlemens Nanni
2022-12-17Unlock minherit(2)Klemens Nanni
struct uvm_map's .addr is protected by the map's lock and .{min,max}_offset are immutable. uvm_map_inherit() locks the VM map upon entry, sets the desired inheritance mode for the given address range (validated outside the lock) and unlocks the map itself. fork(2), i.e. uvm_mapent_forkcopy(), first locks both old and new maps and then copies entries over as per the inheritance type. futex(2), another user of struct vm_map_entry's .inheritance member, also locks the map accordingly. OK mpi
2022-12-17Add aplefuse(4), a driver for the eFuses on Apple Silicon SoCs.Mark Kettenis
ok patrick@
2022-12-17Make nvmem_read_cell() and nvmem_write_cell() work for hardware thatMark Kettenis
requires word-sized access. ok patrick@
2022-12-16qcpdc(4)'s establish routine needs to return the wrapped cookie, not thePatrick Wildt
cookie it received from establishing the interrupt.
2022-12-16Prevent KASSERT in iwm(4) if firmware image is missing or corrupt.Stefan Sperling
Same fix as for iwx(4) in CVS commit YakAvDYHWiUF3c4m, r1.113 if_iwx.c. ok deraadt, mpi
2022-12-16always keep pf_state_keys attached to pf_states.David Gwynne
pf_state structures don't contain ip addresses, protocols, ports, etc. that information is stored in a pf_state_key struct, which is used to wire a state into the state table. when things like pfsync or the pf state ioctls want to export information about a state, particularly the addresses on it, they needs the pf_state_key struct to read from. before this diff the code assumed that when a state was removed from the state tables it could throw the pf_state_key structs away as part of that removal. this code changes it so once pf_state_insert succeeds, a pf_state will keep its references to the pf_state_key structs until the pf_state struct itself is being destroyed. this allows anything that holds a reference to a pf_state to also look at the pf_state_key structs because they're now effectively an immutable part of the pf_state struct. this is by far the simplest and most straightforward fix for pfsync crashing on pf_state_key dereferences we've come up with so far. it has been made possible by the addition of reference counts to pf_state and pf_state_key structs, which allows us to properly account for this adjusted lifecycle for pf_state_keys on pf_state structs. sashan@ and i have been kicking this diff around for a couple of weeks now. ok sashan@ jmatthew@