summaryrefslogtreecommitdiff
path: root/sys/arch/arm64/arm64
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-04Fix WITNESS build on arm64.Visa Hankala
OK guenther@
2018-05-04Add stack trace saving for arm64.Visa Hankala
OK guenther@
2018-05-03Add support for SMCCC 1.1 which provides proper support for the firmware-basedMark Kettenis
workaround for branch target injection attacks (CVE 2017-5715). ok patrick@, jsg@
2018-04-18Stop modifying vm page flags using mixed atomic and non-atomicPatrick Wildt
operations. This resolves one of the failures frequently seen on QEMU where spawning processes while another process is working can lead to crashes. Committing on behalf of drahn@ ok kettenis@ jsg@
2018-04-18Introduce a pmap lock on pmap_fault_fixup(). Heavily threadedPatrick Wildt
applications will crash without this lock as other threads attempt to walk the tree while another thread is adding/removing mappings. Committing on behalf of drahn@ ok kettenis@
2018-04-12Implement MAP_STACK option for mmap(). Synchronous faults (pagefault andTheo de Raadt
syscall) confirm the stack register points at MAP_STACK memory, otherwise SIGSEGV is delivered. sigaltstack() and pthread_attr_setstack() are modified to create a MAP_STACK sub-region which satisfies alignment requirements. Observe that MAP_STACK can only be set/cleared by mmap(), which zeroes the contents of the region -- there is no mprotect() equivalent operation, so there is no MAP_STACK-adding gadget. This opportunistic software-emulation of a stack protection bit makes stack-pivot operations during ROPchain fragile (kind of like removing a tool from the toolbox). original discussion with tedu, uvm work by stefan, testing by mortimer ok kettenis
2018-04-09Set trapframe pointer early on in do_el0_sync. This allows the use ofMark Kettenis
PROC_STACK() in the upcoming stack pointer checking diff and probably fixes bugs where ptrace(2) and core dumps would report the wrong register state. ok deraadt@
2018-04-09Get rid of some FreeBSD leftovers (that are mostly commented out already).Mark 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-29Call imxuart(4) early attach on arm64.Patrick Wildt
2018-03-29Initialize the secondary core's schedstate before spinning them up.Patrick Wildt
ok kettenis@
2018-03-29Set p->p_cpu in cpu_switchto() like we do on other MP architectures.Patrick Wildt
ok kettenis@
2018-03-20Do not panic from ddb(4) when a lock requirement isn't fulfilled.Martin Pieuchot
Extend the logic already present for panic() to any DDB-related operation such that if ddb(4) is entered because of a fault or other trap it is still possible to call 'boot reboot'. While here stop printing splassert() messages as well, to not fill the buffer. ok visa@, deraadt@
2018-03-09Remove bogus copying of bootargs.Mark Kettenis
From Arrtturi Alm.
2018-02-24Make ncpusfound count the available processors even if they don't attach.Mark Kettenis
ok patrick@
2018-02-23Get rid of the cpu_on_fn hook and call the psci(4) functions directly insteadMark Kettenis
like we already do in the code that flushes the BTB. ok jsg@
2018-02-20Release the secondary CPUs.Mark Kettenis
2018-02-20Make arm64 pmap (somewhat) mpsafe.Mark Kettenis
2018-02-19Remove almost unused `flags' argument of suser().Martin Pieuchot
The account flag `ASU' will no longer be set but that makes suser() mpsafe since it no longer mess with a per-process field. No objection from millert@, ok tedu@, bluhm@
2018-02-17Rename memhook to vmmap to match other archs.Mark Kettenis
ok millert@
2018-02-06Allow the kernel to recognize that it has been netbooted and to add theChristian Weisgerber
boot interface to the "netboot" group. efiboot grabs the MAC address from the PXE environment, passes it to the kernel, where it is matched against the list of ethernet interfaces and the boot device is set. Concept and most of the code cribbed from amd64. ok kettenis@
2018-02-02Enable interrupts in (synchronous) trap handlers.Mark Kettenis
ok patrick@
2018-01-31Make sure each CPU uses its own set of VAs for pmap_zero_page() andMark Kettenis
pmap_copy_page(). ok patrick@
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-28Bring this more in line with our other architectures.Mark Kettenis
ok patrick@
2018-01-27Sync the nam2blk entries with the bdevsw table, which is theChristian Weisgerber
definitive list of block devices supported on an architecture. ok kettenis@ deraadt@
2018-01-26Cleanup VFP code.Mark Kettenis
ok patrick@
2018-01-25Remove mutex implementations that now live in MI code.Martin Pieuchot
2018-01-21Move some code back from locore0.S to locore.S that we will need to bring upMark Kettenis
secondary CPUs. This involves adjusting get_virt_delta() to account for the fact that it may no longer live near the start of kernel code. Heavily based on a diff from drahn@. ok patrick@, deraadt@
2018-01-20Re-enable the code that unmaps the startup code once more now that lld isMark Kettenis
fixed.
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-13Add a barrier at the end of pmap_map_early() such that the new mapping isMark Kettenis
guaranteed to be available after pmap_map_early() returns. Fixes a hang seen with the in-progress SMP work. ok patrick@
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-11Add size for free.Visa Hankala
OK mpi@
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-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-30Delete unnecessary <sys/file.h> includesPhilip Guenther
ok millert@ krw@
2017-12-30Add copyin32 implementation.Mark Kettenis
ok guenther@
2017-12-29Use register_t instead of uint32_t in smc/hmc calls such that argumentsMark Kettenis
to SMC64 functions don't get truncated. Implement support for the CPU_ON call.
2017-12-27Initialize memhook such that /dev/mem access doesn't attempt to map pagesMark Kettenis
at address zero. Spotted by Artturi Alm. ok patrick@
2017-12-27Turns out linker scripts in lld are still subtly broken and aligningMark Kettenis
sections doesn't work when the -r option is used. Disable the unmapping code again until lld gets fixed.
2017-12-24Re-enable the code that unmaps the startup code. This was temporarilyMark Kettenis
disabled while lld was growing up, but forgotten about when gap.o was added back. ok deraadt@
2017-12-24For systems where the cpu node in the device tree has a "clocks" property,Mark Kettenis
implement hw.cpuspeed using the clock framework. ok patrick@
2017-12-24Generate SIGBUS/BUS_ADRALN when we see a SP Alignment Exception from userland.Mark Kettenis
ok jsg@
2017-12-23Remove stray space.Mark Kettenis