Peter Wemm [Mon, 22 Sep 2003 22:19:59 +0000 (22:19 +0000)]
MFCi386: trap.c rev 1.257 by bde. Don't forget to reenable interrupts
for breakpoint and trace traps from usermode. Although all the setidt
entries are interrupt gates on amd64, all but the trace and bpt trap
entry handlers reenable interrupts after the swapgs instruction in order
to simulate the trap/interrupt gate distinction. In other words, the
amd64 code behaves the same way that i386 does here.
Peter Wemm [Mon, 22 Sep 2003 21:56:48 +0000 (21:56 +0000)]
MFi386: machdep.c:1.570 clock.c:1.204 by bde: Quick fix for calling DELAY
for ddb input in some atkbd-based console drivers. ddb must not use any
normal locks but DELAY() normally calls getit() which needs clock_lock.
This also removes the need for recursion on clock_lock.
Peter Wemm [Mon, 22 Sep 2003 21:46:47 +0000 (21:46 +0000)]
Microoptimization to allow the compiler to evaluate ntohl() etc on
known constants at compile time rather than at run time. We have a number
of nasty hacks around the place to cache ntohl() of constants (eg: nfs).
This change allows the compiler to compile-time evaluate ntohl(1) as
0x01000000 rather than having to emit assembler code to do it. This
has other smaller flow-on effects because the compiler can see that
ntohl(constant) itself has a constant value now and can propagate the
compile time evaluation.
Obtained from: Ideas from NetBSD and Linux, and some code from NetBSD
David Xu [Mon, 22 Sep 2003 14:40:36 +0000 (14:40 +0000)]
Save and restore timeout field for signal frame just like what we did
for interrupted field.
Also in _thr_sig_handler, retrieve current signal mask from kernel not
from ucp, the later is pre-unioned mask, not current signal mask.
Alan Cox [Mon, 22 Sep 2003 04:58:09 +0000 (04:58 +0000)]
- vm_hold_free_pages() should lock the kernel object. (The pages being
freed belong to the kernel object.)
- Increase the granularity of the vm object locking in vm_hold_load_pages()
in order to reduce the number of times that we acquire and release the
same lock.
Alan Cox [Mon, 22 Sep 2003 00:56:13 +0000 (00:56 +0000)]
Initialize the page's pindex field even for VM_ALLOC_NOOBJ allocations.
(This field is useful for implementing sanity checks even if the page does
not belong to an object.)
Paul Saab [Sun, 21 Sep 2003 22:14:49 +0000 (22:14 +0000)]
revert to version 1.25 and use va_copy to obtain another copy of the
variable arguments. version 1.26 incorrectly truncated the message if
the buffer was too long.
Put x11-wm/sawfish2 and irc/xchat on CD 1 instead of sawfish and xchat.
Sawfish is gone, and xchat2 is more widely used these days since it is the
current stable release.
Thomas Quinot [Sun, 21 Sep 2003 16:49:53 +0000 (16:49 +0000)]
(atapi_cb): Reorganize error handling circuitry.
Fix to the messages output under CAM_DEBUG_CCB: the summary sense
information (error bits and sense key) is in the error field, not
in the result field, of struct ata_request. No other functional change.
Thomas Quinot [Sun, 21 Sep 2003 08:42:32 +0000 (08:42 +0000)]
(camperiphdone): When the cam_periph layer performs sense recovery,
completion of recovery is indicated by positioning the CAM_AUTOSNS_VALID
bit in the status field of the CCB, not in the flags field.
This fixes an endless loop of sense recovery actions.
Daniel Eischen [Sun, 21 Sep 2003 07:59:16 +0000 (07:59 +0000)]
The ports freeze may take longer than anticipated. Instead of
waiting for it to be delayed, temporarily back out the -pthread
removal until the freeze is lifted.
Freeze possibly taking longer than necessary: will
Requested by: kris
Jeff Roberson [Sun, 21 Sep 2003 07:39:16 +0000 (07:39 +0000)]
- Fix MD_SMALL_ALLOC on architectures that support it. Define a new alloc
function, startup_alloc(), that is used for single page allocations prior
to the VM starting up. If it is used after the VM startups up, it
replaces the zone's allocf pointer with either page_alloc() or
uma_small_alloc() where appropriate.
Alan Cox [Sat, 20 Sep 2003 23:54:36 +0000 (23:54 +0000)]
Reimplement pmap_release() such that it uses the page table rather than the
pte object to locate the page table directory pages. (This is another step
toward the elimination of the pte object.)
Peter Wemm [Sat, 20 Sep 2003 23:35:33 +0000 (23:35 +0000)]
Bad Jeffr! No cookie!
Temporarily disable the UMA_MD_SMALL_ALLOC stuff since recent commits
break sparc64, amd64, ia64 and alpha. It appears only i386 and maybe
powerpc were not broken.
Bill Paul [Sat, 20 Sep 2003 21:18:27 +0000 (21:18 +0000)]
Remove the dual-address cycle stuff. DAC is used to allow a bus master
device to access 64-bit addresses from a 32-bit PCI bus. While the
RealTek manual says you can set this bit and the chip will perform
DAC only if you give it a DMA address with any of the upper 32
bits set, this appears not to be the case. If I turn on the DAC
bit, the chip sets the 'system error' bit in the status register
when I to do a DMA on my Athlon test box with 32-bit PCI bus (VIA
chipset) even though I only have 128MB of physical memory, and thus
can never give the chip a 64-bit address.
Obviously, I can't just set it and forget it, so until I figure
out the right rule for when it's safe/necessary to enable it, keep
it turned off.
Ruslan Ermilov [Sat, 20 Sep 2003 21:13:43 +0000 (21:13 +0000)]
Keep up with recent mdoc(7) changes, that include:
- If no .Os call is made, don't print the OS info at all.
- Allow for multiple .Lb calls in the LIBRARY section.
- Improved documentation on punctuation characters.
Fix the last remaining problem encountered by KSE: apparently it is
not guaranteed that the RSE writes the NaT collection immediately,
sort of atomically, to the backing store when it writes the register
immediately prior to the NaT collection point. This means that we
cannot assume that the low 9 bits of the backingstore pointer do not
point to the NaT collection. This is rather a surprise and I don't
know at this time if it's a bug in the Merced or that it's actually
a valid condition of the architecture. A quick scan over the sources
does not indicate that we depend on the false assumption elsewhere,
but it's something to keep in mind.
The fix is to write the saved contents of the ar.rnat register to
the backingstore prior to entering the loop that copies the dirty
registers from the kernel stack to the user stack.
Move uma_small_alloc() and uma_small_free() to uma_machdep.c. These
functions reference UMA internals from <vm/uma_int.h>, which makes
them highly unwanted in non-UMA specific files.
While here, prune the includes in pmap.c and use __FBSDID(). Move
the includes above the descriptive comment.
The copyright of uma_machdep.c is assigned to the project and can
be reassigned to the foundation if and when when such is preferrable.
Stefan Eßer [Sat, 20 Sep 2003 15:10:38 +0000 (15:10 +0000)]
Correct card type of Netgear WG311 and add WAG311 and WGT511T
which are based on the AR5212 and should just work (not verified).
Add Proxim Skyline 4032, the PCI version of th e4030.
Add revision suffix 'B' to D-Link DWL-G520/G650 entries, in order
to indicate that revision A1 cards are not supported by this driver
(both A1 and B1/B2 cards are sold in identical boxes).
Explicitly point out the existence of unsupported DWL-G520/G650
(rev. A1) cards in the CAVEATS section.
Approved by: sam
Jeff Roberson [Sat, 20 Sep 2003 02:05:58 +0000 (02:05 +0000)]
- Somewhere along the line I stupidly removed critical logic from
sched_ptcpu_update(). This caused erroneous cpu times in TOP for
processes that were asleep. Replace the code that was removed.
Jeff Roberson [Sat, 20 Sep 2003 00:21:48 +0000 (00:21 +0000)]
- In reassignbuf() don't unlock vp and lock newvp if they are the same.
Doing so creates a race where the buf is on neither list.
- Only vfree() in an error case in vclean() if VSHOULDFREE() thinks we
should.
- Convert the error case in vclean() to INVARIANTS from DIAGNOSTIC as this
really should not happen and is fast to check.
Jeff Roberson [Fri, 19 Sep 2003 23:37:49 +0000 (23:37 +0000)]
- Remove interlock protection around VI_XLOCK. The interlock is not
sufficient to guarantee that this race is not hit. The XLOCK will likely
have to be redesigned due to the way reference counting and mutexes work
in FreeBSD. We currently can not be guaranteed that xlock was not set
and cleared while we were blocked on the interlock while waiting to check
for XLOCK. This would lead us to reference a vnode which was not the
vnode we requested.
- Add a backtrace() call inside of INVARIANTS in the hopes of finding out if
this condition is ever hit. It should not, since we should be retaining
a reference to the vnode in these cases. The reference would be sufficient
to block recycling.
Make KSE_STACKSIZE machine dependent by moving it from thr_kern.c to
pthread_md.h. This commit only moves the definition; it does not
change it for any of the platforms. This more easily allows 64-bit
architectures (in particular) to pick a slightly larger stack size.
Jeff Roberson [Fri, 19 Sep 2003 23:27:46 +0000 (23:27 +0000)]
- Remove the working-set algorithm. Instead, use the per cpu buckets as the
working set cache. This has several advantages. Firstly, we never touch
the per cpu queues now in the timeout handler. This removes one more
reason for having per cpu locks. Secondly, it reduces the size of the zone
by 8 bytes, bringing it under 200 bytes for a single proc x86 box. This
tidies up other logic as well.
- The 'destroy' flag no longer needs to be passed to zone_drain() since it
always frees everything in the zone's slabs.
- cache_drain() is now only called from zone_dtor() and so it destroys by
default. It also does not need the destroy parameter now.
Jeff Roberson [Fri, 19 Sep 2003 23:04:44 +0000 (23:04 +0000)]
- Remove the cache colorization code. We can't use it due to all of the
broken consumers of the malloc interface who assume that the allocated
address will be an even multiple of the size.
- Remove disabled time delay code on uma_reclaim(). The comment there said
it all. It was not an effective strategy and it should not be left in
#if 0'd for all eternity.
_ia64_break_setcontext() now takes a mcontext_t. While here, define
THR_SETCONTEXT as PANIC(). The THR_SETCONTEXT macro is currently not
used, which means that the definition we had could be wrong, overly
pessimistic or unknowingly right. I don't like the odds...
The new _ia64_break_setcontext() and corresponding kernel fixes make
KSE mostly usable. There's still a case where we don't properly
restore a context and end up with a NaT consumption fault (typically
an indication for not handling NaT collection points correctly),
but at least now mutex_d works...
Fix the most significant KSE breakage caused by not restoring the
restart instruction bits in the PSR. As such, we were returning
from interrupt to the instruction in the bundle that caused us
to enter the kernel, only now we're returning to a completely
different bundle.
While close here: add two KASSERTs to make sure that we restore
sync contexts only when entered the kernel through a syscall and
restore an async context only when entered the kernel through an
interrupt, trap or fault.
While not exactly here, but close enough: use suword64() when we
copy the dirty registers from the kernel stack to the user stack.
The code was intended to be be replaced shortly after being added,
but that was a couple of weeks ago. I might as well avoid that it
is a source for panics until it's replaced.
Revamp trap(): make it more explicit which kinds of traps/faults we
can get (or not) and what we do with them. This fixes the behaviour
for NaT consumption and speculation faults in that we now don't panic
for user faults.
Remove the dopanic label and move the code to a function. This makes
it easier in the simulator to set a breakpoint.
While here, remove the special handling of the old break-based syscall
path and move it to where we handle the break vector. While here,
reserve a new break immediate for KSE. We currently use the old break-
based syscall to deal with restoring async contexts. However, it has
the side-effect of also setting the signal mask and callong ast() on
the way out. The new break immediate simply restores the context and
returns without calling ast().