Commit Graph

65949 Commits

Author SHA1 Message Date
Alan Cox
0349775790 Eliminate redundant code from vm_page_startup(). 2007-12-19 05:47:50 +00:00
Kip Macy
d29a9a83fd Remove extraneous debug statements.
Noticed by: Andrey Chernov
2007-12-19 05:17:40 +00:00
Kip Macy
b96ebbf2e8 Don't overload tcp_usrreqs unless the kernel doesn't provide offload support. 2007-12-18 23:00:25 +00:00
Kip Macy
bc65987ade Incorporate TCP offload hooks in to core TCP code.
- Rename output routines tcp_gen_* -> tcp_output_*.
  - Rename notification routines that turn in to no-ops in the absence of TOE
    from tcp_gen_* -> tcp_offload_*.
  - Fix some minor comment nits.
  - Add a /* FALLTHROUGH */

Reviewed by: Sam Leffler, Robert Watson, and Mike Silbersack
2007-12-18 22:59:07 +00:00
David E. O'Brien
10c2b8e128 Be more exact with sigaction SA_SIGINFO handling.
Reviewed by:	marcel
2007-12-18 20:39:13 +00:00
Andrew Thompson
8411d52a93 Simplify the error handling and use the dereferenced sc->sc_ifp pointer. 2007-12-18 09:13:04 +00:00
Andrew Thompson
155f68d1aa When the bridge has an address and a packet comes in for it then drop it if the
link has been marked discarding by Spanning Tree. This would cause the bridge
to see duplicate packets to itself even if STP has correctly calculated the
topology and blocked redundant links.

Reported by:	trasz
Tested by:	trasz
MFC after:	3 days
2007-12-18 07:04:50 +00:00
Andrew Thompson
1f019d8381 - Use the macro to check the port status has it will also test if its
administratively down (!IFF_UP)
 - Use the same parameters to lagg_link_active() to get the backup port as in
   the output path, this didnt actually matter in practice as sc_primary is
   always the first on the port list.

MFC after:	3 days
2007-12-18 02:12:03 +00:00
Randall Stewart
83073fcba3 - sctp-iterator should run at PI_NET priority ...not 0.
MFC after:	1 week
2007-12-18 01:24:15 +00:00
Kip Macy
81186fb40c only include intr_machdep.h when it is needed for intr_bind
ia64 doesn't have an intr_machdep.h
2007-12-17 23:39:28 +00:00
Marcel Moolenaar
6d86273c0a Remove file after being repocopied to ../ofw, where it lives on.
Repocopy by: simon@
2007-12-17 22:50:39 +00:00
Marcel Moolenaar
22f4c5e3d9 Build the OFW loader from its new location after the sources
were repocopied from ./loader to ./ofw.
2007-12-17 22:19:44 +00:00
Andrew Thompson
f51133ee3f Add myself to the copyright. 2007-12-17 18:49:44 +00:00
Robert Watson
b5f992b93d Fix a MAC label leak for POSIX semaphores, in which per-policy labels
would be properly disposed of, but the global label structure for the
semaphore wouldn't be freed.

MFC after:	3 days
Reported by:	tanyong <tanyong at ercist dot iscas dot ac dot cn>,
		zhouzhouyi
2007-12-17 17:26:32 +00:00
Robert Watson
8b953b3f9d Fix leaking MAC labels for IPv6 inpcbs by adding missing MAC label
destroy call; this transpired because the inpcb alloc path for IPv4/IPv6
is the same code, but IPv6 has a separate free path.  The results was
that as new IPv6 TCP connections were created, kernel memory would
gradually leak.

MFC after:	3 days
Reported by:	tanyong <tanyong at ercist dot iscas dot ac dot cn>,
		zhouzhouyi
2007-12-17 17:20:57 +00:00
Kip Macy
c662126d0c disable update in place on transmit 2007-12-17 10:02:29 +00:00
Kip Macy
5e0f5cfaed Add SB_NOCOALESCE flag to disable socket buffer update in place 2007-12-17 10:02:01 +00:00
Kip Macy
8090c9f504 Make TCP offload work on HEAD (modulo negative interaction between sbcompress
and t3_push_frames).
 - Import latest changes to cxgb_main.c and cxgb_sge.c from toestack p4 branch
 - make driver local copy of tcp_subr.c and tcp_usrreq.c and override tcp_usrreqs so
   TOE can also functions on versions with unmodified TCP

- add cxgb back to the build
2007-12-17 08:17:51 +00:00
David Xu
7fab871d8c Check NULL pointer. 2007-12-17 08:09:37 +00:00
Kip Macy
228d1e266e build tcp_offload.c instead of tcp_ofld.c 2007-12-17 08:00:08 +00:00
Kip Macy
8b5709dfab incorporate feedback since initial commit
- rename tcp_ofld.[ch] to tcp_offload.[ch]
- document usage and locking conventions of the functions in the
  toe_usrreqs function vector
- document tcpcb, inpcb, and socket fields used by toe
- widen the listen interface into 2 functions
- rename DISABLE_TCP_OFFLOAD to TCP_OFFLOAD_DISABLE
- shrink conditional compilation to reduce the likelihood of bitrot
- replace sc->sc_toepcb checks in tcp_syncache.c with TOEPCB_ISSET
2007-12-17 07:56:27 +00:00
Kip Macy
29910a5a77 widen the routing event interface (arp update, redirect, and eventually pmtu change)
into separate functions

revert previous commit's changes to arpresolve and add a new interface
arpresolve2 which does arp resolution without an mbuf
2007-12-17 07:40:34 +00:00
David Xu
9514dcc041 Add missing changes for fixing LOR of umtx lock and thread lock, follow
the committing of files:
	kern_resource.c revision 1.181
	sched_4bsd.c	revision 1.111
	sched_ule.c	revision 1.218
2007-12-17 05:55:07 +00:00
Kevin Lo
5497f4c53e Use M_NOWAIT instead of M_WAITOK to cause malloc() to return NULL
Reviewed by: imp
2007-12-17 05:08:54 +00:00
Kip Macy
58505389d1 Don't panic in arpresolve if we're given a null mbuf. We could
insist that the caller just pass in an initialized mbuf even
if didn't have any data - but that seems rather contrived.
2007-12-17 04:19:25 +00:00
Kip Macy
ea6ee7d60a Include cdefs.h and param.h for architectures with less header pollution 2007-12-16 21:22:24 +00:00
Poul-Henning Kamp
164a5044a9 Add the magic word 0 value for CFA compliant devices. 2007-12-16 21:18:13 +00:00
Rui Paulo
de272a0a53 Fix previous commit. The code ended up in the wrong function.
Approved by:	     njl (mentor)
2007-12-16 20:37:27 +00:00
Poul-Henning Kamp
015a11e695 Chop DIOCGDELETE from userland up in 1024 sector chunks to give geom_disk
or any other bio chopping geom a reasonable size of work.

Check for delivered signals between chunks, because the request size
and service time is unbounded.
2007-12-16 19:38:26 +00:00
Kip Macy
bfa0795b00 Add back in cxgb now that the includes are believed to be fixed 2007-12-16 18:45:23 +00:00
Kip Macy
fc5a2e51fb Use the vm include convention of busdma 2007-12-16 18:43:57 +00:00
Kip Macy
04b25f8e3e need M_IOVEC define 2007-12-16 18:36:57 +00:00
Kip Macy
01cf8d43b8 Don't globally include mvec.h its only needed by cxgb_sge.c 2007-12-16 18:26:04 +00:00
Poul-Henning Kamp
eed6cda966 Don't limit BIO_DELETE requests to MAXPHYS, they perform no data
transfers, so they are not subject to the VM system limitation.
2007-12-16 18:03:31 +00:00
Kip Macy
3bd3bd76b5 Remove cxgb module from build until I can compensate for the lack of header
pollution on architectures other than amd64
2007-12-16 17:43:40 +00:00
Stanislav Sedov
1e6774a44e - Don't return 0xffff if PHY id isn't equal 0. This allows PHYs with
non-zero addresses to be used.

Approved by:	cognet
MFC after:	2 weeks
2007-12-16 12:57:12 +00:00
Stanislav Sedov
64425c8f7b - Add quirk for the TrendNet TU-S9 adapter, which uses new version of PL2303
chip (revision 0x400). This allows it to be correctly identified as PL2303X.

