Commit Graph

30748 Commits

Author SHA1 Message Date
Doug Rabson
2750f739f9 * 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.
2002-03-14 09:28:05 +00:00
Doug Rabson
26c01501cd 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.
2002-03-14 09:20:07 +00:00
Alfred Perlstein
b0a3bfbdc6 Missed this file for select SMP fixes associated with rev 1.93 of
kern/sys_generic.c
2002-03-14 05:16:18 +00:00
Alfred Perlstein
d16160657d Missed this file for select SMP fixes associated with rev 1.93 of
kern/sys_generic.c
2002-03-14 04:47:08 +00:00
Brian Feldman
9cb574590e Document faultstate.lookup_still_valid more than none.
Requested by:	alfred
2002-03-14 02:10:14 +00:00
Alfred Perlstein
85f190e4d1 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.

Proc locks are no longer used in select/poll.

Portions contributed by: davidc
2002-03-14 01:32:30 +00:00
Kirk McKusick
9721068f95 This corrects the first of two known deadlock conditions that
come from the presence of a snapshot file.
2002-03-14 01:21:13 +00:00
Doug Rabson
b81b083819 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.
2002-03-14 00:28:10 +00:00
Brian Feldman
0e0af8ecda 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 :)
2002-03-13 23:48:08 +00:00
Robert Watson
419fe413e5 DBA update: pick the right DBA for various LOMAC copyrights. 2002-03-13 22:55:20 +00:00
Dag-Erling Smørgrav
830c02d426 Remove a bogus cast and deconstification that broke the Alpha kernel build. 2002-03-13 19:16:41 +00:00
Dag-Erling Smørgrav
979f47f40d Back out previous commit, it was the wrong patch! 2002-03-13 19:13:41 +00:00
Dag-Erling Smørgrav
51238e752e Remove a bogus cast that breaks the Alpha kernel build due to -Werror. 2002-03-13 19:12:31 +00:00
Warner Losh
20fe00734b Add 5th parameter to pci_read_device specifying the size of the object
to create.
2002-03-13 16:32:11 +00:00
Yoshihiro Takahashi
d679987554 Use the dx register for the destination port address. A immediate port
address of outb is only 8 bits.

Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
MFC after:	3 days
2002-03-13 13:59:41 +00:00
Yoshihiro Takahashi
e454a5425b MFi386: revision 1.502 2002-03-13 13:45:00 +00:00
Ruslan Ermilov
9662d32c73 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.)
2002-03-13 11:03:36 +00:00
Ruslan Ermilov
3e444868c4 Further document "console" (nullconsole). 2002-03-13 10:55:22 +00:00
Luigi Rizzo
49b144f286 Add a readonly sysctl variable of type string, kern.bootp_cookie,
which is initialized with whatever string a dhcp/bootp server passes
as vendor tag 134.
There is no standard tag that I know with this information, and
no vendor-defined tag that applies to FreeBSD that I could find
doing the same thing.

The intended use is to pass information to userland for run-time
configuration of a diskless client without having to run a bootp/dhcp
client for the third time (after the one in pxeboot/etherboot, and
the one in the kernel bootp), also because these clients generally
screwup the interface configuration, which is not exactly what you
want when you have your disks nfs-mounted.

Manpage update to follow soon.

MFC-after: 3 days
2002-03-13 09:23:11 +00:00
Jake Burkholder
9ad1d32f3d Fix ifdef LOCORE protection. 2002-03-13 06:04:36 +00:00
Jake Burkholder
76cf1369d7 Add a DEBUGGER_ON_POWERFAIL option. This makes the power button on ultra 10s
work like an NMI button.
2002-03-13 05:58:45 +00:00
Jake Burkholder
064d9e8af4 Fix braino. 2002-03-13 05:54:00 +00:00
Warner Losh
86d1f89423 Cleanup the recent cardbus cleanups. This fixes some of the panics
that I introduced with -v.  However, other problems still remain (including
the loss of interrupts).
2002-03-13 05:38:19 +00:00
Jake Burkholder
5ce88ec47e Add support for starting and stopping cpus with ipis.
Stop the other cpus when shutting down or entering the debugger.

Submitted by:	tmm
2002-03-13 04:59:01 +00:00
Jake Burkholder
63a33ce158 Use intr_disable/intr_restore instead of doing it manually.
Submitted by:	tmm
2002-03-13 04:43:45 +00:00
Jake Burkholder
4968137eb9 Add support for driving the clocks on secondary cpus.
Submitted by:	tmm
2002-03-13 04:38:33 +00:00
Jake Burkholder
8f5eafcdd1 Fix a bug where the wrong number of windows were copied for a failed fill
on return to user mode.  We may not have frame pointers setup for more
than 1 on return from exec.
2002-03-13 04:02:27 +00:00
Jake Burkholder
37453e292e White space. 2002-03-13 03:55:28 +00:00
Jake Burkholder
1bc589c745 Make IPI_WAIT use a bit mask of the cpus that a pmap is active on and only
wait for those cpus, instead of all of them by using a count.  Oops.
Make the pointer to the mask that the primary cpu spins on volatile, so
gcc doesn't optimize out an important load.  Oops again.
Activate tlb shootdown ipi synchronization now that it works.  We have
all involved cpus wait until all the others are done.  This may not be
necessary, it is mostly for sanity.
Make the trigger level interrupt ipi handler work.

