summaryrefslogtreecommitdiff
path: root/sys/arch/arm
AgeCommit message (Collapse)Author
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-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-16Make FPU registers available in core dumps and through ptrace(2).Mark Kettenis
ok visa@, patrick@
2018-03-08Rework and cleanup the linker script for armv7. The main feature isPatrick Wildt
that it gives us a read-only data section. In addition the linker script is now easily diffable to arm64 and we also stop mapping some unnecessary space before the kernel. Prompted by deraadt@ ok kettenis@
2018-03-05Do not redefine PAGE_SHIFT/PAGE_SIZE/PAGE_MASK in vmparam.h; thoseTheo de Raadt
definitions are already found in param.h ok jsg
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-03-01AAPCS requires 8-byte alignment for 64-bit types. We missed this when weMark Kettenis
did the big EABI switch. Do it now before we get into trouble with using floating-point and vector instructions that actually require things to be properly aligned. This breaks the ABI. In particular, file descriptor passing will be broken if kernel and userland are not in sync. Upgrading from a snap is highly recommended. ok otto@, patrick@, jsg@, phessler@, deraadt@
2018-02-28Explicitly align svcstack and esym. Finally fixes the problem whereMark Kettenis
kernels wouldn't boot because the random order in which we happened to link it would cause these symbols to be misaligned. Thanks to Brandon Bergren for figuring out the problem.
2018-02-25Typo: auxilliary -> auxiliaryPhilip Guenther
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-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-11Rework the DDB trace handling for armv7. By switching to clang thePatrick Wildt
stack frame format has changed. Apparently AAPCS doesn't specify at all what a stack frame looks like. We end up with much simpler code, but also with a lot less information in the trace. ok kettenis@
2018-02-10Convert armv7 to MI mutex.Martin Pieuchot
Tested by jsg@, ok patrick@
2018-02-10Replace two spaces indents with tabs. Makes it easier to read andPatrick Wildt
especially makes it easier to diff against our other linker scripts. ok jsg@
2018-02-10Supplying entropy from etext has created a regression on arm where wePatrick Wildt
get an alignment fault while copying the data. Turns out that since we have .rodata in the text segment, it's very easily possible that etext remains unaligned. Work around this by word-aligning etext. The next step is to split .rodata out of the text segment. ok deraadt@
2018-02-10Put the ldscript parts into a single file instead of storing it as headPatrick Wildt
and tail and cat(1) it together. It was maybe needed when ports needed different contents, but now it's just a headache. ok deraadt@
2018-02-06Make sure sigfillsiz is word aligned.Patrick Wildt
ok kettenis@
2018-01-26Add kernel support for the VFP FPU/SIMD unit. Based on a diff by drahn@.Mark Kettenis
This allows us to use floating-pointer and vector instructions in userland code. The current implementation assumes all 32 VFP registers are present. This should be the case on all armv7 hardware currently supported by OpenBSD. ok patrick@
2018-01-23Revise 'struct fpreg' such that it can actually represent the full VFPv3-D32Mark Kettenis
state. ok patrick@
2018-01-15Improve defense against branch predictor target injection (Spectre "variant 2")Mark Kettenis
attacks. OpenBSD/armv7 is already in pretty good shape as we have always been flushing the branch predictor cache on context switches. This diff adds additional flushes to page faults in kernel address space. The impact on performance should be minimal as these page faults should only happen when userland (deliberately or accidentally) tries to access kernel addres space which would lead to a fatal signal (SIGSEGV or SIGBUS). Loosely based on changes made by Marc Zyngier in Linux and based on information in Arm Trusted Firmware Security Advisory TFV 6. Note that for Cortex-A15 (and Cortex-A72) you will need firmware that sets the ACTRL[0] bit for this diff to be effective. Also note that with this diff Cortex-A57 is still vulnerable. ok jsg@
2018-01-11Add size for free.Visa Hankala
OK mpi@
2017-12-30Delete unnecessary <sys/file.h> includesPhilip Guenther
ok millert@ krw@
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-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-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-10-26Discard exception handling information as we do on other architectures.Mark Kettenis
ok patrick@, deraadt@
2017-10-01set MAXSSIZ to the same value as on all other architectures (32MB)Christian Weisgerber
ok deraadt@
2017-09-11Remove whitespace in inline assembly output constraint strings. WhileJonathan Gray
gcc is documented as ignoring whitespace in any position but the first clang gives "error: invalid output constraint '=r ' in asm".
2017-09-08If you use sys/param.h, you don't need sys/types.hTheo de Raadt
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-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-20Add Cortex-A55 and Cortex-A75 part numbers.Jonathan Gray
2017-08-17Fix typo in comments: s/return/returns/ in "a function that never return."Tom Cosgrove
2017-08-17tedu unused, vestigial, arm STACKCHECKS code that only fills and never checksTom Cosgrove
ok drahn@
2017-08-12remove apmwarn sysctl which is not usedTed Unangst
2017-07-31Use unsigned long instead of uint32_t, which is the appropriate integerMark Kettenis
type for storing pointers in our universe. Avoids an implicit dependence on <sys/types.h>. ok tom@
2017-07-25Print CPU type as we do on arm64. This is how ARM prints revisions in itsMark Kettenis
documentation. ok patrick@, tom@
2017-07-21Accessing a mmap(2)ed file behind its end should result in a SIGBUSMark Kettenis
according to POSIX. ok bluhm@, deraadt@
2017-07-12remove CPU_LIDSUSPEND/machdep.lidsuspendMartin Natano
"fire away!" tedu
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-18Fix kernel build on armv7 and sh.Visa Hankala
Pointed out by deraadt@
2017-05-12Make atomic.h ready to be included in userland.Martin Pieuchot
- keep setbits/clearbits and virtio barriers inside _KERNEL - prefix def_atomic_xxx macros with underscores
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-05-05Remove /* FALLTHROUGH */ that isn't (and shouldn't).Mark Kettenis
2017-05-02Remove check for compatible property. Turns out sunxi relied on the brokenMark Kettenis
check we had before rev 1.16. Suggested by jmatthew@
2017-04-30Make early attrbute work here as well. Remove unreachable panic while there.Mark Kettenis
ok visa@, patrick@, drahn@
2017-04-30Rename Debugger() into db_enter().Martin Pieuchot
Using a name with the 'db_' prefix makes it invisible from the dynamic profiler. ok deraadt@, kettenis@, visa@
2017-04-30Unifdef KGDB.Martin Pieuchot
It doesn't compile und hasn't been working during the last decade. ok kettenis@, deraadt@