Commit Graph

534 Commits

Author SHA1 Message Date
jhb
30b152864c thread_exit() requires PROC_LOCK to be held, so lock it. 2002-07-11 22:13:33 +00:00
mike
7ffb7525e5 Remove label_t and physadr, which seem to have never been used in
FreeBSD.

Submitted by:	bde
2002-07-10 15:47:59 +00:00
mike
ebfda4c0dd Move __offsetof() macro from <machine/ansi.h> to <sys/cdefs.h>. It's
hardly MD, since all our platforms share the same macro.  It's not
really compiler dependent either, but this helps in reducing
<machine/ansi.h> to only type definitions.
2002-07-08 16:43:35 +00:00
peter
62e40d1277 Add a special page zero entry point intended to be called via the single
threaded VM pagezero kthread outside of Giant.  For some platforms, this
is really easy since it can just use the direct mapped region.  For others,
IPI sending is involved or there are other issues, so grab Giant when
needed.

We still have preemption issues to deal with, but Alan Cox has an
interesting suggestion on how to minimize the problem on x86.

Use Luigi's hack for preserving the (lack of) priority.

Turn the idle zeroing back on since it can now actually do something useful
outside of Giant in many cases.
2002-07-08 04:24:26 +00:00
peter
b73c441dad Collect all the (now equivalent) pmap_new_proc/pmap_dispose_proc/
pmap_swapin_proc/pmap_swapout_proc functions from the MD pmap code
and use a single equivalent MI version.  There are other cleanups
needed still.

