summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2018-08-18Make sure we don't match (and attach) more than the maximum number ofMark Kettenis
supported CPUs. ok deraadt@, patrick@, visa@
2018-08-18Support arbitrary number of redistributors.Mark Kettenis
Inspired by an earlier diff from drahn@ ok patrick@, jsg@
2018-08-17The official name for the ssdfb(4) reset GPIO attribute uses plural form.Patrick Wildt
2018-08-17Support reading and using serveral device tree attributes for ssdfb(4),Patrick Wildt
since some OLED display controller settings can change depending on the actual hardware integration.
2018-08-17the stack already counts bytes and packets, so don't do it again here.David Gwynne
makes output stats look plausible. reported by jason tubnor ok deraadt@
2018-08-16Make pmap_allocate_asid() mpsafe. Since between checking the ASIDPatrick Wildt
table and setting the bits atomically another core can select the same ASID as we did it currently would not be safe to run it without the kernel lock. This replaces the atomic_setbits_int(9) call with atomic_cas_uint(9) where we can check that the table entry has not been changed since we evaluted it. Also modify pmap_free_asid() to use the same concept. ok kettenis@
2018-08-15Turns out the integration of the GIC-500 on the Rockchip RK3399 is busted.Mark Kettenis
It treats all access to the memory mapped registers as "secure" even if we're running in non-secure mode. As a result, during bringup of OpenBSD on the RK3399, I got confused and tweaked the interrupt priorities in a way that is wrong (but worked on the RK3399. Fix those priorities to match what they should be according to the documentation (and works on other hardware that includes a GICv3) and add code that detects the broken RK3399 GIC and adjusts the priorities accordingly. Also remove (broken) code that tries to mess around with group 0 interrupts and fix setting bits in the GICD_CTLR register on the broken RK3399 GIC.
2018-08-15Distinguish between softc array members that are indexed by redistributorMark Kettenis
and those that are indexed by the assigned CPU (unit) number. Fix the shuffling of the affinity fields are shuffled around to match the spec.
2018-08-15Push back the kernel lock in sys_mmap(2) a little bit more now thatMark Kettenis
fd_getfile(9) is mpsafe. Note that sys_mmap(2) isn't actually unlocked currently. However this diff has been tested with it unlocked, and I hope to unlock it for real soon-ish. ok visa@, mpi@
2018-08-15Use atomic instructions to keep track of what ASIDs are in use. This makesMark Kettenis
pmap_free_asid() and therefore pmap_destroy() mpsafe which is important since we might end up calling that function without holding the kernel lock as a result of releasing a reference in pmap_page_protect(9). ok visa@
2018-08-15Update AP selection heuristics for auto-join.Stefan Sperling
We now prefer stronger crypto over weaker crypto over none, prefer 5 GHz band with reasonable RSSI, and use RSSI as a tie-breaker with a slight advantage for 5GHz. Candidate APs are now ranked by a score which is calculated based on these attributes. There is likely room for improvements to make these heuristics work well across many different environments, but it's a start. ok phessler@
2018-08-15Partially revert previous, EM7455 is already handled by umb(4).Martin Pieuchot
Reported by Bryan Vyhmeister.
2018-08-15Grab the KERNEL_LOCK() in MP-unsafe fo_close routines. This preventsVisa Hankala
a scenario where MP-unsafe code gets run without the kernel lock as a consequence of an unlocked system call. OK mpi@, kettenis@
2018-08-15Introduce mue_eeprom_present to check if the EEPROM is present.Kevin Lo
When the EEPROM is not populated, set the MAC config register MUE_MAC_CR_AUTO_SPEED. While there, encode the MAC address for the onboard USB Ethernet for the Rasperry Pi, like smsc(4) does.
2018-08-15add cpuid and msr bits fromJonathan Gray
'Deep Dive: CPUID Enumeration and Architectural MSRs' ok deraadt@
2018-08-14spelling errorTheo de Raadt
2018-08-14return ENOTTY rather than EINVAL to indicate an ioctl hasn't been handledJonathan Matthew
ok dlg@ deraadt@ kettenis@
2018-08-13Instead of using BYPASSUNVEIL at NDINIT time, use KERNELPATH to indicateTheo de Raadt
we want to skip all userland-related checks. Discussed with beck and semarie, tested by stsp.
2018-08-13More clear version of previous namei/pledge/chroot solution. namei flagTheo de Raadt
KERNELPATH indicates this operation is being done on behalf of the kernel, not a process, so ignore chroot of the current process context, start at /, and skip unveil and pledge checks. Discussed with beck and semarie
2018-08-13in sys_statfs(), BYPASSUNVEIL can be passed to NDINIT in the "flags"Theo de Raadt
argument, rather than manually |= afterwards. Observed by semarie
2018-08-13The first panic in pledge_namei should only be for ni_pledge == 0Theo de Raadt
(the other cause is implausible, and crashes with a nice *NULL)
2018-08-13Simplify the startup of the cleaner, reaper and update threads byVisa Hankala
passing the main function directly to kthread_create(9). The start_* functions are mere stepping stones nowadays and can be pruned. They used to contain more logic in the pre-kthread era. While here, set `cleanerproc' and `syncerproc' during the thread creation rather than expect the threads to set the proc pointer. Also, rename `sched_sync' to `syncer_thread' to reduce confusion with the scheduler-related functions. OK kettenis@, deraadt@, mpi@
2018-08-13Add support for band-steering access points to net80211.Stefan Sperling
Some access points have a feature called "band steering" where they will try to push clients from 2 GHz channels to 5 GHz channels. If a client sends probe-requests on both 2 GHz and 5GHz channels, and then attempts to authenticate on a 2 GHz channel, such APs will deny authentication and hope that the client will come back on a 5 GHz channel. So if we fail to AUTH for any reason, and if there is a different AP with the same ESSID that we haven't tried yet, try that AP next. Keep trying until no APs are left, and only then continue scanning. APs with support for this feature were provided by Mischa Peters. ok phessler@ mpi@
2018-08-13Support CPU frequency scaling on NXP i.MX8M.Patrick Wildt
ok kettenis@
2018-08-13Support GPIO-based voltage regulators.Patrick Wildt
ok kettenis@
2018-08-13Prevent iwm(4) from writing back the former BSS channelStefan Sperling
if the current BSS has been changed by ieee80211_input(). Needed for upcoming band-steering support in net80211. ok phessler@ mpi@
2018-08-13Make it possible to run pipe(2) and pipe2(2) mostly w/o KERNEL_LOCK():Martin Pieuchot
- Update counters atomatically - Use IPL_MPFLOOR for pipe's pool. - Grab the KERNEL_LOCK() before calling km_alloc(9) & km_free(9) Inputs from kettenis@, ok visa@
2018-08-13Attach to Sierra Wireless MC7304/MC7354 & EM7455, from Denis Lapshin.Martin Pieuchot
2018-08-13regenMartin Pieuchot
2018-08-13Sierra Wireless MC7304/MC7354, from Denis Lapshin.Martin Pieuchot
2018-08-12Add administrative options to LACP trunk implementation.ccardenas
The trunk driver now has a new ioctl (SIOCxTRUNKOPTS), which for now only has options for LACP: * Mode - Active or Passive (default Active) * Timeout - Fast or Slow (default Slow) * System Priority - 1(high) to 65535(low) (default 32768/0x8000) * Port Priority - 1(high) to 65535(low) (default 32768/0x8000) * IFQ Priority - 0 to NUM_QUEUES (default 6) At the moment, ifconfig only has options for lacpmode and lacptimeout plumbed as those are the immediate need. The approach taken for the options was to make them on a "trunk" vs a "port" as what's typically seen on various NOSes (JunOS, NXOS, etc...) as it's uncommon for a host to have one link "Passive" and the other "Active" in a given trunk. Just like on a NOS, when applying lacpmode or lacptimeout, the settings are immediately applied to all existing ports in the trunk and to all future ports brought into the trunk. Tested by many on a plethora of NIC drivers and switches. Ok remi@
2018-08-12Drop reference to dmabuf "file" as fnew() returns one that has twoMark Kettenis
references. ok visa@, deraadt@
2018-08-12Really overwrite the major of com(4) instead of the hardcoded 12.Mark Kettenis
Should have been part of the earlier commit that unified armv7 and arm64.
2018-08-12Add retguard macros for arm64 asm and apply them in the straightforwardmortimer
cases in kernel and libc. ok deraadt@
2018-08-11Make legacy interrupts work in more cases.Mark Kettenis
2018-08-11Use IORT table to map requester ID into MSI sideband data.Mark Kettenis
2018-08-11Get rid of PLEDGE_STAT, which was a hack used for unveil.Bob Beck
We use UNVEIL_INSPECT instead in the unveil flags for the same purpose, and now add traversed vnodes of a path with UNVEIL_INSPECT instead of with 0 flags and voodoo in unveil_flagmatch. This allows us to uncontort the logic of unveil_flagmatch a bunch. helpful review and ok from semarie@
2018-08-11Match "ARMH0011".Mark Kettenis
2018-08-11Make GICv3 redistributor support actually work and add ITS support.Mark Kettenis
2018-08-11Bump MAXCPUS from 8 to 24.Mark Kettenis
ok jsg@
2018-08-11Fix a couple of bugs in the ITS support code:Mark Kettenis
- Don't dereference sc_prop if we're not handling an LPI. Fixes a crash on qemu when emulating a GICv3 without ITS (and therefore no LPIs(. - Use the true IPL when calculating the priority of an LPI. The old code used a variable that still had the IPL_MPSAFE flag in it. - Write to the right GITS_BASERn instead of ialways writing to GITS_BASER0. - Flush the cache after initializing/modifying the in-memory tables. The GICv3 on the SynQuacer isn't fully coherent and only supports the "non-shareable" attribute for its in-memory tables. So we have to flush the cache to the point of coherency to guarentee that the GIC sees our changes to those tables. Throw in a full memory barrier for good measure. Also add support for the SynQuacer pre-ITS. ok jsg@, patrick@
2018-08-11Add comment explaining why we read basic MCS set only from beacon/probereq.Stefan Sperling
requested by mpi@
2018-08-11Use MAXCPUS as the number of elements for the array of per-cpu data.Mark Kettenis
ok jsg@, patrick@
2018-08-11Use MAXCPUS as the number of elements for the array of per-cpu data.Mark Kettenis
Fixes machines with more than 8 cores. ok jsg@, patrick@
2018-08-10crank to 6.4-betaTheo de Raadt
2018-08-10Bump boot loader versions for softraid passphrase handling change.Joel Sing
2018-08-10Retry on incorrect passphrase for softraid crypto boot.Joel Sing
Historically, the softraid crypto support in the boot loaders has only given one attempt to provide the correct passphrase. There were a few reasons for this, including the fact that pkcs5_pbkdf2() allows an empty passphrase and that returning EPERM allowed for another attempt. With the event of KARL and the need for bsd.booted with hibernate resumption, this becomes much more of an issue - if you get the passphrase wrong you fail to resume. There are also other situations like using /etc/boot.conf to switch serial console, but an incorrect passphrase results in the config not being read. Also, bcrypt_pbkdf() does not permit empty passphrases. This reworks the softraid crypto support in the boot loaders so that it loops requesting a valid passphrase until one is provided, or an empty passphrase is entered (at which point it will abort). ok mortimer@ tb@
2018-08-10Update fd_freefile when filtering/closing kqueue descriptors in fdcopy().Joel Sing
Prior to r1.153 of kern_descrip.c, the kqueue descriptors were removed using fdremove(), which reset fd_freefile as appropriate. The new code simply avoids adding the descriptor to the new table, however this means that fd_freefile can be left with an incorrect value, resulting in a file descriptor allocation "hole". Restore the previous behavour by lowering fd_freefile as appropriate when dropping descriptors. Issue found via golang regress tests. ok deraadt@ mpi@ visa@
2018-08-09Remove redundant "kq == kn->kn_kq" checks. The lists kq_knhash andVisa Hankala
kq_knlist are dedicated to a single kqueue instance, which makes the filtering by kn_kq unnecessary. OK kettenis@, mpi@
2018-08-09Hook up the rasops text emulation functions so we only write outPatrick Wildt
the characters that changed, and only when they change. This replaces writing out the whole framebuffer every 100ms with a partial update mechanism. Now the system stays responsive and does not slow down anymore due to the periodic update.