Commit Graph

1143 Commits

Author SHA1 Message Date
aymeric 0c43568c58 pmap_pinit(): improve the hash function in the case of collisions, the
previous version would easily make the low order bits oscillate between 0
and some other value.

Together with the previous change, this should make those
pmap_pinit: out of segments
panics even less likely.

We should really attempt a systematic search before panic()ing at the end.
2004-03-21 10:34:56 +00:00
aymeric 560cb79c0e . don't call VSID_TO_HASH() on a pmap.pm_vsid. It already holds the hash value.
This should fix PR #24754, as well as many of the hangs and process
  aborts reported on port-macppc@ in the last weeks.
  This error would cause the pmap's vsid never to be freed, and would
  occasionnally free a valid vsid used by another pmap, sometimes the kernel's.
. add a related KASSERT() to avoid regression
2004-03-21 10:25:59 +00:00
aymeric 3ddd2de94c defparam PMAP_MEMLIMIT 2004-03-17 14:14:02 +00:00
cl ea5ec0212d add kernel part of concurrency support for SA on MP systems
- move per VP data into struct sadata_vp referenced from l->l_savp
  * VP id
  * lock on VP data
  * LWP on VP
  * recently blocked LWP on VP
  * queue of LWPs woken which ran on this VP before sleep
  * faultaddr
  * LWP cache for upcalls
  * upcall queue
- add current concurrency and requested concurrency variables
- make process exit run LWP on all VPs
- make signal delivery consider all VPs
- make timer events consider all VPs
- add sa_newsavp to allocate new sadata_vp structure
- add sa_increaseconcurrency to prepare new VP
- make sys_sa_setconcurrency request new VP or wakeup idle VP
- make sa_yield lower current concurrency
- set sa_cpu = VP id in upcalls
- maintain cached LWPs per VP
2004-03-14 01:08:47 +00:00
christos fcc8e3a5b0 PR/24741: Aymeric Vincent: Variable sme_flags isn't initialized to zero 2004-03-11 15:40:13 +00:00
kleink 9ff09d5dff Pull in SPRs via <powerpc/spr.h> in this single instance, and dispose of
<machine/spr.h> again.
2004-03-02 00:35:54 +00:00
drochner 6f1a2b7cbf deliver SIGSEGV/SEGV_ACCERR if code execution on stack is attempted,
tested by Juergen Hannken-Illjes
(there are more uninitialized ksi.ksi_code arguments)
2004-02-24 18:31:46 +00:00
drochner 45fc887212 deliver SIGSEGV/SEGV_ACCERR if code execution on stack is attempted,
tested by Chuck Silvers
2004-02-24 18:25:27 +00:00
matt 77effcd27e Don't waste space on likely unused sysmon structure.
Instead malloc them as needed.
2004-02-17 22:03:52 +00:00
wiz d20841bb64 Uppercase CPU, plural is CPUs. 2004-02-13 11:36:08 +00:00
uebayasi 189c5218f4 Typo typo. 2004-01-31 14:12:33 +00:00
nonaka bf6adc04cc implement bus_space_set_region_[124], bus_space_copy_region_[124]. 2004-01-08 15:29:20 +00:00
briggs ad7a849c27 Change CPPFLAGS to -D${MACHINE}=${MACHINE} instead of just -D${MACHINE}
This makes it possible to define header files on the command line that
might include ${MACHINE} somewhere in the path.  This might be used in
evbppc, for example, when defining PPC_PCI_MACHDEP_IMPL as, for example:

PPC_PCI_MACHDEP_IMPL="<arch/evbppc/sandpoint/pci_machdep.h>"

which will be included as

#include PPC_PCI_MACHDEP_IMPL

Prior to this change, the compile would fail trying to include
<arch/evbppc/1/pci_machdep.h>
2004-01-06 18:44:57 +00:00
jdolecek 089abdad44 Rearrange process exit path to avoid need to free resources from different
process context ('reaper').

