summaryrefslogtreecommitdiffstats
path: root/sys/arch/hppa (follow)
Commit message (Collapse)AuthorAgeFilesLines
* spellingjsg2021-03-1111-25/+25
|
* timecounting: use C99-style initialization for all timecounter structscheloha2021-02-231-2/+9
| | | | | | | | | | | | | | | | | | The timecounter struct is large and I think it may change in the future. Changing it later will be easier if we use C99-style initialization for all timecounter structs. It also makes reading the code a bit easier. For reasons I cannot explain, switching to C99-style initialization sometimes changes the hash of the resulting object file, even though the resulting struct should be the same. So there is a binary change here, but only sometimes. No behavior should change in either case. I can't compile-test this everywhere but I have been staring at the diff for days now and I'm relatively confident this will not break compilation. Fingers crossed. ok gnezdo@
* Terminate backtrace of secondary processors in ddb.kettenis2021-02-221-1/+4
| | | | From miod@
* Add uhidpp(4), a driver for Logitech HID++ devices. Currently limited toanton2021-02-041-1/+2
| | | | | | | | | exposing battery sensors for HID++ 2.0 devices. Most of the code is derived from the hid-logitech-hidpp Linux driver. Thanks to Ville Valkonen <weezeldinga at gmail dot com> for testing. ok mglocker@
* Again allow COPTS= to come from the environment again, and don't lose thederaadt2021-01-281-4/+4
| | | | | SMALL_KERNEL specific variations. ok espie jsg
* introduce ujoy(4), a restricted subset of uhid(4) for gamecontrollers.thfr2021-01-232-2/+5
| | | | | | | | This includes ujoy_hid_is_collection() to work around limitations of hid_is_collection() until this can be combined without fallout. input, testing with 8bitdo controller, and ok brynet@ PS4 controller testing, fix for hid_is_collection, and ok mglocker@
* Clear CR 26 before returning to userland to avoid potentioal info leak.kettenis2021-01-111-4/+7
| | | | ok miod@, deraadt@
* "encoding of diag instructions is hard, let's go shopping"kettenis2021-01-092-69/+31
| | | | | | | Clean up things a bit, adding documentation about the source of the information about these instructions. From miod@
* Use daddr_t and not daddr32_t in boot media.krw2020-12-093-8/+8
| | | | | | | | | | At a minimum, amd64/i386 should now boot from 4TB GPT formatted disks. More daddr32_t terminations with extreme prejudice to follow. Tested by various, in snaps for a few days. ok deraadt@
* In case of failure, call sigexit() from trapsignal instead of sensig().mpi2020-11-081-5/+7
| | | | | | | Simplify MD code and reduce the amount of recursion into the signal code which helps when dealing with locks. ok cheloha@, deraadt@
* uvm_grow() doesn't need KERNEL_LOCK anymore, and onfault never did.deraadt2020-10-221-4/+2
| | | | | minor refactorings to narrow KERNEL_LOCK just around uvm_fault() ok kettenis
* move the backwards-stack vm_minsaddr check from hppa trap.c to uvm_grow(),deraadt2020-10-211-3/+2
| | | | | within the correct #ifdef of course. ok kettenis
* hppa also has a similar to arm64: copyout(9), copyinstr(9) andderaadt2020-10-211-1/+7
| | | | | | copyoutstr(9) should bail out properly if they are called with a length of 0. ok kettenis@
* use access_type as the PROT_* variable for uvm_fault() consistantlyderaadt2020-10-081-17/+15
| | | | ok kettenis
* Only perform uvm_map_inentry() checks for PROC_SP for userland pagefaults.deraadt2020-09-241-7/+9
| | | | | | | | This should be sufficient for identifying pivoted ROP. Doing so for other traps is at best opportunistic for finding a straight-running ROP chain, but the added (and rare) sleeping point has proven to be dangerous. Discussed at length with kettenis and mortimer. ok mortimer kettenis mpi
* When emulating reading from cr26 and cr27 on PCXS, simply set cr26 to zerokettenis2020-09-141-3/+3
| | | | | | | | and take the cr27 value that was saved in the trap frame. This matches what process_read_regs() does and prevents returning the wrong values if the uvm_map_inentry() checks sleeps trying to grab the vm_map read lock. ok miod@, deraadt@
* Push KERNEL_LOCK/UNLOCK() dance inside trapsignal().mpi2020-08-191-27/+1
| | | | ok kettenis@, visa@
* Add support for timeconting in userland.pirofti2020-07-062-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | This diff exposes parts of clock_gettime(2) and gettimeofday(2) to userland via libc eliberating processes from the need for a context switch everytime they want to count the passage of time. If a timecounter clock can be exposed to userland than it needs to set its tc_user member to a non-zero value. Tested with one or multiple counters per architecture. The timing data is shared through a pointer found in the new ELF auxiliary vector AUX_openbsd_timekeep containing timehands information that is frequently updated by the kernel. Timing differences between the last kernel update and the current time are adjusted in userland by the tc_get_timecount() function inside the MD usertc.c file. This permits a much more responsive environment, quite visible in browsers, office programs and gaming (apparently one is are able to fly in Minecraft now). Tested by robert@, sthen@, naddy@, kmos@, phessler@, and many others! OK from at least kettenis@, cheloha@, naddy@, sthen@
* wire up kstat(4)dlg2020-07-061-2/+3
| | | | "looks right" deraadt@
* Remove obsolete <machine/stdarg.h> header. Nowadays the varargvisa2020-06-301-54/+0
| | | | | | | | functionality is provided by <sys/stdarg.h> using compiler builtins. Tested in a ports bulk build on amd64 by naddy@ OK naddy@ mpi@
* Implement cpu_rnd_messybits() as a read of the cycle counter register.naddy2020-06-142-12/+13
| | | | ok dlg@ deraadt@
* introduce "cpu_rnd_messybits" for use instead of nanotime in dev/rnd.c.dlg2020-05-312-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | rnd.c uses nanotime to get access to some bits that change quickly between events that it can mix into the entropy pool. it doesn't use nanotime to get a monotonically increasing set or ordered and accurate timestamps, it just wants something with bits that change. there's been discussions for years about letting rnd use a clock that's super fast to read, but not necessarily accurate, but it wasn't until recently that i figured out it wasn't interested in time at all, so things like keeping a fast clock coherent between cpu cores or correct according to ntp is unecessary. this means we can just let rnd read the cycle counters on cpus and things will be fine. cpus with cycle counters that vary in their speed and arent kept consistent between cores may even be desirable in this context. so this is the first step in converting rnd.c to reading cycle counter. it copies the nanotime backend to each arch, and they can replace it with something MD as a second step later on. djm@ suggested rnd_messybytes, but we landed on cpu_rnd_messybits. thanks to visa for his eyes. ok deraadt@ visa@ deraadt@ says he will help handle any MD fallout that occurs.
* dev/rndvar.h no longer has statistical interfaces (removed during variousderaadt2020-05-293-7/+3
| | | | | | conversion steps). it only contains kernel prototypes for 4 interfaces, all of which legitimately belong in sys/systm.h, which are already included by all enqueue_randomness() users.
* Retire <machine/varargs.h>.visa2020-05-271-17/+0
| | | | | | Nothing uses the header anymore. OK deraadt@ mpi@
* increment version numbers, due to recent RB_GOODSEED and fchmod +T changesderaadt2020-05-261-2/+2
|
* iodcstrategy() maintains a cache for READ performance (tapes are supportedderaadt2020-05-261-8/+17
| | | | | | | here, and alternatively would need to rewind). WRITE code exists, but was always wrong -- it writes the cache-buffer to disk, rather than the provided write-buffer. Copy the write-buffer into the cache, and invalidate the cache completely so that future reads start from scratch.
* Put setjmp+longjmp inside #ifdef DDB the only kernel-side user.deraadt2020-05-171-3/+3
| | | | This shrinks the ramdisks a tiny bit.
* Make inittodr() and resettodr() MI.kettenis2020-05-161-93/+1
| | | | | ok deraadt@, mpi@, visa@ ok cheloha@ as well (would have preferred in new file for this code)
* Initialize the timeval passed to todr_gettime() with the base time fromkettenis2020-05-111-1/+4
| | | | | | | the file system such that implementations can use it to guess the right century. ok mpi@
* Use the same inittodr()/resettodr() implementation as onkettenis2020-05-012-65/+129
| | | | | | | | amd64/arm64/armv7/i386/sparc64 and move it to the end of machdep.c. Rework the actual implementation for the MC14818 compatible RTC into something that can be used as a todr_handle just like on amd64. ok mpi@
* Sync existing stacktrace_save() implementationsvisa2020-04-181-3/+6
| | | | | | | | Upgrade stacktrace_save() to stacktrace_save_at() on architectures where the latter is missing. Define stacktrace_save() as an inline function in header <sys/stacktrace.h> to reduce duplication of code. OK mpi@
* Allow hppa boot(8) to read from an ffs2 filesystem; ok kettenis@otto2020-03-122-4/+7
|
* lcd(4/hppa): timeout_add(9) -> timeout_add_usec(9)cheloha2020-03-061-2/+2
| | | | | | Tested by kettenis@. ok kettenis@
* Use major 32 for dt(4).mpi2020-01-241-2/+3
| | | | ok visa@, kettenis@, deraadt@
* wire up pppac(4) to some majors on each arch.dlg2020-01-231-1/+2
| | | | | | | | i was lazy and just put them at the end of the existing set. fyi, i think major 51 is free on all archs if anyone is looking for another one. ok claudio@
* Separate the stack trace saving interface from ddb. The saving does notvisa2020-01-201-3/+4
| | | | | | | | | | require the debugger on most architectures, and the separation makes the code easier to use from other subsystems. The function definitions are still conditional to DDB. However, that should not matter for now. OK deraadt@, mpi@
* The boot loader allows to inspect memory with the hexdump command.bluhm2019-12-231-2/+7
| | | | | Document the new feature in boot(8) man page. OK jmc@ deraadt@
* Add fido(4), a HID driver for FIDO/U2F security keysreyk2019-12-172-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | While FIDO/U2F keys were already supported by the generic uhid(4) driver, this driver adds the first step to tighten the security of FIDO/U2F access. Specifically, users don't need read/write access to all USB/HID devices anymore and the driver also improves integration with pledge(2) and unveil(2): It is pledge-friendly because it doesn't require any ioctls to discover the device and unveil-friendly because it uses a single /dev/fido/* directory for its device nodes. It also allows to support FIDO/U2F in firefox without further weakening the "sandbox" of the browser. Firefox does not have a proper privsep design and many operations, such as U2F access, are handled directly by the main process. This means that the browser's "fat" main process needs direct read/write access to all USB HID devices, at least on other operating systems. With fido(4) we can support security keys in Firefox under OpenBSD without such a compromise. With this change, libfido2 stops using the ioctl to query the device vendor/product and just assumes "OpenBSD" "fido(4)" instead. The ioctl is still supported but there was no benefit in obtaining the vendor product or name; it also allows to use libfido2 under pledge. With feedback from deraadt@ and many others OK kettenis@ djm@ and jmc@ for the manpage bits
* Implement a hexdump command in the boot loader. This helps tobluhm2019-11-281-1/+4
| | | | | | inspect the memory layout that the firmware has created. It is especially useful for UEFI debugging. OK deraadt@ kettenis@
* TRUE/FALSE conversions missed in previous.mpi2019-11-101-4/+4
|
* The compiler -pg option implies -fno-ret-protector, as we want to disableguenther2019-11-071-2/+2
| | | | | | | | | | | retguard and similar when profiling. However, that missed all the .S files, as ${PROF} wasn't added when ${NORMAL_S} was converted from direct invocation of ${AS} to instead use ${CC}. Similarly, mcount.o still had retguards as it cannot be built with -pg. So: pass ${PROF} when compiling .S files, and compile "no profiling" files with -fno-ret-protector on archs with retguard. feedback and ok mpi@ mortimer@
* Convert db_addr_t -> vaddr_t but leave the typedef for now.mpi2019-11-073-14/+14
|
* ANSIfy functions and get rid of boolean_t.mpi2019-11-061-4/+2
| | | | ok dlg@, jasper@
* Use arc4 to bit-spread the 512-byte random buffer over the .openbsd.randomdataderaadt2019-10-294-7/+14
| | | | | | | | | section, which has grown a fair bit with the introduction of retguard. Mortimer discovered the repeated 512-byte sequence as retguard keys, and this resolves the issue. (Chacha does not fit on the media, so 1.5K early drop RC4 is hopefully sufficient in our KARL link universe) Version crank the bootblocks. sysupgrade -s will install new bootblocks. ok djm mortimer
* Improve previouskn2019-10-201-5/+2
| | | | From and OK jmc
* Document "set db_console 0|1"kn2019-10-201-3/+10
| | | | OK deraadt
* hppa: gsckbc(4), power(4): tsleep(9) -> tsleep_nsec(9); ok kn@ visa@cheloha2019-10-122-5/+5
|
* If uvm_map_inentry returns false then a signal has been delivered, andderaadt2019-09-061-2/+3
| | | | | | userret() must be called on trap() exit to deliver it, rather than repeating the same cause infinitely. discovered by George Koehler ok kettenis bluhm visa
* Remove DST/TIMEZONE options(4) from kernel configs; ok jca@ deraadt@cheloha2019-09-041-3/+1
|
* crank version, following fchmod changederaadt2019-08-041-2/+2
|