summaryrefslogtreecommitdiff
path: root/sys/arch/arm
AgeCommit message (Collapse)Author
2019-03-13Store whether or not the VFP was active on entering the unhandledPatrick Wildt
instruction trap and pass it to the VFP fault handler, so that it knows if we faulted with the VFP active or disabled. Reading the status in the VFP fault handler does not work since at that point the VFP already got disabled. ok kettenis@
2019-02-10revert revert revert. there are many other archs that use custom allocs.Ted Unangst
2019-02-10make it possible to reduce kmem pressure by letting some pools use a moreTed Unangst
accomodating allocator. an interrupt safe pool may also be used in process context, as indicated by waitok flags. thanks to the garbage collector, we can always free pages in process context. the only complication is where to put the pages. solve this by saving the allocation flags in the pool page header so the free function can examine them. not actually used in this diff. (coming soon.) arm testing and compile fixes from phessler
2019-01-24Add .fpu directives in inline assembly to silence new compilerMark Kettenis
warnings/errors about using VFP2 instructions. We use vfpv3 here (which corresponds to vfpv3-d32) since that is the minimum requirement for OpenBSD/armv7. ok jsg@, patrick@
2019-01-22flense more trailing whitespacePeter Hessler
2019-01-22remove trailing whitespace in the Laptop Package part of the license text.Peter Hessler
no words or punctation were modified.
2019-01-05match arm64 and print unconfigured simplebus devices on armv7Jonathan Gray
ok dlg@ kettenis@
2018-12-07For shared interrupts we need to make sure that we registerPatrick Wildt
with the lowest IPL. Once we actually run the IRQ handler we raise to the highest IPL. Fixes a crash seen when having a network card in the PCIe slot of the MacchiatoBin. ok ccardenas@
2018-12-05Include srp.h where struct cpu_info uses srp to avoid erroring out whenJonathan Gray
including cpu.h machine/intr.h etc without first including param.h when MULTIPROCESSOR is defined. ok visa@
2018-10-02Unify the MD byteswapping code as much as possible across architectures.Christian Weisgerber
Use inline functions instead of GNU C statement expressions, and make them available to userland. With clues from guenther@. ok guenther@ kettenis@
2018-09-14Unify and bump some of the NMBCLUSTERS defines. Some archs had it set toClaudio Jeker
4MB which is far too low especially when the platform is able to run MP. New limits are, amd64 = 256M; arm64, mips64, sparc64 = 64M; alpha, arm, hppa, i386, powerpc = 32M; m88k, sh = 8M Still rather conservative numbers but much better than before. At least some hangs of arm64 build boxes was caused by this. OK kettenis@, visa@
2018-09-06fix whitespaceJonathan Gray
2018-08-11Use MAXCPUS as the number of elements for the array of per-cpu data.Mark Kettenis
ok jsg@, patrick@
2018-08-08Extend the FDT interrupt API to support masking and unmasking IRQs.Patrick Wildt
Discussed with kettenis@
2018-08-06Make it possible to build a MULTIPROCESSOR kernel on armv7. While thisMark Kettenis
doesn't actually spin up any secondary CPUs, it does run. Mostly a cleanup of <machine/cpu.h> along the lines of what I did earlier on arm64. Makes armv7 use the MI mplock implementation and implements copyin32. ok patrick@
2018-08-06Give the FDT interrupt API a more generic naming by replacing thePatrick Wildt
arm_intr_* prefix with fdt_intr_*. ok kettenis@
2018-07-10Move from sendsig() to its callers the initsiginfo() calls andPhilip Guenther
instead of passing sendsig() the code+type+val, pass a siginfo_t* to copy from. Eliminate the indirection through struct emul for sendsig(); we no longer have a SunOS4-compat version of sendsig() ok deraadt@
2018-07-09Add PCI machdep headers based on the arm64 port.Patrick Wildt
ok kettenis@
2018-07-09Implement ampintcmsi(4) in ampintc(4) to support MSI. The GICv2M is anPatrick Wildt
extension to the GIC controller, which is represented as subnode in the device tree. There can be multiple GICv2Ms, so it makes sense to attach those to ampintc(4) as some kind of simplebus. The GICv2M is simply an interrupt generator that can be used by PCIe devices to ring the door bell. There is no need for further configuration, we only need to find out which SPIs we are allowed to use for MSI and to register an edge triggered interrupt on a (randomly) allocated SPI. Implement support for interrupt types. The GIC only seems to support level triggered active-high or egdge triggered low-to-high interrupts. We currently always configure them to be level triggered, which is a sane default for most controllers. Since MSI interupts on the GIC are edge triggered, we need to be able to parse the type information and to configure the interrupt correspondingly. ok kettenis@
2018-06-30Remove strange /* End of file */ style.Theo de Raadt
2018-06-26Make ast() call refreshcreds(). Tweak this code to be similar to the amd64.Mark Kettenis
ok phessler@, guenther@
2018-06-23Save and restore FPU registers around signal handlers.Mark Kettenis
Fixes the random crashes in sh(1). ok guenther@
2018-06-22Move up the setting of pcb_tf, refreshcreds(), and stack check so thatPhilip Guenther
we can be sure signals posted from userret() are based on the correct information ok kettenis@
2018-06-22Update the pointer to the trapframe in the PCB when handling an AST.Mark Kettenis
From drahn@, ok guenther@
2018-06-22Save and restore the relevant FPU state on armv7.Mark Kettenis
ok deraadt@
2018-06-04Remove the cpu_reset_needs_v4_MMU_disable flag; it's always true for hardwareMark Kettenis
that OpenBSD runs on. ok patrick@
2018-06-03Remove #ifdef __XSCALE__ bits. No binary change.Mark Kettenis
ok deraadt@
2018-05-15Remove a4x bus space hack.Mark Kettenis
ok patrick@
2018-05-07Use speed from device tree for serial console on armv7 too.Mark Kettenis
ok visa@, patrick@
2018-05-04Add a common rules file for ofw sources to help keep the configurationsVisa Hankala
of fdt-enabled platforms in sync. OK deraadt@
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-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@