Approved by:	maxim
MFC after:	1 week
2007-12-16 12:39:50 +00:00
Scott Long
469f9f4498 Add a missing mutex unlock.
Reported by: Michael Jung
2007-12-16 07:49:44 +00:00
Kip Macy
a47aeca9c0 turn off building of cxgb properly ... sigh 2007-12-16 07:44:08 +00:00
Kip Macy
d202ae29cf Don't use old-style mbuf iovecs 2007-12-16 07:41:57 +00:00
Kip Macy
bdca760906 Update tod_connect call to reflect updated interface 2007-12-16 07:37:48 +00:00
Kip Macy
6dbb9276dc disable cxgb build to prevent tinderbox whining 2007-12-16 07:36:35 +00:00
Kip Macy
b3e761e5c8 Move arp update upcall to always be called for ARP replies - previous invocation
would not always get called at the appropriate times
2007-12-16 06:42:33 +00:00
Jeff Roberson
ace8398da0 Refactor select to reduce contention and hide internal implementation
details from consumers.

 - Track individual selecters on a per-descriptor basis such that there
   are no longer collisions and after sleeping for events only those
   descriptors which triggered events must be rescaned.
 - Protect the selinfo (per descriptor) structure with a mtx pool mutex.
   mtx pool mutexes were chosen to preserve api compatibility with
   existing code which does nothing but bzero() to setup selinfo
   structures.
 - Use a per-thread wait channel rather than a global wait channel.
 - Hide select implementation details in a seltd structure which is
   opaque to the rest of the kernel.
 - Provide a 'selsocket' interface for those kernel consumers who wish to
   select on a socket when they have no fd so they no longer have to
   be aware of select implementation details.

Tested by:	kris
Reviewed on:	arch
2007-12-16 06:21:20 +00:00
Jeff Roberson
53bfc2ecaf - Don't depend on header pollution to declare struct thread. 2007-12-16 06:12:53 +00:00
Kip Macy
53f37d1908 Fix tinderbox on sun4v
include cpufunc.h so that nanoseconds(void) is defined
2007-12-16 06:07:34 +00:00
Kip Macy
3b10e74aa9 Makefile for the TCP offload module 2007-12-16 05:40:18 +00:00
Kip Macy
64e4fdfff0 Don't use old style mbuf iovec interface 2007-12-16 05:34:18 +00:00
Kip Macy
a9420d282f Update the toedev's connect interface to reflect the fact that the inpcb
doesn't cache the rtentry in HEAD.
2007-12-16 05:30:21 +00:00
Kip Macy
280b95e8b5 Add driver for TCP offload
Sponsored by: Chelsio Inc.
2007-12-16 05:27:26 +00:00
Kip Macy
501e15907b Update the buffer management support code needed by the tcp offload module 2007-12-16 05:19:48 +00:00
Kip Macy
c186903b0d Sanitize of a routine that is going away 2007-12-16 05:14:25 +00:00
Kip Macy
35f70ae1d3 overlead mbuf fields for use by toe 2007-12-16 05:11:42 +00:00
Kip Macy
92328e3882 Add system includes for mvec.h 2007-12-16 05:11:10 +00:00
Kip Macy
ee939bbf7e Add socket option for setting and retrieving the congestion control algorithm.
The name used is to allow compatibility with Linux.
2007-12-16 03:30:07 +00:00
Marcel Moolenaar
bd71bd379c Make files under src/sys/powerpc/aim, as well as Open Firmware related
files dependent upon option/cpu AIM. This is in preparation of adding
support for Book-E (e500) support.

