Peter Wemm [Sat, 6 Dec 2003 23:17:18 +0000 (23:17 +0000)]
Kill the ASM versions of the mtx_lock_spin and friends. They were never
used on amd64, and were actually totally broken. They had the wrong
calling conventions. I believe the i386 versions are going away too.
Peter Wemm [Sat, 6 Dec 2003 23:13:22 +0000 (23:13 +0000)]
Revert some amd64 changes that cached curthread and converge back to the
i386 version. The curthread special case in pcpu.h solves my complaint
about the verbose macro expansion in this case. Note that the i386
version still has some OBE comments, I didn't re-add them back again.
Robert Watson [Sat, 6 Dec 2003 21:48:03 +0000 (21:48 +0000)]
Rename mac_create_cred() MAC Framework entry point to mac_copy_cred(),
and the mpo_create_cred() MAC policy entry point to
mpo_copy_cred_label(). This is more consistent with similar entry
points for creation and label copying, as mac_create_cred() was
called from crdup() as opposed to during process creation. For
a number of policies, this removes the requirement for special
handling when copying credential labels, and improves consistency.
Bruce A. Mah [Sat, 6 Dec 2003 20:43:48 +0000 (20:43 +0000)]
Trim some unnecessary text from bt(4) and mly(4) listings, fix typo in
sk(4) listing, trim em(4) devices, trim dgb(4) devices, trim
stl(4)/stli(4) devices, trim uaudio(4) devices.
Alan Cox [Sat, 6 Dec 2003 05:45:32 +0000 (05:45 +0000)]
Fix a deadlock between vm_fault() and vm_mmap(): The expected lock ordering
between vm_map and vnode locks is that vm_map locks are acquired first. In
revision 1.150 mmap(2) was changed to pass a locked vnode into vm_mmap().
This creates a lock-order reversal when vm_mmap() calls one of the vm_map
routines that acquires a vm_map lock. The solution implemented herein is
to release the vnode lock in mmap() before calling vm_mmap() and reacquire
this lock if necessary in vm_mmap().
Approved by: re (scottl)
Reviewed by: jeff, kan, rwatson
Ian Dowse [Fri, 5 Dec 2003 09:36:56 +0000 (09:36 +0000)]
Don't include the file system ID in the output of `mount -v' if it
is all zeros. The kernel now consistently zeroes FSIDs for non-root
users, so there's no point in printing these.
Also fix a number of compiler warnings, including two real bugs:
- a bracket placement bug caused `mount -t ufs localhost:/foo /mnt'
to override the `-t ufs' specification and use mount_nfs.
- an unitialised variable was used instead of _PATH_SYSPATH when
warning that the mount_* program cound not be found.
Submitted by: Rudolf Cejka <cejkar@fit.vutbr.cz> (FSID part)
Approved by: re (scottl)
Ian Dowse [Fri, 5 Dec 2003 09:29:42 +0000 (09:29 +0000)]
(Forced commit) The log message for revision 1.42 was confused
with another change. The correct message is:
Improve on umount.c revision 1.41 (silence non-root warnings
about failing to use MNT_BYFSID) by silencing the second
warning too. Also fix a misspelling in a comment.
Ian Dowse [Fri, 5 Dec 2003 09:22:40 +0000 (09:22 +0000)]
Don't include the file system ID in the output of `mount -v' if it
is all zeros. The kernel now consistently zeroes FSIDs for non-root
users, so there's no point in printing these. Also fix a misspelling
in a comment.
Submitted by: Rudolf Cejka <cejkar@fit.vutbr.cz>
Approved by: re (scottl)
Warner Losh [Fri, 5 Dec 2003 04:28:03 +0000 (04:28 +0000)]
Fix the case where one goes from zero to more than zero items enabled
in /etc/ttys. Before this fix, once the count of active services
reaches 0, one could never restart any more without a reboot.
Steve Passe did the leg work on this patch. After he found the fix,
we discovered that an identical fix had been made to NetBSD.
Peter Wemm [Fri, 5 Dec 2003 01:41:43 +0000 (01:41 +0000)]
Apply a second fix for stack alignment with libkse. This time, enter the
UTS with the stack correctly aligned. Also, while here, use an indirect
jump rather than the pushq/ret hack.
This fixes threaded apps that use floating point for me, although
it hasn't solved all the problems. It is an improvement though.
Preservation of the 128 byte red zone hasn't been resolved yet.
Peter Wemm [Fri, 5 Dec 2003 01:36:44 +0000 (01:36 +0000)]
"Fix" makecontext() so that the C code begins execution with its
ABI-required stack alignment. C code expects that the push of the
return address disturbed the 16 byte alignment and it will take corrective
measures to fix it before making another call. Of course, if its wrong
to start with, then all hell breaks loose. Essentially we "fix" this
by making the stack alignment odd to start with.
This was one of the things that broke on libkse with apps that use
floating point/varargs/etc.
Warner Losh [Wed, 3 Dec 2003 23:06:30 +0000 (23:06 +0000)]
Connect the cx driver to its new location in the tree.
Update notes to reflect that cx is no longer a counted device
Update options for new cx option
# commented out ELAN_PPS and ELAN_XTAL since they produced errors
John Baldwin [Wed, 3 Dec 2003 21:12:09 +0000 (21:12 +0000)]
- Remove the hack to prevent the acpi module from loading.
- Add a really, really, nasty hack to provide stub versions of all of
the 'device apic' functions used by the ACPI MADT APIC enumerator if
'device apic' is not compiled into the kernel. This is gross but is
the best we can do with the current kernel linker implementation.
John Baldwin [Wed, 3 Dec 2003 20:33:18 +0000 (20:33 +0000)]
- Reorder the APIC enumerator SYSINIT's to register enumeators at
SI_SUB_CPU - 1 and probe enumerators, probe CPUs, and setup the local
APIC programming all at SI_SUB_CPU / SI_ORDER_FIRST. This is needed to
help get the ACPI module working again as it moves the APIC enumeration
code after SI_SUB_KLD.
- In the MADT parser, use mp_maxid rather than MAXCPU to terminate a loop
when assigning per-cpu ACPI IDs to avoid a dependency on 'options SMP'.
- Allow the apic device to be disabled via 'hint.apic.0.disabled' from the
loader. Note that since this is done in the local APIC code, it works
for both the ACPI and non-ACPI cases.
John Baldwin [Wed, 3 Dec 2003 20:27:48 +0000 (20:27 +0000)]
Update this driver to be more module friendly:
- Dynamically allocate the cpu_softc[] array based on mp_maxid instead of
using a statically sized array that depended on 'options SMP'.
- Use mp_maxid rather than MAXCPU when walking all the CPUs looking for a
match.
- Always call smp_rendezvous() since UP kernels now provide this.
- Use mp_ncpus rather than cpu_ndevices when determining if we need to
disable C3 for SMP machines.
Warner Losh [Wed, 3 Dec 2003 17:09:41 +0000 (17:09 +0000)]
Remove old cxconfig utility and connect new sconfig utility to the build.
The sconfig utility supports more than just cx boards, and those drivers
will make their way into FreeBSD shortly (maybe before 5.2).
Confirmed that this doesn't break the build.
Submitted by: Roman Kurakin <rik@cronyx.ru>
Approved by: re@ <scottl>
John Baldwin [Wed, 3 Dec 2003 14:55:31 +0000 (14:55 +0000)]
Export a few SMP related symbols in UP kernels as well. This is needed to
aid other kernel code, especially code which can be in a module such as
the acpi_cpu(4) driver, to work properly with both SMP and UP kernels.
The exported symbols include mp_ncpus, all_cpus, mp_maxid, smp_started, and
the smp_rendezvous() function. This also means that CPU_ABSENT() is now
always implemented the same on all kernels.
Warner Losh [Wed, 3 Dec 2003 07:29:38 +0000 (07:29 +0000)]
Updated cx driver commit part 1: bring in the new kernel driver.
This is the vastly updated cx drvier from Roman Kurakin <rik@cronyx.ru>
who has been patiently waiting for this update for sometime.
The driver is mostly a rewrite from the version we have in the tree.
While some similarities remain, losing the little history that the old
driver has is not a big loss, and the re@ felt it was easier this way (less
error prone).
The userland parts of this update will be committed shortly.
The driver is not connected to the build yet. I want to make sure I
don't break any platform at any time, so I want to test that with
these files in the tree before I continue (on the off chance I'm
forgetting a file).
I changed the DEBUG macro to CX_DEBUG from the code that was submitted
(to not break when we go to building with opt_global.h after the
release), as well adding $FreeBSD$.
Submitted by: Roman Kurakin
Approved by: re@ <scottl>
Peter Wemm [Wed, 3 Dec 2003 06:58:48 +0000 (06:58 +0000)]
Add an additional knob to just disable the apic code without also having
to resort to disabling acpi as well. I'll document this in the release
notes for amd64.
Peter Wemm [Wed, 3 Dec 2003 06:54:40 +0000 (06:54 +0000)]
For the amd64 we need to do some extra stack alignment fixups. Otherwise
we can end up with some threads with a non-16-byte-aligned stack. This
causes some interesting side effects, including general protection
faults leading to a SIGBUS when doing floating point or varargs. This
should be just a verbose NOP for the other platforms.
Andre Oppermann [Tue, 2 Dec 2003 21:25:12 +0000 (21:25 +0000)]
Swap destination and source arguments of two bcopy() calls.
Before committing the initial tcp_hostcache I changed them from memcpy()
to conform with FreeBSD style without realizing the difference in argument
definition.
This fixes hostcache operation for IPv6 (in general and explicitly IPv6
path mtu discovery) and T/TCP (RFC1644).
Submitted by: Taku YAMAMOTO <taku@cent.saitama-u.ac.jp>
Approved by: re (rwatson)
Replace the KDE and GNOME 2 desktops with KDE (Lite Edition) and GNOME 2
(Lite Edition) respectively. These "lite" packages are streamlined to
provide users with the core essentials for each desktop and to fit on the
release disc 1.
Brooks Davis [Tue, 2 Dec 2003 18:33:36 +0000 (18:33 +0000)]
This is a direct commit to the vendor branch with code from the vendor.
Replace the if_name and if_unit members of struct ifnet with new members
if_xname, if_dname, and if_dunit. if_xname is the name of the interface
and if_dname/unit are the driver name and instance.
This change paves the way for interface renaming and enhanced pseudo
device creation and configuration symantics.
Bruce Evans [Tue, 2 Dec 2003 15:02:12 +0000 (15:02 +0000)]
Fixed panics in apic interrupt handlers if kernel profiling is turned
on. MCOUNT and FAKE_MCOUNT() may clobber all the call-used registers,
and one FAKE_MCOUNT() was placed so that an active %eax was clobbered.
The fix is to move this FAKE_MCOUNT() earlier where it should have
been anyway.
Fixed 3 layers of bitrot in the comment about why this FAKE_MCOUNT()
was where it was by removing the comment. (mcount() should be called
as early as possible after entering a new level, but an implementation
detail got in the way until 3 layers of changes ago.)
Kernel profiling still gives wrong results because the new interrupt
code rearranged object files too much. mcount() depends on trap,
syscall and interrupt handlers being between certain magic labels with
interrupt handlers last, and on nothing else being there. Splitting
up exception.o moved the magic labels to effectively random places
relative to what they are supposed to delimit. This mainly broke the
call graph; the flat profile is still usable.
Bruce Evans [Tue, 2 Dec 2003 12:36:00 +0000 (12:36 +0000)]
Fixed breakage of the pci case of the cy driver by the new interrupt
code. Both the driver and the new code were wrong. Driver interrupt
handlers are supposed to take "void *vsc" arg, but some including all
COMPAT_ISA drivers and the pci part of the cy driver want an "int unit"
arg. They got this using bogus casts of function pointers which should
have kept working despite their bogusness. However, the new interrupt
code doesn't honor requests to pass an arg of ((void *)0), so things
are very broken if the arg is actually a representation of unit 0.
The fix is to use a normal "void *vsc" arg for the pci case and a
wrapper for the COMPAT_ISA case (of the cy driver). This cleans up
new-busification of the pci case but takes the COMPAT_ISA case a little
further from new-bus. The corresponding bug for the COMPAT_ISA case
has already been fixed similarly using a wrapper in compat_isa.c and
we need another wrapper just to undo that.
Fixed some directly related style bugs (mainly by removing compatibility
cruft).
cy.c:
Fixed an indirectly related old bug in cyattach_common(). A wrong status
was returned in the unlikely event that malloc() failed.
Paul Saab [Tue, 2 Dec 2003 07:57:20 +0000 (07:57 +0000)]
After extensive QA cycles at 3ware, bring the driver in-line with all the
issues which they found and asked to be changed so 3ware can offcially
support the driver.
Summary of the most significant changes:
- TWE_OVERRIDE is no longer supported
- If twe_getparam failed, bogus data would be returned to the caller
- Cache the device unit in the twe_drive structure to aid debugging
- Add the 3ware driver version.
- Proper return error codes for many functions.
- Track the minimum queue length statistics
- 4.x compat: use the cached unit number from the twe_drive structure
instead of the the cached si_drv2. 3ware found that after many loads
and unloads that si_drv2 became corrupted. This did not happen in
-current.
Submitted by: Vinod Kashyap (with modifications by me)
Approved by: re (rwatson)
Bruce A. Mah [Tue, 2 Dec 2003 07:13:03 +0000 (07:13 +0000)]
Trim wi(4) devices from the hardware notes. Also add a listing of the
various chipsets supported by this driver as there are only a few and
this seems to be useful information.
Warner Losh [Tue, 2 Dec 2003 04:59:59 +0000 (04:59 +0000)]
Fix Lucent cards.
o Back out workaround for not resetting lucent cards more than once. With
these fixes, it appaers they are no longer necessary.
o Set wi_gone when the card goes awol: typically when we get 0xffff back from
the card. Also, don't interact with a card that's gone, so we fail in
seconds rather than minutes. Also reduce amount of time we wait to .5s
in wi_cmd.
o clear wi_gone on ifconfig down to give some cards a chance after they wedge
(this appears to unwedge one of my prism cards with old firmware). ifconfig
up will fail quickly enough if the card really is out to lunch.
o Add delay in wi_init of 100ms.
o wi_stop(ifp, 0->1) changes so that we clear sc_enabled so that we
exit out of the interrupt routine by just acking the interrupt
Submitted by: iedowse
Approved by: re@ (scottl)
# after the freeze I'll fix some of the minor style issues that reviewers
# of this patch have told me about.
Sam Leffler [Tue, 2 Dec 2003 00:23:45 +0000 (00:23 +0000)]
Include opt_ipsec.h so IPSEC/FAST_IPSEC is defined and the appropriate
code is compiled in to support the O_IPSEC operator. Previously no
support was included and ipsec rules were always matching. Note that
we do not return an error when an ipsec rule is added and the kernel
does not have IPsec support compiled in; this is done intentionally
but we may want to revisit this (document this in the man page).
PR: 58899
Submitted by: Bjoern A. Zeeb
Approved by: re (rwatson)
David Greenman [Mon, 1 Dec 2003 22:12:50 +0000 (22:12 +0000)]
Fixed a bug in sendfile(2) where the sent data would be corrupted due
to sendfile(2) being erroneously automatically restarted after a signal
is delivered. Fixed by converting ERESTART to EINTR prior to exiting.
Updated manual page to indicate the potential EINTR error, its cause
and consequences.
Don Lewis [Mon, 1 Dec 2003 19:03:50 +0000 (19:03 +0000)]
Use a mutex to synchronize the driver top and bottom halves instead of
using critcal_enter() and critical_exit() to attempt to replace spl*()
calls. The critical section was calling selrecord(), which locks an
MTX_DEF mutex, which is not legal in a critical section.
Tested by: Stefan Ehmann <shoesoft@gmx.net> and "make universe"
Approved by: re (scottl)
Ian Dowse [Sun, 30 Nov 2003 23:30:09 +0000 (23:30 +0000)]
In dounmount(), only call checkdirs() prior to VFS_UNMOUNT() in the
forced unmount case. Otherwise, a file system that is referenced
only by process fd_cdir/fd_rdir references to the file system root
vnode will be successfully unmounted without the MNT_FORCE flag.
The previous behaviour was not compatible with the unmount semantics
required by amd(8), so file systems could be unexpectedly unmounted
while there were still references to the file system root directory.
Reported by: Erez Zadok <ezk@cs.sunysb.edu>
Approved by: re (scottl)
Jeff Roberson [Sun, 30 Nov 2003 22:20:40 +0000 (22:20 +0000)]
- Make mp_maxid reflect the same meaning as it does on other architectures.
It is one past the last valid cpuid. This relied on a different bug in
UMA to work properly.
Jeff Roberson [Sun, 30 Nov 2003 22:18:14 +0000 (22:18 +0000)]
- Unbreak UP. mp_maxid is not defined on uni-processor machines, although
I believe it and the other MP variables should be. For now, just define it
here and wait for jhb to clean it up later.
The new "spec against spec" comparison code was yet another time
victim of the special sort order employed where files come before
directories and alphabetic inside these two groups.
Søren Schmidt [Sun, 30 Nov 2003 16:27:59 +0000 (16:27 +0000)]
Fix ata-card.
The altio resource magic no longer worked probably due to other changes
in the kernel. Redo that part so it also fits better into ATAng.
Fix detach so it doesn't panic the system when a pccard device is
yanked.
Jeff Roberson [Sun, 30 Nov 2003 08:04:01 +0000 (08:04 +0000)]
- Replace the local maxcpu with mp_maxid. Previously, if mp_maxid
was equal to MAXCPU, we would overrun the pcpu_mtx array because maxcpu
was calculated incorrectly.
- Add some more debugging code so that memory leaks at the time of
uma_zdestroy() are more easily diagnosed.