Ian Dowse [Sun, 26 Aug 2001 20:47:19 +0000 (20:47 +0000)]
Stop using dirhash when a directory is removed, and ensure that we
never attempt to hash directories once they are deleted. This fixes
a problem where operations on a deleted directory could trigger
dirhash sanity panics.
Bill Fumerola [Sun, 26 Aug 2001 10:09:47 +0000 (10:09 +0000)]
the IP_FW_GET code in ip_fw_ctl() sizes a buffer to hold information
about rules and dynamic rules. it later fills this buffer with these
rules.
it also takes the opporunity to compare the expiration of the dynamic
rules with the current time and either marks them for deletion or simply
charges the countdown.
unfortunatly it does this all (the sizing, the buffer copying, and the
expiration GC) with no spl protection whatsoever. it was possible for
the dynamic rule(s) to be ripped out from under the request before it
had completed, resulting in corrupt memory dereferencing.
Warner Losh [Sun, 26 Aug 2001 04:43:16 +0000 (04:43 +0000)]
Improve the documentation for the various tunables. Document how to
force ISA routing of interrupts. Warn the user that with ISA routing
of interrupts for PCI devices with more than one slot, polling mode is
in order. Minor markup fixes as well and some white space/sentence
break changes (I did these as one commit since this file has been in
the tree only 4 days and I doubt that translation has begun).
Ian Dowse [Sun, 26 Aug 2001 01:25:12 +0000 (01:25 +0000)]
When compacting directories, ufs_direnter() always trusted DIRSIZ()
to supply the number of bytes to be bcopy()'d to move an entry. If
d_ino == 0 however, DIRSIZ() is not guaranteed to return a sensible
length, so ufs_direnter could end up corrupting a directory during
compaction. In practice I believe this can only happen after fsck_ffs
has fixed a previously-corrupted directory.
We now deal with any mid-block unused entries specially to avoid
using DIRSIZ() or bcopy() on such entries. We also ensure that the
variables 'dsize' and 'spacefree' contain meaningful values at all
times. Add a few comments to describe better this intricate piece
of code.
The special handling of mid-block unused entries makes the dirhash-
specific bugfix in the previous revision (1.53) now uncecessary,
so this change removes it.
Warner Losh [Sat, 25 Aug 2001 22:04:00 +0000 (22:04 +0000)]
Fix cut-and-paste-o that Nate found. We were setting csc_route twice,
rather than setting it once and setting func_route when we can't route
PCI interrupts.
Dima Dorfman [Sat, 25 Aug 2001 21:58:58 +0000 (21:58 +0000)]
Consistently use 'queueing' instead of 'queuing'. Both spellings are
correct, but the former seems to be preferred. This makes all of the
section-4 manual pages consistent in this respect.
Dima Dorfman [Sat, 25 Aug 2001 21:29:12 +0000 (21:29 +0000)]
Remove description of an option that only applies to UNICOS < 7.0.
That define may still be present in the source, but I don't think
anyone has plans to try to use it.
Warner Losh [Sat, 25 Aug 2001 06:40:00 +0000 (06:40 +0000)]
First cut at getting the ISA routing working. If we can't route a PCI
interrupt for the CSC interrupt, then we revert to ISA. If we didn't
have an interrupt set up with hw.pcic.irq, then do polling.
Also, don't complain about ignoring function 1 for any devices except
pcic devices. This would normally only show up if someone set
hw.pcic.ignore_function_1=1.
MFC: as soon as I can test it on some troublesome laptops.
Peter Wemm [Sat, 25 Aug 2001 02:20:02 +0000 (02:20 +0000)]
Optionize UPAGES for the i386. As part of this I split some of the low
level implementation stuff out of machine/globaldata.h to avoid exposing
UPAGES to lots more places. The end result is that we can double
the kernel stack size with 'options UPAGES=4' etc.
This is mainly being done for the benefit of a MFC to RELENG_4 at some
point. -current doesn't really need this so much since each interrupt
runs on its own kstack.
Bosko Milekic [Fri, 24 Aug 2001 23:00:59 +0000 (23:00 +0000)]
Force a commit on kern_mutex.c to explain reason for last commit but while
I'm at it also add a comment in mtx_validate() explaining the purpose
of the last change.
Basically, this fixes booting kernels compiled with MUTEX_DEBUG. What used
to happen is before we setidt from init386() [still using BTX idt], we
called mtx_init() on several mutex locks, notably Giant and some others.
This is a problem for MUTEX_DEBUG because it enables mtx_validate() which
calls kernacc(), some of which in turn requires Giant.
Fix by calling kernacc() from mtx_validate() only if (!cold).
Brian Somers [Fri, 24 Aug 2001 21:39:27 +0000 (21:39 +0000)]
Rename the DIAGNOSTICS section to RETURN VALUES and describe the
return values a little more. Specifically, mention that a return
of 0 from NgRecvData() and NgRecvMsg() means the socket has been
closed.
Matthew Dillon [Fri, 24 Aug 2001 19:45:59 +0000 (19:45 +0000)]
Ok, third time is the charm. VM_INHERIT_XXX -> INHERIT_XX (use the same
semantics as PROT_XXX vs VM_PROT_XXX separating user-space defines from
kernel defines).
Matthew Dillon [Fri, 24 Aug 2001 19:28:00 +0000 (19:28 +0000)]
Update the mmap.2 and minherit.2 manual pages. Add a short explanation and
referal from mmap to minherit for MAP_INHERIT. Fully document the
minherit.2 manual page (because frankly, my dear, however you think it
currently works is almost certainly wrong!). I may soon re-implement
MAP_COPY because I believe we can support it properly now, but I will have
to call it something else and that is for a later time.
Matthew Dillon [Fri, 24 Aug 2001 18:22:46 +0000 (18:22 +0000)]
Remove MAP_NOEXTEND. It came from 4.4-lite and not only was never
implemented, but mmap()'s default behavior is *already* to not extend
files. Only write() or ftruncate() can extend a file.
Warner Losh [Fri, 24 Aug 2001 17:29:42 +0000 (17:29 +0000)]
Explain what we're doing in pcic_pci_shutdown a little better. Try to
explain the subtle side effects that are going to happen and why we go
ahead and ack the interrupt source. This stuff is tricky to get
right.
Also, emperical tests have shown that doing a shutdown in attach to be
ineffectual, so remove it from there. Analysis of the code paths
shows that nearly identical writes to these registers happen in later
parts of the code. The hanging problem on thinkpads when we change
the interrupt routing type is something else.
Warner Losh [Fri, 24 Aug 2001 07:43:35 +0000 (07:43 +0000)]
Move code to shutdown the pcic_pci_shutdown. Call it on system
shutdown and also before we get going with the device initialization.
This may fix the hangs some people are seeing on warmboot. It appears
that some machines will reset the cardbus bridge on boot, while others
don't. So we turn off the card, and ack the interrupts (which likely
is a nop in the shutdown case since we're still fielding interrupts).
This should turn off the interrupts.
Since I don't have hardware that hangs on reboot, I'm committing this
without testing that aspect of the patch (it causes no harm on my
Dell).
Warner Losh [Fri, 24 Aug 2001 07:30:18 +0000 (07:30 +0000)]
Two fixes. First, put into place a more generic chipset specific
initialization structure. Warn the user for those chipsets that
aren't yet customized that they might not work. Second, try to power
off the slot on attach and ack the interrupts. I don't know, but this
might solve the hangs that people will see on Thinkpads if they set
hw.pcic.init_routing=1.
Nick Sayer [Fri, 24 Aug 2001 02:14:26 +0000 (02:14 +0000)]
In order for the MA301 to pass interrupts from the PCCard, you must
go into the PLX 9052's interrupt control register and turn on the magic
interrupt enable bit.
Partial thanks are due to OpenBSD for pointing out that the chip is a
PLX 9052 and pointing me to the datasheet PDF.