Obtained from: Juniper, Semihalf
2007-12-16 01:02:47 +00:00
Jeff Roberson
db08a3eee2 - Define lpohead even if userspace includes this file. 2007-12-16 00:52:32 +00:00
Marcel Moolenaar
5d8dd7e60b Rename OEA to AIM. The former means nothing as it applies to all
processors (it's the PowerPC Operating Environment Architecture).
AIM designates the processors made by the Apple-IBM-Motorola
alliance and those we typically support.

While here, remove the NetBSD option IPKDB. It's not an option
used by us. Also, PPC_HAVE_FPU is not used by us either. Remove
that too.

Obtained from: Juniper, Semihalf
2007-12-16 00:45:56 +00:00
Randall Stewart
6b4959bf2f - fix tab to space issue, hmm maybe I should use vi. 2007-12-15 23:14:53 +00:00
Jeff Roberson
eea4f254fe - Re-implement lock profiling in such a way that it no longer breaks
the ABI when enabled.  There is no longer an embedded lock_profile_object
   in each lock.  Instead a list of lock_profile_objects is kept per-thread
   for each lock it may own.  The cnt_hold statistic is now always 0 to
   facilitate this.
 - Support shared locking by tracking individual lock instances and
   statistics in the per-thread per-instance lock_profile_object.
 - Make the lock profiling hash table a per-cpu singly linked list with a
   per-cpu static lock_prof allocator.  This removes the need for an array
   of spinlocks and reduces cache contention between cores.
 - Use a seperate hash for spinlocks and other locks so that only a
   critical_enter() is required and not a spinlock_enter() to modify the
   per-cpu tables.
 - Count time spent spinning in the lock statistics.
 - Remove the LOCK_PROFILE_SHARED option as it is always supported now.
 - Specifically drop and release the scheduler locks in both schedulers
   since we track owners now.

In collaboration with:	Kip Macy
Sponsored by:	Nokia
2007-12-15 23:13:31 +00:00
Kip Macy
4c908c35e0 fix bonehead cut and paste error in last commit 2007-12-15 22:06:23 +00:00
Kip Macy
22a80c41fa Move NIC driver (cxgb) into its own directory. Add toecore to support
registering different TOMs.
2007-12-15 22:03:19 +00:00
Kip Macy
3e96c7e790 Import updated support code for the TOM (tcp offload module). 2007-12-15 21:54:59 +00:00
Kip Macy
a0d231fbb8 Create separate capability flags for TCP over IPv4 and TCP over IPv6 2007-12-15 21:01:48 +00:00
Kip Macy
835a6f1230 add interface capability for TOE 2007-12-15 20:22:09 +00:00
Kip Macy
9f117e1062 make naming prefixes consistent across tom_info 2007-12-15 20:20:08 +00:00
Kip Macy
26a4d66f05 add compile option to remove extra branch introduced by tcp offload support code 2007-12-15 19:53:35 +00:00
Scott Long
b063a42270 Add the 'hptrr' driver for supporting the following Highpoint RocketRAID
cards:

     o   RocketRAID 172x series
     o   RocketRAID 174x series
     o   RocketRAID 2210
     o   RocketRAID 222x series
     o   RocketRAID 2240
     o   RocketRAID 230x series
     o   RocketRAID 231x series
     o   RocketRAID 232x series
     o   RocketRAID 2340
     o   RocketRAID 2522

Many thanks to Highpoint for their continued support of FreeBSD.

Submitted by: Highpoint
2007-12-15 00:56:17 +00:00
Marcel Moolenaar
dd3456c071 Sort. 2007-12-14 23:47:39 +00:00
Marcel Moolenaar
15cd8608c7 This file was repocopied to src/sys/powerpc/aim, where it will
live on -- an afterlife.
2007-12-14 23:03:48 +00:00
Marcel Moolenaar
47abecea5e Update file list after repocopying select files from
src/sys/powerpc/powerpc to src/sys/powerpc/aim.
2007-12-14 23:00:15 +00:00
Marcel Moolenaar
cdc58beadc Forced commit to record that this file was repocopied from
src/sys/powerpc/powerpc and modified for its new location.
2007-12-14 22:39:35 +00:00
David E. O'Brien
1ad1915760 Add comment to pc_cp_time. 2007-12-14 22:20:10 +00:00
David E. O'Brien
d08aed068a style.Makefile(5) 2007-12-14 21:30:51 +00:00
Marcel Moolenaar
b28dabb55d Remove unused file. 2007-12-14 19:59:53 +00:00
Robert Watson
8c0a1e3efe Minor style consistency improvements. 2007-12-14 12:19:40 +00:00
Ariff Abdullah
667aaea554 Limit total hardware playback channels to just 1. The reliability of
it's multi DAC / playback channels is not that good. Enabling vchans
make the bug more visible since playback allocation will look for
possible free hardware channels first (i.e: the next DAC, the very first
has been consumed by vchan mixer) which in this case has been proven faulty.

Tested by:	Dominic Fandrey <LoN_Kamikaze at gmx dot de>
URL:		http://lists.freebsd.org/pipermail/freebsd-stable/2007-December/039022.html
2007-12-14 02:16:26 +00:00
Ariff Abdullah
d155e640d8 Add speaker/headphone controls for HP Compaq DC7700 Small Form Factor PC
@ ALC262.

Submitted by:	Carlos A. M. dos Santos <unixmania at gmail dot com>
2007-12-13 15:48:45 +00:00
Ariff Abdullah
c8d361d42d nid 28 for Acer @ ALC268 should be identified as analog CD input pin,
though it doesn't provides proper (sane, valid, usable, etc) analog CD
playback due to its stripped down nature.
2007-12-13 15:44:53 +00:00
Søren Schmidt
4c088dcd6c Implement a workaround of the datacorruption problem on serverworks HT1000 chipsets.
The HT1000 DMA engine seems to not always like 64K transfers and sometimes barfs data all over memory leading to instant chrash and burn.
Also fix 48bit adressing issues, apparently newer chips needs 16bit writes and not the usual fifo thing.

HW donated by: Travis Mikalson at TerraNovaNet
2007-12-13 11:47:36 +00:00
Kip Macy
0005682030 Fix error in previous commit - the style fix changed flag name without
changing references to the flag
2007-12-13 01:24:20 +00:00
Sam Leffler
1f0598ffe0 update channel flag defs to match _ieee80211.h so cpp doesn't complain
about redefinitions

MFC after:	1 week
2007-12-13 01:23:40 +00:00
Kip Macy
76b262c426 Fix style issues with initial TCP offload commit
Requested by: rwatson
Submitted by: rwatson
2007-12-12 23:31:49 +00:00
Kip Macy
8e7e854cd6 add interface for allowing consumers to register for ARP updates,
redirects, and path MTU changes

Reviewed by: silby
2007-12-12 20:53:25 +00:00
Kip Macy
284333d353 Add interface for tcp offload to syncache:
- make neccessary changes to release offload resources when a syncache
   entry is removed before connection establishment
 - disable checks for offloaded connection where insufficient information
   is available

Reviewed by: silby
2007-12-12 20:35:59 +00:00
Rui Paulo
319b564536 Disallow the legacy USB circuit to generate an SMI# via an ICH
register (MacBooks only).
This allows MacBooks to boot in SMP mode without any trick and solves
the timer problems with HZ=1000.

MFC after:	   1 week

Reviewed by:	   njl (mentor), jhb
Approved by:	   njl (mentor), jhb
2007-12-12 20:24:06 +00:00
Kip Macy
620721db82 Add driver independent interface to offload active established TCP connections
Reviewed by: silby
2007-12-12 20:21:39 +00:00
Alexander Motin
52b9b77f78 Increase control channel xmit queue to 128 packets.
Previous value 16 was too small for real LAC as temporal activity
spike cound easily overflow queue demanding tunnel disconnection due
to possible state inconsistency.
2007-12-12 19:04:30 +00:00
Ariff Abdullah
909f7f7f4e Disable AC97 microphone channel. Due to the channel allocation priority
that favours true hardware channel, the first instance of recording
request will grab this channel (the first channel is being used as
vchan master). In many cases, it is not really work as intended and give
false impression of broken recording.

PR:		kern/118546
MFC after:	3 days
2007-12-12 18:21:05 +00:00
Kip Macy
4f1efccf29 Remove spurious timestamp check. RFC 1323 explicitly states that timestamps MAY
be transmitted if negotiated.
2007-12-12 06:11:50 +00:00
Scott Long
281017a577 Rewrite the DMA code paths from being an impenitrable maze of special cases
to a much saner and simplier unified code path.  Along the way, fix various
CAM nits and bugs so that the passthrough works correctly for all cases.
2007-12-12 05:55:03 +00:00
Alan Cox
21e10ad46a Simplify vm_page_free_toq(). 2007-12-11 21:20:34 +00:00
Olivier Houchard
c8ffd860a5 There's no need to call pmap_vac_me_harder() in pmap_protect(), as it
already happened in pmap_modify_pv().

Submitted by:	Mark Tinguely <tinguely AT casselton DOT net>
2007-12-11 20:35:44 +00:00
Markus Brueffer
a8a27cb0f9 Fix calculation of descriptor tag checksums. According to ECMA-167, Part 4,
7.2.3, bytes 0-3 and 5-15 are used to calculate the checksum of a descriptor
tag.

PR:		kern/90521
Submitted by:	Björn König <bkoenig@cs.tu-berlin.de>
Reviewed by:	scottl
Approved by:	emax (mentor)
2007-12-11 19:49:40 +00:00
David Xu
435806d31b Fix LOR of thread lock and umtx's priority propagation mutex due
to the reworking of scheduler lock.

MFC: after 3 days
2007-12-11 08:25:36 +00:00
David Xu
f5ae94753b Add quirks for Netac Onlydisk 2000 USB disk. 2007-12-11 06:41:38 +00:00
John Baldwin
0a63574164 Bah, remove last vestiges of some statfs conversion fixes that aren't quite
ready for CVS yet that snuck into 1.68.

Pointy hat to:	jhb
2007-12-10 19:42:23 +00:00
David E. O'Brien
b48287a32a Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
Sam Leffler
de0abf19ba Wake On Lan (WOL) infrastructure
Submitted by:	Stefan Sperling <stsp@stsp.name>
Reviewed by:	brooks
2007-12-10 02:31:00 +00:00
Marcel Moolenaar
3959198cc5 Decode as many or as few partition entries as the label claims there
are. We have already checked it against the caller provided maxpart.
2007-12-09 22:44:22 +00:00
Marcel Moolenaar
4275d83ab5 Fix a bug in the add verb, where we failed to keep the list
of partitions in index-order. This is assumed by the APM, MBR
and BSD partitioning schemes.
2007-12-09 22:26:42 +00:00
Alan Cox
dbfb54ffea Eliminate compilation warnings due to the use of non-static inlines
through the introduction and use of the __gnu89_inline attribute.

Submitted by: bde (i386)
MFC after: 3 days
2007-12-09 21:00:36 +00:00
Andrew Thompson
9ddd3624d9 Fix spelling.
Obtained from:	OpenBSD
2007-12-09 20:47:12 +00:00
Andrew Thompson
2aec24b515 sc->ndis_tq variable is only initialized when a driver module is for wireless
NICs.

PR:		kern/118439
Submitted by:	Weongyo Jeong
2007-12-09 20:14:01 +00:00
Scott Long
f40b4cabee Fix an incorrect FreeBSD version test. 2007-12-09 19:24:27 +00:00
Scott Long
579ec1a53f Modify locking so that a single version of the driver src can be used on 6.x
and beyond.
2007-12-09 19:22:25 +00:00
Robert Watson
63d79c4fd6 Check for P_WEXIT before PHOLD() on a process in kstack and vm query
sysctls, as PHOLD() asserts !P_WEXIT.

Reported by:	Michael Plass <mfp49_freebsd at plass-family dot net>
2007-12-09 17:22:27 +00:00
David Malone
71bd9b9cf9 If we are walking the IPv6 header chain and we hit an IPPROTO_NONE
header, then don't try to pullup anything, because there is no next
header if we hit IPPROTO_NONE. Set ulp to a non-NULL value so the
search for an upper layer header terinates.

This is based on Pekka's diagnosis, but I chose a simpler fix.

PR:		115261
Submitted by:	Pekka Savola <pekkas@netcore.fi>
Reviewed by:	mlaier
MFC after:	2 weeks
2007-12-09 15:35:09 +00:00
Marcel Moolenaar
04a814ef90 Internal partitions can not be deleted or modified. 2007-12-08 23:08:42 +00:00
Marcel Moolenaar
d6bbbeebd9 Skip internal partitions in the check for (user) partitions for
the destroy command. Previously a freshly created BSD disklabel
could not be destroyed because of the internal partition.
2007-12-08 22:06:17 +00:00
Alan Cox
7501865c53 Use 1GB virtual pages to implement the direct map on architectures that
support this feature.

Wrap a nearby line that is too long.

MFC after: 6 weeks
2007-12-08 21:48:27 +00:00
Alan Cox
4ad863249b Recognize architectural support for 1GB virtual pages.
MFC after: 6 weeks
2007-12-08 21:13:01 +00:00
Scott Long
44f05562de Support new ARC120x family of controllers. Many thanks for Areca's continued
support of FreeBSD.

Submitted by: Erich Chen @ Areca
2007-12-08 20:48:26 +00:00
Marcel Moolenaar
ddba264187 Add support for FS_ZFS. 2007-12-08 07:01:10 +00:00
Marcel Moolenaar
93810b75d9 Add a file system type for ZFS (FS_ZFS). 2007-12-08 06:47:48 +00:00
Marcel Moolenaar
c6400868f5 Sync with NetBSD rev 1.101.
This also fixes fstypenames being short an entry.
2007-12-08 06:44:27 +00:00
Scott Long
d637500d06 Grrr, remove an unused variable missed in the last commit. 2007-12-08 01:41:31 +00:00
Pyun YongHyeon
1acbb78ada Add another RTL8168 revision 3 which is found on RTL8111-GR Gigabit
Ethernet Controller. Multicast filtering wasn't tested and needs more
expore. While I'm here change complex if statements with switch
statement which would improve readability.

Reported by:	Abdullah Ibn Hamad Al-Marri < wearabnet AT yahoo DOT ca >
Tested by:	Abdullah Ibn Hamad Al-Marri < wearabnet AT yahoo DOT ca >
2007-12-08 00:14:09 +00:00
Scott Long
7815c9e2db Don't expect a return value from statfs_scale_blocks(). 2007-12-07 22:32:09 +00:00
Ed Maste
9bffabcec9 Merge from Adaptec a 64 bit fix and a workaround for luns != 0 returning
CAM_SEL_TIMEOUT on SAS controllers, which prevented passthrough devices
from being created.
2007-12-07 20:37:12 +00:00
Ed Maste
7ea2d5586c Add family support to allow the driver to attach to new devices that
share the same interface.

Submitted by:	Achim Leubner at Adaptec
2007-12-07 18:05:41 +00:00
Joseph Koshy
9596916c4d Add stub functions to unbreak LINT. 2007-12-07 17:21:53 +00:00
Joseph Koshy
0da7aa7a7d Add stubs to unbreak LINT. 2007-12-07 13:45:47 +00:00
Søren Schmidt
02d76bfa1b Fix speed report on Intel SATA chips in compat mode.
Fix broken detect of JMicron 368.
2007-12-07 13:14:31 +00:00
Olivier Houchard
b358d3906a Fix style in previous commit.
Pointed out by:	njl
2007-12-07 10:42:11 +00:00
Andrew Thompson
30d9c7698a Preallocate some space to return the scan results, some drivers do not properly
pass back the desired buffer length. This fixes scanning with the Marvell
88W8335 and BCM4328 wireless cards.

PR:		kern/118370
Submitted by:	Weongyo Jeong
Tested by:	Ed Schouten
2007-12-07 10:37:25 +00:00
Joseph Koshy
ca16b7ddc8 Increment FreeBSD_version to mark the addition of callchain support
to hwpmc.
2007-12-07 08:36:38 +00:00
Joseph Koshy
d07f36b075 Kernel and hwpmc(4) support for callchain capture.
Sponsored by:	FreeBSD Foundation and Google Inc.
2007-12-07 08:20:17 +00:00
Kip Macy
2de2af32a0 Add padding for anticipated functionality
- vimage
 - TOE
 - multiq
 - host rtentry caching

Rename spare used by 80211 to if_llsoftc

Reviewed by: rwatson, gnn
MFC after: 1 day
2007-12-07 01:46:13 +00:00
Randall Stewart
41eee5558c - More fixes for lock misses on the transfer of data to
the sent_queue. Sometimes I wonder why any code
  ever works :-)
