summaryrefslogtreecommitdiffstats
path: root/sys/arch/powerpc/include (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use the debugger mutex for `ddb_mp_mutex'. This should prevent a racevisa2019-03-231-3/+1
| | | | | | | | | | that could leave `ddb_mp_mutex' locked if one CPU incremented `db_active' while another CPU was in the critical section. When the race hit, the debugger was unable to resume execution or switch between CPUs. Race analyzed by patrick@ OK mpi@ patrick@
* Add intr_{disable,restore}() for powerpc.visa2019-03-231-1/+13
| | | | OK mpi@ patrick@
* Include srp.h where struct cpu_info uses srp to avoid erroring out whenjsg2018-12-051-1/+2
| | | | | | | including cpu.h machine/intr.h etc without first including param.h when MULTIPROCESSOR is defined. ok visa@
* Unify and bump some of the NMBCLUSTERS defines. Some archs had it set toclaudio2018-09-141-2/+2
| | | | | | | | | 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@
* Remove unused spllock().visa2018-08-201-2/+1
| | | | OK deraadt@ mpi@
* #define _MAX_PAGE_SHIFT in MD _types.h as the maximum pagesize an archderaadt2018-03-051-1/+2
| | | | | | | | | | 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
* Move common mutex implementations to a MI place.mpi2018-01-251-84/+2
| | | | | | Archs not yet converted can to the jump by defining __USE_MI_MUTEX. ok visa@
* Include <sys/mutex.h> rather than <machine/mutex.h>mpi2018-01-221-2/+2
| | | | Required by upcoming MI mutex change.
* Define and use IPL_MPFLOOR in our common mutex implementation.mpi2018-01-132-3/+4
| | | | ok kettenis@, visa@
* Unify <machine/mutex.h> a bit further.mpi2018-01-121-7/+8
| | | | | | `mtx_owner' becomes the first field of 'struct mutex' on i386/amd64/arm64. ok visa@
* Change __mp_lock_held() to work with an arbitrary CPU info structure andmpi2017-12-041-2/+2
| | | | | | | extend ddb(4) "ps /o" output to print which CPU is currently holding the KERNEL_LOCK(). Tested by dhill@, ok visa@
* Move mutex, condvar, and thread-specific data routes, pthread_once, andguenther2017-09-051-5/+1
| | | | | | | | 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@
* Remove leftovers of a past softintr mechanism.visa2017-07-251-5/+1
| | | | OK mpi@, kettenis@
* kill RCSID macros; discussed with millertderaadt2017-06-291-5/+1
|
* Unbreak profiling assembly functions in userland by defining thempi2017-06-231-2/+2
| | | | | | correct prologue if compiled with -DPROF. ok deraadt@
* Kill SPINLOCK_SPIN_HOOK, use CPU_BUSY_CYCLE() instead.mpi2017-05-291-3/+1
| | | | ok visa@, kettenis@
* Make atomic.h ready to be included in userland.mpi2017-05-121-3/+4
| | | | | | - keep setbits/clearbits inside _KERNEL ok dlg@, kettenis@
* Hook up mutex(9) to witness(4).visa2017-04-201-3/+15
|
* Provide mips64 with kernel-facing TCB_{GET,SET} macros that store itguenther2017-04-131-3/+1
| | | | | | | 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@
* In exec_elf.c: expand ELFNAME(), ELFNAME2(), and ELFNAMEEND() exceptguenther2017-02-081-4/+2
| | | | | | | | | | | | | | | | | | | | | | 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@
* Telling gcc the TCB pointer is in %r2 via the 'register asm' extensionguenther2016-09-041-35/+2
| | | | tests out on powerpc and generates slightly better code
* Increase the number of mbufs on most architectures. This is basedbluhm2016-09-031-2/+2
| | | | | | | 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@
* SROP mitigation. sendsig() stores a (per-process ^ &sigcontext) cookiederaadt2016-05-101-2/+2
| | | | | | | | 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
* Flush page (through the direct map) before mapping it into AGP. Fixeskettenis2016-05-071-1/+17
| | | | | | | artifacts seen in X on some G5 machines. Unfortunately not enough to fix G4 machines. With help from Marcus Glocker. ok mpi@
* Use a Thread Information Block in both single and multi-threaded programs.guenther2016-05-071-1/+4
| | | | | | | | | | | | | | | | | 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@
* G/C DDB_REGS.mpi2016-04-271-2/+1
|
* One ddb interface is enough for ppc.mpi2016-03-051-1/+6
|
* Define db_reg_t like the other archs by typedef'ing "struct trapframe".mpi2016-03-051-9/+6
| | | | | This will allow us to use some of the DDB macros on trapframe which are not DDB_REGS.
* The only network driver needing <net/if_types.h> is upl(4) for IFT_OTHER.mpi2015-11-241-2/+1
|
* Add a per-page flag to indicate that all mappings of that page should bekettenis2015-10-081-4/+5
| | | | | | uncached. To be used in the drm code. ok mpi@
* lint is dead and C99 may be old enough to drive a car: delete LONGLONGguenther2015-09-261-3/+1
| | | | | | comments ok millert@
* intr_barrier(9) for macppc and socppc.kettenis2015-09-131-2/+3
|
* Make the powerpc pmap (more) mpsafe by protecting both the pmap itself and thekettenis2015-09-111-1/+5
| | | | | | | pv lists with a mutex. This should make pmap_enter(9), pmap_remove(9) and pmap_page_protect(9) safe to use without holding the kernel lock. ok visa@, mpi@, deraadt@
* Provide remaining arch with END() macro for setting calculated size onguenther2015-08-301-1/+2
| | | | | | symbols in ASM ok deraadt@ mpi@
* _NLIST_DO_ELF is no longer needed: it's the only optionguenther2015-08-291-4/+2
| | | | ok deraadt@
* Add support for the Secure-PLT ABI variant. This will give us better W^Xkettenis2015-08-231-2/+7
| | | | | | support on powerpc as it uses a non-executable GOT and PLT. "start slamming stuff in" deraadt@
* replace the asm mutexes with a c implementation.dlg2015-08-142-6/+8
| | | | | | | | | | there's no real functional advantage to this, except that it will make it easier to add deadlock detection to the code. this is modelled on the c mutex implementation thats on alpha, mips64, and hppa. ok mpi@ kettenis@
* 17 years ago, setfault() was modified to save the status register in themiod2015-07-291-2/+1
| | | | | | | | | | | | | | faultbuf. But 1/ sr was only restored for machine check exceptions, and 2/ the way it was saved was unsafe if interrupts were enabled, and could cause %r2 to be lost. Discussing this with deraadt@ at the end of c2k15, this was probably needed for the old VI boards which were the target of the original powerpc port, came with a worse-than-Genesi openfirmware. Since then, machine check exceptions have been unheard of; or, if they happen, they do not need the status register to be restored. ok mpi@ deraadt@
* introduce srp, which according to the manpage i wrote is short fordlg2015-07-021-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "shared reference pointers". srp allows concurrent access to a data structure by multiple cpus while avoiding interlocking cpu opcodes. it manages its own reference counts and the garbage collection of those data structure to avoid use after frees. internally srp is a twisted version of hazard pointers, which are a relative of RCU. jmatthew wrote the bulk of a hazard pointer implementation and changed bpf to use it to allow mpsafe access to bpfilters. however, at s2k15 we were trying to apply it to other data structures but the memory overhead of every hazard pointer would have blown out significantly in several uses cases. a bulk of our time at s2k15 was spent reworking hazard pointers into srp. this diff adds the srp api and adds the necessary metadata to struct cpuinfo on our MP architectures. srp on uniprocessor platforms has alternate code that is optimised because it knows there'll be no concurrent access to data by multiple cpus. srp is made available to the system via param.h, so it should be available everywhere in the kernel. the docs likely need improvement cos im too close to the implementation. ok mpi@
* remove __cpu_cas and use atomic_cas_ulong instead.dlg2015-06-261-21/+1
| | | | ok mpi@
* rename the guard #define from _MACHINE_MPLOCK_H_ to _POWERPC_MPLOCK_H_dlg2015-06-261-4/+4
|
* move the ppc mplock implementation from macppc to powerpc.dlg2015-06-261-0/+52
| | | | ok mpi@
* IPL_MPSAFE bits for macppc with openpic(4).mpi2015-06-241-9/+8
|
* Add bits missed in previous... I suck at cvs.mpi2015-06-051-10/+9
|
* put mpi's atomics back in, but with the return value of add (and therefore sub, inc, and dec) fixed.dlg2015-05-061-2/+240
| | | | | | | | | | | | | the asm read the value from memory into a register, added to it, and then tried to write it back. after succeeding it doesnt have to add again before returning. this splits sub, inc, and dec off from add. sub can use the subf opcode, and inc and dec can use the addic opcode. explicitely identify where the modified memory is so we can avoid using "memory" as a clobber. ok mpi@
* emul_native is only used for kernel threads which can't dump core, soguenther2015-05-051-5/+1
| | | | | | | | | | | delete coredump_trad(), uvm_coredump(), cpu_coredump(), struct md_coredump, and various #includes that are superfluous. This leaves compat_linux processes without a coredump callback. If that ability is desired, someone should update it to use coredump_elf32() and verify the results... ok kettenis@
* Remove SIZE_MAX from limits.h. It was added years ago before wemillert2015-04-301-4/+1
| | | | had a proper stdint.h. No ports fallout. OK guenther@ miod@
* Revert back to using GCC builtins. This code triggers an off by one inmpi2015-04-241-168/+2
| | | | device_unref() as found by deraadt@.
* Implement the MI atomic API for PowerPC to avoid using gcc builtins thatmpi2015-04-221-2/+168
| | | | | | include extra sync operations. ok kettenis@
* The ELF psABI for PPC specifies that the stack shall always be 16-byte aligned.guenther2015-04-211-2/+2
| | | | ok mpi@ deraadt@