Submitted by:	tmm
2002-03-13 03:43:00 +00:00
Jake Burkholder
453e54056e Add an ATOMIC_CLEAR_INT macro.
Submitted by:	tmm
2002-03-13 03:28:47 +00:00
Jake Burkholder
b8d4451640 Use the deo hosted toolchain by default. 2002-03-13 03:23:17 +00:00
Jake Burkholder
1ffbafa265 LABELOFFSET is 128 for sparc64.
Submitted by:	tmm
Forgotten by:	obrien
2002-03-13 03:17:29 +00:00
Archie Cobbs
44a8ff315e Add realloc() and reallocf(), and make free(NULL, ...) acceptable.
Reviewed by:	alfred
2002-03-13 01:42:33 +00:00
Doug Rabson
c19da1c7af Only i386 has wbinvd(). 2002-03-12 09:45:17 +00:00
Jeff Roberson
8de00f4a87 This patch adds the "LOCKSHARED" option to namei which causes it to only acquire shared locks on leafs.
The stat() and open() calls have been changed to make use of this new functionality.  Using shared locks in
these cases is sufficient and can significantly reduce their latency if IO is pending to these vnodes.  Also,
this reduces the number of exclusive locks that are floating around in the system, which helps reduce the
number of deadlocks that occur.

A new kernel option "LOOKUP_SHARED" has been added.  It defaults to off so this patch can be turned on for
testing, and should eventually go away once it is proven to be stable.  I have personally been running this
patch for over a year now, so it is believed to be fully stable.

Reviewed by:	jake, obrien
Approved by:	jake
2002-03-12 04:00:11 +00:00
Peter Wemm
841390683c Fix some -Wunused warnings by "using" a macro argument 2002-03-12 00:19:14 +00:00
Peter Wemm
a84c6cd303 Fix a warning (make ucontext_t *ucp a const) 2002-03-12 00:18:20 +00:00
Peter Wemm
db593b65d2 Stop concatenating __func__ with strings 2002-03-12 00:17:45 +00:00
Peter Wemm
e64c73a9f0 Deal with a structure member rename in a recent acpica import 2002-03-12 00:15:57 +00:00
Peter Wemm
8b79649b5b Do not concatenate __func__ with strings, because it is not a string.
Later gcc's blow up on this.
2002-03-12 00:15:06 +00:00
Peter Wemm
4d3523e298 Do not do string concatenation with __func__ (which is not a string) 2002-03-12 00:12:59 +00:00
Peter Wemm
75a3a26d2a Recent acpica imports have changed the lengths from UINT32 to ACPI_SIZE,
which is 64 bit on ia64.  Fix it.
2002-03-12 00:10:40 +00:00
Brooks Davis
d174b27395 Add support for 3Com Airconnect PCI cards.
MFC after:	3 days
2002-03-11 23:29:59 +00:00
Poul-Henning Kamp
dd84a43c1d First commit of the GEOM subsystem to make it easier for people to
test and play with this.

This is not yet production quality and should be run only on dedicated
test boxes.

For people who want to develop transformations for GEOM there exist a
set of shims to run geom in userland (ask phk@freebsd.org).

Reports of all kinds to: phk@freebsd.org
Please include in report:
        dmesg
        sysctl debug.geomdot
        sysctl debug.geomconf

Known significant limitations:
        no kernel dump facility.
        ioctls severely restricted.

Sponsored by:   DARPA, NAI Labs
2002-03-11 21:42:35 +00:00
Søren Schmidt
fe86c44885 Add new support for locking an ATA channel and use that throughout
the ATA/ATAPI driver. This solves the concurrency problem with
the new GEOM code, and also cuts a good deal of the patch size
in the upcoming MFC.
2002-03-11 21:04:32 +00:00
John Baldwin
bb7d54e8c7 Fix a misspelling of mine: s/optomization/optimization/.
Noticed by:	bmilekic
2002-03-11 19:58:53 +00:00
John Baldwin
ee1b1a6549 Grrr, turn preemption back off on the alpha again. It is still not stable.
Noticed by:	wilko, mjacob, jhb, peter, and others
2002-03-11 19:35:10 +00:00
Ian Dowse
23bd68a426 Fix a bug in ufsdirhash_adjfree() that caused it to incorrectly
update the free-space statistics in some cases. The problem affected
directory blocks when the free space dropped below the size of the
maximum allowed entry size. When this happened, the free-space
summary information could claim that there are no further blocks
that can fit a maximum-size entry, even if there are.

The effect of this bug is that the directory may be enlarged even
though there is space within the directory for the new entry. This
wastes disk space and has a negative impact on performance.

Fix it by correctly computing the dh_firstfree array index, adding
a helper macro for clarity. Put an extra sanity check into
ufsdirhash_checkblock() to detect the situation in future.

Found by:	dwmalone
Reviewed by:	dwmalone
MFC after:	1 week
2002-03-11 19:13:22 +00:00
Warner Losh
a2df0b493e On FreeBSD make usb_proc_t the same as d_thred_t always. 2002-03-11 16:38:53 +00:00
Poul-Henning Kamp
063f776327 I missed one VOP_CLOSE in the previous commit.
Pointed out by:	bde
2002-03-11 16:27:04 +00:00