- Fix the pad of the last mbuf routine, It was working improperly
  on non-4 byte aligned chunks which could cause memory overruns.

MFC after:	1 week
2007-12-07 01:32:14 +00:00
Ed Maste
a723a5482e Allow simultaneous opens of the device for issuing commands to the
controller.  This is merged from Adaptec driver build 11669.
2007-12-07 00:22:23 +00:00
Xin LI
1fa8f5f051 Turn MPASS(0) into panic with more obvious reason why the assertion
is failed.
2007-12-07 00:00:21 +00:00
John Baldwin
8120bb7e3a Regen. 2007-12-06 23:37:26 +00:00
John Baldwin
695e8d536c Add freebsd32 compat wrappers for msgctl() and __semctl() using
kern_msgctl() and kern_semctl().

MFC after:	1 week
2007-12-06 23:36:57 +00:00
John Baldwin
3c39e0d8d4 Add freebsd32 compat wrappers for msgctl() and _semctl() using
kern_msgctl() and kern_semctl().

MFC after:	1 week
2007-12-06 23:35:29 +00:00
John Baldwin
d43c6fa4fe Move 32-bit SYSV IPC structure definitions into freebsd32_ipc.h.
MFC after:	1 week
2007-12-06 23:23:16 +00:00
Xin LI
745973bd99 size_max should be unsigned, as such, use size_t here. 2007-12-06 23:19:05 +00:00
Olivier Houchard
91f2b6797a Erm, add a missing else, we do not want to increase the mapping counters for
both kernel and userland when we create a pv for pmap_kernel.

Reported by:	Mark Tinguely <tinguely AT casselton DOT net>
MFC After:	3 days
2007-12-06 23:17:24 +00:00
John Baldwin
74427aa423 Move several data structure definitions out of freebsd32_misc.c and into
freebsd32.h instead.

MFC after:	1 week
2007-12-06 23:11:27 +00:00
Julian Elischer
dbec798a76 Remove more dup'd code
MFC After: 1 week
2007-12-06 22:48:24 +00:00
Julian Elischer
90b3552e6e remove duped code
Reviewed By: gnn
MRC after: 1 week
2007-12-06 22:44:24 +00:00
Julian Elischer
bf3ce91a99 No need to assert that a == b when we just set a = b. 2007-12-06 22:40:17 +00:00
Kip Macy
8160baf419 Change uint8_t to equivalent base language type and add line break where 80
characters is exceeded in bit macros

Requested by: Bruce Evans
2007-12-06 19:11:14 +00:00
Ed Maste
8af086fd5c Add more PCI ID's from Adaptec's driver, including two requested
by Daniel Kamm.

  Adaptec RAID 51245
  Adaptec RAID 51645
  Adaptec RAID 52445
  Adaptec RAID 5405
  Sun STK RAID REM
  Sun STK RAID EM
  SG-XPCIESAS-R-IN
  SG-XPCIESAS-R-EX
2007-12-06 18:25:29 +00:00
Dag-Erling Smørgrav
6c7faee24f Simpler version of the previous commit. 2007-12-06 09:31:13 +00:00
John Baldwin
f97a705a99 Only attach to a GPT partition if it has the GPT_ENT_TYPE_FREEBSD type.
XXX: This only works currently with GEOM_GPT which only exists in 6.x.
XXX: I didn't add 'mbroffset' support for a GPT partition holding a BSD
label as I'm not sure if they use relative or absolute offsets.

MFC after:	3 days
2007-12-06 09:20:27 +00:00
Kip Macy
208e56cb04 Respect the fact that the value a may be constant so cast to const uint8_t * 2007-12-06 04:00:59 +00:00
Marcel Moolenaar
5aaa8fefdf Add a BSD disklabel backend to g_part:
o  Disklabels can have between 8 and 20 partitions (inclusive).
o  No device special file is created for the raw partition.
o  Switch ia64 to use this backend.
o  No support for boot code yet.
2007-12-06 02:32:42 +00:00
Ed Maste
e9faf6c240 Add PCI IDs for additional cards:
AOC-USAS-S4i
AOC-USAS-S8i
AOC-USAS-S4iR
AOC-USAS-S8iR
AOC-USAS-S8i-LP
AOC-USAS-S8iR-LP
2007-12-06 02:10:07 +00:00
Nate Lawson
52604c49a6 Hold Giant over the entire execution of the suspend path instead of
dropping it after each call into newbus.  This doesn't fix any known
problems but seems more correct.

Submitted by:	Marko Zec <zec / icir.org>
2007-12-06 01:39:23 +00:00
Randall Stewart
9c04b2966d - optimize the initialization of the SB max variables.
- Missing lock when sending data and moving it to the
  outqueue.
- If a mbuf alloc fails during moving to outqueue the
  reassembly of the old mbuf chain was incorrect.
