Commit Graph

60696 Commits

Author SHA1 Message Date
Ruslan Ermilov
e640c42275 - Removed a copyright from makefile.
- Added ${.CURDIR} to .include "...".
- Whitespace fixes.

OK'ed by:	piso
2006-09-27 12:30:27 +00:00
Eric Anholt
30e14d656c Add support for 945G/GM AGP chipsets.
The key problem was that the aperture size detection using the MSAC bit
doesn't work -- the bit appears to be set even when it shouldn't be.  Linux
takes a different approach, testing for a bit of the GMADR (PCIR_BAR(2)) being
set.  However, as I don't think that's a safe way to test aperture size, we
just allocate the resource and check its size.  This also pointed out that
agp_generic_attach hadn't been allocating our aperture resource, which may
have caused problems in some cases.

Also corrected is a minor copy-and-pasteo in an error case.

PR:		kern/103079
Submitted by:	mnag
Tested on:	i945GM, i915GM
MFC after:	2 weeks
2006-09-27 06:38:54 +00:00
Scott Long
37fe50c382 Skip the AEN event command that is always hanging out on the card.
Submitted by: Doug Ambrisko
2006-09-27 05:00:10 +00:00
Scott Long
420a5a0e25 Fix a bad #include statment 2006-09-27 04:54:23 +00:00
Paolo Pisati
7c00cc76f0 Compilation. 2006-09-27 02:08:44 +00:00
Paolo Pisati
be4f3cd0d9 Summer of Code 2005: improve libalias - part 1 of 2
With the first part of my previous Summer of Code work, we get:

-made libalias modular:

 -support for 'particular' protocols (like ftp/irc/etcetc) is no more
  hardcoded inside libalias, but it's available through external
  modules loadable at runtime

 -modules are available both in kernel (/boot/kernel/alias_*.ko) and
  user land (/lib/libalias_*)

 -protocols/applications modularized are: cuseeme, ftp, irc, nbt, pptp,
  skinny and smedia

-added logging support for kernel side

-cleanup

After a buildworld, do a 'mergemaster -i' to install the file libalias.conf
in /etc or manually copy it.

During startup (and after every HUP signal) user land applications running
the new libalias will try to read a file in /etc called libalias.conf:
that file contains the list of modules to load.

User land applications affected by this commit are ppp and natd:
if libalias.conf is present in /etc you won't notice any difference.

The only kernel land bit affected by this commit is ng_nat:
if you are using ng_nat, and it doesn't correctly handle
ftp/irc/etcetc sessions anymore, remember to kldload
the correspondent module (i.e. kldload alias_ftp).

General information and details about the inner working are available
in the libalias man page under the section 'MODULAR ARCHITECTURE
(AND ipfw(4) SUPPORT)'.

NOTA BENE: this commit affects _ONLY_ libalias, ipfw in-kernel nat
support will be part of the next libalias-related commit.

Approved by: glebius
Reviewed by: glebius, ru
2006-09-26 23:26:53 +00:00
Scott Long
31e2a87d4d The need to run a filter also implies that bouncing could be possible, so
just use the COULD_BOUNCE flag for both and retire the USE_FILTER flag.
This fixes the problem that rev 1.81 introduced with the if_bfe driver
(and possibly others).
2006-09-26 23:14:42 +00:00
John Baldwin
bec0c98eae Fix a memory leak in ipmi_unload().
CID:		1542
Found by:	Coverity Prevent
2006-09-26 15:48:13 +00:00
John Baldwin
d93b6afb2b Only support the SMB_OLD_BREAD ioctl if one of COMPAT_FREEBSD[456] is
defined.
2006-09-26 14:38:56 +00:00
Robert Watson
d39de3122d PC98 would also like a trademark.
Who would have thought that getting a kernel printf right would be so
tricky?

MFC after:	3 days
Submitted by:	Gavin Atkinson <gavin dot atkinson at ury dot york dot ac dot uk>
2006-09-26 12:45:47 +00:00
Ruslan Ermilov
f0e795737b Add a value to the define I forgot, for the purity's sake. 2006-09-26 12:44:20 +00:00
Ruslan Ermilov
f88b3f22ac Now that we have COMPAT_FREEBSD6 officially, use it from opt_compat.h. 2006-09-26 12:41:13 +00:00
Ruslan Ermilov
6c9fdda750 Added COMPAT_FREEBSD6 option. 2006-09-26 12:36:34 +00:00
Matt Jacob
9311717d79 Begin the process of moving info to sysctl stuff for FreeBSD
by providing OIDs for WWNN/WWPN and Initiator ID.
2006-09-26 04:59:52 +00:00
Tor Egge
8d0547c68b Protect change to bo_flag by holding the bufobj mutex. 2006-09-26 04:21:20 +00:00
Tor Egge
e60c361218 Reduce fluctuations of mnt_flag to allow unlocked readers to get a
slightly more consistent view.
2006-09-26 04:20:09 +00:00
Tor Egge
9b65c22cf4 Don't restore MNT_QUOTA bit in mnt_flag after snapshot creation,
closing a race between nmount() and quotactl().
2006-09-26 04:19:11 +00:00
Tor Egge
fba924ce9b Don't restore MNT_QUOTA bit in mnt_flag after a failed mount with
MNT_UPDATE flag, closing a race between nmount() and quotactl().
2006-09-26 04:18:36 +00:00
Tor Egge
55b4ff0d9f Increase mnt_noasync once in softdep_mount() to disallow async io,
closing a window where a file system using softupdates could be async
for a short while if both MNT_UPDATE and MNT_ASYNC were passed as flags
to nmount().  Add MNTK_SOFTDEP flag to ensure that softdep_mount()
doesn't increase mnt_noasync multiple times.
2006-09-26 04:17:17 +00:00
Tor Egge
a1e363f256 Add mnt_noasync counter to better handle interleaved calls to nmount(),
sync() and sync_fsync() without losing MNT_ASYNC.  Add MNTK_ASYNC flag
which is set only when MNT_ASYNC is set and mnt_noasync is zero, and
check that flag instead of MNT_ASYNC before initiating async io.
2006-09-26 04:15:59 +00:00
Tor Egge
cea9d840d8 Don't restore mnt_kern_flag on failed MNT_UPDATE mount, it can race
with dounmount(), causing loss of MNTK_UNMOUNT flag.
2006-09-26 04:15:04 +00:00
Tor Egge
5da56ddb21 Use mount interlock to protect all changes to mnt_flag and mnt_kern_flag.
This eliminates a race where MNT_UPDATE flag could be lost when nmount()
raced against sync(), sync_fsync() or quotactl().
2006-09-26 04:12:49 +00:00
John-Mark Gurney
e16fa5ca55 fix calculating to_tsecr... This prevents the rtt calculations from
going all wonky...
2006-09-26 01:21:46 +00:00
Robert Watson
88b85279a9 SI_ORDER_THIRD + 2, not SI_ORDER_FOURTH + 2.
MFC after:	3 days
Submitted by:	mlaier
2006-09-26 00:15:56 +00:00
Robert Watson
5add74b4a7 Add "FreeBSD" trademark statement to copyright section of boot messages.
MFC after:	3 days
Approved by:	core, board at FreeBSDFoundation dot org
2006-09-25 23:19:01 +00:00
Robert Watson
d038d0bd66 Merge OpenBSM 1.0 alpha 12 import changes into src/sys/bsm. New events
for the Linuxulator.