From within the exiting process context:
* deactivate pmap and free vmspace while we can still block
* introduce MD cpu_lwp_free() - this cleans all MD-specific context (such
  as FPU state), and is the last potentially blocking operation;
  all of cpu_wait(), and most of cpu_exit(), is now folded into cpu_lwp_free()
* process is now immediatelly marked as zombie and made available for pickup
  by parent; the remaining last lwp continues the exit as fully detached
* MI (rather than MD) code bumps uvmexp.swtch, cpu_exit() is now same
  for both 'process' and 'lwp' exit

uvm_lwp_exit() is modified to never block; the u-area memory is now
always just linked to the list of available u-areas. Introduce (blocking)
uvm_uarea_drain(), which is called to release the excessive u-area memory;
this is called by parent within wait4(), or by pagedaemon on memory shortage.
uvm_uarea_free() is now private function within uvm_glue.c.

MD process/lwp exit code now always calls lwp_exit2() immediatelly after
switching away from the exiting lwp.

g/c now unneeded routines and variables, including the reaper kernel thread
2004-01-04 11:33:29 +00:00
aymeric f45c23b807 fix an obvious typo which prevented the machdep.cacheinfo table from being
published.
This generated the following warning message at boot time:
sysctl_createv: sysctl_create(cacheinfo) returned 17
2004-01-03 00:09:15 +00:00
pk 70f20a1217 Replace the traditional buffer memory management -- based on fixed per buffer
virtual memory reservation and a private pool of memory pages -- by a scheme
based on memory pools.

This allows better utilization of memory because buffers can now be allocated
with a granularity finer than the system's native page size (useful for
filesystems with e.g. 1k or 2k fragment sizes).  It also avoids fragmentation
of virtual to physical memory mappings (due to the former fixed virtual
address reservation) resulting in better utilization of MMU resources on some
platforms.  Finally, the scheme is more flexible by allowing run-time decisions
on the amount of memory to be used for buffers.