- some_taken becomes a counter in sctputil.c instead of a set to 1.
- Fix a panic to be only under invarients and have a proper recovery.
- msg_flags needed to be set.to the value collected not or'd.

MFC after:	1 week
2007-12-06 00:22:55 +00:00
Kip Macy
32089e4962 Fix bit macros to work on multi-byte types
MFC after: 1 day
2007-12-05 23:48:03 +00:00
Philip Paeps
e383ee75af Fix a use-after-free.
Submitted by:	Ilja van Sprundel <ilja -at- netric.org>
Reviewed by:	secteam
MFC after:	1 day
2007-12-05 19:32:59 +00:00
Philip Paeps
6c3c35e413 Plug two potential (root-only, local) information leaks. buf is not
initialized before use and returned integrally instead of up to size.

Submitted by:	Ilja van Sprundel <ilja -at- netric.org>
Reviewed by:	secteam
MFC after:	1 day
2007-12-05 19:32:07 +00:00
Randall Stewart
cf70a46b47 - Puts default limits on 4k/9k and 16k zones for mbufs all based
on 1/2 of each of the successive limits tied to the limit for
  2k clusters.
- Adds real functionality in so that doing a sysctl to change these
  actually changes them :-)

MFC after:	1 week
2007-12-05 15:29:44 +00:00
Remko Lodder
28d34c0e95 Bring in support for: Marvell Yukon 8039
PR:		118401
Submitted by:	Skip Ford <skip at menantico dot com>
Approved by:	imp (mentor), yongari
MFC After:	3 days
2007-12-05 09:41:58 +00:00
Konstantin Belousov
973bdaa06f Use curthread instead of the FIRST_THREAD_IN_PROC for vnlru and syncer,
when applicable.

Aquire Giant slightly later for vnlru.

In the syncer, aquire the Giant only when a vnode belongs to the
non-MPsafe fs.

In both speedup_syncer() and syncer_shutdown(), remove the syncer thread from
the lbolt sleep queue after the syncer state is modified, not before.

Herded by:	attilio
Tested by:	Peter Holm
Reviewed by:	ups
MFC after:	1 week
2007-12-05 09:34:04 +00:00
Julian Elischer
abc3f1d24b Stop serial console and gdb serial port from getting all screwed up.
PR: 65278
MFC in: 3 days
Submitted by: ups@
2007-12-05 05:16:56 +00:00
Craig Rodrigues
62bdb328bb In nmount(), internally convert the mount option: "rdonly" to "ro".
This makes updates mounts such as:
 "mount -u -o rdonly" work more like, "mount -u -o ro".

References to "-o rdonly" were changed to "-o ro" in revision 1.60 of
the mount(8) man page,
but some people still like to use "-o rdonly" since it was documented
in earlier versions of FreeBSD.

Requested by:	rwatson
MFC after:	1 week
2007-12-05 03:26:14 +00:00
Andrew Thompson
22cf347586 Apply a workaround for the unkillable jail problem where some devices created
within the jail are never freed. si_cred is only used by the MAC framework so
make the cred reference conditional on it being compiled in, this is not a fix
and will need to be reviewed for any new consumers of si_cred.

This will quell some user complaint when using jails with a default kernel.

Reviewed by:	rwatson
MFC after:	3 days
2007-12-05 01:22:03 +00:00
Andrew Thompson
d3b28963dc Support monitor mode where the frame is discarded after bpf and stats processing. 2007-12-05 00:42:28 +00:00
Wojciech A. Koszek
272afb6534 Remove obsolete comment on a way of getting kernel configuration file from
INCLUDE_CONFIG_FILE. Make a user to look at what config(8) actually does,
and how can one fetch actual configuration file.

Reported by:	many
Reviewed by:	cognet (mentor)
Approved by:	cognet (mentor)
2007-12-04 21:01:55 +00:00
Wojciech A. Koszek
8b249eccbc Cast address of 'bssid' to uint8_t since printf() expects to get unsigned
argument in %6D case.

Submitted by:	thompsa
Compile-tested:	wkoszek
Reviewed by:	cognet (mentor)
Approved by:	cognet (mentor)
2007-12-04 20:48:32 +00:00
Wojciech A. Koszek
9977143467 Cast 'data' to 'u_char', as printf() requires this type to be unsigned. This
is what gcc3 complains about.

Without this change, it's impossible to build the kernel with gcc3.

Tested by:	cognet@ (mentor)
Approved by:	cognet@ (mentor)
2007-12-04 20:33:58 +00:00
Jung-uk Kim
959a913b87 Remove redundant checks for msgsnd(3) and msgrcv(3).
COMPAT_IA32 (implicitly) requires SYSVSEM, SYSVSHM and SYSVMSG in kernel.

Pointed out by:	jhb
2007-12-04 20:25:41 +00:00
Wojciech A. Koszek
4ce05f7e44 Explicitly initialize 'ret' to 0'. It lets one to build tmpfs from the
latest source tree with older compiler--gcc3.

Approved by:	cognet (mentor)
2007-12-04 20:20:59 +00:00
Randall Stewart
2aedc03dad - More fixes for the non-blocking msg send, had the skip of the pre-block
test incorrect.
- Fix the initial buf calculation to be more friendly, calc is the same
  but we use different variable to make it easier amongst the different
  code versions.

MFC after:	1 week
2007-12-04 20:20:42 +00:00
Wojciech A. Koszek
9889281da3 Explicitly initialize 'error' to 0 (two places). It lets one to build tmpfs
from the latest source tree with older compiler--gcc3.

Reviewed by:	kib@ (on freebsd-current@)
Approved by:	cognet@ (mentor)
2007-12-04 20:14:15 +00:00
Alan Cox
b95c2d7968 Increment __FreeBSD_version on account of changes to the jumbo frames
allocator.  (See revision 1.35 of kern/kern_mbuf.c.)

Requested by: Andrew Gallatin
2007-12-04 17:57:41 +00:00
Randall Stewart
0e81d2ed7a - Opps, signedness issue with one of the new var's (this is an issue
mainly in apple but with the right -Wall it could effect us too).

MFC after:	1 week
2007-12-04 14:47:39 +00:00
Randall Stewart
9f22f50039 - Found a problem in non-blocking sends. When
sending, once the locks are all unlocked to
  do the copy's in, its possible that other
  events could then raise the number of bytes
  outstanding pushing it so not all the message
  would fit. This would then cause us to send
  only part of the message. This fix makes it
  so we keep a "reserved" amount that can be
  kept in mind when making calculations to send.
- rcv msg args with a NULL/NULL for to/tolen will return an error incorrectly
  for the 1-2-1 model.
- We were not doing 0 len return correctly and not setting cantrcv more
  correctly. Previouly we "fixed" this area by taking out the socantrcv
  since we then could not get the data out. The correct rix is to still
  flag the socket but alow a by-pass route to continue to read until
  all data is consumed.

MFC after:	1 week
2007-12-04 14:41:48 +00:00
Yaroslav Tykhiy
3affb6fb19 For the sake of convenience, print the name of the network interface
IPv4 address duplication was detected on.

Idea by:	marck
2007-12-04 13:01:12 +00:00
Konstantin Belousov
d24031dd0c Fix the ABI change of the signal delivered on the access to the page
with insufficient protection mode.

For the i386 and amd64, create the tunable, machdep.prot_fault_translation,
with the following behaviour:
	0 = autodetect the signal to be delivered on KERN_PROTECTION_FAILURE
	    from vm_fault based on the ELF OSABI note:
		no note or __FreeBSD_version < 700004 - SIGBUS/BUS_PAGE_FAULT
		note, and __FreeBSD_version >= 700004 - SIGSEGV/SEGV_ACCERR
	1 = always SIGBUS/BUS_PAGE_FAULT
	2 = always SIGSEGV/SEGV_ACCERR

This would do mostly automatic correction of ABI breakage, with the exception
of the untaged binaries for 7-CURRENT/RELENG_7 before the note is fixed. For
them, sysctl would allow to run the binary with manual settings.

Discussed with:	portmgr (kris)
PR:		kern/118304
MFC after:	3 days
2007-12-04 12:33:03 +00:00
Konstantin Belousov
f231de478e Implement fetching of the __FreeBSD_version from the ELF ABI-tag note.
The value is read into the p_osrel member of the struct proc. p_osrel
is set to 0 for the binaries without the note.