MFC after:	3 days
Obtained from:	TrustedBSD Project
2006-09-25 12:22:07 +00:00
Bruce M Simpson
13c8384424 Fix an incompatibility between CARP and IPv4 multicast routing, whereby
the VRRPv2 advertisements will originate from the wrong source address.
This only affects kernels compiled with MROUTING and after the MRT_INIT
ioctl() has been issued.
Set imo_multicast_vif in carp's softc to the invalid value -1 after it is
zeroed by softc allocation, to stop the ip_output() path looking up the
incorrect source address thinking a vif is set.

PR:		kern/100532
Submitted by:	Bohus Plucinsky
MFC after:	1 week
2006-09-25 11:53:54 +00:00
Bruce M Simpson
e2fd806b36 Spleling
Submitted by:	pjd
2006-09-25 11:48:07 +00:00
Scott Long
40218a48e0 Update the mfi module build with the mfi_debug.c file. 2006-09-25 11:42:12 +00:00
Scott Long
6b31d3f79d Add the mfi_debug.c file and MFI_DEBUG option. 2006-09-25 11:40:14 +00:00
Scott Long
5ba21ff136 Add a command debugging module and a periodic watchdog timer.
Sponsored by: IronPort
2006-09-25 11:35:34 +00:00
Søren Schmidt
6182698f19 add support for the ALI/ULI M5288 AHCI part.
patch by: Sven Petai
2006-09-25 11:26:29 +00:00
Bruce M Simpson
07ea6709ea Account for output IP datagrams on the ifaddr where they originated from,
*not* the first ifaddr on the ifp.  This is similar to what NetBSD does.

PR:		kern/72936
Submitted by:	alfred
Reviewed by:	andre
2006-09-25 10:11:16 +00:00
John-Mark Gurney
4dc630cdd2 if min is greater than max, prefer max over min... I managed to get a
retransmit timer that was going to take 19 days to trigger...

Reviewed by:	silby
2006-09-25 07:22:39 +00:00
John-Mark Gurney
33fabe46da remove unnecessary NULL check...
Coverity ID:	1545
2006-09-25 01:29:48 +00:00
Warner Losh
2dca50b6a1 Add a newline to the printf. 2006-09-24 19:24:26 +00:00
Alexander Leidinger
18c15b598d Fix uninitialized variable warning.
Submitted by:	dhw
Reviewed by:	ryanb
2006-09-24 17:37:03 +00:00
Robert Watson
22b7bca620 Rework the way errors are handled with respect to how audit records are
written to the audit trail file:

- audit_record_write() now returns void, and all file system specific
  error handling occurs inside this function.  This pushes error handling
  complexity out of the record demux routine that hands off to both the
  trail and audit pipes, and makes trail behavior more consistent with
  pipes as a record destination.

- Rate limit kernel printfs associated with running low on space.  Rate
  limit audit triggers for low space.  Rate limit printfs for fail stop
  events.  Rate limit audit worker write error printfs.

- Document in detail the types of limits and space checks we perform, and
  combine common cases.

This improves the audit subsystems tolerance to low space conditions by
avoiding toasting the console with printfs are waking up the audit daemon
continuously.

MFC after:	3 days
Obtained from:	TrustedBSD Project
2006-09-24 13:35:58 +00:00
Hiroki Sato
8ee0930a99 Disable an overly-verbose warning message by default.
Suggested by:	njl
MFC after:	3 days
2006-09-24 09:39:17 +00:00
John-Mark Gurney
4db71d27a1 hide kqueue_register from public view, and replace it w/ kqfd_register...
this eliminates a possible race in aio registering a kevent..
2006-09-24 04:47:47 +00:00
John-Mark Gurney
aeab19b21f return EBADF instead of successfully attaching (and then panicing) when
an fd is dieing..

Convinced by:	jhb
PR:		103127
2006-09-24 02:29:53 +00:00
John-Mark Gurney
9edac6f3f9 add KTRACE hooks into kevent... This will help people debug their kqueue
programs to find out exactly which events were registered and which were
returned...  This should be lower in kern_kevent, but that would require
special munging due to locks and the functions used to copyin/copyout
kevents...

