Ruslan Ermilov [Fri, 15 Mar 2002 11:27:47 +0000 (11:27 +0000)]
Embed boot images built as part of buildworld rather than the
installed ones under /boot (which we may not even have in the
case of a cross build).
This introduced chicken and egg problem - we need boot images
early in the "depend" stage but they have not yet been built.
Work around this by excluding the generated makeboot.c source
from the "depend" list; it's okay because we hardcode all its
dependencies explicitly. We actually lose the dependency bit
on <sys/types.h> but it's probably okay too as the only thing
we use is the u_char datatype and this is unlikely to change.
After all, it's normal for sloppy cleaning to cause problems.
beast.FreeBSD.org running 5.0-CURRENT alpha has been able to
cross build i386 world with this patch.
Doug Rabson [Fri, 15 Mar 2002 11:12:08 +0000 (11:12 +0000)]
* Stop other cpus when one cpu enters DDB and restart them after it
leaves.
* Add a sync.i instruction to the code which writes out breakpoints to
ensure that the breakpoint is seem by all cpus in the coherence domain.
Doug Rabson [Fri, 15 Mar 2002 09:47:16 +0000 (09:47 +0000)]
* Remove a breakpoint() I accidentally left in for debugging :-(.
* Make cpu_mp_probe() work before the VM system is available and
initialise mp_maxid accordingly.
David E. O'Brien [Fri, 15 Mar 2002 08:21:41 +0000 (08:21 +0000)]
Remove all the custom toolchain knob tweaking.
We are now using a native binutils, and you have to have CC=gcc in your
/etc/make.conf to compile userland anyway.
Alfred Perlstein [Fri, 15 Mar 2002 08:03:46 +0000 (08:03 +0000)]
Giant pushdown for read/write/pread/pwrite syscalls.
kern/kern_descrip.c:
Aquire Giant in fdrop_locked when file refcount hits zero, this removes
the requirement for the caller to own Giant for the most part.
kern/kern_ktrace.c:
Aquire Giant in ktrgenio, simplifies locking in upper read/write syscalls.
kern/vfs_bio.c:
Aquire Giant in bwillwrite if needed.
kern/sys_generic.c
Giant pushdown, remove Giant for:
read, pread, write and pwrite.
readv and writev aren't done yet because of the possible malloc calls
for iov to uio processing.
kern/sys_socket.c
Grab giant in the socket fo_read/write functions.
kern/vfs_vnops.c
Grab giant in the vnode fo_read/write functions.
David E. O'Brien [Fri, 15 Mar 2002 07:42:47 +0000 (07:42 +0000)]
Uggg!! LD ME HARDER!!
Rev 1.2 changed the default emulation from ``elf64_sparc'' to ``elf32_sparc''
and I never noticed it after my review of rev 1.1. Backing the change of
the default emulation out, and Wa-la!, I can now build a native [and usable]
binutils. WTF, the "-m elf64_sparc" parameter handed to `ld' by `gcc'
wasn't DTRT is beyond me.
Luigi Rizzo [Fri, 15 Mar 2002 06:47:38 +0000 (06:47 +0000)]
Add comments to ME README.BOOTP README.TEMPLATING mentioning that
they contain stale information.
Remove files referring to the old diskless setup to avoid confusion.
Warner Losh [Fri, 15 Mar 2002 06:41:01 +0000 (06:41 +0000)]
Revert most of the recent PCI merge. This has proven to be too
unstable for the coming DP1 release. Instead, I'll develop that on
the IMP_CB_MERGE branch until it is more stable.
Doug Rabson [Thu, 14 Mar 2002 19:33:03 +0000 (19:33 +0000)]
* Save and restore PCPU_GET(current_pmap) in pcb_pmap so that we don't
lose if a process is preempted while pmap is temporarily switched to
another pmap.
* For SMP, drop the high-fp state when a thread is switched away from
so that if another cpu resumes that thread, it doesn't have to play
games with IPI to get ahold of the correct register values.
Mark Murray [Thu, 14 Mar 2002 16:41:36 +0000 (16:41 +0000)]
Remove the use of random(3), and encapsulate the salt-generation in
its own function. The use of arc4random(3) is hopeless overkill here,
but that does not hurt anything.
Maxim Konovalov [Thu, 14 Mar 2002 16:05:06 +0000 (16:05 +0000)]
Teach REST how to restart a file transfer after 2^31 bytes: now yylex()
returns off_t in yylval.u.o. REST is the only user of yylval.u.o at the
moment.
Doug Rabson [Thu, 14 Mar 2002 10:24:00 +0000 (10:24 +0000)]
* Add some KTR messages for IPIs.
* Don't call ast() from interrupt() - if we switch, then we will miss
writing cr.eoi which will prevent the current cpu from receiving
interrupts until the current thread is resumed. The call to ast()
happens magically in exception_restore where it is safe.
* Add DDB 'show irq' command to examine interrupt hardware state.
Doug Rabson [Thu, 14 Mar 2002 09:28:05 +0000 (09:28 +0000)]
* Use a mutex to protect the RID allocator.
* Use ptc.g instead of ptc.l so that TLB shootdowns are broadcast to the
coherence domain.
* Use smp_rendezvous for pmap_invalidate_all to ensure it happens on all
cpus.
* Dike out a DIAGNOSTIC printf which didn't compile.
* Protect the internals of pmap_install with cpu_critical_enter/exit.
Doug Rabson [Thu, 14 Mar 2002 09:20:07 +0000 (09:20 +0000)]
Move the call to pmap_bootstrap to after the initialisation of thread0.
This allows us to use mutexes in pmap safely. Also initialise fpcurthread
for cpu0 so that ia64_fpstate_check doesn't barf during boot.
Alfred Perlstein [Thu, 14 Mar 2002 01:32:30 +0000 (01:32 +0000)]
Fixes to make select/poll mpsafe.
Problem:
selwakeup required calling pfind which would cause lock order
reversals with the allproc_lock and the per-process filedesc lock.
Solution:
Instead of recording the pid of the select()'ing process into the
selinfo structure, actually record a pointer to the thread. To
avoid dereferencing a bad address all the selinfo structures that
are in use by a thread are kept in a list hung off the thread
(protected by sellock). When a selwakeup occurs the selinfo is
removed from that threads list, it is also removed on the way out
of select or poll where the thread will traverse its list removing
all the selinfos from its own list.
Problem:
Previously the PROC_LOCK was used to provide the mutual exclusion
needed to ensure proper locking, this couldn't work because there
was a single condvar used for select and poll and condvars can
only be used with a single mutex.
Solution:
Introduce a global mutex 'sellock' which is used to provide mutual
exclusion when recording events to wait on as well as performing
notification when an event occurs.
Interesting note:
schedlock is required to manipulate the per-thread TDF_SELECT
flag, however if given its own field it would not need schedlock,
also because TDF_SELECT is only manipulated under sellock one
doesn't actually use schedlock for syncronization, only to protect
against corruption.
Bruce A. Mah [Thu, 14 Mar 2002 01:29:31 +0000 (01:29 +0000)]
Add a warning that URLs in this document are subject to change (in
fact, they're incorrect right now). Point readers to the list
archives for current locations.
Doug Rabson [Thu, 14 Mar 2002 00:28:10 +0000 (00:28 +0000)]
Don't restore r13 when returning to kernel mode. We may have migrated to
a different cpu since the exception_save and r13 needs to point at the
current cpu's pcpu structure.
Brian Feldman [Wed, 13 Mar 2002 23:48:08 +0000 (23:48 +0000)]
Rename SI_SUB_MUTEX to SI_SUB_MTX_POOL to make the name at all accurate.
While doing this, move it earlier in the sysinit boot process so that the
VM system can use it.
After that, the system is now able to use sx locks instead of lockmgr
locks in the VM system. To accomplish this, some of the more
questionable uses of the locks (such as testing whether they are
owned or not, as well as allowing shared+exclusive recursion) are
removed, and simpler logic throughout is used so locks should also be
easier to understand.
This has been tested on my laptop for months, and has not shown any
problems on SMP systems, either, so appears quite safe. One more
user of lockmgr down, many more to go :)
Robert Nordier [Wed, 13 Mar 2002 19:00:19 +0000 (19:00 +0000)]
Clarify the cylinder > 1023 issue, now that EDD support is automatic.
Also drop a note about undocumented features that was intended to
cover the since-documented slice-selection syntax.
Udo Erdelhoff [Wed, 13 Mar 2002 13:10:22 +0000 (13:10 +0000)]
Fix some of the worst sgml mistakes in this document:
- paragraphs are closed with </para>, not <para>
- for each opening tag, there should be a closing tag
Not fixed (yet): block elements inside inline elements
Noticed during translation, hunted down with suppe/slashexpand
Ruslan Ermilov [Wed, 13 Mar 2002 11:03:36 +0000 (11:03 +0000)]
Implement -m and -p loader(8) "boot" command options in boot2.
(This is more useful for 4.x where boot blocks can still load
kernels, modulo the PR kern/17422.)