summaryrefslogtreecommitdiff
path: root/sys/arch/arm64/include
AgeCommit message (Collapse)Author
2018-05-06Use speed from device tree for serial console. Makes it possible to bootMark Kettenis
and install systems where the firmware uses a non-standard speed. This is important for various boards that use a Rockchip SoC where the vendor thinks using 1500000 bps as the serial console speed is a good idea (it isn't). ok deraadt@, visa@, patrick@
2018-05-04Add stack trace saving for arm64.Visa Hankala
OK guenther@
2018-05-02Add imxpd(4) which is a power domain controller driver thatPatrick Wildt
essentially calls into ATF to make it supply power. ok kettenis@
2018-04-09The Open Firmware Interrupt Mapping "recommendation" says that the numberMark Kettenis
of address celss in the child unit specifier should be fetched from the interrupt controller node. Fix this as the current code doesn't work on the MACCHIATObin for example. ok patrick@
2018-03-20To allow sharing more code between armv7 and arm64 platforms, introducePatrick Wildt
a common bus space tag that can be used for early console attachment. ok kettenis@
2018-03-05#define _MAX_PAGE_SHIFT in MD _types.h as the maximum pagesize an archTheo de Raadt
needs (looking at you sgi, but others required this before). This is for the circumstances we need pagesize known at compile time, not getpagesize() runtime. Use it for malloc storage sizes, for shm, and to set pthread stack default sizes. The stack sizes were a mess, and pushing them towards page-aligned is healthy move (which will also be needed by the coming stack register checker) ok guenther kettenis, discussion with stefan
2018-02-20Make arm64 pmap (somewhat) mpsafe.Mark Kettenis
2018-01-31Add MULTIPROCESSOR support to the interrupt controller drivers. This makesMark Kettenis
the secondary CPUs receive clock interrupts. Based on diffs from drahn@. ok patrick@
2018-01-30Add support for switching CPUs in ddb on arm64. Based on a diff from drahn@.Mark Kettenis
ok patrick@
2018-01-28Spin up secondary CPUs and add IPI infrastructure. Heavily based on diffsMark Kettenis
from dran@. ok patrick@
2018-01-26Cleanup VFP code.Mark Kettenis
ok patrick@
2018-01-25Move common mutex implementations to a MI place.Martin Pieuchot
Archs not yet converted can to the jump by defining __USE_MI_MUTEX. ok visa@
2018-01-17Defend agains branch predictor target injection (Spectre "variant 2")Mark Kettenis
attacks by flushing the branch predictor cache (BTB) on context switches and page faults in kkernel address space. Note that this relies on the presence of firmware (such as Arm Trusted Firmware) that provides PSCI services that flush the BTB on entry as described in Arm Trusted Firmware Security Advisory TFV 6. ok patrick@, visa@
2018-01-13Define and use IPL_MPFLOOR in our common mutex implementation.Martin Pieuchot
ok kettenis@, visa@
2018-01-12Add MULTIPROCESSOR basics for arm64. Enough to build and run a kernel withMark Kettenis
option MULTIPROCESSOR on a single CPU. ok patrick@
2018-01-12Runtime services may (and do) use device mappings on some UEFI implementations.Mark Kettenis
Skip these mappings during the remap-pahse as they are likely to be in a different 512G bloch as memory and SetVirtualAddressMap() shouldn't need them. But do assign a new virtual address and let efi(4) create a mapping. Add a PMAP_DEVICE flag such that pmap_enter() can continue to be used to create these mappings. ok patrick@
2018-01-12Unify <machine/mutex.h> a bit further.Martin Pieuchot
`mtx_owner' becomes the first field of 'struct mutex' on i386/amd64/arm64. ok visa@
2018-01-10Implement FUCKWIT for arm64; unmap the kernel almost entirely while userlandMark Kettenis
is running. This provides protection against meltown on cores that are vilnerable (just Cortex-A75 so far) but also seems to be an essential to protect against spectre-like attacks against the kernel. This implementation only exposes a single treampoline page that does not contain any kernel virtual addresses and also hides the real virtual address of the exception vectors, which helps on cores vulnerable to "variant 3a" (Cortex-A57, Cortex-A72). The implementation is inspired by the work done by Will Deacon for Linux, but there are no knobs to turn it off. The overhead is fairly limited: around 3-4% slowdown on Cortex-A57. ok patrick@, deraadt@
2018-01-05Make arm64 use the MI mplock implementation. Avoid <sys/mplock.h> beingMark Kettenis
pulled in for assembly files by bringing <machine/cpu.h> and <machine/param.h> in line with other architectures. Some minor cleanup of those files is included. ok patrick@
2018-01-04Implement support for calling EFI runtime services and use it to implementMark Kettenis
a time-of-day clock device based on the GetTime() and SetTime() services. The virtual memory mappings for the runtime services calls are implemented through a separate pmap that is only activated when we make a runtime services call. ok tom@, visa@ tested by naddy@
2017-12-31Tighten the permissions used in the early stage page tables somewhat.Mark Kettenis
Add an interface to establish additional VA=PA 1G block mappings for use by upcoming EFI runtime services support. ok guenther@
2017-12-30Implement CPU_BUSY_CYCLE and intr_disable/restore.Mark Kettenis
ok patrick@, tom@
2017-12-04Change __mp_lock_held() to work with an arbitrary CPU info structure andMartin Pieuchot
extend ddb(4) "ps /o" output to print which CPU is currently holding the KERNEL_LOCK(). Tested by dhill@, ok visa@
2017-10-24R_AARCH64_NONE should be zero, not 256. The latter was a deprecatedPhilip Guenther
assignment and isn't used by clang/lld. ok jsg@
2017-10-01set MAXSSIZ to the same value as on all other architectures (32MB)Christian Weisgerber
ok deraadt@
2017-09-05Move mutex, condvar, and thread-specific data routes, pthread_once, andPhilip Guenther
pthread_exit from libpthread to libc, along with low-level bits to support them. Major bump to both libc and libpthread. Requested by libressl team. Ports testing by naddy@ ok kettenis@
2017-08-27arm64 performance: use cache zeroing function in pmap_zero_page()Dale Rahn
This improves page zeroing (a rather common occurance) by over 8x. ok kettenis@, phessler@, tom@
2017-08-27Add glass console support for arm64. This uses the "stdout-path" propertyMark Kettenis
of the /chosen node in the device tree to decide whether the framebuffer should be used as the console device. Most, if not all, machines will have that set to use a serial console and there is no easy way yet to change that. ok jsg@
2017-08-09remove duplicated PAGE macros and drop type suffixJonathan Gray
ok kettenis@
2017-08-06Fix TCR definitions to avoid integer overflow. Rename TCR_ASID_16 to TCR_ASMark Kettenis
to match the official ARM docs. ok patrick@, tom@
2017-06-29kill RCSID macros; discussed with millertTheo de Raadt
2017-06-23Unbreak profiling assembly functions in userland by defining theMartin Pieuchot
correct prologue if compiled with -DPROF. ok deraadt@
2017-05-27Use EFI memory map to discover available physical memory.Mark Kettenis
Fall back on improved code that parses the FDT /memory node. However, on machines with "real" UEFI firmware, /memory may include reserved memory that we shouldn't use (it does on the Overdrive 1000). On those machines, make sure that you use BOOTAA64 0.3 or later such that the EFI memory map gets used. For now, print out the EFI memory map to help debug any issues. ok patrick@
2017-05-12Make atomic.h ready to be included in userland.Martin Pieuchot
- keep setbits/clearbits and virtio barriers inside _KERNEL ok dlg@, kettenis@
2017-05-10Remove pmep_pa_is_mem(). Instead create write-back cachable mappings byMark Kettenis
default an require callers of pmap_enter() and require pmap_kenter_pa() to explicitly request uncached mappings by passing the PMAP_NOCACHE flag in the low bits of the physical address like we do on other architectures. ok drahn@, patrick@
2017-05-08add a BUS_DMA_64BIT flag to bus_dma on all our archs.David Gwynne
this is so drivers can advertise that they can handle 64 dma addresses to the platform. it may choose to handle dmamaps differently based on this flag. tweaks and ok tom@ ok kettenis@
2017-04-30Unifdef KGDB.Martin Pieuchot
It doesn't compile und hasn't been working during the last decade. ok kettenis@, deraadt@
2017-04-27Add code to identify the CPUs on arm64 systems. The primary CPU is attachedMark Kettenis
and identified early on. For the secondary CPUs this happens late, such that the drivers we need to spin up CPUs, such as psci(4), will be available. This also fixes some code in simplebus(4) where the return value of OF_getprop() was not properly checked. Heavily based on an earlier diff from drahn@. ok drahn@, jsg@
2017-04-20Hook up mutex(9) to witness(4).Visa Hankala
2017-04-16Define EXT_IMPLICIT_NBIT like we do on sparc64 and mips64. Makes vaiousMark Kettenis
long double math stuff (including printf) actually work. While there remove 'struct ieee_ldouble', which isn't defined on other architectures. ok deraadt@
2017-04-13A little bit more trivial cleanup.Mark Kettenis
2017-04-13Provide mips64 with kernel-facing TCB_{GET,SET} macros that store itPhilip Guenther
in struct mdproc. With that, all archs have those and the __HAVE_MD_TCB macro can be unifdef'ed as always defined. ok kettenis@ visa@ jsing@
2017-04-11Revise 'struct fpreg' and dump floating-point register in core dumps. AlsoMark Kettenis
reset the floating-point register state upon exec. ok guenther@
2017-03-24Simplify ASID allocation code considerably by allocating an ASID up frontMark Kettenis
when a pmap is created and freeing it when the pmap is destroyed. This diff relies on the fill 16-bit ASID space being implemented in the processor. While this is documented as an optional feature in the ARMv8 architecture reference manual, all ARMv8 processors seen in the wild so far implement the full 16-bit space. This change incorporates changes by drahn@ to allocate an empty page table for the lower half of the address space for the kernel. ok drahn@, patrick@
2017-03-21Revise the definition of "struct reg" to have a layout compatible with otherMark Kettenis
operating systems. Implement process_read_regs() and make process_read_fpregs() clear the struct fpreg to avoid leaking kernel stack contents. This makes core dumps actually usable. ok drahn@
2017-03-16Remove some unused variables, unused types, duplicated/unused functionMark Kettenis
prototypes and duplicate defines. Also remove PMAP_CACHE_PTE, which is unused and misleading since the page tables are mapped as normal write-back cached memory. Fix a bunch on KNF issues as well. ok patrick@
2017-03-12Bring SROP mitigation to arm64. Make some small modifications to the armMark Kettenis
code as well to improve diffability. Changes the types used in the arm64 "struct sigcontext" to avoid having to include <sys/types.h>. ok deraadt@
2017-03-12Remove some unused cruft.Mark Kettenis
ok jsg@
2017-03-09Change the interrupt routing API to take a pointer to a "struct cpu_info"Mark Kettenis
instead of a cpu number. ok patrick@
2017-03-08Establish API to route interrupts to specific CPU cores.Patrick Wildt
Based on and ok drahn@