If someone wants to teach ktrace how to output pretty kevents, I have a
kevent prety printer that can be used...
2006-09-24 02:23:29 +00:00
Warner Losh
4e53810378 Cleanup sloppy ifdef. 2006-09-24 00:26:33 +00:00
Alexander Leidinger
b611c801f0 MFp4 the sound Google Summer of Code project:
The goal was to sync with the OSSv4 API 4Front Technologies uses in their
proprietary OSS driver. This was successful as far as possible. The part
of the API which is stable is implemented, for the rest there are some
stubs already.

New system ioctls:
 - SNDCTL_SYSINFO - obtain audio system info (version, # of audio/midi/
   mixer devices, etc.)
 - SNDCTL_AUDIOINFO - fetch details about a specific audio device
 - SNDCTL_MIXERINFO - fetch details about a specific mixer device

New audio ioctls:
 - Sync groups (SNDCTL_DSP_SYNCGROUP/SNDCTL_DSP_SYNCSTART) which allow
   triggered playback/recording on multiple devices (even across processes
   simultaneously).
 - Peak meters (SNDCTL_DSP_GETIPEAKS/SNDCTL_DSP_GETOPEAKS) - can query
   audio drivers for peak levels (needs driver support, disabled for now).
 - Per channel playback/recording levels -
   SNDCTL_DSP_{GET,SET}{PLAY,REC}VOL.  Note that these are still in name
   only, just wrapping around the AC97-style mixer at the moment. The next
   step is to push them down to the drivers.

