Change the second (and last) argument of cpu_set_upcall(). Previously
we were passing in a void* representing the PCB of the parent thread.
Now we pass a pointer to the parent thread itself.
The prime reason for this change is to allow cpu_set_upcall() to copy
(parts of) the trapframe instead of having it done in MI code in each
caller of cpu_set_upcall(). Copying the trapframe cannot always be
done with a simply bcopy() or may not always be optimal that way. On
ia64 specifically the trapframe contains information that is specific
to an entry into the kernel and can only be used by the corresponding
exit from the kernel. A trapframe copied verbatim from another frame
is in most cases useless without some additional normalization.
Note that this change removes the assignment to td->td_frame in some
implementations of cpu_set_upcall(). The assignment is redundant.
A previous call to cpu_thread_setup() already did the exact same
assignment. An added benefit of removing the redundant assignment is
that we can now change td_pcb without nasty side-effects.
This change officially marks the ability on ia64 for 1:1 threading.
Not tested on: amd64, powerpc
Compile & boot tested on: alpha, sparc64
Functionally tested on: i386, ia64
John Baldwin [Wed, 4 Jun 2003 21:10:15 +0000 (21:10 +0000)]
Batton down the hatches!!!
Always route PCI interrupts on i386 UP machines. I was planning to enable
this for i386 anyways once SMP support is done. Having this enabled fixes
problems on many people's laptops.
Make this compile without warnings on 64-bit architectures:
Don't cast thread_self() to int. Cast to uintptr_t. Pull in the
predefined printf format from <inttypes.h>
Make this compile without warnings on 64-bit architectures:
In recurse(), cast the pointer difference to int to match the format.
The difference is expected to fit in an int.
Peter Wemm [Wed, 4 Jun 2003 19:28:39 +0000 (19:28 +0000)]
GRRR. Do not force Dangerously Dedicated mode on amd64 when you select
'use entire disk'. Neither for ia64 while I'm here - it needs a MBR if
its going to use fdisk+disklabel. The ia64 case is mostly academic though
because you'd be creating two partitions (dos + freebsd) rather than
a single freebsd-only partition.
Make this a true GEOM class:
Attach to the component devices using GEOM semantics.
Create a GEOM provider instead of using disk_create()
Use the GEOM OAM api for configuration.
I saw approx ~1% speedup in througput and ~7% in latency in a
simple minded test of a two-disk striped device.
This file was repo-copied from src/sys/dev/ccd/ccd.c.
Hartmut Brandt [Wed, 4 Jun 2003 15:38:32 +0000 (15:38 +0000)]
Make the internal statistics sysctl an array of integers rather than a string.
While a string is readable without a tool, an array is easier to process for
a monitoring application. This also prevents the extra hoops we need with
sbufs and locking.
Move the mtx_init() in en_attach() higher before the first failure point so
that we can unconditionally destroy it in en_destroy().
Tony Finch [Wed, 4 Jun 2003 15:31:55 +0000 (15:31 +0000)]
Fix substitution when the regex matches the zero-length string.
There are two bugs: in the s///g case, the substitution didn't occur
at the end of the line; in the s///N case, the code didn't count
forwards along the line properly. See the sg, s3, s4, and s5 tests
in src/tools/regression/usr.bin/sed/.
Bruce Evans [Wed, 4 Jun 2003 11:21:18 +0000 (11:21 +0000)]
Removed garbage:
- -elf in CFLAGS had no effect except to reduce portability.
- -elf in LDFLAGS had even less effect, since LDFLAGS is not used.
- -Wall in CFLAGS had no effect except to reduce portability and break
overriding of WARNS, since the setting of WARNS implies -Wall.
Mike Makonnen [Wed, 4 Jun 2003 08:23:05 +0000 (08:23 +0000)]
Make C applications statically compiled with libthr work. Previously,
an application compiled -static with libthr would dump core in
malloc(3) because the stub thread initialization routine in libc would
be used instead of the libthr supplied one.
Mike Makonnen [Wed, 4 Jun 2003 08:16:32 +0000 (08:16 +0000)]
If the library is not able to create a thread because resources
don't allow it at the moment, the correct thing to do is try again.
Otherwise, libthr would fail this test because it doesn't allow
an unlimited number of concurrent threads per application.
Alan Cox [Wed, 4 Jun 2003 06:00:55 +0000 (06:00 +0000)]
- Add vm object locking to vm_object_deallocate(). (Still more
changes are required.)
- Remove special-case macros for kmem object locking. They are
no longer used.
Have the port readmes follow the same logic as buildworld. We skip
doing make readmes if /tmp/.skip_ports exists. This file is created
after a complete run, which avoids that we do the lengthy operation
again for a rerelease.
When NOPORTS or NOPORTREADMES are defined, we create the file prior
to starting the release.
Robert Watson [Wed, 4 Jun 2003 04:03:58 +0000 (04:03 +0000)]
Document the BUG (feature) that you can pass in an empty name to
VOP_GETEXTATTR() to retrieve the attribute name list on some file
systems, and note that this will be replaced with its own VOP
in due course.
Robert Watson [Wed, 4 Jun 2003 04:01:44 +0000 (04:01 +0000)]
The vnode operations for extended attributes no longer suffer from
the features (bugs) in the BUGS section related to querying the
required buffer size, or telling if an overflow occured.
Robert Watson [Wed, 4 Jun 2003 04:00:26 +0000 (04:00 +0000)]
Document the new explicit listing API for extended attributes; note
that the old API (passing "" as the attribute name to the _get_
interface) is now deprecated (and was probably a bad idea).
Robert Watson [Wed, 4 Jun 2003 03:57:28 +0000 (03:57 +0000)]
Implementations of extattr_list_fd(), extattr_list_file(), and
extattr_list_link() system calls, which return a least of extended
attributes defined for a vnode referenced by a file descriptor
or path name. Currently, we just invoke VOP_GETEXTATTR() since
it will convert a request for an empty name into a query for a
name list, which was the old (more hackish) API. At some point
in the near future, we'll push the distinction between get and
list down to the vnode operation layer, but this provides access
to the new API for applications in the short term.
The existing API was counter-intuitive, and poorly documented.
The prototypes for these system calls are identical to
extattr_get_*(), but without a specific attribute name to
leave NULL.
Julian Elischer [Wed, 4 Jun 2003 00:12:57 +0000 (00:12 +0000)]
Remove un-needed code.
Don't copyin() data we are about to overwrite.
Add a flag to tell userland that KSE is officially "DONE" with the
mailbox and has gone away.
Bosko Milekic [Tue, 3 Jun 2003 19:19:13 +0000 (19:19 +0000)]
Fix a potential bucket leak where when freeing to an empty bucket
we failed to put the bucket back into the general cache/container.
Also, fix a bad assumption. There was a KASSERT() that aimed to
guarantee that whenever the pcpu container's mc_starved was > 0,
that whatever the bucket we were freeing to was an empty bucket,
assuming it belonged to the pcpu container cache. However, there
is at least one case where this is not true anymore; consider:
1) All containers empty, next thread to try to alloc will touch
a pcpu container, notice it's empty, and increment the pcpu
container's mc_starved.
2) Some other thread frees an mbuf belonging to a bucket in
the general cache/container. Then it frees another mbuf
belonging to the same bucket (still in gen container).
3) Some third thread tries to allocate an mbuf from the pcpu
container and, since empty, grabs one mbuf now available
in the general cache and moves the non-empty bucket from
which it took 1 mbuf and to which the thread in (2) freed
to, and moves it to the pcpu container.
4) A final thread tries to free an mbuf belonging to the
NON-EMPTY bucket mentionned in (2) and (3) and, since
the pcpu container's mc_starved is > 0, but the bucket
is obviously non-empty, it trips on the KASSERT.
This meant that one could potentially get a panic in some
cases when out of mbufs and clusters. The problem could
be mitigated by commenting out some cv_signal() calls,
but I'm assuming that was pure coincidence and this is
the correct fix.
John Baldwin [Tue, 3 Jun 2003 18:44:31 +0000 (18:44 +0000)]
Bah, revert the previous commit for the time being due to inadequate testing
on my part. The output asm looks correct with the previous commit in place
and it works on amd64, but on my laptop I got a spew of AE_BAD_PARAMETER
errors trying to unlock the acpi global lock.
John Baldwin [Tue, 3 Jun 2003 14:46:16 +0000 (14:46 +0000)]
Fix the asm constraints so that we use the correct constants when acquiring
and releasing ACPI global locks instead of (ab)using the pointers to those
locks as the constants. Also, rather than require that the address of
the lock be stored in a register, use a memory constraint allowing the
memory address to be used directly.
Bruce Evans [Tue, 3 Jun 2003 11:54:42 +0000 (11:54 +0000)]
Fixed exit code in previous commit. "var++" to set a flag to nonzero
is a style bug at best. When the variable isn't a flag, it potentially
overflows after a large number of settings. Here the number of settings
is limited by ARG_MAX, but the variable is the exit code so it became
bogus after the second setting and effectively overflowed to 0 after
approx. 128 settings.
Fixed some style bugs involving comments in and near previous commit.
Clarification of previous commit message: df -t didn't give undefined
behaviour, and the behaviour used to conform perfectly with the man
page, since the buggy behaviour is documented in the BUGS section. -t
just worked when no files or file systems were specified, and was just
ignored if a file or file system was specified.
Hartmut Brandt [Tue, 3 Jun 2003 07:58:39 +0000 (07:58 +0000)]
The midway driver has been busdmaified and is not i386-specific anymore.
Repo-copy it from the i386 specific man4 section to the common one.
Remove the i386 keyword from the man page header.
Document the sysctl interface to the driver.
Fix a spelling error (ALL -> AAL).
Jeff Roberson [Tue, 3 Jun 2003 05:24:46 +0000 (05:24 +0000)]
- Remove the blocked pointer from the umtx structure.
- Use a hash of umtx queues to queue blocked threads. We hash on pid and the
virtual address of the umtx structure. This eliminates cases where we
previously held a lock across a casuptr call.
Greg Lehey [Tue, 3 Jun 2003 04:51:31 +0000 (04:51 +0000)]
Don't deregister the kld on resetconfig, only when we're really ready
to unload. This would cause a panic on the second resetconfig.
Start Vinum at boot time at SI_SUB_RAID, not SI_SUB_VINUM.
SI_SUB_VINUM was there first, but there's no real distinction, and
SI_SUB_RAID is a more neutral name.
Peter Wemm [Tue, 3 Jun 2003 01:44:43 +0000 (01:44 +0000)]
Two enhancements for kdump.
1) add a "-p pid", which is rather useful for selecting a single pid in
a combined trace file (eg: with ktrace -i).
2) display binary genio data in a more precise format.
Sam Leffler [Mon, 2 Jun 2003 23:45:32 +0000 (23:45 +0000)]
Merge from private version:
o add hash operations
o make AES operations useful: split into 3 ops based on key length (specify
aes for AES w/ 128 bit keys, aes192 for 192-bit keys, and aes256 for
256-bit keys
o add -c option to force encrypt->decrypt result to be compared against the
original plaintext (need to compare it against a known good implementation
like openssl)
o change multi-threaded test output to be more meaningingful
o fix default block size selection to consider algorithm's blocking needs
Sam Leffler [Mon, 2 Jun 2003 23:34:59 +0000 (23:34 +0000)]
Redo locking for better SMP suport:
o adding locking to op submission
o mark interrupt handler MPSAFE
o don't use locking on detach; disabling interrupts should be sufficient
o change mutex string names so witness printouts are more meaningful
Note: locking is still pretty brute-force but it's probably not worth
improving it given the relatively low performance of hifn-based cards.
Sam Leffler [Mon, 2 Jun 2003 23:32:03 +0000 (23:32 +0000)]
Redo locking for proper SMP operation:
o replace driver-global lock with three locks: one for the handling of mcr1
operations, one for handling of mcr2 operations, and one for the mcr1
free list
o mark the interrupt handler MPSAFE
o don't use locking on detach; disabling interrupts is sufficient (I think)
Sam Leffler [Mon, 2 Jun 2003 23:28:06 +0000 (23:28 +0000)]
Flush my local cache of cryto subsystem fixes:
o add a ``done'' flag for crypto operations; this is set when the operation
completes and is intended for callers to check operations that may complete
``prematurely'' because of direct callbacks
o close a race for operations where the crypto driver returns ERESTART: we
need to hold the q lock to insure the blocked state for the driver and any
driver-private state is consistent; otherwise drivers may take an interrupt
and notify the crypto subsystem that it can unblock the driver but operations
will be left queued and never be processed
o close a race in /dev/crypto where operations can complete before the caller
can sleep waiting for the callback: use a per-session mutex and the new done
flag to handle this
o correct crypto_dispatch's handling of operations where the driver returns
ERESTART: the return value must be zero and not ERESTART, otherwise the
caller may free the crypto request despite it being queued for later handling
(this typically results in a later panic)
o change crypto mutex ``names'' so witness printouts and the like are more
meaningful
Peter Wemm [Mon, 2 Jun 2003 21:56:08 +0000 (21:56 +0000)]
Fix restarted syscalls. When we rewind %rip, we also need to restore
all the argument registers etc since we have almost certainly have trashed
them by now. Take particular car of %r10 since it held the original value
of %rcx (which we saved in tf_rcx on entry and doreti doesn't know this).
Change the list interface to simplify things.
Remove old list ioctls which bogusly exported the softc to userland.
Move the softc and associated structures from the public header to
the source file.
For now only use this for implementing a OAM config method which
can return a list of configured CCD devices in the format which
"ccdconfig -g[v]" would normally output.