summaryrefslogtreecommitdiff
path: root/sys/arch/powerpc
AgeCommit message (Collapse)Author
2018-08-20Remove unused spllock().Visa Hankala
OK deraadt@ mpi@
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-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-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-01-25Remove mutex implementations that now live in MI code.Martin Pieuchot
2018-01-25Move common mutex implementations to a MI place.Martin Pieuchot
Archs not yet converted can to the jump by defining __USE_MI_MUTEX. ok visa@
2018-01-22Include <sys/mutex.h> rather than <machine/mutex.h>Martin Pieuchot
Required by upcoming MI mutex change.
2018-01-13Define and use IPL_MPFLOOR in our common mutex implementation.Martin Pieuchot
ok kettenis@, visa@
2018-01-12Unify <machine/mutex.h> a bit further.Martin Pieuchot
`mtx_owner' becomes the first field of 'struct mutex' on i386/amd64/arm64. ok visa@
2018-01-11Add size for free.Visa Hankala
OK mpi@
2017-12-30Delete unnecessary <sys/file.h> includesPhilip Guenther
ok millert@ krw@
2017-12-20Sync C mutex implementations.Martin Pieuchot
ok kettenis@
2017-12-04Change __mp_lock_held() to work with an arbitrary CPU info structure andMartin Pieuchot
extend ddb(4) "ps /o" output to print which CPU is currently holding the KERNEL_LOCK(). Tested by dhill@, ok visa@
2017-10-18add support for printing function arguments when displaying a traceJasper Lievisse Adriaanse
from DDB. this uses CTF to get the correct number of arguments. ok mpi@
2017-09-11Sync alpha/mips64/powerpc mutex implementations.Martin Pieuchot
No functionnal change. ok visa@
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-07-25Remove leftovers of a past softintr mechanism.Visa Hankala
OK mpi@, kettenis@
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-30Kill db_sym_t.Martin Pieuchot
ok deraadt@, kettenis@, jasper@
2017-05-29Kill SPINLOCK_SPIN_HOOK, use CPU_BUSY_CYCLE() instead.Martin Pieuchot
ok visa@, kettenis@
2017-05-16Implement copyin32(9).Mark Kettenis
ok mpi@, visa@
2017-05-12Make atomic.h ready to be included in userland.Martin Pieuchot
- keep setbits/clearbits inside _KERNEL ok dlg@, kettenis@
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-20Hook up mutex(9) to witness(4).Visa Hankala
2017-04-13Provide mips64 with kernel-facing TCB_{GET,SET} macros that store itPhilip Guenther
in struct mdproc. With that, all archs have those and the __HAVE_MD_TCB macro can be unifdef'ed as always defined. ok kettenis@ visa@ jsing@
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-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@
2016-12-20fix an uninitialised variable on altivec assist trapJonathan Gray
ok krw@ 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-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-10take it one step further and bring the message inline with arm/sparc64Jasper Lievisse Adriaanse
pointed out by guenther@
2016-09-09don't hardcode the filename in an error message; use the function name insteadJasper Lievisse Adriaanse
ok jsg@ (who spotted the powerpc straggler too) millert@
2016-09-04Telling gcc the TCB pointer is in %r2 via the 'register asm' extensionPhilip Guenther
tests out on powerpc and generates slightly better code
2016-09-03Increase the number of mbufs on most architectures. This is basedAlexander Bluhm
on a guess how much memory a typical machine has. If the value is too high, users may run out of kernel memory. Then we will have to adjust this again. OK claudio@ deraadt@
2016-06-07consistently set ipls on pmap pools.David Gwynne
this is a step toward making ipls unconditionaly on pools. ok deraadt@ kettenis@
2016-05-10SROP mitigation. sendsig() stores a (per-process ^ &sigcontext) cookieTheo de Raadt
inside the sigcontext. sigreturn(2) checks syscall entry was from the exact PC addr in the (per-process ASLR) sigtramp, verifies the cookie, and clears it to prevent sigcontext reuse. not yet tested on landisk, sparc, *88k, socppc. ok kettenis
2016-05-07Flush page (through the direct map) before mapping it into AGP. FixesMark Kettenis
artifacts seen in X on some G5 machines. Unfortunately not enough to fix G4 machines. With help from Marcus Glocker. ok mpi@
2016-05-07Use a Thread Information Block in both single and multi-threaded programs.Philip Guenther
This stores errno, the cancelation flags, and related bits for each thread and is allocated by ld.so or libc.a. This is an ABI break from 5.9-stable! Make libpthread dlopen'able by moving the cancelation wrappers into libc and doing locking and fork/errno handling via callbacks that libpthread registers when it first initializes. 'errno' *must* be declared via <errno.h> now! Clean up libpthread's symbol exports like libc. On powerpc, offset the TIB/TCB/TLS data from the register per the ELF spec. Testing by various, particularly sthen@ and patrick@ ok kettenis@
2016-04-27G/C DDB_REGS.Martin Pieuchot
2016-03-19Reduces the noise around the global ``ticks'' variable by renamingMartin Pieuchot
all the local ones to ``nticks''. ok stefan@, deraadt@
2016-03-06DDB_REGS -> ddb_regsMartin Pieuchot
2016-03-05One ddb interface is enough for ppc.Martin Pieuchot
2016-03-05Define db_reg_t like the other archs by typedef'ing "struct trapframe".Martin Pieuchot
This will allow us to use some of the DDB macros on trapframe which are not DDB_REGS.
2016-03-02DDB_REGS -> ddb_regs in db_regs[], no reason to be different.Martin Pieuchot
2015-11-24The only network driver needing <net/if_types.h> is upl(4) for IFT_OTHER.Martin Pieuchot
2015-10-08Add a per-page flag to indicate that all mappings of that page should beMark Kettenis
uncached. To be used in the drm code. ok mpi@
2015-09-26lint is dead and C99 may be old enough to drive a car: delete LONGLONGPhilip Guenther
comments ok millert@
2015-09-21Fix membar positioning in mtx_enter_try() and (critically!) mtx_leave()Mark Kettenis
Same diff as guenther@ committed for alpha. ok guenther@