| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
based on include-what-you-use suggestions
|
| |
|
|
|
|
|
|
| |
so that we can provide IOMMU-hooked bus DMA tags for each PCI device.
ok kettenis@
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
|
| |
Enables a clock and/or power domain for a group of devices.
Required to use linux 5.11 dtbs on am335x and omap4.
ok kettenis@
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
| |
ok tb@, deraadt@
|
|
|
|
|
|
|
| |
Simplify MD code and reduce the amount of recursion into the signal code
which helps when dealing with locks.
ok cheloha@, deraadt@
|
|
|
|
|
|
| |
around uvm_fault(), and slightly refactor code to be more like on
other architectures
in snaps for 2 weeks
|
|
|
|
|
| |
("permanently undefined")
ok deraadt@ kettenis@
|
|
|
|
|
|
|
|
|
| |
fails and we're doing a copyin/copyout.
Fixes a buf where systems calls would return EACCESS instead of EFAULT
when accessing userland memory that can't be accessed.
ok patrick@
|
|
|
|
| |
OK deraadt@ kettenis@
|
|
|
|
|
|
| |
as there is little purpose running them excessively.
studied with kettenis while searching for "system registers read after
sleeping in trap()"
|
|
|
|
| |
The header is being pulled via db_machdep.h -> uvm_extern.h -> uvm_map.h
|
|
|
|
| |
OK deraadt@, mpi@
|
|
|
|
| |
ok kettenis@, visa@
|
|
|
|
|
|
| |
by miod@ where the powerpc64 claimed to be "for all AArch64 platforms".
ok patrick@
|
|
|
|
|
|
|
|
|
|
|
|
| |
in the chipset tag for establishing interrupts now takes a struct cpu_info *.
The normal pci_intr_establish() macro passes NULL as ci, which indicates that
the primary CPU is to be used.
The PCI controller drivers can then simply pass the ci on to our arm64/armv7
interrupt establish "framework".
Prompted by dlg@
ok kettenis@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a struct cpu_info *. From a driver point of view the fdt_intr_establish_*
API now also exist same functions with a *_cpu suffix. Internally the
"old" functions now call their *_cpu counterparts, passing NULL as ci.
NULL will be interpreted as primary CPU in the interrupt controller code.
The internal framework for interrupt controllers has been changed so that
the establish methods provided by an interrupt controller function always
takes a struct cpu_info *.
Some drivers, like imxgpio(4) and rkgpio(4), only have a single interrupt
line for multiple pins. On those we simply disallow trying to establish
an interrupt on a non-primary CPU, returning NULL.
Since we do not have MP yet on armv7, all armv7 interrupt controllers do
return NULL if an attempt is made to establish an interrupt on a different
CPU. That said, so far there's no way this can happen. If we ever gain
MP support, this is a reminder that the interrupt controller drivers have
to be adjusted.
Prompted by dlg@
ok kettenis@
|
|
|
|
|
|
|
|
|
| |
Checked against
* ARM Architecture Reference Manual (agtimer)
* ARM Cortex-A9 MPCore Technical Reference Manual (amptimer)
* OMAP35x Applications Processor Technical Reference Manual (gptimer)
Artturi Alm had independently suggested this in the past.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
length of up to 31 characters. This limit is also present in the
flattened device tree specification/ Unfortunately this limit isn't enforced
by the tooling and there are systems in the wild that use longer strings.
This includes the device trees used on POWER9 systems and has been seen
on some ARM systems as well.
So bump the buffer size from 32 bytes (31 + terminating NUL) to 64 bytes.
Centrally define OFMAXPARAM to this value (in <dev/ofw/openfirm.h>)
replacing the various OPROMMAXPARAM definition scattered around the tree
to make sure the FDT implementation of OF_nextprop() uses the same
buffer size as its consumers.
Eliminate the static buffer in various openprom(4) implementations on
FDT systems.
Makes it possible to dump the full device tree on POWER9 systems using
eeprom -p.
ok deraadt@, visa@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
| |
"looks right" deraadt@
|
|
|
|
|
|
|
|
| |
functionality is provided by <sys/stdarg.h> using compiler builtins.
Tested in a ports bulk build on amd64 by naddy@
OK naddy@ mpi@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
ok jsg@
|
|
|
|
| |
This shrinks the ramdisks a tiny bit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sparc64 (and arm mem.c) are the only architectures/places where
RWLOCK_INITIALIZER() is used with static function variables, all other
(mem.c) usages place it into the global scope.
Fix builds with WITNESS enabled for sparc64 and arm by moving physlock
into global scope:
mem.c:93: error: initializer element is not constant
mem.c:93: error: (near initialization for 'physlock.rwl_lock_obj.lo_type')
OK visa
|
|
|
|
|
| |
ok deraadt@, mpi@, visa@
ok cheloha@ as well (would have preferred in new file for this code)
|
|
|
|
|
|
|
| |
the file system such that implementations can use it to guess the right
century.
ok mpi@
|
|
|
|
|
|
|
|
|
|
|
| |
DMA remapping in the same way as arm64. This relies on the dma-ranges
property in the device tree and allows us to get rid of the hack for
the Raspberry Pi in the dwctwo(4) driver.
Note that this does not include the hack in simplebus(4) that we have on
arm64 since firmware that has the dma-ranges is in widespread use now.
ok patrick@
|
|
|
|
|
|
| |
arrm32_machdep.c.
ok mpi@
|
|
|
|
| |
OK kettenis@
|
|
|
|
|
|
|
| |
problems as 64-bit models. All syscall instructions ("swi 0") now have a
nop;nop after them. We make the kernel skip over these when returning, so
that we can (soon) change the nops into a speculation barrier.
ok kettenis
|
|
|
|
|
|
|
|
|
|
| |
problems as 64-bit models. "movs pc, lr" is the pre-VM legacy eret and
as such also requires speculation blockers. Idiomatically spray
"dsb nsh; ish" after each such occurance because it is cheap.
(I find it very interesting 2/3 of these occur at end of a .o, so the
instructions speculatively executed are from a randomly different .o file
after each kernel relink...)
ok kettenis
|
|
|
|
|
| |
to spin trying things.
ok kettenis
|
|
|
|
|
|
| |
problems as 64-bit models. After every eret, there must be a speculation
barrier.
ok kettenis
|
|
|
|
|
|
|
|
| |
alex14fr at gmail reported qemu-system-arm -M virt with vio(4) failed rx
checksums. The mi netinet/in4_cksum.c and the xscale path removed in
in_cksum_arm.S 1.6 worked, for now just fix one line of assembly.
ok kettenis@
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
|
|
|
|
|
| |
The design is fairly simple: events, in the form of descriptors on a
ring, are being produced in any kernel context and being consumed by
a userland process reading /dev/dt.
Code and hooks are all guarded under '#if NDT > 0' so this commit
shouldn't introduce any change as long as dt(4) is disable in GENERIC.
ok kettenis@, visa@, jasper@, deraadt@
|
| |
|
|
|
|
|
|
| |
BP cache if necessary).
ok patrick@
|
|
|
|
|
|
|
| |
arm64 version and fixes some (but not all) remaining issues with SMP support
on armv7.
ok visa@, patrick@
|
|
|
|
|
|
| |
the kernel.
ok patrick@
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and not just ".openbsd.randomdata.retguard". Accept both in the kernel
ldscripts so that they're placed together between the __retguard_{start,end}
symbols.
Similarly, match not just ".openbsd.randomdata" but also
".openbsd.randomdata.*" to pick up other random (pun intended) items.
While here, stub in those retguard bits into all the ldscripts.
ok deraadt@
|