Audio ioctls still under development by 4Front (for which stubs may exist
in this commit):
 - SNDCTL_GETNAME, SNDCTL_{GET,SET}{SONG,LABEL}
 - SNDCTL_DSP_{GET,SET}_CHNORDER
 - SNDCTL_MIX_ENUMINFO, SNDCTL_MIX_EXTINFO - (might be documented enough in
   the OSS releases to work on this.  These ioctls cover the cool "twiddle
   any knob on your card" features.)

Missing:
 - SNDCTL_DSP_COOKEDMODE -- this ioctl is used to give applications direct
   access to a card's buffers, bypassing the feeder architecture.  It's
   a toughy -- "someone" needs to decide :
   (a) if this is desireable, and (b) if it's reasonably feasible.

Updates for driver writers:
 So far, only two routines to the channel class (in channel_if.m) are added.
 One is for fetching a list of discrete supported playback/recording rates
 of a channel, and the other is for fetching peak level info (useful for
 drawing peak meters).  Interested parties may want to help pushing down
 SNDCTL_DSP_{GET,SET}{PLAY,REC}VOL into the drivers.

To use the new stuff you need to rebuild the sound drivers or your kernel
(depending on if you use modules or not) and to install soundcard.h (a
buildworld/installworld handles this).

Sponsored by:	Google SoC 2006
Submitted by:	ryanb
Many thanks to:	4Front Technologies for their cooperation, explanations
		and the nice license of their soundcard.h.
2006-09-23 20:45:47 +00:00
John-Mark Gurney
402865f637 now that we don't automagicly increase the MTU of host routes, when we copy
the loopback interface, copy it's mtu also..  This means that we again have
large mtu support for local ip addresses...
2006-09-23 19:24:10 +00:00
Alexander Leidinger
d4b7423fa1 MFp4:
- Linux returns ENOPROTOOPT in a case of not supported opt to setsockopt.
- Return EISDIR in pread() when arg is a directory.
- Return EINVAL instead of EFAULT when namelen is not correct in accept().
- Return EINVAL instead of EACCESS if invalid access mode is entered in
  access().
- Return EINVAL instead of EADDRNOTAVAIL in a case of bad salen param
  to bind().

Submitted by:	rdivacky
Tested with:	LTP (vfork01 fails now, but it seems to be a race and
		not caused by those changes)
MFC after:	1 week
2006-09-23 19:06:54 +00:00
Scott Long
f1a7e6d559 Allow the ASF feature to be disabled via a tunable. On one of my systems,
bringing up the bge interface results in a complete system freeze when
this feature is enabled.  Leave it enabled by default.
2006-09-23 18:55:49 +00:00
Martin Blapp
45e6819160 Protect enterpgrp() against another tty/proc race case until the tty locking work
has been fixed.

MFC after:	1 week
2006-09-23 17:35:24 +00:00
Bruce M Simpson
f1edc3bde5 Always set the IP version in the TCP input path, to preserve
the header field for possible later IPSEC SPD lookup, even
when the kernel is built without 'options INET6'.

PR:		kern/57760
MFC after:	1 week
Submitted by:	Joachim Schueth
2006-09-23 16:26:31 +00:00
Martin Blapp
7c56049e6d Check for tp->t_refcnt == 0 before doing anything in tty_open().
PR:		103520
MFC after:	1 week
2006-09-23 14:52:46 +00:00
Martin Blapp
153c21c8c1 If /dev/tty gets opened after your controlling terminal has been revoked
you can't call tty_clone afterwords. OpenBSD and NetBSD both fail the
open call in that case, so we should do so as well. This can
be done in ctty_clone by returning with *dev==NULL. Admittedly this
causes open to return ENOENT, instead of ENXIO as on the other BSDs,
but this way requires the least touching of code.

Submitted by:  Nate Eldredge <nge@cs.hmc.edu>
PR:            83375

MFC:           1 week
2006-09-23 14:44:14 +00:00
David Xu
07a8ebcc75 Stop reloading %fs and %gs, since it causes the base address from
GDT to be loaded into FS.base and GS.base, these values of course
are not the values set by sysarch() with I386_SET_FSBASE and
I386_SET_GSBASE, the change fixed a crash for 32bit libthr after
signal handler returned and normal code is accessing thread pointer,
for example: movl %gs:8, %eax.
2006-09-23 13:42:09 +00:00
David Xu
4af4fcb71a Regenerate. 2006-09-23 00:27:53 +00:00
David Xu
5c26f4cea8 Enable sigwait. 2006-09-23 00:27:11 +00:00
John Baldwin
157f14ae25 Map pmap_{un,}mapbios() to pmap_{un,}mapdev() on 6.x and earlier. 2006-09-22 22:16:20 +00:00
John Baldwin
d72a078647 Update the ipmi(4) driver:
- Split out the communication protocols into their own files and use
  a couple of function pointers in the softc that the commuication
  protocols setup in their own attach routine.
- Add support for the SSIF interface (talking to IPMI over SMBus).
- Add an ACPI attachment.
- Add a PCI attachment that attaches to devices with the IPMI interface
  subclass.
- Split the ISA attachment out into its own file: ipmi_isa.c.
- Change the code to probe the SMBIOS table for an IPMI entry to just use
  pmap_mapbios() to map the table in rather than trying to setup a fake
  resource on an isa device and then activating the resource to map in the
  table.
- Make bus attachments leaner by adding attach functions for each
  communication interface (ipmi_kcs_attach(), ipmi_smic_attach(), etc.)
  that setup per-interface data.
- Formalize the model used by the driver to handle requests by adding an
  explicit struct ipmi_request object that holds the state of a given
  request and reply for the entire lifetime of the request.  By bundling
  the request into an object, it is easier to add retry logic to the various
  communication backends (as well as eventually support BT mode which uses
  a slightly different message format than KCS, SMIC, and SSIF).
- Add a per-softc lock and remove D_NEEDGIANT as the driver is now MPSAFE.
- Add 32-bit compatibility ioctl shims so you can use a 32-bit ipmitool
  on FreeBSD/amd64.
- Add ipmi(4) to i386 and amd64 NOTES.

Submitted by:	ambrisko (large portions of 2 and 3)
Sponsored by:	IronPort Systems, Yahoo!
MFC after:	6 days
2006-09-22 22:11:29 +00:00
Andrew Thompson
0a6f8a5050 Revert r1.80 as the ethernet header was inadvertently stripped from ARP
packets. Reimplement this correctly and use a sysctl that defaults to off so
the user doesnt get any suprises if ipfw blocks the ARP packet.

MFC after:	3 days
2006-09-22 21:57:52 +00:00
Ruslan Ermilov
43e5f4b8cd Update a comment about M_VLANTAG. 2006-09-22 19:50:04 +00:00
Bruce M Simpson
4a75dc2585 Fix a case where socket I/O atomicity is violated due to not dropping
the entire record when a non-data mbuf is removed in the soreceive() path.
This only triggers a panic directly when compiled with INVARIANTS.

PR:		38495
Submitted by:	James Juran
MFC after:	1 week
2006-09-22 15:34:16 +00:00
David Xu
ac3674aa52 Regenerate. 2006-09-22 15:05:34 +00:00
David Xu
cda9a0d1c2 Add compatible code to let 32bit libthr work on 64bit kernel. 2006-09-22 15:04:28 +00:00
David Xu
e58b17ea53 Fix umtx command order error for freebsd 32bit. 2006-09-22 14:59:10 +00:00
Olivier Houchard
b098674792 Use usbd_clear_endpoint_stall_async() when clearing endpoint stalls in
an interrupt context.

Obtained from:	NetBSD
MFC after:	1 week
2006-09-22 12:45:42 +00:00
Alan Cox
6b5e9c85b0 The fix in revision 1.152 converted in the wrong direction.
Fix a typo in a comment.

Submitted by: Michael Plass
2006-09-22 07:16:36 +00:00
Alan Cox
b8a4b36974 The sparc64/sparc64/pmap.c implementations of pmap_remove(),
pmap_protect(), and pmap_copy() have optimizations for regions
larger than PMAP_TSB_THRESH (which works out to 16MB).  This
caused a panic in tsb_foreach for kernel mappings, since
pm->pm_tsb is NULL in that case.  This fix teaches tsb_foreach
to use the kernel's tsb in that case.

Submitted by: Michael Plass
MFC after: 3 days
2006-09-22 07:02:15 +00:00
SUZUKI Shinsuke
831c32014e fixed a bug that IPv6 packets arriving to stf are not accepted.
(a degrade introduced in in6.c Rev 1.61)

PR: kern/103415
Submitted by: JINMEI Tatuya
MFC after: 1 week
2006-09-22 01:42:22 +00:00
SUZUKI Shinsuke
8343821b87 fixed a bug that local IPv6 traffic (to an address configured on an
interface other than lo0) does not show up properly on any bpf.

Reported by: mlaier
Reviewed by: gnn, csjp
MFC after: 1 week
2006-09-22 01:31:22 +00:00
David Xu
27bbb2e71f Regenerate. 2006-09-22 00:53:43 +00:00
David Xu
1eec02f538 Add umtx support for 32bit process on AMD64 machine. 2006-09-22 00:52:54 +00:00
Matt Jacob
4542a3798e Connect up a QUEUE FULL event with CAM and adjust openings.
Unfortunately, the QUEUE FULL event only tells you Bus && Target.
It doesn't tell you lun. In order for the XPT_REL_SIMQ action to
work, we have to have a real lun. But which one? For now, just
iterate over MPT_MAX_LUNS.

Practically speaking, this is only going to be happening for lower
quality SAS or SATA drives behind the SAS controller, which means
only lun 0, so it's not so bad.

Helpful Reminder Nagging from: John Baldwin, Fred Whiteside

MFC after:	5 days
2006-09-21 20:35:12 +00:00
Andre Oppermann
ba04adb0f9 Move the initialization of the hardware capabilities in em_init_locked()
before em_setup_transmit_structures() as it needs this information to
properly set up TSO parameters.

Reviewed by:	jfv
2006-09-21 19:14:51 +00:00
John Baldwin
e7a975adbe Fix a sign bug in acpi_release_resource(). acpi_sysres_find() returns !=
NULL if the specified resource is a sub-alloc of a system resource.
2006-09-21 18:56:03 +00:00
Robert Watson
827f0e85a6 Regenerate. 2006-09-21 16:20:38 +00:00
Robert Watson
e6f188152c Use AUE_CREAT instead of AUE_O_CREAT for linux_creat().
Obtained from:	TrustedBSD Project
2006-09-21 16:18:33 +00:00
Robert Watson
753a5e888c Regenerate. 2006-09-21 16:13:16 +00:00
Robert Watson
b5ca51459a Use AUE_GETDIRENTRIES instead of AUE_O_GETDENTS and AUE_NULL for a number
of directory reading system calls.

Respell a mis-spelled event name.

Clean up white space/line wraps in a couple of places.

Assign event numbers to some new system call entries that have turned
up in the list since audit support was added.

Obtained from:	TrustedBSD Project
2006-09-21 16:12:58 +00:00
Martin Blapp
1c1d411bee Back out rev. 1.258. The real race cause has been fixed
in rev. 1.241 of kern_proc.c.

Requested by:	jhb
2006-09-21 14:09:26 +00:00
Randall Stewart
adf5d1c6d0 atomic_fetchadd_int is used by mb_free_ext(), but it
returns the previous value that the "add" effected (In
this case we are adding -1), afterwhich we compare it
to '0'... to see if we free the mbuf... we should
be comparing it to '1'... Note that this only effects
when there is contention since there is a first part
to the comparison that checks to see if its '1'. So
this bug would only crop up if two CPU's are trying
to free the same mbuf refcount at the same time. This
will happen in SCTP but I doubt can happen in TCP or
UDP.
PR:		N/A
Submitted by:	rrs
Reviewed by:	gnn,sam
Approved by:	gnn,sam
2006-09-21 09:55:43 +00:00
Robert Watson
2ecf07cb25 Merge OpenBSM 1.0 alpha 11 changes into src/sys/bsm and src/sys/security;
primarily, add new event identifiers and update trigger names.

Obtained from:	TrustedBSD Project
2006-09-21 07:27:02 +00:00
David Xu
ecc313475b Regenerate. 2006-09-21 04:50:38 +00:00
David Xu
47bd78d24d sync with master. 2006-09-21 04:49:36 +00:00
David Xu
cca0a557dd Regenerate. 2006-09-21 04:19:48 +00:00
David Xu
73fa3e5b88 Replace system call thr_getscheduler, thr_setscheduler, thr_setschedparam
with rtprio_thread, while rtprio system call is for process only, the new
system call rtprio_thread is responsible for LWP.
2006-09-21 04:18:46 +00:00
Alexander Kabaev
fa034a084b Use __builtin_offsetof for GCC 4.1. 2006-09-21 01:38:58 +00:00
Alexander Kabaev
d9cb97ff9d Use __builtin_va_start instead of __builtin_stdarg_start. GCC4 obsoletes
the former and  __builtin_va_start was present in all GCC version 3.1 and
later.
2006-09-21 01:37:02 +00:00
Wojciech A. Koszek
dec10b39fd Correct 'interrupt interrupt' -> 'interrupt' in the comment.
Requested by:	jhb
Approved by:	cognet (mentor)
2006-09-20 20:52:11 +00:00
Alexander Leidinger
6dc4e81071 style(9)
While I'm here add a MFC reminder, I forgot it in the previous commit.

Noticed by:	ssouhlal
MFC after:	1 week
2006-09-20 19:27:11 +00:00
Doug Ambrisko
796ddce11d Add a new 'bce_mgmt_init_locked' function to enable the minimal parts
of the chip to let ASF/IPMI firmware to respond to IPMI after attaching
and when the chip is down.  David looked at it but could really say
what they right minimal config. stuff would be.  It's not documented.
I figured this out via trial and error.

Reviewed by:	davidch
2006-09-20 18:55:16 +00:00
Doug Ambrisko
a1adc445ed Allow hw.mfi.event_locale/hw.mfi.event_class to be set via loader.
If an event doesn't match the criteria then don't print it.  Some
events are not saved in the log (<0 class events).
2006-09-20 18:49:35 +00:00
Alexander Leidinger
a312f6a30a Bring the i386 linux mmap code more into line with how linux (2.4.x)
behaves. This fixes a lot of test which failed before. For amd64 there
are still some problems, but without any testers which apply patches
and run some predefines tests we can't do more ATM.

Submitted by:	Marcin Cieslak <saper@SYSTEM.PL> (minor fixups by myself)
Tested with:	LTP
2006-09-20 17:24:20 +00:00
Robert Watson
f50c4fd817 Remove MAC_DEBUG + MPRINTF debugging from System V IPC. This no longer
appears to be serving a useful purpose, as it was used during initial
development of MAC support for System V IPC.

MFC after:	1 month
Obtained from:	TrustedBSD Project
Suggested by:	Christopher dot Vance at SPARTA dot com
2006-09-20 13:40:00 +00:00
Robert Watson
738f14d4b1 Remove MAC_DEBUG label counters, which were used to debug leaks and
other problems while labels were first being added to various kernel
objects.  They have outlived their usefulness.

MFC after:	1 month
Suggested by:	Christopher dot Vance at SPARTA dot com
Obtained from:	TrustedBSD Project
2006-09-20 13:33:41 +00:00
Robert Watson
04f11621df Rather than allocating all buffer memory for the completed BSM record
when allocating the record in the first place, allocate the final buffer
when closing the BSM record.  At that point, more size information is
available, so a sufficiently large buffer can be allocated.

This allows the kernel to generate audit records in excess of
MAXAUDITDATA bytes, but is consistent with Solaris's behavior.  This only
comes up when auditing command line arguments, in which case we presume
the administrator really does want the data as they have specified the
policy flag to gather them.

Obtained from:	TrustedBSD Project
MFC after:	3 days
2006-09-20 13:23:40 +00:00
Robert Watson
1db97bc63b Add missing white space in au_to_exec_{args,env}().
MFC after:	 3 days
2006-09-20 13:14:47 +00:00
Wojciech A. Koszek
6a535c2e4a Fix 'interrupt interrupt' -> 'interrupt' in the comment.
Approved by:	cognet (mentor)
2006-09-20 12:23:33 +00:00
Ruslan Ermilov
8ad58ac6ee Revert back to always using *(int *)arg for now. While this
is incorrect, and causes endianness bugs on 64-bit big-endian
machines (sparc64), it's the best choice for now, as many of
these IOCTLs are used inside the kernel, and bogusly pass an
argument as "int *" which results in unaligned access panics
on sparc64 when attempting to dereference them via *(intptr_t *).

(Several of us are working on a real fix, which is uneasy.)
2006-09-20 11:43:36 +00:00
Konstantin Belousov
28de2218ec Fix the glitch introduced in rev. 1.93. In softdep_sync_metadata(),
switch by worklist type contains two for() loops, for D_INDIRDEP and
D_PAGEDEP. On error, these loops are exited by break, where the switch
actually shall be leaved. Use goto instead of break to reach the error
handling code.

Reported by:	Peter Holm
Reviewed by:	tegge
Approved by:	pjd (mentor)
MFC after:	2 weeks
2006-09-20 07:49:28 +00:00
Pawel Jakub Dawidek
783deec19e There is no need to set 'sp' to NULL anymore. 2006-09-20 07:27:05 +00:00
Scott Long
78e36c279b Change some variable names and update some comments to help clarify some
confusing issues.
2006-09-20 06:58:02 +00:00
John-Mark Gurney
b70c1daf97 spell PCIS_CRYPTO_ENTERTAIN properly...
MFC after:	3 days
2006-09-20 06:47:14 +00:00
Tor Egge
4e59868e08 Copy stat information from mount structure before it can change identity. 2006-09-20 00:32:07 +00:00
Tor Egge
60b0b1aa18 Don't try to obtain a reference to a nonexisting (NULL) mount structure in
default VOP_GETWRITEMOUNT().
2006-09-20 00:27:02 +00:00
Martin Blapp
d7b167b57b Fix races between tty.c and sessrele() / doenterpgrp() / leavepgrp(). The tty
code is still under giant lock, but the session/pgrp release code just used
proctree_locks. This explains why moving the proctree_lock in sys/kern/tty.c
rev. 1.258 did fix the panics in our SMP systems.

This should also fix some race panics with revoked ttys.

Reviewed by:	jhb
MFC after:	1 week
2006-09-19 19:25:11 +00:00
Konstantin Belousov
f37e633887 Fix the bug in rev. 1.232. If vfs_suser returned false, coveredvp shall be
unlocked only if it really exists.

Found with:	Coverity Prevent(tm)
CID:	1535
Approved by:	pjd (mentor)
2006-09-19 14:04:12 +00:00
Konstantin Belousov
af72db7175 Fix the bug in rev. 1.134. In devfs_allocv_drop_refs(), when not_found == 2
and drop_dm_lock is true, no unlocking shall be attempted. The lock is
already dropped and memory is freed.

Found with:	Coverity Prevent(tm)
CID:	1536
Approved by:	pjd (mentor)
2006-09-19 14:03:02 +00:00
Ruslan Ermilov
9e24e7f60b Make typecast expressions comply with style(9). 2006-09-19 13:03:09 +00:00
Ruslan Ermilov
9cd96497d6 This time, really fix endian bugs accessing ioctl arguments that
are passed by value.  These are KDSKBMODE, KDSETLED, KDSKBSTATE,
and KDSETRAD.

Tested on:	amd64, sparc64 (demo code)
2006-09-19 13:01:20 +00:00
Ruslan Ermilov
225fcb2690 Back out revision 1.8. The only thing it did was to break LEDs (and
some other less noticeable things) on little-endian 64-bit platforms
such as amd64.

PR:		kern/101931
Discussed with:	emax, marius
MFC after:	1 day
2006-09-19 09:34:25 +00:00
Andre Oppermann
9fd7a4e705 Don't forget to add curly braces when doing more than one line of actions
after a 'if' statement.

Pointy hat to:	andre
2006-09-18 23:44:12 +00:00
Maksim Yevmenkin
8c3c9a505f Do not try to call keyboard callback unless keyboard is active and busy.
This should fix 'kbdcontrol -K < /dev/console' panic on sparc64 with sunkbd(4).

PR:		sparc64/96798
MFC after:	1 week
2006-09-18 22:56:59 +00:00
Jung-uk Kim
3e9b1bcabf Do not strip VLAN tag in promiscuous mode. 2006-09-18 22:18:21 +00:00
Jung-uk Kim
f9004b6d2d Simplify promiscuous mode check and make ALLMULTI independent from it. 2006-09-18 20:54:40 +00:00
John Baldwin
d4a5bcc95c Update prototype for smbus callback change.
Reported by:	Ian FREISLICH <if at hetzner dot co dot za>
2006-09-18 20:17:42 +00:00
Christian S.J. Peron
600d74bfa1 Make sure that lutimes(2) gets processed and converted into a BSM record.
Submitted by:	rwatson
MFC after:	1 day
2006-09-18 17:55:32 +00:00
Sam Leffler
72845968fa remove local change
Spotted by:	Gavin Atkinson
2006-09-18 17:23:35 +00:00
Sam Leffler
d9994d8bb4 remove this from HEAD too since it got taken off the vendor branch 2006-09-18 17:01:35 +00:00
Sam Leffler
e73ceabdc0 fixup build after move of ah_osdep.?
MFC after:	2 weeks
2006-09-18 16:50:59 +00:00
Sam Leffler
6432da677c This commit was generated by cvs2svn to compensate for changes in r162413,
which included commits to RCS files with non-trunk default branches.
2006-09-18 16:49:15 +00:00
Sam Leffler
3fe92528af o move ath hal os glue code from the hal to the driver: this code was
part of the hal distribution early on when the hal was built for
  each os but it's been portable for a long time so move the os-specific
  code out (and off the vendor branch)
o correct the copyright on ah_osdep.?; it was mistakenly given a
  restricted license and not a dual-bsd/gpl license
o remove the module api definition as it was never used
o fixup include paths for move of ah_osdep.h

MFC after:	2 weeks
2006-09-18 16:49:15 +00:00
Sam Leffler
3da8df6081 nuke unused support for building ath hal from src code
MFC after:	1 week
2006-09-18 16:30:28 +00:00
Sam Leffler
5901d2d38a Add support for newer parts that do not require separate keycache
entries for tx+rx mic keys.  This requires a newer hal, but works
fine with the current hal in cvs.

MFC after:	2 weeks
2006-09-18 16:26:19 +00:00
Sam Leffler
a7ee023101 remove stub radar support; it's never been used and future
hal's will not include the calls (due to redesign)

MFC after:	1 week
2006-09-18 16:16:02 +00:00
Konstantin Belousov
4dec8579bd Fix the race while waiting for coveredvp lock during unmount. The vnode may
be recycled during the sleep, wrap the vn_lock with vhold/vdrop.
Check that coveredvp still points to the same mp after sleep (needed
because sleep dropped Giant).
Move check for user rights for unmount after coveredvp lock is obtained.

Tested by:	Peter Holm
Reviewed by:	tegge
Approved by:	kan (mentor)
MFC after:	2 weeks
2006-09-18 15:35:22 +00:00
Konstantin Belousov
e7f9b74438 Resolve the devfs deadlock caused by LOR between devfs_mount->dm_lock and
vnode lock in devfs_allocv. Do this by temporary dropping dm_lock around
vnode locking.

For safe operation, add hold counters for both devfs_mount and devfs_dirent,
and DE_DOOMED flag for devfs_dirent. The facilities allow to continue after
dropping of the dm_lock, by making sure that referenced memory does not
disappear.

Reviewed by:	tegge
Tested by:	kris
Approved by:	kan (mentor)
PR:		kern/102335
2006-09-18 13:23:08 +00:00
Robert Watson
5702e0965e Declare security and security.bsd sysctl hierarchies in sysctl.h along
with other commonly used sysctl name spaces, rather than declaring them
all over the place.

MFC after:	1 month
Sponsored by:	nCircle Network Security, Inc.
2006-09-17 20:00:36 +00:00
Christian S.J. Peron
f07b836981 Correct a slight regression which was introduced with the implementation of
audit pipes. If the kernel record was not selected for the trail or the pipe,
any user supplied record attached to it would be tossed away, resulting in
otherwise selected events being lost.

- Introduce two new masks: AR_PRESELECT_USER_TRAIL AR_PRESELECT_USER_PIPE,
  currently we have AR_PRESELECT_TRAIL and AR_PRESELECT_PIPE, which tells
  the audit worker that we are interested in the kernel record, with
  the additional masks we can determine if either the pipe or trail is
  interested in seeing the kernel or user record.

- In audit(2), we unconditionally set the AR_PRESELECT_USER_TRAIL and
  AR_PRESELECT_USER_PIPE masks under the assumption that userspace has
  done the preselection [1].

Currently, there is work being done that allows the kernel to parse and
preselect user supplied records, so in the future preselection could occur
in either layer. But there is still a few details to work out here.

[1] At some point we need to teach au_preselect(3) about the interests of
    all the individual audit pipes.

This is a RELENG_6 candidate.

Reviewed by:	rwatson
Obtained from:	TrustedBSD Project
MFC after:	1 week
2006-09-17 17:52:57 +00:00
David Xu
103c065406 Make cpu_set_upcall_kse() and cpu_set_user_tls() work for 32bit process. 2006-09-17 14:54:14 +00:00
Andre Oppermann
a855e2b4c0 Remove VLAN mtag UMA zones and initialize ether_vtag and tso_segsz packet
header fields to zero on mbuf allocation.

Sponsored by:	TCP/IP Optimization Fundraise 2005
2006-09-17 13:44:32 +00:00
Andre Oppermann
7ff0b850a6 Make tcp_usr_send() free the passed mbufs on error in all cases as the
comment to it claims.

Sponsored by:	TCP/IP Optimization Fundraise 2005
2006-09-17 13:39:35 +00:00
Andre Oppermann
78ba57b9e1 Move ethernet VLAN tags from mtags to its own mbuf packet header field
m_pkthdr.ether_vlan.  The presence of the M_VLANTAG flag on the mbuf
signifies the presence and validity of its content.

Drivers that support hardware VLAN tag stripping fill in the received
VLAN tag (containing both vlan and priority information) into the
ether_vtag mbuf packet header field:

	m->m_pkthdr.ether_vtag = vlan_id;	/* ntohs()? */
	m->m_flags |= M_VLANTAG;

to mark the packet m with the specified VLAN tag.

On output the driver should check the mbuf for the M_VLANTAG flag to
see if a VLAN tag is present and valid:

	if (m->m_flags & M_VLANTAG) {
		... = m->m_pkthdr.ether_vtag;	/* htons()? */
		... pass tag to hardware ...
	}

VLAN tags are stored in host byte order.  Byte swapping may be necessary.

(Note: This driver conversion was mechanic and did not add or remove any
byte swapping in the drivers.)

Remove zone_mtag_vlan UMA zone and MTAG_VLAN definition.  No more tag
memory allocation have to be done.

Reviewed by:	thompsa, yar
Sponsored by:	TCP/IP Optimization Fundraise 2005
2006-09-17 13:33:30 +00:00
Robert Watson
da7cbdc2b3 Regenerate. 2006-09-17 13:29:36 +00:00
Robert Watson
6c2d307a0e AUE_SIGALTSTACK instead of AUE_SIGPENDING for sigaltstack().
Obtained from:	TrustedBSD Project
MFC after:	3 days
2006-09-17 13:28:11 +00:00
Robert Watson
31214759fa Add AUE_SYSARCH to the list of audit events during BSM conversion to prevent
a console warning.  Eventually, we will capture more arguments for sysarch.

Obtained from:	TrustedBSD Project
MFC after:	3 days
2006-09-17 11:42:40 +00:00
Robert Watson
101581b082 Expore kern.acct_configured, a sysctl that reflects the configured/
unconfigured state of the kernel accounting system.  This is used by
the accounting privilege regression test to determine whether
accounting is in use and will be disrupted by the regression test.

Sponsored by:	nCircle Network Security, Inc.
Obtained from:	TrustedBSD Project
MFC after:	1 month
2006-09-17 11:00:36 +00:00
Andrew Thompson
781dd9ae05 Rearrange things so that ARP packets can be filtered or rate limited with IPFW.
Requested by:	Jon Otterholm
Tested by:	Jon Otterholm
2006-09-17 08:20:56 +00:00
Matt Jacob
059cce1a75 Don't allow attachment of disks that could cause GEOM to panic. 2006-09-16 21:21:07 +00:00
Matt Jacob
1190a85bef New Dell 1950/2950 SES backplane drops off the bus if you poke
at greater then lun 0.

MFC after:	1 week
2006-09-16 17:35:47 +00:00
Robert Watson
ef0d1723db Add audit hooks for ppc, ia64 system call paths.
Reviewed by:	marcel (ia64)
Obtained from:	TrustedBSD Project
MFC after:	3 days
2006-09-16 17:03:02 +00:00
Alexander Leidinger
18f81b3dfa - don't reboot() when feed with wrong parameters (and enough permissions) [1]
- add support to power off the system [2]
- check the linux magic values [3]

Submitted by:	Marcin Cieslak <saper@SYSTEM.PL> [1,2]
Modelled after:	linux man page of the reboot() syscall [3]
Found by:	LTP testcase "reboot02" [1]
Tested with:	LTP testcase "reboot02" [1,3]
MFC after:	1 week
2006-09-16 14:12:04 +00:00
Pawel Jakub Dawidek
f8aa16c66c Fix detecting of UFS1 label when mediasize%fragsize != 0.
Submitted by:	Stanislav Sedov
PR:		kern/84637
MFC after:	1 week
2006-09-16 11:24:41 +00:00
Pawel Jakub Dawidek
8abd1ad101 Add 'configure' subcommand which for now only allows setting and removing
of the BOOT flag. It can be performed on both attached and detached
providers.

Requested by:	Matthias Lederhofer <matled@gmx.net>
MFC after:	1 week
2006-09-16 10:43:17 +00:00
Pawel Jakub Dawidek
5e165262f1 Add __printflike() to gctl_error().
Approved by:	phk
MFC after:	1 week
2006-09-16 10:39:07 +00:00
John Hay
724e825a16 Handle a list of IPv6 src and dst addresses correctly, eg.
ipfw add allow ip6 from any to 2000::/16,2002::/16

PR:		102422 (part 3)
Submitted by:	Andrey V. Elsukov <bu7cher at yandex dot ru>
MFC after:	5 days
2006-09-16 10:27:05 +00:00
Pawel Jakub Dawidek
5a20446db8 Small fixes after adding __printflike() to gctl_error().
Approved by:	phk
MFC after:	3 days
2006-09-16 09:48:29 +00:00
Pawel Jakub Dawidek
dec53cdd32 Remove extra arguments.
MFC after:	3 days
2006-09-16 07:47:57 +00:00
John Hay
f129892448 Make it possible to add an IPv6 host route to a host directly connected.
Use something like this:
route add -inet6 <dest_addr> <my_addr_on_that_interface> -interface -llinfo

This is usefull for wireless adhoc mesh networks.

MFC after:	5 days
2006-09-16 06:24:28 +00:00
Ruslan Ermilov
85fcf1ba07 Fix input byte counting. Now the sum of the ipackets/ibytes counters
of individual interfaces should match the ipackets/ibytes counter of
the aggregate (FEC) interface.

PR:		kern/82189
Submitted by:	Stikheev Andrew <sand AT zunet DOT ru>
MFC after:	3 days
2006-09-15 20:17:45 +00:00
Andrew Gallatin
0fa7f68197 - Updated to the latest myri10ge firmware
- Added support for multicast filtering, now that the firmware
  supports it.  Note that this is not yet tested, as multicast
  seems to panic -current (even w/o mxge loaded)
- Added workaround to cope with different irq data struct size on
  pre-multicast firmware which can found running on nics.
- Added Intel E5000 PCIe chipsets to list providing aligned completions.
- Replaced various magic constants with #defines, now that they are
  defined in the firmware headers.
2006-09-15 19:24:45 +00:00
Pawel Jakub Dawidek
679f8b7e7a Add 'show geom [addr]' ddb(4) command, which prints entire GEOM topology if
no additional argument is given or details about the given GEOM object
(class, geom, provider or consumer).

Approved by:	phk
2006-09-15 16:36:45 +00:00
Andre Oppermann
31ecb34a4e When doing TSO subtract hdrlen from TCP_MAXWIN to prevent ip->ip_len
from wrapping when we generate a maximally sized packet for later
segmentation.

Noticed by:	gallatin
Sponsored by:	TCP/IP Optimization Fundraise 2005
2006-09-15 16:08:09 +00:00