MFC after:	3 days
2007-12-04 12:28:07 +00:00
Konstantin Belousov
93d1c72883 Check for the program headers alignment of the ELF images before
dereferencing. Unaligned access could cause panic on strict alignment
architectures.

Reviewed by:	marcel, marius (also tested on sparc64, thanks !)
MFC after:	3 days
2007-12-04 12:21:27 +00:00
Alan Cox
d1ce3dfa8d Correct an error under COUNT_IPIS within pmap_lazyfix_action(): Increment
the counter that the pointer refers to, not the pointer.

MFC after: 3 days
2007-12-04 09:06:08 +00:00
Alan Cox
491bc4fe00 Style change: Use NULL rather than 0 where appropriate. 2007-12-04 08:17:04 +00:00
Mike Silbersack
136286a141 Fix SACK negotiation that was broken in rev 1.105.
Before this fix, FreeBSD would negotiate SACK on outgoing
connections, but would always fail to negotiate it on incoming
connections.

Discovered by: James Healy and Lawrence Stewart
Submitted by: James Healy and Lawrence Stewart
MFC after: 3 days
2007-12-04 07:11:13 +00:00
Alan Cox
ba63339a0a Introduce an UMA backend page allocator for the jumbo frame zones that
allocates physically contiguous memory.

MFC after: 3 months
Requested and reviewed by: Kip Macy
Tested by: Andrew Gallatin and Pyun YongHyeon
2007-12-04 07:06:08 +00:00
Andrew Thompson
ac740aebcf Implement functions required by some ndis drivers.
NdisIMCopySendPerPacketInfo [1]
 KeQuerySystemTime [1]
 KeTickCount [1]
 strncat [1]
 KeBugCheckEx

Submitted by:	Marcin Simonides [1]
2007-12-03 23:43:58 +00:00
Andrew Thompson
7218dd5f5a Remove compatibilty defines to simplify reading the code, this is around 10% of
the total LOC. These are mostly for the 6.x branch and it will be easier to
cherrypick any changes (if at all).
2007-12-03 21:51:28 +00:00
Robert Watson
56905239ae When a symbol name can't be resolved, return "??" as the name, rather
than "Unknown func", in order to avoid putting spaces in what ideally
is a string separated by white space.
2007-12-03 14:44:35 +00:00
Ariff Abdullah
84793af6a9 Fix audio playback aborted with SNDCTL_DSP_SETTRIGGER, affecting
PortAudio version 19.

PR:		kern/118395
Submitted by:	Henrik Gulbrandsen <henrik at gulbra dot net>
MFC after:	3 days
2007-12-03 14:26:56 +00:00
Konstantin Belousov
6ed4cfc05d Do not allow the SNPSTTY ioctl for the snoop device that has a tty
attached. Otherwise, the snp->snp_tty would be overwritten, while the
tty line discipline still set to the snpdisc. Then snplwrite() causes
panic because ttytosnp() cannot find the snp.

MFC after:	1 week
2007-12-03 14:02:27 +00:00
Robert Watson
309bdd49b5 Catch up pc98 for i386 stack(9) changes:
Add stub stack.h for pc98 that includes i386 pc98.

  Add i386 stack_machdep.c to files.pc98.

Spotted by:	tinderbox
2007-12-03 11:38:28 +00:00
Joseph Koshy
c438255074 Add userland definitions for parsing callchain records.
Sponsored by:	FreeBSD Foundation and Google Inc.
2007-12-03 11:11:08 +00:00
Pyun YongHyeon
7c103000b6 Always honor promiscuous flag prior to programming Rx multicast
filter. This fixes a regression introduced in rev 1.89.

PR:	114632
MFC after:	3 days
2007-12-03 01:28:08 +00:00
Robert Watson
1cc8c45c54 Add another new sysctl in support of the forthcoming procstat(1) to
support its -k argument:

kern.proc.kstack - dump the kernel stack of a process, if debugging
  is permitted.

This sysctl is present if either "options DDB" or "options STACK" is
compiled into the kernel.  Having support for tracing the kernel
stacks of processes from user space makes it much easier to debug
(or understand) specific wmesg's while avoiding the need to enter
DDB in order to determine the path by which a process came to be
blocked on a particular wait channel or lock.
2007-12-02 21:52:18 +00:00
Robert Watson
4ed8baa00a Remove duplicate $FreeBSD$ tag. 2007-12-02 21:07:49 +00:00
Robert Watson
3c90d1ea74 Break out stack(9) from ddb(4):
- Introduce per-architecture stack_machdep.c to hold stack_save(9).
- Introduce per-architecture machine/stack.h to capture any common
  definitions required between db_trace.c and stack_machdep.c.
- Add new kernel option "options STACK"; we will build in stack(9) if it is
  defined, or also if "options DDB" is defined to provide compatibility
  with existing users of stack(9).

Add new stack_save_td(9) function, which allows the capture of a stacktrace
of another thread rather than the current thread, which the existing
stack_save(9) was limited to.  It requires that the thread be neither
swapped out nor running, which is the responsibility of the consumer to
enforce.

Update stack(9) man page.

Build tested:	amd64, arm, i386, ia64, powerpc, sparc64, sun4v
Runtime tested:	amd64 (rwatson), arm (cognet), i386 (rwatson)
2007-12-02 20:40:35 +00:00
Scott Long
cdc03cc897 Provide unqiue malloc types instead of using M_DEVBUF. 2007-12-02 19:54:45 +00:00
Scott Long
f4b5c2581d Refactor completion handlers so that they can be combined into a single
function.  Add missing locking.
2007-12-02 19:50:01 +00:00
Scott Long
4059f1cc7d Make a pass at style.9 compliance 2007-12-02 18:48:17 +00:00
Scott Long
4c92c3889c Fix a typo that was hidden by AMR_DEBUG. 2007-12-02 18:47:31 +00:00
Scott Long
3002614d91 Fix printf format bugs that where hidden by AMR_DEBUG. 2007-12-02 18:45:37 +00:00
Scott Long
eaf63cb2ae The AR_SCSI_PASSTHROUGH conditional no longer exists, remove it from the
makefile.
2007-12-02 18:39:38 +00:00
Ariff Abdullah
229acba1d0 Headphone / speakers automute fixup for Acer Aspire 4710 @ ALC268 laptop.
Tested by:	Liyu, She
2007-12-02 16:38:28 +00:00
Olivier Houchard
18836eac48 Fix a potential bug in pmap :
We used to allocate the domains 0-14 for userland, and leave the domain 15
for the kernel. Now supersections requires the use of domain 0, so we
switched the kernel domain to 0, and use 1-15 for userland.
How it's done currently, the kernel domain could be allocated for a
userland process.
So switch back to the previous way we did things, set the first available
domain to 0, and just add 1 to get the real domain number in the struct pmap.

Reported by:	Mark Tinguely <tinguely AT casselton DOT net>
MFC After:	3 days
2007-12-02 15:26:30 +00:00
Olivier Houchard
35af41b0a6 Move the strongarm-specific files from conf/files.arm to sa11x0/files.sa11xO.
Submitted by:	Rafal Jaworowski <raj AT semihalf DOT com>
2007-12-02 13:12:21 +00:00
Olivier Houchard
f9af595fc3 Cleanup : make nexus standard, as it is mandatory anyway.
Garbage-collect unused nexus_io.c and nexus_io_asm.S

Submitted by:	Rafal Jaworowski <raj AT semihalf DOT com>
2007-12-02 13:10:42 +00:00
Guido van Rooij
d23d475fb4 Consider the following situation:
1. A packet comes in that is to be forwarded
2. The destination of the packet is rewritten by some firewall code
3. The next link's MTU is too small
4. The packet has the DF bit set

Then the current code is such that instead of setting the next
link's MTU in the ICMP error, ip_next_mtu() is called and a guess
is sent as to which MTU is supposed to be tried next. This is because
in this case ip_forward() is called with srcrt set to 1. In that
case the ia pointer remains NULL but it is needed to get the MTU
of the interface the packet is to be sent out from.
Thus, we always set ia to the outgoing interface.

MFC after:	2 weeks
2007-12-02 13:00:47 +00:00
Olivier Houchard
b21a1da537 Close a race.
The RAS implementation would set the end address, then the start
address.  These were used by the kernel to restart a RAS sequence if
it was interrupted.  When the thread switching code ran, it would
check these values and adjust the PC and clear them if it did.

