summaryrefslogtreecommitdiff
path: root/sys/arch/arm64/arm64
AgeCommit message (Collapse)Author
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
2017-12-20Sync C mutex implementations.Martin Pieuchot
ok kettenis@
2017-12-18Generate SIGBUS/BUS_ADRALN when we see a PC Alignment Exception from userland.Mark Kettenis
ok patrick@
2017-12-14fcntl(F_SETFL) invokes the FIONBIO and FIOASYNC ioctls internally, soPhilip Guenther
the memory devices (/dev/null, /dev/zero, etc) need to permit them. problem noted, tweak, and testing by jeremy@ ok deraadt@
2017-12-11In uvm Chuck decided backing store would not be allocated proactivelyTheo de Raadt
for blocks re-fetchable from the filesystem. However at reboot time, filesystems are unmounted, and since processes lack backing store they are killed. Since the scheduler is still running, in some cases init is killed... which drops us to ddb [noted by bluhm]. Solution is to convert filesystems to read-only [proposed by kettenis]. The tale follows: sys_reboot() should pass proc * to MD boot() to vfs_shutdown() which completes current IO with vfs_busy VB_WRITE|VB_WAIT, then calls VFS_MOUNT() with MNT_UPDATE | MNT_RDONLY, soon teaching us that *fs_mount() calls a copyin() late... so store the sizes in vfsconflist[] and move the copyin() to sys_mount()... and notice nfs_mount copyin() is size-variant, so kill legacy struct nfs_args3. Next we learn ffs_mount()'s MNT_UPDATE code is sharp and rusty especially wrt softdep, so fix some bugs adn add ~MNT_SOFTDEP to the downgrade. Some vnodes need a little more help, so tie them to &dead_vnops. ffs_mount calling DIOCCACHESYNC is causing a bit of grief still but this issue is seperate and will be dealt with in time. couple hundred reboots by bluhm and myself, advice from guenther and others at the hut
2017-09-16The copyin(9) family of functions should return EFAULT for all memoryPhilip Guenther
protection issues. So make amd64 do that instead of passing through uvm_fault()'s return value, which lead to other possible errors (particularly EACCES) being returned to userspace. Clean up a vestige on arm64 too. ok bluhn@ deraadt@
2017-09-08If you use sys/param.h, you don't need sys/types.hTheo de Raadt
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-27Clear second return register on exec.Mark Kettenis
ok guenther@
2017-08-20Add Cortex-A55 and Cortex-A75 part numbers.Jonathan Gray