Chris Costello [Wed, 8 Jan 2003 11:06:22 +0000 (11:06 +0000)]
o Refer to "Network Associates Laboratories" instead of "NAI Labs" or
"Network Associates Labs" in the copyright notice.
o Remove clause #3 in the license terms.
o Remove the line break from my name.
Peter Wemm [Wed, 8 Jan 2003 07:02:07 +0000 (07:02 +0000)]
Add a declaration that malloc() returns a pointer, not an int. Otherwise
this segfaults on ia64. (Cannot cast an int to a pointer).
The rest of the code does it this way rather than use system includes....
Peter Wemm [Wed, 8 Jan 2003 06:43:27 +0000 (06:43 +0000)]
Change this:
#include <strings.h>
...
foo = (char *)strdup(...);
To:
#include <string.h>
foo = strdup(...);
because the former segfaults on an ia64 since there is no prototype
for strdup() in strings.h. Converting an "int" to a pointer is fatal.
Peter Wemm [Wed, 8 Jan 2003 06:40:35 +0000 (06:40 +0000)]
Add #include "diff.h" in order to get the prototype for xmalloc().
The corresponding warning has been ignored for ages:
prepend_args.c:75: warning: initialization makes pointer from integer
without a cast
This is fatal on ia64. You cannot convert an implicit int return from
an undeclared function to a pointer as you've lost the upper 32 bits.
On ia64, the warning is "pointer from different sized integer".
John Baldwin [Wed, 8 Jan 2003 01:33:18 +0000 (01:33 +0000)]
Enumerate logical hyperthread CPUs manually if they aren't already listed
in the mptable. The way this works is that we determine if the system
has hyperthreading and how many logical CPU's should be in each physical
CPU by using the information returned by cpuid. During the first pass of
the mptable, we build a bitmask of the APIC IDs of the CPUs listed in the
mptable. We then scan that bitmask to see if the CPUs are already listed
by the mptable, or if there are any APIC IDs already in use that would
conflict with the APIC IDs of the logical CPUs. If that test succeeds,
then we fixup the count of application processors. Later on during the
second pass of the mptable we create fake processor entries for logical
CPUs and add them to the system.
We only need this type of fixup hack when using the mptable to enumerate
CPUs. The ACPI MADT table properly enumerates all logical CPUs.
John Baldwin [Wed, 8 Jan 2003 01:23:16 +0000 (01:23 +0000)]
If the boot processor supports hyperthreading and contains more than one
logical CPU, display the number of logical CPUs per physical processor
underneath the list of CPU features.
Peter Wemm [Tue, 7 Jan 2003 22:24:13 +0000 (22:24 +0000)]
Move the MOD_SHUTDOWN event from shutdown_post_sync to shutdown_final,
so that entities that want to use the post_sync hook to write stuff
to devices and other tidy-up can do so before the device tree is
shot down. eg: da doing a SYNC_CACHE etc. This should get crashdumps
working on mpt devices again, and stops the ia64 boxes locking up
on regular shutdown when da tries to issue the scsi commands to mpt.
Kirk McKusick [Tue, 7 Jan 2003 18:23:50 +0000 (18:23 +0000)]
This patch fixes a problem caused by applications that rapidly and
repeatedly truncate the same file. Each time the file is truncated,
a buffer is grabbed to store the indirect block numbers that need
to be freed. Those blocks cannot be freed until the inode claiming
them is written to disk. Thus, the number of buffers being held by
soft updates explodes and in extreme cases can run the kernel out
of buffers. The problem can be avoided by doing an fsync on the
file every debug.maxindirdep truncates (currently defaulted to 50).
The fsync causes the inode to be written so that the held buffers
can be freed. The check for excessive buffers is checked as part
of the existing hook for excessive dependencies (softdep_slowdown)
in the truncate code.
Reported by: David Schultz <dschultz@uclink.Berkeley.EDU>
Sponsored by: DARPA & NAI Labs.
MFC after: 3 weeks
John Baldwin [Tue, 7 Jan 2003 18:17:18 +0000 (18:17 +0000)]
Cast the integer read as the first argument for %b to an unsigned integer
so it's value is not sign extended when assigned to the uintmax_t variable
used internally by printf. For example, if bit 31 is set in the cpuid
feature word, then %b would print out the initial value as a 16 character
hexadecimal value. Now it only prints out an 8 character value.
Scott Long [Tue, 7 Jan 2003 07:46:50 +0000 (07:46 +0000)]
Teach sysinstall about rpcbind, rpc.lockd, and rpc.statd. As an added
bonus, rpcbind will be enabled automatically if rpc.lockd, rpc.statd, amd,
NFS Server, or NIS is enabled.
Maxime Henrion [Tue, 7 Jan 2003 01:01:20 +0000 (01:01 +0000)]
o Only try to recopy the mbuf into an mbuf cluster if
bus_dmamap_load_mbuf() returned EFBIG.
o Fix mbuf leaks in an error (rare) code path.
o Reuse the TX descriptor if xl_encap() failed instead of
just picking the next one.
o Better error messages.
John Polstra [Mon, 6 Jan 2003 23:46:47 +0000 (23:46 +0000)]
Don't reference the maxlen and flags fields in the ring control blocks
as separate 16-bit entities. Some of the ring control blocks are
in NIC memory, so they must be referenced using 32-bit accesses.
Smaller accesses have been observed to fail under some conditions.
This caused the rings to be set up wrong, leading to writes by the
card outside of the intended bounds of the rings. This problem was
diagnosed by Michael Barthelow. Don Bowman submitted a patch which
fixed the problem using a slightly different approach.
Reference ring control blocks in NIC memory using a pointer to
volatile.
Parenthesize the BGE_HOSTADDR macro definition properly.
Thomas Moestl [Mon, 6 Jan 2003 22:12:57 +0000 (22:12 +0000)]
Convert to use bus_dmamap_load_mbuf(); decouple software TX descriptors
from the hardware descriptors to avoid the overhead of having a DMA
map for each of them. Bump the number of hardware descriptors to 128,
and use half as many software descriptors for now.
Some minor cleanups.
Sam Leffler [Mon, 6 Jan 2003 22:11:56 +0000 (22:11 +0000)]
more crypto test stuff:
o cryptotest can now run multiple threads with -t option
o cryptotest can now "profile" time spent doing symmetric ops with -p
o cryptostats dumps the crypto statistics block
o cryptokeystat is an openbsd app that tests public key ops
Thomas Moestl [Mon, 6 Jan 2003 22:09:01 +0000 (22:09 +0000)]
- Convert to use bus_dmamap_load_mbuf().
- remove DPRINTF(), there is a CTR*() for any of them, and KTR is
far more useful to debug this driver.
- some cleanups; remove some unused code and definitions.
Thomas Moestl [Mon, 6 Jan 2003 21:59:54 +0000 (21:59 +0000)]
Change the iommu code to be able to handle more than one DVMA area per
map. Use this new feature to implement iommu_dvmamap_load_mbuf() and
iommu_dvmamap_load_uio() functions in terms of a new helper function,
iommu_dvmamap_load_buffer(). Reimplement the iommu_dvmamap_load()
to use it, too.
This requires some changes to the map format; in addition to that,
remove unused or redundant members.
Add SBus and Psycho wrappers for the new functions, and make them
available through the respective DMA tags.
Sam Leffler [Mon, 6 Jan 2003 21:23:06 +0000 (21:23 +0000)]
fix memory allocation problems and collateral damage:
o create a separate tag for each object allocated with bus_dmamem_alloc so
the tag's maxsize is setup appropriately; this reduces memory allocation
for the queue descriptors from 16M to what it should be and also fixes
memory allocation for public key operands
o release bus dma resources on detach so module usage doesn't leak
o remove public key op disable now that bus dma memory allocation is fixed
o collect attach error handling in one place
Thomas Moestl [Mon, 6 Jan 2003 20:54:07 +0000 (20:54 +0000)]
- remove the unused parent DMA tag argument from
_nexus_dmamap_load_buffer()
- implement nexus_dmamap_load() in terms of _nexus_dmamap_load_buffer().
Note that this is untested, as this code is not currently used (but
might be later for UPA devices).
- move BUS_DMAMAP_NSEGS to bus_private.h
- disable the ecache flushing in nexus_dmamap_sync(); it should not be
needed, although the docs are not entirely clear on that.
BSD disklabels expose the controling label though the 'c' partition, and
some trick is necessary to prevent further BSD geoms from attaching to
that. Our old trick was to make sure we don't attach to a geom from
the "BSD" class, but this doesn't work if an intermediary geom obscures
this fact. Instead, calculate the MD5 checksum of the label we target
and ask if anybody below us loves that label. If they do we don't.
Thomas Moestl [Mon, 6 Jan 2003 17:10:07 +0000 (17:10 +0000)]
Some cleanup:
- move some constants into iommureg.h
- correct some comments
- use KASSERT() in one place instead of rolling our own
- take a sanity check out of #ifdef DIAGNOSTIC
- fix a syntax error in normally #ifdef'ed out debug code
Thomas Moestl [Mon, 6 Jan 2003 16:51:06 +0000 (16:51 +0000)]
- remove some outdated comments
- tweak the announce message a bit
- remove '\n's from a few panic() calls
- don't use the DVMA base adress the firmware reports; instead, figure
it out from the appropriate register on Sabres and let the IOMMU code
choose it on Psychos. This also makes the IOMMU TSB size freely
selectable.
Thomas Moestl [Mon, 6 Jan 2003 16:36:05 +0000 (16:36 +0000)]
1.) fix a copy-and-paste-o in a panic() message
2.) pass the requesting child device (instead of the bus one) up when
handling interrupt resources
3.) remeber to mark the resource list entry as unused in
sbus_release_resource().
Jacques Vidrine [Mon, 6 Jan 2003 13:19:05 +0000 (13:19 +0000)]
Correct file descriptor leaks in lseek and do_dup.
The leak in lseek was introduced in vfs_syscalls.c revision 1.218.
The leak in do_dup was introduced in kern_descrip.c revision 1.158.
Peter Wemm [Mon, 6 Jan 2003 08:28:15 +0000 (08:28 +0000)]
Move dashutdown from SHUTDOWN_PRI_DEFAULT to SHUTDOWN_PRI_FIRST.
Otherwise, the scsi devices that it is trying to issue commands to may
have gone away. This is what caused shutdown to hang on ia64 systems
with mpt scsi controllers. The bus system has torn down the device tree
and reset the mpt controller etc, and suddenly along comes dashutdown
and wants to issue a few more scsi commands.... <HANG!>
This shouldn't work on i386 either, but it seems to work solely due
to luck.
Warner Losh [Mon, 6 Jan 2003 08:09:41 +0000 (08:09 +0000)]
MFp4: make it work
o Expand variables correctly.
o Set variables for each event.
o rewrite event loop to execute the commands in the config file, rather
than the hard wired generic command
o better(?) debug when running -d
o sort vectors of actions so that we just have to search for the first
one to match rather than the best one that matches.
o better attempts to clear all resources used on 'restart'
o Remove now bogus comments