However, there's a small flaw in this scheme.  Thread T1, sets the end
address and gets preempted.  Thread T2 runs and also does a RAS
operation.  This resets end to zero.  Thread T1 now runs again and
sets start and then begins the RAS sequence, but is preempted before
the RAS sequence executes its last instruction.  The kernel code that
would ordinarily restart the RAS sequence doesn't because the PC isn't
between start and 0, so the PC isn't set to the start of the sequence.
So when T1 is resumed again, it is at the wrong location for RAS to
produce the correct results.  This causes the wrong results for the
atomic sequence.

The window for the first race is 3 instructions.  The window for the
second race is 5-10 instructions depending on the atomic operation.
This makes this failure fairly rare and hard to reproduce.

Mutexs are implemented in libthr using atomic operations.  When the
above race would occur, a lock could get stuck locked, causing many
downstream problems, as you might expect.

Also, make sure to reset the start and end address when doing a syscall, or
a malicious process could set them before doing a syscall.

Reviewed by: imp, ups (thanks guys)
Pointy hat to:	cognet
MFC After:	3 days
2007-12-02 12:49:28 +00:00
Robert Watson
cc43c38c87 Add two new sysctls in support of the forthcoming procstat(1) to support
its -f and -v arguments:

kern.proc.filedesc - dump file descriptor information for a process, if
  debugging is permitted, including socket addresses, open flags, file
  offsets, file paths, etc.

kern.proc.vmmap - dump virtual memory mapping information for a process,
  if debugging is permitted, including layout and information on
  underlying objects, such as the type of object and path.

These provide a superset of the information historically available
through the now-deprecated procfs(4), and are intended to be exported
in an ABI-robust form.
2007-12-02 10:10:27 +00:00
Andrew Thompson
4d50f65ceb Hide a debug printf, NDIS_DEBUG is always defined and we test the sysctl.
MFC after:	3 days
2007-12-02 09:03:43 +00:00
Andrew Thompson
e880149eb9 Correct the calculation for the number of 100ns intervals since
January 1, 1601. The 1601 - 1970 period was in seconds rather than 100ns
units.

Remove duplication by having NdisGetCurrentSystemTime call ntoskrnl_time.
2007-12-02 08:54:50 +00:00
Alan Cox
b640825647 Correct a comment. 2007-12-02 07:43:42 +00:00
Andrew Thompson
f3ad39ccf5 Correct the nwbx_ies field type in struct ndis_wlan_bssid_ex.
PR:		kern/118369
Submitted by:	Weongyo Jeong
2007-12-02 04:04:42 +00:00
Alan Cox
30418ed31c Eliminate vfs_page_set_valid()'s unused argument. 2007-12-02 01:28:35 +00:00
John Birrell
967d872708 Add extra visibility definitions.
See: <http://groups.google.com/group/generic-abi/browse_thread/thread/1a84adc15666164>

These are already in OpenSolaris and DTrace uses STV_ELIMINATE.
2007-12-02 00:05:18 +00:00
Robert Watson
9ccca7d1b1 Modify stack(9) stack_print() and stack_sbuf_print() routines to use new
linker interfaces for looking up function names and offsets from
instruction pointers.  Create two variants of each call: one that is
"DDB-safe" and avoids locking in the linker, and one that is safe for
use in live kernels, by virtue of observing locking, and in particular
safe when kernel modules are being loaded and unloaded simultaneous to
their use.  This will allow them to be used outside of debugging
contexts.

Modify two of three current stack(9) consumers to use the DDB-safe
interfaces, as they run in low-level debugging contexts, such as inside
lockmgr(9) and the kernel memory allocator.

Update man page.
2007-12-01 22:04:16 +00:00
Peter Wemm
66e7bdd4dc Based in info gleaned from the web and other drivers (including the Linux
sx driver), change a magic value in the PLX bridge chip.  Apparently later
builds of the PCI cards had corrected values in the configuration eeprom.
This change supposedly fixes some pci bus problems.
2007-12-01 20:39:47 +00:00
Poul-Henning Kamp
d31fc8ce59 Remove XRPU driver, after asking all the users. 2007-12-01 20:07:45 +00:00
Marius Strobl
ddcde502eb Fix a non-fatal off-by-one error in the previous revision. 2007-12-01 19:42:33 +00:00
Robert Watson
cdd475b347 The kernel linker includes a number of utility functions to look up symbol
information in support of DDB(4); these functions bypass normal linker
locking as they may run in contexts where locking is unsafe (such as the
kernel debugger).

Add a new interface linker_ddb_search_symbol_name(), which looks up a
symbol name and offset given an address, and also
linker_search_symbol_name() which does the same but *does* follow the
locking conventions of the linker.

Unlike existing functions, these functions place the name in a
caller-provided buffer, which is stable even after linker locks have been
released.  These functions will be used in upcoming revisions to stack(9)
to support kernel stack trace generation in contexts as part of a live,
rather than suspended, kernel.
2007-12-01 19:24:28 +00:00
Ken Smith
d9e6294e4f Fix a broken check that recently became more annoying because it now
gets enabled when INVARIANTS is on instead of DIAGNOSTIC (which apparently
nobody uses).  From Tor's description:

  This happens when the block range spans two block maps, the first in the
  inode (mapping up to NDADDR direct blocks) and the second being the first
  indirect block.  The current check assumes that both block maps are
  indirect blocks.

Work done by:	tegge
Tested by:	kris, kensmith
2007-12-01 13:12:43 +00:00
Kevin Lo
a770f1e136 ieee80211com.ic_fixed_rate holds rate instead of rate index
Reviewed by: Weongyo Jeong
2007-12-01 08:53:03 +00:00
Bjoern A. Zeeb
ee763d0d9c Centralize and correct computation of TCP-MD5 signature offset within
the packet (tcp header options field).

Reviewed by:	tools/regression/netinet/tcpconnect
MFC after:	3 days
Tested by:	Nick Hilliard (see net@)
2007-11-30 23:46:51 +00:00
Bjoern A. Zeeb
beb8b626d1 Move call to tcp_signature_compute() after we adjusted the payload offset
in the tcp header. With relevant parts of the tcp header changing after
the 'signature' was computed, the signature becomes invalid.

Reviewed by:	tools/regression/netinet/tcpconnect
MFC after:	3 days
Tested by:	Nick Hilliard (see net@)
2007-11-30 23:41:51 +00:00
Julian Elischer
182ff780b4 Add ipv6 to ng_cisco node. ipv6 wasn't a reality when I wrote it..
Submitted by: Marko Zec
2007-11-30 23:27:39 +00:00
Marius Strobl
9c13c513ad - Add the PCI side of the HOST-PCI bridge itself to the bus. This
is required by the X.Org PCI domains code and additionally needs
  a workaround for Hummingbird and Sabre bridges as these don't
  allow their config headers to be read at any width, which is an
  unusual behavior.
- In psycho(4) take advantage of DEFINE_CLASS_0 and use more
  appropriate types for some softc members.

MFC after:	3 days
2007-11-30 23:02:42 +00:00
Peter Wemm
3e3d9737c7 Allow the sio acpi attachment to be disabled (ie: use hints only). This
hack means you can get the units and flags to match up more easily with
serial consoles on machines with acpi tables that cause the com ports
to be probed in the wrong order (and hence get the wrong sio unit number).

This replaces the common alternative hack of editing the code to comment
out the acpi attachment.  This could go away entirely when device wiring
patches are committed.
2007-11-30 21:45:07 +00:00
Peter Wemm
585484b918 Add sio_puc_kludge_unit() to stop sio devices originating from puc
stomping on the units intended for the motherboard sio ports.  This is
no real substitute for the not-yet-committed device wiring enhancements.

Code taken from sio's pci attachment.
2007-11-30 21:36:12 +00:00
Peter Wemm
e16aed66ee Deal with the possibility of device_set_unit() being called when attaching
the associated devinfo sysctl tree.
2007-11-30 21:30:14 +00:00
Peter Wemm
cd17ceaab8 Add sysctl_rename_oid() to support device_set_unit() usage. Otherwise,
when unit numbers are changed, the sysctl devinfo tree gets out of sync
and duplicate trees are attempted to be attached with the original name.
2007-11-30 21:29:08 +00:00
Alan Cox
58041e4b9c Improve get_pv_entry()'s handling of low-memory conditions. After page
allocation fails and pv entries are reclaimed, there may be an unused pv
entry in a pv chunk that survived the reclamation.  However, previously,
after reclamation, get_pv_entry() did not look for an unused pv entry in
a surviving pv chunk; it simply retried the page allocation.  Now, it
does look for an unused pv entry before retrying the page allocation.