On the other hand, the effectiveness of the LRU queue for buffer recycling
may be somewhat reduced compared to the traditional method since, due to the
nature of the pool based memory allocation, the actual least recently used
buffer may release its memory to a pool different from the one needed by a
newly allocated buffer. However, this effect will kick in only if the
system is under memory pressure.
2003-12-30 12:33:13 +00:00
manu fe7a5ddf22 Fix PowerPC ports build with KGDB. 2003-12-30 11:23:20 +00:00
mjl df0cb86d0d Add some casts to printf() args to make it compile w/ DEBUG set. 2003-12-27 13:35:52 +00:00
pk 5218af0651 Use uvm_km_zalloc(...) instead of uvm_km_alloc1(...,1). 2003-12-18 14:15:55 +00:00
simonb 4805123b12 Nuke register prefix for local variables, clean up indentation a little. 2003-12-17 04:04:40 +00:00
manu d2b4a2c0fa Enable SA_SIGINFO for COMPAT_DARWIN 2003-12-16 13:38:25 +00:00
manu c3eb252046 GPR5 does not hold code, it holds the signal number (this is the first
argument to the signal handler). It's an extraordinary luck that test
programs worked so far.
2003-12-16 13:36:18 +00:00
scw 6222bc14b8 Fix a typo in bswr2rb() which resulted in an 8-bit load instead 16-bit.
Pointed out by Derek Godfrey.
2003-12-11 23:52:25 +00:00
matt 0ecc4c35b5 Copy ksi->ksi_info, not all of ksi, to user stack. 2003-12-11 18:33:52 +00:00
simonb 8b18b565b8 Make some comments line up. 2003-12-09 09:49:01 +00:00
hannken 8e29a1a664 Make it compile without PPC_OEA. 2003-12-05 11:00:57 +00:00
atatat 13f8d2ce5f Dynamic sysctl.
Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al.  Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded.  Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment.  I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.
2003-12-04 19:38:21 +00:00
manu 057381d1b4 Move machine dependent definitions to machine dependent headers. 2003-12-03 18:25:44 +00:00
simonb 9c334e285d Remove unused ddbsave define. 2003-11-30 07:41:54 +00:00
manu 097771219f Implement vm_read, vm_write, and a framework for vm_machine_attribute.
THe machine dependent bit nees to be written.
2003-11-29 23:56:08 +00:00
simonb 2350e98506 Fix some white space nits. 2003-11-26 03:56:38 +00:00
simonb 19a9d14f26 Remove the prototype for the non-existent intr_md_register() function. 2003-11-26 03:55:38 +00:00
simonb da33cec9b3 Need offset of ci_curpm in struct cpu_info on 4xx as well. 2003-11-26 03:51:39 +00:00
matt 99f7a6b7db More PPC64 changes. (latent for now). 2003-11-21 22:57:14 +00:00
matt d765841d3e Restore ci_curpm since it re-enables 603 to working state. 2003-11-21 18:07:29 +00:00
matt 13e522ee98 Add PowerPC64 definitions 2003-11-21 17:40:48 +00:00
scw 1ba37196a9 Include arch/powerpc/ibm4xx/intr.c only if a particular board actually
uses the generic 4xx interrupt implementation.
There are some 4xx boards with entirely different interrupt controllers.
2003-11-19 14:27:24 +00:00
manu b6b7d129a1 Added mach_thread_set_state 2003-11-11 18:12:40 +00:00
manu a2bed85761 Implement mach_thread_get_state.
While we are here, try to tag machine dependent functions in header files.
also transformed darwin_ppc_*_state into mach_ppc_*_state, as this is
what they really are (COMPAT_DARWIN is on the top of COMPAT_MACH, not the
other way around)
2003-11-11 17:31:59 +00:00
he 1995f8d682 Replace an overlooked instance of p->p_nras with LIST_EMPTY(&p->p_raslist). 2003-11-06 08:49:13 +00:00
dsl 2ffbd2ab99 Remove p_nras from struct proc - use LIST_EMPTY(&p->p_raslist) instead.
Remove p_raslock and rename p_lwplock p_lock (one lock is enough).
Simplify window test when adding a ras and correct test on VM_MAXUSER_ADDRESS.
Avoid unpredictable branch in i386 locore.S
(pad fields left in struct proc to avoid kernel bump)
2003-11-04 10:33:15 +00:00
cl ef56cc40ab Reduce code duplication by adding mi_userret() in sys/userret.h
containing signal posting, kernel-exit handling and sa_upcall processing.

XXX the pc532, sparc, sparc64 and vax ports should have their
XXX userret() code rearranged to use this.
2003-10-31 16:44:34 +00:00
simonb 6d85c5e0d5 Don't pass the (unused) return value args to the
trace_enter()/systrace_enter() functions.
2003-10-31 03:28:12 +00:00
chs 6ef2bc9b82 make this compile again. 2003-10-28 15:28:24 +00:00
kleink 39dd1b6e20 pmap_print_mmuregs(): move initialization of addr before its first use;
reported by David Young.
2003-10-27 23:35:41 +00:00
dyoung 9dbaa63583 Stop false uninitialized variable warning. 2003-10-27 23:08:12 +00:00
dyoung 9a73ec4e1e Stop false uninitialized variable warning. 2003-10-27 22:48:20 +00:00
simonb 499ef1c1bb Remove (the now non-compiling) support for 128bit FP emulation, which
isn't needed for PowerPC anyway.
2003-10-27 04:32:02 +00:00
simonb 354075932d Fix a bogus uninitialised warning. 2003-10-27 04:30:32 +00:00
simonb 1baeb1502a Keep bogus gcc -Wuninitialised warnings happy. 2003-10-27 03:58:17 +00:00