summaryrefslogtreecommitdiff
path: root/sys/arch/m88k
AgeCommit message (Collapse)Author
2010-12-27Do not issue a cache maintainance operation until the last one is notMiod Vallat
completed; this used to be the case, but revision 1.25 of this file, close to four years ago, changed this behaviour by mistake. The side effects of this mishandling of the cache did not show up until the kernel memory allocation strategy moved towards fast reuse of freed pages. Took me a while to track this down, maybe I'm getting too old to write code, I probably should write backdoors instead.
2010-12-26Misplaced splx() in pmap_unsetbit().Miod Vallat
2010-12-26Kill pmap_phys_address(), and force every driver's mmap() routine to returnMiod Vallat
a physical address [more precisely, something suitable to pass to pmap_enter()'sphysical address argument]. This allows MI drivers to implement mmap() routines without having to know about the pmap_phys_address() implementation and #ifdef obfuscation.
2010-12-23The exception vector page on m88k systems has always been the same page asMiod Vallat
the one used by the firmware, which (at least on mvme88k) is at address zero. This is unfortunate, since this means that NULL pointer dereferences in the kernel are not caught, and writes cause havoc. This behaviour was necessary to be able to use the PROM system call interface during early bootstrap, without having to disassemble the VBR page and update branches - which use pc-relative displacement - if we were to use a different VBR address. On mvme88k, change this and actually set up two VBR pages: one, over the PROM page (except for the system call vectors), and another one in the kernel image (which will be mapped read-only). We'll run with the PROM page until the end of autoconf, and then switch to the kernel one, and unmap all the PROM below it. As a bonus, the final kernel page can use optimized data access fault handlers, which do not have to check for faults caused by badaddr(), since badaddr() is only used during device probe on buses which do not support hotplug. There are a few infrastructure collateral damage on aviion and luna88k, but these ports do not change their behaviour yet.
2010-12-23Check for pcb_onfault being set for genuine kernel data faults, copyout()Miod Vallat
may be invoked with an address under the kernel text and we're about to stop having such pages always mapped.
2010-12-23Make the pte created by pmap_map() wired, and count them in pmap_kernel()'sMiod Vallat
statistics. This allows these mappings to be removed with pmap_kremove() without messing with accounting.
2010-12-21Convert netisr to a normal soft interrupt instead of hanving MD codeClaudio Jeker
for it. This makes the netisr a real C function which will help further development. No noticable performance change on i386 and amd64. With input from kettenis@ and miod@ additional OKs mikeb@ and henning@
2010-12-20KNFMiod Vallat
2010-12-20mvme88k kernels running on 88110 systems have been prone to panicing forMiod Vallat
``invalid opcode'' in kernel mode after being idle for a few hours, since many months already. This panic does not make sense. Recently, I've been able to gather enough samples and, looking at the instructions surrounding the panic location, I have narrowed a pattern, and I'll conveniently blame these panics upon a (to the best of my knowledge) new genuine 88110 bug. The exception handler will now recognize this situation and apply a large hammer of workaround - probably not the best workaround that could be devised, but it's short, easy to implement, and works 100% of the time so far. Besides, since the machine is idle, who cares as long as it keeps running? (the curious reader will find more information in the trap.c comments)
2010-12-15oops, i forgot to check in the BRKSIZ define in uvm, but deraadt thinksTed Unangst
its better as a per arch MD define anyway. all default to MAXDSIZ as before.
2010-11-27Remove ddb single-step load and store counters. Most platforms do notMiod Vallat
implement them, and they are of questionable usefulness.
2010-11-18Declare pmap_proc_iflush() in <uvm/uvm_pmap.h> unless <machine/pmap.h>Miod Vallat
provides an inline version of it.
2010-09-28Implement a per-cpu held mutex counter if DIAGNOSTIC on all non-x86 platforms,Miod Vallat
to complete matthew@'s commit of a few days ago, and drop __HAVE_CPU_MUTEX_LEVEL define. With help from, and ok deraadt@.
2010-06-27Bunch of include adjustements to restore compilability.Miod Vallat
2010-06-26Don't #include <sys/user.h> into files that don't need the stuffPhilip Guenthe
it defines. In some cases, this means pulling in uvm.h or pcb.h instead, but most of the inclusions were just noise. Tested on alpha, amd64, armish, hppa, i386, macpcc, sgi, sparc64, and vax, mostly by krw and naddy. ok krw@
2010-06-22Don't play with cacheability in vmapbuf() - pmap_enter() knows what it does.Miod Vallat
This is a leftover from a very old workaround for a very old and long gone pmap_enter() bug.
2010-06-22Since our caches are snooping, we only need to broadcast cache invalidatesMiod Vallat
on 88110 designs. Brings a ~8% speedup on GENERIC.MP on 197DP.
2010-05-09hander -> handlerJasper Lievisse Adriaanse
ok miod@
2010-05-02Precompute the userland process apr cache bits into a global variable.Miod Vallat
On AViiON systems with the 6:1 CMMU:CPU configuration, force cached mappings to be writethrough - this probably hides a bug in the code, but that's the only way so far to get such a system running stably.
2010-04-25Update various comments.Miod Vallat
2010-04-21<sys/systm.h> required now.Miod Vallat
2010-04-20destintation -> destinationMiod Vallat
2010-04-18Work in progress support for AViiON models 4600 and 530.Miod Vallat
Also features support for {awkw,bast}ard 6:1 CMMU:CPU configurations (4I2D). Tested on model 4605, which runs up to cpu_initclocks(), which is not written for this system family yet. No regression on model 4300.
2009-12-16zap two more handrolled equivalents of nitems().Jasper Lievisse Adriaanse
ok miod@
2009-11-27Move MB_LEN_MAX into the machine-independent sys/limits.h header,Philip Guenthe
rather than defining it separately for each architecture. Also set it to 4, to accommodate for future UTF-8 support (rfc3629). Diff by stsp, committing to catch the libc major bump ok kettenis@, guenther@
2009-11-04Get rid of __HAVE_GENERIC_SOFT_INTERRUPTS now that all our platforms support it.Mark Kettenis
ok jsing@, miod@
2009-09-27In pmap_proc_iflush(), do not bother checking for pmap being curpmap on anyMiod Vallat
processor, since caches are physically addressed and we are working on physical addresses.
2009-08-13A new(er) mtx_enter_try().Tobias Weingartner
Ok oga@, "the time is now" deraadt@.
2009-05-02Drop the pm_cpus bitmask field from struct pmap, and instead remember theMiod Vallat
currently active userland pmap in each processors struct cpu_info. This thus skips the complete tlb flush if idle switches back to the proc previously running on this processor.
2009-04-27Revert mtx_enter_try. It didn't compile on hppa, it doesn't compile onMark Kettenis
landisk, and the sparc implementation is obviously wrong. That's where I stopped looking, so who knows what else was broken. A simple comparison of the existing mtx_enter with the new mtx_enter_try would have told anybody.
2009-04-25Enter mtx_enter_try. In part for completeness, things may startTobias Weingartner
using this soon(ish). Ok oga@, sorta yes kettenis@.
2009-04-19Rename max_cpus to ncpusfound and compute it regardless of optionMiod Vallat
MULTIPROCESSOR.
2009-03-26Remove cpu_wait(). It's original use was to be called from the reaper soOwain Ainsworth
MD code would free resources that couldn't be freed until we were no longer running in that processor. However, it's is unused on all architectures since mikeb@'s tss changes on x86 earlier in the year. ok miod@
2009-03-15Generic softinterrupt support for m88k based platforms, adapted from armMiod Vallat
with different locking mechanism. 88110 soft ipi are replaced with an ipi callback which is checked upon return from exception (it can not be kept as a softintr, as the generic softinterrupt code doesn't have per-cpu pending softintr queues).
2009-03-15Introduce splsoftassert(), similar to splassert() but for soft interruptMiod Vallat
levels. This will allow for platforms where soft interrupt levels do not map to real hardware interrupt levels to have soft ipl values overlapping hard ipl values without breaking spl asserts.
2009-03-04Since 88110 processors can not flush individual TLB entries, instead ofMiod Vallat
flushing the whole TLB block every time a pte is modified, store a bitmask of pending flushes and do them at pmap_update() time. 88100 behaviour is unchanged.
2009-03-04Introduce atomic_clear_int() as an MD atomic operation to perform atomicMiod Vallat
exchange with zero; use it in the soft interrupt code to make it simpler and faster.
2009-03-04Fix stupid logic bug in rw_cas_m88k(), makes NFS much happier on SMP kernels.Miod Vallat
2009-03-01Files forgotten during last commit:Miod Vallat
Rework nmi handling to handle ``complex'' NMI faster, and return as fast as possible from the exception, without doing the AST and softintr dance. This should avoid too much stack usage under load. ok deraadt@
2009-02-21Move part of the mp lock logic into per-cpu callbacks; on MVME197DP we needMiod Vallat
to disable NMI sources in addition to interrupt sources, and we can not use a quick sequence with shadowing frozen as done for atomic ops. This lets GENERIC.MP boot multiuser on MVME197DP boards, and is so far stable enough to be able to recompile a kernel from scratch (with make -j2).
2009-02-21Get rid of 88110 nmi stacks. This was a good idea, but I outsmarted myselfMiod Vallat
since it was intended to service NMI occuring in user mode, and we could end up invoking preempt() and have another cpu start using this stack, with interesting results.
2009-02-20This should get me nominated for the ``stupidest bug of the year'' award.Miod Vallat
2009-02-20atomic_{set,clear}bits_int were not safe enough on 88110 systems, as theyMiod Vallat
can be interrupted by NMI; move the SMP version of these routines from inlines to a separate file (kernel text shrinks 20KB...). Since the implementation for 88110 becomes really hairy, the pre-main() code is responsible for copying the appropriate code over for kernels configured for both 88100 and 88110 cpus, to avoid having to choose the atomicity strategy at runtime. Hairy, I said. This gets GENERIC.MP run much further on 197DP. Not enough to reach multiuser mode, but boots up to starting sshd and then panics.
2009-02-18In __cpu_simple_lock(), do not hog the bus with exclusive accesses; ifMiod Vallat
xmem didn't return the expected value, spin doing regular loads until it appears we have a chance to grab the lock again.
2009-02-18typoMiod Vallat
2009-02-17Pass a cpu_info * to setsoftipi() so it does not need to curcpu(), whichMiod Vallat
synchronizes the pipeline on 88110.
2009-02-16More 88110 SMP work. Contains, horribly entangled:Miod Vallat
- dma_cachectl() split into a ``local cpu only'' and ``all cpus'', and an ipi to broadcast ``local dma_cachectl'' is added. - cpu_info fields are rearranged, to have the 88100-specific information and the 88110-specific information overlap, and has many more 88110 ugly things. - more ipi handling in the 197-specific area. Since it is not possible to have the second processor receive any hardware interrupt (selection is done on a level basis via ISEL, and we definitely do not want the main cpu to lose interrupts), the best we can do is to inflict ourselves a soft interrupt for late ipi processing. It gets used for softclock and hardclock on the secondary processor, but since the soft interrupt dispatcher doesn't have an exception frame, we have to remember parts of it to build a fake clockframe from the soft ipi handler (ugly but works). This now lets GENERIC.MP run a few userland binaries before bugs trigger.
2009-02-16Since NMI are now handled separately, remove the ``interrupt type'' argumentMiod Vallat
from interrupt() and related function pointers.
2009-02-16Rewrite the way the initial processing of exceptions is done on 88110 - weMiod Vallat
now set up both the exception frame structure and the exception stack as soon as possible, so that we can safely get interrupted by an NMI as soon as we reenable shadowing.
2009-02-15If we are on the NMI stack, do not switch to the curpcb stack moments later,Miod Vallat
this defeats the purpose of having a separate stack at this point... Oopsie