| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
Do this by clearing all the bits marked RES0 and set all the bits
marked RES1 for the ARMv8.0.
Any optional features introduced in later revisions of the architecture
(such as PAN) will be enabled after SCTLR_EL1 is initialized.
ok patrick@
|
|
|
|
| |
ok patrick@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
typically pass the physical address, however retrieved, to our PCIe
controller code. This physical address can in practise be directly
given to the PCIe, but it is not a given that the CPU and the PCIe
controller are able to use the same physical addresses.
This is even more obvious with an smmu(4) inbetween, which can change
the world view by introducing I/O virtual addresses. Hence for this
it is indeed necessary to map those pages, which thanks to integration
with bus_dma(9) works easily.
For this we remember the PCI devices' DMA tag in the interrupt handle
during the MSI map, so that we can use the smmu(4)-hooked DMA tag to
load the physical address.
While some systems might prefer to implement "trapping" pages for MSIs,
to make sure devices cannot trigger other devices' interrupts, we only
make sure the whole page is mapped.
Having the IOMMU create a mapping for each MSI is a bit wasteful, but
for now it's the simplest way to implement it.
Discussed with and ok kettenis@
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ASIDs. This should only happen on systems with 8-bit ASIDs, which are
currently unsupported in OpenBSD.
The new scheme uses "generations". Whenever we run out of ASIDs we bump
the generation and flush the complete TLB. The pmaps of processes that
are currently on the CPU are carried over into the new generation. This
implementation relies on the scheduler lock to make sure this happens
without any (known) races.
ok patrick@, mpi@
|
|
|
|
| |
ok kettenis@
|
|
|
|
|
|
| |
so that we can provide IOMMU-hooked bus DMA tags for each PCI device.
ok kettenis@
|
| |
|
|
|
|
|
|
| |
running the kernel in EL2.
ok patrick@
|
|
|
|
|
|
|
|
| |
since its interrupts seem to be hardwared to trigger an FIQ instead of an
IRQ. This means we need to manipulate both the F and the I bit in the
DAIF register when enabling and disabling interrupts.
ok patrick@
|
|
|
|
|
|
|
|
| |
posted and non-posted device memory mappings and set the right memory
attributes for them. Needed because on the Apple M1 using the wrong
mapping will fault.
ok patrick@, dlg@
|
|
|
|
|
|
|
|
| |
write-combining on arm64 as Linux does, this doesn't seem to work on
NXP's LX2160A SoC. So switch to using "device" mappings for now to
make amdgpu(4) work better.
ok patrick@
|
|
|
|
| |
noticed by kettenis
|
|
|
|
| |
ok naddy@
|
|
|
|
|
|
|
|
| |
that user-space access from the kernel is not allowed for "normal"
load/store instructions. Only the special "unprivileged" load/store
instructions are allowed. We already use those in copyin(9) and copyout(9).
ok patrick@, drahn@, jsg@
|
|
|
|
|
|
| |
by miod@ where the powerpc64 claimed to be "for all AArch64 platforms".
ok patrick@
|
|
|
|
|
|
|
|
|
|
|
| |
have stored the struct cpu_info * in the wrapper around the interrupt
handler cookie, but since we can have a few layers inbetween, this does
not seem very nice. Instead have each and every interrupt controller
provide a barrier function. This means that intr_barrier(9) will in the
end be executed by the interrupt controller that actually wired the pin
to a core. And that's the only place where the information is stored.
ok kettenis@
|
|
|
|
|
|
|
|
|
| |
already assume every cookie is wrapped and simply retrieve the pointer
from it. It's a bit of a layer violation though, since only the intc
should actually store that kind of information. This is good enough for
now, but I'm already cooking up a diff to resolve this.
ok dlg@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
somehow gain access to the struct cpu_info * used to establish the
interrupt. One possibility is to store the pointer in the cookie
returned by the establish methods. A better way would be to ask
the interrupt controller directly to do barrier.
This means that all external facing interrupt establish functions
need to wrap the cookie in a common way. We already do this for
FDT-based interrupts. Also most PCI controllers already return
the cookie from the FDT API, which is already wrapped. So arm64's
acpi_intr_establish() and acpipci(4) now need to explicitly wrap
it, since they call ic->ic_establish directly, which does not wrap.
ok dlg@
|
|
|
|
| |
ok naddy@
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
|
|
| |
functionality is provided by <sys/stdarg.h> using compiler builtins.
Tested in a ports bulk build on amd64 by naddy@
OK naddy@ mpi@
|
|
|
|
|
|
|
|
| |
with a bit-reversed copy of itself. There is progressively less
entropy in the higher bits of a counter than in the lower bits, so
bit-reverse one half in order to extract maximal entropy.
style fixes and ok kettenis@
|
|
|
|
| |
ok patrick@, deraadt@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
|
|
|
| |
bus_space_read_region_n, bus_space_write_region_n and
bus_space_set_region_n functions were all broken.
Fixes mvneta(4) on arm64.
ok patrick@
|
| |
|
| |
|
|
|
|
|
|
|
| |
operations, however they should be treated as read per the design.
Switch to using bit defines, correct said defines.
Fixes cache flushing causing Firefox to abort.
ok kettenis@ kurt@
|
|
|
|
|
|
|
|
|
| |
feature register that can indicate that a processor is not vulnarable to
Spectre v2 attacks. Use this field in favour of adding specific processors
to a whitelist. Continue to whitelist the few processors that are known
not to be vulnerable but don't set the appropriate value in the CSV2 field.
ok jsg@
|
|
|
|
|
|
| |
(stirng -> string)
ok kettenis@ who pointed out I should fix the new arm64 smbiosvar.h too
|
|
|
|
|
|
|
| |
differences between the i386 and amd64 versions of the code and
switch to using the standard C integer exact width integer types.
ok deraadt@
|
|
|
|
| |
ok deraadt@, jsg@
|
|
|
|
|
|
| |
clamping the maximum DVFS state.
ok mlarkin@, patrick@
|
|
|
|
|
|
| |
an earlier diff from sf@.
ok jmatthew@, also ok mlarkin@, sf@ for a slightly different earlier version
|
|
|
|
| |
ok kettenis@
|
|
|
|
| |
ok kettenis@
|
|
|
|
| |
ok kettenis@
|
|
|
|
|
|
|
|
| |
implements mapping of MSI and MSI-X interrupts with new generic functions.
Fixes a use-after-free in sone PCI device drivers that call pci_intr_string(9)
after pci_intr_establish(9).
ok deraadt@
|
|
|
|
|
|
|
|
|
| |
we need KVA to keep track of all the RAM pages, machines with a lot
of memory easily exhaust our KVA space. We need about 1G of KVA
per 32G of memory, so with 16G of KVA we can maintain close to 512G
of memory.
ok kettenis@
|
|
|
|
|
|
|
| |
a new pci_machdep.c file such that it can be re-used by other arm64
PCI host bridge drivers in the future.
ok patrick@
|
|
|
|
|
|
|
| |
commit to unbreak the build.
from kettenis@
ok drahn@
|
|
|
|
| |
ok patrick@
|
|
|
|
|
| |
details from the ELF header instead of faking it.
Proposal from mlarkin, tested on most architectures already
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
in libm since the rounding mode is in fpcr, not fpsr. Since both FPU
registers are 32-bit we can store them in the 64-bit fenv_t to make
handling the bits easier.
While there add FE_DENORMAL, which also exists on x86. Also make sure
that whenever we are being passed an exception mask, we only allow the
bits that are supported by hardware.
Found by regression tests
Debugged with Moritz Buhl
ok kettenis@
|
|
|
|
|
|
|
| |
so that pmap.h can be included as part of the mmap_hint regression test.
From Moritz Buhl
ok bluhm@
|