While here, use the UMA zone hooks to keep a cache of preinitialized
proc structures handy, just like the thread system does.  This eliminates
one dependency on 'struct proc' being persistent even after being freed.
There are some comments about things that can be factored out into
ctor/dtor functions if it is worth it.  For now they are mostly just
doing statistics to get a feel of how it is working.
2002-07-07 23:05:27 +00:00
peter
2727877234 Fix (s/proc/thread/) some typos in two panic messages. 2002-07-07 22:50:41 +00:00
peter
48d11f9343 Back out proc part of last commit. UMA manages the thread cache only, and
we just have to deal with the kstack when told to.  We do not have a
UMA-managed cache for the proc struct and its associated upage yet.  So,
go back to the old lazy mechanism.  Note that if UMA destroys pages that
used to contain proc structures, we'll lose the corresponding upage
forever.  (zones never did this - once a page was allocated, it stayed
attached to the proc zone forever)
2002-07-05 01:27:35 +00:00
peter
5d120cf80b Take a shot at implementing changes from i386/pmap.c rev 1.328-1.331. 2002-07-05 00:38:43 +00:00
mike
beba9fcf0e Since printf(3) now supports the `j' conversion specifier, use that
when printing intmax_t and uintmax_t.

Forgotten by:	mike
Noticed by:	bde
2002-06-30 05:48:03 +00:00
rwatson
3e3677e3e3 Remove ALT_BREAK_TO_DEBUGGER. This was inconsistent (both in form
and function) with existing configuration choices.  Arguably if
ALT_BREAK_TO_DEBUGGER was present, so should have been
BREAK_TO_DEBUGGER.  Regardless, it broke the option sort order in
these kernel configuration files.

Requested by:	bde
2002-06-30 04:12:21 +00:00
julian
b858fa511c Fix reverse ordering of locks. add a comment about locks on some platforms.
Submitted by:	jhb@freebsd.org
2002-06-29 23:58:50 +00:00
julian
aa2dc0a5d9 Part 1 of KSE-III
The ability to schedule multiple threads per process
(one one cpu) by making ALL system calls optionally asynchronous.
to come: ia64 and power-pc patches, patches for gdb, test program (in tools)

Reviewed by:	Almost everyone who counts
	(at various times, peter, jhb, matt, alfred, mini, bernd,
	and a cast of thousands)

	NOTE: this is still Beta code, and contains lots of debugging stuff.
	expect slight instability in signals..
2002-06-29 17:26:22 +00:00
julian
a06b68b34f Add files that are new for KSE. 2002-06-29 07:04:59 +00:00
jake
c5b25f086b Fix a deletion during traversal tailq bug. 2002-06-29 06:37:24 +00:00
obrien
581ba5cbdd Do NOT enable ATA_STATIC_ID -- cmd646 controller will be !ata2!,
and you will not mount an ATA /:
	mountroot> ufs:/ad0a
	Mounting root from ufs:/ad0a
	setrootbyname failed
	ffs_mountroot: can't find rootvp
2002-06-29 04:42:03 +00:00
peter
b6009897cf Remove a couple of __P() stragglers. 2002-06-29 02:32:34 +00:00
mux
c13cdc98b2 GENERIC now builds with -Werror, so remove NO_WERROR.
Approved by:	jake
2002-06-27 14:43:27 +00:00
jake
e17570ea7d pmap_kremove can no longer be used to remove the magic device mappings
installed with pmap_kenter_flags, since the physical addresses may not
have an associated vm_page.  Add a function to do this.

Tested by:	Tomi Vainio <Tomi.Vainio@Sun.COM>
2002-06-25 15:13:09 +00:00
jake
e102a9b6dd Add an MD callout like cpu_exit, but which is called after sched_lock is
obtained, when all other scheduling activity is suspended.  This is needed
on sparc64 to deactivate the vmspace of the exiting process on all cpus.
Otherwise if another unrelated process gets the exact same vmspace structure
allocated to it (same address), its address space will not be activated
properly.  This seems to fix some spontaneous signal 11 problems with smp
on sparc64.
2002-06-24 15:48:02 +00:00
mini
ef6f2f567d Remove unused diagnostic function cread_free_thread().
Approved by:	alfred
2002-06-24 06:22:00 +00:00
mux
af8d245e93 Add a missing prototype to fix a warning. 2002-06-23 21:29:00 +00:00
mux
e0761b9824 Include machine/critical.h to get missing prototypes.
Reviewed by:	tmm
2002-06-23 14:38:41 +00:00
jake
877630816b Fix a bug related to marking pages virtually uncacheable due to illegal
dcache aliasing.  A page that already had more than 1 mapping of the
same virtual colour would not be correctly uncached.

Noticed by:	Artur Grabowski <art@openbsd.org>
2002-06-22 23:55:15 +00:00
mux
398085672a Warning fix.
Reviewed by:	peter
2002-06-22 20:46:59 +00:00
jake
006e0b22c0 {f,s}usword -> {f,s}uword16. Implement {f,s}uword32.
Requested by:	peter
2002-06-20 20:41:57 +00:00
peter
df4ec1a7b3 Deorbit suibyte(). It was only used for split address space systems
for supporting UIO_USERISPACE (ie: it wasn't used).
2002-06-20 07:13:35 +00:00
peter
4830c34648 Move the "- 1" into the RQB_FFS(mask) macro itself so that
implementations can provide a base zero ffs function if they wish.
This changes
  #define RQB_FFS(mask) (ffs64(mask))
  foo = RQB_FFS(mask) - 1;
to
  #define RQB_FFS(mask) (ffs64(mask) - 1)
  foo = RQB_FFS(mask);
On some platforms we can get the "- 1" for free, eg: those that use the
C code for ffs64().

Reviewed by:	jake (in principle)
2002-06-20 06:21:20 +00:00
obrien
a1cfbf791e Sync with i386. 2002-06-18 01:11:04 +00:00
jake
384222848c Add constants for the min and max prom addresses. Use these instead of
magic numbers.  Use stxa_sync instead of stxa; membar #Sync; to ensure
that no instruction is placed between the two.  This can cause random
corruption even though interrupts are already disabled.
2002-06-17 15:44:10 +00:00
tmm
0d05c0dd9c Add PCI bus enumeration and latency timer setup to the sparc64 MD PCI
code. Both tasks are not always performed completely by the firmware.
The former is required to get some e450 models to boot; the latter fixes
the repeated fifo underruns with hme(4)s and gem(4)s observed on some
machines (and probably performance problems with other peripherals as
well).
2002-06-12 19:20:57 +00:00
jake
c7a429349c Add code to drop to ddb when a process gets a fatal signal that usually
suggests kernel bugs (4, 10, 11).  Add a sysctl debug.debugger_on_signal
which turns this on and off, default off.
2002-06-08 07:36:28 +00:00
jake
012b4f04b0 Re-enable SMP by default. 2002-06-08 07:22:36 +00:00
jake
b13b0b35c1 Remove test code. 2002-06-08 07:21:52 +00:00
jake
56400fc901 Remove code from trap which is handled in userland now. 2002-06-08 07:17:19 +00:00
jake
51d015a4b6 Fix bizarre SMP problems. The secondary cpus sometimes start up with junk
in their tlb which the prom doesn't clear out, so we have to do so manually
before mapping the kernel page table or the cpu can hang due various
conditions which cause undefined behaviour from the tlb.
2002-06-08 07:10:28 +00:00
jake
edd9ce8013 Comment out options SMP for now until I figure out what's going on. 2002-06-07 15:36:42 +00:00
jhb
2aa855d8b1 - Fixup / remove obsolete comments.
- ktrace no longer requires Giant so do ktrace syscall events before and
  after acquiring and releasing Giant, respectively.
- For i386, ia32 syscalls on ia64, powerpc, and sparc64, get rid of the
  goto bad hack and instead use the model on ia64 and alpha were we
  skip the actual syscall invocation if error != 0.  This fixes a bug
  where if we the copyin() of the arguments failed for a syscall that
  was not marked MP safe, we would try to release Giant when we had
  not acquired it.
2002-06-07 05:47:35 +00:00
jake
af06035ee4 Use pmap_map instead of pmap_kenter to map the message buffer. Its too
early for pmap_kenter.
2002-06-05 15:36:57 +00:00
jake
85904aa20b Bump TSB_PAGES_SHIFT to 4. Less sucks too much. 2002-06-04 19:40:45 +00:00
dfr
a3b8e6c9c7 Move the definition of ElfN_Hashelt to common headers. The only platform
which has a different definition for this is alpha.
2002-05-30 08:32:18 +00:00
jake
ace1c1caeb Forgot to commit this file. Catch up to loader->kernel abi changes. 2002-05-29 19:48:03 +00:00
jake
7dff1045f4 Forward declare struct trapframe. 2002-05-29 19:25:14 +00:00
jake
63364b9f7b Remove BOOTP_WIRED_TO= since I keep forgetting to take this out and screwing
over people with gems.
2002-05-29 19:22:17 +00:00
jake
f9b60edf3c Don't try to flush illegal alises from the data cache in vmapbuf and
vunmapbuf, this is handled by pmap now.
2002-05-29 06:16:47 +00:00
jake
8bf6eba7b8 Add an MD page flag for tracking if a page is cacheable or not, so that
we don't flush all mappings of a physical page in order to make it
virtually cachable again, if it is already cachable.
2002-05-29 06:12:13 +00:00
jake
c5525858aa Remove an unused variable. 2002-05-29 06:10:37 +00:00
jake
580d1a81b5 Merge the code in pv.c into pmap.c directly. Place all page mappings onto
the pv lists in the vm_page, even unmanaged kernel mappings.  This is so
that the virtual cachability of these mappings can be tracked when a page
is mapped to more than one virtual address.  All virtually cachable
mappings of a physical page must have the same virtual colour, or illegal
alises can be created in the data cache.  This is a bit tricky because we
still have to recognize managed and unmanaged mappings, even though they
are all on the pv lists.
2002-05-29 06:08:45 +00:00
jake
a601bb5324 Add pv list linkage and a pmap pointer to struct tte. Remove separately
allocated pv entries and use the linkage in the tte for pv operations.
2002-05-29 05:56:05 +00:00
jake
2a45651b25 Use a contrived 'tlb_entry' structure for passing the mappings for the
kernel text and data from the loader to the kernel, so that the tte format
is not part of the loader->kernel ABI.
2002-05-29 05:49:59 +00:00
jake
980c076c0c Remove pmap.pm_pvlist and make the functions that use it no-ops. These are
all optimizations for architectures which have large sparse page tables,
and/or can't put the pv linkage inside of the page table entries.
2002-05-29 05:24:16 +00:00