Note: This only applies to RELENG_7.  Earlier branches use a different
pv entry allocator.

MFC after: 6 weeks
2007-11-30 07:14:42 +00:00
John Birrell
a9445e17cc Adjust the padding to account for the change of size of the MI part
of struct pcpu.
2007-11-29 20:50:40 +00:00
Simon L. B. Nielsen
9790a3cbd4 Correct a random value disclosure in random(4).
Security:	FreeBSD-SA-07:09.random
2007-11-29 16:06:12 +00:00
Robert Watson
ef54068b54 Move use of 'i' in cp_time sysctl under SCTL_MASK32 so that it compiles
without warnings on systems that don't define it.
2007-11-29 08:38:22 +00:00
Joseph Koshy
4dd9b0c085 Revert revision 1.4.
Intel CPUs with family 0x6, model 0xE and later (i.e., Intel Core(TM))
have a PMC architecture that differs somewhat from previous CPUs in
family 0x6.  Even though the basic programming model is similar, the
documented set of legal values that may be loaded into their PMC MSRs
differs from that of the previous PMCs in family 0x6 and reusing bit
values valid for the older PMCs could result in undefined behaviour in
the general case.
2007-11-29 06:43:58 +00:00
Peter Wemm
7628402b07 Move the shared cp_time array (counts %sys, %user, %idle etc) to the
per-cpu area.  cp_time[] goes away and a new function creates a merged
cp_time-like array for things like linprocfs, sysctl etc.  The
atomic ops for updating cp_time[] in statclock go away, and the scope
of the thread lock is reduced.

sysctl kern.cp_time returns a backwards compatible cp_time[] array.
A new kern.cp_times sysctl returns the individual per-cpu stats.

I have pending changes to make top and vmstat optionally show per-cpu
stats.

I'm very aware that there are something like 5 or 6 other versions "out
there" for doing this - but none were handy when I needed them.

I did merge my changes with John Baldwin's, and ended up replacing a
few chunks of my stuff with his, and stealing some other code.

Reviewed by:  jhb
Partly obtained from:  jhb
2007-11-29 06:34:30 +00:00
Bruce Evans
d5c90663b2 Don't use plain "ret" instructions at targets of jump instructions,
since the branch caches on at least Athlon XP through Athlon 64 CPU's
don't understand such instructions and guarantee a cache miss taking
at least 10 cycles.  Use the documented workaround "ret $0" instead
("nop; ret" also works, but "ret $0" is probably faster on old CPUs).

Normal code (even asm code) doesn't branch to "ret", since there is
usually some cleanup to do, but the __mcount, .mcount and .mexitcount
entry points were optimized too well to have the minimum number of
instructions (3 instructions each if profiling is not enabled) and
they did this.  I didn't see a significant number of cache misses for
.mexitcount, but for the shared "ret" for __mcount and .mcount I
observed cache misses costing 26 cycles each.  For a send(2) syscall
that makes about 70 function calls, the cost of these cache misses
alone increased the syscall time from about 4000 cycles to about 7000
cycles.  4000 is for a profiling (GUPROF) kernel with profiling disabled;
after this fix, configuring profiling only costs about 600 cycles in the
4000, which is consistent with almost perfect branch prediction in the
mcounting calls.
2007-11-29 02:01:21 +00:00
Bruce Evans
7e7c8806bf Remove entry points for -finstrument functions since they are currently
unused except to obfuscate disassemblies.  -mprofiler-epilogue is
currently with gcc-4 (it does too little), but -finstrument-functions
is broken in a different way (it does too much).

amd64 version: meger whitespace fixes from i386 version.
2007-11-29 01:15:03 +00:00
John Birrell
35a04710d7 Remove some compatibility stuff that we now get from the Solaris header. 2007-11-29 00:15:08 +00:00
John Birrell
bb23d448d7 Remove an OpenSolaris compatibility header that is no longer referenced. 2007-11-28 23:21:55 +00:00
Jack F Vogel
2635265800 Add COHERENT to descriptor mem allocation for the
benefit of ARM (request from Olivier Houchard), its
a noop on most architectures and goodness on those
that use it.
2007-11-28 23:04:11 +00:00
John Birrell
ee8a5fa77d Remove _SOLARIS_C_SOURCE now that it doesn't do anything in FreeBSD
headers. All OpenSolaris compatibility comes via the set of specific
compatibility headers in src/compat/opensolaris and
src/sys/compat/opensolaris.
2007-11-28 22:58:09 +00:00
Olivier Houchard
43e23d1b4c Fixes for ARM9/ARM10 :
Call uma_sel_align() there at well.
Set CPU_CONTROL_VECRELOC if we're using the high vectors page.

Submitted by:	Rafal Jaworowski <raj AT semihalf DOT com>
MFC After:	1 week
2007-11-28 22:55:55 +00:00
Alan Cox
b3e2a63fa6 Account for pv entry pages in the total number of wired pages. (Note: pv
entry pages have always been included in the total number of wired pages
on i386 just not amd64.)

MFC after: 6 weeks
2007-11-28 22:41:14 +00:00
Bjoern A. Zeeb
19ad9831df Add sysctls to if_enc(4) to control whether the firewalls or
bpf will see inner and outer headers or just inner or outer
headers for incoming and outgoing IPsec packets.

This is useful in bpf to not have over long lines for debugging
or selcting packets based on the inner headers.
It also properly defines the behavior of what the firewalls see.

Last but not least it gives you if_enc(4) for IPv6 as well.

[ As some auxiliary state was not available in the later
  input path we save it in the tdbi. That way tcpdump can give a
  consistent view of either of (authentic,confidential) for both
  before and after states. ]

Discussed with:	thompsa (2007-04-25, basic idea of unifying paths)
Reviewed by:	thompsa, gnn
2007-11-28 22:33:53 +00:00
John Baldwin
3f7f26e990 MFamd64: 1.109 of pci_cfgreg.c which changes pci_cfgdisable() into a nop
for type #1 similar to what other OS's do.

MFC after:	3 days
2007-11-28 22:22:05 +00:00
Olivier Houchard
85d18774de Correct the logic : we can just invalidate the cache lines, and not
write-back them, only if PREWRITE is not set, and if the buffer is
cache-line aligned.

MFC After:	1 week
2007-11-28 22:21:17 +00:00
John Baldwin
98bbce55fa Adjust the code to probe for the PCI config mechanism to use.
- On amd64, just assume type #1 is always used.  PCI 2.0 mandated
  deprecated type #2 and required type #1 for all future bridges which
  was well before amd64 existed.
- For i386, ignore whatever value was in 0xcf8 before testing for type #1
  and instead rely on the other tests to determine if type #1 works.  Some
  newer machines leave garbage in 0xcf8 during boot and as a result the
  kernel doesn't find PCI at all (which greatly confuses ACPI which expects
  PCI to exist when PCI busses are in the namespace).

MFC after:	3 days
Discussed with:	scottl
2007-11-28 22:20:08 +00:00
John Birrell
b468fe2bce * Check endianness the FreeBSD way.
* Use LBOLT rather than lbolt to avoid a clash with a FreeBSD global
  variable.
2007-11-28 22:16:00 +00:00
John Birrell
9587fed572 Fix a prototype definition. 2007-11-28 22:13:28 +00:00
John Birrell
da9085a1c0 Check endianness the FreeBSD way. 2007-11-28 22:12:21 +00:00
John Birrell
47b288c152 Include an extra header to get this to compile cleanly. 2007-11-28 22:11:39 +00:00
John Birrell
e3709a563c Remove _SOLARIS_C_SOURCE compatibility definitions. Unfortunately the
ZFS porting style didn't extend this, instead using a heap of additional
header files that don't get installed.

My intention had been to allow OpenSolaris external code to build on
FreeBSD out of the box (i.e. without a src tree).
2007-11-28 21:54:46 +00:00
John Birrell
57438287ab Add more OpenSolaris compatibility headers. 2007-11-28 21:50:40 +00:00
John Birrell
eca148b637 Remove an extern that is defined elsewhere. 2007-11-28 21:50:05 +00:00
John Birrell
edadde229a Add compatibility cruft moved from under _SOLARIS_C_SOURCE in sys/types.h 2007-11-28 21:49:16 +00:00