summaryrefslogtreecommitdiff
path: root/sys/arch/arm
AgeCommit message (Collapse)Author
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-07Record the target mask for the boot CPU when we attach and use that to pickMark Kettenis
the target CPU interface when establishing an interrupt. Makes interrupts work on machines that boot up on a CPU that is attached to a CPU interface that isn't zero. Discussed with Dale Rahn.
2017-03-03Fix the lidsuspend sysctl name in arm/include/cpu.hTom Cosgrove
From Markus Hennecke, thanks
2017-03-02Add a new sysctl machdep.lidaction. The sysctl works as follows:Martin Natano
machdep.lidaction=0 # do nothing machdep.lidaction=1 # suspend machdep.lidaction=2 # hibernate lidsuspend is just an alias for lidaction, so if you change one, the other one will have the same value. The plan is to remove machdep.lidsuspend eventually when people have upgraded their /ets/sysctl.conf. discussed with deraadt, who came up with the new MIB name no objections mlarkin ok stsp halex jcs
2017-02-28Switch geteblks()'s size argument from int to size_t. It's called withMartin Natano
unsigned variables as argument in most places anyway. Decrease the chance of signedness/range mismatch issues. ok stefan
2017-02-15Bump MAXTSIZ to 64M on arm.Jeremie Courreges-Anglas
Needed for ports/devel/llvm which builds large executables with a .text section over 32M. Remove the comment about the +/-32M limitation of branch instructions, which can be lifted using other techniques (eg cc -mlong-calls) and should not be enforced by the kernel. ok guenther@ patrick@ jsg@ kettenis@
2017-02-12Split up fork1():Philip Guenther
- FORK_THREAD handling is a totally separate function, thread_fork(), that is only used by sys___tfork() and which loses the flags, func, arg, and newprocp parameters and gains tcb parameter to guarantee the new thread's TCB is set before the creating thread returns - fork1() loses its stack and tidptr parameters Common bits factor out: - struct proc allocation and initialization moves to thread_new() - maxthread handling moves to fork_check_maxthread() - setting the new thread running moves to fork_thread_start() The MD cpu_fork() function swaps its unused stacksize parameter for a tcb parameter. luna88k testing by aoyama@, alpha testing by dlg@ ok mpi@
2017-02-08In exec_elf.c: expand ELFNAME(), ELFNAME2(), and ELFNAMEEND() exceptPhilip Guenther
leaving out the size, so that ELFNAME2(exec,makecmds) becomes exec_elf_makecmds instead of exec_elf{32,64}_makecmds and then delete the ELFNAME2() and ELFNAMEEND() macros. Move the prototypes for functions local to exec_elf.c to there from exec_elf.h. Simplify the SMALL_KERNEL conditionals around the ELF coredump code. Change exec_conf.c to use the size-generic names and macros Remove exec_elf{32,64}.c and just build exec_elf.c; delete the _KERN_DO_ELF and _KERN_DO_ELF64 #defines. ok jca@, encouragement from deraadt@ and tom@
2017-02-07There are 1023 possible values for the interrupts, but our masks limitPatrick Wildt
these currently to 255. Thus making it impossible to use higher IRQs than that. The AMD Seattle SoC though seems to provide 448 IRQs, which is kind of out of bounds, so raise them to the proper values. This makes interrupts work on that machine.
2017-02-06add a license for the code in here, all of which i seem to have written.David Gwynne
this has been pointed out to me by a couple of people now.
2017-01-24Rename pfind(9) into tfind(9) to reflect that it deals with threads.Martin Pieuchot
While here document prfind(9. with and ok guenther@
2017-01-23remove #defines present in MI conf.h; ok kettenisTheo de Raadt
2017-01-23No need to explicitly use config_activate_children in the cfattach struct.Mark Kettenis
2017-01-21Move virtio config from files.pci to files.pciReyk Floeter
virtio itself is not PCI, it is a paravirtual bus on top of either PCI or MMIO (arm). This is the first step of moving the virtio files to dev/pv. No functional change. arm kernel changes tested by jsg@ and patrick@ no objections from sf@ mlarkin@
2017-01-21p_comm is the process's command and isn't per thread, so move it fromPhilip Guenther
struct proc to struct process. ok deraadt@ kettenis@
2017-01-13Ansify cpu_sysctl() on alpha, arm, arm64, luna88k and sparc64.Frederic Cambus
OK mpi@
2017-01-06there is no longer a need to ifdef __armv7__ armv6 rev instructionsJonathan Gray
2017-01-06unifdef CPU_ARMv7 and ARM_ARCH_7Jonathan Gray
ok kettenis@ patrick@
2017-01-05Complete idle PCB allocation for secondary processors so that it makesPatrick Wildt
sense and builds as part of an MP kernel. ok kettenis@ mpi@
2017-01-04unifdef CPU_XSCALE_PXA2X0, ARM_MMU_XSCALE, ARM_MMU_GENERIC (armv3)Jonathan Gray
and remove some xscale definitions. ok kettenis@
2017-01-03Add simplefb(4), a driver to support the framebuffer set up by the firmwareMark Kettenis
on some platforms that use device trees. Works on Allwinner (sunxi) and should also work on Raspberry Pi (broadcom) armv7 platforms. ok jsg@, visa@
2017-01-02remove unused armv4 and xscale filesJonathan Gray
ok kettenis@ patrick@
2017-01-01recognise Cortex A32Jonathan Gray
2016-12-30Remove unused headers.Jeremie Courreges-Anglas
ISA and PIO don't really fit in the ARM landscape. Suggested by patrick@ and kettenis@, ok deraadt@
2016-12-24Match on "arm,gic-400" another GICv2 compat string.Jonathan Gray
ok patrick@ kettenis@
2016-12-23The code to retrieve the interrupt ID only works if the amount of IRQsPatrick Wildt
supported by the controller is not too big. Otherwise the mask will be wrong and the calculated IRQ as well. Split the dynamic mask into two pieces. First of all use a static mask to remove the bits we don't want to look at. Then we use that value to check for spurious or false IRQs. ok jsg@
2016-10-22If an Access Flag fault happens while we were running the kernel andPatrick Wildt
it happened on a kernel page, we need to consult the kernel pmap instead of the current proc's pmap. Fixes panic when using tmpfs. ok kettenis@
2016-10-21Outsource simplebus softc definition so that it can be used byPatrick Wildt
simplebus compatible bus drivers. ok kettenis@
2016-10-19Change pmap_proc_iflush() to take a process instead of a procPhilip Guenther
powerpc: rename second argument of pmap_proc_iflush() to match other archs ok kettenis@
2016-10-08Various printf claim to report the PID, so actually report that and not the TIDPhilip Guenther
Build testing assistance from deraadt@
2016-10-05Some device trees use 64-bit intermediate virtual addresses. ThisPatrick Wildt
means that even though the hardware in the end never leaves the 32-bit address space, some addresses used solely in the device tree can be bigger than 32-bit. As bus_space_map(9) takes addresses of size bus_addr_t, which is 32-bit on ARMv7, we cannot pass those virtual addresses to the parent bus, even though it will be mapped back into a 32-bit address in the end. To work around this, make bus_space_map(9) take a 64-bit address. Since this is implemented as a macro and function pointer we can safely do that without harming any other architecture. ok kettenis@ deraadt@
2016-10-02The userspace TCB_GET() shouldn't take an argumentPhilip Guenther
ok deraadt@ tom@ patrick@
2016-09-26Remove xscale support. Properly distinguish between ARMv7 and ARMv8.Mark Kettenis
ok patrick@, jsg@
2016-09-25Make a move towards ending 4 decades of kernel snooping.Theo de Raadt
Add sysctl kern.allowkmem (default 0) which controls the ability to open /dev/mem or /dev/kmem at securelevel > 0. Over 15 years we converted 99% of utilities in the tree to operate on sysctl-nodes (either by themselves or via code hiding in the guts of -lkvm). pstat -d and -v & procmap are affected and continued use of them will require kern.allowkmem=1 in /etc/sysctl.conf. acpidump (and it's buddy sendbug) are affected, but we'll work out a solution soon. There will be some impact in ports. ok kettenis guenther
2016-09-24Stick the thread control block pointer into a CPU register on ARMv7.Patrick Wildt
ok guenther@
2016-09-24If the value of r0 upon entering the kernel is zero, interpret this as theMark Kettenis
address of the end of the symbol table. This will make it possible to get rid of the code in the bootloader that patches up the kernel with the updated esym value. ok tom@, patrick@
2016-09-24Remove a couple of unsused static inline functions. Also remove a comparisMark Kettenis
of an array to a null pointer that is always false. Found with clang. ok jsg@
2016-09-24Add an implementation of __aeabi_ldivmode() and __aeabi_uldivmod(); clangMark Kettenis
generates calls to these functions when compiling an armv7 kernel. Code from NetBSD's unified userland+kernel implementation, with lots of irrelevant (for us) #ifdefs removed. ok patrick@, guenther@
2016-09-23Use "%s" to print the version string. Avoids a "format string is not aMark Kettenis
string literal" warning from clang and matches what we do on amd64.
2016-09-21Modernize arm assembly in the kernel for clang.Mark Kettenis
Based on a similar diff in bitrig. No binary change when compiled with gcc. ok patrick@
2016-09-20Complete bus_dmamap_load_raw(9) implementation for ARM. My initialPatrick Wildt
commit did not copy the vaddr information to the map's segments. This means non-coherent bus dma raw mappings could not be synced. As only agp(4) and radeondrm(4) seem to make use of non-coherent raw mappings at the moment, this bug did not cause any visible effects. From Marius Strobl. ok kettenis@
2016-09-20one too many close parenthesesJasper Lievisse Adriaanse
spotted by Markus Hennecke
2016-09-19ansify function definitionsJasper Lievisse Adriaanse
ok guenther@ millert@
2016-09-19fix whitespace at EOLJasper Lievisse Adriaanse
2016-09-18Use a locator (named "early") to let designated drivers attach before others.Mark Kettenis
ok patrick@, jsg@
2016-09-18option INSECURE is obsoleteTheo de Raadt
2016-09-16Define PT_ARM_EXIDX.Mark Kettenis
ok guenther@
2016-09-15all pools have their ipl set via pool_setipl, so fold it into pool_init.David Gwynne
the ioff argument to pool_init() is unused and has been for many years, so this replaces it with an ipl argument. because the ipl will be set on init we no longer need pool_setipl. most of these changes have been done with coccinelle using the spatch below. cocci sucks at formatting code though, so i fixed that by hand. the manpage and subr_pool.c bits i did myself. ok tedu@ jmatthew@ @ipl@ expression pp; expression ipl; expression s, a, o, f, m, p; @@ -pool_init(pp, s, a, o, f, m, p); -pool_setipl(pp, ipl); +pool_init(pp, s, a, ipl, f, m, p);
2016-09-04Remove support for tape block devices. Nobody mount(8)s tapes any longer.Christian Weisgerber
ok deraadt@ guenther@
2016-09-03remove strongarm files that were abused by zaurusJonathan Gray