summaryrefslogtreecommitdiff
path: root/sys/arch/powerpc
AgeCommit message (Collapse)Author
2015-04-24Revert back to using GCC builtins. This code triggers an off by one inMartin Pieuchot
device_unref() as found by deraadt@.
2015-04-23Fix 13 years old typo that should be responsible for the unhappinessMartin Pieuchot
of UVM on PowerPC architectures by breaking pmap_is_referenced() and friends. ok kettenis@
2015-04-22Implement the MI atomic API for PowerPC to avoid using gcc builtins thatMartin Pieuchot
include extra sync operations. ok kettenis@
2015-04-21The ELF psABI for PPC specifies that the stack shall always be 16-byte aligned.Philip Guenther
ok mpi@ deraadt@
2015-03-31Make it possisble to disable block address translation mechanism onMartin Pieuchot
processors that support it. Due to the way trap code is patched it is currently not possible to enabled/disable BAT at runtime. ok miod@, kettenis@
2015-03-31Merge two versions of ppc_check_procid().Martin Pieuchot
ok miod@, kettenis@ as part of a larger diff
2015-02-15Change pmap_remove_holes() to take a vmspace instead of a map as its argument.Miod Vallat
Use this on vax to correctly pick the end of the stack area now that the stackgap adjustment code will no longer guarantee it is a fixed location.
2015-02-11no md code wants lockmgr locks, so no md code needs to include sys/lock.hDavid Gwynne
with and ok miod@
2015-02-11make the rwlock implementation MI.David Gwynne
each arch used to have to provide an rw_cas operation, but now we have the rwlock code build its own version. on smp machines it uses atomic_cas_ulong. on uniproc machines it avoids interlocked instructions by using straight loads and stores. this is safe because rwlocks are only used from process context and processes are currently not preemptible in our kernel. so alpha/ppc/etc might get a benefit. ok miod@ kettenis@ deraadt@
2015-02-09oops, accidental commitTheo de Raadt
2015-02-09syncTheo de Raadt
2015-02-08Do not assume that addresses passed to bus_space_map(9) are relativeMartin Pieuchot
to the bus base address, that's not the case with radeondrm(9) cards on G5. From miod@
2015-01-24Implement bus_dmamem_alloc_range(9) for macppc/socppc.Mark Kettenis
2015-01-22pool_setipl() on both pmap pools as a workaround for some sort of MPTheo de Raadt
race. This will certainly be revisited, but too much time has been spent on it for now. ok mpi
2015-01-22Let powerpc's bus_space(9) use the same pmap and uvm interfaces than theMartin Pieuchot
other archs. Specify the caching policy by passing PMAP_* flags to pmap_kenter_pa() like the majority of our archs do and kill pmap_kenter_cache(). Spread some pmap_update() along the way. While here remove the unused flag argument from pmap_fill_pte(). Finally convert the bus map/unmap functions to km_alloc/free() instead of uvm_km_valloc/free(). Inputs from kettenis@ and miod@, ok miod@
2015-01-21Even without BATs memory under ``physmaxaddr'' is mapped 1:1 in theMartin Pieuchot
kernel, so update pmap_extract() accordingly and save a VP lookup. While here unify pted checks after the VP lookups. ok miod@
2015-01-20Merge two copies of the (almost) identical bus space code into one file.Martin Pieuchot
This brings bus_space_mmap(9) to socppc and change its bus_space_map(9) implementation to use kernel_map instead of phys_map like macppc and everybody else.
2015-01-20Nothing in this file requires <sys/queue.h>. While here remove old andMartin Pieuchot
unused typedef & external definitions.
2015-01-20Merge two copies of the same dma code into one file and sync the headers.Martin Pieuchot
ok kettenis@
2015-01-20Various cleanups. Explicitly include <sys/atomic.h>, Use pmap_remove_pg()Martin Pieuchot
for the kernel pmap and kill pmap_kremove_pg(). Finally guard the hash lock code under "MULTIPROCESSOR" to explicit which part of the code received some MP love. ok kettenis@
2015-01-04Implement splassert(9) for powerpc.Martin Pieuchot
This changes the logic to prevent a recursion when processing soft interrupts. Previously a per-CPU flag was set before re-enabling interrupts. Now the IPL level is raised to SOFTTTY which makes splsoftassert() happy, greatly inspired by mips64. As a side effect, the ppc_intr_{disable,enable}() dance is now done only once instead of twice per splx(9). While here, make use of dosoftint() instead of having 3 different functions for dispatching soft interrupts. Tested by deraadt@ on G4 smp and by myself G5 smp, G3, G4 and socppc. No objection from the usual (and over busy) suspects.
2014-12-23force the pool of pmapvp onto PAGE_SIZE allocations by specifying aDavid Gwynne
pool allocator. pmapvp is 1024 bytes, and the size * 8 change in pools without an allocator being specified tries to place it on large pages. you need pmap to use large pages, and pmap isnt set up yet. fixed a very early fault on macppc. debugged with and tested by krw@ ok deraadt@ krw@
2014-12-17remove simplelocks useTheo de Raadt
ok kettenis mpi
2014-11-25Speed up page zeroing by using a loop of dcbz/dcbzl instead of bzero().Martin Pieuchot
While here, use the direct map for pmap_copy_page() and remove the now unused stolen page addresses. No objection from the usual suspects, "it works, commit" deraadt@
2014-11-18make pmap_zero_page MP-safe, by using the directmapTheo de Raadt
mpi will investigate speedups after this. ok mpi kettenis
2014-11-16Replace a plethora of historical protection options with justTheo de Raadt
PROT_NONE, PROT_READ, PROT_WRITE, and PROT_EXEC from mman.h. PROT_MASK is introduced as the one true way of extracting those bits. Remove UVM_ADV_* wrapper, using the standard names. ok doug guenther kettenis
2014-11-02Only mark segment 0 as executable on 64-bit systems. There it is harmless asMark Kettenis
we have a proper X bit in the page tables. On 32-bit systems kernel .text is handled by an IBAT, so we don't need page table entries that are executable in the kernel pmap. ok mpi@
2014-10-27Remove the spilling code for IBAT register and set up the first IBAT registerMark Kettenis
to cover the first 8 MB of memory such that it covers kernel .text and not much else. This is a first step towards W^X in the kernel for machines with G4 and older processors. ok mpi@
2014-10-27Remove execute permission from most pages in the kernel pmap. This is a firstMark Kettenis
step towards W^X in the kernel, even though it is only effective on machines with a G5 processor. ok mpi@
2014-10-22make [bl]emtoh{16,32,64} take volatile const foo *, not volatile foo *David Gwynne
while in the manpage add volatile where the code has it too. ok miod@ guenther@
2014-10-10Make CPU_INFO_FOREACH useable before secondary CPUs are started.Martin Pieuchot
ok deraadt@, mlarkin@
2014-10-08Introduce ppc_mttb() and use it instead of rerolling the move to timeMartin Pieuchot
base dance in inline assembly in various places. tweak and ok miod@
2014-09-08Delete procfs; it's always had races and is now unused: no one noticed forPhilip Guenther
months that I broke it before the 5.5 release. confirmed as not being required by ports by sthen@, ajacoutot@, dcoppa@
2014-09-06Rename ci_iactive into ci_flags, this field now holds the going-to-Martin Pieuchot
sleep bit.
2014-09-06Rewrite cpu_idle & friends to not check and update the hid0 registerMartin Pieuchot
in the idle loop, in preparation for G5 support. Only do a disable/enable interrupt dance if the running CPU supports a sleep mode. Fix entering ddb(8) from interrupt context by not modifying the return address of the 'forced' trap frame. While here, modify the existing logic to terminate prefetching of all data streams if AltiVec is supported before setting the POW bit. With inputs/explanations from drahn, looks ok to miod@
2014-09-06Rewrite the PowerPC stack dump routine to delimit the trap & interruptMartin Pieuchot
contexts with markers (---like on x86---) and print the associated type or number when available. While here, gyp' the support for process tracing (tr /p). ok miod@
2014-09-06Add functions to manipulate IBM PowerPC 970 specific registers thatMartin Pieuchot
will be used in upcoming MP and idle support. ok miod@
2014-07-22<netinet/in_systm.h> is no longer needed.Martin Pieuchot
2014-07-13use nitems() instead of handrolling something identicalJasper Lievisse Adriaanse
ok mpi@ sthen@
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-07-12Tackle the endian.h mess. Make it so that:Philip Guenther
* you can #include <sys/endian.h> instead of <machine/endian.h>, and ditto <endian.h> (fixes code that pulls in <sys/endian.h> first) * those will always export the symbols that POSIX specified for <endian.h>, including the new {be,le}{16,32,64}toh() set. c.f. http://austingroupbugs.net/view.php?id=162 if __BSD_VISIBLE then you also get the symbols that our <machine/endian.h> currently exports (ntohs, NTOHS, dlg's bemtoh*, etc) * when doing POSIX compiles (not __BSD_VISIBLE), then <netinet/in.h> and <arpa/inet.h> will *stop* exporting the extra symbols like BYTE_ORDER and betoh* ok deraadt@
2014-07-11CPU_BUSY_CYCLE(): A new MI statement for busy loop power reductionMasao Uebayashi
The new CPU_BUSY_CYCLE() may be put in a busy loop body so that CPU can reduce power consumption, as Linux's cpu_relax() and FreeBSD's cpu_spinwait(). To start minimally, use PAUSE on i386/amd64 and empty on others. The name is chosen following the existing cpu_idle_*() functions. Naming and API may be polished later. OK kettenis@
2014-07-09obvious need for systm.h, which no longer comes in from something user.h ↵Theo de Raadt
includes
2014-07-09pull in uvm/uvm_extern.h (before and) and instead pmap.h, and do not assumeTheo de Raadt
that user.h's tentacles fetched it even earlier.
2014-07-03Include <sys/mutex.h> explicitely here.Matthieu Herrb
It will no longer be pulled by uvm_extern.h in the short future. ok jsg@
2014-06-19Implement the membar(9) API for powerpc.Mark Kettenis
ok miod@, dlg@
2014-06-18Add missing synchronization instructions.Mark Kettenis
ok mpi@
2014-05-11Move the increment of uvmexp.softs back to the caller of mi_ast():Philip Guenther
it needs to be done atomicly on some MP archs and we don't have atomic_add_int() everywhere yet. Also, mi_ast() was meant to be inline. noted by miod@
2014-05-10bring things syscall_mi.h needs into scope earlierTheo de Raadt
ok guenther
2014-05-10Factor out the common ast bits into mi_ast()Philip Guenther
ok deraadt@