Compare commits

..
2319 Commits
Author SHA1 Message Date
Dimitry Andric 67c55ed439 MFC r362623:
Fix copy/paste mistake in kvm_getswapinfo(3)

It seems this manpage was copied from kvm_getloadavg(3), but the
DIAGNOSTICS section was not updated completely. Update the section with
correct information about a return value of -1.
2020-06-30 15:53:52 +00:00
Tai-hwa Liang 16b4f86a4b MFC r338038: Extending the delay cycles to give the codec more time to pump ADC data across the AC-link.
Without this patch, some CS4614 cards will need users to reload the driver manually or
the hardware won't be initialised properly. Something like:

	# kldload snd_csa
	# kldunload snd_csa
	# kldload snd_csa

Tested with:	Terratec SiXPack 5.1+
2018-08-26 13:08:50 +00:00
David C Somayajulu e4a7e73ca5 MFC r336438
Fixes for  the following issues:
1. Fix taskqueues drain/free to fix panic seen when interface is being
   bought down and in parallel asynchronous link events happening.

2. Fix bxe_ifmedia_status()

Submitted by:[email protected] and [email protected]
2018-08-09 00:59:57 +00:00
David C Somayajulu f8c0c096a4 MFC r333004
Fix Issue with adding MultiCast Addresses. When multicast addresses are
added/deleted, the delete the multicast addresses previously programmed
in HW and reprogram the new set of multicast addresses.

Submitted by:[email protected]
2018-05-09 21:50:20 +00:00
David C Somayajulu 5a2057c18d MFC r314365
1. state checks in bxe_tx_mq_start_locked() and bxe_tx_mq_start() to
           sync threads during interface down or detach.
        2. add sysctl to set pause frame parameters
        3. increase max segs for TSO packets to BXE_TSO_MAX_SEGMENTS (32)
        4. add debug messages for PHY
        5. HW LRO support restricted to FreeBSD versions 8.x and above.

Submitted by:	[email protected]
2017-03-24 03:37:58 +00:00
David C Somayajulu 454be0d5c2 MFC r298591
1. Removed -Wno-shift-negative-value from Makefile
2. Fixed warning its absence caused in bxe_elink.c
2016-05-10 03:22:31 +00:00
David C Somayajulu b9b880a1f9 MFC r298496
Remove Unused/Dead Code
2016-05-10 03:19:09 +00:00
David C Somayajulu cd7455f553 MFC r298294
1. modify fwdump (a.k.a grcdump) so that grcdump memory is allocated
     and freed on as needed basis.
2. grcdump can be taken at failure points by invoking bxe_grc_dump()
     when trigger_grcdump sysctl flag is set. When grcdump is taken
     grcdump_done sysctl flag is set.
3. grcdump_done can be monitored by the user to retrieve the grcdump
2016-05-10 03:17:04 +00:00
David C Somayajulu 0b74afb5d4 MFC r297884
Add support for Flash Update

Submitted by:[email protected];[email protected];[email protected]
2016-04-19 19:22:07 +00:00
David C Somayajulu 5ccfc53931 MFC r297873
1. Process tx completions in bxe_periodic_callout_func() and
   restart transmissions if possible.
2. For SIOCSIFFLAGS call bxe_init_locked() only if !BXE_STATE_DISABLED
3. remove code not needed in bxe_init_internal_common()

Submitted by:[email protected];[email protected]
2016-04-19 19:18:59 +00:00
David C Somayajulu cbf671fd69 MFC r297155
Modifications to achieve a common source base from FreeBSD7.x thru 10.x
2016-04-06 21:59:52 +00:00
David C Somayajulu 951d7ff99b MFC r296579
Fix code so that buf_ring allocation for Tx Queues and their mutexes
is done during during bxe_attach() and freed during bxe_detach()
2016-03-14 23:49:16 +00:00
David C Somayajulu a97f2cb70c MFC r296071
Upgrade the firmware carried in driver and loaded during hardware
initialization (a.k.a STORM firmware) to version 7.13.1 (latest version)
2016-03-09 21:50:39 +00:00
David C Somayajulu 7863881888 MFC r295830
Remove dead code. Code Cleanup. Improve clarity in debug messages
2016-02-25 18:12:09 +00:00
David C Somayajulu 4589d2a8da MFC r295823
Modified the use of bxe_grc_dump() function so that it can be invoked directly at any potential error path, where a fwdump is needed. The fwdump (a.k.a grcdump) is stored in a driver buffer. The sysctl grcdump_done indicates if a fwdump was taken and waiting to be retrieved.
The sysctl trigger_grcdump can be used to manually trigger a fwdump.
2016-02-25 18:08:10 +00:00
John Baldwin 546d648266 Return the timestamps from the corresponding namecache entry on a negative
namecache hit.  This was ommitted due to a merging error in r238913.  The
effect was to usually break caching of negative name lookups in the NFS
client.

Submitted by:	bde
2016-02-02 19:29:29 +00:00
David C Somayajulu 3db57f7204 MFC r292639
Add support for firmware dump (a.k.a grcdump)
2016-01-13 01:16:10 +00:00
David C Somayajulu f343af6689 MFC r292638
Check for packet_length is greater than 60 bytes as well as packet_length is
      greater than len_on_bd, before invoking the routine to handle jumbo over SGL
      (bxe_service_rxsgl()).
      Add counters for number of jumbo_over_SGL packets (rx_bxe_service_rxsgl) and
      erroneous jumbo_over_SGL packets (rx_erroneous_jumbo_sge_pkts)

      Fix formatting in bxe_sysctl_state()
2016-01-13 01:11:32 +00:00
David C Somayajulu 363e8594e2 MFC r289199
Add support for reading device temperature
2016-01-13 01:09:32 +00:00
Edwin Groothuis 0899e9134b MFC of 290697,tzdata7:
Update to tzdata2015g:

Turkey's 2015 fall-back transition is scheduled for Nov. 8, not Oct. 25.

Norfolk moves from +1130 to +1100 on 2015-10-04 at 02:00 local time.

Fiji's 2016 fall-back transition is scheduled for January 17, not 24.

Fort Nelson, British Columbia will not fall back on 2015-11-01.  It has
effectively been on MST (-0700) since it advanced its clocks on 2015-03-08.
New zone America/Fort_Nelson.
2015-11-12 03:30:04 +00:00
Tai-hwa Liang dc76a52be4 MFC r287698: Fixing a memory leak on module unloading. 2015-10-26 03:48:38 +00:00
Tai-hwa Liang 323699b1bf MFC r238980:
Just like the other file systems found in /sys/fs, g_vfs_open()
should be paried with g_vfs_close().  Though g_vfs_close() is a wrapper
around g_wither_geom_close(), r206130 added the following test in
g_vfs_open():

	if (bo->bo_private != vp)
		return (EBUSY);

  Which will cause a 'Device busy' error inside reiserfs_mountfs() if
the same file system is re-mounted again after umount or mounting failure:

	(case 1, /dev/ad4s3 is not a valid REISERFS partition)
	# mount -t reiserfs -o ro /dev/ad4s3 /mnt
	mount: /dev/ad4s3: Invalid argument
	# mount -t msdosfs -o ro /dev/ad4s3 /mnt
	mount: /dev/ad4s3: Device busy

	(case 2, /dev/ad4s3 is a valid REISERFS partition)
	# mount -t reiserfs -o ro /dev/ad4s3 /mnt
	# umount /mnt
	# mount -t reiserfs -o ro /dev/ad4s3 /mnt
	mount: /dev/ad4s3: Device busy

  On the other hand, g_vfs_close() 'fixed' the above cases by doing an
extra step to keep 'sc->sc_bo->bo_private' and 'cp->private' pointers
synchronised.

Reviewed by:	kib
2015-10-24 19:40:27 +00:00
Tai-hwa Liang 0f57b94412 MFC r286888: Using consistent coding style to deal with error inside the loop. 2015-10-07 09:41:17 +00:00
Tai-hwa Liang 378b24a8dd MFC r286887: Using the error return code documented in the comment.
Though there is no direct midi_uninit() caller amongst existing drivers
at this moment, a quick experiment indicates that EBUSY gives users more
precise error message once drivers start to honour this result.  For example,
emu_midi_detach() should check the result of mpu401_uninit() and block
module unloading if there is any MIDI I/O in progress.
2015-09-17 00:19:27 +00:00
Tai-hwa Liang ff8ca6716e MFC r286886: Fixing typo as well as improving readability of a few comments. 2015-09-16 11:32:28 +00:00
Edwin Groothuis 74283b4763 MFC of 286750,tzdata7:
Update to tzdata2015f:

Changes affecting future time stamps

    North Korea switches to +0830 on 2015-08-15.  (Thanks to Steffen Thorsen.)
    The abbreviation remains "KST".  (Thanks to Robert Elz.)
    Uruguay no longer observes DST.  (Thanks to Steffen Thorsen and Pablo Camargo.)
    Changes affecting past and future time stamps
    Moldova starts and ends DST at 00:00 UTC, not at 01:00 UTC. (Thanks to Roman Tudos.)
2015-08-14 00:01:45 +00:00
Dimitry Andric 506eb9ca99 MFC r286519:
In GNU as, avoid left-shifting negative integers, which is undefined.
2015-08-12 19:18:54 +00:00
David C Somayajulu 648dcf329c MFC r285973
- Avoid lock contention in the if_transmit callback by using trylock and
       enqueueing the frames when it fails. This way there is some latency
       removed from the transmitting path.
      - If IFF_DRV_OACTIVE is set (and also if IFF_DRV_RUNNING is not) just
       enqueue the desired frames and return successful transmit. This way we
       avoid to return errors on transmit side and resulting in
       possible out-of-order frames. Please note that IFF_DRV_OACTIVE is set
       everytime we get the threshold ring hit, so this can be happening quite
       often.

Submitted by:	[email protected]
2015-08-05 02:16:11 +00:00
Dimitry Andric cb1fe3ec8f MFC r285340:
Fix swapped copyin(9) arguments in cxgb's iwch_arm_cq() function.
Detected by clang 3.7.0 with the warning:

sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c:309:18: error: variable
'rptr' is uninitialized when used here [-Werror,-Wuninitialized]
		chp->cq.rptr = rptr;
			       ^~~~
2015-07-28 09:19:04 +00:00
David C Somayajulu 56d31093c6 MFC r284739
tx_mtx should be grabbed before calling buf_ring_dequeue_sc()

Submitted by: [email protected]
2015-06-30 20:45:41 +00:00
David C Somayajulu b9672ecc6c MFC r284470
In bxe_set_mc_list(): added missing BXE_MCAST_UNLOCK()
In __ecore_vlan_mac_h_exec_pending(): need to check for ECORE_PENDING

Submitted by:[email protected]
2015-06-30 20:40:38 +00:00
David C Somayajulu 190c8e68c1 MFC r284335
PHY LOCK acquires the hardware lock via bxe_acquire_phy_lock() and releases it via bxe_release_phy_lock(). It was simply acquiring a mutex earlier which can cause the PHY to use bogus values. Fixes intermittent link failures.

bxe_ioctl() completes all functions within its context as opposed to a taskqueue earlier.

bxe_handle_rx_mode_tq() no longer required. bxe_set_rx_mode() handles the functionality within its context

Submitted by:[email protected]
2015-06-30 20:37:04 +00:00
Dimitry Andric bd464ed955 MFC r284346:
Fix the following clang 3.7.0 warnings in lib/libfetch/http.c:

    lib/libfetch/http.c:1628:26: error: address of array 'purl->user'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.user = purl->user ?
                                                   ~~~~~~^~~~ ~
    lib/libfetch/http.c:1630:30: error: address of array 'purl->pwd'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.password = purl->pwd?
                                                       ~~~~~~^~~~
    lib/libfetch/http.c:1657:25: error: address of array 'url->user'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.user = url->user ?
                                                   ~~~~~^~~~ ~
    lib/libfetch/http.c:1659:29: error: address of array 'url->pwd'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.password = url->pwd ?
                                                       ~~~~~^~~ ~
    lib/libfetch/http.c:1669:25: error: address of array 'url->user'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.user = url->user ?
                                                   ~~~~~^~~~ ~
    lib/libfetch/http.c:1671:29: error: address of array 'url->pwd'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.password = url->pwd ?
                                                       ~~~~~^~~ ~

Since url->user and url->pwd are arrays, they can never be NULL, so the
checks can be removed.

Reviewed by:	bapt
Differential Revision: https://reviews.freebsd.org/D2673
2015-06-20 13:30:09 +00:00
Edwin Groothuis 813625317c MFC of 284397,tzdata7:
Update to tzdata2015e:

  Changes affecting future time stamps

    Morocco will suspend DST from 2015-06-14 03:00 through 2015-07-19 02:00,
    not 06-13 and 07-18 as we had guessed.  (Thanks to Milamber.)

    Assume Cayman Islands will observe DST starting next year, using US rules.
    Although it isn't guaranteed, it is the most likely.
2015-06-15 01:03:40 +00:00
John Baldwin 6b0aeadfac MFC 281887:
Reassign copyright statements on several files from Advanced
Computing Technologies LLC to Hudson River Trading LLC.
2015-06-02 19:20:39 +00:00
David C Somayajulu a1620da41b MFC r283274
Add stat counters for Jumbo Frames using SGE ring.
Also remove the checks for IFCAP_LRO in bxe_alloc_fp_buffers() and bxe_pf_rx_q_prep() since both TPA and Jumbo can use SGE ring.

Submitted by:[email protected]
2015-05-30 04:49:19 +00:00
David C Somayajulu 3fe84cece5 MFC r283269
Submitted by:	[email protected]
2015-05-29 23:37:27 +00:00
Dimitry Andric 644c272b14 MFC r283254:
Ensure that the static structs emitted by the MODULE_DEPEND() and
MODULE_VERSION() macros don't end up as .comm symbols, when all the
version fields are zero.

Normally, such symbols will end up in .bss, but for kernel module
version objects, this can lead to "garbage" version numbers.

Fix this by instructing the compiler to always put these structs in the
.data segment instead.

Reported by:	delphij, ae
2015-05-28 06:45:13 +00:00
Edwin Groothuis 9f629bf059 MFC of 283079,tzdata7:
Update to tzdata2015d:

Release 2015d - 2015-04-24 08:09:46 -0700

  Changes affecting future time stamps

    Egypt will not observe DST in 2015 and will consider canceling it
    permanently.  For now, assume no DST indefinitely.
    (Thanks to Ahmed Nazmy and Tim Parenti.)

  Change affecting past and future time zone abbreviations

    The abbreviations for Hawaii-Aleutian standard and daylight times
    have been changed from HAST/HADT to HST/HDT, as per US Government
    Printing Office style.  This affects only America/Adak since 1983,
    as America/Honolulu was already using the new style.
2015-05-18 22:12:50 +00:00
Edwin Groothuis d8930c0c1b MFC of 283042,tzdata7:
Update to tzdata2015c:

    Release 2015c - 2015-04-11 08:55:55 -0700

    Changes affecting future time stamps

    Egypt's spring-forward transition is at 24:00 on April's last Thursday,
    not 00:00 on April's last Friday.  2015's transition will therefore be on
    Thursday, April 30 at 24:00, not Friday, April 24 at 00:00.  Similar fixes
    apply to 2026, 2037, 2043, etc.  (Thanks to Steffen Thorsen.)
2015-05-18 02:10:45 +00:00
David C Somayajulu b32cc26aec MFC r281006
When an mbuf allocation fails in the receive path, the mbuf containing the received packet is not sent to the host network stack and is reused again on the receive ring.  Remaining received packets in the ring are not processed in that invocation of bxe_rxeof() and defered to the task thread
2015-04-07 18:14:01 +00:00
Edwin Groothuis 018b3e0647 MFC of 280413,tzdata7:
Release 2015b - 2015-03-19 23:28:11 -0700

  Changes affecting future time stamps

    Mongolia will start observing DST again this year, from the last
    Saturday in March at 02:00 to the last Saturday in September at 00:00.
    (Thanks to Ganbold Tsagaankhuu.)

    Palestine will start DST on March 28, not March 27.  Also,
    correct the fall 2014 transition from September 26 to October 24.
    Adjust future predictions accordingly.  (Thanks to Steffen Thorsen.)

  Changes affecting past time stamps

    The 1982 zone shift in Pacific/Easter has been corrected, fixing a 2015a
    regression.  (Thanks to Stuart Bishop for reporting the problem.)

    Some more zones have been turned into links, when they differed
    from existing zones only for older time stamps.  As usual,
    these changes affect UTC offsets in pre-1970 time stamps only.
    Their old contents have been moved to the 'backzone' file.
    The affected zones are: America/Antigua, America/Cayman,
    Pacific/Midway, and Pacific/Saipan.

  Changes affecting time zone abbreviations

    Correct the 1992-2010 DST abbreviation in Volgograd from "MSK" to "MSD".
    (Thanks to Hank W.)
2015-03-24 06:12:59 +00:00
Edwin Groothuis 81dedb949e MFC of 279706,tzdata7:
Release 2015a - 2015-01-29

Changes affecting future time stamps

    The Mexican state of Quintana Roo, represented by America/Cancun,
    will shift from Central Time with DST to Eastern Time without DST
    on 2015-02-01 at 02:00.  (Thanks to Steffen Thorsen and Gwillim Law.)

    Chile will not change clocks in April or thereafter; its new standard time
    will be its old daylight saving time.  This affects America/Santiago,
    Pacific/Easter, and Antarctica/Palmer.  (Thanks to Juan Correa.)

    New leap second 2015-06-30 23:59:60 UTC as per IERS Bulletin C 49.
    (Thanks to Tim Parenti.)

  Changes affecting past time stamps

    Iceland observed DST in 1919 and 1921, and its 1939 fallback
    transition was Oct. 29, not Nov. 29.  Remove incorrect data from
    Shanks about time in Iceland between 1837 and 1908.

    Some more zones have been turned into links, when they differed
    from existing zones only for older time stamps.  As usual,
    these changes affect UTC offsets in pre-1970 time stamps only.
    Their old contents have been moved to the 'backzone' file.
    The affected zones are: Asia/Aden, Asia/Bahrain, Asia/Kuwait,
    and Asia/Muscat.
2015-03-06 22:10:13 +00:00
Dimitry Andric dfa40d69d9 MFC r276346:
In contrib/binutils/gas/config/tc-ppc.c, fix a few -Wformat-security
warnings.
2014-12-31 16:28:16 +00:00
Dimitry Andric c34f2c3d02 MFC r275477:
Pull in r174303 from upstream gcc trunk (by Jason Merrill):

  PR c++/48211
  * name-lookup.h (cp_class_binding): Make base a pointer.
  * name-lookup.c (new_class_binding): Adjust.
  (poplevel_class): Adjust.

This fixes a potential segfault when compiling gold, a part of the
devel/binutils port, with gcc.  See also the upstream bug report:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48211

Thanks to Jason Merrill, Tom Callaway and Red Hat legal for approving
the use of this patch under the GNU GPL, version 2 or later.
2014-12-11 08:05:59 +00:00
Dimitry Andric d10f9994bf MFC r274900:
Fix the following -Werror warnings from clang 3.5.0, while building
bsnmpd's snmp_hostres module:

usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:204:20: error: absolute value function 'abs' given an argument of type 'const long' but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value]
        str[9] = (u_char)(abs(tm->tm_gmtoff) / 3600);
                          ^
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:204:20: note: use function 'labs' instead
        str[9] = (u_char)(abs(tm->tm_gmtoff) / 3600);
                          ^~~
                          labs
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:205:22: error: absolute value function 'abs' given an argument of type 'const long' but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value]
        str[10] = (u_char)((abs(tm->tm_gmtoff) % 3600) / 60);
                            ^
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:205:22: note: use function 'labs' instead
        str[10] = (u_char)((abs(tm->tm_gmtoff) % 3600) / 60);
                            ^~~
                            labs

Since tm::tm_gmtoff is a long, use labs(3) instead.
2014-11-25 13:29:13 +00:00
Dimitry Andric 16840ea80c MFC r274847:
Fix the following -Werror warnings from clang 3.5.0, while building
usr.bin/locate:

usr.bin/locate/locate/util.c:249:29: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
                            MAXPATHLEN, abs(i) < abs(htonl(i)) ? i : htonl(i));
                                                 ^
usr.bin/locate/locate/util.c:249:29: note: remove the call to 'abs' since unsigned values cannot be negative
                            MAXPATHLEN, abs(i) < abs(htonl(i)) ? i : htonl(i));
                                                 ^~~
usr.bin/locate/locate/util.c:274:32: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
                            MAXPATHLEN, abs(word) < abs(htonl(word)) ? word :
                                                    ^
usr.bin/locate/locate/util.c:274:32: note: remove the call to 'abs' since unsigned values cannot be negative
                            MAXPATHLEN, abs(word) < abs(htonl(word)) ? word :
                                                    ^~~

The problem is that ntohl() always returns an unsigned quantity.  In
this case, it's expected to be cast back to a signed integer, but to
stop complaints about abs() we just store it into an integer, and don't
call ntohl() again.

Reviewed by:	ngie
Differential Revision: https://reviews.freebsd.org/D1196
2014-11-25 12:45:31 +00:00
Edwin Groothuis 3eb76b32e2 MFC of 274559,tzdata7:
Release 2014j - 2014-11-10 17:37:11 -0800

  Changes affecting current and future time stamps

    Turks & Caicos' switch from US eastern time to UTC-4 year-round
    did not occur on 2014-11-02 at 02:00.  It's currently scheduled
    for 2015-11-01 at 02:00.  (Thanks to Chris Walton.)

  Changes affecting past time stamps

    Many pre-1989 time stamps have been corrected for Asia/Seoul and
    Asia/Pyongyang, based on sources for the Korean-language Wikipedia
    entry for time in Korea.  (Thanks to Sanghyuk Jung.)  Also, no
    longer guess that Pyongyang mimicked Seoul time after World War II,
    as this is politically implausible.

    Some more zones have been turned into links, when they differed
    from existing zones only for older time stamps.  As usual,
    these changes affect UTC offsets in pre-1970 time stamps only.
    Their old contents have been moved to the 'backzone' file.
    The affected zones are: Africa/Addis_Ababa, Africa/Asmara,
    Africa/Dar_es_Salaam, Africa/Djibouti, Africa/Kampala,
    Africa/Mogadishu, Indian/Antananarivo, Indian/Comoro, and
    Indian/Mayotte.

  Changes affecting commentary

    The commentary is less enthusiastic about Shanks as a source,
    and is more careful to distinguish UT from UTC.
2014-11-16 04:13:09 +00:00
Dimitry Andric 7c015fba24 MFC r273837:
Fix a clang 3.5 warning about abs(3) being given an argument of type
quad_t in setusercontext().  While here, sanitize the clamping of the
priority value, and use the correct type for the return value of
login_getcapnum().

Reviewed by:	kib
2014-11-01 13:45:01 +00:00
Edwin Groothuis f1fd6badce MFC of 273718, tzdata2014i
Upgrade to 2014i

Lots of historical data

Pacific/Fiji will go into DST from 2014-11-02 to 2015-01-18
Pacific/Bougainville will go from UTC+10 to UTC+11.
Europe/Minsk will go from FET to MSK.
2014-10-27 06:13:22 +00:00
David C Somayajulu e037e9201c MFC r271728
For ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() check bxe_debug flag before printing error message.
2014-09-22 18:36:37 +00:00
David C Somayajulu 2c5bfcb9be MFC r271727
Remove clean option form Makefile
2014-09-22 18:31:40 +00:00
David C Somayajulu 52162fa10e MFC r271726
Remove clean option in Makefile
2014-09-22 18:29:14 +00:00
Dimitry Andric ace3f7ae8a MFC r257658 (modified to apply to stable/7):
For C++ programs, don't emit any explicit dependency to libstdc++.a or
libc++.a during the early build stages (bootstrap-tools, build-tools,
cross-tools), since it is not possible to know in advance which C++
library is available on the host system.

Instead, just use the bootstrap compiler's built-in default.  This
should eventually make it possible to build stable/9 on head, or on
stable/10, which ship without libstdc++ by default.

[Note: this should get the stable/7 tinderbox at least a bit further in
buildworld.]
2014-09-18 06:47:48 +00:00
David C Somayajulu 7c4be4135d MFC r268854
Initiate error recovery stats fail to update after 3 retries.
      Change bxe_panic() ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() to
      panic only if ECORE_STOP_ON_ERROR is defined.
2014-09-12 18:31:44 +00:00
Sergey Kandaurov 8b62ba0609 MFC r270728, tzdata2014f
- Parts of Russia will change times on 2014-10-26.
- Time zone name changes for Asia/Novokuznetsk and Xinjiang and Samoa
  and America/Metlakatla, new zones Asia/Chita and Asia/Srednekolymsk.
- Australia will now use Axxx.
- New zone tab data format.

And lots of historical changes (See
http://mm.icann.org/pipermail/tz-announce/2014-August/000023.html
for the full details.)
2014-08-29 13:24:49 +00:00
Edwin Groothuis c8a477689d MFC of i267473,tzdata2013b
Fix historical data for Egypt.
Better prediction for future Egypt / Morocco changes.
Update to Cocos / Cook islands.
Fix historical data for Russia.
2014-06-14 11:37:01 +00:00
Alexander Motin 3e3a45aede MFC r237398:
In camisr() clear CAM_SIM_ON_DONEQ flag after camisr_runqueue() purged SIM
done queue. Clearing it before caused extra SIM queueing in some cases.
It was invisible during normal operation, but during USB device unplug and
respective SIM destruction it could keep pointer on SIM without having
counted reference and as result crash the system by use afer free.

PR:		usb/168743
2014-06-04 12:24:53 +00:00
Gregory Neil Shapiro b2581eb644 Note merge for sendmail 8.14.9. 2014-05-26 16:01:45 +00:00
Gregory Neil Shapiro bfd2dfa583 MFC: Minor changes to force commit these files so new freebsd*.cf files are
built to use the new sendmail-8.14.9/cf tree.
2014-05-26 15:47:26 +00:00
Gregory Neil Shapiro 11076f6c2b MFC: Update for sendmail 8.14.9 import 2014-05-26 15:36:57 +00:00
Gregory Neil Shapiro f5342d84e6 MFC: Merge sendmail 8.14.9 to HEAD 2014-05-26 15:31:26 +00:00
Edwin Groothuis ec01651ed3 MFC of 265978, tzdata2014c
- Egypt will go into DST on 15 May 2014.
2014-05-13 21:29:19 +00:00
David C Somayajulu 42638a6ba6 MFC r265703
Modify Copyright information and other strings to reflect
Qlogic Corporation's purchase of Broadcom's NetXtreme business.
Added clean option to Makefile

Submitted by:	David C Somayajulu ([email protected]) QLogic Corporation
2014-05-12 16:10:14 +00:00
David C Somayajulu 0640fa8ac4 MFC r265411
Modify Copyright information to reflect Qlogic Corporation's purchase
of Broadcom's NetXtreme business

Submitted by:David C Somayajulu ([email protected]) QLogic Corporation
2014-05-10 02:06:46 +00:00
Edwin Groothuis 92244f12d1 MFC of 263901, tzdata2014b
- Update antartica.
 - Comments about historical data for Hawaii.
 - Update details for Crimea on 30 March
 - Move location data Simferopol.
2014-03-29 04:19:48 +00:00
Dimitry Andric 2400551229 Turn off warnings for building aicasm. Various versions of yacc exist,
which can result in different warnings-as-errors in this tool, but these
are all completely harmless.

This is a direct commit to stable/7, stable/8, stable/9 and stable/10,
since this kernel build tool has already been removed in head.
2014-03-23 14:18:40 +00:00
Eric Davis 31004c9841 MFC 262999
Fixed MSI interrupt allocation and handling.
Fixed a DMA mapping leak that occurs when defragmenting packet chains.

Approved by:	davidch (mentor)
2014-03-21 23:56:38 +00:00
Edwin Groothuis f9705f5519 MFC of 263041, tzdata2014a:
- Fix historical info about asia/Zion, Ukraine
- Fiji starts DST at 02:00 instead of 03:00
- Turkey will move to DST at 31 March this year.
2014-03-11 20:36:22 +00:00
Xin LI b9cd5722d0 MFC r261618:
In g_eli_crypto_hmac_init(), zero out after using the ipad buffer,
k_ipad.

Note that the two consumers in geli(4) are not affected by this
issue because the way the code is constructed and as such, we
believe there is no security impact with or without this change
with geli(4)'s usage.

Reported by:	Serge van den Boom <serge vdboom.org>
Reviewed by:	pjd
2014-02-22 00:41:03 +00:00
Peter Wemm e7dbc6c14a MFC r256557 - kernel and userland osreldate helpers. 2014-02-11 17:07:45 +00:00
Gregory Neil Shapiro f84675f613 MFC: Note merge of sendmail 8.14.8. 2014-02-02 00:30:29 +00:00
Gregory Neil Shapiro 7e3cdb942d MFC: Minor changes to force commit these files so new freebsd*.cf files are
built to use the new sendmail-8.14.8/cf tree.
2014-02-02 00:29:48 +00:00
Gregory Neil Shapiro 36c7fd893c MFC: Add missing svn:keywords property to new files 2014-02-02 00:29:04 +00:00
Gregory Neil Shapiro 12f0e7e02f MFC: Update for sendmail 8.14.8 import 2014-02-02 00:28:39 +00:00
Gregory Neil Shapiro 592d968f6e MFC: Remove local FreeBSD workaround now that upstream project has a better fix. 2014-02-02 00:28:12 +00:00
Gregory Neil Shapiro 0581c75fd3 MFC: Add new sendmail 8.14.8 file 2014-02-02 00:27:38 +00:00
Gregory Neil Shapiro e826924463 MFC: Merge sendmail 8.14.8 2014-02-02 00:26:48 +00:00
Gregory Neil Shapiro fa5a86621f MFC: Update link to vendor import instructions 2014-02-01 22:06:39 +00:00
Peter Wemm 768e111b5b Revert MFC of r258821 - it was already handled by MFC of r239672.
Pointy hat to: peter
2014-01-08 03:17:11 +00:00
Eric Davis 047a6d1d5b Merged r260415 from head.
Approved by:	davidch
2014-01-07 23:50:15 +00:00
Peter Wemm dcd3798d9c MFC r258821 - fix tcp simultaneous close
PR:             kern/99188
2014-01-07 23:02:50 +00:00
Eric Davis 965240c874 MFC Broadcom 10Gb bxe driver
Merged r255736, r255861, r256299, r256341, r258187, r259928, r260113

Approved by:  davidch (mentor)
2014-01-05 23:13:18 +00:00
Dimitry Andric 817bcc38be MFC r260112:
In sys/dev/sound/pci/maestro.c, #if 0 two unused static functions.
2014-01-04 23:12:01 +00:00
Dimitry Andric d0d5d934af MFC r260095:
For sys/boot/i386 and sys/boot/pc98, separate flags to be passed
directly to the linker (LD_FLAGS) from flags passed indirectly, via the
compiler driver (LDFLAGS).

This is because several Makefiles under sys/boot/i386 and sys/boot/pc98
use ${LD} directly to link, and the normal LDFLAGS value should not be
used in these cases.
2014-01-04 22:00:07 +00:00
Dimitry Andric 6a4ec2cff0 MFC r260103:
In sys/amd64/amd64/pmap.c, remove static function pmap_is_current(),
which has been unused since r189415.

Reviewed by:	alc
2014-01-04 21:45:52 +00:00
Dimitry Andric c9fecfe0c9 MFC r260057:
In sys/dev/scc, remove unused static function scc_setmreg().  While
here, invoke scc_getmreg() in two more places where it can be used.

Reviewed by:	marcel
2014-01-04 21:32:53 +00:00
Dimitry Andric e8f4f8ba7b MFC r260048:
In sys/netgraph/netflow, use __FBSDID() instead of old-style rcs_id[].
2014-01-04 19:04:53 +00:00
Dimitry Andric cccf7a9bbd MFC r260042:
Remove superfluous old-style rcsid[] from if_my.c.  There is already an
__FBSDID() at the top of the file.
2014-01-04 18:58:18 +00:00
Dimitry Andric ee77308b50 MFC r260040:
In sys/dev/mcd/mcd.c, mark the static const COPYRIGHT string as __used,
so it ends up in the object file, and no warnings are emitted about it
being actually unused.
2014-01-04 18:53:31 +00:00
Dimitry Andric e39b92f7e1 MFC r260038:
In sys/dev/en/midway.c, #if 0 an unused static function.
2014-01-04 18:48:29 +00:00
Dimitry Andric bc53795df5 MFC r260016:
Remove superfluous old-style rcsid[] from if_sk.c.  There is already an
__FBSDID() at the top of the file.
2014-01-04 17:33:05 +00:00
Edwin Groothuis ffd7b3bae3 MFC of 259626, tzdata2013i:
Removed support for solar-time-based time zones
Jordan stays at summer time this year.
Fix historical data for Cuba
2013-12-19 20:25:55 +00:00
Edwin Groothuis e9c8b4caf7 MFC of 257681
tzdata2013f
- Jordan goes to winter time on the last Friday in October.
- Tocantins in Brazil will not go into summer time in October.
- Indonesian time zones renames.
- Lots of cleanups in with regarding to links and historical data.

tzdata2013h
- Libya didn't go back to DST.
- Fix Morocco 2038 issue.
- Brazil/Acre and ?Western Amazonas are chaning timezones.
2013-11-05 06:40:35 +00:00
Dimitry Andric 8284fddb61 MFC r255931:
Fix a bug in ld, where indirect symbols are not handled properly during
linking of a shared library, leading to corrupt indexes in the dynamic
symbol table.  This should fix the multimedia/ffmpegthumbnailer port.

Reported by:	swills
2013-10-12 16:11:57 +00:00
Gregory Neil Shapiro 869263712f MFC: Temporarily revert sendmail 8.14.7 change to getipnodebyname() flags
to prevent problems between the resolver and Microsoft DNS servers with
     AAAA lookups.  The upstream open source project will work on a more
     permanent fix for the next release.  Issue noted by Pavel Timofeev.
2013-08-15 01:42:46 +00:00
Edwin Groothuis 6989de007b MFC of tzdata2013d, 253009
- Morocco:
  announced that the year's Ramadan daylight-savings transitions
  would be 2013-07-07 and 2013-08-10.

- Israel:
  As of 2013, DST starts at 02:00 on the Friday before the last
  Sunday in March.  DST ends at 02:00 on the first Sunday after
  October 1, unless it occurs on the second day of the Jewish Rosh
  Hashana holiday, in which case DST ends a day later (i.e. at 02:00
  the first Monday after October 2).  [Rosh Hashana holidays are
  factored in until 2100.]
2013-07-07 22:27:58 +00:00
Dimitry Andric 87614dae73 MFC r252387:
Make libsupc++'s __cxa_call_terminate() prototype consistent with the
definition.

Submitted by:	[email protected]
2013-07-04 22:09:14 +00:00
Jim Harris a560b12bed MFC r252262:
For ATA_PASSTHROUGH commands, pretend isci(4) supports multiword DMA
  by treating it as UDMA.

  This fixes a problem introduced in r249933/r249939, where CAM sends
  ATA_DSM_TRIM to SATA devices using ATA_PASSTHROUGH_16.  scsi_ata_trim()
  sets protocol as DMA (not UDMA) which is for multi-word DMA, even
  though no such mode is selected for the device.  isci(4) would fail
  these commands which is the correct behavior but not consistent with
  other HBAs, namely LSI's.

  smh@ did some further testing on an LSI controller, which rejected
  ATA_PASSTHROUGH_16 commands with mode=UDMA_OUT, even though only
  a UDMA mode was selected on the device.  So this precludes adding
  any kind of mode detection in CAM to determine which mode to use on
  a per-device basis.

Note: The reasons behind this change do not apply to stable/7.  This MFC
is to keep the driver consistent across stable branches and current.

Sponsored by: Intel
2013-07-03 23:24:53 +00:00
David E. O'Brien 0974633a12 MF8: r252639
MF9: r252635, r252638:
     MFC: r252348, r252363: sysconf(3) returns a long, not an int.
2013-07-03 23:03:28 +00:00
Dimitry Andric 91fd779f75 MFC r250393:
When gcc 4.2.0 was imported, the 3DNow intrinsics header <mm3dnow.h> was
not added to the list of intrinsics headers to install, so belatedly (5
years :) add it.
2013-05-15 20:59:00 +00:00
Dimitry Andric 271c9a0ce7 MFC r250392:
For some reason, the gcc intrinsics header tmmintrin.h was imported with
two copies of itself pasted together.  Remove the extraneous copy.
2013-05-11 16:47:42 +00:00
Sean Bruno 7f96a32e26 MFC r249815
Return a lun count of 1 and a lun id of 0 when CAM attempts a REPORT_LUNS
command on a disk device.  This quieseces some noise on the console that
recently appeared.
2013-05-08 15:50:24 +00:00
Dimitry Andric 6b7b099896 MFC r249846:
When rebooting (exiting) from the BTX loader, make sure to restore the
GDT from the correct segment, otherwise a triple fault would be caused.
In some virtual environments (VMware, VirtualBox, etc) this could lead
to a unhandled error or hang in the guest emulation software.

Thanks to avg and jhb for a few hints in the right direction.

Noticed by:	Jeremy Chadwick <[email protected]> (and many others)
2013-05-01 18:06:53 +00:00
Sergey Kandaurov 608f7cadd0 MFC r248253:
Add missed `_load' to the `if_foo_load="YES"' line.

PR:		docs/176915
Submitted by:	Dmitry Afanasiev <[email protected]>
2013-04-29 20:32:09 +00:00
Sergey Kandaurov cf997d3316 Fix build.
- pass a format string to printf
- catch up with constifying uz_name
2013-04-29 11:36:59 +00:00
Sean Bruno 5c6e5e0ffe MFC r249349
Repair camcontrol output and use CAM defined values for string sizes
2013-04-25 17:06:07 +00:00
Gregory Neil Shapiro d1a7a39447 Record sendmail 8.14.7 upgrade 2013-04-25 02:27:13 +00:00
Gregory Neil Shapiro 97f0fde1e6 MFC: Minor changes to force commit these files so new freebsd*.cf files are
built to use the new sendmail-8.14.7/cf tree.
2013-04-25 02:19:46 +00:00
Gregory Neil Shapiro fdc36c48cb MFC: Update for sendmail 8.14.7 2013-04-25 02:18:50 +00:00
Gregory Neil Shapiro dc54faabf8 MFC: Merge sendmail 8.14.7 2013-04-25 02:18:15 +00:00
Edwin Groothuis a1ae545b4c Merge of current from 249692, tzdata2013c:
- antarctica: AusAQ and ATAQ have been removed.
- Antarctica/Macquarie has been moved to australasia file and AU.
- Asia/Hebron, Palestine updated for 2013.
- Paraguay stays with DST for the whole year.
2013-04-20 11:45:08 +00:00
Sean Bruno ca21a7bcdd MFC r249170
Notify CAM on state* change to a logical volume not status.  This resolves
the issues reported regarding camcontrol devlist not showing the rebuild
states of volumes unless an explicit camcontrol rescan was executed.
2013-04-19 18:39:17 +00:00
Dimitry Andric 3f4d8128f1 MFC r249316:
Ensure make -j N universe works correctly, by checking for an up-to-date
make before starting the universe targets themselves.  Otherwise, all of
the targets would attempt to build make simultaneously, overwriting each
other's copies of the make object files and executable.  This could lead
to strange errors, for example when partially-written make executables
are invoked.

Also amend r216620, to make the rest of universe wait properly until the
upgrade_checks target is finished, by adding universe_${target}_prologue
to the .ORDER target.  Otherwise, make will be too smart for its own
good, and start building the universe targets simultaneously with the
prologues anyway.
2013-04-16 06:53:20 +00:00
Sergey Kandaurov 6051e1478e MFC r222854: Added FreeBSD 8.3.
Several manual pages reference it in stable/7.
2013-04-10 10:22:45 +00:00
Sean Bruno 34745f7324 Resolve kernel panic that occurs on callback from sysctl when setting
hw.ciss.expose_hidden_physical=1 on a HP ProLiant DL360 G6 (and possibly
others) due to mishandling of error value in acpica on stable/7

Note that this is a direct commit as this code has been fixed in stable/8
(8.4 included) and higher release for quite some time.

PR:	kern/152250
Submitted by:	Loic Pefferkorn <[email protected]>
Reviewed by:	avg@
2013-04-03 23:11:15 +00:00
Dimitry Andric d1c4293bc9 MFC r248802:
Similar to r239870 and r239872, teach the other binutils tools about the
DW_FORM_flag_present dwarf attribute, so they do not print errors or
warnings on files that contain it.  (This attribute can be emitted by
newer versions of clang and gcc.)
2013-04-03 16:31:30 +00:00
Edwin Groothuis 574c86435a Merge of current of tzdata2013b
Lots of historical data added.

Morocco: add DST rules for the coming years
Cuba: Doing DST in 2013.
Chili: Will do DST in 2013 as it seems
2013-03-15 01:01:14 +00:00
Lawrence Stewart 083a7ad761 MFC r247906:
The hashmask returned by hashinit() is a valid index in the returned hash array.
Fix a siftr(4) potential memory leak and INVARIANTS triggered kernel panic in
hashdestroy() by ensuring the last array index in the flow counter hash table is
flushed of entries.
2013-03-11 06:17:46 +00:00
Marius Strobl d90288dbd3 MFC: r247632
- Complete r231621 (MFC'ed to stable/7 in r232094) by also blacklisting the
  bridge used by VMware for PCIe devices. While at it, update the comment
  now that we know that MSI-X doesn't work with ESXi 5.1 for Intel 82576
  either and the underlying issue is a bug in the MSI-X allocation code of
  the hypervisor.
  Reported by: Harald Schmalzbauer
- Make the nomatch table const.
2013-03-08 12:59:06 +00:00
Xin LI 09805e3614 MFC r247334:
Correct a typo introduced in r153575, which gives inverted logic when
handling blocking semantics when seeding.

PR:		kern/143298
Submitted by:	James Juran <james juran baesystems com>
Reviewed by:	markm
2013-03-01 00:46:41 +00:00
Giorgos Keramidas 29ee6d90cb MFH r247014, r247050 and r247051.
Add a sample program that shows how a custom comparison function and
qsort(3) can work together to sort an array of integers.

PR:             docs/176197
Submitted by:   Fernando, fapesteguia at opensistemas.com
		Christoph Mallon, christoph.mallon at gmx.de
Approved by:    gjb (mentor), remko (mentor)
2013-02-25 19:09:41 +00:00
Gregory Neil Shapiro 1b062a300e MFC: Merge sendmail 8.14.6 errata issue 2013-02-21 22:48:25 +00:00
Mark Johnston 72f8897082 MFC r239672 (by rrs):
This small change takes care of a race condition
  that can occur when both sides close at the same time.
  If that occurs, without this fix the connection enters
  FIN1 on both sides and they will forever send FIN|ACK at
  each other until the connection times out. This is because
  we stopped processing the FIN|ACK and thus did not advance
  the sequence and so never ACK'd each others FIN. This
  fix adjusts it so we *do* process the FIN properly and
  the race goes away ;-)

Approved by:	rrs
Approved by:	emaste (co-mentor)
2013-02-19 16:40:38 +00:00
Dimitry Andric 6ae39da3ac MFC r246875:
Import change 40eebf235370b6fe6353784ccf01ab92eed062a5 from upstream wpa:

  From: Jouni Malinen <[email protected]>
  Date: Fri, 15 Jul 2011 13:42:06 +0300
  Subject: [PATCH] MD5: Fix clearing of temporary stack memory to use correct length

  sizeof of the structure instead of the pointer was supposed to be used
  here. Fix this to clear the full structure at the end of MD5Final().

Found by:	clang ToT
Reviewed by:	rpaulo
2013-02-19 08:07:11 +00:00
Dimitry Andric 55acd28844 MFC r246874:
Fix two instances of undefined behaviour in contrib/nvi.

Found by:	clang ToT
Obtained from:	NetBSD
Reviewed by:	jh
2013-02-19 07:55:53 +00:00
Dimitry Andric 16616fa0dd MFC r246873:
In contrib/opie/opiekey.c, use the correct length to zero the secret.

Found by:	clang ToT
Reviewed by:	delphij
2013-02-19 07:50:10 +00:00
Dimitry Andric 25d2268acb MFC r246860:
Fix undefined behaviour in usr.bin/mail/util.c.

Reported by:	[email protected]
2013-02-18 22:03:04 +00:00
Dag-Erling Smørgrav d4cee66c1a MFH r246362: remove political propaganda 2013-02-05 14:55:33 +00:00
Xin LI 6e53d57ac5 MFC r243779 (marcel):
Protect against DoS attacks, such as being described in CVE-2010-2632.
The changes were derived from what has been committed to NetBSD, with
modifications. These are:

1.  Preserve the existsing GLOB_LIMIT behaviour by including the number
    of matches to the set of parameters to limit.
2.  Change some of the limits to avoid impacting normal use cases:
    GLOB_LIMIT_STRING - change from 65536 to ARG_MAX so that glob(3)
        can still provide a full command line of expanded names.
    GLOB_LIMIT_STAT - change from 128 to 1024 for no other reason than
        that 128 feels too low (it's not a limit that impacts the
        behaviour of the test program listed in CVE-2010-2632).
    GLOB_LIMIT_PATH - change from 1024 to 65536 so that glob(3) can
        still provide a fill command line of expanded names.
3.  Protect against buffer overruns when we hit the GLOB_LIMIT_STAT or
    GLOB_LIMIT_READDIR limits. We append SEP and EOS to pathend in
    those cases. Return GLOB_ABORTED instead of GLOB_NOSPACE when we
    would otherwise overrun the buffer.

This change also modifies the existing behaviour of glob(3) in case
GLOB_LIMIT is specifies by limiting the *new* matches and not all
matches. This is an important distinction when GLOB_APPEND is set or
when the caller uses a non-zero gl_offs. Previously pre-existing
matches or the value of gl_offs would be counted in the number of
matches even though the man page states that glob(3) would return
GLOB_NOSPACE when gl_matchc or more matches were found.

The limits that cannot be circumvented are GLOB_LIMIT_STRING and
GLOB_LIMIT_PATH all others can be crossed by simply calling glob(3)
again and with GLOB_APPEND set.

The entire description above applies only when GLOB_LIMIT has been
specified of course. No limits apply when this flag isn't set!

Obtained from: Juniper Networks, Inc
2013-02-05 09:53:32 +00:00
Xin LI dcbb770ce9 MFC r243758 (marcel):
In globextend() when the pathv vector cannot be (re-)allocated, don't
free and clear the gl_pathv pointer in the glob_t structure. Such
breaks the invariant of the glob_t structure, as stated in the comment
right in front of the globextend() function. If gl_pathv was non-NULL,
then gl_pathc was > 0. Making gl_pathv a NULL pointer without also
setting gl_pathc to 0 is wrong.

Since we otherwise don't free the memory associated with a glob_t in
error cases, it's unlikely that this change will cause a memory leak
that wasn't already there to begin with. Callers of glob(3) must
call globfree(3) irrespective of whether glob(3) returned an error
or not.

MFC r243759 (marcel):

In globextend(), take advantage of the fact that realloc(NULL, size) is
equivalent to malloc(size). This eliminates the conditional expression
used for calling either realloc() or malloc() when realloc() will do
all the time.
2013-02-05 09:50:33 +00:00
Eitan Adler 2010b09c09 MFC r243930:
Constify where possible

Approved by:	cperciva (mentor, implicit)
2013-02-04 00:34:35 +00:00
Eitan Adler 4881953735 MFC r243931:
Avoid the creation of a temporary object by using the prefix operator
	for non-primitive types.

Approved by:	cperciva (mentor, implicit)
2013-02-02 23:31:10 +00:00
Eitan Adler 8b120df8b9 MFC r244122:
Remove 'dangerous' instructions from the example make.conf.
	Clarify when and why these might be used and that this isn't a supported
	configuration.

PR:		docs/144488
Approved by:	cperciva (mentor, implicit)
2013-02-02 23:22:31 +00:00
Sean Bruno 763c703a80 MFC r245459
Satisfy the intent of kern/151564: [ciss] ciss(4) should increase
  CISS_MAX_LOGICAL to 107

  Submitter wanted to increase the number of logical disks supported by ciss(4)
  by simply raising the CISS_MAX_LOGICAL value even higher.  Instead, consult
  the documentation for the raid controller (OPENCISS) and poke the controller
  bits to ask it for how many logical/physical disks it can handle.

  Revert svn R242089 that raised CISS_MAX_LOGICAL to 64 for all controllers.

  For older controllers that don't support this mechanism, fallback to the old
  value of 16 logical disks.  Tested on P420, P410, P400 and 6i model ciss(4)
  controllers.

  This should will be MFC'd back to stable/9 stable/8 and stable/7 after the MFC
  period.
2013-01-31 21:53:55 +00:00
Marius Strobl a86649867c MFC: r241875
Remove support for using Giant for locking within mpt(4). Finer grained
locking has been working fine for ~5.5 years by now.
2013-01-27 17:24:50 +00:00
Marius Strobl 1ac81e501e MFC: r241875
Remove support for using Giant for locking within mpt(4). Finer grained
locking has been working fine for ~5.5 years by now.
2013-01-27 17:16:07 +00:00
Marius Strobl 7630d7def8 MFC: r241874
After r241858 (MFC'ed to stable/7 in r242287), remove the remainder of
FreeBSD ~4 support from mpt(4).
2013-01-27 17:13:21 +00:00
Hajimu UMEMOTO f5e980f22e MFC r245225, r245256: Restrict use of source address selection
of getipnodebyname(1) only to IPv6 address.
2013-01-17 17:08:10 +00:00
Erwin Lansing c3b5593a7c MFC r245034
Update with new IPv4 address for D root.

        Approved by:    delphij (mentor)
2013-01-08 08:59:39 +00:00
Peter Wemm d56a801f62 MFC 245107: use full domain name 2013-01-06 19:27:07 +00:00
Mark Johnston a9e01b30f8 - Add IFT_L2VLAN (vlan(4)) support.
- Add a -P option to support PID files. When -a is specified
  /var/run/rarpd.pid is used by default, and when an interface is
  specified /var/run/rarpd.<ifname>.pid is used by default.

Approved by:	hrs, emaste (co-mentor)
2013-01-05 22:56:16 +00:00
Warren Block 20ab0322cb MFC r242697,r242704:
r242697:
Add devd.conf(5) and devd(8) to SEE ALSO xrefs.  Give users a pointer to
seemingly mysterious actions that are not done by ifconfig itself, but
by devd triggering on events caused by ifconfig.

r242704:
Remove fifteen-year-old notes on media selection (suggested by simon@).
Add commas after "e.g." and "i.e.".

PR:		docs/173405
2013-01-03 21:37:17 +00:00
Gregory Neil Shapiro 3cf0a65a36 MFC: Minor changes to force commit these files so new freebsd*.cf files are
built to use the new sendmail-8.14.6/cf tree.

     While here, update DNSBL link once again.
2013-01-01 18:55:49 +00:00
Gregory Neil Shapiro e922c985ae MFC: Update import info based on recent experiences and sendmail 8.14.6 import. 2013-01-01 18:48:32 +00:00
Gregory Neil Shapiro a94fbdb482 MFC: Merge sendmail 8.14.6 2013-01-01 18:30:57 +00:00
Dimitry Andric 9c4cb9047d MFC r244600:
Fix a bug in ld --gc-sections: it strips out .note sections, while it
should never do so.  This can cause global constructors and destructors
to not be executed at run-time, resulting in crashes and other strange
behaviour.

Reported by:	rene
2012-12-31 14:21:51 +00:00
Bjoern A. Zeeb d7b742f48f MFC 244900:
Happy New Year 2013!
2012-12-31 12:11:14 +00:00
Mark Johnston 8b021e3f9e MFC 244523:
- Make sure that errno isn't modified before calling logerror() in error
  conditions.
- Don't check for AF_INET6 when compiled without INET6 support.

Approved by:	emaste (co-mentor)
2012-12-31 03:35:09 +00:00
Mark Johnston ccc5462304 MFC r244522: Don't reload syslogd after rotating sendmail.st.
Approved by:	emaste (co-mentor)
2012-12-31 03:34:30 +00:00
Gregory Neil Shapiro a722d6da7b MFC: Add missing closing quote on commented out example 2012-12-30 15:38:06 +00:00
Gregory Neil Shapiro da83a5305e MFC: Properly define true/false when defining __bool_true_false_are_defined
for filters which pull in mfapi.h before stdbool.h.  Issue reported by
     Petr Rehor, maintainer of amavisd-milter port.
2012-12-29 19:13:16 +00:00
Eitan Adler 35c6b5d5db MFC r244037:
Add check for failure of mkstemp and setenv.

Approved by:	cperciva (implicit)
2012-12-20 18:13:04 +00:00
Eitan Adler ff2e6c79d8 MFC r242996:
Add support for CIR1000 - Cirrus Logic V34 to the sio driver

PR:		kern/44267
Approved by:	cperciva (implicit)
2012-12-20 04:16:25 +00:00
Eitan Adler 15b98f9bee MFC r244318:
Minor wording improvments to some manual pages

Approved by:	cperciva (implicit)
2012-12-20 00:32:43 +00:00
Eitan Adler 4f9db546a0 MFC r243891:
Add ability to mergemaster to permit the user to type
	the absolute path to PAGER if mergemaster can not find
	the one already set.

Approved by:	cperciva (implicit)
2012-12-20 00:30:48 +00:00
Eitan Adler f401c05986 MFC r243894:
Remove useless check for NULL prior to free.

Approved by:	cperciva (implicit)
2012-12-20 00:28:51 +00:00
Eitan Adler f60b4e7de9 MFC r243892:
Remove pointless check for the existence of /usr/bin/less which exists
	in all configurations.

Approved by:	cperciva (implicit)
2012-12-20 00:26:47 +00:00
Dimitry Andric b2cef0ca0a MFC r243907:
Fix an old bug in devd, where it uses std::sort() to sort the various
lists it reads from its configuration files on the priority field.

Because some items in the lists have the same priority, and std::sort()
is not stable, the exact order in which the items are enumerated does
not have to correspond to the order they appear in the configuration
files.

Apparently this was never noticed with libstdc++, but with libc++ it
could cause the "uhid" entry from /etc/devd/usb.conf to be used instead
of the "ums" entry (which is earlier in the file).  This caused the
problem described in the PR: the USB mouse module was never loaded, and
the other actions (such as starting moused) were not executed.

To fix the problem, make devd use std:stable_sort() instead.

Reported by:	Jan Beich <[email protected]>
PR:		bin/172958
2012-12-19 12:20:04 +00:00
Eitan Adler 152d3bbb23 MFC r243320,r243474:
Add 'w' flag to:

	Use whitespace (spaces and tabs) as the delimiter.
	Consecutive spaces and tabs count as one single field
	separator.
Approved by:	cperciva (implicit)
2012-12-16 17:01:23 +00:00
Eitan Adler 034670dfdb MFC r227162:
Add missing static keywords to cut(1)

Approved by:	ed
Approved by:	cperciva (implicit)
2012-12-16 16:59:44 +00:00
Eitan Adler 47f46307b1 MFC r236866,r236867:
- Consistenly mention columns and fields
	- Add -b to short error messages

Approved by:	kevlo
Approved by:	cperciva (implicit)
2012-12-16 16:55:59 +00:00
Eitan Adler 2bf2cc9d6f MFC r244017:
Sync with Library of Congress list.

Approved by:	cperciva (implicit)
2012-12-15 14:36:41 +00:00
Eitan Adler 01af33fe73 MFC r243899:
Use Bernard Baruch's full name.

	The words "old than" seem to be quoted as "older than" by some sources,
	so use the more likely and grammatically correct text.

PR:		docs/173868
Approved by:	cperciva (implicit)
2012-12-15 14:34:33 +00:00
Baptiste Daroussin dc86b17ab8 MFC r243021:
return ERANGE if the buffer is too small to contain the login as documented in
the manpage

Reviewed by:	cognet, kib
2012-12-14 08:54:52 +00:00
Remko Lodder d3f2817d10 MFC r232639
Original commit:
  Add support for the MosChip MCS9904 four serial ports
  controller.

  PR:	 165804
  Submitted by:	Eugene Grosbein
  MFC after:	1 week
2012-12-12 07:24:37 +00:00
Jim Harris f513291307 MFC r243904:
Don't call bus_dmamap_load in CAM_DIR_NONE case, since there is nothing
to map, and technically this isn't allowed.

Functionally, it works OK (at least on x86) to call bus_dmamap_load with
a NULL data pointer and zero length, so this is primarily for correctness
and consistency with other drivers.

While here, remove check in isci_io_request_construct for nseg==0.
Previously, bus_dmamap_load would pass nseg==1, even for case where
buffer is NULL and length = 0, which allowed CAM_DIR_NONE CCBs
to get processed.  This check is not correct though, and needed to be
removed both for the changes elsewhere in this patch, as well as jeff's
preliminary bus_dmamap_load_ccb patch (which uncovered all of this in
the first place).
2012-12-12 00:39:54 +00:00
Eitan Adler fdc7c5f020 MFC r243238:
Standardize EXIT STATUS instructions in man pages when possible.

Approved by:	cperciva (implicit)
2012-12-10 02:44:46 +00:00
Eitan Adler cfdd07b081 MFC r243077:
Fix error code if file isn't readable.

Approved by:	cperciva (implicit)
2012-12-10 02:35:20 +00:00
Eitan Adler 9eebebadf0 MFC r243084:
Add support for a -q flag.  While here make the custom argument parsing
	use getopt instead of hacking on it more.  This change also fixes the
	method of silencing the compiler warning about gfn being used
	uninitialized.

Approved by:	cperciva (implicit)
2012-12-10 02:33:16 +00:00
Eitan Adler 8bf9aba9c3 MFC r243893:
Remove hack to emulate effective uid and just use the EUID's name in the
	first place.  I was unaware of this option when originally committing
	this change.

	I accidently merged this to only one directory last time :(

Approved by:	cperciva (implicit)
2012-12-08 00:28:16 +00:00
Eitan Adler 3287edec11 MFC r243893:
Remove hack to emulate effective uid and just use the EUID's name in the
	first place.  I was unaware of this option when originally committing
	this change.

Approved by:	cperciva (implicit)
2012-12-08 00:25:51 +00:00
Xin LI 0c8e67f54a MFC r242519:
Replace log(3) with flsll(3) for watchdogd(8) and drop libm dependency.
2012-12-03 18:31:33 +00:00
Xin LI 5cb9be7e85 MFC r242728:
ICMPV6_FILTER should read ICMP6_FILTER.

Submitted by:	Frédéric Perrin <frederic.perrin resel.fr>
2012-12-03 18:21:29 +00:00
Eitan Adler 23610ac83f MFC r243155:
Correct spelling of "lily" [0]
	Correct spelling of Camellia

PR:		misc/173655 [0]
Approved by:	cperciva (implicit)
2012-12-03 01:02:45 +00:00
Chris Rees d617f1213c MFC r242183:
Allow spaces in _chroot

Approved by:	hrs
2012-12-01 15:54:54 +00:00
Hajimu UMEMOTO c4224cbe08 MFC r243649: cyrus-sasl 2.1.26 was released. In this version, the type
of callback functions was changed from "unsigned long" to "size_t".
2012-12-01 11:12:04 +00:00
Eitan Adler 983f44b391 MFC r243078:
Add deviceid to the disk output on boot to help debugging.

PR:		kern/173290
Approved by:	cperciva (implicit)
2012-11-30 03:38:01 +00:00
Peter Jeremy d435e1e243 MFC r241708: Explicitly specify 'np' so that getty(8) does not
simulate even parity on local.9600.

PR:		76226
Approved by:	jhb (mentor)
2012-11-27 19:35:21 +00:00
Eitan Adler 4218099a67 MFC r243072:
Follow the behavior as specified in POSIX:

	if (exists AND (NOT f_option) AND
		((not_writable AND input_is_terminal) OR i_option))
			prompt

	in particular, add the test for input_is_terminal

PR:		bin/173039
Approved by:	cperciva (implicit)
2012-11-26 05:13:57 +00:00
Jaakko Heinonen bab0c3cc76 MFC r235143 by kib:
Plug a leak.

PR:		167068
Tested by:	Oliver Pinter
2012-11-24 08:33:27 +00:00
Remko Lodder 39b29a319b MFC r232486
Add an ifconfig carp option that enables users to set
the state of the carp cluster.

This is a direct commit to stable/9 because -HEAD's
code is very different. I discussed this with Gleb
and the reason for this is that since we do not
touch the kernel itself and are not adding very
weird or confusing things, we can commit this to the
stable branch directly.

The options 'master' and 'backup' are now available,
which enables the administrator to force a node into
the backup or master state on the cluster. Ofcourse
preempt has to be disabled otherwise the master node
will become master again.

One can do that with:

sysctl net.inet.carp.preempt=0

After that one can schedule maintenance on the node
normally running as the master and such.

PR:	 100956
Discussed with:	glebius
2012-11-23 21:29:08 +00:00
Simon L. B. Nielsen 0bc54cefa0 Fix multiple Denial of Service vulnerabilities with named(8).
Fix insufficient message length validation for EAP-TLS messages.

Fix Linux compatibility layer input validation error.

This commit includes stable/7 which was missed in r243417.

Security:	FreeBSD-SA-12:06.bind
Security:	FreeBSD-SA-12:07.hostapd
Security:	FreeBSD-SA-12:08.linux
Security:	CVE-2012-4244, CVE-2012-5166, CVE-2012-4445, CVE-2012-4576
Approved by:	re
Approved by:	security-officer
2012-11-22 23:15:38 +00:00
Eitan Adler 23b7675898 MFC r243000:
Add support for CIR1000 - Cirrus Logic V34 to the uart driver

Approved by:	cperciva (implicit)
2012-11-21 01:01:19 +00:00
Eitan Adler 1fff27426e MFC r243241:
Modernize parts of the ports.7 manual page.

Approved by:	cperciva (implicit)
2012-11-21 00:40:26 +00:00
Eitan Adler d35638c14b MFC r243240:
Use the macro for standard error return values.

	.Dd not bumped because there is no important content change.

Obtained from:	DragonflyBSD
Approved by:	cperciva (implicit)
2012-11-21 00:31:57 +00:00
Eitan Adler 97bfdef1b0 MFC r243081:
Avoid possible null deref if ypclnt_new returns null

PR:		bin/172979
Approved by:	cperciva (implicit)
2012-11-19 04:08:20 +00:00
Dimitry Andric 715459b3ff MFC r243037:
Fix a bug in aicasm_gram.y, noted by a newer clang 3.2 snapshot: it
compared an enum scope_type against a yacc-generated define, so the
condition would always be false.
2012-11-17 23:44:01 +00:00
Baptiste Daroussin 45af412bba MFC r243022:
small style fix
2012-11-15 18:05:38 +00:00
Eitan Adler 2e9c5640ac MFC r242814:
Add support for Advantech PCI-1602 RS-485/RS-422 serial card

PR:		kern/169726
Approved by:	cperciva (implicit)
2012-11-14 00:34:10 +00:00
Edwin Groothuis 20ba338a6f Merge of current of tzdata2012j
- Libya went to Standard Time on 10 November 2012
2012-11-13 21:15:11 +00:00
Edwin Groothuis ef4f7dc8ca Merge of current of 242925, tzdata2012i
- Cuba is changing back to Standard Time on 4 November 2012.
2012-11-12 20:47:35 +00:00
Baptiste Daroussin 5795aa2c9b MFC: r241107, r241108
Remove useless atoi(3), previous strspn(3) makes sure that a_name->val is a
number.
This also allow pw user show to work as expected.

PR:		bin/172112
Submitted by:	Ilya A. Arkhipov <[email protected]>
2012-11-12 14:19:05 +00:00
Eitan Adler 9d1e9940ac MFC r242583:
Add support for a few more devices:

	PNP0510 and FUJ02E5 for a  "Wacom Tablet at FuS Lifebook T"
	PNP0502 and PNP0511 for some other generic devices.

PR:		kern/173357
Approved by:	cperciva (implicit)
2012-11-11 04:07:10 +00:00
Eitan Adler 978c21c1ac MFC r242462:
10 years too late add support for "2.88MB 3.5in Extra High Density"
	floppies.

	Its unlikely that anyone actually uses these or cares about these
	anymore, since we support other floppy types and this change doesn't
	hurt - just add it.

PR:		conf/40777
Arrival-Date:	Fri Jul 19 08:50:02 PDT 2002
Approved by:	cperciva (implicit)
2012-11-09 00:35:55 +00:00
Eitan Adler 7a3f86bba4 MFC r242514,r242541:
Revert the change that makes less default.

	Since I've committed this I've receieved roughly an equal
	amount of email thanking me for making this change
	and asking me to revert it.

	I've resisted making this change because
	new users tend to prefer less over more
	and these users are the least likely to know
	how to change the PAGER on their own.

Requested by:	many
Objected to:	just as many
Decision made by:	core

====
	Change default prompt to show ~ again for the home directory

Approved by:	cperciva (implicit)
2012-11-06 00:55:43 +00:00
Dag-Erling Smørgrav f0b1d3961e MFH r225599: fix resume logic 2012-11-05 13:02:34 +00:00
Dag-Erling Smørgrav b5bfb64f8a MFH r225815 (partial): adjust copyright statement 2012-11-05 12:58:44 +00:00
Dag-Erling Smørgrav 6b01f56572 MFH r240496: use libmd if and only if OpenSSL is not available 2012-11-05 12:42:24 +00:00
Dag-Erling Smørgrav d1d00dd579 MFH r221820, r221821, r221822: increase WARNS
MFH r221830: mark all descriptors close-on-exec
MFH r225813: man page fixes
MFH r225814: adjust copyright statement
MFH r226537: latin1 -> utf8
MFH r230307, r230478: fix SIGINFO infinite loop and data loss
MFH r233648: man page fixes
MFH r234138: support percent-encoded user and password
MFH r234837: avoid busy-loop on slow connections
MFH r234838: don't reuse credentials when redirected to another host
MFH r236193: avoid SIGPIPE on network connections
MFH r240496: use libmd if and only if OpenSSL is not available
2012-11-05 10:54:14 +00:00
Eitan Adler af7a9fb032 MFC r241844:
remove duplicate semicolons where possible.

Approved by:	cperciva (implicit)
2012-11-04 01:20:00 +00:00
Eitan Adler 33dff2c336 MFC r242452:
The test fails with "exit 1" if /usr/games/fortune doesn't actually
	exist.  Fix that.

PR:		conf/71994
Approved by:	cperciva (implicit)
2012-11-04 00:30:42 +00:00
Navdeep Parhar 082af1f797 MFC r242087:
Initialize the response queue mutex a bit earlier to avoid a panic that
occurs if t3_sge_alloc_qset fails and then t3_free_qset attempts to
destroy an uninitialized mutex.
2012-10-30 19:34:45 +00:00
Matthew D Fleming c1a1e3d655 MFC r242152:
Const-ify the zone name argument to uma_zcreate(9).
2012-10-30 17:05:47 +00:00
Eitan Adler df95fbea95 MFC r241857:
Add support for the "&" character in usernames.

	Charlie & finally has his last name.

PR:		gnu/37910
Approved by:	cperciva (implicit)
2012-10-30 03:21:31 +00:00
Eitan Adler f565eec409 MFC r241855:
Update the kill(2) and killpg(2) man pages to the modern permission
	checks. Also indicate killpg(2) is POSIX compliant.

Approved by:	cperciva (implicit)
2012-10-29 04:51:51 +00:00
Eitan Adler c8b6dde4ef MFC r242136:
Prefer an example users born after myself might use.

Approved by:	cperciva (implicit)
2012-10-29 04:21:17 +00:00
Eitan Adler 184190f858 MFC r241841:
Implement HTTP 305 redirect handling.

PR:		172452
Approved by:	cperciva (implicit)
2012-10-29 04:18:34 +00:00
Eitan Adler 8e61483447 MFC r241840:
Don't deny non-temporary redirects if the -A option is set (per
	the man page) [0]

	While here add support for draft-reschke-http-status-308-07

PR:		172451 [0]
Approved by:	cperciva (implicit)
2012-10-29 04:16:52 +00:00
Eitan Adler 8f9a440270 MFC r241858:
Remove unused code since the 5.x days

Approved by:	cperciva (implicit)
2012-10-29 04:09:21 +00:00
Eitan Adler b0d6456689 MFC r241855,r241859:
Update the kill(2) and killpg(2) man pages to the modern permission
	checks. Also indicate killpg(2) is POSIX compliant.

	Correct the killpg(2) return values:

	Return EPERM if processes were found but they
	were unable to be signaled.

	Return the first error from p_cansignal if no signal was successful.

Discussed with:	jilles
Approved by:	cperciva (implicit)
2012-10-29 03:52:19 +00:00
Gavin Atkinson 8a605e8458 Merge r240680 from head:
Align the PCI Express #defines with the style used for the PCI-X
  #defines.  This has the advantage that it makes the names more
  compact, and also allows us to correct the non-uniform naming of
  the PCIM_LINK_* defines, making them all consistent amongst themselves.

  This is a mostly mechanical rename:
    s/PCIR_EXPRESS_/PCIER_/g
    s/PCIM_EXP_/PCIEM_/g
    s/PCIM_LINK_/PCIEM_LINK_/g

  In this MFC, #defines have been added for the old names to assist
  merges and out-of-tree drivers.
2012-10-28 13:21:35 +00:00
Edwin Groothuis 3ee0defb87 Merge of current of tzdata2012h, r242208
- Bahia no longer has DST.
- Tocantins has DST.
- Israel has new DST rules next year.
- Jordan stays on DST this winter.
2012-10-28 09:16:55 +00:00
Eitan Adler cf72bce83f MFC r241848:
Check the return error of set[e][ug]id. While this can never fail in the
	current version of FreeBSD, this isn't guarenteed by the API.
	Custom security modules, or future implementations of the setuid and
	setgid may fail.

Approved by:	cperciva (implicit)
2012-10-27 01:20:48 +00:00
Eitan Adler 67bdb34b41 MFC r241845,r241934:
Sysinstall has been removed from base.

MFC farther back to maintain consistency

Approved by:	cperciva (implicit)
2012-10-26 00:35:30 +00:00
Xin LI 595d24ac68 MFC r240210:
It seems that what the code really meant is that when a write is completed,
do a BUS_DMASYNC_POSTWRITE over the DMA map.  The way it currently is would
only do POSTREAD for read transactions.

Submitted by:	Sascha Wildner
2012-10-26 00:32:28 +00:00
Eitan Adler b314f7b0b2 MFC r241847:
Free buf when its no longer used. This helps eliminate a static analysis
	warning.

PR:		ports/172566
Approved by:	cperciva (implicit)
2012-10-25 03:27:53 +00:00
Eitan Adler d05a7fc6d8 MFC r241846:
bcd isn't installed setuid.
	caesar isn't installed setuid.

For the archaeologists:
	it seems this call originally came from NetBSD PR 5970 and 5945

PR:		172566
Approved by:	cperciva (implicit)
2012-10-25 03:20:01 +00:00
Eitan Adler 0c412fcb36 MFC r241893:
Update re members to reality

Approved by:	cperciva (implicit)
2012-10-25 03:17:03 +00:00
Eitan Adler 14314b232a MFC r241849:
Fix typo in error when unable to create TCP socket

PR:		bin/172490
Approved by:	cperciva (implicit)
2012-10-25 03:14:17 +00:00
Eitan Adler 5690bf59e7 MFC r241834:
Make do_uniq work with python3

Approved by:	cperciva (implicit)
2012-10-25 03:12:34 +00:00
Eitan Adler 00cbfc7689 MFC r241839:
Be a bit more lenient in the maximum number of redirects allowed.
	Chrome and Firefox have a limit of 20. IE has a limit of 8.

Approved by:	cperciva (implicit)
2012-10-25 03:11:18 +00:00
Eitan Adler 6bb2371b52 MFC r241838:
Remove unused variable. Newer versions of gcc care.

Approved by:	cperciva (implicit)
2012-10-25 01:23:42 +00:00
Eitan Adler 8eec1e8c43 MFC r241829:
Fix conditional expression: previously a bit vector was being operated
	on by a logical not instead of the entire expression.

Approved by:	cperciva (implicit)
2012-10-25 01:20:20 +00:00
Edwin Groothuis 4b7ce96f70 Merge of 241869
Import of tzdata2012g

 - Fix end of DST in Gaza and Hebron
 - Western Samoa: DST start at 30 Septembet 2012 and finished at 7 April 2013.
2012-10-22 10:30:04 +00:00
Eitan Adler 16f6015880 MFC r241613:
Add support for samsung HM250JI

PR:		usb/121474
Approved by:	cperciva (implicit)
2012-10-19 00:32:18 +00:00
Eitan Adler 2c6c75ef79 MFC r241602:
Add a bunch more example completions.
Approved by:	cperciva (implicit)
2012-10-19 00:26:22 +00:00
Eitan Adler 4387a07e91 MFC r241581:
Fix minor nits:
	use a comma after "i.e."
	sentences begin on new lines.

	No .Dd bump for trivial modification.

Approved by:	cperciva (implicit)
2012-10-18 01:14:22 +00:00
Eitan Adler 3b84d5747f MFC r241580:
Add support for the USB DISK Pro PMAP.

	This patch has sit for 6 years in the PR database.

PR:		usb/96381
Approved by:	cperciva (implicit)
2012-10-18 01:12:15 +00:00
Peter Wemm 9680f91e7e mx1 -> smarthost.ysv 2012-10-15 14:16:01 +00:00
Eitan Adler 097913de1d MFC r241373:
Remove undefined behavior from sranddev() and
	srandomdev(). This doesn't actually work
	with any modern C compiler:

	In particular, both clang and modern gcc
	verisons silently elide any xor operation
	with 'junk'.

Approved by:	cperciva (implicit)
2012-10-12 02:12:53 +00:00
Eitan Adler 4695cf6032 MFC r240389,r240409:
- 	Add support for ipv6 addresses as destination
- 	Add documentation for IPv6 support

PR:		docs/171580
Approved by:	cperciva (implicit)
2012-10-12 02:10:27 +00:00
Peter Wemm 449c6036ee Switch freebsd.org nullhost cluster machines from hub to mx1 2012-10-11 20:52:23 +00:00
Eitan Adler c994b93ce9 MFC r241118:
Implement the Sun/GNU extension of using a default
	prefix when no arguments are supplied.

Approved by:	cperciva (implicit)
2012-10-10 21:21:54 +00:00
Eitan Adler b3e2afbd24 MFC r241117:
add SG state type

PR:		bin/171664
Approved by:	cperciva (implicit)
2012-10-10 21:20:34 +00:00
Jim Harris 1fca0ce862 MFC r240695:
Add constants for programming interfaces for NVM/solid state storage
controller sub-class code.

Reference:  PCI Code and ID Assignment Specification Rev 1.2
2012-10-09 20:07:24 +00:00
Sean Bruno 8243e64200 MFC r240879
This patch fixes a nit in the em, lem, and igb driver statistics.  Increment
adapter->dropped_pkts instead of if_ierrors because if_ierrors is
overwritten by hw stats collection.

Submitted by: Andrew Boyer <[email protected]>
Reviewed by:  Jack F Vogel <[email protected]>
2012-10-09 18:02:09 +00:00
David E. O'Brien f1a6788089 MF8: r241368:
MF9: r237100: MFC r236338, r236339, r236346, r236347, r236365, & r236977
    * Deprecate the FreeBSD 10's make's ":U" (to-upper case) and ":L"
      (to-lower case) modifiers for ":tu" and ":tl".
    * make it easier to test newly-built make.
    * Add "-V '${VAR}'" variable expansion from Portable Berkeley Make.
    * regression test for '-V' command line option and the :t[lu] modifiers.
  MF9: r241364: Update MAKE_VERSION for r237100.
  MFC: r201225: add missing `void' keyword.
2012-10-09 13:21:08 +00:00
Doug Barton 0f17a85a77 MFC r241218:
Remove references to CVS so that people will stop bringing it up

For -p:
	The localtime update should have been excluded in the first place

	The make.conf comparison has been OBE for some time now, and there
	is no src.conf equivalent to share/examples/make.conf, so remove
	the whole thing.

Update copyright
2012-10-08 05:51:47 +00:00
Eitan Adler 2eca737df7 MFC r241116:
Correct the tip about finding all the directories on the system
	Add a tip about clearing the screen.
	Make things more consistent by removing quotes around 'make search'

Approved by:	cperciva (implicit)
2012-10-05 22:42:57 +00:00
Doug Barton d09766261f MFC r229822:
There is no longer a need to abstract ${rcvar_manpage} as we are not
attempting to maintain compatibility with NetBSD for some years now.
2012-10-04 22:32:27 +00:00
Doug Barton 2725e0deaf MFC r240090:
Improve file rotation
2012-10-04 22:24:14 +00:00
Doug Barton de9ffcf7e0 MFC r238879:
Add a couple of nice quotes from Edward Everett Hale
2012-10-04 22:16:58 +00:00
Eitan Adler 8bff3236e4 MFC r241115:
Indicate (loudly) that ports csup is going away.

	While here clarify some other portions.

Approved by:	cperciva (implicit)
2012-10-04 01:37:12 +00:00
Eitan Adler abdf44179d MFC r241062:
clarify the wording for 'first' and 'last'

Approved by:	cperciva (implicit)
2012-10-04 01:33:49 +00:00
Gavin Atkinson 6b4dff6ec7 Merge the following from head:
r240694
    Add PCI subclass for NVM Express devices.

  r240699, r240739
    Recognise NVM devices and pretty-print their name.
2012-10-01 15:47:35 +00:00
Eitan Adler 749aea8bb8 MFC r240495:
Adding missing return statements during error conditions.

PR:		kern/171187
Approved by:	cperciva (implicit)
2012-09-28 01:04:10 +00:00
Mikolaj Golub 4f0e143403 MFC r240595:
In snmp_hostres, device_map table is used for consistent device table
indexing. When a device has gone it is not removed from device_map
table but just its entry_p field is set to NULL.

So when traversing device_map in disk_OS_get_ATA_disks() and
disk_OS_get_MD_disks() check for entry_p being NULL, otherwise the
bsnmpd crash is possible when a removed map entry is dereferenced.

Before the fix, for disk_OS_get_ATA_disks() the crash could be easily
reproduced running:

  atacontrol detach ata1

The crash was not observed in disk_OS_get_MD_disks() because currently
snmp_hostres does no see md(4) disks: to get the device list it uses
devinfo(3), which does not return md devices.

Reported by:  Miroslav Lachman 000.fbsd quip.cz
2012-09-27 18:53:59 +00:00
Eitan Adler 7622a8c9ab MFC r240470:
Remove scripts and tools which only functioned when src was using CVS

Approved by:	cperciva (implicit)
2012-09-25 01:31:30 +00:00
Eitan Adler 60dda1c147 MFC r240466:
Define missing DEBUGOUT# macros. DEBUGOUT[45] are not yet used but are
	being defined pre-emptively to avoid future build breakage

PR:		kern/168967
Approved by:	cperciva (implicit)
2012-09-25 01:28:15 +00:00
Sean Bruno 5a767851b9 MFC r238601
On BIO_ERROR, set bio_resid to stop losing data in the error case.

Submitted by: Mark Johnston <[email protected]>
2012-09-23 20:31:52 +00:00
Sean Bruno 1acae81a7b MFC r238371
When an MFI command fails, the driver needs to set bio->bio_resid so that
the upper levels notice.  Otherwise we see commands silently failing leading
to data corruption.  This mirrors dadone()

Submitted by: Andrew Boyer [email protected]
2012-09-23 20:24:24 +00:00
Sean Bruno 75b651bbe6 MFC r238373
sys/dev/mfivar.h contains references to MFI_DEBUG, but it never gets turned on
unless the file also includes opt_mfi.h.

Submitted by: Andrew Boyer [email protected]
2012-09-23 20:16:45 +00:00
Jim Harris 5236e9174d MFC r240514:
isci(4): Fix SCSI/ATA translation for SCSI_WRITE_BUFFER w/ mode==0x7
(download microcode with offsets, save, and activate).

SATI translation layer was incorrectly using allocation length instead
of blocks, and was constructing the ATA command incorrectly.

Also change #define to specify that the 512 block size here is
specific for DOWNLOAD_MICROCODE, and does not relate to the device's
logical block size.
2012-09-17 16:12:53 +00:00
Eitan Adler 4f9d8d9880 MFC r240328:
Follow up to doc r39516:

		Update the Vendor Relations Team information to reflect that
		incoming email is now handled by core@ and the Foundation.

Approved by:	cperciva (implicit)
2012-09-14 00:37:12 +00:00
Edwin Groothuis 5d3c7a701c iMFC of 240457, tzdata2012f
- Pacific/Fiji will go into DST from 21 October 2012 till 20 January 2013.
 - Fix offset for Pacific/Tokelau.
 - Gaza and West Bank had DST from 29 March to 28 September 2012.
 - Syria has DST from April till October
 - Morocco had DST from April to September 2012 except for 20 July to 20 August.
 - Cuba changed to DST from 1 April 2012 only.
 - Haiti has DST between 8 March and 1 November in 2012.

Obtained from:  ftp://ftp.iana.org/tz/releases/
2012-09-13 10:25:18 +00:00
Eitan Adler 862086296f MFC r240293:
Sync access file date recommendation
	Change from CVS to svn for canconical source of information

Approved by:	cperciva (implicit)
2012-09-13 01:05:30 +00:00
Eitan Adler e8bef81b9a MFC r237676,r237677,r237680,r240294,r240318,r240324:
Update organization.dot to reflect reality

Approved by:	cperciva (implicit)
2012-09-13 01:02:56 +00:00
Eitan Adler 0a245e0903 MFC r240316:
We moved to subversion ages ago.

Approved by:	cperciva (implicit)
2012-09-13 00:54:24 +00:00
Dimitry Andric 76102ac2d9 MFC r239872:
Teach libdwarf about the DW_FORM_flag_present dwarf attribute, so
programs using libdwarf (such as ctfconvert) don't error out on files
containing the attribute.
2012-09-12 18:18:14 +00:00
Dimitry Andric b482cfa439 MFC r239870:
Teach gdb about the DW_FORM_flag_present dwarf attribute, so it doesn't
error out on files that contain it.  (This attribute can be emitted by
newer versions of clang.)
2012-09-12 18:02:35 +00:00
Martin Matuska 1ff8d298b5 MFC r240162:
Make r230454 more readable and vendor-like.

PR:	kern/171380
2012-09-09 07:47:02 +00:00
Eitan Adler c58140b832 MFC r238202:
Remove ancient vnconfig symlink

Approved by:	cperciva (implicit)
2012-09-08 03:10:56 +00:00
Dimitry Andric f7c5db07eb MFC r239962:
Fix a twelve year old bug in readelf: when process_dynamic_segment()
encounters a DT_RUNPATH entry, the global dynamic_info[] array is
overrun, causing some other global variable to be overwritten.

In my testcase, this was the section_headers variable, leading to
segfaults or jemalloc assertions when it was freed later on.

Thanks to Koop Mast for providing samples of a few "bad" .so files.
2012-09-07 18:03:29 +00:00
Jim Harris 2491765dc5 MFC r239571:
Add -m option (for printing sampled PCs to a file) to pmcstat usage
message.
2012-09-04 17:29:35 +00:00
Jim Harris f0294f40b8 MFC r239889:
Do not call sati_check_data_io() for SATI_UNMAP sequences.

This routine is intended only for commands such as INQUIRY where
the controller may fill out a smaller amount of data than allocated
by the host.

The end result of this bug was that isci(4) would report non-zero
resid for successful SCSI_UNMAP commands.

Sponsored by:   Intel
2012-09-04 17:15:19 +00:00
Eitan Adler cab51f4c32 MFC r236596:
Fix style nit: don't use leading zero for dates in .Dd

Approved by:	cperciva (implicit)
2012-09-02 18:54:31 +00:00
Eitan Adler b356c873b3 MFC r237178,r237180:
Fix mdoc style nits

PR:		kern/168910
Approved by:	cperciva (implicit)
2012-09-02 18:44:40 +00:00
Eitan Adler 8c1965ee61 MFC r235251,r238205:
Add Spanish Dvorak keyboard model to syscons.

	(not verified to be accurate)

PR:		conf/160235
Approved by:	cperciva (implicit)
2012-09-02 18:40:11 +00:00
Eitan Adler ef549ef723 MFC r238199:
Remove variables which are initialized but never used thereafter
	reported by gcc46 warning

Approved by:	cperciva (implicit)
2012-09-02 18:33:43 +00:00
Eitan Adler 208769bcab MFC r238201:
Remove variables which are initialized but never used thereafter
	reported by gcc46 warning

Approved by:	cperciva (implicit)
2012-09-02 18:17:12 +00:00
Eitan Adler ead1e95d4a MFC r238221:
Fix always 0 tautologly revealed by gcc46

Approved by:	cperciva (implicit)
2012-09-02 18:10:31 +00:00
Eitan Adler eb1d29ca8b MFC r239076:
Add support for SIIG Cyber Serial Dual PCI 16C850

Approved by:	cperciva (implicit)
2012-09-02 18:04:06 +00:00
Eitan Adler 880206938e MFC r239047:
Remove variables which are initialized but never used thereafter
	reported by gcc46 warning

Approved by:	cperciva (implicit)
2012-09-02 18:01:16 +00:00
Bjoern A. Zeeb 062cea90ee MFC r238878:
For consistency put the IPsec comment iside the #fidef section.
2012-08-29 12:44:17 +00:00
Bjoern A. Zeeb 74044f7ed4 MFC r238877:
Fix a comment that we do not have an SA yet but need to acquire one.
2012-08-28 12:56:35 +00:00
Jim Harris 163a0fb28b MFC r239545, r239665:
Fix/add support for SCSI UNMAP to ATA DSM translation.

(Note: scsi_da does not support BIO_DELETE->SCSI_UNMAP on this
stable branch, but I am MFC'ing the changes to keep a
consistent driver across all stable releases.)

This addresses kernel panic observed when sending SCSI UNMAP
commands to SATA disks attached to isci(4).

1) Flesh out callback routines to allocate/free buffers needed for
translating SCSI UNMAP data to ATA DSM data.
2) Add controller-level pool for storing buffers previously allocated
for UNMAP translation, to lessen chance of no buffer available
under memory pressure.
3) Ensure driver properly handles case where buffer pool is empty
and contigmalloc returns NULL.
4) Clear freeze bit in isci_remote_device_release_lun_queue() before
calling xpt_release_devq to ensure that any ccbs which immediately
start during the call to xpt_release_devq() see an accurate picture
of the frozen_lun_mask.  This code path is extensively exercised
when tagged read/write commands mix with non-tagged DSM commands.

Sponsored by: Intel
2012-08-27 15:54:51 +00:00
Ed Maste 3ac15a2360 MFC r232844: Remove extraneous log message
When ntp switched between PLL and FLL mode it produced a log message
"kernel time sync status change %04x".  This issue is reported in ntp
bug 452[1] which claims that this behaviour is normal and the log
message isn't necessary.  I'm not sure exactly when it was removed, but
it's gone in the latest ntp release (4.2.6p5).

[1] http://bugs.ntp.org/show_bug.cgi?id=452
2012-08-20 19:23:32 +00:00
Xin LI 717f2453a5 MFC r238631:
Import an updated version of moduli(5) manual page from OpenBSD.
2012-08-20 18:33:23 +00:00
Xin LI 8a726d226f MFC r239169:
RFC 2289 requires all hashes be stored in little endian format before
folding to 64 bits, while SHA1 code is big endian.  Therefore, a bswap32
is required before using the value.

Without this change, the implementation does not conform to test vector
found in RFC 2289.

PR:		bin/170519
Submitted by:	Arthur Mesh <arthurmesh gmail com> (with changes)
2012-08-20 18:26:16 +00:00
Warren Block 8e038febe5 MFC r239233:
Correct description of minfree to kilobytes rather than blocks.

PR:		125921
Submitted by:	Andre Albsmeier <[email protected]>
2012-08-20 16:40:15 +00:00
John Baldwin 2dab0434c7 MFC 230547:
Add a timeout on positive name cache entries in the NFS client.  That is,
we will only trust a positive name cache entry for a specified amount of
time before falling back to a LOOKUP RPC, even if the ctime for the file
handle matches the cached copy in the name cache entry.  The timeout is
configured via a global 'vfs.nfs.name_timeout' sysctl and defaults to 60
seconds.  It may be set to zero to disable positive name caching entirely.

Note that this can result in increased NFS traffic under certain workloads.
Increasing the threshold can mitigate this somewhat.  Also, to match the
existing 'vfs.nfs.negative_name_timeout' sysctl in 7, this version uses a
sysctl rather than a mount option as in 8.x and later.

Tested by:	Mark Saad
2012-08-17 14:22:56 +00:00
Simon L. B. Nielsen 5038f5e8fe Fix named(8) DNSSEC validation Denial of Service.
Security:	FreeBSD-SA-12:05.bind
Security:	CVE-2012-3817
Obtained from:	ISC
Approved by:	so (simon)
2012-08-06 21:33:11 +00:00
John Baldwin 2e89c94eaa MFC 194358,230394,230441,230489,230552,232116,232420:
- For dotdot lookup in nfs_lookup, inline the vn_vget_ino() to prevent
  operating on the unmounted mount point and freed mount data in case of
  forced unmount performed while dvp is unlocked to nget the target vnode.
- Close a race in NFS lookup processing that could result in stale name cache
  entries on one client when a directory was renamed on another client.  The
  root cause for the stale entry being trusted is that each per-vnode nfsnode
  structure has a single 'n_ctime' timestamp used to validate positive name
  cache entries.  However, if there are multiple entries for a single vnode,
  they all share a single timestamp.  To fix this, extend the name cache
  to allow filesystems to optionally store a timestamp value in each name
  cache entry.  The NFS clients now fetch the timestamp associated with
  each name cache entry and use that to validate cache hits instead of the
  timestamps previously stored in the nfsnode.  Another part of the fix is
  that the NFS clients now use timestamps from the post-op attributes of
  RPCs when adding name cache entries rather than pulling the timestamps out
  of the file's attribute cache.  The latter is subject to races with other
  lookups updating the attribute cache concurrently.
- Adjust the nfs_skip_wcc_data_onerr setting so that it does not block
  post-op attributes for ENOENT errors now that the name caching logic
  depends on working post-op attributes.

Tested by:	Mark Saad  nonesuch longcount org
2012-07-30 19:05:41 +00:00
Eitan Adler cd508339a7 MFC r230454:
Use provided name when allocating ksid domain. It isn't really used on FreeBSD, but should fix a panic when pool is imported from another OS that is using this.

Requested by:	nox
No objections:	pjd
Approved by:	cperciva (implicit)
2012-07-24 03:46:58 +00:00
Bjoern A. Zeeb e2b8d884e1 MFC r238248:
Implement handling of "atomic fragements" as outlined in
 draft-gont-6man-ipv6-atomic-fragments to mitigate one class of
 possible fragmentation-based attacks.
2012-07-16 07:22:22 +00:00
Jaakko Heinonen c8153368b9 MFC r230642: Remove trailing whitespace. 2012-07-15 19:05:58 +00:00
Mikolaj Golub 2beca786d1 MFC r238083:
Fix RTTVAR scale in net.inet.tcp.hostcache.list sysctl.

Reviewed by:	andre
2012-07-08 19:33:20 +00:00
Benjamin Kaduk 1865d33219 MFC r237581:
Explicitly mention that setting the change and expiry times to zero is
  equivalent to leaving the time unset. [1]

  Wordsmith in the compat support section.

  Use a full path to nologin(8) in the context of setting it as a user's shell,
  keeping a separate cross-reference.

PR:		docs/169354 [1]
Approved by:	hrs (mentor)
2012-07-06 03:43:33 +00:00
Warren Block b4f43c14ab MFC r238008:
Add reference to portsnap(8).

Submitted by:	Tim Kientzle
2012-07-03 15:54:20 +00:00
Doug Barton c8a244ac7d MFC r238038:
Unfortunately the change in r237958 resulted in s/install/instclean/ due to
the aggressive pattern matching of the :C modifier. I tested build and
install in 2 phases, however with different solutions, resulting in the
breakage. Mea culpa.

The solution is to break out the all: target. This causes a few lines of
code duplication, but now the all: target works as it should, and the
other targets continue to work as they did before.

While I'm here, add a ===> header line to the start of each port build
to make it easier to find/more clear in the logs.
2012-07-02 22:19:02 +00:00
Christian Brueffer 8f654825b4 MFC: r217140
Use ether_ntoa instead of home-grown version.

PR:		169075
Submitted by:	Alexandr <[email protected]>
2012-07-02 17:48:19 +00:00
Jung-uk Kim 3757e6e071 MFC: r237657, r237658, r237666
Merge OpenSSL 0.9.8x and regen manual pages.
2012-07-02 16:24:43 +00:00
Doug Barton f3ae344512 MFC r237958:
For the ports modules building code, clean WRKDIR before building. This is
important for those that use -DNO_CLEAN routinely, since it will prevent
installing stale stuff, and even more important when the port is upgraded
to a newer version. When the user doesn't use -DNO_CLEAN, this will create
an infinitesimal amount of extra work, but won't hurt anything.

This is necessary because the ports tree has flags that prevent the ususal
'update the build if newer source files exist' logic from doing what it
would do in the base.
2012-07-02 06:52:25 +00:00
Eitan Adler a594cd1f2d MFC r237178:
attach_generic causes missing devices in /dev when the driver interacts with some non-highpoint controollers. Change attach_generic to be off by default.

PR:		kern/168910
Approved by:	cperciva (implicit)
2012-07-01 00:40:56 +00:00
Gavin Atkinson 2b12963a86 Merge r237645 from head:
The -S option, to specify the sector size, has been usable on all types
  of memory disks since r135340.  Update the man page to reflect this.

Noticed by:	avg
2012-06-30 20:23:59 +00:00
Warren Block d0141bb973 MFC r237655:
Point out that /usr/src, /usr/doc, and /usr/ports may be empty or not
exist until populated with csup(1) or svn(1).

PR:		169487
Submitted by:	Moritz Wilhelmy
2012-06-28 13:12:34 +00:00
Eitan Adler b1221df50f MFC r237286, r237523:
Don't close an uninitialized descriptor.

PR:		bin/167302
Approved by:	cperciva (implicit)
2012-06-27 06:41:10 +00:00
Xin LI d909fe3097 MFC r237339:
Polish previous revision: if the fts_* routines have lstat()'ed the
directory entry then use the struct stat from that instead of doing
it again, and skip the rm_overwrite() call if fts_read() indicated
that the entry couldn't be a regular file.

Obtained from:	OpenBSD

MFC r237284 (kevlo):

Fix potential symlink race condition in "rm -P" by adding a check
that the file we have opened is the one we expected.  Also open in
non-blocking mode to avoid a potential hang with FIFOs.

Obtained from:	NetBSD via OpenBSD
2012-06-27 00:37:22 +00:00
Warren Block 75d7cd49e8 MFC r225808:
Fix grammar.

PR:		140457
Submitted by:	jeremyhu AT apple.com
Approved by:	gjb (mentor)
2012-06-25 23:40:58 +00:00
Christian Brueffer 5ed4d347b9 MFC: r211353
Tie up some loose ends r88509 left behind:

- chooseproc() is long gone, MLINK choosethread instead
- Update NAME section for choosethread
- Mark chooseproc.9 for removal
2012-06-24 18:38:16 +00:00
Xin LI f07e5d9e43 MFC r237348:
Currently the code uses gzFile * for a zlib file descriptor, which
is not correct.  The code works by accident because gzFile is
currently defined as void *, and internally it would be casted from
or to its real type.

A newer version of zlib will instead define it as a pointer to a
specific type pointer (namely, struct gzFile_s *).  This therefore
would cause stricter checks and compiler would catch this type
mismatch.

This change does not cause any changes to the resulting binary,
as validated with md5(1).
2012-06-23 00:37:32 +00:00
Eitan Adler 12b9ff1047 MFC r237257:
Remove variables which are initialized but never used thereafter reported by gcc46 warning

PR:		bin/163847
Approved by:	cperciva (implicit)
2012-06-22 05:40:15 +00:00
Eitan Adler bc2ea1719a MFC r236376:
Add characters mapping for codepages used in Germany.

PR:		bin/163847
Approved by:	cperciva (implicit)
2012-06-22 05:36:37 +00:00
Eitan Adler da1d9797bd MFC r237258:
Remove variables which are initialized but never used thereafter reported by gcc46 warning

Approved by:	cperciva (implicit)
2012-06-22 05:23:49 +00:00
Warren Block 6d68cc220e MFC r235873:
Fixes to man8 groff mandoc style, usage mistakes, or typos.

PR:		168016
Submitted by:	Nobuyuki Koganemaru
Approved by:	gjb (mentor)
2012-06-21 02:48:49 +00:00
Eitan Adler 89414a2ad7 MFC r236999:
Include a warning when using the example code as it may not
	work in unusual situations.
	Also slightly optimize the command.

Approved by:	cperciva (implicit)
2012-06-20 06:58:56 +00:00
Doug Barton 0a8c4bf8e6 Improve the functionality of the PORTS_MODULES knob by adding
LOCALBASE/bin and sbin to PATH, which allows dependencies to be found;
adding SRC_BASE and OSVERSION to match the new kernel, and putting the
related builds under MAKEOBJDIRPREFIX so that they only need to be built
once per kernel.

In addition to the PR this includes ideas/contributions from crees
and matthew.

PR:		ports/161452
Submitted by:	Garrett Cooper <[email protected]>
2012-06-17 21:07:27 +00:00
Konstantin Belousov 2488476f4c Move misplaced comment.
Discussed with:	bz
2012-06-16 18:37:54 +00:00
Dag-Erling Smørgrav b735a5ae8b Backport sha512 support. 2012-06-16 09:17:21 +00:00
Sergey Kandaurov 1eea9d01a2 MFC r234188, r234463, r234465 (partially, except softclock_ih):
- Update the swi_add prototype after struct ithd was split up into
  struct intr_event and struct intr_thread. [1]
- Update the rest of struct ithd references.
- net_ih cookie has gone away.
- Document swi_remove(9).

PR:		docs/166864 [1]
2012-06-14 11:39:43 +00:00
Eitan Adler 6f9c459231 MFC r236287:
add missing variable declaration when DEBUG is defined forgotten in r215046

PR:		bin/166404
Approved by:	cperciva (implicit)
2012-06-14 06:55:40 +00:00
Eitan Adler ef54389346 MFC r236286:
Fix likely race condition if wait_child() is interrupted by sigchild()

PR:		bin/102834
Approved by:	cperciva (implicit)
2012-06-13 03:41:42 +00:00
Eitan Adler 1b12e3d327 MFC r236288:
Only set _w to 0 when the file stream is not currently reading. Without this fflush may fail to write data in the buffer.

PR:		kern/137819
Approved by:	cperciva (implicit)
2012-06-13 03:29:57 +00:00
Bjoern A. Zeeb 58aded078e Fix a problem where zero-length RDATA fields can cause named(8) to crash.
[12:03]

Correct a privilege escalation when returning from kernel if
running FreeBSD/amd64 on non-AMD processors. [12:04]

Fix reference count errors in IPv6 code. [EN-12:02]

Security:	CVE-2012-1667
Security:	FreeBSD-SA-12:03.bind
Security:	CVE-2012-0217
Security:	FreeBSD-SA-12:04.sysret
Security:	FreeBSD-EN-12:02.ipv6refcount
Approved by:	so (simon, bz)
2012-06-12 12:10:10 +00:00
Isabell Long 6d6fe888bb Partial merge of r213507 from head:
In r178993, the ability to view a man page by giving a path to the
man page itself was added, but never documented.  Subsequently, the
GNU-licensed man(1) and its man page were replaced by BSD licensed
implementations, and later on this undocumented functionality was
also added to the new BSD-licensed man(1), together with
documentation.

This is a merge of the documentation part of that commit (r213507)
into the GNU-licensed man(1) man page in stable/7, in order to
document the available functionality.

PR:		docs/158973
Merge help:	bz
Approved by:	gabor (mentor)
2012-06-11 19:05:10 +00:00
Xin LI 261c22b3db MFC r236572:
Replace the use of wall clock time with monotonically increasing
clock.  In general, gettimeofday() is not appropriate interface
when accounting for elasped time because it can go backward, in
which case the policy code could errornously consider the limit
as exceeded.

Reported by:	Mahesh Arumugam
Submitted by:	Dorr H. Clark via gnn
Sponsored by:	Citrix / NetScaler
2012-06-11 07:11:34 +00:00
Warren Block c534b2045b MFC r236122,r236595:
Wording corrections and simplifications.

Approved by:	gjb (mentor)
2012-06-09 01:42:55 +00:00
Andrew Gallatin 0bfca41577 MFC 236212:
Update mxge(4) firmware to the latest version available from
  Myricom (1.4.55).

  Sponored by: Myricom, Inc.
2012-06-07 14:03:20 +00:00
Eitan Adler 379cc4b2b2 MFC r236289:
Relax security permissions on '.seq' file creation - the strict,
	but odd permissions resulted in a security alert from 110.neggrpperm

PR:		bin/165533
Approved by:	cperciva (implicit)
2012-06-06 06:39:34 +00:00
Eitan Adler eae8f58702 MFC r236285:
Add missing flag enable when certain arguments are parsed

PR:		bin/163053
Approved by:	cperciva (implicit)
2012-06-06 06:35:47 +00:00
Eitan Adler 7e2fd22dcd MFC r236379:
Adding missing dependancies for loading hptiop(4), hptmv(4) and isp(4) as modules.

PR:		kern/166239
Approved by:	cperciva (implicit)
2012-06-06 04:39:05 +00:00
Eitan Adler 24cfa6c09a MFC r236282:
Add support for Sun 1040 PCI Quad Serial

PR:		kern/163450
Approved by:	cperciva (implicit)
2012-06-06 04:18:22 +00:00
Marius Strobl 3471557f13 MFC: r236486
Add nitems(), a macro for determining the number of elements in a
statically-allocated array.

Obtained from:	OpenBSD (in principle)
2012-06-05 19:59:09 +00:00
Marius Strobl f8ec15eb3f MFC: r236328
Try to finally get the point in time at which bge_add_sysctls() is called
right; it needs to be called before bge_can_use_msi() but in turn requires
bge_flags to be properly set.

Submitted by:	yongari
2012-06-02 19:15:22 +00:00
Baptiste Daroussin 24018ef846 RFC: 235276
- Print package name in case an empty pkgdep line is found.

PR:		bin/164378
Submitted by:	Yuri <yuri AT tsoft.com> and many others
Approved by:	des (mentor)
2012-06-02 16:17:25 +00:00
Glen Barber 74d3f03060 MFC r236274, r236278, r236279:
r236274:
 - Fix an mdoc(7) formatting nit.

r236278:
 - Fix mdoc(7) style nits.

r236279:
 - Add '-width Pa' to src.conf.5 for mdoc(7) style consistency.
2012-06-02 02:27:01 +00:00
Eitan Adler ff570e3a43 MFC r235481:
Rework sample code which sets SSH_AUTH_SOCK to the user's ssh-agent
	socket path if running

PR:		167932
Approved by:	cperciva (implicit)
2012-06-01 06:40:48 +00:00
Warren Block 6653749a48 MFC r235842
Mention the upper hard limit for -n option.  Patch slightly modified
from PR version.

PR:		168255
Submitted by:	Andy Kosela
Approved by:	gjb (mentor)
2012-05-31 02:53:28 +00:00
Bjoern A. Zeeb f298b88543 Update the previous openssl fix. [12:01]
Fix a bug in crypt(3) ignoring characters of a passphrase. [12:02]

Security:	FreeBSD-SA-12:01.openssl (revised)
Security:	FreeBSD-SA-12:02.crypt
Approved by:	so (bz, simon)
2012-05-30 12:01:28 +00:00
Jim Harris 7a83e5fe6e MFC r234106, r235751:
Queue CCBs internally instead of using CAM_REQUEUE_REQ status.  This fixes
problem where userspace apps such as smartctl fail due to CAM_REQUEUE_REQ
status getting returned when tagged commands are outstanding when smartctl
sends its I/O using the pass(4) interface.

Sponsored by: Intel
2012-05-29 23:17:15 +00:00
Dag-Erling Smørgrav 1df87348da MFH r230622: use build tools, not host tools, to build aicasm. 2012-05-28 22:09:50 +00:00
Dag-Erling Smørgrav 0408808984 Make yacc a bootstrap tool if building on head, since the new yacc is
not 100% backward compatible.
2012-05-28 15:34:55 +00:00
Sean Bruno 4ec138c6ae MFC r235635
Decode new battery status indications.
2012-05-27 19:10:29 +00:00
Andrey V. Elsukov 9f575bea40 MFC r235599:
Introduce new device flag G_MIRROR_DEVICE_FLAG_TASTING. It should
  protect geom from destroying while it is tasting.

MFC r235600:
  Prevent removing of the last active component from a mirror.

PR:		kern/154860
Reviewed by:	pjd
Tested by:	Eugene Grosbein
2012-05-25 04:27:08 +00:00
Baptiste Daroussin 4176916cb9 MFC: r201226, r202844, r206043, r206132, r206133, r212029, r225610, r226708,
r228670

- Add support for UPDATING remote fetching.
- Reorganize EXAMPLES section in pkg_updating(1).
- Style fixes.
- Replace hardcoded INDEX version. [1]
- Fix a buffer overlap. [2]
- Remove empty package when fetching fails and -K is used. [3]
- Remove useless chmod2() after mkdtemp(3). [4]
- Replace mkdir(1) call with mkdir(2). [5]
- Get rid of some vsystem() calls.
- Switch from lstat(2) to open(2) in fexists().
- Try rename(2) in move_file() first.
- Fix pkg_delete, check if the file we're trying to delete is a
symlink before complaining that it doesn't exist. Typical case
would be a leftover library symlink that's left over after the
actual library has been removed.
- Print the package name on deletion errors.
- Staticify elide_root()
- In usr.sbin/pkg_install/updating/main.c, use the size of the destination
buffer as size argument to strlcpy(), not the length of the source

PR:		bin/145101 [1], bin/139492 [2], bin/144919 [3]
		bin/144920 [4], bin/144921 [5]
Submitted by:	gcooper [1,2,3,4,5]
Approved by:	des (mentor)
2012-05-21 13:07:12 +00:00
Glen Barber 546569dd4b MFC r235597:
Fix a typo that crept in.
2012-05-21 00:15:58 +00:00
Glen Barber d09f3c4907 MFC r235567:
mdoc(7) style/formatting fixes.

While here, fix a few nits igor(1) does not like.
2012-05-20 01:40:35 +00:00
Bjoern A. Zeeb 37fe100384 MFC r234643:
Do not toggle IFCAP_TSO4 if we would also do TSO6.  Given the driver does
 not currently announce/support TSO6 that cannot happen. Clean it up anyway
 for consistency.
2012-05-19 22:50:38 +00:00
Bjoern A. Zeeb 072adc7041 MFC r234620:
If we pass down 64k - L2 hdr size + 1 to 64K L3+ data adding an ether
 header will make the data go over the 64k limits announced to busdma as
 maxsize and the transaction will fail.

 With TSO this can result in a TCP regression due to the lost packet.

 According to the data sheets ixgbe(4) 82598 and 82599 can handle up to
 256k so increase the maximum.

 Reported by:	Jon Kåre Hellan, UNINETT (jon.kare.hellan uninett.no)
 Tested by:	Jon Kåre Hellan, UNINETT (jon.kare.hellan uninett.no)
2012-05-19 22:17:34 +00:00
Bjoern A. Zeeb 3ec42c79e2 MFC r231767:
Fix PAWS (Protect Against Wrapped Sequence numbers) in cases when
 hz >> 1000 and thus getting outside the timestamp clock frequenceny of
 1ms < x < 1s per tick as mandated by RFC1323, leading to connection
 resets on idle connections.

 Always use a granularity of 1ms using getmicrouptime() making all but
 relevant callouts independent of hz.

 Use getmicrouptime(), not getmicrotime() as the latter may make a jump
 possibly breaking TCP nfsroot mounts having our timestamps move forward
 for more than 24.8 days in a second without having been idle for that
 long.

PR:		kern/61404
2012-05-19 18:33:28 +00:00
Bjoern A. Zeeb 00bef68024 MFC r231505,231520:
Introduce a new NET_RT_IFLISTL API to query the address list.  It works
 on extended and extensible structs if_msghdrl and ifa_msghdrl.  This
 will allow us to extend both the msghdrl structs and eventually if_data
 in the future without breaking the ABI.

 The MFC is just to provide the new API to old stable branches to make
 updating and if needed downgrading a lot easier for updates to 10.
2012-05-19 14:38:14 +00:00
Bjoern A. Zeeb ddf45758d3 MFC r222589:
There are a couple of structs in mfireg.h with members named 'class'.
  These cause problems when trying to include the header in a C++ project.
  Rename them to 'evt_class', and track the change in mfi and mfiutil.

  Submitted by:	Mark Johnston
  Sponsored by:	Sandvine Incorporated

Missed with:	r235636
Submitted by:	Oliver Pinter (oliver.pntr gmail.com) to unbreak the build
2012-05-19 14:13:16 +00:00
Sean Bruno 94896fdf48 MFC of head thunderbolt support for mfi(4)
r233711 -- IFV head_mfi into head for initial thunderbolt support
r233768 -- atomic_t --> mfi_atomic
r233805 -- fix tinderbuild, move megasas_sge to mfivar.h
r233877 -- remove atomic.h from includes
r235014 -- fix reading of sector >= 2^32 or 2^21, repair RAID handling
r235016 -- style(9)
r235040 -- fix returns from mfi_tbolt_sync_map_info()
r235318 -- repair panic on PAE i386
r235321 -- repair the repair of panics on PAE i386
2012-05-18 23:29:30 +00:00
Sean Bruno 73179c53b4 MFC 232854,232874,232882,232883,232886 for bus_get_dma_tag() 2012-05-18 21:40:17 +00:00
Glen Barber 265dbd8d00 MFC r235319:
Remove duplicate words in mdoc(7) pages.

PR:		167810
2012-05-18 01:13:18 +00:00
Glen Barber 3dd560e12b MFC r235211:
General mdoc(7) and typo fixes.

PR:		167696
2012-05-18 00:03:13 +00:00
Eitan Adler 90490db17c MFC r235201 r235419:
Add missing period at the end of the error message

Approved by:	cperciva (implicit)
2012-05-16 00:36:51 +00:00
Jim Harris 43152fdcee MFC r235043:
Fix off-by-one error in sati_inquiry_block_device_translate_data().  Bug would
result in INQUIRY VPD 0x81 to SATA devices to return only 63 bytes of data
instead of 64 during SCSI/ATA translation.

Sponsored by: Intel
2012-05-16 00:01:39 +00:00
Eitan Adler c02f54401a MFC r235209 r235227:
Add a few new tips and update some old ones to more modern commands

Approved by:	cperciva (implicit)
2012-05-13 01:30:27 +00:00
Eitan Adler 9b1445034e MFC r232496:
Fix a variety of grammar nits and errors

Approved by:	cperciva (implicit)
2012-05-12 00:55:49 +00:00
Eitan Adler af739ad128 MFC r235208:
make it easier for users used to a VCS that allows up to be a shortcut
	for update.

Approved by:	cperciva (implicit)
2012-05-12 00:51:54 +00:00
Eitan Adler e6d6039de7 MFC r235205:
Document the -c option in --help output

Approved by:	cperciva (implicit)
2012-05-12 00:46:39 +00:00
Eitan Adler 97fec303d5 MFC r235203:
fix spacing in mtree file

Approved by:	cperciva (implicit)
2012-05-12 00:44:18 +00:00
Eitan Adler 21210c245a Partial MFC r234935:
Prefer the use of csup to cvsup when talking about the binary.

PR:		docs/167459
Approved by:	cperciva (implicit)
2012-05-09 00:56:08 +00:00
Eitan Adler a874df232f Undo MFC r234131:
The kernel change can't be MFCed so undo the documentation MFC.

PR:		kern/164970
Approved by:	cperciva (implicit)
2012-05-07 12:33:17 +00:00
Sergey Kandaurov 997a71ed2b Fix r234821 mis-merge. 2012-05-06 19:01:18 +00:00
Eitan Adler 6e22bcd3d8 MFC r234820:
pread(2) might fail with EBUSY, so document it

PR:		docs/167201
Approved by:	cperciva (implicit)
2012-05-06 14:23:19 +00:00
Eitan Adler 6917cf50ec MFC r234821:
Add support for:
		Olympus FE-210 camera
		LG UP3S MP3 player
		Laser MP3-2GA13 MP3

PR:		usb/119201
Approved by:	cperciva (implicit)
2012-05-06 14:16:18 +00:00
Eitan Adler a0e4401780 MFC r234819:
Allow users of gprof to get per run output files (using the pid)

PR:		bin/99800
Approved by:	cperciva (implicit)
2012-05-06 14:11:25 +00:00
Glen Barber 9387b5f21c MFC r234775:
As cron(8) is started with '-s' by default, timezones that observe
DST should not need to worry about scheduling jobs when the DST time
changes.

Rather than removing the BUGS section in crontab(5) regarding this,
note that disabling '-s' may still cause jobs to be executed twice or
not at all.

PR:		166318
2012-05-05 02:53:19 +00:00
Eitan Adler f484b2e995 MFC r233429,r233435,r233437,r234077,r234133,r234135,r234159,r234823:
A variety of changes that make the default shell easier to use.

Approved by:	cperciva (implicit)
2012-05-03 19:56:50 +00:00
Eitan Adler 2425e53ea9 MFC r234131:
Return EBADF instead of EMFILE from dup2 when the second argument is
	outside the range of valid file descriptors

PR:		kern/164970
Approved by:	cperciva (implicit)
2012-05-03 16:32:09 +00:00
Eitan Adler aaa9f00e7b MFC r234714, r234700:
Document the standardization status of err* and warn*

PR:		docs/164939
Approved by:	cperciva (implicit)
2012-05-03 16:21:26 +00:00
Bjoern A. Zeeb 2ba2050289 Fix multiple OpenSSL vulnerabilities.
Security:	CVE-2011-4576, CVE-2011-4619, CVE-2011-4109
Security:	CVE-2012-0884, CVE-2012-2110
Security:	FreeBSD-SA-12:01.openssl
Approved by:	so (bz,simon)
2012-05-03 15:25:11 +00:00
Andrey V. Elsukov ce66d7f1f1 MFC r234574 (by melifaro):
Fix panic in ng_patch(4) caused by checksum flags being added to mbuf flags.

  Tested by:        Maxim Ignatenko <[email protected]>
2012-04-25 12:02:06 +00:00
David Schultz 3545380e2a MFC r234529:
Ensure that the {,v}swprintf functions always null-terminate the
  output string, even if an encoding error or malloc failure occurs.
2012-04-24 03:59:13 +00:00
Benjamin Kaduk 3eb1daf691 MFC r233160:
Expound a bit more about the system maximum number of FIBs,
    how it may be set, and current limitations on the value.

PR:		docs/157453
Approved by:	hrs (mentor)
2012-04-24 03:30:26 +00:00
Pyun YongHyeon 717d619d24 MFC r234121:
Back out r228476.
  r228476 fixed superfluous link UP/DOWN messages but broke IPMI
  access during boot.  It's not clear why r228476 breaks IPMI and
  should be revisited.

  Reported by:	Paul Guyot <paulguyot <> ieee dot org >
2012-04-23 03:42:23 +00:00
David Schultz d204c6392c MFC r233973 (partial):
Fix bugs in remquo{,f}.
2012-04-21 06:59:48 +00:00
Marius Strobl 170fde4c54 MFC: r189727
read_ivar takes a uintptr_t * not a u_char *.
2012-04-21 00:28:29 +00:00
Marius Strobl 7c5c86faf0 MFC: r222475
Fix read_ivar implementation for MMC and SD.

1. Both mmc_read_ivar() and sdhci_read_ivar() use the expression
'*(int *)result = val' to assign to result which is uintptr_t *.
This does not work on big-endian 64 bit systems.

2. The media_size ivar is declared as 'off_t' which does not fit
into uintptr_t in 32bit systems, change this to long.

Submitted by:	kanthms at netlogicmicro com (initial version)

PR:		134745
2012-04-20 15:56:51 +00:00
David E. O'Brien 70c56a08d0 MFC r215821:
Add a missing CTL description from CVS revision 1.147.
2012-04-19 02:55:13 +00:00
Eitan Adler d0c10712cd MFC r231813:
Add err(3) to strerror(3) SEE ALSO section

Approved by:	cperciva (implicit)
2012-04-14 02:49:01 +00:00
Eitan Adler 678c2b74f2 MFC r230347:
Fix warning when compiling with gcc46:
		error: variable 'addrs' set but not used

Approved by:	cperciva (implicit)
2012-04-14 02:11:26 +00:00
Eitan Adler d2a124ad50 MFC r234134:
s/Free Memory Pages/Free Memory/ to avoid confusion, since we're
	reporting a number of bytes rather than a number of pages

Approved by:	cperciva (implicit)
2012-04-14 02:07:37 +00:00
Andriy Gapon c17c589385 MFC r231558: newvers.sh: unbreak git/git-svn support 2012-04-13 11:12:18 +00:00
Pyun YongHyeon f3592c1539 MFC r233688-233689:
r233688:
  Remove task queue based link state change handler. Driver no longer
  needs to defer link state handling.
  While I'm here, mark IFF_DRV_RUNNING before changing media.  If
  link is established without any delay, that link state change
  handling could be lost.

r233689:
  Do not report current link status if driver is not running.
  This change also workarounds dhclient's link state handling bug by
  not giving current link status.

  Unlike other controllers, ale(4)'s PHY hibernation perfectly works
  such that driver does not see a valid link if the controller is not
  brought up.  If dhclient(8) runs on ale(4) it will blindly waits
  until link UP and then gives up after 10 seconds.  Because
  dhclient(8) still thinks interface got a valid link when IFM_AVALID
  is not set for selected media,  this change makes dhclient initiate
  DHCP without waiting for link UP.
2012-04-11 07:21:51 +00:00
Pyun YongHyeon 89de0a1dd5 MFC r233585-233587:
r233585:
  Partially revert r223608 and selectively allow microcode loading
  for 82550C.  For 82550 controllers this change restores CPUSaver
  microcode loading.  Due to silicon bug on 82550 and 82550C with
  server extension, these controllers seem to require CPUSaver
  microcode to receive fragmented UDP datagrams.  However the
  microcode shouldn't be used on client featured 82550C as it locks
  up the controller.  In addition, client featured 82550C does not
  have the silicon bug.  Also clear temporary memory used for
  microcode loading since the same memory area is used for other
  commands.
  While I'm here use 82550C in probe message instead of generic
  82550.

  Reported by:	Andreas Longwitz <longwitz <> incore de>
  Tested by:	Andreas Longwitz <longwitz <> incore de>

r233586:
  Load entire EEPROM contents in device attach time and verify
  whether the checksum of EEPROM is valid or not.  Because driver
  heavily relies on EEPROM information when it selectively enables
  features/workarounds, it would be helpful to know whether driver
  sees valid EEPROM.
  While I'm here remove all other EEPROM accesses since the entire
  EEPROM is loaded at device attach time.

r233587:
  Remove unnecessary #if as the software workaround for PCI protocol
  violation should be activated unless the system is cold-booted
  after updating EEPROM.
  The PCI protocol violation happens only when established link is
  10Mbps so the workaround should be updated whenever link state
  change is detected.  Previously the workaround was activated only
  when user checks current media status with ifconfig(8).
2012-04-11 07:12:20 +00:00
Marius Strobl aa341e9b86 MFC: r233827
Fix probing of SAS1068E with a device ID of 0x0059 after r232411 (MFC'ed
to stable/7 in r232610).
Reported by: infofarmer

MFC: r233886

Refine r233827; as it turns out, controllers with a device ID of 0x0059
can be upgraded to MegaRAID mode, in which case mfi(4) should attach to
these based on the sub-vendor and -device ID instead (not currently done).
Therefore, let mpt_pci_probe() return BUS_PROBE_LOW_PRIORITY.
While it, let mpt_pci_probe() return BUS_PROBE_DEFAULT instead of 0 in
the default case.
2012-04-07 12:47:12 +00:00
Doug Barton 879db240ba Add Bv9ARM.pdf to the list of docs to install.
(Direct commit because this file varies widely between BIND versions)
2012-04-05 00:08:16 +00:00
Marius Strobl 3c8bbe4151 MFC: r233747, r233748
- Fix panic on kernel traps having a mapping in trap_sig b0rked in r206086
  (MFC'ed to stable/7 in r206197).
  Reported by: David E. Cross
- Remove checks that are redundant due to tf_type being unsigned.
2012-04-04 21:19:27 +00:00
Marius Strobl 4ede5e313c MFC: r233701
- Remove erroneous trailing semicolon. [1]
- Correctly determine the maximum payload size for setting the TX link
  frequent NACK latency and replay timer thresholds.

Submitted by:	stefanf [1]
2012-04-02 20:14:51 +00:00
Jung-uk Kim 10396b3048 MFC: r233702
Work around Erratum 721 for AMD Family 10h and 12h processors.
2012-04-02 18:31:01 +00:00
Jung-uk Kim 8f8370c97f MFC: r233619
Add a PNP ID for Japanese 106-key keyboard.
2012-04-02 17:35:26 +00:00
Jim Harris d9c15b180e MFC r233663:
Fix bug where isci(4) would report only 15 bytes of returned data on a
READ_CAP_16 command to a SATA target.

Sponsored by: Intel
Approved by: sbruno
2012-04-02 16:37:46 +00:00
Jim Harris add21e5589 MFC r233622:
Ensure consistent target IDs for direct-attached devices.

Sponsored by: Intel
Reported by: sbruno, Ravi Pokala <rpokala at panasas dot com>
Tested by: Ravi Pokala <rpokala at panasas dot com>
Approved by: sbruno
2012-04-02 16:33:07 +00:00
John Baldwin 9c1ea7ca53 MFC 233256:
Eliminate vm.pmap.shpgperproc and vm.pmap.pv_entry_max because they no
longer serve any purpose.
2012-04-02 14:52:28 +00:00
Marius Strobl 01a2fdfe08 MFC: r233425
Consistently update to the MPI header set version 01.05.20 after r224761
(MFC'ed to stable/2 in r224821).
Requested by:	mjacob
2012-03-31 10:29:20 +00:00
Marius Strobl 090e017518 MFC: r233403, r233404
- Use the PCI ID macros from mpi_cnfg.h rather than duplicating them here.
  Note that this driver additionally probes some device IDs for the most
  part not know to other MPT drivers, if at all. So rename the macros not
  present in mpi_cnfg.h to match the naming scheme in the latter and but
  suffix them with a _FB in order to not cause conflicts.
- Like mpt_set_config_regs(), comment out mpt_read_config_regs() as the
  content of the registers read isn't actually used and both functions
  aren't exactly up to date regarding the possible layouts of the BARs
  (these function might be helpful for debugging though, so don't remove
  them completely).
- Use DEVMETHOD_END.
- Use NULL rather than 0 for pointers.
- Remove an unusual check for the softc being NULL.
- Remove redundant zeroing of the softc.
- Remove an overly banal and actually partly incorrect as well as partly
  outdated comment regarding the allocation of the memory resource.
2012-03-31 10:25:16 +00:00
Marius Strobl ffdbe53b28 MFC: r233423
Initialize the mutexes used for the NVM and the swflag as MTX_DUPOK in
order to avoid otherwise harmless witness warnings when these are acquired
at the same time and due to both using MTX_NETWORK_LOCK as their type.
The right fix actually would be to use different, descriptive types for
these. However, the latter would require undesirable changes to the shared
code base. Another approach would be to just supply NULL as the type, which
was deemed as less desirable though as it would cause the unique but cryptic
name also to be used for the type and to diverge from the type used by other
network device drivers.
2012-03-31 01:21:54 +00:00
Eitan Adler 02cffbf707 MFC r231300, r231328:
Permit the use of relative paths for the prefix argument.
	Remove an unnecessary cwd from created plists when -p is specified

Approved by:	cperciva (implicit)
2012-03-29 23:59:02 +00:00
Eitan Adler b6d0b2391b MFC r227489:
- fix duplicate "a a" in some comments

Approved by:	cperciva (implicit)
2012-03-29 02:47:01 +00:00
Eitan Adler cafd9133ab MFC r233136, r233432:
Restore the ability to use a non-standard LOCALBASE to sshd
	Add the ability to use a non-standard LOCALBASE to ssh

Approved by:	cperciva (implicit)
2012-03-29 01:46:56 +00:00
Eitan Adler 47ca06502e MFC r230348:
- Fix warning when compiling with gcc46:
	        error: variable 'extra_async_bytes' set but not used

Approved by:	cperciva (implicit)
2012-03-28 02:35:28 +00:00
Eitan Adler 217e74b3ca MFC r233428:
- Direct users to csup instead of cvsup in the csup-file boilerplate text.

Approved by:	cperciva (implicit)
2012-03-27 00:52:30 +00:00
Pyun YongHyeon 0b75b2e39e MFC r232951,232953,233158:
r232951:
  fxp(4) does not handle deferred dma map loading.  Tell
  bus_dmamap_load(9) that it should return immediately with error
  when there are insufficient mapping resources.

r232953:
  Fix white space nits.

r233158:
  Do not change current media when driver is already running.  If
  driver is running driver would have already completed flow control
  configuration.  This change removes unnecessary media changes in
  controller reconfiguration cases such that it does not trigger link
  reestablishment for configuration change requests like promiscuous
  mode change.

  Reported by:	Many
  Tested by:	Mike Tancsa <mike <> sentex dot net>
2012-03-26 05:17:59 +00:00
Pyun YongHyeon 6d36dd7b01 MFC r232849-232850:
r232849:
  Show PCI bus speed and width as well as running mode of PCI-X
  device in device attach.  This would help to narrow down issue to a
  specific controller and operating mode of the controller.
  While I'm here rename BGE_MISCCFG_BOARD_ID with
  BGE_MISCCFG_BOARD_ID_MASK.

r232850:
  Make if_ierrors updated whenever any of the following counters are
  updated.
   o Number of times NIC ran out of RX buffer descriptors
   o Number of inbound packet errors
   o Number of inbound packets that were chosen to be discarded
  Previously only the discarded packet counter was used to update
  if_ierrors.  This change fixes wrong if_ierrors counter on
  BCM570[0-4] controllers.  For BCM5705 and later controllers bge(4)
  already correctly counted it.

  Reported by:	Eugene Grosbein <egrosbein <> rdtc dot ru>
2012-03-26 04:51:04 +00:00
Pyun YongHyeon b1f26ed76c MFC r232848:
Add workaround for PCI-X BCM5704 controller that live behind
  AMD-8131 PCI-X bridge.  The bridge seems to reorder write access to
  mailbox registers such that it caused watchdog timeouts by
  out-of-order TX completions.

  Tested by:	Michael L. Squires <mikes <> siralan dot org >
2012-03-26 04:39:10 +00:00
Pyun YongHyeon ebc3da1856 MFC r232246:
Prefer RL_GMEDIASTAT register to RGEPHY_MII_SSR register to
  extract a link status of PHY when parent driver is re(4).
  RGEPHY_MII_SSR register does not seem to report correct PHY status
  on some integrated PHYs used with re(4).
  Unfortunately, RealTek PHYs have no additional information to
  differentiate integrated PHYs from external ones so relying on PHY
  model number is not enough to know that.  However, it seems
  RGEPHY_MII_SSR register exists for external RealTek PHYs so
  checking parent driver would be good indication to know which PHY
  was used. In other words, for non-re(4) controllers, the PHY is
  external one and its revision number is greater than or equal to 2.
  This change fixes intermittent link UP/DOWN messages reported on
  RTL8169 controller.

  Also, mii_attach(9) is tried after setting interface name since
  rgephy(4) have to know parent driver name.

  PR:	kern/165509
2012-03-26 04:30:46 +00:00
Pyun YongHyeon 18915fcec8 MFC r232145:
Use correct Config registers for RTL8139 family. Unlike RTL8168 and
  RTL810x family , RTL8139 has different register map for Config
  registers.

  While here, follow the lead of re(4) in WOL configuration.
   - Disable WOL_UCAST and WOL_MCAST capabilities by default.
   - Config5 register write does not need to unlock EEPROM access
     on RTL8139 family but unlocking EEPROM access does not affect
     its operation and make it consistent with re(4).

  Reported by:	Matt Renzelmann  mjr <> cs dot wisc dot edu
2012-03-26 03:56:52 +00:00
Pyun YongHyeon e1dc1c185e MFC r232019,232021,232025,232027,232029,232040:
r232019:
  Give hardware chance to drain active DMA cycles.

r232021:
  If there are not enough RX buffers, release partially allocated RX
  buffers.

r232025:
  Introduce sf_ifmedia_upd_locked() and have driver reset PHY before
  switching to selected media.  While here, set if_drv_flags before
  switching to selected media.

r232027:
  No need to reprogram hardware RX filter when driver is not running.

r232029:
  Remove taskqueue based MII stat change handler.
  Driver does not need deferred link state change processing.
  While I'm here, do not report current link status if interface is
  not UP.

r232040:
  Add check for IFF_DRV_RUNNING flag after serving an interrupt and
  don't give RX path more priority than TX path.
  Also remove infinite loop in interrupt handler and limit number of
  iteration to 32. This change addresses system load fluctuations
  under high network load.
2012-03-26 03:49:46 +00:00
Eitan Adler 806ffcaa83 MFC r233138:
draft-ietf-ipv6-scoping-arch-02.txt is now RFC 4007

PR:		phk
Approved by:	cperciva (implicit)
2012-03-26 01:16:56 +00:00
Marius Strobl 86bf4084b6 MFC: r233105
Declare some variables static in order to reduce the object size and
redo r232822 (MFC'ed to stable/7 in r232966) in a less hackish way.
2012-03-25 16:25:18 +00:00
Edwin Groothuis 8b97006ed0 MFC of r233445, tzdata2012a
- Updates to various locations in Antarctica.
- Armenia will abolish DST this year.
- Not only Samoa has moved to UTC+14, also Fakaofo did.
- There will be a leap second in 30 June 2012.
- Historical updates of 1918 to Canada, Winn, Regina, Edm, Vanc, Creston.
- Chili stays on DST until 28 April 2012
- The Falkland islands will stay on DST this year.
2012-03-25 02:19:39 +00:00
Jim Harris 42cb060ca5 MFC r233371:
Call xpt_bus_register during attach context, then freeze and do not release
until domain discovery is complete.  This fixes an isci(4) bug on FreeBSD 7.x
where devices weren't always appearing after boot without an explicit rescan.

Sponsored by: Intel
Reported and tested by: <rpokala at panasas dot com>
Reviewed by: scottl
Approved by: scottl
2012-03-23 17:23:40 +00:00
Sergey Kandaurov ec792c4690 MFC r210525:
Missing IFCAP_* macro descriptions in ifnet(9).

PR:		docs/148952
Submitted by:	Lars Hartmann <[email protected]>
2012-03-22 11:47:06 +00:00
Eitan Adler 29d7df0807 MFC r232505:
Remove outdated comment of seven years

PR:		docs/116116
Approved by:	cperciva
2012-03-19 01:57:14 +00:00
Eitan Adler 96195361a2 MFC r231306:
Fix NULL ptr dereference in setusercontext if pwd is null,
	LOGIN_SETPRIORITY is set, and setting the priority (rtprio or
	setpriority) fails.

PR:		kern/164238
Approved by:	cperciva
2012-03-19 01:52:09 +00:00
Eitan Adler 22b188e25f MFC r232504:
Remove reference to gcc's non-standard -fwritable-strings, which
	doesn't exist in recent releases (and is bad advice anyway)

PR:		docs/163119
Approved by:	cperciva
2012-03-19 01:33:24 +00:00
Eitan Adler 6ef81461ee MFC r232503:
POSIX mandates that swab do nothing when len < 0

PR:		140690
Approved by:	cperciva
2012-03-19 01:28:11 +00:00
Eitan Adler 54cd47ff8c MFC r232506:
Explicitly list dependency

PR:		misc/160463
Approved by:	cperciva
2012-03-19 01:19:04 +00:00
Christian Brueffer 3ca739c818 MFC: r232316
Update bridge(4) default values.
2012-03-17 12:36:45 +00:00
Christian Brueffer 101f5c93b4 MFC: r232315
Use a more appropriate default for the maximum number of addresses in the
bridge forwarding table.
2012-03-17 12:24:17 +00:00
Sean Bruno b90fadbf4e MFC r226702
Author: 	obrien
Date: 	Mon Oct 24 20:52:41 2011 UTC (4 months, 3 weeks ago)
Changed paths: 	3
Log Message:

* Don't give the impression that this compiler is GPLv3.
  (It is "well known" that GCC 4.2.2 is GPLv3.)
* Don't give the impression that this compiler isn't "trustable".
* Fix dependency nit.
2012-03-17 00:10:21 +00:00
Sean Bruno cb426ab517 MFC r232986
Update man page to present -T argument in synopsis
2012-03-15 16:47:45 +00:00
Sean Bruno 6d4baf1a02 MFC r183347
Add a flag, -T, that tells syslogd to always replace the timestamp on
messages from the network. We already replace malformatted timestamps
and this option lets us replace timestamps that are correctly formatted
but wrong.

PR:		120891
Submitted by:	Thomas Vogt <[email protected]>
MFC after:	1 week

MFC r186263
Fixing !INET6 builds after bumping WARNS to 3.

MFC r186331
Constify 'name' field in struct funix.  This commit makes syslogd(8)
WARNS?=6 on amd64 but I have not tested under universe so keep WARNS?=
level as-is for now.

MFC r186234
Rather than hardcode the 'struct iovec iov' array size, use a #define.
While I'm here bump WARNS to 3.

Obtained from:	Juniper Networks

MFC r186236
Use passed parameter rather than the #define.
(more accurate extraction of Juniper Networks change)

MFC r224002
Add a new option, -N to disable the default and recommended syslogd(8)
behavior, which binds to the well known UDP port.

This option implies -s.

Obtained from:	delphij@ obrien@ avatar@ trhodes@ dwmalone@
2012-03-14 21:45:45 +00:00
Marius Strobl 2674dfe896 MFC: r232822
Fix a bug introduced in r223938 (MFC'ed to stable/7 in r224410); on
big-endian machines coping a 32-bit quantum bytewise to the address of
a 64-bit variable results in writing to the "wrong" 32-bit half so adjust
the address accordingly. This fix is implemented in a hackish way for
two reasons:
o in order to be able to get it into 8.3 with zero impact on the little-
  endian architectures where this bug has no effect and
o to avoid blowing the x86 boot2 out of the water again when compiling
  it with clang, which all sane versions of this fix tested do.
This change fixes booting from UFS1 file systems on big-endian machines.
2012-03-14 13:09:41 +00:00
Eitan Adler 9b3170d03f MFC r232471:
Document the [n]eei and [n]bacc options

PR:		docs/165009
Approved by:	bcr
2012-03-10 18:37:01 +00:00
Andrey V. Elsukov 2942ccb76a MFC r232339:
Note that memory should be freed after uuid_to_string(3) call.

PR:		docs/161808
2012-03-08 09:56:07 +00:00
Mark Peek 829648eba4 MFC r231990
Update to tcsh 6.18.01
2012-03-07 22:19:43 +00:00
Sergey Kandaurov 9c9de84712 MFC r231821:
delete-old does not have delete-old-libs dependency.
 Reflect this in the comment.

PR:		conf/163993
Submitted by:	Eugen Konkov <kes-kes at yandex ru>
2012-03-07 08:21:25 +00:00
Sean Bruno 85619fba6b MFC r232411
Fix a problem that was causing the mpt(4) driver to attach to MegaRAID
cards that should be handled by the mfi(4) driver.

The root of the problem is that the mpt(4) driver was masking off the
bottom bit of the PCI device ID when deciding which cards to attach to.

It appears that a number of the mpt(4) Fibre Channel cards had a LAN
variant whose PCI device ID was just one bit off from the FC card's device
ID.  The FC cards were even and the LAN cards were odd.

The problem was that this pattern wasn't carried over on the SAS and
parallel SCSI mpt(4) cards.  Luckily the SAS and parallel SCSI PCI device
IDs were either even numbers, or they would get masked to a supported
adjacent PCI device ID, and everything worked well.

Now LSI is using some of the odd-numbered PCI device IDs between the 3Gb
SAS device IDs for their new MegaRAID cards.  This is causing the mpt(4)
driver to attach to the RAID cards instead of the mfi(4) driver.

The solution is to stop masking off the bottom bit of the device ID, and
explicitly list the PCI device IDs of all supported cards.

This change should be a no-op for mpt(4) hardware.  The only intended
functional change is that for the 929X, the is_fc variable gets set.  It
wasn't being set previously, but needs to be because the 929X is a Fibre
Channel card.

Reported by:  Kashyap Desai <[email protected]>
2012-03-06 15:02:18 +00:00
Remko Lodder da7083b7c5 Merge r238821
Add sticky.8 to the obsolete files since it had been
moved to sticky.7

Submitted by:	maxim and pluknet

With help from:	dim (because of awkward merge conflicts)
2012-03-06 14:13:23 +00:00
Xin LI d9a348231c Merge all revisions except r199804 back to stable/7. 2012-03-05 19:32:44 +00:00
Eitan Adler 8041e50b54 MFC r227626, r227642:
- be more precise about the unit of measurement

Approved by:	cperciva
2012-03-04 16:24:58 +00:00
Jung-uk Kim c7520bcc5a MFC: r232309
Fix a long standing bug.  The caller expects a non-zero value for success.
Luckily keyboard probing was turned off by default from the first revision.
2012-03-03 00:37:03 +00:00
Sean Bruno eb5a666a9a MFC r232267 via stable/8 MFC r232354
Workaround for PCIe 4GB boundary issue

Enforce a boundary of no more than 4GB - transfers crossing a 4GB
boundary can lead to data corruption due to PCIe limitations.  This
change is a less-intrusive workaround that can be quickly merged back
to older branches; a cleaner implementation will arrive in HEAD later
but may require KPI changes.

This change is based on a suggestion by jhb@.
2012-03-02 16:38:54 +00:00
Sean Bruno cdbc172bd0 MFC r232225
Update PCI-IDs with devices found on Intel SDP

Return  BUS_PROBE_DEFAULT so that non-default drivers may be loaded
2012-03-01 22:36:42 +00:00
Remko Lodder 356ddbb996 MFC r124468
Move the sticky manual from section 8 to section
7 like NetBSD has, since this is not a command
on itself.

PR:		124468
2012-02-29 15:10:34 +00:00
Marius Strobl 21f15b79ba MFC: r231914
Probe the National DP83849, which is a dual-port version of the PHYTER.

Obtained from:	NetBSD
2012-02-25 00:41:38 +00:00
Marius Strobl 3c926ea86b MFC: r231913
- Probe BCM57780.
- In case the parent is bge(4), don't set the Jumbo frame settings unless
  the MAC actually is Jumbo capable as otherwise the PHY might not have the
  corresponding registers implemented. This is also in line with what the
  Linux tg3 driver does.

PR:		165032
Submitted by:	Alexander Milanov
Obtained from:	OpenBSD
2012-02-25 00:35:32 +00:00
Marius Strobl 56d7bd4381 MFC: r231621
- As it turns out, MSI-X is broken for at least LSI SAS1068E when passed
  through by VMware so blacklist their PCI-PCI bridge for MSI/MSI-X here.
  Note that besides currently there not being a quirk type that disables
  MSI-X only and there's no evidence that MSI doesn't work with the VMware
  pass-through, it's really questionable whether MSI generally works in
  that setup as VMware only mention three know working devices [1, p. 4].
  Also not that this quirk entry currently doesn't affect the devices
  emulated by VMware in any way as these don't claim support MSI/MSI-X to
  begin with. [2]
  While at it, make the PCI quirk table const and static.
- Remove some duplicated empty lines.
- Use DEVMETHOD_END.

PR:		163812, http://forums.freebsd.org/showthread.php?t=27899 [2]
Reviewed by:	jhb

[1]: http://www.vmware.com/pdf/vsp_4_vmdirectpath_host.pdf
2012-02-24 00:49:18 +00:00
Pyun YongHyeon 378633f046 MFC r231622:
For RTL8168/8111D controller, make sure to wake PHY from power down
  mode.  Otherwise, PHY access times out under certain conditions.

  Approved by:	re (kib)
2012-02-23 11:28:19 +00:00
Doug Barton dfea403349 MFC r231862:
Increase the default shutdown timer to 90 seconds. This will allow
certain systems that take a long time to shut down, without adversely
affecting things that shut down quickly. It's also 30 seconds less than
the default hard limit of 120 seconds in kern.init_shutdown_timeout.

PR:		conf/109272
Submitted by:	Radim Kolar SF.NET <[email protected]>
2012-02-20 10:15:20 +00:00
Sean Bruno d45e8a1a00 MFC isci(4) SAS driver
r230843, 231134, 231136, 231296, 231615, 231693, 231860

Obtained from:	Intel (Jim Harris jimharris@)
2012-02-17 06:58:40 +00:00
Eitan Adler a1d811e5e5 MFC r231299:
- More accurately document what happens on error.

PR:		docs/127908
Approved by:	cperciva
2012-02-17 00:56:17 +00:00
Eitan Adler c8a1a48cf8 MFC r228274:
- Fix some uninitialized variables in pipe regression tests that result in failure.

PR:		misc/161175
Approved by:	cperciva
2012-02-16 19:40:17 +00:00
Eitan Adler 01bf36137c MFC r22990[45] and r229907-r229919:
- fix a variety of warnings produced by gcc46 when compiling world

Approved by (cperciva)
2012-02-16 05:00:41 +00:00
Bjoern A. Zeeb 169ab8526f MFC r231515:
Use the correct constant (with same value) for comparying the SA type.

PR:		kern/142741
Submitted by:	Matthijs Kooiman (matthijs stdin.nl)
2012-02-15 09:32:51 +00:00
Pyun YongHyeon fe50483638 MFC r230288,230339:
r230288:
  Document dev.bge.%d.msi_disable tunable.

r230339:
  Reflect tunable name change made in r230337.
2012-02-15 04:09:43 +00:00
Pyun YongHyeon ff6d023789 MFC r230286,230337-230338,231159:
r230286:
  Introduce a tunable that disables use of MSI.
  Non-zero value will use INTx.

r230337-230338:
  Rename dev.bge.%d.msi_disable to dev.bge.%d.msi which matches
  enable/disable and default it to on.

r231159:
  Call bge_add_sysctls() early and especially before bge_can_use_msi() so
  r230337 actually has a chance of working and doesn't always unconditionally
  disable the use of MSIs.
2012-02-15 04:04:36 +00:00
Pyun YongHyeon 68e53499c4 MFC r230336:
Fix a logic error which resulted in putting PHY into sleep when WOL
  is active.  If WOL is active driver should not put PHY into sleep.
  This change makes WOL work on RTL8168E.
2012-02-15 03:51:09 +00:00
Pyun YongHyeon 394ef83a65 MFC r230575-230576:
r230275:
  Use a RX DMA tag to free loaded RX DMA maps.
  Previously it used a TX DMA tag.

r230276:
  Free allocated jumbo buffers when controller is stopped.
2012-02-15 03:43:46 +00:00
Pyun YongHyeon 76757a04fc MFC r229940:
style. No functional changes.
2012-02-15 03:35:39 +00:00
Glen Barber 5381eb02a2 MFC r231244:
- Fix some Xr references:

- - lmc(4): Netgraph(4) -> netgraph(4)
- - security(7): rc.conf(8) -> rc.conf(5)
- - sbp(4): sysctl(1) -> sysctl(8)
- - portindex(5): build(1) -> build(7)
2012-02-15 01:41:00 +00:00
Dimitry Andric 6a1df0d9af MFC r231118:
Consistently set RPCGEN_CPP when running rpcgen, so the C preprocessor
set via ${CPP} is used, instead of always using hardcoded /usr/bin/cpp.
2012-02-14 19:49:36 +00:00
Bjoern A. Zeeb b796e8afd5 MFC 229547:
Mark a couple of file local functions static and stop exporting them.

Discussed with:	rwatson
2012-02-14 15:18:08 +00:00
Doug Barton 9653e243c8 MFC r231507:
Move addswap to run right after kld (aka early in the second stage),
as it did previously.
2012-02-14 10:34:27 +00:00
Doug Barton 57dd1552b6 MFC r231194:
Add a knob to always load the default rulesets. While I'm here document
the other devfs_ knobs in rc.conf.5.
2012-02-14 10:30:12 +00:00
Doug Barton 451db53130 MFC r230374:
If we're booting there is no need to waste time determining if the service
is running or not.
2012-02-14 10:19:58 +00:00
Doug Barton 6f3b26c671 MFC r230099:
Change rcvar= assignments to the literal values set_rcvar
would have returned. This will slightly reduce boot time,
and help in diff reduction to HEAD.
2012-02-14 10:17:30 +00:00
Marius Strobl b071e6c715 MFC: r231228
Remove extra newlines from panic messages.
2012-02-14 01:15:46 +00:00
Marius Strobl c7cb135383 Forced commit to denote that the commit message of r231625 actually
should have read:
MFC: r231518

Flesh out support for SAS1078 and SAS1078DE (which are said to actually
be the same chip):
- The I/O port resource may not be available with these. However, given
  that we actually only need this resource for some controllers that
  require their firmware to be up- and downloaded (which excludes the
  SAS1078{,DE}) just handle failure to allocate this resource gracefully
  when possible. While at it, generally put non-fatal resource allocation
  failures under bootverbose.
- SAS1078{,DE} use a different hard reset protocol.
- Add workarounds for the 36GB physical address limitation of scatter/
  gather elements of these controllers.

Tested by:	Slawa Olhovchenkov

PR:	149220 (remaining part)
2012-02-14 01:09:10 +00:00
Marius Strobl bb295be145 MFC: r231518
Remove extra newlines from panic messages.
2012-02-14 00:56:01 +00:00
Dimitry Andric 7375274b3f MFC r231079:
Let rpcgen(1) support an environment variable RPCGEN_CPP to find the C
  preprocessor to run.  Previously, it always ran /usr/bin/cpp, unless you
  used the -Y option, and even then you could not set the basename.  It
  also attempted to run /usr/ccs/lib/cpp for SVR4 compatibility, but this
  is obsolete, and has been removed.

  Note that setting RPCGEN_CPP to a command with arguments is supported,
  though the command line parsing is simplistic.  However, setting it to
  e.g. "gcc46 -E" or "clang -E" will lead to problems, because both gcc
  and clang in -E mode will consider files with unknown extensions (such
  as .x) as object files, and attempt to link them.

  This could be worked around by also adding "-x c", but it is much safer
  to set RPCGEN_CPP to e.g. "cpp46" or "clang-cpp" instead.

MFC r231080:

  Amend r231079 by properly shifting up the existing arguments in
  rpc_main.c's insarg() function.  I had forgotten to put this in my patch
  queue, sorry.

  Pointy hat to:	me

MFC r231101:

  In usr.bin/rpcgen/rpc_main.c, use execvp(3) instead of execv(3), so
  rpcgen will search the current PATH for the preprocessor.  This makes it
  possible to run a preprocessor built during the cross-tools stage of
  buildworld.
2012-02-13 21:07:48 +00:00
Dimitry Andric 72f08711d3 MFC r231054:
In usr.bin/rpcgen/rpc_main.c, properly check the return value of
strlcpy(), in addition to checking that of strlcat().
2012-02-12 14:56:50 +00:00
Mikolaj Golub 2f1a635f45 MFC r230874:
Try to avoid ambiguity when sysctl returns ENOMEM additionally
checking the returned oldlen: when ENOMEM is due to the supplied
buffer being too short the return oldlen is equal to buffer size.

Without this additional check sockstat gets stuck in loop leaking the
memory if the returned ENOMEM was due the exceeded memorylocked
limit. This is easily can be observed running `limits -l 1k sockstat'.

Submitted by:	Andrey Zonov <andrey zonov org>
2012-02-12 07:56:46 +00:00
Mikolaj Golub efae070b83 MFC r230873:
Try to avoid ambiguity when sysctl returns ENOMEM additionally
checking the returned oldlen: when ENOMEM is due to the supplied
buffer being too short the return oldlen is equal to buffer size.

Without this additional check kvm_getprocs() gets stuck in loop if the
returned ENOMEM was due the exceeded memorylocked limit. This is
easily can be observed running `limits -l 1k top'.

Submitted by:	Andrey Zonov <andrey zonov org>
2012-02-12 07:53:37 +00:00
Craig Rodrigues a7b1e06663 MFC 183243-231540. This records mergeinfo for already merged
changesets, but brings in the following changes:

MFC 222326
    - Fix tftp_log() usage

MFC 223137
    - Man page updates

MFC 223487
    - Bring back syncnet() implementation from older tftp implementation.

MFC 229780
    - Spelling fixes for libexec/

MFC 229904
    - Fix warning when compiling with gcc46:
          error: variable 'bp' set but not used
2012-02-12 01:07:15 +00:00
Craig Rodrigues be69743be2 MFC 170382 through 231539
- this records svn:mergeinfo for previously merged changesets

This pulls in changes such as:

MFC 216370
  - Remove adertising clause from UCB copyrighted files in usr.bin

MFC 222534
  - Fix a couple of spelling errors.

MFC 223493
  - Remove duplicated header files

MFC 223135 - 223491
  - man page updates

MFC 229403
  - Replace index() and rindex() calls with strchr() and strrchr().

MFC 230044
  - fgets(3) returns a pointer, so compare against NULL, not integer 0.
2012-02-11 23:58:07 +00:00
Bjoern A. Zeeb fc89f7e7ec MFC r223741:
Tag mbufs of all incoming frames or packets with the interface's FIB
 setting (either default or if supported as set by SIOCSIFFIB, e.g.
 from ifconfig).

 Submitted by:	Alexander V. Chernikov (melifaro ipfw.ru)
 Reviewed by:	julian
2012-02-10 16:05:33 +00:00
Doug Barton 659accc77f MFC r228191:
Ensure kldxref is run first.
2012-02-10 10:23:55 +00:00
Bjoern A. Zeeb 912a5f4115 MFC r223735:
Add infrastructure to allow all frames/packets received on an interface
 to be assigned to a non-default FIB instance.

 Submitted by:  cjsp
 Submitted by:  Alexander V. Chernikov (melifaro ipfw.ru)
                (original versions)
 Reviewed by:   julian
 Reviewed by:   Alexander V. Chernikov (melifaro ipfw.ru)

Reviewed by:	melifaro
2012-02-10 06:43:16 +00:00
Bjoern A. Zeeb 9147ffaedb MFC r223259:
Correct a typo in the function name.
2012-02-10 06:06:30 +00:00
Eitan Adler 906d205eda MFC r231111, r231331:
ports(7) currently makes no mention of LOCALBASE: fix that

PR:		159551
Approved by:	gjb
2012-02-10 04:11:04 +00:00
Eitan Adler b5fc068a12 MFC r228344:
- Add support for Support SEAGATE DAT Scopion 130

PR:		kern/141934
Approved by:	cperciva
2012-02-10 00:10:13 +00:00
Bjoern A. Zeeb ba66d2bfbc Fix no-IPv6 kernels after r231207.
Reported by:	someone via luigi
2012-02-09 22:13:20 +00:00
Bjoern A. Zeeb f02d7d5a9e MFC r229546:
Convert an #ifdef DIAGNOSTIC if/panic to a KASSERT.
2012-02-09 21:33:44 +00:00
Bjoern A. Zeeb c07abfa9b0 MFC r229276:
Remove an uneeded inpcb forward declaration and align the function
 declaration following to match the style in the rest of the file.
2012-02-09 20:54:25 +00:00
Bjoern A. Zeeb 96482c7814 MFC r229127:
Remove a declaration to a non-existent function.
2012-02-09 16:12:25 +00:00
Bjoern A. Zeeb 1b514315f6 MF8 r224326:
Flush output buffers before closing TCP session.  Fixes the case where
 the proxy would eat the 221 response coming from the server towards the
 client.

 Obtained from:	OpenBSD r1.18
PR:		bin/154469
2012-02-09 09:01:03 +00:00
Bjoern A. Zeeb f732be0e00 MFC r223667:
In case ntp cannot resolve a hostname on startup it will queue the entry
 for resolving by a child process that, upon success, will add the entry
 to the config of the running running parent process.

 Unfortunately there are a couple of bugs with this, fixed in various
 later versions of upstream in potentially different ways due to other
 code changes:

 1) Upon server [-46] <FQDN> the [-46] are used as FQDN for later resolving
    which does not work.  Make sure we always pass the name (or IP there).

 2) The intermediate file to carry the information to the child process
    does not know about -4/-6 restrictions, so that a dual-stacked host
    could resolve to an IPv6 address but that might be unreachable (see
    r223626) leading to no working synchronization ignoring a IPv4 record.
    Thus alter the intermediate format to also pass the address family
    (AF_UNSPEC (default), AF_INET or AF_INET6) to the child process
    depending on -4 or -6.

 3) Make the child process to parse the new intermediate file format and
    save the address family for getaddrinfo() hints flags.

 4) Change child to always reload resolv.conf calling res_init() before
    trying to resolve names.  This will pick up resolv.conf changes or
    new resolv.confs should they have not existed or been empty or
    unusable on ntp startup.  This fix is more conditional in upstream
    versions but given FreeBSD has res_init there is no need for the
    configure logic as well.

 Approved by:	roberto
 Sponsored by:	Sandvine Incorporated
2012-02-09 07:52:44 +00:00
Bjoern A. Zeeb e2f25f58ec MFC r223626:
Compare port numbers correctly.  They are stored by SRCPORT()
 in host byte order, so we need to compare them as such.
 Properly compare IPv6 addresses as well.

 This allows the, by default, 8 badaddrs slots per address
 family to work correctly and only print sendto() errors once.

 The change is no longer applicable to any latest upstream versions.

 Approved by:   roberto
 Sponsored by:  Sandvine Incorporated
2012-02-09 07:28:17 +00:00
Sean Farley 90ccb6ff3e Merge from head to stable/7:
r230656:
msdos was renamed to msdosfs in 2001 by r77577.
2012-02-09 01:18:09 +00:00
Sean Farley cf3290fc2c Merge from head to stable/7:
r230655:
Since April 2, 2006, Indiana has observed DST.
2012-02-08 23:12:05 +00:00
Bjoern A. Zeeb ed74e6a58d MFC r223359:
Garbage collect never used global, sysctl, externs.
2012-02-08 19:20:11 +00:00
Bjoern A. Zeeb b4ef8c3d13 MFC r228641:
Allow toggling of IFCAP_VLAN_HWCSUM for hardware that supports checksum
 offloading on vlans and document the new option.
2012-02-08 18:51:25 +00:00
Bjoern A. Zeeb e0a9a1a85d Remove sun4v from universe targets.
Approved by:	re
2012-02-08 18:22:10 +00:00
Bjoern A. Zeeb 86a8840f3b MFC r222845:
Correct comments and debug logging in ipsec to better match reality.
2012-02-08 17:54:11 +00:00
Bjoern A. Zeeb e27d866234 MFC r225428:
Shorten a variable access some using a cached value rather than
 casting the input argument again, making the code more readable.

 Reviewed by:	jhb
2012-02-08 17:03:30 +00:00
Bjoern A. Zeeb 55f27647c9 MFC r225036:
Hide IPv6 next header parsing warnings under the verbose sysctl
 so people can possibly disable it when their consoles are flooded,
 or enabled it for debugging.
2012-02-08 16:45:20 +00:00
Bjoern A. Zeeb 701f3edbb8 MFC r225033:
If we detect an IPv6 fragment header and it is not the first fragment,
 then terminate the loop as we will not find any further headers and
 for short fragments this could otherwise lead to a pullup error
 discarding the fragment.

 Submitted by:	Matthew Luckie (mjl luckie.org.nz)
PR:		kern/145733
2012-02-08 16:26:01 +00:00
Bjoern A. Zeeb 190f6552c6 MFC r225032,225034:
ipfw internally checks for offset == 0 to determine whether the
 packet is a/the first fragment or not.  For IPv6 we have added the
 "more fragments" flag as well to be able to determine on whether
 there will be more as we do not have the fragment header avaialble
 for logging, while for IPv4 this information can be derived directly
 from the IPv4 header.  This allowed fragmented packets to bypass
 normal rules as proper masking was not done when checking offset.
 Split variables to not need masking for IPv6 to avoid further errors.

 After r225032 fix logging in a similar way masking the the IPv6
 more fragments flag off so that offset == 0 checks work properly.

 Submitted by:	Matthew Luckie (mjl luckie.org.nz)
PR:		kern/145733
2012-02-08 16:07:07 +00:00
Bjoern A. Zeeb 613a70fa19 MFC r225030:
While not explicitly allowed by RFC 2460, in case there is no
 translation technology involved (and that section is suggested to
 be removed by Errata 2843), single packet fragments do not harm.

 There is another errata and further drafts under discussion to clarify
 on these kinds of packets.
 Meanwhile add a sysctl to allow disabling this behaviour again.
 We will treat single packet fragment (a fragment header added
 when not needed) as if there was no fragment header.

 Submitted by:	Matthew Luckie (mjl luckie.org.nz) (original version)
PR:		kern/145733
2012-02-08 15:38:36 +00:00
Alexander Motin 85a2a6c587 MFC 230877:
Fix NULL dereference panic on attempt to turn off (on system shutdown)
disconnected swap device.

This is quick and imperfect solution, as swap device will still be opened
and GEOM will not be able to destroy it. Proper solution would be to
automatically turn off and close disconnected swap device, but with existing
code it will cause panic if there is at least one page on device, even if
it is unimportant page of the user-level process. It needs some work.
2012-02-08 07:34:03 +00:00
Jaakko Heinonen 2fbbb89ec7 MFC r229692:
Check the return value of sbuf_finish() in pfs_readlink() and return
ENAMETOOLONG if the buffer overflowed.
2012-02-06 17:31:13 +00:00
Sean Bruno a63f28a626 MFC r230313, r230316, r230323, r230588
Support new raid controllers
2012-02-05 19:22:20 +00:00
Dimitry Andric 13bbaf99c2 MFC r229753:
In sys/contrib/rdma/ib_addr.h, bump MAX_ADDR_LEN to 20 bytes (the same
value used in sys/ofed/include/linux/netdevice.h), so there will be no
buffer overruns in the rest of the inline functions in this file.

Reviewed by:	kmacy
2012-02-03 23:27:07 +00:00
Jaakko Heinonen 9ba822ae37 MFC r228359:
sbuf_data() hasn't returned NULL for overflowed buffers since r71721.
2012-02-01 17:07:29 +00:00
Jaakko Heinonen 5594a62e52 Partially MFC r228358: Fix markup. 2012-02-01 17:04:14 +00:00
Marius Strobl 02f118d2ae Add more sparc64 compatibility macros for the shared loader.
This is a direct commit to stable/7 in order to unbreak the build with
224371 in place.
2012-01-31 23:20:17 +00:00
Sergey Kandaurov 475e8295c4 MFC r230531: Remove unused variable. 2012-01-31 10:46:51 +00:00
Doug Barton 10cfee1e4e MFC r217071 and r217213:
Make the setting of the BIND CFLAG -DWORDS_BIGENDIAN conditional on the
TARGET_ENDIANNESS knob from bsd.endian.mk so that we can avoid having to
special-case each arch.

MFC r224093 (in part):

Stop claiming that we support atomic ops except on arches where we know
that they work. Many users have reported problems on the other arches,
so until they can get fixed we'll take the safe route.
2012-01-31 00:49:34 +00:00
Sergey Kandaurov b8be116c36 MFC r230613:
Remove a left-over reference to make.conf(5) for now-defunct -DVM_STACK
2012-01-30 12:32:22 +00:00
Eitan Adler 0bd69f37ac MFC r230327:
Add support for Sony Ericsson GC89 EDGE/Wirelles LAN PC Card

PR:		kern/131933
Approved by:	cperciva
2012-01-28 21:45:40 +00:00
Eitan Adler 5aef557784 MFC r230109:
- Document TheDraw splash screens in the default loader.conf

Approved by:	cperciva
2012-01-28 19:33:32 +00:00
Andre Oppermann 70dacd1476 MFC r226113 and r228016:
Prevent TCP sessions from stalling indefinitely in reassembly
 when reaching the zone limit of reassembly queue entries.

Reviewed by:	lstewart
2012-01-25 11:16:31 +00:00
Alan Cox 08f1f9aeb9 MFC r226163, r228317, and r228324
Fix the handling of an empty kmem map by sysctl_kmem_map_free().

  Eliminate the possibility of 32-bit arithmetic overflow in the
  calculation of vm_kmem_size that may occur if the system
  administrator has specified a vm.vm_kmem_size tunable value that
  exceeds the hard cap.

  Eliminate stale numbers from a comment.

PR:		162741
2012-01-21 07:57:27 +00:00
Lawrence Stewart 9c85055748 MFC r229898:
Consumers of bpfdetach() expect it to remove all bpf_if structs from the
bpf_iflist list which reference the specified ifnet. The existing implementation
only removes the first matching bpf_if found in the list, effectively leaking
list entries if an ifnet has been bpfattach()ed multiple times with different
DLTs.

Fix the leak by performing the detach logic in a loop, stopping when all bpf_if
structs referencing the specified ifnet have been detached and removed from the
bpf_iflist list.

Whilst here, also:

- Remove the unnecessary "bp->bif_ifp == NULL" check, as a bpf_if should never
  exist in the list with a NULL ifnet pointer.

- Except when INVARIANTS is in the kernel config, silently ignore the case where
  no bpf_if referencing the specified ifnet is found, as it is harmless and does
  not require user attention.

Reviewed by:	csjp
2012-01-21 04:24:19 +00:00
Jilles Tjoelker 59f0348973 MFC r227124: fifo_misc test: Fix swapped lseek arguments.
It worked regardless because SEEK_CUR happens to be 1.

PR:		misc/160866
2012-01-20 16:34:14 +00:00
Jilles Tjoelker b9cd8f4fef MFC r227123: lint: Fix lseek() argument order.
Because SEEK_SET is 0, this seems to have no effect on the generated code.

PR:		bin/160806
Submitted by:	Henning Petersen <henning dot petersen at t-online dot de>
Obtained from:	NetBSD
2012-01-20 15:46:46 +00:00
Don Lewis 85cf257a62 MFC: r229984
Pass the arguments to mtx_init() in the correct order.  There should be
no change to the binary because the value of MTX_DEF is zero and there
is a visible function prototype.
2012-01-18 21:51:56 +00:00
Bjoern A. Zeeb 04dca90fd2 MFC r225048:
In this branch when doing no further checkes there is no reason use
 the temporary variable and check with if as TUNABLE_*_FETCH do not
 alter values unless successfully found the tunable.
2012-01-17 22:09:33 +00:00
Bjoern A. Zeeb ebd17d62dc MFC r224516:
Introduce a tunable to disable the time consuming parts of bootup
 memtesting, which can easily save seconds to minutes of boot time.
 The tunable name is kept general to allow reusing the code in
 alternate frameworks.
2012-01-17 22:02:30 +00:00
Eitan Adler b436217e21 MFC r228343:
- Fix ktrace leakage if error is set

PR:		kern/163098
Approved by:	sbruno
2012-01-15 20:52:01 +00:00
Christian Brueffer 71c19a1d1c MFC: r229585
Fix typo.
2012-01-12 20:51:01 +00:00
Eitan Adler 3a0db83eb6 MFC r228445:
- Add support for ASCII art splash screens in TheDraw format

PR:		kern/143370
Approved by:	ed
2012-01-12 00:05:35 +00:00
Warren Block 34d2a6d9d3 MFC r227981:
Point out that @reboot runs at every cron startup, not just system
startup.

Approved by:	gjb (mentor)
2012-01-11 23:11:48 +00:00
Sergey Kandaurov ee26f1cb85 MFC r211801: fix typo.
Spotted by:	Ildar Hizbulin <hizel vyborg ru> (stable/7)
2012-01-11 17:21:22 +00:00
Yoshihiro Takahashi f37d7df378 MFC: revision 229462
Fix 230MB MO support.

  Submitted by:	Kaho Toshikazu
2012-01-11 13:59:49 +00:00
Eitan Adler 091a56ac85 - Remove extraneous null ptr deref checks
- Fix memory leak

Approved by:	jhb
2012-01-10 01:02:40 +00:00
Eitan Adler e10d1d5ea8 MFC r227535:
- add support for Titan VScom PCIex-800H

PR:		kern/124128
Approved by:	jhb
2012-01-10 00:35:25 +00:00
Eitan Adler ce875fe3e9 MFC r227532:
- add support for Broadcom 802.11bg/EDGE/GPRS CardBus (Serial)
	- correct mislabeling of 0x432214e4 device

PR:		kern/119606
Approved by:	jhb
2012-01-10 00:27:37 +00:00
Eitan Adler 3977786641 MFC 226404:
- add support for I-O DATA RSA-PCI2/R

PR:		kern/142999
Approved by:	jhb
2012-01-10 00:20:28 +00:00
Pyun YongHyeon ddfbbed55f MFC r198999:
Take a step towards removing if_watchdog/if_timer.  Don't explicitly set
  if_watchdog/if_timer to NULL/0 when initializing an ifnet.  if_alloc()
  sets those members to NULL/0 already.
2012-01-09 20:16:06 +00:00
Pyun YongHyeon 5cb6a91e9e MFC r212378:
Catch up to rename of the constant for the Master Data Parity Error bit in
  the PCI status register.
2012-01-09 20:08:57 +00:00
Pyun YongHyeon 1f3f313618 MFC r228717:
Increase wait time for OP_TCPSTART command processing.  It seems
  100us is not enough to ensure prefetch unit work.
2012-01-09 19:59:53 +00:00
Pyun YongHyeon 378c7cfa76 MFC r228716:
TCP header size is represented by number of 32bits words.
  Fix the TCP header size calculation such that makes TSO engine
  cache all header(ethernet/IP/TCP) bytes to its internal buffer.
  While here, remove extra pull up for TCP payload.  Unlike some
  em(4) controllers, fxp(4) does not require such work around for
  TSO.
  The two limitations are ethernet/IP/TCP header size should be less
  than or equal to the size of controller's internal buffer(80 bytes)
  and these header information should be found in the first fragment
  of a TSO frame.
2012-01-09 19:31:35 +00:00
Pyun YongHyeon 05c82251c9 MFC r228479-228480:
r228479:
  BCM5720 performance tweak from Broadcom.
   o Allow multiple outstanding read requests from non-LSO read DMA engine.
   o Allow 4KB burst length reads for non-LSO frames.
   o Enable 512B burst length reads for buffer descriptors.

r228480:
  Destroy DMA tag for jumbo RX buffer in device detach.
2012-01-09 19:23:29 +00:00
Pyun YongHyeon 225a464894 MFC r228476:
Rework link state tracking and remove superfluous link UP/DOWN
  messages.
   o Add check for actually resolved speed in miibus_statchg callback
     instead of blindly reprogramming BCE_EMAC_MODE register.  The
     callback may be called multiple times(e.g. link UP, link
     transition, auto-negotiate complete etc) while auto-negotiation
     is in progress.  All unresolved link state changes are ignored
     now and setting BCE_EMAC_MODE after link establishment is done
     once.
   o bce(4) is careful enough not to drive MII_TICK if driver got a
     valid link.  To detect lost link, bce(4) relied on link state
     change interrupt and if driver see the interrupt, it forced to
     drive MII_TICK by calling bce_tick() in interrupt handler.
     Because bce(4) generates multiple link state change interrupts
     while auto-negotiation is in progress, bce_tick() would be
     called multiple times and this resulted in generating multiple
     link UP/DOWN messages.
     With this change, bce_tick() is not called in interrupt handler
     anymore such that miibus_statchg callback handles link state
     changes with consistent manner.
2012-01-09 19:10:11 +00:00
Pyun YongHyeon 012b3d4444 MFC r218529:
- Updated firmware which improves small packet performance.
2012-01-09 18:55:28 +00:00
Pyun YongHyeon 491d6ffe11 MFC r210522,213489,218423,218527:
r210522:
  Fix an apparent typo.

r213489:
  Add the capability to read the complete contents of the NVRAM via sysctl
        dev.bce.<unit>.nvram_dump
  Add the capability to write the complete contents of the NVRAM via sysctl
        dev.bce.<unit>.nvram_write
  These are only available if the kernel option BCE_DEBUG is enabled.
  The nvram_write sysctl also requires the kernel option
  BCE_NVRAM_WRITE_SUPPORT to be enabled.  These are to be used at your
  own caution.  Since the MAC addresses are stored in the NVRAM, if you
  dump one NIC and restore it on another NIC the destination NIC's
  MAC addresses will not be preserved.  A tool can be made using these
  sysctl's to manage the on-chip firmware.

r218423:
  - Added systcls for header splitting, RX/TX buffer count, interrupt
    coalescing, strict RX MTU, verbose output, and shared memory debug.
  - Added additional debug counters (VLAN tags and split header frames).
  - Updated debug counters to 64 bit definitions.
  - Updated l2fhdr bit definitions.
  - Combined RX buffer sizing into a single function.
  - Added buffer size and interrupt coalescing settings to adapter info
    printout.

r218527:
  - Added error checking to nvram read functions.
  - Minor style updates.
2012-01-09 18:33:54 +00:00
Eitan Adler 783c6507e9 MFC r228233:
- Fix typos s/(more|less) then|\1 than/

Approved by:	brucec
2012-01-09 03:03:43 +00:00
Glen Barber 5bab6b189f MFC r229353:
- Trivial standardization to a few comments in kern.pre.mk.
2012-01-09 02:00:31 +00:00
Eitan Adler a70450626a MFC r228754:
- Add restrict keyword to glob(3)

PR:		kern/161958
Approved by:	jilles
2012-01-08 21:01:51 +00:00
Kevin Lo 2c74f290ef MFC r227871:
Remove unused variable mii.
This variable is initialized but not used.

Reviewed by:	yongari
2012-01-07 16:14:53 +00:00
Eitan Adler 4ebba4b2c4 MFC r227491:
-  new sentence should start on new line.

Approved by:	gjb
2012-01-07 03:31:40 +00:00
Glen Barber fb46cf8ac0 MFC r209362, r210933, r228356:
r209362 (brian) [1]:
- Add a -t switch for masking output that's above or below certain
  thresholds.  This switch makes it a lot easier to locate problem
  areas when a process is threatening to consume all of your disk
  space.

r210933 (joel):
- Fix typos and spelling mistakes.

r228356 [2]:
- Update du(1):

  - Sort arguments alphabetically where appropriate
  - '-B blocksize' is not mutually exclusive of '-h|-k|-m'
  - Mention '-t' in synopsis
  - Other wording improvements
  - Update usage() output to reflect the new synopsis
  - Other miscellaneous improvements

Approved by:	brian [1]
PR:		162438 [2]
2012-01-07 01:39:38 +00:00
Pyun YongHyeon ef1bca715f MFC r207761:
Add a fastpath to allocate from packet zone when using m_getjcl.
  This will add support for packet zone for at least igb and ixgbe
  and will avoid to check for that in bce and mxge.
2012-01-07 01:12:21 +00:00
Pyun YongHyeon 4bb4f6a47a MFC r180509,181362,215835,228370:
Belatedly add man page for et(4) and catch up with all changes.

r180509:
  Manpage for the et(4) driver.

r181362:
  Comment out information about Jumbo Frame support, it's not
  implemented yet.  While here, fix a whitespace nit.

r215835:
  Add a HARDWARE section.

r228370:
  After r228293, et(4) supports altq(4).
2012-01-07 00:05:20 +00:00
Pyun YongHyeon d7819f7cb6 MFC r228333,228335-228336,228362,228368-228369,228381:
r228333:
  Protect SIOCSIFMTU ioctl handler with driver lock.
  Don't blindly re-initialize controller whenever MTU is changed.
  Now, reinitializing is done only when driver is running.

  While here, remove unnecessary assignment of error value since it
  was already initialized to 0.

r228335:
  Consistently use a tab character instead of using either a space or
  tab after #define.
  While I'm here consistently use capital letters when it uses
  hexadecimal notation.

  No functional changes.

r228336:
  Disable all clocks and put PHY into COMA before entering into
  suspend state.  This will save more power.
  On resume, make sure to enable all clocks.  While I'm here, if
  controller is not fast ethernet, enable gigabit PHY.

r228362:
  Do not disable interrupt without knowing whether the raised
  interrupt is ours.  Note, interrupts are automatically ACKed when
  the status register is read.
  Add RX/TX DMA error to interrupt handler and do full controller
  reset if driver happen to encounter these errors.  There is no way
  to recover from these DMA errors without controller reset.
  Rename local variable name intrs with status to enhance
  readability.

  While I'm here, rename ET_INTR_TXEOF and ET_INTR_RXEOF to
  ET_INTR_TXDMA and ET_INTR_RXDMA respectively.  These interrupts
  indicate that a frame is successfully DMAed to controller's
  internal FIFO and they have nothing to do with EOF(end of frame).
  Driver does not need to wait actual end of TX/RX of a frame(e.g.
  no need to wait the end signal of TX which is generated when a
  frame in TX FIFO is emptied by MAC).  Previous names were somewhat
  confusing.

r228368:
  Remove unnecessary definition of ET_PCIR_BAR.  Controller support
  I/O memory only.
  While here, use pci_set_max_read_req(9) rather than directly
  manipulating PCIe device control register.

r228369:
  Announce flow control ability to PHY driver and enable RX flow
  control.  Controller does not automatically generate pause frames
  based on number of available RX buffers so it's very hard to
  know when driver should generate XON frame in time.  The only
  mechanism driver can detect low number of RX buffer condition is
  ET_INTR_RXRING0_LOW or ET_INTR_RXRING1_LOW interrupt.  This
  interrupt is generated whenever controller notices the number of
  available RX buffers are lower than pre-programmed value(
  ET_RX_RING0_MINCNT and ET_RX_RING1_MINCNT register).  This scheme
  does not provide a way to detect when controller sees enough number
  of RX buffers again such that efficient generation of XON/XOFF
  frame is not easy.

  While here, add more flow control related register definition.

r228381:
  FreeBSD driver does not require arpcom structure in softc.
2012-01-06 21:46:35 +00:00
Pyun YongHyeon 69a2f96b0e MFC r228326-228327,228331-228332:
r228326:
  Controller does not require TX start command for every frame.  So
  send a single TX command after setting up all TX frames.  This
  removes unnecessary register accesses and bus_dmamap_sync(9) calls.
  et(4) uses TX interrupt moderation so it's possible to have TX
  buffers that were already transmitted but waiting for TX completion
  interrupt.  If the number of available TX descriptor is less then
  1/3 of total TX descriptor, try reclaiming first to get enough free
  TX descriptors before setting up TX descriptors.
  After r228325, et_txeof() no longer tries to send frames after
  reclaiming TX buffers.  That change was made to give more chance
  to transmit frames in main interrupt handler since we can still
  send frames in interrupt handler with RX interrupt.  So right
  before exiting interrupt hander, after enabling interrupt, try to
  send more frames.  This gives slightly better performance numbers.

  While I'm here reduce number of spare TX descriptors from 8 to 4.
  Controller does not require reserved TX descriptors, it was just to
  reduce TX overhead.  After r228325, driver has much lower TX
  overhead so it does not make sense to reserve 8 TX descriptors.

r228327:
  Remove et_enable_intrs(), et_disable_intrs() functions and
  manipulation of interrupt register access is done through
  CSR_WRITE_4 macro.  Also add disabling interrupt into et_reset()
  because we want interrupt disabled state after controller reset.
  While I'm here slightly change interrupt handler to be more
  readable one.

r228331:
  Rework link state tracking and TX/RX MAC configuration.
   o Do not report link status if driver is not running.
   o TX/RX MAC configuration should be done with resolved speed,
     duplex and flow control after establishing a link so it can't
     be done in driver initialization routine.
     Move the configuration to miibus_statchg callback which will be
     called whenever any link state change is detected.
     At this moment, flow-control is not enabled yet mainly because
     I was not able to set correct flow control parameters to
     generate TX pause frames.
   o Now TX/RX MAC is enabled only when a valid link is detected.
     Rearragnge hardware initialization routine a bit to leave
     enabling MAC to miibus_statchg callback.  In order to that,
     TX/RX DMA engine is enabled in et_init_locked().
   o Introduce ET_FLAG_LINK flag to track current link state.
   o Introduce ET_FLAG_FASTETHER flag to mark whether controller is
     fast ethernet.  This flag is checked in miibus_statchg callback
     to know whether PHY established a valid link.
   o In et_stop(), TX/RX MAC is explicitly disabled instead of
     relying on et_reset().  And move et_reset() from et_stop() to
     controller initialization.  Controler reset is not required here
     and it would also clear critial registers(i.e station address,
     RX filter configuration, WOL etc) that are required to make WOL
     work.
   o Switching to current media is done in et_init_locked() after
     setting IFF_DRV_RUNNING flag.  This should ensure reliable
     auto-negotiation/manual link establishment.
   o In et_start_locked(), check whether driver got a valid link
     before trying to send frames.
   o Remove checking a link in et_tick() as this is done by
     miibus_statchg callback.

r228332:
  Implement hardware MAC statistics counter.  Counters could be
  queried with dev.et.%d.stats sysctl node where %d is an instance of
  device.
2012-01-06 19:27:51 +00:00
Pyun YongHyeon 3ad9090b81 MFC r228325:
Overhaul bus_dma(9) usage in et(4) and clean up TX/RX path.  This
  change should make et(4) work on any architectures.
   o Remove m_getl inline function and replace it with stanard mbuf
     interfaces.  Previous code tried to minimize code duplication
     but this came from incorrect use of common DMA tag.
     Driver may be still use a common RX allocation handler with
     additional structure changes but I don't see much point to do
     that it would make it hard to understand the code.
   o Remove DragonflyBSD specific constant EVL_ENCAPLEN, use
     ETHER_VLAN_ENCAP_LEN instead.
   o Add bunch of new RX status definition.  It seems controller
     supports RX checksum offloading but I was not able to make the
     feature work yet.  Currently driver checks whether recevied
     frame is good one or not.
   o Avoid a typedef ending in '_t' as style(9) says.
   o Controller has no restriction on DMA address space, so there
     is no reason to limit the DMA address to 32bit.  Descriptor
     rings,  status blocks and TX/RX buffers now use full 64bit DMA
     addressing.
   o Allocate DMA memory shared between host and controller as
     coherent.
   o Create 3 separate DMA tags to be used as TX, mini RX ring and
     stanard RX ring.  Previously it created a single DMA tag and it
     was used to all three rings.
   o et(4) does not support jumbo frame at this moment and I still
     don't quite understand how jumbo frame works on this controller
     so use two RX rings to handle small sized frame and normal sized
     frame respectively.  The mini RX ring will be used to receive
     frames that are less than or equal to 127 bytes.  The second RX
     ring is used to receive frames that are not handled by the first
     RX ring.
     If jumbo frame support is implemented, driver may have to choose
     better RX scheme by letting the second RX ring handle jumbo
     frames.  This scheme will mimic Broadcom's efficient jumbo frame
     handling feature.  However RAM buffer size(16KB) of the
     controller is too small to hold 2 jumbo frames, if 9KB
     jumbo frame is used, I'm not sure how good performance would it
     have.
   o In et_rxeof(), make sure to check whether controller received
     good frame or not.  Passing corrupted frame to upper layer is
     bad idea.
   o If driver receives a bad frame or driver fails to allocate RX
     buffer due to resource shortage condition, reuse previously
     loaded DMA map for RX buffer instead of unloading/loading RX
     buffer again.
   o et_init_tx_ring() never fails so change return type to void.
   o In watchdog handler, show TX DMA write back status of errored
     frame which could be used as a clue to debug watchdog timeout.
   o Add missing bus_dmamap_sync() in various places such that et(4)
     should work with bounce buffers(e.g. PAE).
   o TX side bus_dmamap_load_mbuf_sg(9) support.
   o RX side bus_dmamap_load_mbuf_sg(9) support.
   o Controller has no DMA alignment limit in RX buffer so use
     m_adj(9) in RX buffer allocation to make IP header align on 2
     bytes boundary.  Otherwise it would trigger unaligned access
     error in upper layer on strict alignment architectures.
     One of down side of controller is it provides limited set of RX
     buffer length like most Intel controllers.  This is not problem
     at this moment because driver does not support jumbo frame yet
     but it may require alignment fixup code to support jumbo frame
     on strict alignment architectures.
   o In et_txeof(), don't zero TX descriptors for transmitted frames.
     TX descriptors don't need write access after transmission.
     Driver sets IFF_DRV_OACTIVE when the number of available TX
     descriptors are less than or equal to ET_NSEG_SPARE.  Make sure
     to clear IFF_DRV_OACTIVE only when the number of available TX
     descriptor is greater than ET_NSEG_SPARE.
2012-01-06 19:12:47 +00:00
Pyun YongHyeon 570a58be9f MFC r228291-228293,228297-228298:
r228291:
  Remove NetBSD license. r199548 removed all bit macros that were
  derived from NetBSD.

r228292:
  Implement suspend/resume methods.  Driver has no issue with
  suspend/resume.

r228293:
  Fix alt(4) support.  Also add check for number of available TX
  descriptors before trying to send frames.  If we're not able to
  send a frame, make sure to prepend it to if_snd queue such that
  alt(4) should work.

  While I'm here prefer ETHER_BPF_MTAP to BPF_MTAP.  ETHER_BPF_MTAP
  should be used for controllers that support VLAN hardware tag
  insertion.  The controller supports VLAN tag insertion but lacks
  VLAN tag stripping in RX path though.

r228297:
  et(4) supports VLAN oversized frame so correctly set header length.
  While I'm here remove initializing if_mtu, it is set by
  ether_ifattach(9).  Also move callout_init_mtx(9) to the right below
  driver lock initialization.

r228298:
  Make et_probe() return BUS_PROBE_DEFAULT such that allow other
  driver that has high precedence for the controller override et(4).
  Add missing callout_drain(9) in device detach and rework detach
  routine.  While I'm here use rman_get_rid(9) instead of using
  cached resource id because bus methods are free to change the
  id.
2012-01-06 18:18:25 +00:00
Eitan Adler b9014d7368 MFC r227488:
- add "check" option to MD5 and friends to compare files against known hash.

Approved by: cperciva
2012-01-06 02:28:21 +00:00
Pyun YongHyeon 424217d861 MFC r228286:
Fix off by one error in mbuf access.  Previously it caused panic.
  While I'm here use NULL to compare mbuf pointer and add additional
  check for zero length mbuf before accessing the mbuf.

  PR:	kern/162932
2012-01-05 21:18:34 +00:00
Pyun YongHyeon ffccf262a8 MFC r228205:
Add more controllers that support jumbo frame.
2012-01-05 20:37:42 +00:00
Pyun YongHyeon 16f56932f0 MFC r228086:
Announce flow control capability to PHY drivers and enable flow
  control for all vr(4) controllers that support it.  It's known that
  old vr(4) controllers(Rhine II) does not support TX pause but Rhine
  III supports both TX and RX pause.
  Make TX pause really work on Rhine III by letting controller know
  available RX buffers.
  While here, adjust XON/XOFF parameters to get better performance
  with flow control.
2012-01-05 20:33:20 +00:00
Pyun YongHyeon 05984c246b MFC r228084:
Reuse flag variable to represent driver internal states rather than
  using member variables in softc.
  While I'm here change media after setting IFF_DRV_RUNNING. This
  will remove unnecessary link state handling in vr_tick() if
  controller established a link immediately.
2012-01-05 18:24:02 +00:00
Eitan Adler e5bf147121 MFC r227458, r226436:
- change "is is" to "is" or "it is"
- change "the the" to "the"
- other typo fixes

Approved by:	lstewart
2012-01-05 04:50:10 +00:00
Pyun YongHyeon c08688cdff MFC r227842:
For IP1001 PHY, do not set multi-port device(MASTER).  Ideally this
  bit should not affect link establishment process of auto-negotiation
  if manual configuration is not used, which is true in auto-negotiation.
  However it seems setting this bit interfere with IP1001 PHY's
  down-shifting feature such that establishing a 10/100Mbps link failed
  when 1000baseT link is not available during auto-negotiation process.
2012-01-05 00:11:04 +00:00
Pyun YongHyeon ef767bf7e0 MFC r227828,227835,227837:
r227828:
  Always start MII auto polling before accessing any MII registers.

r227835:
  Rework link establishment and link state detection logic.
   - Remove MIIBUS statchg callback and program VGE_DIAGCTL before
     initiating link establishment.  Previously driver used to
     program VGE_DIAGCTL after getting a link in statchg callback.
     It seems the VGE_DIAGCTL register works like a kind of MII
     register such that it requires setting a 'to be' mode in advance
     rather than relying on resolved speed/duplex of established link.
     This means the statchg callback is not needed in driver.  In
     addition, if there was no link at the time of media change, this
     was not called at all.
   - Introduce vge_ifmedia_upd_locked() to change current media to
     configured one.  Actual media change is performed only after PHY
     reset and VGE_DIAGCTL setup.
   - In WOL configuration, make sure to clear forced mode such that
     controller can rely on auto-negotiation.
   - Unlike most other drivers that use miibus(4), vge(4) used
     controller's auto-polling feature for link state tracking via
     interrupt.  This came from controller's inefficient mechanism to
     access MII registers.  On link state change interrupt, vge(4)
     used to get current link state with series of MII register
     accesses.  Because vge(4) already enabled auto polling, read PHY
     status register to resolved speed/duplex/flow control parameters.

  vge(4) still does not drive MII_TICK to reduce number of MII
  register accesses which in turn means the driver does not know the
  status of auto-negotiation.  This was a one of long standing
  issue of vge(4).  Probably driver may be able to implement a timer
  that keeps track of auto-negotiation state and restart
  auto-negotiation when driver couldn't establish a link within a
  specified period.  However the controller does not provide a
  reliable way to detect auto-negotiation failure so I'm not sure
  whether it's worth to implement it in driver.

  Alternatively driver can completely disable MII auto-polling and
  let miibus(4) poll link state by driving MII_TICK.  This may reduce
  unnecessary overhead of stopping/restarting MII auto-polling of
  controller.  Unfortunately it was known that some variants of
  controller does not work correctly if MII auto-polling is disabled.

r227837:
  Announce flow control capability to underlying PHY driver.
  Pause timer value is initialized to 0xFFFF. Controller allows just
  4 different TX pause thresholds. The lowest possible threshold
  value looks too aggressive so use next available threshold value.
2012-01-05 00:01:49 +00:00
Pyun YongHyeon e721d7a774 MFC r227850-227851,227854,227914,227916:
r227850:
  Writing access to RL_CFG5 register also requires EEPROM write
  access.
  While I'm here, enable WOL through magic packet but disable waking
  up system via unicast, multicast and broadcast frames.  Otherwise,
  multicast or unicast frame(e.g. ICMP echo request) can wake up
  system which is not probably wanted behavior on most environments.
  This was not known as problem because RL_CFG5 register access had
  not effect until this change.
  The capability to wake up system with unicast/multicast frames
  are still set in driver, default off, so users who need that
  feature can still activate it with ifconfig(8).

r227851:
  Perform media change after setting IFF_DRV_RUNNING flag. Without it,
  driver would ignore the first link state update if controller
  already established a link such that it would have to take
  additional link state handling in re_tick().

r227854:
  Disable accepting frames in re_stop() to put RX MAC into idle state.
  Because there is no reliable way to know whether RX MAC is in
  stopped state, rejecting all frames would be the only way to
  minimize possible races.
  Otherwise it's possible to receive frames while stop command
  execution is in progress and controller can DMA the frame to freed
  RX buffer during that period.
  This was observed on recent PCIe controllers(i.e. RTL8111F).

  While this change may not be required on old controllers it
  wouldn't make negative effects on old controllers.  One side effect
  of this change is disabling receive so driver reprograms RL_RXCFG
  to receive WOL frames when it is put into suspend or shutdown.

  This should address occasional 'memory modified free' errors seen
  on recent RealTek controllers.

r227914:
  Make sure to stop TX MAC before freeing queued TX frames.
  For RTL8111DP, check if the TX MAC is active by reading RL_GTXSTART
  register.  For RTL8402/8168E-VL/8168F/8411, wait until TX queue is
  empty.

r227916:
  To save more power, switch to 10/100Mbps link when controller is
  put into suspend/shutdown.  Old PCI controllers performed that
  operation in firmware but for RTL8111C or newer controllers, it's
  responsibility of driver.  It's not clear whether the firmware of
  RTL8111B still downgrades its speed to 10/100Mbps so leave it as it
  was.
2012-01-04 23:32:50 +00:00
Pyun YongHyeon d52f3fb62a MFC r227587,227590-227591,227593,227638-227639:
r227587:
  Add preliminary support for RTL8402 PCIe FastEthernet with
  integrated card reader.

r227590:
  Add preliminary support for RTL8411 PCIe Gigabit ethernet with
  integrated card reader.

r227591:
  Add missing driver lock in SIOCSIFCAP handler.

r227593:
  Disable PCIe ASPM (Active State Power Management) for all
  controllers.
  More and more RealTek controllers started to implement EEE feature.
  Vendor driver seems to load a kind of firmware for EEE with
  additional PHY fixups.  It is known that the EEE feature may need
  ASPM support.  Unfortunately there is no documentation for EEE of
  the controller so enabling ASPM may cause more problems.

r227638:
  Add preliminary support for second generation RTL8105E PCIe
  FastEthernet.

r227639:
  Add preliminary support for RTL8168/8111F PCIe Gigabit ethernet.
2012-01-04 22:57:04 +00:00
Pyun YongHyeon ddaedd4cde MFC r227582:
Enable 64bit DMA addressing support for all msk(4) controllers.
  Unnecessarily complex LE format used on Marvell controller was
  main reason not to enable 64bit DMA addressing in driver.  If high
  32bit address of DMA address of TX/RX buffer is changed, driver has
  to generate a new LE.  In TX path, driver will keep track of lastly
  used high 32bit address of DMA address and generate a new LE
  whenever it sees high address change in the DMA address. In RX path,
  driver will always use two LEs to specify 64bit DMA address of RX
  buffer.  If the high 32bit address of DMA address of RX buffer is
  the same as previous DMA address of RX buffer, driver does not have
  to use two LEs but driver will use two LEs for simplicity in RX
  ring management.

  One of draw back for switching to 64bit DMA addressing is that the
  large amount of LEs are used to specify 64bit DMA address such that
  number of available LEs for TX/RX buffers are considerably reduced.
  To mitigate the issue, increase number of available LEs from 256 to
  384 for TX and from 256 to 512 for RX. For 32bit architectures,
  msk(4) does not use 64bit DMA addressing to save resources.
2012-01-04 21:54:20 +00:00
Pyun YongHyeon 8d980ddf5d MFC r227452:
To send a frame, controller requires a prepended TX header and
  the length of frame should be treated as multiple of 4. Actual
  frame length is set in the TX header. The TX header position
  should be aligned on 4 byte boundary and actual frame start
  position should be aligned on 4 byte boundary as well. This means
  we need 4(TX header length) + 3(frame length fixup) additional free
  space in TX buffer in addition to actual frame length.
  Make sure TX handler check these additional bytes.
  ae_tx_avail_size() returns actual free space in TX buffer to ease
  the calculation of available TX buffer space in caller. While I'm
  here, replace magic number to appropriate sizeof operator to
  enhance readability.

  This change should fix controller lockup issue happened under
  certain conditions but it still does not fix watchdog timeout. It
  seems the watchdog timeout is side-effect of TxS and TxD
  mismatches. The root cause of TxD/TxD mismatch is not known yet but
  it looks like silicon bug. I guess driver may have to reinitialize
  controller whenever it sees TxS and TxD mismatches but leave it as
  it was at this moment.

  PR:	kern/145918
2012-01-04 21:28:49 +00:00
Sergey Kandaurov 004c780b74 MFC r227792:
Add history for setsockopt(2).

PR:		docs/162719
Submitted by:	Niclas Zeising <niclas at zeising gmail>
2012-01-04 14:55:24 +00:00
Sergey Kandaurov 1a9782429a MFC r227055:
Remove a couple of write-only variables.
2012-01-04 14:06:17 +00:00
Eitan Adler e573e6823f MFC r226482
- remove device keyword from makefs manpage

Approved by: gjb
2012-01-04 02:03:15 +00:00
Pyun YongHyeon 3767299e6d MFC r227675:
Partially revert r218788. r218788 removed calling dc_setcfg() for
  !DC_IS_ADMTEK in dc_miibus_statchg(). This change broke link
  establishment of Intel 21143 with dcphy(4) where it stuck in
  "ability detect" state without completing auto-negotiation.
  Also nuke dc_if_media as it's not actually used.
2012-01-04 01:53:53 +00:00
Rick Macklem 0438c40380 MFC: r227690
The old NFS client will crash due to the reply being m_freem()'d
twice if the server bogusly returns an error with the NFSERR_RETERR
bit (bit 31) set. No actual NFS error has this bit set, but it seems
that amd will sometimes do this. This patch makes sure the NFSERR_RETERR
bit is cleared to avoid a crash.
This is not exactly a merge, since the code is in sys/nfsclient/nfs_socket.c,
which does not exist in head.

Tested by:	martin at lispworks.com
PR:		kern/153847
2012-01-04 00:51:05 +00:00
Pyun YongHyeon d413d3375d MFC r227349,227513-227514:
r227349:
  Document TI_SF_BUF_JUMBO and Xr altq.

r227513:
  Document newly introduced a loader tunable and sysctl variables.

r227514:
  Clarify hw.ti.%d.dac tunable.
2012-01-04 00:04:01 +00:00
Pyun YongHyeon 4edb8f831c MFC r227348:
ti(4) supports altq(4).
2012-01-03 23:58:02 +00:00
Pyun YongHyeon 81b086da70 MFC r227512:
Overhaul bus_dma(9) usage in driver:
   - Don't use a single big DMA block for all rings. Create separate
     DMA area for each ring instead.  Currently the following DMA
     areas are created:
        Event ring, standard RX ring, jumbo RX ring, RX return ring,
        hardware MAC statistics and producer/consumer status area.
     For Tigon II, mini RX ring and TX ring are additionally created.
   - Added missing bus_dmamap_sync(9) in various TX/RX paths.
   - TX ring is no longer created for Tigon 1 such that it saves more
     resources on Tigon 1.
   - Data sheet is not clear about alignment requirement of each ring
     so use 32 bytes alignment for normal DMA area but use 64 bytes
     alignment for jumbo RX ring where the extended RX descriptor
     size is 64 bytes.
   - For each TX/RX buffers use separate DMA tag(e.g. the size of a
     DMA segment, total size of DMA segments etc).
   - Tigon allows separate DMA area for event producer, RX return
     producer and TX consumer which is really cool feature.  This
     means TX and RX path could be independently run in parallel.
     However ti(4) uses a single driver lock so it's meaningless
     to have separate DMA area for these producer/consumer such that
     this change creates a single status DMA area.
   - It seems Tigon has no limits on DMA address space and I also
     don't see any problem with that but old comments in driver
     indicates there could be issues on descriptors being located in
     64bit region.  Introduce a tunable, dev.ti.%d.dac, to disable
     using 64bit DMA in driver. The default is 0 which means it would
     use full 64bit DMA.  If there are DMA issues, users can disable
     it by setting the tunable to 0.
   - Do not increase watchdog timer in ti_txeof(). Previously driver
     increased the watchdog timer whenever there are queued TX frames.
   - When stat ticks is set to 0, skip processing ti_stats_update(),
     avoiding bus_dmamap_sync(9) and updating if_collisions counter.
   - MTU does not include FCS bytes, replace it with
     ETHER_VLAN_ENCAP_LEN.

  With these changes, ti(4) should work on PAE environments.
  Many thanks to Jay Borkenhagen for remote hardware access.
2012-01-03 23:46:45 +00:00
Pyun YongHyeon 5c36f47912 MFC r227431-227432,227505,227509:
r227431:
  style.
  No functional changes.

r227432:
  Remove dead ifdef.  Driver should always check raised interrupt is
  for the device.

r227505:
  It's bad idea to allocate large memory, 4KB, from stack.
  Pre-allocate the memory in device attach time. While I'm here
  remove unnecessary reassignment of error variable as it was already
  initialized. Also added a missing driver lock in TIIOCSETTRACE
  handler.

r227509:
  Export sysctl node for various interrupt moderation parameters and
  have administrators control them.  ti(4) provides a character
  device to control various other features of driver via ioctls but
  users had to write their own code to manipulate these parameters.
  It seems some default values for these parameters are not optimal
  on today's system but leave it as it was and let administrators
  change them.  The following parameters could be changed:

  dev.ti.%d.rx_coal_ticks
  dev.ti.%d.rx_max_coal_bds
  dev.ti.%d.tx_coal_ticks
  dev.ti.%d.tx_max_coal_bds
  dev.ti.%d.tx_buf_ratio
  dev.ti.%d.stat_ticks

  The interface has to be brought down and up again before a change
  takes effect.

  ti(4) controller supports hardware MAC counters with additional
  DMA statistics.  So it's doable to export these counters via
  sysctl interface.  Unfortunately, these counters are cumulative
  such that driver have to either send an explicit clear command to
  controller after extracting them or have to maintain internal
  counters to get actual changes.  Neither look good to me so
  counters were not exported via sysctl.
2012-01-03 23:39:30 +00:00
Pyun YongHyeon 39904059f8 MFC r227347,227367:
r227347:
  Retire 'options TI_PRIVATE_JUMBOS' and replace local jumbo
  allocator with UMA backed jumbo allocator by default. Previously
  ti(4) used sf_buf(9) interface for jumbo buffers but it was broken
  at this moment such that enabling jumbo frame caused instant panic.
  Due to the nature of sf_buf(9) it heavily relies on VM changes but
  it seems ti(4) was not received much blessing from VM gurus.  I
  don't understand VM magic and implications used in driver either.
  Switching to UMA backed jumbo allocator like other network drivers
  will make jumbo frame work on ti(4).
  While I'm here, fully allocate all RX buffers. This means ti(4) now
  uses 512 RX buffer and 1024 mini RX buffers.

  To use sf_buf(9) interface for jumbo buffers, introduce a new
  'options TI_SF_BUF_JUMBO'. If it is proven that sf_buf(9) is better
  for jumbo buffers, interesting developers can fix the issue in
  future.

  ti(4) still needs more bus_dma(9) cleanups and should use separate
  DMA tag/map for each ring(standard, jumbo, mini, command, event
  etc) but it should work on all platforms except PAE.

  Special thanks to Jay[1] who provided complete remote debugging
  access.

r227367:
  Comment out TI_JUMBO_HDRSPLIT. TI_JUMBO_HDRSPLIT requires TI_SF_BUF_JUMBO.
2012-01-03 21:21:25 +00:00
Pyun YongHyeon b4d1f7ecce MFC r227311-227312,227318-227319,227322-227324:
r227311:
  Remove ti_unit member variable in softc.
  While I'm here use PCIR_BAR macro.

r227312:
   o Remove unnecessary controller reinitialization.
   o Do not blindly UP controller when MTU is changed. Reinitialize
     controller only if driver is running.
   o Remove useless ti_stop() in ti_watchdog() since ti_init_locked()
     always invokes ti_stop().

r227318:
  Track which ring was updated in RX handler and update only modified
  ring. This should reduce unnecessary register accesses.

r227319:
  Mini ring is not available on Tigon 1 so do not create DMA maps for
  mini ring on Tigon 1 to save resources.

r227322:
  Show RX buffer allocation failure and do not blindly send alive
  message to firmware. Probably the correct way for this error is to
  send a TI_CMD_CODE_STACK_DOWN message to firmware and let firmware
  handle the rest.

r227323:
  If ti_chipinit() fails in ti_stop(), ignore the error and release
  all allocated TX/RX buffer resources. If the interface is brought
  to up again after the error, we will leak allocated TX/RX buffers.

r227324:
  Do not allow changing MTU to be less than the minimum.
2012-01-03 20:52:05 +00:00
Pyun YongHyeon 143264b254 MFC r227091-227095,227098-227099:
r227091:
  Make sure to unload loaded DMA area(descriptor, command, event ring).

r227092:
  Paritial merge since IFCAP_LINKSTATE capability is not available
  on stable/7.
  Hide superfluous link up/down message under bootverbose since
  if_link_state_change(9) shows that information.
  While I'm here, change baudrate with the resolved speed of the
  established link instead of blindly setting it 1G. Unfortunately,
  it seems there is no way to differentiate 10/100Mbps from
  non-gigabit link so just assume we established a 100Mbps link if
  current link is not a gigabit link.

r227093:
  Introduce ti_ifmedia_upd_locked() to use in driver initialization
  and add missing driver lock for both ti_ifmedia_upd() and
  ti_ifmedia_sts().

r227094:
  Don't clear upper 4bits from VLAN tag information.  It's
  responsibility of vlan(4) to extract VLAN id from the tag
  information and vlan(4) correctly handles it.

r227095:
  Don't abuse if_hwassist and make sure enabling corresponding TX/RX
  checksum offloading and VLAN hardware tag insertion/stripping from
  the currently enabled hardware offloading capabilities.
  Previously if_hwassist, which was initialized to TX/RX checksum
  offloading, was blindly used to enable both TX and RX checksum
  offloading such that disabling either TX or RX checksum offloading
  was not possible.

  ti(4) controllers support TX/RX checksum offloading with VLAN
  tagging so announce TX/RX checksum offloading capability over VLAN
  to vlan(4).

  Make VLAN hardware tag insertion/stripping honors currently enabled
  interface capability instead of blindly enabling VLAN hardware
  tagging. This change allows disabling hardware support of VLAN tag.

  Because ti(4) supports VLAN oversized frames, make network stack
  know the capability by setting if_hdrlen.

  While I'm here, rewrite SIOCSIFCAP handler and make sure to
  reinitialize controller whenever TX/RX checksum offloading and VLAN
  hardware tagging option is changed.  The requirement of controller
  reinitialization comes from the limitation of Tigon I/II firmware.
  Tigon I/II firmware requires all related RCBs should be
  reinitialized whenever any of its hardware offloading capabilities
  change.

  vlan(4) is also notified whenever the parent interface's capability
  changes such that it can correctly handle TX/RX checksum offloading
  based on parent interface's enabled offloading capabilities.

  RX checksum offloading handler was changed to make upper stack use
  controller computed partial checksum value.  Previously, ti(4) just
  set the computed value for any frames(IPv4, IPv6) and the value was
  not used in upper stack because driver didn't set CSUM_DATA_VALID
  such that upper network stack had to recompute checksum of TCP/UDP
  packets. I have no idea how this was not noticed for a long time.
  With this change, upper network stack does not have to fully
  recompute the checksum such that calculating pseudo checksum based
  on partial checksum is sufficient to know whether received packet's
  checksum is correct or not. However, I don't know why ti(4) does
  not have controller compute pseudo checksum as controller has
  ability to do it. I'm just guessing enabling that feature could
  trigger a firmware bug or could be slower than computing it on host
  side so just leave it as it was.

  In order not to produce false positives, ti(4) now checks whether
  controller actually computed IP or TCP/UDP checksum by checking
  ti_flags field.

r227098:
  Because ti(4) drops a driver lock in RX handler, check whether
  driver is still running before re-enabling interrupts.

r227099:
  Implement altq(4) support.
  While I'm here fix a logic error in r227098 where it didn't
  re-enable interrupts when TX queue is empty.
2012-01-03 20:28:17 +00:00
Pyun YongHyeon 0c7c9615ed MFC r219547:
- Allocate the DMA memory shared between the host and the controller as
    coherent.
  - Constify the ti_devs table.
  - Don't bother to set if_mtu to ETHERMTU, ether_ifattach() does that.
2012-01-03 19:22:28 +00:00
Pyun YongHyeon 3512f7c893 MFC r227086-227089:
r227086:
  Use ANSI function definations.

r227087:
  No functional changes.

r227088:
  Make ti(4) build with 'options TI_PRIVATE_JUMBOS'.
  This was broken in r175872.

  We have a UMA backed jumbo allocator and that is much better
  implementation than having a local jumbo buffer allocator in
  driver. This local allocator would be removed in near future but
  fixing build before removal wouldn't be a bad idea.

r227089:
  s/u_intXX_t/uintXX_t/g
2012-01-03 19:01:54 +00:00
Fabien Thomas 27998d850a MFC r228438:
There's a small set of events on Nehalem, that are not supported in
processors with CPUID signature 06_1AH, 06_1EH, and 06_1FH.
2012-01-03 17:19:57 +00:00
Fabien Thomas e1630047b8 MFC r228198:
Update Westmere uncore event exception list.
2012-01-03 17:07:11 +00:00
Pyun YongHyeon 4cd0f8c1e6 MFC r226871-226872:
r226871:
  Add initial BCM5720 support.
  Many thanks to Broadcom for continuing support of FreeBSD.

  Submitted by:		Geans Pin at Broadcom (initial version)
  H/W donated by:	Broadcom

r226872:
  Disable updating InputDiscards counter for BCM5717, BCM5718,
  BCM5719 A0 and BCM5720 A0 and add comment why driver does not try
  to read it.
2012-01-03 01:07:02 +00:00
Pyun YongHyeon 6c68076ebc Recognize BCM5720C PHY.
This is a direct commit to stable/7.
2012-01-03 00:49:12 +00:00
Pyun YongHyeon 5f2e63aa93 MFC r226814-226815,226820-226821,226864,226866-226867:
r226814:
  Rename definition of BGE_SOFTWARE_GENCOMM_* to more readable ones.
  The origin of GENCOMM seems to come from Alteon Tigon Host/NIC
  interface definition where it defines general communications region
  which is active when firmware is loaded and running.  This region
  was used in communication between the host and processor internal
  to the Tigon chip.
  Broadcom data sheet also defines the region as 'Software Gencomm'
  in NetXtreme memory map but lacks detailed description of its
  interface so it was hard to know which ones are used for which
  interface.
  This change shall slightly enhance readability.

  No functional changes.

r226815:
  Define MAC address mail box and use it instead of using
  hard-coded value.

r226820:
  Offset 0x6810 is RX-RISC event register. Rename BGE_CPU_EVENT with
  BGE_RX_CPU_EVENT for readability.
  Additionally define BGE_TX_CPU_EVENT for TX-RSIC event register(BCM570[0-4] only).

r226821:
  SRAM offset 0x0C04 is used by driver to inform the IPMI/ASF firmware
  about the various driver events like load, unload, reset, suspend,
  restart, and ioctl operations.
  Define driver's event rather than using hard-coded values.  We don't
  still send suspend/resume event to firmware.

  Previously bge(4) used BGE_SDI_STATUS to send events. Because driver
  has to access firmware mail box to inform current state, using
  BGE_SDI_STATUS register was wrong. The end result was the same as
  BGE_SDI_STATUS is 0x0C04.

  No functional changes.

r226864:
  Rename BGE_FW_DRV_ALIVE/BGE_FW_PAUSE to BGE_FW_CMD_DRV_ALIVE/BGE_FW_CMD_PAUSE.
  Also add more firmware commands(not used yet).
  No functional changes.

r226866:
  Rename hard-coded value 1 << 14 with BGE_RX_CPU_DRV_EVENT.
  This bit(SW event 7 in publicly available data sheet) is used to
  make RX CPU handle a firmware command and the bit is automatically
  cleared after RX CPU completed the command.
  Generally firmware command takes the following steps.
   1. Write BGE_SRAM_FW_CMD_MB with a command.
   2. Write BGE_SRAM_FW_CMD_LEN_MB with the length of the command in bytes.
   3. Write BGE_SRAM_FW_CMD_DATA_MB with actual command data.
   4. Generate BGE_RX_CPU_EVENT and let firmware handle the command.
   5. Wait for the ACK of the firmware command.

  No functional changes.

r226867:
  Define BGE_FW_HB_TIMEOUT_SEC and remove one more magic value.
  bge(4) sends BGE_FW_CMD_DRV_ALIVE command to firmware every 2
  seconds.  BGE_FW_CMD_DRV_ALIVE command requires 4 bytes data.  This
  data contains timeout value in seconds until the next
  BGE_FW_CMD_DRV_ALIVE command.
  Broadcom recommends driver set the value 3 times longer than the
  interval that it sends BGE_FW_CMD_DRV_ALIVE.  Currently bge(4) uses
  3 seconds so probably we have to increase it in future and use
  different ALIVE command(e.g. BGE_FW_CMD_DRV_ALIVE3).

  No functional changes.
2012-01-03 00:26:11 +00:00
Pyun YongHyeon 61f88a6d00 MFC r226749,226770,226804-226807:
r226749:
  Whitespace nits.

r226770:
  Fix long standing bge_sysctl_debug_info() issues.
   o Protect bge(4) status block access and register dump with driver lock.
   o Add missing bus_dmamap_sync() before dumping status block.
   o Use minimum status block size, 32 bytes, for status block dump on most
     controllers except BCM5700 AX/BX.
  While I'm here, make the handler show 5717 Plus in hardware flags.

r226804:
  Make CPMU handle GPHY power down control on controllers that have
  CPMU capability.

r226805:
  It is known that all Broadcom controllers have 4GB boundary DMA
  bug.  Apply workaround to all controllers.

r226806:
  Broadcom says BCM5755 or higher and BCM5906 have short DMA bug.
  Apply workaround to these controllers.

r226807:
  BCM5719 cannot handle DMA requests for DMA segments that have
  larger than 4KB in size.  However the maximum DMA segment size
  created in DMA tag is 4KB, so we wouldn't encounter the issue here.
  Just record this issue such that let developers not to create a DMA
  segment that is larger than 4KB for BCM5719. It's possible to split
  a DMA segment into multiple smaller ones in run time but I believe
  it's not worth to implement that.
2012-01-03 00:12:06 +00:00
Pyun YongHyeon ecc1ec6683 MFC 226703-226704:
r226703:
  Add ALi/ULi M5261/M5263 to supported hardware chipets.

r226704:
  All dc(4) controllers support VLAN over-sized frame.
  Xr vlan
2012-01-02 23:43:45 +00:00
Pyun YongHyeon 88d43bdbd1 MFC r226701:
Add support for ALi/ULi, now NVIDIA, M5261/M5263 PCI FastEthernet
  controller which is found on ULi M1563 South Bridge & M1689 Bridge.
  These controllers look like a tulip clone.
  M5263 controller does not support MII bitbang so use DC_ROM
  register to access MII registers.  Like other tulip variants, ULi
  controller uses a setup frame to configure RX filter and uses new
  setup frame format.  It's not clear to me whether the controller
  supports a hash based multicast filtering so this patch uses 14
  perfect multicast filter to filter multicast frames.  If number of
  multicast addresses is greater than 14, controller is put into a
  mode that receives all multicast frames.
  Due to lack of access to M5261, this change was not tested with
  M5261 but it probably works.  Many thanks to Marco who provided
  remote access to M5263.

  Tested by:	Marco Steinbach <coco <> executive-computing dot de>,
		Martin MATO <martin.mato <> orange dot fr>
2012-01-02 23:40:09 +00:00
Pyun YongHyeon 4dd6dade51 MFC r226699:
When driver is run for the first time there would be no established
  link such that calling dc_setcfg() right after media change would
  be meaningless unless controller in question is not Davicom DM9102.
  Ideally dc_setcfg() should be called when speed/duplex is resolved
  otherwise it would reprogram controller with wrong speed/duplex
  information.  Because MII status change callback already calls
  dc_setcfg() I think calling dc_setcfg() in dc_init_locked() is
  wrong.  For instance, it would take some time to establish a link
  after mii_mediachg(), so blindly calling dc_setcfg() right after
  mii_mediachg() will always yield wrong media configuration.

  Extend dc_ifmedia_upd() to handle media change and still allow
  21143 and Davidcom controllers program speed/duplex regardless of
  current resolved speed/duplex of link. In theory 21143 may not need
  to call dc_setcfg() right after media change, but leave it as it is
  because there are too many variants to test that change.  Probably
  dc(4) shall need a PHY reset in dc_ifmedia_upd() but it's hard to
  verify correctness of the change.

  This change reliably makes ULi M5263 establish a link.

  While I'm here correctly report media change result. Previously it
  always reported a success.
2012-01-02 23:22:11 +00:00
Glen Barber 20d05783c8 MFC r228885:
r228885:
 - Add missing opening and closing brackets in getopt_long.3 and
   getsubopt.3 to make the examples reflect reality more closely.
2012-01-02 22:26:26 +00:00
Glen Barber c89ec15cf6 MFC r209035, r228823:
r209035 (uqs):
 - Use same table markup as in hexdump.1

r228823:
 - Enclose tabbed content in quotes
2012-01-02 22:19:55 +00:00
Glen Barber 4cdc0aa739 MFC r228419:
r228419:
 - Minor whitespace cleanup to make.conf(5)
2012-01-02 22:12:36 +00:00
Doug Barton 54f58b1164 MFC r228909:
1. Remove a bunch of duplicates. Usually this means removing them from
   fortunes, but occasionally remove them from the other 2 files when
   they are not offensive, or not murphy'ish enough.

   Where the version in fortunes had better attribution and/or formatting,
   copy it over.

2. Fix a few typos

3. Use the full name of François De La Rochefoucauld, fix one of his
   quotes, and remove the duplicate of it.

MFC r228934:

Prefer ASCII apostrophes over Unicode ones like the rest of the file.

MFC r228938:

1. Correct capitalization of the nobility particle for
   Francois de La Rochefoucauld introduced in r228909

2. Change c-cedilla introduced in the same commit to ASCII c since
   non-UTF-8 terminals will choke on the non-ASCII text.
2012-01-01 22:33:55 +00:00
Matthew D Fleming e536c2d962 MFC r228440:
Consistently use types in ixgbe driver code:

 - ixgbe_tso_setup() returns a bool, so declare it bool, not boolean_t.
 - ixgbe_txeof() returns a bool, so declare it bool, not boolean_t.
 - Do not re-define bool if the symbol already exists.

Note this is a partial MFC since ixgbe_tx_ctx_setup() returns more than
TRUE/FALSE on stable/7 and ixgbe_header_split tunable does not exist.
2011-12-31 20:26:05 +00:00
Matthew D Fleming f8cfa4fb55 MFC r228441:
Consistently use types in e1000 driver code:

 - Two struct members eee_disable are used in a function that expects
   an int *, so declare them int, not bool.
 - igb_tx_ctx_setup() returns a boolean value, so declare it bool, not int.
 - igb_header_split is passed to TUNABLE_INT, so delcare it int, not bool.
 - igb_tso_setup() returns a bool, so declare it bool, not boolean_t.
 - Do not re-define bool/true/false if the symbols already exist.
2011-12-31 20:01:09 +00:00
Matthew D Fleming fd7cde1937 MFC r228442:
Do not use the sometimes-reserved word 'bool' for a variable name.
This is a direct commit since the file name has changed.
2011-12-31 18:41:29 +00:00
Bjoern A. Zeeb aa9b786123 MFC r229067 (by obrien):
Happy 2012 to FreeBSD users in Samoa.
2011-12-31 11:43:35 +00:00
Pyun YongHyeon 6b687baf10 MFC r226480-226481:
r226480:
  Add missing driver lock in media status handler.

r226481:
  Make sure to report media change status to caller. Previously it
  always reported success.
2011-12-31 01:33:25 +00:00
Pyun YongHyeon b1edb1d47a MFC r226478:
Close a race where SIOCGIFMEDIA ioctl get inconsistent link status.
  Because driver is accessing a common MII structure in
  mii_pollstat(), updating user supplied structure should be done
  before dropping a driver lock.

  Reported by:	Karim (fodillemlinkarimi <> gmail dot com)
2011-12-31 01:10:29 +00:00
Pyun YongHyeon adec19a208 MFC r226123:
BCE_MISC_ID register of BCM5716 returns the same id of BCM5709 so
  remove explicit checks for BCM5716.
  The BCM5709 and BCM5716 chips are virtually indistinguishable by
  software except for the PCI device ID.  The two chips differ in
  that BCM5709 supports TCP/IP and iSCSI offload in Windows while
  the BCM5716 doesn't.
  While I'm here remove now unused definition of BCE_CHIP_NUM_5716
  and BCE_CHIP_ID_5716_C0.
2011-12-31 00:47:54 +00:00
Jilles Tjoelker 955c8f0295 MFC r227121: make(1): obj dirs are physical paths so write pwd -P
rather than `pwd`.

Regular pwd may return a pathname containing symlinks, but make does not use
such pathnames.
2011-12-30 21:46:30 +00:00
Colin Percival bf5eebf687 Fix a problem whereby a corrupt DNS record can cause named to crash. [11:06]
Add an API for alerting internal libc routines to the presence of
"unsafe" paths post-chroot, and use it in ftpd. [11:07]

Fix a buffer overflow in telnetd. [11:08]

Make pam_ssh ignore unpassphrased keys unless the "nullok" option is
specified. [11:09]

Add sanity checking of service names in pam_start. [11:10]

Approved by:    so (cperciva)
Approved by:    re (bz)
Security:       FreeBSD-SA-11:06.bind
Security:       FreeBSD-SA-11:07.chroot
Security:       FreeBSD-SA-11:08.telnetd
Security:       FreeBSD-SA-11:09.pam_ssh
Security:       FreeBSD-SA-11:10.pam
2011-12-23 15:00:37 +00:00
Doug Barton 57cec9dc68 MFC: r179530
- Replace rcsid with __FBSDID.
- Remove paths.h and embed it in the source.
- Remove stale alpha support.
- Clean up compiler warnings and fix style(9) bugs.

Not MFC'ed by:	jkim

MFC: r195339

Add a new options (-s) that, when specified, skips the question about
adjusting the clock to UTC.
That avoids to write on /etc/wall_cmos_clock which is useful in some
cases (example: host user in a jail).

Not MFC'ed by:	attilio

MFC: r198254

When tzsetup is run as non-root and the "CMOS clock question on
UTC" is answered as No, it would abort without properly ending the
dialog session.

Not MFC'ed by:	edwin

MFC: r198267

Instead of having to know which timezone was picked last time, you
now can run "tzsetup -r" which will reinstall the last choice. This
data is recorded in /var/db/zoneinfo.

Not MFC'ed by:	edwin

MFC: r198350

- Add support for chrooted installs.
- Add examples to the man-page.

Not MFC'ed by:	edwin

MFC: r208830

When there is a problem with writing, also bail out.

Not MFC'ed by:	edwin

MFC: r208831

Add comment that this value is unused.
It is obvious that it isn't used, but both clang and Coverity talk about it.

Not MFC'ed by:	edwin

MFC: r209190

Use literal format strings.  Found by clang.

Not MFC'ed by:	emaste

MFC: r210243

Fix support for chrooted installs.

Not MFC'ed by:		nork
While mentored by:	imp

MFC: r220172

Add a menu entry for UTC in the main menu.

Not MFC'ed by:	edwin

MFC: r222139

- add missing options and arguments to program's usage()
  and sync it with manpage's SYNOPSIS

- generally clean up a manpage's formatting

Not MFC'ed by:	ru

MFC: r227011

If the user is moving from any other time zone to UTC we need
to delete any old /var/db/zoneinfo file that may exist so that
tzsetup -r does the right thing.
2011-12-16 23:44:16 +00:00
Dag-Erling Smørgrav bc9d2b5a49 MFH r228384: validate the service name
Security:	some poorly thought out programs allow the user to specify
		the service name; this patch makes it harder to trick these
		programs into loading and executing arbitrary code.
2011-12-13 13:03:11 +00:00
Dag-Erling Smørgrav 30b4e39da0 MFH r227757: check for null passphrases, since openssl doesn't
Security:	prevents users with unencrypted ssh keys (prohibited
		unless the nullok option is specified) from logging in
		by providing a bogus non-null passphrase.
2011-12-11 20:40:23 +00:00
Alan Cox 88f7f00500 MFC r224689
Fix an error in kmem_alloc_attr().  Unless "tries" is updated,
  kmem_alloc_attr() could get stuck in a loop.
2011-12-04 02:13:54 +00:00
Alan Cox e71eab122c MFC r218863
tmpfs_remove() isn't modifying the file's data, so it shouldn't set
  TMPFS_NODE_MODIFIED on the node.

PR:		152488
2011-12-04 01:22:22 +00:00
Alan Cox e40bb73dc0 MFC r226740
Speed up vm_page_cache() and vm_page_remove() by checking for a few
  common cases that can be handled in constant time.
2011-12-03 17:29:38 +00:00
Doug Barton 7e0d5bcd4a MFC r228122:
If using DESTDIR we need to be sure to create a
${DESTDIR}/var/db/zoneinfo
2011-12-01 05:54:22 +00:00
Doug Barton aaa4fa679e MFC r227482:
The default setting, daily_accounting_compress="NO", was causing
only 1 old file to be saved, so fix this.

While I'm here, fix a very old off-by-one error causing 1 more
file than specified in daily_accounting_save to be saved because
acct.0 was not taken into account (pun intended). Change that, and
use a more thorough method of finding old files to delete. Partly
just because this is the right thing to do, but also to silently
fix the extra log that would have been left behind forever with the
previous method.
2011-12-01 05:49:37 +00:00
Marius Strobl b63c1d3d88 MFC: r227960
Increase the CDMA sync timeout for Schizo bridges to 15 seconds as used by
OpenSolaris. One second turned out to be not enough for certain loads while
10 seconds were sufficient.
Reported by: Peter Jeremy
2011-11-29 19:49:11 +00:00
Warren Block 79621b2e41 MFC r225861:
Fix a confusing sentence.
Other wording tweaks.

Approved by:	gjb (mentor)
2011-11-26 16:38:49 +00:00
Marius Strobl ba184e2c41 MFC: r227829, r227844
- Add a DEVMETHOD_END alias for KOBJMETHOD_END so that along with 'driver_t'
  and DEVMETHOD() we can fully hide the explicit mention of kobj(9) from
  device drivers.
- Update the device driver examples to use DEVMETHOD_END.

Submitted by:	jhb
2011-11-25 17:08:39 +00:00
Marius Strobl 06ae371e2c MFC: r204602, r204650
- Add missing includes to make example "compilable".
- Use NULL for pointer arguments instead of 0.
2011-11-25 16:54:18 +00:00
Glen Barber 024bd9e85e MFC r227769, 227770, 227771:
- Add a note to src/Makefile that explains that 'rm' runs twice because
  thesecond invocation only needs to operate on files with the immutable
  flag set.

- Fix the note in r227769 to be less specific to the immutable flag.

- Replace 'chflags' with 'file flags' in a comment, since 'chflags'is a
  command, not a flag itself.
2011-11-23 12:24:48 +00:00
Rick Macklem e16cb5b009 MFC: r227059
Both a crash reported on freebsd-current on Oct. 18 under the
subject heading "mtx_lock() of destroyed mutex on NFS" and
PR# 156168 appear to be caused by clnt_dg_destroy() closing
down the socket prematurely. When to close down the socket
is controlled by a reference count (cs_refs), but clnt_dg_create()
checks for sb_upcall being non-NULL to decide if a new socket
is needed. I believe the crashes were caused by the following race:
  clnt_dg_destroy() finds cs_refs == 0 and decides to delete socket
  clnt_dg_destroy() then loses race with clnt_dg_create() for
    acquisition of the SOCKBUF_LOCK()
  clnt_dg_create() finds sb_upcall != NULL and increments cs_refs to 1
  clnt_dg_destroy() then acquires SOCKBUF_LOCK(), sets sb_upcall to
    NULL and destroys socket

This patch fixes the above race by changing clnt_dg_destroy() so
that it acquires SOCKBUF_LOCK() before testing cs_refs.
This is a slightly modified patch for stable/7. It fixes the
above race, although others still exist, since some patches
such as r193272 cannot be MFC'd.

Tested by:	nonesuch at longcount.org (Mark Saad)
PR:		kern/156168
2011-11-22 01:32:57 +00:00
Marius Strobl af76531f46 MFC: r227578
Fix compilation with DEBUG defined.
2011-11-19 13:33:30 +00:00
Marius Strobl 3b6ded4a90 MFC: r227539
Define curthread as an inline function that loads the thread pointer
directly from g7, the pcpu pointer. This guarantees correct behavior
when the thread migrates to a different CPU.
Commit message stolen from r205431. Additional testing by Peter Jeremy.
2011-11-19 13:30:12 +00:00
Doug Barton fb19c7647a MFC r227416:
Document that flock can return ENOLCK
2011-11-18 21:13:43 +00:00
Doug Barton e2ca24de37 MFC r213077:
Simplify how we find the kernel source.

MFC r222218:
expr -> sh arithmetic expansion

MFC r226863:
Fix svnversion for svn 1.7.x by not looking for .svn in ${SYSDIR}
(since it no longer exists). Instead, run svnversion if we can find
the binary and test that the output looks like a version string.
2011-11-18 21:09:03 +00:00
Xin LI bf61e0d6e5 MFC r227409:
Do a dummy read to flush the interrupt ACK that we just performed,
ensuring that everything is really, truly consistent.

This fixes certain cases where one will see various:
  mfi0: COMMAND 0xffffffXXXXXXXXXX TIMEOUT AFTER XX SECONDS

Requested by:	Vincent Hoffman <vince unsane co uk>
2011-11-17 11:16:56 +00:00
Doug Barton 3241bf2140 Upgrade to BIND 9.4-ESV-R5-P1 to address the following DDOS bug:
Recursive name servers are failing with an assertion:
INSIST(! dns_rdataset_isassociated(sigrdataset))

At this time it is not thought that authoritative-only servers
are affected, but information about this bug is evolving rapidly.

Because it may be possible to trigger this bug even on networks
that do not allow untrusted users to access the recursive name
servers (perhaps via specially crafted e-mail messages, and/or
malicious web sites) it is recommended that ALL operators of
recursive name servers upgrade immediately.

For more information see:
https://www.isc.org/software/bind/advisories/cve-2011-tbd
which will be updated as more information becomes available.

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-4313
2011-11-17 01:10:16 +00:00
Fabien Thomas 83bdb91741 MFC r226514,r226526,r226986:
Add a flush of the current PMC log buffer before displaying the next top.

As the underlying block is 4KB if the PMC throughput is low the measurement
will be reported on the next tick. pmcstat(8) use the modified flush API to
reclaim current buffer before displaying next top.
2011-11-16 16:15:31 +00:00
Fabien Thomas 43ec7b561b MFC r227391:
Import gcc fix for -fstack-protector that produces segfaulting
binaries on arm/armel.

Related gcc bug:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35965

Author kindly accepted that all of his patches can be use as GPLv2.

PR:	161128
2011-11-16 14:37:47 +00:00
Rick Macklem 42d063cde4 MFC: r224604
Fix a LOR in the NFS client which could cause a deadlock.
This was reported to the mailing list [email protected]
on July 21, 2011 under the subject "LOR with nfsclient sillyrename".
The LOR occurred when nfs_inactive() called vrele(sp->s_dvp)
while holding the vnode lock on the file in s_dvp. This patch
modifies the client so that it performs the vrele(sp->s_dvp)
as a separate task to avoid the LOR. This fix was discussed
with jhb@ and kib@, who both proposed variations of it.
2011-11-16 05:05:13 +00:00
Marius Strobl f47badfb37 Partially disable r227304 as stable/7 doesn't support reporting the maximum
supported transfer size, yet. Reported by: Scott Allendorf
This is a direct commit to stable/7.
2011-11-07 22:34:07 +00:00
Marius Strobl 95d978e102 MFC: r227006, r227281, r227282
Add a PCI front-end to esp(4) allowing it to support AMD Am53C974 and
replace amd(4) with the former in the amd64, i386 and pc98 GENERIC kernel
configuration files. Besides duplicating functionality, amd(4), which
previously also supported the AMD Am53C974, unlike esp(4) is no longer
maintained and has accumulated enough bit rot over time to always cause
a panic during boot as long as at least one target is attached to it
(see PR 124667).

PR:		124667
Obtained from:	NetBSD (based on)
2011-11-07 13:46:16 +00:00
Marius Strobl d08c02eb23 MFC: r226947, r226949, r227284
- Use device_t rather than the NetBSDish struct device.
- Move esp_devclass to ncr53c9x.c in order to allow different bus front-ends
  to use it.
- Use KOBJMETHOD_END.
- Remove the gl_clear_latched_intr hook as it's not needed for any of the
  chips nor the front-ends supported in FreeBSD and likely never will be.
- Correct the DMA constraints and only limit the tag used for the transfer
  buffers to 32-bit DMA as that address is written into a 32-bit register.
- The ESP200 also only supports up to 64k transfers.
- Don't let the DMA and SBus front-end supply a maximum transfer size larger
  than MAXPHYS as that's the maximum the upper layers use and we otherwise
  just waste resources unnecessarily.
- Initialize the ECB callout and don't zero the handle when returning ECBs
  to the free list so that ncr53c9x_callout() actually is called with the
  driver lock held.
- On detach the driver lock should be held across cam_sim_free() according
  to isp(4) and a panic received.
- Check the return value of NCRDMA_SETUP(), i.e. bus_dmamap_load(9), and try
  to handle failures gracefully.
- In ncr53c9x_action() replace N calls to xpt_done() in a switch with just
  one at the end.
- On XPT_PATH_INQ report "NCR" rather than "Sun" as the vendor as the former
  is somewhat more correct as well as the maximum supported transfer size via
  maxio in order to take advantage of controllers that that can handle more
  than DFLTPHYS.
- Freeze the device queue if a request didn't complete without error and
  isn't already frozen.
- Print the number of MESSAGE (EXTENDED) rejected.
- Fix the path encoded in the multiple inclusion protection of ncr53c9xvar.h.
- Correct the DMA constraints used in the LSI64854 core to not exceed the
  maximum supported transfer size and include the boundary so we don't need
  to check on every setup of a DMA transfer.
- Let the bus DMA map callbacks do nothing in case of an error.
- Correctly handle > 64k transfers for FAS366 in the LSI64854. A new feature
  flag NCR_F_LARGEXFER was introduced so we just need to check for this one
  and not for individual controllers supporting large transfers in several
  places.
- Let the LSI64854 core load transfer buffers using BUS_DMA_NOWAIT as the
  NCR53C9x core can't handle EINPROGRESS. Due to lack of bounce buffers
  support, sparc64 doesn't actually use EINPROGRESS and likely never will,
  as an example for writing additional front-ends for the NCR53C9x core it
  makes sense to set BUS_DMA_NOWAIT anyway though.
- Some minor cleanup.
2011-11-07 13:18:09 +00:00
Marius Strobl e64fdac2b3 Automatically compile in mii_bitbang.c if one of the drivers depending on
it since r227279 is compiled into the kernel. This restores POLA for people
that don't use "options miibus" but "options mii" and individual PHY drivers
instead.
This is a direct commit to stable/7.
2011-11-07 11:31:37 +00:00
Marius Strobl d3ecab167c MFC: r226995 (partially), r227042
- Import the common MII bitbang'ing code from NetBSD and convert drivers to
  take advantage of it instead of duplicating it. This reduces the size of
  the i386 GENERIC kernel by about 8k. The only potential in-tree users left
  unconverted are ed(4) and xe(4). Xe(4) generally should be changed to use
  miibus(4) instead of implementing PHY handling on its own, as otherwise it
  makes not much sense to add a dependency on miibus(4)/mii_bitbang(4) to it
  just for the MII bitbang'ing code. Ed(4) has some chip specific things
  interwinded with the MII bitbang'ing code and it's unclear whether it can
  be converted to common code, at least not without thorough testing of all
  the various chips supported by ed(4).
  The common MII bitbang'ing code also is useful in the embedded space for
  using GPIO pins to implement MII access.
- Based on lessons learnt with dc(4) (see r185750), add bus barriers to the
  MII bitbang read and write functions of the other drivers converted in
  order to ensure the intended ordering. Given that register access via an
  index register as well as register bank/window switching is subject to the
  same problem, also add bus barriers to the respective functions of smc(4),
  tl(4) and xl(4).
- Sprinkle some const.

Thanks to the following testers:
Andrew Bliznak (nge(4)), nwhitehorn@ (bm(4)), yongari@ (sis(4) and ste(4))
Thanks to Hans-Joerg Sirtl for supplying hardware to test stge(4).

Reviewed by:	yongari (subset of drivers)
Obtained from:	NetBSD (partially)
2011-11-06 21:11:22 +00:00
Marius Strobl eaf2df1c8e MFC: r227001
Increase the IOC port initialization timeouts by ten times to what the
corresponding Linux driver uses. This allows mpt(4) to still recognize
all good SATA devices in presence of a defective one, which takes about
45 seconds.
In the long term we probably should implement the logic used by mpt2sas(4)
allowing IOC port initialization to complete at a later time.

Submitted by:	Andrew Boyer
2011-11-06 19:57:17 +00:00
Konstantin Belousov a3fccd55ba MFC r227062:
Fix kernel panic when d_fdopen csw method is called for NULL fp.
This may happen when kernel consumer calls VOP_OPEN().
2011-11-06 13:35:55 +00:00
Christian Brueffer 1826a6f56f MFC: r226937
Fix a misplaced parenthesis.
2011-11-06 13:03:59 +00:00
Doug Barton 2fbd7fc2ba MFC r227013:
1. Add a new option, --run-updates, to always or never run the newalises,
   pwd_mkdb, etc. updates at the end of the comparison.

2. Add an update to the end to handle /etc/localtime, if it exists.
   If /var/db/zoneinfo exists, automatically update /etc/localtime,
   which should (hopefully) be safe to do. If not, prompt the user
   to run tzsetup.

3. Update run_it_now(), the function that handles input for the updates,
   to make sure that we got a valid answer, and to handle the --run-updates
   option if supplied.
2011-11-06 08:03:33 +00:00
Doug Barton 0e58ad2e7c MFC r213573:
mdoc: drop redundant .Pp and .LP calls

They have no effect when coming in pairs, or before .Bl/.Bd
2011-11-06 08:01:17 +00:00
Doug Barton 6ab9f89e34 MFC r226927:
Add birth date for Ken Thompson
Add birth and death dates for Steve Jobs
Update birth and add death date for Dennis Ritchie

MFC r226942:
Fix typo from r226927
2011-11-06 07:33:17 +00:00
Doug Barton c36de80618 MFC r226909:
Add a reminder about quarterly status report due dates
2011-11-06 07:26:31 +00:00
Doug Barton 57d21f19ca MFC r226898:
Fix the text and attribution of the poem "Youth" by Samuel Ullman.

Our copy was a bastardization of the "older" (probably original?) and
shorter version of the poem; and the "newer" version that is better
known, and arguably more popular. Standardize on the latter.

Cf. http://www.bartleby.com/73/2099.html
2011-11-06 07:11:27 +00:00
Andriy Gapon 03bb4465eb MFC r225505: dsp_ioctl: fix type of variable used to store ioctl request
PR:		kern/156433
2011-11-05 11:18:46 +00:00
Alexander V. Chernikov 18b8eca692 MFC 213440 (by ru)
Show hostcache statistics in netstat(1).

Submitted by:   Maxim Dounin
Approved by:    ae
Approved by:    ru
2011-11-02 11:05:11 +00:00
Sergey Kandaurov 73564ffa6b MFC r226790:
Fix typo in timer_getoverrun cross-reference.
2011-11-01 16:56:42 +00:00
Edwin Groothuis ab415231db MFC of 226976, tzdata2011n
- Fiji will end DST on 22 January 2012.
- Moldova split into two timezones has been cancelled.
- Cuba will end DST on 13 November 2011

Obtained from:	 ftp://ftp.iana.org/tz/releases/
2011-11-01 02:04:02 +00:00
Marius Strobl b19865eb3b MFC: r226522
Allow to dump on Solaris swap partitions.

PR:		161764
Submitted by:	Peter Jeremy
2011-10-30 12:23:06 +00:00
Marius Strobl e4110378f6 MFC: r199560
- Hook into the existing stat timer to drive the transmit watchdog instead
  of using if_watchdog and if_timer.
- Reorder detach to call ether_ifdetach() before anything else in tl(4)
  and wb(4).
2011-10-30 01:24:56 +00:00
Marius Strobl 7f0b2b04a7 MFC: r199559
- Add a private timer to drive the transmit watchdog instead of using
  if_watchdog and if_timer.
- Fix some issues in detach for sn(4), ste(4), and ti(4).  Primarily this
  means calling ether_ifdetach() before anything else.
2011-10-30 01:13:49 +00:00
Marius Strobl 548c77c36a MFC: r226381
Merge from NetBSD:
- Remove clause 3 and 4 from TNF licenses.
- Fix memset usage.
- Various cleanup.
- Kill caddr_t.
2011-10-29 23:53:58 +00:00
Marius Strobl 769a141157 MFC: r226350
Merge from r225950:

Set the sense residual properly.

Reviewed by:	ken
2011-10-29 23:51:23 +00:00
Marius Strobl c06632c538 MFC: r206534
Whitespace cleanup, in advance of next sync with Adaptec's driver.  No
functional change.
2011-10-29 23:44:30 +00:00
Marius Strobl af4cb0dc0b MFC: r226095
Merge from r225950:

Set the sense residual properly.

Reviewed by:	ken
2011-10-29 23:27:36 +00:00
Pyun YongHyeon 6f326da565 MFC r226695-226696:
r226695:
  Fix a regression introduced in r218832. For TX status check, driver
  should use a TX list DMA tag.

r226696:
  Add missing bus_dmamap_sync() in setup frame transmit.
2011-10-27 16:48:19 +00:00
Colin Percival cd8fd26bc6 MFC r226650: Make freebsd-update work with FreeBSD 9.0. (In the unlikely
event that a 7.5-RELEASE happens, this should simplify upgrading from that
to 9.x.)
2011-10-26 20:07:58 +00:00
Edwin Groothuis f40c7ff3f7 MFC of r226771
Fix breakage in tzsetup:
MD      +4700+02850     Europe/Chisinau most locations
2011-10-26 01:58:13 +00:00
Edwin Groothuis ed313fa48f MFC of 226752, tzdata2011m
Europe:
- Pridnestrovian Moldavian Republic (PMR, also known as
  "Pridnestrovie") has abolished seasonal clock change (no transition
  to the Winter Time).
- The recent change to the Ukranian time zone (Europe/Kiev) to
  introduce permanent daylight saving time (similar to Russia) was
  reverted.

South America:
- Bahia: The President signed a decree that includes Bahia in summer
  time.

zone.tab:
- Add Europe/Tiraspol Pridnestrovie

Obtained from:  ftp://ftp.iana.org/tz/releases/
2011-10-25 21:59:24 +00:00
Christian Brueffer def92c9ffa MFC: r226398, r226442
Move the allocation of usrbufs down a few lines to avoid leaking it
in case of an error.
2011-10-23 18:27:53 +00:00
Mikolaj Golub 32819fbf77 MFC r226403:
In r225809 the intention was to send VEOF only once if STDIN was not a
terminal. Unfortunately the fix was incorrect and for flushtime > 0 it
keept sending VEOF.

Sent VEOF generates ^D\b\b echoed by the terminal, which was reported
in bin/161526. Note, we still send VEOF at least once. Otherwise
commands like below would hang forever:

  echo 1 |script /tmp/script.out cat

PR:		bin/161526
Reported by:	Adrian Wontroba <[email protected]>, Stefan Bethke <[email protected]>
Tested by:	Stefan Bethke <[email protected]>
2011-10-21 05:41:20 +00:00
Sean Bruno 0f392d34bf MFC r224536:
Confirmed behavior of a Cisco 6509 in production.

In the old TFTP server, there was an undocumented behavior where
the block counter would rollover to 0 if a file larger
than 65535 blocks was transferred.  With the default block size
of 512 octets per block, this is a file size of approximately 32 megabytes.

The new TFTP server code would report an error and stop transferring
the file if a file was larger than 65535 blocks.

This patch restores the old TFTP server's behavior to the new
TFTP server code.  If a TFTP client transfers a file larger
than 65535 blocks, and does *not* specify the "rollover" option,
then automatically rollover the block counter to 0 every time
we reach 65535 blocks.

This restores interoperability with the FreeBSD 6 TFTP client.
Without this change, if a FreeBSD 6 TFTP client tried to
retrieve a file larger than 65535 blocks from a FreeBSD 9 TFTP server
, the transfer would fail.
The same file could be retrieved successfully if the same FreeBSD 6
TFTP client was used against a FreeBSD 6 TFTP server.

Approved by:  re (kib)
Tested by: Pawan Gupta <pawang at juniper dot net>,
Obtained from:  Juniper Networks
FreeBSD7 Reviewed by: Yahoo Inc.
2011-10-20 19:23:21 +00:00
David Schultz 1f223b91f7 Belated MFC of log2 and log2f to 7-STABLE by popular demand, along with
other log* improvements.

r175461 - log(3) manpage (partial MFC)
r216210 - add k_log (used by log*)
r216211 - add log2 and log2f
r216247 - log2f style
r216248 - log2f insignificant bug
r219360 - log10 converted to use k_log
r219361 - log10f converted to use k_log
r226375 - log2/log10 style
r226376 - log2/log10 bde's improvements; fix log(1) with FE_DOWNWARD rounding
2011-10-17 05:38:22 +00:00
Christian Brueffer cba5a2bccc MFC: r226117
Add missing va_end() in an error case to clean up after va_start()
(already done in the non-error case).
2011-10-15 13:05:31 +00:00
Christian Brueffer f3f732cf65 MFC: r226116
Add missing va_end() to clean up after va_start().
2011-10-15 12:59:30 +00:00
Xin LI 195d455354 MFC r226082:
Return proper errno when we hit error when doing sanity check.
This fixes dtrace crashes when module is not compiled with CTF
data.

Submitted by:	Paul Ambrose ambrosehua at gmail.com
2011-10-14 22:52:46 +00:00
Gavin Atkinson 8d3abd6855 Merge r222754 from head:
Add another example to mount(8) on using the "-o" argument.

PR:		docs/157389
Submitted by:	Warren Block <wblock wonkity.com>
2011-10-12 20:40:25 +00:00
Edwin Groothuis fbe1895bd5 MFC of tzdata2011l, 226289
Changes in 2011i:

    Africa
    - Added South Sudan: Africa/Juba

    Australasia:
    - Samoa will go forward 24 hours at 30 December 2011 to better match
      the day of the week with its neighbours.

    Europe:
    - Europe/Kaliningrad will have the timezone KALT.

    North America:
    - Updates to Metlakatla historical data
    - Newfoundland, Labrador and Resolute will do something which I
      can't figure out.

    iso3166tab;
    - Add SS for South Sudan.

Changes in 2011j:

    - Samoa will go from 29 December 23:59:59 to 31 December 00:00:00.
    - Samoa DST will end on 1 April 2012

Changes in 2011k:

    - Gaza / West Bank goes back to standard time on 02 August 2011.
    - West Bank went bac kto DST on 30 August 2011.
    - Lots of changes in Minsk (GMT+3 without DST) and other Russian
      regions. A new timezone has been created for them, FET: Further-eastern
      European Time aka GMT+3.
    - Add Asian/Hebron to the zone.tab file.

Changes in 2011l:

    - West Bank came out of DST on 30 September 2011.
    - Fiji will g oin DST on 23 October and out of it on 26 Februari
    - State Bahia might go back to DST in 16 October 2011

    Due to legal problems, ado and Paul Eggert have to temporary suspend
    their work on the timezone database
    (http://thread.gmane.org/gmane.comp.time.tz/4133). Their work has
    been continued by volunteers on the tz community and the hosting
    of the data files is done by Robert Elz at ftp://munnari.oz.au/pub/.

Obtained from:	ftp://munnari.oz.au/pub, ftp://elsie.nci.nih.gov/pub/
2011-10-12 09:17:53 +00:00
Edwin Groothuis 947450e249 MFC of r226283
Updates from Newsletter VI-9 and VI-10:

    Newsletter VI-9 2011-06-12
    Name changes for Fiji and Myanmar as well as other minor corrections

    Newsletter VI-10 2011-08-09
    Code elements for South Sudan.

Obtained from:	http://www.iso.org/iso/country_codes.html
2011-10-12 07:14:52 +00:00
Konstantin Belousov 8d851ea3f2 MFC r226022:
Move parts of the commit log for r166167, where Tor explained the
interaction between vnode locks and vfs_busy(), into comment.
Comment is slightly edited to better fit into RELENG_7 reality.
2011-10-11 14:05:39 +00:00
Christian Brueffer 9c4301e541 MFC: r198357
Check pointer for NULL before dereferencing it, not after.
2011-10-10 18:20:36 +00:00
Christian Brueffer be1b277a01 MFC: r198329
Check pointer for NULL before dereferencing it, not after.
2011-10-10 17:39:58 +00:00
Christian Brueffer 75cb404e01 MFC: r225560
Minor spelling, wording and punctuation fixes in comments.
2011-10-10 12:15:10 +00:00
Glen Barber 60d4e536ed Pull mergeinfo up to the directory. 2011-10-10 11:23:48 +00:00
Glen Barber 36ebb67bca MFC r225858, 225859, 226172:
225858:
 - Document and provide an example for PORTS_MODULES [1]

225859:
 - Whitespace cleanup

226172:
 - Bump date

PR:		161017 [1]
2011-10-10 11:15:57 +00:00
Glen Barber 3996de5db2 MFC 225908, 225912, 225927:
225908:
- Reorder default ps(1) output according to reality.

225912:
- there's no reason the semantics of the -x flag are being explained in
  the -a flag description
- be more precise regarding the relation between the -a flag and the
  security.bsd.see_other_uids sysctl
- describe the format of the -t flag's argument
- 'con' no longer is a possible entry in the 'TT' column
- explain that the 'TT' column refers to pseudo-terminals
  via mere numbers
- add a hint in the 'tt' keyword description that a
  keyword 'tty' exists, which will give the full terminal pathname

225859:
- Correct a typo that was introduced in 225912
2011-10-10 11:12:40 +00:00
Glen Barber fc1aa921a7 MFC r225857:
- Fix a few grammar and mdoc nits in script.1

PR:		161088
2011-10-10 11:07:36 +00:00
Jaakko Heinonen ecb4416185 MFC r219038: Document the input line length limit. 2011-10-07 14:30:45 +00:00
Jaakko Heinonen 814576457b MFC r218411:
- Use LINE_MAX from limits.h as the maximum line length instead of
  BUFSIZ. Use LINE_MAX * 2 as the buffer size (BSIZE).
- Error out if we encounter a line longer than LINE_MAX. The previous
  behavior was to silently split long lines and produce corrupted
  output.

PR:		bin/151384
2011-10-07 14:29:15 +00:00
Jaakko Heinonen 16e8746513 MFC r218410: Handle EOF when skipping lines. 2011-10-07 14:27:20 +00:00
Jung-uk Kim 34c573df2e MFC: r225801
Avoid accidental conflicts with C++ operator keywords.
2011-10-05 15:52:40 +00:00
Colin Percival ae9bcae743 Fix a bug in UNIX socket handling in the linux emulator which was
exposed by the security fix in FreeBSD-SA-11:05.unix.

Approved by:	so (cperciva)
Approved by:	re (kib)
Security:	Related to FreeBSD-SA-11:05.unix, but not actually
		a security fix.
2011-10-04 19:07:38 +00:00
Bjoern A. Zeeb de655c07df MFC r225837:
Pass the fibnum where we need filtering of the message on the
 rtsock allowing routing daemons to filter routing updates on an
 rtsock per FIB.

 Adjust raw_input() and split it into wrapper and a new function
 taking an optional callback argument even though we only have one
 consumer [1] to keep the hackish flags local to rtsock.c.

 PR:            kern/134931
 Submitted by:  multiple (see PR)
 Suggested by:  rwatson [1]
 Reviewed by:   rwatson
2011-10-04 13:19:21 +00:00
Mikolaj Golub 2c003f3fd7 MFC r225809:
When script(1) reads EOF from input it starts spinning on zero-byte
reads eating 100% CPU. Fix this by skipping select on STDIN after
reading EOF -- permanently if STDIN is not terminal and for one second
if it is.

Also after reading EOF from STDIN we have to pass it to the program
being scripted. The previous approach was to write zero bytes into the
pseudo-terminal. This does not work because zero-byte write does not
have any effect on read. Fix this by sending VEOF instead.

Reported by:	Ronald Klop <[email protected]>
Discussed with:	kib, Chris Torek <[email protected]>
2011-10-04 11:10:11 +00:00
Alexander Motin 19212c3b73 MFC r196879:
Add support for changing providers priority.

PR:		kern/160811
2011-09-29 18:42:44 +00:00
Bjoern A. Zeeb 78be76b35b Fix handling of corrupt compress(1)ed data. [11:04]
Add missing length checks on unix socket addresses. [11:05]

Approved by:	so (cperciva)
Approved by:	re (kensmith)
Security:	FreeBSD-SA-11:04.compress
Security:	CVE-2011-2895 [11:04]
Security:	FreeBSD-SA-11:05.unix
2011-09-28 08:47:17 +00:00
Jaakko Heinonen 090c0494b7 MFC r225587:
Expose "log" in the default devfs rules. /etc/rc.d/jail creates /dev/log
as a symbolic link.

PR:		conf/160711
2011-09-22 18:21:15 +00:00
Xin LI e128420365 MFC r225452:
Sync pf.os with OpenBSD:

 - Update OpenBSD fingerprints through OpenBSD 4.9
 - Fix typos.

Obtained from:	OpenBSD
2011-09-22 01:13:40 +00:00
Christian Brueffer fb36e0dcf8 MFC: r225533
Improve the sleep_delay sysctl description by specifying which unit
the number is in.
2011-09-20 05:02:48 +00:00
Xin LI 9c162af2a6 MFC r225340:
Fix a bug in ichwd(4) which prevents it from being enabled if the new
timeout is the same timeout.

Submitted by:	Dmitrij Tejblum <tejblum yandex-team.ru>
PR:		kern/139604
2011-09-16 05:57:01 +00:00
Xin LI 851651a017 MFC r225338:
Fix the check in dircheck() on namlen.

The value of namlen is copied from on-disk d_namlen, which is a 8-bit
unsigned integer which can never exceed MAXNAMLEN (255) so the test is
always true.  Moreover, UFS does not allow d_namelen being zero.

Change namlen from u_int to u_int8_t, and replace the unneeded test
with a useful test.

PR:		bin/160339
Submitted by:	Eugene Grosbein <eugen grosbein.pp.ru>
2011-09-16 05:45:13 +00:00
Pyun YongHyeon 653cabf5e4 MFC r225440:
vge(4) hardwares poll media status and generates an interrupt
  whenever the link state is changed.  Using software based polling
  for media status tracking is known to cause MII access failure
  under certain conditions once link is established so vge(4) used to
  rely on link status change interrupt.
  However DEVICE_POLLING completely disables generation of all kind
  of interrupts on vge(4) such that this resulted in not detecting
  link state change event.  This means vge(4) does not correctly
  detect established/lost link with DEVICE_POLLING.  Losing the
  interrupt made vge(4) not to send any packets to peer since vge(4)
  does not try to send any packets when there is no established link.

  Work around the issue by generating link state change interrupt
  with DEVICE_POLLING.

  PR:		kern/160442
2011-09-15 17:22:38 +00:00
Andriy Gapon e09446a00f MFC r209030,209305,209358: In dtrace lexer, do not unput token if it is EOF.
PR:		kern/159064
On behalf of:	kan, marcel
2011-09-15 10:42:55 +00:00
Marius Strobl 99e4ce3e7b MFC: r221407 (partial)
- Let mii_phy_add_media() also announce the support of IFM_NONE.
- Add a PHY-specific reset routine is for lxtphy(4) which disables MII
  interrupts.
- Remove redundant checks in NIC drivers for mii->mii_instance not being
  zero before calling the reset routines because as soon as one PHY driver
  attaches mii->mii_instance is incremented and we hardly can end up in
  their media change callbacks etc if no PHY driver has attached as
  mii_attach() would have failed in that case and not attach a miibus(4)
  instance.
- Convert the mebers of the MII data structure to unsigned where
  appropriate. This is partly inspired by NetBSD/OpenBSD.
- Add MIIF_NOMANPAUSE and mii_phy_flowstatus() calls to drivers that
  weren't explicitly converted to support flow control before. It's
  unclear whether flow control actually works with these but typically
  it should and their net behavior should be more correct with these
  changes in place than without if the MAC driver sets MIIF_DOPAUSE.

Obtained from:	NetBSD (partially)
2011-09-11 20:25:57 +00:00
Xin LI 67d344f18a MFC r225446:
Fix SSL memory handlig for (EC)DH cipher suites, in particular for
multi-threaded use of ECDH.

Security:	CVE-2011-3210
Reviewed by:	stas
Obtained from:	OpenSSL CVS
2011-09-08 16:22:58 +00:00
Marius Strobl 98474722a5 MFC: r225334
Fix alignment assumptions.

PR:		160289
2011-09-05 17:45:24 +00:00
Marius Strobl 02e9122c5a MFC: r198136
Support the specification of a range of destination ports e.g.

	netsend 127.0.0.1 6666-7777 [payloadsize] [packet_rate] [duration]
2011-09-05 12:39:15 +00:00
Marius Strobl 18d75efc56 MFC: r198132
A small change to avoid calling gettimeofday() too often (hardwired to once
every 20us at most).
2011-09-05 12:36:11 +00:00
Sergey Kandaurov 6dc53f8ebe MFC r225330:
Cosmetic cleanup: remove unused #define LIBMEMSTAT
2011-09-05 07:59:23 +00:00
Christian Brueffer f2508e64e3 MFC: r225228
Remove broken link to supported wifi cards. There doesn't appear to
be an equivalent list anywhere else.
2011-09-04 14:30:22 +00:00
Christian Brueffer 578e4298e3 MFC: r225215
Fix memory leak in error cases.
2011-09-03 21:28:26 +00:00
Marius Strobl 9168c5427c MFC: r225229
Since r221218 rman_manage_region(9) actually honors rm_start and rm_end
which may cause problems when these contain garbage so zero the range
descriptors embedding the rmans when allocating them.
2011-09-02 16:18:06 +00:00
Dag-Erling Smørgrav 64e566ea99 I have a box running 702103 that needed a new btxld. 2011-08-31 16:54:05 +00:00
Andrey V. Elsukov 57a8804e1c MFC r225104:
Fix lock leak.

  Reported by:	Alex Lyashkov
2011-08-31 06:48:00 +00:00
Glen Barber 17e53cff23 MFC 225142:
Reword sentence noting UPDATING entries prior to October 2007[1] are
only available in older FreeBSD releases.

PR:		159220

[1] - October 2007 is specific to HEAD.  In stable/8 and stable/7,
the correct year is 2004, so that change is reflected here as well.
2011-08-31 01:18:23 +00:00
Pyun YongHyeon d5ce8e705b MFC r225088:
Disable PHY hibernation until I get more detailed hibernation
  programming secret.  The PHY would go into sleep state when it
  detects no established link and it will re-establish link when the
  cable is plugged in.  Previously it failed to re-establish link
  when the cable is plugged in such that it required to manually down
  and up the interface again to make it work.  This came from
  incorrectly programmed hibernation parameters.  According to
  Atheros, each PHY chip requires different configuration for
  hibernation and different vendor has different settings for the
  same chip.
  Disabling hibernation may consume more power but establishing link
  looks more important than saving power.
  Special thanks to Atheros for giving me instructions that disable
  hibernation.

  PR:	kern/148772
2011-08-30 17:21:55 +00:00
Dmitry Morozovsky 6fd70c3f9c MFC r225122:
Add kern.cam.boot_delay description (with reasonable default) to
 default/loader.conf

 This should help people installing ${OS} to USB devices, where there are
 frequently cases where kernel tries to mount root before actual umass sensing
 is finished.

Reviewed by:	mav
Approved by:	kib
2011-08-30 11:49:22 +00:00
Martin Matuska 37ff343c96 Fix buffer overflow and possible ISO image corruption in wrong
handling of "." character case in makefs ISO level 1 and 2 filename
conversion.

Filed as NetBSD PR #45285
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=45285

Reviewed by:	Christos Zoulas <[email protected]>
2011-08-29 20:00:57 +00:00
Marius Strobl 9a9a737ddd MFC: r225015
Revert r224157 (MFC'ed to stable/7 in r224402), re-enabling r222135 (MFC'ed
to stable/7 in r222372). The underlying problem keeping the latter from
working as expected was fixed in r225014 (MFC'ed to stable/7 in r225117).
2011-08-23 14:37:42 +00:00
Marius Strobl 8b0f0b8982 MFC: r225014
r221812 (MFC'ed to stable/7 in r222160) reveals that at least some Broadcom
PHYs default to being not only isolated but also powered down after a reset
and while they just work fine [sic] when both is the case they don't if they
are only deisolate but still powered down. So in order to put PHYs in an
overall normal operation mode for the common case, ensure in mii_phy_reset()
that they are not powered down after a reset. Unfortunately, this only helps
in case of BCM5421, while BCM5709S apparently only work when they remain
isolated and powered down after a reset. So don't call mii_phy_reset() in
brgphy_reset() and implement the reset locally leaving the problematic bits
alone. Effectively this bypasses r221812 for brgphy(4).
Thanks to Justin Hibbits for doing a binary search in order to identify
the problematic commit.

PR:		157405, 158156
Reviewed by:	yongari (mii_phy_reset() part)
2011-08-23 14:32:59 +00:00
Marius Strobl aff0c65ce4 MFC: r223688
Add detection for the Marvel 88E1149R and treat it just like the
88E1149.
2011-08-23 14:01:04 +00:00
John Baldwin e7513ad50b MFC 224495:
Properly initialize an error variable to avoid returning uninitialized
data when 'show drives' succeeds, often resulting in a failing exit code
even though the command worked fine.
2011-08-22 18:58:08 +00:00
John Baldwin c9af54e83e MFC 224898: Add device id for the Moxa CP-112UL dual-port serial adapters. 2011-08-22 18:46:23 +00:00
John Baldwin 29b8064057 MFC 224986:
One of the general principles of the sysctl(3) API is that a user can
query the needed size for a sysctl result by passing in a NULL old
pointer and a valid oldsize.  The kern.proc.args sysctl handler broke
this assumption by not calling SYSCTL_OUT() if the old pointer was NULL.
2011-08-22 18:41:55 +00:00
Jilles Tjoelker 556960ad8d MFC r224865: tail: Fix crash if -F'ed file's filesystem disappears.
If tail notices that a file it is following no longer exists (because stat()
fails), it will output any final lines and then close the file. If the read
operation also causes an error, such as when the filesystem is forcefully
unmounted, it closes the file as well, leading to fclose(NULL) and a
segmentation fault.

PR:		bin/159750
2011-08-21 22:09:30 +00:00
Jaakko Heinonen 6a32c4bddc MFC r208717:
Don't try to call cdevsw d_close() method when devfs_close() is called
because of insmntque1() failure.
2011-08-20 15:21:02 +00:00
Andriy Gapon 930c0f296a MFC r224527: smp_rendezvous: master cpu should wait until all slaves are
fully done
2011-08-20 12:08:53 +00:00
Yoshihiro Takahashi 7e1535271f MFC: revision 224780
Allow to build a release for stable/[78] on a current box and vise versa.
2011-08-19 12:08:54 +00:00
Daniel Eischen 50841d6411 MFC r218627
Allow SO_SETFIB to select/set the default routing table.

Requested by: Andrew Boyer aboyer at averesystems dot com.
2011-08-17 14:29:33 +00:00
Konstantin Belousov c90b38602a MFC r224743:
Do not update mountpoint generation counter to the value which was not
yet acted upon by devfs_populate().
2011-08-16 09:06:44 +00:00
Pyun YongHyeon 260b890b38 MFC r224506:
Add new device id of D-Link DGE-530T Rev. C controller.  DGE-503T
  Rev A1 and B1 is supported by sk(4) but the DGE-530T Rev. C
  controller is re-branded RealTek 8169 controller.

  PR:	kern/159116
2011-08-15 17:10:23 +00:00
Marius Strobl e8135aab42 MFC: r221466, r221494 (partial), r224652
Change several archs to use makefs (from base) instead of mkisofs (from
ports) which makes release CD generation both faster and self-hosting.
2011-08-13 13:18:54 +00:00
Marius Strobl 90904ac1fd MFC: r224762
Sync makefs(8) ISO 9660 support with NetBSD:
o cd9960 -> cd9660
o Move inclusion of sys/endian.h from cd9660_eltorito.c to cd9660.h
  since actual user is not cd9660_eltorito.c but iso.h and
  cd9660_eltorito.h.

  Actually, include order/place of sys/endian.h doesn't matter on
  netbsd since it is always included by sys/types.h but it's not
  true on other system.  This should fix cross build breakage on
  freebsd introduced by rev. 1.16 of cd9660_eltorito.c.
  Problem reported and fix suggested on twitter.
o Fix fd leaks in error cases. Found by cppcheck.
o RRIP RE length should be 4, not 0
o Apply fixes for PR bin/44114 (makefs(8) -t cd9660 -o rockridge creates
  corrupted cd9660fs), iso9660_rrip.c part:
  - cd9660_rrip_finalize_node() should check rr_real_parent in node->parent,
    not in node itself in RRIP_PL case
  - cd9660_rrip_initialize_node() should update only node passed as arg
    so handle RRIP_PL in DOTDOT case

  Fixes malformed dotdot entries in deep (more than 8 level) directories
  moved into .rr_moved dir.

  Should be pulled up to netbsd-5.
  (no official ISO has such deep dirs, but cobalt restorecd is affected)

Reviewed by:	mm
Obtained from:	NetBSD
2011-08-13 13:15:38 +00:00
Marius Strobl ddc86ecacb MFC: r224687
Compile fbsd-threads.c. Amongst others this is necessary for a working
kgdb(1).

PR:		158719
Reviewed by:	marcel
2011-08-13 13:09:46 +00:00
Marius Strobl 17e1ba5325 MFC: r224686
Implement functions necessary for compiling fbsd-threads.c.

Reviewed by:	marcel
2011-08-13 12:57:51 +00:00
Marius Strobl f2755d7541 MFC: r224685
Implement

Reviewed by:	marcel
2011-08-13 12:50:39 +00:00
Marius Strobl d21a00593c MFC: r224684
Use the size of struct fpreg rather than of the pointer to it when copying
the FPU state.

Reviewed by:	marcel
2011-08-13 12:49:02 +00:00
Marius Strobl 76dbf98168 MFC: r224683, r224693
The tid member of struct pthread actually is long so read it as such.
Accessing it as an int causes failure on big-endian LP64, i.e. mips64be,
powerpc64 and sparc64.

Reviewed by:	marcel
2011-08-13 12:47:10 +00:00
Marius Strobl d2eeac91e6 MFC: r224682 (partial)
- Merge from r147740:
  When the last, possibly partially filled buffer is flushed, we didn't
  reset fragsz to 0 and as such would stop reflecting reality.
- Use __FBSDID.
2011-08-13 12:43:35 +00:00
Marius Strobl 74b206f255 MFC: r224494, r224761
- Send the RELSIM_ADJUST_OPENINGS in response to a MPI_EVENT_QUEUE_FULL using
  the right SIM in case the HBA is RAID-capable but the target in question is
  not a hot spare or member of a RAID volume.
- Report the loss and addition of SAS and SATA targets detected via PHY link
  status changes and signalled by MPI_EVENT_SAS_DEVICE_STATUS_CHANGE to cam(4)
  as lost devices and trigger rescans as appropriate. Without this it can take
  quite some time until a lost device actually is no longer tried to be used,
  if it ever stops. [1]
- Handle MPI_EVENT_IR2, MPI_EVENT_LOG_ENTRY_ADDED, MPI_EVENT_SAS_DISCOVERY
  and MPI_EVENT_SAS_PHY_LINK_STATUS silently as these serve no additional
  purpose beyond adding cryptic entries to logs.
- Add a warning for MPI_EVENT_SAS_DISCOVERY_ERROR events, which can help
  identifying broken disks. [2]

Thanks to Hans-Joerg Sirtl for providing one of the HBAs these changes were
developed with and RIP to the mainboard that didn't survive testing them.

PR:		157534 [1]
Submitted by:	Andrew Boyer [2]
2011-08-13 12:37:23 +00:00
Marius Strobl a4454621ec MFC: r224493
- Staticize functions as appropriate and comment out unused ones.
- Sprinkle some const where appropriate.
- Consistently use target_id_t for the target parameter of mpt_map_physdisk()
  and mpt_is_raid_volume().
- Fix some whitespace bugs.
2011-08-13 12:33:41 +00:00
Marius Strobl 60558e8681 MFC: r223985
- For SAS but neither FC nor SPI controllers default to using MSI/MSI-X
  (still allowing their use to be disabled via device hints though). This
  matches what the corresponding Linux driver provided by LSI does. Tested
  with SAS1064.
- There's no need to keep track of the RIDs used.
- Don't allocate MSI/MSI-X as RF_SHAREABLE.
- Remove a comment which no longer applies since r209599 (MFC'ed to stable/7
  in r224332).
- Assign NULL rather than 0 to pointers.
2011-08-13 12:29:50 +00:00
Doug Barton cb11ccd4be MFC r224726:
Make clear that the -U option can be dangerous.

In -p mode install the group file with the same permissions as normally
done in etc/Makefile.

Update the copyright.
2011-08-12 21:41:20 +00:00
Jaakko Heinonen 44dc234f21 MFC r216047 by kevlo:
Fix fd leak in get_font

MFC r222568:

Don't try to close the stream if fopen(3) fails.

PR:		bin/155349
2011-08-11 15:22:46 +00:00
Martin Matuska 49ae4ce01a Remove svn:mergeinfo from files under usr.sbin/makefs
This is a direct commit to stable/7
2011-08-10 08:34:00 +00:00
Martin Matuska 8acc0ae07d MFC r224690:
Fix NetBSD PR bin/44114:
makefs with -t cd9660 -o rockridge against directories with
deep structure creates a corrupted cd9660 image.

http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=44114

Fix NetBSD PR bin/45217:
makefs creates ISO9660 images that violate the ECMA-119 (ISO9660)
specification. This is caused by erroneously writing 32 bytes
with value 0x20 to the volume_set_id field and 128 bytes with value 0x20
to the the following 37-byte fields in the PVD:
copyright_file_id, abstract_file_id, bibliographic_file_id

This causes, among other unwanted results the reserved4 field to be
overwritten with the value 0x20. To comply with the specification,
this field muse be zero. As a result, all FreeBSD distribution
ISO images created with makefs have not been 100% valid ISO9660 files.

http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=45217

Reviewed by:	kientzle
Obtained from:	NetBSD
2011-08-10 08:28:37 +00:00
Doug Barton 36b232bc47 MFC r224673:
Put information about supported-but-deprecated headers in comments
2011-08-09 20:54:00 +00:00
Doug Barton 30744b1dd6 MFC r208027:
mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to the
bottom of the manpages and order them consistently.
2011-08-09 20:52:12 +00:00
Doug Barton 9b903a3bc7 MFC r224672:
Fix a silly typo on my part.
2011-08-09 20:07:16 +00:00
Doug Barton d9e17b171c MFC r209031:
mdoc nitpicking: the title argument shall be uppercase
2011-08-09 20:02:43 +00:00
Ed Maste be397c1c80 MFC r224047:
Remove note that claims pthread_set_name_np is for debugging only.

  As Garrett points out,
    It is no more a debugging interface than setproctitle(3), and has not
    been since the name started getting stuffed into the kernel. This
    statement may have made sense when the name was only visible in thread
    state dumps and the debugger.

PR: threads/158815
2011-08-08 13:58:39 +00:00
Sergey Kandaurov b8e623af04 MFC r224571:
Add missing MODULE_VERSION() definition.

PR:		kern/159345
2011-08-08 12:19:20 +00:00
Martin Matuska 62d749b3df MFC r224523, r224524:
MFC r224523:
Fix invalid assertion of C++ external static data member declarations
as anonymous namespaces are local to the current translation.

MFC r224524:
Fix accidential dos-style endings to unix-style line endings
from last commit (r224523) to match the version approved by re@

GCC PR:		c++/33094

Reviewed by:	uqs
Obtained from:	gcc (branches/redhat/gcc-4_1-branch, rev. 129554, GPLv2)
2011-08-06 07:01:16 +00:00
Glen Barber f4ff7858e1 Provide a more user friendly URL to the IETF site 2011-08-06 00:45:33 +00:00
Glen Barber cedc99e8c8 Provide a more user friendly URL to the IETF site 2011-08-06 00:44:29 +00:00
Andrey V. Elsukov 001eff7e0f MFC r223753:
ARP code reuses mbuf from ARP request to make a reply, but it does not
  reset rcvif to NULL. Since rcvif is not NULL, ipfw(4) supposes that ARP
  replies were received on specified interface.
  Reset rcvif to NULL for ARP replies to fix this issue.

  PR:           kern/131817
2011-08-03 04:28:16 +00:00
Doug Barton 6228ebcce7 Update for version 9.4-ESV-R5 2011-08-02 09:43:27 +00:00
Doug Barton 29306aed90 Update to version 9.4-ESV-R5 which contains various bug fixes
and improvements

See RELEASE-NOTES-BIND-9.4-ESV.* for details

This is expected to be the final release of the BIND 9.4 branch
2011-08-02 09:42:58 +00:00
Doug Barton 613b2dd8f2 Non-functional changes related to version 9.4-ESV-R5
(format of time stamp in CVS $Id, copyright updates)
2011-08-02 07:55:50 +00:00
Dmitry Morozovsky 977339dd61 MFC r224140:
Correct small typo in a do{}while(0)

Approved by:    kib
2011-07-31 08:53:59 +00:00
Andriy Gapon 8afe602fa3 MFC r223663: add SNDCTL_DSP_HALT specified by OSS
PR:		kern/156874
2011-07-29 22:11:05 +00:00
Alexander Motin ee07d3a920 MFC r224250:
Fix `diskinfo -t` operation for disks smaller then 8GB or bigger then 2TB.
Tested to work with 1.44MB floppy, 4GB USB stick and 4TB disk array.
2011-07-29 10:51:56 +00:00
Marius Strobl 96db30dff0 MFC: r223228
Merge from r161730:
o  Set TP using inline assembly to avoid dead code elimination.
o  Eliminate _tcb.

Merge from r161840:
Stylize: avoid using a global register variable.

Merge from r157461:
Simplify _get_curthread() and _tcb_ctor because libc and rtld now
already allocate thread pointer space in tls block for initial thread.

Merge from r177853:
Replace function _umtx_op with _umtx_op_err, the later function directly
returns errno, because errno can be mucked by user's signal handler and
most of pthread api heavily depends on errno to be correct, this change
should improve stability of the thread library.
2011-07-27 11:21:50 +00:00
Glen Barber e132039525 MFC 224286:
Document the potential for jail escape.

PR:		142341
2011-07-27 01:57:24 +00:00
Glen Barber 989d98aa9f MFC 223773:
- General grammar and mdoc(7) fixes.
- While here, remove a paragraph about userspace operation
  that has been outdated for some time.

PR:		158623
2011-07-26 19:05:59 +00:00
Jaakko Heinonen bb27ec2ade MFC r222216:
In init_dynamic_kenv(), ignore environment strings exceeding the
KENV_MNAMELEN + 1 + KENV_MVALLEN + 1 length limit to avoid buffer
overflow in getenv(). Currenly loader(8) doesn't limit the length of
environment strings.

PR:		kern/132104
2011-07-26 18:59:38 +00:00
Glen Barber fb00e5ce9e MFC 202386, 224284:
202386 (by ru):
Use the newly brought %U macro.

224284:
Fix various broken links in manual pages.

PR:		159130 159131 159132 159133
PR:		159134 159135 159144
2011-07-26 17:39:40 +00:00
Glen Barber 04a1656b39 MFC 224284:
Fix various broken links in manual pages.

PR:		159136
2011-07-26 17:16:55 +00:00
Glen Barber ffe6a6015c MFC 224284:
Fix various broken links in manual pages.

PR:		159137
2011-07-26 17:10:25 +00:00
Glen Barber ace2ec79e8 MFC 202386, 224284:
202386 (by ru):
Use the newly brought %U macro.

224284:
Fix various broken links in manual pages.

PR:		159138
2011-07-26 17:02:53 +00:00
Jaakko Heinonen 0221b5b1be MFC r219925:
Recognize "ro", "rdonly", "norw", "rw" and "noro" as equal options in
vfs_equalopts(). This allows vfs_sanitizeopts() to filter redundant
occurrences of these options. It was possible that for example both "ro"
and "rw" options became active concurrently.

PR:		kern/133614

MFC r220040:

Fix some style issues in r219925.
2011-07-26 16:14:57 +00:00
Marius Strobl 75973de725 MFC: r214921, r219954, r219956, r221387, r221470, r221536, r222191
- Sync with the latest version from NetBSD. It notably addds ISO9660 support.
- Add support for synthesizing an APM partition map to map Mac PowerPC
  bootstrap partitions from the ISO9660 boot catalog. This preserves OS X's
  ability to mount the CD, while allowing us a way to provide HFS-ified
  bootstrap code for Open Firmware.
- Add analogs to the -chrp-boot and -prep-boot options to mkisofs.
2011-07-26 14:41:54 +00:00
Marius Strobl 40284bb3b9 MFC: r210933 (partial)
Fix typos and spelling mistakes.
2011-07-26 14:03:52 +00:00
Marius Strobl 5713a7bd8e MFC: r203059
Correct copy-paste typo from previous option description.
2011-07-26 13:58:09 +00:00
Marius Strobl 132224c578 MFC: r220389, r220392
- Mark getc() as inline, this has no effect on gcc but helps clang.
- Move getc() body before xgetc() so gcc does not emit a warning about function
  having no body.

Approved by:    jhb
2011-07-26 13:29:11 +00:00
Marius Strobl 6263fae071 MFC: r219452
Some more shrinking.

   o    bunch of variables are turned into uint8_t

   o    initial setting of namep[] in lookup() is removed
        as it's only overwritten a few lines down

   o    kname is explicitly initialized in main() as BSS
        in boot2 is not zeroed

   o    the setting and reading of "fmt" in load() is removed

   o    buf in printf() is made static to save space

Reviewed by:    jhb
Tested by:      me and Fabian Keil <freebsd-listen fabiankeil de>
2011-07-26 13:26:51 +00:00
Marius Strobl d25f2783c8 MFC: r219186
This patch shrinks boot2 a little.

o    It switches kname to be just a pointer instead of an array
     thus avoiding a couple of memcpy()s.

o    It changes ioctl to unsigned from uint8_t.

o    It changes the second keyhit limit to 3 seconds from 5
     so that constant propagation can take place.

o    It changes the ticks overflow computation as suggested by bde@.

o    It removes bi_basemem/bi_extmem/bi_memsizes_valid setting from
     bootinfo as it is unused.

Reviewed by: jhb
2011-07-26 13:24:52 +00:00
Marius Strobl acf06d239a MFC: r218926
In sys/boot/i386/boot2/boot2.c, change the type of the 'opts' variable
from uint16_t back to uint32_t.  The actual option bitmasks (RB_* and
RBX_*) assume at least a 32 bit variable.

Submitted by:	rdivacky
2011-07-26 13:23:26 +00:00
Marius Strobl 2eac6819a8 MFC: r218745
Remove reading of symbols from a.out loaded files.  Since we are tight
on space for clang and a.out support is only needed for /boot/loader,
they are excess bytes that serve no useful purpose other than to
support really old kernels (FreeBSD < 3.2 or so).  Prefer clang
support over support for these old kernels and remove this code.  We
gain about 100 bytes of space this way.

Reviewed by:	rdivacky@
2011-07-26 13:22:13 +00:00
Marius Strobl 6c7d91bfa1 MFC: r214210
Avoid using memcpy() for copying 32bit chunks. This shrinks
the resulting code a little.

Approved by:    rpaulo (mentor)
Reviewed by:    jhb
2011-07-26 13:19:57 +00:00
Marius Strobl e6b27077c9 MFC: r220685
MFi386: revisions 220389 and 220392

  - Mark getc() as inline, this has no effect on gcc but helps clang.
  - Move getc() body before xgetc() so gcc does not emit a warning about
    function having no body.
2011-07-26 13:13:31 +00:00
Marius Strobl 576154c4d2 MFC: r219960
MFi386: the part of 219452

  - bunch of variables are turned into uint8_t.
  - the setting and reading of "fmt" in load() is removed.
  - buf in printf() is made static to save space.
2011-07-26 13:12:08 +00:00
Marius Strobl a9a88df095 MFC: r219225
MFi386: revision 219186

  This patch shrinks boot2 a little.

  o    It switches kname to be just a pointer instead of an array.
  o    It changes ioctl to unsigned from uint8_t.
  o    It changes the second keyhit limit to 3 seconds from 5.
  o    It removes bi_basemem/bi_extmem/bi_memsizes_valid setting.
2011-07-26 13:06:20 +00:00
Marius Strobl 0dab6568ee MFC: r218842
MFi386: revision 218745

  Remove reading of symbols from a.out loaded files.
2011-07-26 13:04:48 +00:00
Marius Strobl 139493306d MFC: r218737, r218946
MFi386: revision 218713

  Apply a few small optimizations to boot2's code, to make it shrink a
  little further.
2011-07-26 13:01:14 +00:00
Marius Strobl dde283c279 MFC: r214257
MFi386: revision 214210

  Avoid using memcpy() for copying 32bit chunks. This shrinks
  the resulting code a little.
2011-07-26 12:58:29 +00:00
Marius Strobl 7ca2bb0a14 MFC: r212064, r212098
Use a cleaner expression to retrieve the memory size in pc98's boot2.c,
which also avoids NULL pointer arithmetic, as suggested by jhb.  The
available space goes from 11 bytes to 7.

Reviewed by:	nyan
Approved by:	rpaulo (mentor)
2011-07-26 12:57:22 +00:00
Marius Strobl d92984e276 MFC: r223938
Since r219452 the alignment of __dmadat has changed, revealing that fsread()
bogusly casts its contents around causing alignment faults on sparc64 and
most likely also on at least powerpc. Fix this by copying the contents
bytewise instead as partly already done here. Solving this the right way
costs some space, i.e. 148 bytes with GCC and 16 bytes with clang on x86
there are still some bytes left there though, and an acceptable hack which
tricks the compiler into only using a 2-byte alignment instead of the native
one when accessing the contents turned out to even take up more space that.
2011-07-25 23:01:08 +00:00
Marius Strobl 0d4ea792db MFC: r218713, r218716
Apply a few small optimizations to boot2's code, to make it shrink a
little further.  This gets us further on the way to be able to build it
successfully with clang.  Using in-tree gcc, this shrinks boot2.bin with
60 bytes, the in-tree clang shaves off 72 bytes, and ToT clang 84 bytes.

Submitted by:	rdivacky
Reviewed by:	imp
2011-07-25 21:41:46 +00:00
Marius Strobl 77eebe2393 MFC: r211747
Replace structure assignments with explicity memcpy calls. This allows
Clang to compile this file: it was using the builtin memcpy and we want
to use the memcpy defined in gptboot.c. (Clang can't compile boot2 yet).

Submitted by:	Dimitry Andric <dimitry at andric.com>
Reviewed by:	jhb
2011-07-25 21:39:09 +00:00
Marius Strobl f3b74a5a92 MFC: r192972 (partial)
Some of the boot loader code only works on a ufs file system, but it
uses the generic struct dirent, which happens to look identical to UFS's
struct direct.  If BSD ever changes dirent then this will be a problem.

Submitted by:	matthew dot fleming at isilon dot com
2011-07-25 21:37:52 +00:00
Pyun YongHyeon 036ebdfa49 MFC r224157:
Revert r222135 by allowing controller reinitialization.  Due to
  unknown reason Apple UniNorth2 gem(4) device required manual
  interface down/up operation after r222135.  Even though this is not
  correct thing and I don't like to revert it but it would be better
  than breaking gem(4) on PPC.  This should be revisited.

  PR:	kern/157405
2011-07-25 20:13:35 +00:00
Marius Strobl 4c601d3f61 MFC: r223986
- Expand the scope of the lock in the interrupt routine to close races with
  checking IFF_DRV_RUNNING and simplify the code. This also involves holding
  the driver lock in the rx_ch callout.
- Just use ifp instead of sc->sc_ifp.

Submitted by:	jhb (mostly)
2011-07-25 19:13:51 +00:00
Marius Strobl e1dd6318c7 MFC: r223984
PCIB_ALLOC_MSIX() may already fail on the first pass, f.e. when the PCI-PCI
bridge is blacklisted. In that case just return from pci_alloc_msix_method(),
otherwise we continue without a single MSI-X resource, causing subsequent
attempts to use the seemingly available resource to fail or when booting
verbose to NULL-dereference rle->start when trying to print the IRQ in
pci_alloc_msix_method().

Reviewed by:	jhb
2011-07-25 19:11:29 +00:00
Marius Strobl b6dba2dfc9 MFC: r223981
Remove extra empty lines.
2011-07-25 19:06:30 +00:00
Marius Strobl b6b571c8b8 MFC: r223962
Remove NULL assignments which are redundant for static timecounters.

Submitted by:	jkim
2011-07-25 19:04:57 +00:00
Marius Strobl bcda6653e3 MFC: r223961
- Remove redundant timecounter masking from counter_get_timecount().
- Zero the timecounter when allocation so we don't need to initialize unused
  members and remove a now redundant NULL assignment.

Submitted by:	jkim
2011-07-25 19:03:50 +00:00
Marius Strobl 3f514683d1 MFC: r223960
- Current testing shows that (ab)using the JBC performance counter in bus
  cycle mode as timecounter just works fine. My best guess is that a firmware
  update has fixed this, so check at run-time whether it advances and use a
  positive quality if it does. The latter will cause this timecounter to be
  used instead of the tick counter based one, which just sucks for SMP.
- Remove a redundant NULL assignment from the timecounter initialization.
2011-07-25 19:01:35 +00:00
Marius Strobl a432f50d86 MFC: r223959
- Add a missing shift in schizo_get_timecount(). This happened to be non-fatal
  as STX_CTRL_PERF_CNT_CNT0_SHIFT actually is zero, if we were using the
  second counter in the upper 32 bits this would be required though as the MI
  timecounter code doesn't support 64-bit counters/counter registers.
- Remove a redundant NULL assignment from the timecounter initialization.
2011-07-25 18:59:43 +00:00
Marius Strobl e6d29d126c MFC: r223944
According to the OpenSolaris source the PCI latency and the cache line size
should be set for Sun ERI.
Tested by:	yongari
2011-07-25 18:57:50 +00:00
Marius Strobl 77b8ad4bc4 MFC: r223801
It can be useful to know which page still has mappings.
2011-07-25 18:54:29 +00:00
Marius Strobl d13d85e395 MFC: r223800
- pmap_cache_remove() and pmap_protect_tte() are only used within pmap.c
  so static'ize them.
- Correct a typo.
2011-07-25 18:53:23 +00:00
Marius Strobl 7126f52bf8 MFC: r223795
Call pmap_qremove() before freeing or unwiring the pages, otherwise
there's a window during which a page can be re-used before its previous
mapping is removed.

Reviewed by:	alc
2011-07-25 18:46:56 +00:00
Marius Strobl 076bfa3895 MFC: r223721
UltraSPARC-IV CPUs seem to be affected by a not publicly documented
erratum causing them to trigger stray vector interrupts accompanied by a
state in which they even fault on locked TLB entries. Just retrying the
instruction in that case gets the CPU back on track though. OpenSolaris
also just ignores a certain number of stray vector interrupts.
While at it, implement the stray vector interrupt handling for SPARC64-VI
which use these for indicating uncorrectable errors in interrupt packets.
2011-07-25 18:44:46 +00:00
Marius Strobl 3dbf5441c6 MFC: r223720
Don't waste a delay slot.
2011-07-25 18:43:24 +00:00
Marius Strobl 2fd718a191 MFC: r223719
- For Cheetah- and Zeus-class CPUs don't flush all unlocked entries from
  the TLBs in order to get rid of the user mappings but instead traverse
  them an flush only the latter like we also do for the Spitfire-class.
  Also flushing the unlocked kernel entries can cause instant faults which
  when called from within cpu_switch() are handled with the scheduler lock
  held which in turn can cause timeouts on the acquisition of the lock by
  other CPUs. This was easily seen with a 16-core V890 but occasionally
  also happened with 2-way machines.
  While at it, move the SPARC64-V support code entirely to zeus.c. This
  causes a little bit of duplication but is less confusing than partially
  using Cheetah-class bits for these.
- For SPARC64-V ensure that 4-Mbyte page entries are stored in the 1024-
  entry, 2-way set associative TLB.
- In {d,i}tlb_get_data_sun4u() turn off the interrupts in order to ensure
  that ASI_{D,I}TLB_DATA_ACCESS_REG actually are read twice back-to-back.

Tested by:      Peter Jeremy (16-core US-IV), Michael Moll (2-way SPARC64-V)
2011-07-25 18:42:45 +00:00
Marius Strobl 70576b1da2 MFC: r223718
Using .comm to declare intrnames and eintrnames causes binutils 2.17.50 to
merge the two.
2011-07-25 18:34:42 +00:00
Marius Strobl 712175d688 MFC: r223648, r223949
- In gem_reset_rx() also reset the RX MAC which is necessary in order to
  get it out of a stuck condition that can be caused by GEM_MAC_RX_OVERFLOW.
- In gem_reset_rxdma() call gem_setladrf() in order to reprogram the RX
  filter and restore the previous content of GEM_MAC_RX_CONFIG. While at it
  consistently use the newly introduced sc_mac_rxcfg throughout the driver
  instead of reading the its old content.
- Increment if_iqdrops instead of if_ierrors in case of RX buffer allocation
  failure.
- According to the GEM datasheet the RX MAC should also be disabled in
  gem_setladrf() before changing its configuration.
- Add error messages to gem_disable_{r,t}x() and take advantage of these
  throughout the driver instead of duplicating their functionality all over
  the place.

In joint forces with:	yongari
2011-07-25 18:32:54 +00:00
Marius Strobl b1220958bb MFC: r223379
Fix whitespace
2011-07-25 18:29:35 +00:00
Marius Strobl 8aba800b76 MFC: r223347
As astopgap minimize the sched_lock coverage in pmap_activate() in order
to reduce lock contention.
2011-07-25 18:25:30 +00:00
Marius Strobl c8272d2ecf MFC: r223235
- As with stray vector interrupts limit the reporting of stray level
  interrupts. Bringup on additional machine models repeatedly reveals
  firmware that enables interrupts behind our back, causing the console
  to be flooded otherwise.
- As with the regular interrupt counters using uint16_t instead of
  u_long for counting the stray vector interrupts should be more than
  sufficient.
- Cache the interrupt vector in intr_stray_vector().
2011-07-25 18:24:17 +00:00
Marius Strobl f69ac634d3 MFC: r223126 (partial)
Don't include curcpu in the mask which is used as the IPI cookie as we
have to ignore it when sending the IPI anyway. Actually I can't think of
a good reason why this ever was done that way in the first place as it's
not even usefull for debugging.
2011-07-25 18:17:12 +00:00
Marius Strobl 82bcd448ff MFC: r222840
- For the case when tl1_align(_trap) is used to call rsf_fatal via
  RSF_FATAL we need to switch to alternate globals for KSTACK_CHECK just
  like tl1_data_excptn(_trap) does. This is more or less cosmetic because
  in case RSF_FATAL is called we're already heading south.
- Correct an END().
- Read the window state from the correct register for a CATR().
2011-07-25 17:56:06 +00:00
Marius Strobl aa39159e0b MFC: r222828 (partial)
- Test KTR_CPUMASK against pc_cpuid rather than pc_mid to match what the C
  version does.
- Initialize global registers early in the MP startup code so PCPU can be
  used.
2011-07-25 17:54:05 +00:00
Marius Strobl 83a8702f66 MFC: r221960
Recognize the SAB 82532 found in Fujitsu PRIMEPOWER650 and 900.
2011-07-25 17:37:54 +00:00
Marius Strobl dc462803e0 MFC: r221958
Recognize the eeprom device found in Fujitsu PRIMEPOWER650 and 900.
2011-07-25 17:32:22 +00:00
Marius Strobl 0e9f6a15fe MFC: r221957
Add support for MK48T37.
2011-07-25 17:31:09 +00:00
Marius Strobl 53678b00e2 MFC: r221955
- Add 10baseT as an alias for 10baseT/UTP.
- Add shorthand aliases for common media+option combinations as announced
  by miibus(4) so that one can actually supply the media strings found in
  the dmesg output to ifconfig(8).

Obtained from:	NetBSD (in principle)
2011-07-25 17:20:33 +00:00
Marius Strobl 10b6f044e1 MFC: r221954
When setting media always and not just in case of switching to IFM_AUTO
clear the options of the current media, i.e. only inherit the instance,
which matches what NetBSD does. Without this it's really non-intuitive
that the following sequence:
	ifconfig bge0 media 1000baseT mediaopt full-duplex
	ifconfig bge0 media 100baseTX
results in 100baseTX full-duplex to be set or that:
	ifconfig bge0 media autoselect mediaopt flowcontrol
	ifconfig bge0 media 1000baseT mediaopt full-duplex
tries to set 1000baseT full-duplex with flowcontrol, which isn't suported
und thus fails while the following:
	ifconfig re0 media 1000baseT mediaopt flowcontrol,full-duplex
	ifconfig re0 media autoselect
just switches to autoselection without flowcontrol.
2011-07-25 17:18:47 +00:00
Marius Strobl e8c8a6e392 MFC: r221344
Correct spelling in comments.

Submitted by:	brucec
2011-07-25 17:14:55 +00:00
Marius Strobl 8ef395f7e9 MFC: r220951
Correct spelling in comments.

Submitted by:	brucec
2011-07-25 17:12:55 +00:00
Marius Strobl e44405a693 MFC: r220945
Correct spelling.

Submitted by:	brucec
2011-07-25 17:01:14 +00:00
Marius Strobl 79483b2714 MFC: r219335
- Allocate the DMA memory shared between the host and the controller as
  coherent.
- Add some missing bus_dmamap_sync() calls. This includes putting such
  calls before calling reply handlers instead of calling bus_dmamap_sync()
  for the request queue from individual reply handlers as these handlers
  generally read back updates by the controller.

Tested on amd64 and sparc64.
2011-07-25 16:59:41 +00:00
Marius Strobl 946736f02e MFC: r195274
Change explicit maximium numbers to the defined macro MPT_MAX_LUNS.
2011-07-25 16:54:31 +00:00
Marius Strobl 8c8db7d9e1 MFC: r209599 (partial), r209960:
r209960 | marius

  - Make the maxsize parameter of the data buffer DMA tag match maxio, which
    was missed in r209599.
    Reported and tested by: Michael Moll
  - Declare mpt_dma_buf_alloc() static just like mpt_dma_buf_free(), both are
    used in mpt.c only.

  Reviewed by:    ken
  MFC after:      r209599

r209599 | ken

  Change the mpt driver to allow larger I/O sizes.

  The mpt driver previously didn't report a 'maxio' size to CAM, and so the
  da(4) driver limited I/O sizes to DFLTPHYS (64K) by default.  The number
  of scatter gather segments allowed, as reported to busdma, was
  (128K / PAGE_SIZE) + 1, or 33 on architectures with 4K pages.

  Change things around so that we wait until we've determined how many
  segments the adapter can support before creating the busdma tag used for
  buffers, so we can potentially support more S/G segments and therefore
  larger I/O sizes.

  Also, fix some things that were broken about the module unload path.  It
  still gets hung up inside CAM, though.

  mpt.c:	Move some busdma initialization calls in here, and call
		them just after we've gotten the IOCFacts, and know how
		many S/G segments this adapter can support.

  mpt.h:	Add max_cam_seg_cnt.

  mpt_cam.c:	Fix the locking in mpt_cam_detach().

  mpt_pci.c:	Pull some busdma initialization and teardown out and put
		it in mpt.c.  We now delay it until we know many scatter
		gather segments the adapter can support, and therefore
		how to setup our busdma tags.

  mpt_raid.c:	Make sure we wake up the right wait channel to get the
		raid thread to wake up when we're trying to shut it down.

  Reviewed by:	gibbs, mjacob
  MFC after:	2 weeks
2011-07-25 16:45:12 +00:00
Marius Strobl 3e2ba3bc2b MFC: r203484
Do not release device, when changing number of openings.
2011-07-25 16:24:27 +00:00
Marius Strobl a7be453462 MFC: r210943
Figure which is the IO and MEM bars- do not assume that they are in
a fixed order.

PR:		149220
Obtained from:	John Baldwin
2011-07-25 16:20:02 +00:00
Marius Strobl 9820936eff MFC: r207543
Print IR_RESYNC updates informatively.

Obtained from:	pluknet
2011-07-25 16:14:36 +00:00
Marius Strobl 93a26a2fec MFC: r198262
Use callout_init_mtx on FreeBSD versions recent enough. This closes
the race where interrupt thread can complete the request for which
timeout has fired and while mpt_timeout has blocked on mpt_lock.
2011-07-25 16:11:52 +00:00
Marius Strobl da267f62d1 MFC: r220944, r220950
- Correct spelling. [1]
- Remove variables which are unused besides initialization. [2]

Submitted by:	brucec, N.J. Mann [1], Christoph Mallon [2]
2011-07-25 15:10:53 +00:00
Marius Strobl bfe1e06aaf MFC: r220943
Correct spelling in a comment.

Submitted by:	brucec
2011-07-25 15:05:37 +00:00
Marius Strobl b7a09e4a22 MFC: r220941
Correct spelling in comments.

Submitted by:	brucec
2011-07-25 15:01:40 +00:00
Marius Strobl 0fb9fe88ad MFC: r220940
Correct spelling in comments.

Submitted by:	brucec
2011-07-25 14:46:24 +00:00
Marius Strobl 40d9c36b02 MFC: r220939
Correct spelling in comments.

Submitted by:	brucec
2011-07-25 14:45:13 +00:00
Marius Strobl 6247b7e16c MFC: r220938
Correct spelling in comments.

Submitted by:	brucec
2011-07-25 14:44:00 +00:00
Marius Strobl 1187b42d76 MFC: r219782
On Serengeti-class machines the OFW root isn't the parent of the CPU
nodes.
2011-07-25 14:34:30 +00:00
Marius Strobl 3f8972c5af MFC: r216016
Define VM_KMEM_SIZE_MAX on sparc64. Otherwise kernel built with
DEBUG_MEMGUARD panics early in kmeminit() with the message
"kmem_suballoc: bad status return of 1" because of zero "size" argument
passed to kmem_suballoc() due to "vm_kmem_size_max" being zero.

The problem also exists on ia64.
2011-07-25 14:33:37 +00:00
Doug Barton c3e3a2170d MFC r197728:
Add OpenVPN IANA assigned port number.
2011-07-24 23:44:16 +00:00
Doug Barton 6ad9414e85 MFC r224125:
Commemorate the release of RFC 6303 by updating the comments regarding
our default empty zones.  No functional changes.
2011-07-22 21:45:28 +00:00
Doug Barton 8b6cabed9c MFC r224124:
Pick up the 2011-06-08 update to this file, the addition of an IPv6
address for D.
2011-07-22 21:43:23 +00:00
Doug Barton 46c29335aa MFC r224122:
Fix the location of the default pid file in named.8
2011-07-22 21:41:09 +00:00
Glen Barber 78fff821c3 MFC 216823, 223991, 223992:
216823 (by pjd):
- For compatibility with Linux and Solaris add poweroff(8).
  It is implemented as a hard link to shutdown(8) and it is equivalent
  of:

        # shutdown -p now

  While I'm here put one line of usage into one line of C code so it
  is easier to grep(1) and separate unrelated code with empty line.

223991:
- Improvements to the shutdown(8) manual.

223992:
- Remove trailing whitespace in the shutdown(8) manual.

Approved by:		delphij
2011-07-22 00:58:09 +00:00
Andrew Gallatin 2d8868f043 MFC r223958:
Update mxge(4) firmware to the latest version available from
  Myricom (1.4.53a).
2011-07-20 21:18:05 +00:00
Andrew Gallatin 58dc16647c MFC r223957: Fix media reporting for dual port CX4 myri10ge NICs 2011-07-20 20:24:40 +00:00
Tai-hwa Liang 902f1c5790 MFC r223035: Using statfs.f_fstypename rather than statfs.f_type whilst
performing fstype comparsion as nullfs will copy f_type from underlayer FS.

PR:		bin/156258
Submitted by:	Marcin Wisnicki <[email protected]>
2011-07-19 03:30:42 +00:00
John Baldwin 339cf820de MFC 222530,223841:
Add a new option to toggle the display of the system idle process (per-CPU
idle threads).  The process is displayed by default (subject to whether or
not system processes are displayed) to preserve existing behavior.  The
system idle process can be hidden via the '-z' command line argument or the
'z' key while top is running.  When it is hidden, top more closely matches
the behavior of FreeBSD <= 4.x where idle time was not accounted to any
process.
2011-07-18 18:37:15 +00:00
Matthew D Fleming 060120ec5c MFC r223875, r223876:
style(9) and cleanup fixes.

Add an option to have a fail point term only execute when run by a
specified pid.  This is helpful for automated testing involving a global
knob that would otherwise be executed by many other threads.
2011-07-18 18:09:10 +00:00
John Baldwin 65b18625de MFC 223870,223937:
- Note that -a, -C, -H, -j, and -z are also toggles.
- Add a leading space to the status messages output after toggling the
  'C' and 'H' flags at runtime.  This matches messages output for other
  toggles which leave the first column in the message blank to hold the
  cursor.
2011-07-14 19:25:42 +00:00
Sean Bruno 7d7b217fe8 MFC r222541, r222464, r222466
Modify the umount(8) command so that it doesn't do
a sync(2) syscall before unmount(2) for the "-f" case.
This avoids a forced dismount from getting stuck for
an NFS mountpoint in sync() when the server is not
responsive. With this commit, forced dismounts should
normally work for the NFS clients, but can take up to
about 1minute to complete.

Add a check for MNTK_UNMOUNTF at the beginning of nfs_sync()
in the old NFS client so that a forced dismount doesn't
get stuck in the VFS_SYNC() call that happens before
VFS_UNMOUNT() in dounmount(). Analagous to r222329 for the new NFS client.
An additional change is needed before forced dismounts will work.

Add a sentence to the umount.8 man page to clarify the behaviour
for forced dismount when used on an NFS mount point. Requested by
Jeremy Chadwick.
This is a content change
2011-07-13 17:09:15 +00:00
Andrey V. Elsukov 2dfe91e7ca MFC r223661:
Improve error reporting. Use corresponding error message when file to be
  preprocessed is missing. Also suggest to use absolute pathname if -p
  option is specified.

  PR:             bin/156653
2011-07-13 04:30:16 +00:00
David E. O'Brien a0b3d944f9 MFC:
+ r223940 (as r223969): If one's message is longer than the buffer size,
then we reset 'cnt' at the wrong point and the actual column # get out of
sync across the buffer size.
+ r175346: Handle wrapping correctly when \r appears in the input,
and don't remove the \r from the output.  For lines longer than 79
characters, don't drop every 80th character.
2011-07-12 23:48:57 +00:00
John Baldwin d3661e16a0 MFC 182966:
Display the sum of the runtime of all the threads in a process when it's
multithreaded instead of picking the time of the first thread found.
2011-07-12 14:28:13 +00:00
Pyun YongHyeon 6f394ee5a4 MFC r223683:
Document two known hardware errata which requires manual link
  configuration.

  Submitted by:	Aries Lee (arieslee <> jmicron com)
2011-07-10 22:09:53 +00:00
Andrey V. Elsukov 4abbec575a MFC r222808 (except SCTP support):
Sync ng_nat with recent (r222806) ipfw_nat changes:

    Make a behaviour of the libalias based in-kernel NAT a bit closer to
    how natd(8) does work. natd(8) drops packets only when libalias returns
    PKT_ALIAS_IGNORED and "deny_incoming" option is set, but ipfw_nat
    always did drop packets that were not aliased, even if they should
    not be aliased and just are going through.
2011-07-07 09:51:31 +00:00
Andrey V. Elsukov 36901420b6 MFC r222806:
Make a behaviour of the libalias based in-kernel NAT a bit closer to
  how natd(8) does work. natd(8) drops packets only when libalias returns
  PKT_ALIAS_IGNORED and "deny_incoming" option is set, but ipfw_nat
  always did drop packets that were not aliased, even if they should
  not be aliased and just are going through.

  PR:		kern/122109, kern/129093, kern/157379
  Submitted by:	Alexander V. Chernikov (previous version)
2011-07-07 09:42:32 +00:00
Andrey V. Elsukov bc937b9836 MFC r222582:
O_FORWARD_IP is only action which depends from the result of lookup of
  dynamic rules. We are doing forwarding in the following cases:
   o For the simple ipfw fwd rule, e.g.

        fwd 10.0.0.1 ip from any to any out xmit em0
        fwd 127.0.0.1,3128 tcp from any to any 80 in recv em1

   o For the dynamic fwd rule, e.g.

        fwd 192.168.0.1 tcp from any to 10.0.0.3 3333 setup keep-state

          When this rule triggers it creates a dynamic rule, but this
        dynamic rule should forward packets only in forward direction.

   o And the last case that does not work before - simple fwd rule which
   triggers when some dynamic rule is already executed.

  PR:           kern/136695, kern/147720, kern/150798
2011-07-06 06:57:07 +00:00
Pyun YongHyeon 3a41f614b8 MFC r223610:
Enable CPUSaver D102 E-step microcode loading for 82551 revision
  0x10.
2011-07-05 23:31:40 +00:00
Pyun YongHyeon 6a34cf919c MFC r223608:
Disable microcode loading for 82550 and 82550C controllers. Loading
  the microcode caused SCB timeouts. Linux driver does not allow
  microcode loading for these controllers and jfv also confirmed that
  there is no need to do and it shouldn't.

  PR:				kern/103332
  Additional confirmation from:	jfv
2011-07-05 23:18:28 +00:00
Jonathan Anderson 0e0a95d68f Merge r223505 from HEAD to stable/7:
--
Tidy up a capabilities-related comment.

This commit refers to an #ifdef that hasn't been merged [yet?]; remove it.

Approved by: rwatson
--
2011-07-05 14:58:10 +00:00
Sergey Kandaurov 1d7d8df388 MFC r223644:
Run load_rc_config early to fix quota knobs expansion.

PR:		conf/157687
2011-07-05 10:37:17 +00:00
Jaakko Heinonen ff8f009685 MFC r222825: Remove a gratuitous newline.
PR:		bin/153667
2011-07-03 07:16:59 +00:00
Pyun YongHyeon 50f65d2dab MFC r223405:
Remove link state change callback handler.  There is no need to
  register both status change and link state change callbacks.
  Implement checking valid link in state change callback and poll
  active link state in vr_tick().  This allows immediate detection of
  lost link as well as protecting driver from frequent link flips during
  link renegotiation.  taskq implementation was removed because driver
  now needs to poll link state in vr_tick().
  While I'm here do not report current link state if interface is not
  running.

  Tested by:	n_hibma
2011-06-29 17:20:10 +00:00
Dimitry Andric acbecca7ed MFC r223579:
For some reason, contrib/traceroute/traceroute.c ensures MAXHOSTNAMELEN
is defined, but then proceeds to use a hardcoded maximum hostname length
of 64 anyway.  Fix this by checking against MAXHOSTNAMELEN instead.

PR:	bin/157732
2011-06-29 16:46:12 +00:00
Edwin Groothuis 347f23e030 Get ISO3166 in sync with head.
MFC of recent updates on the ISO3166 file:

r223633
- Remove AN again now that tzdata2011h has been imported.

r222094
- Put AN back after finding out that tzsetup(1) will complain that
  it doesn't exist. It will be removed again once the tzdata distribution
  files have been updated with the replacements for AN.

r222014
- Revert change to "MF" I made in r189767.  I bet that at the time of r189767
  I checked with http://www.iso.org/iso/country_codes/iso_3166_code_lists.htm
  and "MF" was officially spelled in English as "Saint Martin" there, but now
  that "SX" exists (for "Sint Maarten (Dutch part)") (nice official "English"
  spelling!) they seem to have added a "(French part)" suffix to "MF".  Since
  this is also in line with Newsletter VI-1 (2007-09-21), catch up.

r222011
- ISO3166: Update for newsletters VI-7 and VI-8 from 2010
  - Name change for SH
  - BQ, CW, and SX replace AN

  Reviewed by:	ru

r222010
- Whitespace and typo fixes.

  Found by:	codespell
  Reviewed by:	ru

r198948
- Revert the spelling of Taiwan to be politically neutral in accordance
  with the policy published at http://www.freebsd.org/internal/i18n.html.

  Requested by:	core (murray)

r197392
- List newsletters VI-2, VI-3 and VI-4 that were already applied.
- Apply newsletters VI-5 (BO's name change) and VI-6 (VE's name change).

r191347
- Back out my previous change

r191197
- Change Taiwan, Province of China to Taiwan, Republic of China

r189767
- Switch to using official English short country names.

r174241
- Update with data from Newsletter VI-1 2007-09-21:
    Added SAINT BARTHELEMY (BL) and SAINT MARTIN (MF).
  This allows an MFV of src/share/zoneinfo which uses these two new codes.
2011-06-28 11:01:11 +00:00
Edwin Groothuis f93f73d65c MFC of tzdata2011h, r223629
- Russia scraps DST in 2011
- Remove Netherlands Antilles, add Bonaire, Curacao, Sint Maarten
2011-06-28 10:29:18 +00:00
Andrey V. Elsukov 8bcae50039 MFC r223364:
When user specifies the bootcode with size smaller than VTOC_BOOTSIZE,
  gpart_write_partcode_vtoc8 does access out of range of allocated memory.
  Check size of bootcode before writing it.

  Pointed out by:	ru
2011-06-28 05:04:31 +00:00
Bjoern A. Zeeb bddf102e89 MFC r223267:
Add 'show logstate' to usage().

MFC r223345:

 Add global -d and -e options to either print device numbers
 (usually default) or enclosure:slot information as (Exx:Sxx)
 or both.

 Discussed with:	jhb
 Reviewed by:		jhb
Sponsored by:		Sandvine Incorporated
2011-06-27 11:13:58 +00:00
Bjoern A. Zeeb 82901fff43 MFC r223223:
gre(4) was using a field in the softc to detect possible recursion.
 On MP systems this is not a usable solution anymore and could easily
 lead to false positives triggering enough logging that even  using
 the console was no longer usable (multiple parallel ping -f can do).

 Switch to the suggested solution of using mbuf tags to carry per
 packet state between gre_output() invocations.  Contrary to the
 proposed solution modelled after gif(4) only allocate one mbuf tag
 per packet rather than per packet and per gre_output() pass through.

 As the sysctl to control the possible valid (gre in gre) nestings does
 no sanity checks, make sure to always allocate space in the mbuf tag
 for at least one, and at most 255 possible gre interfaces to detect
 loops in addition to the counter.

 Submitted by:	Cristian KLEIN (cristi net.utcluj.ro) (original version)
PR:		kern/114714
 Reviewed by:	Cristian KLEIN (cristi net.utcluj.ro)
 Reviewed bu:	Wooseog Choi (ben_choi hotmail.com)
Sponsored by:	Sandvine Incorporated
2011-06-27 11:11:19 +00:00
Doug Barton d8ade02449 MFC r223310:
Add the netwait rc.d script. It waits for the specified period for the
network to become active.

MFC r223311, r2233408:

The script itself, and a minor fix to it.
2011-06-25 23:14:49 +00:00
Doug Barton 6b455fbe3f MFC r223264:
Add rc.d/kld to load kernel modules after local disks are up.
2011-06-25 23:09:25 +00:00
Doug Barton 9832c5886d MFC r211094:
"whereis netscape" gives empty output for quite a long time already.
  Suggest to use "whereis firefox" instead.

MFC r212168:
  fix the move so that it matches what the rest of the internet
  says about this game...  This move also makes more sense...

MFC r213287
  Add advice to new fathers from Thomas Ptacek.

MFC r221908
  fortune(6): fix typos and misspellings.

  While here, drop words in the spelling files that are no longer used
  anywhere.

  Speling errors found via:	codespell from Lucas De Marchi

MFC r221909
  Convert a file to UTF-8. This only changes a character in the
  copyright section and will not require UTF-8 for fortune(6).

MFC r222890
  Minor typo, fix 2 attributions
2011-06-25 22:36:41 +00:00
Xin LI eb8a1d8396 MFC less v444. 2011-06-23 00:36:49 +00:00
Andriy Gapon 7174fa0841 MFC r222805: amdsbwd: update to support SB8xx southbridges
PR:		kern/157568
2011-06-22 06:58:42 +00:00
Pyun YongHyeon 3824ce885f MFC r222232:
Add 88E8075 Yukon Supreme to the list of supported hardware list.
2011-06-22 01:57:45 +00:00
Pyun YongHyeon 0e296002b9 MFC r222269:
style(9)
2011-06-22 01:55:47 +00:00
Pyun YongHyeon afb9eb3ad5 MFC r222230:
Add initial support for Marvell 88E8055/88E8075 Yukon Supreme.
2011-06-22 01:48:41 +00:00
Pyun YongHyeon e914a98d5e MFC r222219,222221,222223,222226-222227,222231,222516:
Merge all relevant changes from HEAD to fix long standing
  instability issues of msk(4).  To get desired effect of this
  merge, cold restarting is required because incorrectly programmed
  registers are not reset to default value.
  PR:	kern/114631, kern/116853, kern/139093, kern/144206,
	kern/147824, kern/151169, kern/154591, kern/155636,
	kern/156493

r222219:
  Do not blindly clear entire GPHY control register. It seems some
  bits of the register is used for other purposes such that clearing
  these bits resulted in unexpected results such as corrupted RX
  frames or missing LE status updates.  For old controllers like
  Yukon EC it had no effect but it caused all kind of troubles on
  Yukon Supreme.
  This change shall improve stability of controllers like Yukon
  Ultra, Ultra2, Extreme, Optima and Supreme.

r222221:
  Rework store and forward configuration of TX MAC FIFO. Basically it
  enables store and forward mode except for jumbo frame on Yukon
  Ultra.

r222223:
  Do not configure RAM registers for controllers that do not have
  them.  These registers are defined only for Yukon XL, Yukon EC and
  Yukon FE.

r222226:
  Make sure to enable all clocks before accessing registers.
  Releasing PHY from power down/COMA is done after enabling all
  clocks. While I'm here remove unnecessary controller reset.

r222227:
  Do not touch ASF related register for controllers that do not have
  these registers. Also disable Watchdog of ASF microcontroller.

r222231:
  When MTU is changed, check whether driver should be reinitialized or
  not.  If reinitialized is required, clear driver running flag.

r222516:
  Correctly check MAC running status before disabling TX/RX MACs.
2011-06-22 01:44:09 +00:00
Pyun YongHyeon 5c848ec1c4 MFC r205091,216860:
r205091:
  Implement Rx checksum offloading for Yukon EC, Yukon Ultra,
  Yukon FE and Yukon Ultra2. These controllers provide very simple
  checksum computation mechanism and it requires additional pseudo
  header checksum computation in upper stack. Even though I couldn't
  see much performance difference with/without Rx checksum offloading
  it may help notebook based controllers.

  Actually controller can compute two checksum value by giving
  different starting position of checksum computation on received
  frame. However, for long time, Marvell's checksum offloading engine
  have been known to have several silicon bugs so don't blindly trust
  computed partial checksum value. Instead, compute partial checksum
  twice by giving the same checksum computation position and compare
  the result. If the value is different it's clear indication of
  hardware bug. This configuration lose IP checksum offloading
  capability but I think it's better to take safe route.
  Note, Rx checksum offloading for Yukon XL was still disabled due to
  known silicon bug.

r216860:
  Fix endianness bug introduced in r205091.
  After controller updates control word in a RX LE, driver converts
  it to host byte order. The checksum value in the control word is
  stored in big endian form by controller. r205091 didn't account for
  the host byte order conversion such that the checksum value was
  incorrectly interpreted on big endian architectures which in turn
  made all TCP/UDP frames dropped. Make RX checksum offload work
  on any architectures by swapping the checksum value.

  Reported by:	Sreekanth M. ( kanthms <> netlogicmicro dot com )
  Tested by:	Sreekanth M. ( kanthms <> netlogicmicro dot com )
2011-06-22 00:49:24 +00:00
Pyun YongHyeon 927ceee8fa MFC r222542:
If driver is not running, disable interrupts and do not try to
  process received frames.  Previously it was possible to handle RX
  interrupts even if controller is not fully initialized. This
  resulted in non-working driver after system is up and running.

  Reported by:	hselasky
  Tested by:	hselasky
2011-06-22 00:39:36 +00:00
Pyun YongHyeon 7ef0cbe3d9 MFC r221974:
Correctly disable jumbo frame support for BCM5719 A0.
2011-06-22 00:22:26 +00:00
Pyun YongHyeon d29be935c6 MFC r221818:
Add initial BCM5719 support. TSO and jumbo frame was intentionally
  disabled for BCM5719 A0 revision due to known hardware errata.
  Many thanks to Broadcom for continuing support of FreeBSD.

  Submitted by:	Geans Pin at Broadcom
2011-06-22 00:17:48 +00:00
John Baldwin a0ccf79158 MFC 221346,223049:
Handle a rare edge case with nearly full TCP receive buffers.  If a TCP
buffer fills up causing the remote sender to enter into persist mode, but
there is still room available in the receive buffer when a window probe
arrives (either due to window scaling, or due to the local application
very slowing draining data from the receive buffer), then the single byte
of data in the window probe is accepted.  However, this can cause rcv_nxt
to be greater than rcv_adv.  This condition will only last until the next
ACK packet is pushed out via tcp_output(), and since the previous ACK
advertised a zero window, the ACK should be pushed out while the TCP
pcb is write-locked.  To guarantee this, advance the advertised window
(rcv_adv) even if we advertise a zero window.

During the window while rcv_nxt is greather than rcv_adv, a few places
would compute the remaining receive window via rcv_adv - rcv_nxt.
However, this value was then (uint32_t)-1.  On a 64 bit machine this
could expand to a positive 2^32 - 1 when cast to a long.  In particular,
when calculating the receive window in tcp_output(), the result would be
that the receive window was computed as 2^32 - 1 resulting in advertising
a far larger window to the remote peer than actually existed.

Fix various places that compute the remaining receive window to either
assert that it is not negative (i.e. rcv_nxt <= rcv_adv), or treat the
window as full if rcv_nxt is greather than rcv_adv.
2011-06-20 18:08:52 +00:00
Andrey V. Elsukov c56c781c4b MFC r222745:
Initialize co.use_set variable before parsing each new rule.

  PR:		bin/134975
2011-06-20 13:52:14 +00:00
Andrey V. Elsukov f3becdf1f0 MFC r222744:
Increase buffer size for the command line.

  PR:		bin/125370
2011-06-20 13:46:57 +00:00
Bjoern A. Zeeb 25bcf950be MFC r223057:
Add a new option -P to suppress getservbyport(3) calls when printing rules.
 This allows one to force consistent printing of numeric port numbers like
 we do with -n for other tools like netstat (just that -n was already taken)
 rather than the service names.

 PR:            misc/151015
 Submitted by:  Matt Koivisto (mkoivisto sandvine.com)
Sponsored by:   Sandvine Incorporated
2011-06-20 08:37:34 +00:00
Gregory Neil Shapiro fc186c4d2a sendmail has been updated to 8.14.5 2011-06-20 02:09:15 +00:00
Gregory Neil Shapiro f86fd89a49 MFC: Minor change to force commit this file so new freebsd*.cf files are
built to use the new sendmail-8.14.5/cf tree.
2011-06-20 02:06:45 +00:00
Gregory Neil Shapiro 0657767bfc MFC: Update DNSBL information (MAPS has been acquired, used a generic example) 2011-06-20 02:05:56 +00:00
Gregory Neil Shapiro 34b4c93e63 Merge sendmail 8.14.5 to RELENG_7 2011-06-20 02:04:20 +00:00
Benedict Reuschling 689415b5f8 MFC r223160:
Fix some wording and grammar in the BUGS section.

PR:             docs/157901
Submitted by:   Niclas Zeising (niclas dot zeising at gmail dot com)
Reviewed by:    mav
2011-06-19 11:14:02 +00:00
Bjoern A. Zeeb 42f80a3d4b MFC r219722 (by jhb):
Preserve errno in an error case.
  Submitted by: gcooper

MFC r222899:
  Contrary to when returning in all-good cases at the end of functions we
  did not free memory (1) or close the file descriptor (2) in error cases.

  Reported by:	Mark Johnston (1)
  Reported by:	attilio (2)
  Reviewed by:	jhb
Sponsored by:	Sandvine Incorporated
2011-06-18 22:12:53 +00:00
Bjoern A. Zeeb ce5daeaae3 MFC r222272:
Add FEATURE() definitions for IPv4 and IPv6 so that we can use
  feature_present(3) to dynamically decide whether to use one or the
  other family.
2011-06-18 22:09:44 +00:00
Jaakko Heinonen a138e20111 MFC r216177: Remove stale link.
PR:		151252
2011-06-18 05:13:48 +00:00
Glen Barber f99b2adb43 MFC 186487 by trhodes:
Remove reference to unimplemented "-c" option.

PR:		119338
2011-06-15 01:08:47 +00:00
Glen Barber a79bd6acb5 MFC 186445 by trhodes:
Netgroup database can be centralized via NIS, list it.
Add a missing comma and bump doc date.

PR:		127602
2011-06-14 23:30:48 +00:00
Glen Barber 21f0271598 MFC 187627 by trhodes:
Note the implication of setting the 'w' permission on directories,
while here, expand the 'naughty bits' comment in BUGS.

PR:		84268
2011-06-14 22:52:24 +00:00
Glen Barber 2ccdc58763 MFC 187663 by trhodes:
When "-b" is specified, one could easily create "smaller" files
that are much larger than expected (given the default size).
Change "smaller files" to "split files" which is more in line
with what "-b" actually does.

PR:		119329
2011-06-14 22:40:13 +00:00
Glen Barber fd3b927d5e MFC 187066 by trhodes:
Quote the "u" as it's the name of the union, this may prevent
some confusion when reading the manual page.

PR:		117798
2011-06-14 22:37:09 +00:00
John Baldwin cd93692f1f MFC 222750:
Clear the device_t pointer in 'struct resource' when releasing a device
as otherwise the sysctl to export rman info can dereference a stale
pointer.
2011-06-14 18:54:42 +00:00
Glen Barber 1df81cfa41 MFC 216147 [1], 219424 [2]:
216147 by delphij [1]:
 - Recommend a overwrite of whole geli provider before use.

219424 by pjd [2]:
 - Change example wording.

PR:		155385 [2]
2011-06-14 10:50:16 +00:00
Jaakko Heinonen 6735a6ddf1 MFC r221390: Don't pass empty mount options to nmount(2). 2011-06-13 15:59:21 +00:00
Glen Barber 3f8c2d4d1b MFC 176470 [1]:
Document TCLASS in ip6(4).

PR:		120945
Original commit by:	bms [1]
2011-06-11 01:58:31 +00:00
Glen Barber f932de4dfe MFC 181265 [1]:
Document EAGAIN in ERRORS according to kern_jail.c.

PR:		125253
Original commit by:	trhodes [1]
2011-06-11 01:44:49 +00:00
Glen Barber fc3938a399 MFC 186440 [1]:
Add "crit" to the list of keywords.

PR:		126934
Original commit by:	trhodes [1]
2011-06-11 01:21:54 +00:00
Glen Barber 84474e0ed8 MFC 222758, 222759, 222770:
- Document that when running 'su -m <user> -c <command>', <command> is
  run within a shell as <user>.
- Bump date
- Attempt to clear up some confusion in the following example, by
  stating the '-c' argument is passed to the shell, not to su(1), which
  would indicate the login class.

      'su -m <user> -c <command>'

PR:		157078
2011-06-11 00:31:37 +00:00
Glen Barber 842c7b0f28 MFC 186489 [1]:
Document that kldunloadf can return EINVAL.

PR:		125639
Original commit by:	trhodes [1]
2011-06-11 00:06:14 +00:00
Glen Barber 5b432bc958 MFC 191635 [1]:
- xref ndp(8)

PR:		134053
Original commit by:	danger [1]
2011-06-10 23:52:53 +00:00
Glen Barber 362ae5e4b3 MFC 198714 [1]:
- The majors file was removed long ago, 0 should be used instead.

PR:		139230
Original commit by:	brueffer
2011-06-10 23:42:49 +00:00
John Baldwin a6d47a1405 MFC 222532:
- Document the -H option and 'H' key alongside other options and keys
  rather than at the bottom of the manpage.
- Remove an obsolete comment about SWAIT being a stale state.  It was
  resurrected for a different purpose in FreeBSD 5 to mark idle ithreads.
- Add a comment documenting that the SLEEP and LOCK states typically
  display the name of the event being waited on with lock names being
  prefixed with an asterisk and sleep event names not having a prefix.
2011-06-10 19:16:50 +00:00
John Baldwin 53900c3d23 MFC 222651:
Properly return an ENOBUFS error if a write to a tun(4) device fails
due to m_uiotombuf() failing.

While here, trim unneeded error handling related to tuninit() since it
can never fail.
2011-06-10 19:08:17 +00:00
John Baldwin d94b905938 MFC 222254:
Fix an issue with critical sections and SMP rendezvous handlers.
Specifically, a critical_exit() call that drops the nesting level to zero
has a brief window where the pending preemption flag is set and the
nesting level is set to zero.  This is done purposefully to avoid races
where a preemption scheduled by an interrupt could be lost otherwise (see
revision 144777).  However, this does mean that if an interrupt fires
during this window and enters and exits a critical section, it may preempt
from the interrupt context.  This is generally fine as the interrupt code
is careful to arrange critical sections so that they are not exited until
it is safe to preempt (e.g. interrupts EOI'd and masked if necessary).

However, the SMP rendezvous IPI handler does not quite follow this rule,
and in general a rendezvous can never be preempted.  Rendezvous handlers
are also not permitted to schedule threads to execute, so they will not
typically trigger preemptions.  SMP rendezvous handlers may use
spinlocks (carefully) such as the rm_cleanIPI() handler used in rmlocks,
but using a spinlock also enters and exits a critical section.  If the
interrupted top-half code is in the brief window of critical_exit() where
the nesting level is zero but a preemption is pending, then releasing the
spinlock can trigger a preemption.  Because we know that SMP rendezvous
handlers can never schedule a thread, we know that a critical_exit() in
an SMP rendezvous handler will only preempt in this edge case.  We also
know that the top-half thread will happily handle the deferred preemption
once the SMP rendezvous has completed, so the preemption will not be lost.

This makes it safe to employ a workaround where we use a nested critical
section in the SMP rendezvous code itself around rendezvous action
routines to prevent any preemptions during an SMP rendezvous.  The
workaround intentionally avoids checking for a deferred preemption
when leaving the critical section on the assumption that if there is a
pending preemption it will be handled by the interrupted top-half code.
2011-06-10 19:03:32 +00:00
John Baldwin 89b0d0e382 MFC 222252:
Simplify a stale assertion.  We have not called mi_switch() from a nested
critical section during a preemption for several years.
2011-06-10 18:58:48 +00:00
John Baldwin 670302dd5c MFC 222032:
Fix a race in the SMP rendezvous code.  Specifically, the write by the
last CPU to to finish the rendezvous action may become visible to
different CPUs at different times.  As a result, the CPU that initiated
the rendezvous may exit the rendezvous and drop the lock allowing another
rendezvous to be initiated on the same CPU or a different CPU.  In that
case the exit sentinel may be cleared before all CPUs have noticed causing
those CPUs to hang forever.

Workaround this by using a generation count to notice when this race
occurs and to exit the rendezvous in that case.
2011-06-10 18:56:12 +00:00
John Baldwin 0ec1143fee MFC 220794:
When checking to see if a window update should be sent to the remote peer,
don't force a window update if the window would not actually grow due to
window scaling.  Specifically, if the window scaling factor is larger than
2 * MSS, then after the local reader has drained 2 * MSS bytes from the
socket, a window update can end up advertising the same window.  If this
happens, the supposed window update actually ends up being a duplicate ACK.
This can result in an excessive number of duplicate ACKs when using a
higher maximum socket buffer size.
2011-06-10 18:51:33 +00:00
John Baldwin 1547cc787b MFC 221209:
TCP reuses t_rxtshift to determine the backoff timer used for both the
persist state and the retransmit timer.  However, the code that implements
"bad retransmit recovery" only checks t_rxtshift to see if an ACK has been
received in during the first retransmit timeout window.  As a result, if
ticks has wrapped over to a negative value and a socket is in the persist
state, it can incorrectly treat an ACK from the remote peer as a
"bad retransmit recovery" and restore saved values such as snd_ssthresh and
snd_cwnd.  However, if the socket has never had a retransmit timeout, then
these saved values will be zero, so snd_ssthresh and snd_cwnd will be set
to 0.

If the socket is in fast recovery (this can be caused by excessive
duplicate ACKs such as those fixed by 220794), then each ACK that arrives
triggers either NewReno or SACK partial ACK handling which clamps snd_cwnd
to be no larger than snd_ssthresh.  In effect, the socket's send window
is permamently stuck at 0 even though the remote peer is advertising a
much larger window and pending data is only sent via TCP window probes
(so one byte every few seconds).

Fix this by adding a new TCP pcb flag (TF_PREVVALID) that indicates that
the various snd_*_prev fields in the pcb are valid and only perform
"bad retransmit recovery" if this flag is set in the pcb.  The flag is set
on the first retransmit timeout that occurs and is cleared on subsequent
retransmit timeouts or when entering the persist state.
2011-06-10 18:47:10 +00:00
Andriy Gapon bd82765348 MFC r222720,222721: corrections to amdsbwd.4 2011-06-09 08:33:42 +00:00
John Baldwin a4e09826c5 MFC 221208:
Add a 'show progress' command that shows a summary of all in-progress
commands for a given adapter.  Specifically, it shows the status of any
drive or volume activities currently in progress similar to the
'drive process' and 'volume progress' commands.
2011-06-08 21:10:55 +00:00
Andrey V. Elsukov e0713da0e7 MFC r222559:
Hide useless warning under debug macro.

  PR:           kern/69963, kern/139226

  This is direct commit to stable/7.
2011-06-08 04:54:22 +00:00
John Baldwin 84a4dc60d7 MFC 221138:
Only align MSI message groups based on the number of messages being
allocated, not the maximum number of messages the device supports.  The
spec only requires the former, and I believe I implemented the latter due
to misunderstanding an e-mail.  In particular, this fixes an issue where
having several devices that all support 16 messages can run out of
IDT vectors on x86 even though the driver only uses a single message.
2011-06-07 21:16:02 +00:00
Glen Barber 6e4f1caab1 MFC 187607 [1]:
Attaching to the init process returns EINVAL,
so give an example that is more likely to work.
Stolen from the ktrace(1) manual page.

PR:		128222
Original commit by:	trhodes
2011-06-06 22:14:46 +00:00
Glen Barber 5c2499a2e1 MFC 191634 [1]:
- fix path for locale.alias

PR:		134070
Original commit by:
2011-06-06 21:48:51 +00:00
Glen Barber 1037a07871 MFC 196727 [1]:
Document MALLOC_PRODUCTION knob.

PR:		136029
Original commit by:	maxim [1]
2011-06-06 21:41:10 +00:00
Glen Barber fb39826271 MFC 199873 [1]:
- correct xref sections

PR:		140940
Original commit by:	danger [1]
2011-06-06 21:24:07 +00:00
Glen Barber 67befa540e MFC 199245 [1]:
Fix the grammar in the isprint(3) description.

PR:		140456
Obtained from:	roam [1]
2011-06-06 20:49:16 +00:00
Glen Barber e686acb5bd MFC 190610 [1]:
Fix punctuation.

PR:		132834
Obtained from:	trhodes [1]
2011-06-06 20:28:19 +00:00
Glen Barber bf6c8b1caa MFC 190610 [1]:
Fix punctuation.

PR:		132834
Obtained from:	trhodes [1]
2011-06-06 20:27:32 +00:00
Glen Barber 7e1cb80255 MFC 218951 [1]:
- Add reference to makefs(8).

PR:		154708
Obtained from:	jh [1]
2011-06-06 16:17:56 +00:00
Benedict Reuschling 382435de66 MFC r222492:
Add a short description about NO_CHECKSUM.

PR:		docs/155980
Submitted by	KOIE Hidetaka (koie at suri co jp)
2011-06-06 07:14:29 +00:00
Xin LI 45c65f11bc MFC r222210, 222211, 222287:
- Diff reduction against NetBSD.  The most notable change is to zdiff(1)
   to handle more file formats including bzip2 and xz.
 - Match symbolic link handling behavior with GNU gzip, bzip2 and xz:
   When we are operating on a symbolic link pointing to an existing
   file, bail out by default, but go ahead if -f is specified.
2011-06-06 05:48:25 +00:00
Benedict Reuschling 3f497bf970 MFC r222447:
Mention that jumbo frame support is disabled on PCIe VT6130/VT6132
controllers because of TX MAC hangs when trying to send a frame
that is larger than 4K (see r200759).

PR:		docs/156742
Submitted by:	Michael Moll (kvedulv at kvedulv dot de)
Reviewed by:	yongari@
2011-06-04 11:30:12 +00:00
Matthew D Fleming b82cf201b4 Partial MFC of r212370. np@ requested this functionality so I kept in
the cxgb change, but otherwise MFC'd only the new function
sbuf_new_for_sysctl(9) and none of the changed code.

MFC r217830:

Document sbuf_new_for_sysctl(9).

Partial MFC of r217916:

Explicitly wire the user buffer rather than doing it implicitly in
sbuf_new_for_sysctl(9).  This allows using an sbuf with a SYSCTL_OUT
drain for extremely large amounts of data where the caller knows that
appropriate references are held, and sleeping is not an issue.
2011-06-01 18:27:13 +00:00
Matthew D Fleming de2646dd9f MFC r212478: (originally by kan@)
Add missing pointer increment to sbuf_cat.
2011-06-01 17:51:27 +00:00
Matthew D Fleming 7efa93f74b MFC r212365, r212367:
r212365: Refactor sbuf code so that most uses of sbuf_extend() are in
a new sbuf_put_byte().  This makes it easier to add drain
functionality when a buffer would overflow as there are fewer code
points.

r212367: Add drain functionality to sbufs.  The drain is a function
that is called when the sbuf internal buffer is filled.  For kernel
sbufs with a drain, the internal buffer will never be expanded.  For
userland sbufs with a drain, the internal buffer may still be expanded
by sbuf_[v]printf(3).

Sbufs now have three basic uses:
1) static string manipulation.  Overflow is marked.
2) dynamic string manipulation.  Overflow triggers string growth.
3) drained string manipulation.  Overflow triggers draining.

In all cases the manipulation is 'safe' in that overflow is detected and
managed.

Note that r212367 had to be minorly re-implemented to dynamically
allocate space for a function pointer, a void * argument, and an int
error, to not break the ABI/KBI.
2011-06-01 17:40:59 +00:00
Matthew D Fleming 87822df246 MFC r212180-r212184:
Use math rather than iteration when the desired sbuf size is larger than
SBUF_MAXEXTENDSIZE.

Fix brain fart when converting an if statement into a KASSERT.

Fix user-space libsbuf build.  Why isn't CTASSERT available to
user-space?

Style(9) fixes and eliminate the use of min().

Use a better #if guard.
2011-06-01 16:34:26 +00:00
Matthew D Fleming d377b1ffcd MFC r181462:
Switch to simplified BSD license (with phk's approval), plus whitespace
and style(9) cleanup.
2011-06-01 16:07:14 +00:00
Matthew D Fleming 76e3c5460e MFC r212364:
Fix small errors in the sbuf(9) man page.
2011-06-01 15:46:26 +00:00
Benedict Reuschling 6b8bcd14c8 MFC r222278:
Add a description to the checksum target about not only
being able to verify, but also having the ability to
fetch distfiles that are missing or failed the checksum
calculation

PR:		docs/138887
Submitted by:	Radim Kolar (hsn at sendmail dot cz)
2011-05-30 08:05:27 +00:00
Benedict Reuschling 157c3a10e8 MFC r218699:
Document TRYBROKEN in ports(7).

PR:		docs/153542
Submitted by:	Eitan Adler <[email protected]>
2011-05-30 08:00:28 +00:00
Doug Barton a497aab82e Upgrade to 9.4-ESV-R4-P1, which addresses the following issues:
1. Very large RRSIG RRsets included in a negative cache can trigger
an assertion failure that will crash named (BIND 9 DNS) due to an
off-by-one error in a buffer size check.

This bug affects all resolving name servers, whether DNSSEC validation
is enabled or not, on all BIND versions prior to today. There is a
possibility of malicious exploitation of this bug by remote users.

2. Named could fail to validate zones listed in a DLV that validated
insecure without using DLV and had DS records in the parent zone.
2011-05-28 00:58:19 +00:00
Pyun YongHyeon 5cd4f80585 MFC r221565-221568,221579:
r221565:
  Reuse the TX descriptor(DPD) if xl_encap() failed instead of just
  picking the next available one. This may explain why xl(4) sees TX
  underrun error with no queued frame. I hope this addresses a long
  standing xl(4) watchdog timeout issue as well.

  Obtained from:        OpenBSD

r221566,221579:
  Rename xl_stats_update() callout handler to xl_tick() and move MII
  tick driving logic to xl_tick(). Now xl_tick() handles MII tick as
  well as periodic updating of statistics.
  This change removes a hack used in interrupt handler where it
  wanted to update statistics without driving MII tick.

r221567:
  Rearm watchdog timer if driver kick controller to recover from TX
  underrun error.
  While here, prepend 0x to status code to show TX status is hex
  number.

r221568:
  XL_DMACTL is 32bit register, use 32bit write macro.
  While I'm here add more bits for the register.
2011-05-27 21:45:21 +00:00
Pyun YongHyeon 0fb2c0d2c3 MFC r221563-221564:
r221563:
  Terminate interrupt handler if driver detect it's not running.
  Also add check for driver running state before trying to send
  frames. While I'm here, use for loop.

r221564:
  Change xl_rxeof() a bit to return the number of processed frames in
  RX descriptor ring. Previously it returned the number of frames
  that were successfully passed to upper stack which in turn means it
  ignored frames that were discarded due to errors. The number of
  processed frames in RX descriptor ring is used to detect whether
  driver is out of sync with controller's current descriptor pointer.
  Returning number of processed frames reduces unnecessary (probably
  wrong) re-synchronization.

  While here, remove unnecessary local variable initialization.
2011-05-27 20:34:23 +00:00
Pyun YongHyeon bce8fb88b1 MFC r221557-221558,221560-221561,221571:
r221557:
  Remove unnecessary htole32/le32toh dance.

r221571:
  Remove unneeded use of variable status.

r221558:
  Set status word once instead of twice. For 3C90xB/3C90xC, frame
  length of status word is ignored. While here move bus_dmamap_sync()
  up where DMA map is loaded.

r221560:
  Call bus_dmamap_sync() only after TX DPD update.

r221561:
  Updating status word should be the last operation of UPD structure
  renewal.  Disable instruction reordering by adding volatile to
  xl_list_onefrag structure.
2011-05-27 20:22:19 +00:00
Pyun YongHyeon 431d7c407c MFC r221555:
Rewrite RX filter logic and provide controller specific filter
  handler for 3C90x and 3C90xB/C respectively.  This simplifies ioctl
  handler as well as enhancing readability.
  While I'm here don't reprogram multicast filter when driver is not
  running.
2011-05-27 19:27:17 +00:00
Pyun YongHyeon 70e980d936 MFC r222107:
Fix typo.

  Submitted by:	brad at OpenBSD
2011-05-27 19:05:01 +00:00
Pyun YongHyeon 796444f77e MFC r222135:
Remove unnecessary controller reinitialization by checking
  IFF_DRV_RUNNING flag.  Previously running dhclient or adding alias
  addresses reinitialized controller and it resulted in unnecessary
  link flips.
2011-05-27 18:59:24 +00:00
Pyun YongHyeon 2cb389979a MFC r221712:
Since r117657, bge(4) does not enable buffer manager for BCM5705 or
  newer controllers.  However, all data sheet I have access has no
  indication that buffer manager should not be touched on these
  controllers.  It seems the buffer manager always runs on BCM5705 or
  newer controllers. Some controller(e.g. BCM5719) needs other buffer
  manager configuration so driver should enable buffer manager for
  all controllers.  Both Linux and OpenBSD/NetBSD use the same
  approach.
  This change polls enable bit of block to know whether specified
  block was really stopped as well as enabling buffer manager for all
  controllers in driver initialization.

  Obtained from:	NetBSD
2011-05-27 18:47:48 +00:00
Pyun YongHyeon 806c1c491b MFC r222142:
Datasheet says vge(4) controllers support DAC but it seems that's
  not true on old PCI based controllers.  DAC configuration is read
  from EEPROM in device reset phase and driver can override DAC
  configuration.  However I guess there is an undocumented reason why
  EEPROM configuration does not enable DAC so do not blindly override
  DAC configuration.  Recent PCIe based controllers are supposed to
  support 64bit DMA so allow 64bit DMA only on PCIe based controllers.

  PR:	kern/157184
2011-05-27 18:40:31 +00:00
Sergey Kandaurov 4c723efe74 MFC r222136: Add missing header file. 2011-05-27 09:56:23 +00:00
Jaakko Heinonen ddb8c7f301 MFC r216461:
- Assert that dm_lock is exclusively held in devfs_rules_apply() and
  in devfs_vmkdir() while adding the entry to de_list of the parent.
- Apply devfs rules to newly created directories and symbolic links.

PR:		kern/125034
2011-05-26 15:38:11 +00:00
Konstantin Belousov 5f60b308ad MFC r222086:
The protection against the race with dev_rel(), introduced in r163328,
should be extended to cover destroy_devl() calls for the children of the
destroyed dev.

Requested and tested by:	Oliver Pinter <oliver.pntr gmail com>
2011-05-26 00:09:56 +00:00
Jilles Tjoelker 1a1ec5278b MFC r222037: mq_setattr(2): Add missing const to man page.
The declaration in the header file is correct.
2011-05-24 21:15:13 +00:00
Matthew D Fleming aeac341689 MFC r221843:
Note that the _SWAP operation is supported for all list/queue types.
Also place STAILQ_REMOVE_HEAD in alphabetical order.  Lastly, document
the _SWAP macros.

PR:		kern/143033
2011-05-24 16:06:26 +00:00
Marius Strobl 5b9fe70160 MFC: r221812
Some PHYs like the Level One LXT970 optionally can default to isolation
after rest, in which case we may need to deisolate them.
Tested by:	nwhitehorn
2011-05-21 16:17:39 +00:00
Jung-uk Kim c2655158b2 MFC: r221188
Define "Hypervisor Present" bit.  This bit is used by several hypervisors to
identify CPUs running under emulation.
2011-05-20 22:24:26 +00:00
Jung-uk Kim 4da6fb9b59 MFC: r221102
Use ACPI-supplied CPU frequencies instead of estimated ones.
2011-05-20 22:20:23 +00:00
Pyun YongHyeon ee789b0dac MFC r221468:
Enable Ethernet@WireSpeed for BCM5718/BCM57765 family. While I'm
  here inverse meaning of PHY flag as Ethernet@WireSpeed is enabled
  for most PHYs.
2011-05-20 20:31:36 +00:00
Pyun YongHyeon 42563388b9 MFC r221445:
Add initial BCM57765 family support. The BCM57765 family seems to
  have similar hardware features of BCM5718 family except the number
  of receive return ring is 4. The BCM57765 family is known to
  support IEEE 802.3az EEE(Energy Efficient Ethernet) but this change
  does not include EEE support code. I hope EEE is implemented in
  near future.
  This change will support BCM57761, BCM57765, BCM57781, BCM57785,
  BCM57791 and BCM57795. All hardware offloading features are
  supported and suspend/resume also should work.
  Many thanks to Broadcom for continuing support of FreeBSD.

  Tested by:	Paul Thornton (prt <> prt dot org)
  HW donated by:	Broadcom
2011-05-20 20:27:25 +00:00
Sergey Kandaurov 8610f888c3 MFC r222013: Add missing section number for .Xr jail. 2011-05-20 12:41:33 +00:00
Andriy Gapon 4ed5eca0a8 fix build breakage by adjusting for API difference in r222092 (MFC of
r221803,221809)

This is a direct commit.

Reported by:	Jeremy Chadwick <[email protected]>, tinderbox
Pointyhat to:	avg
2011-05-20 06:49:43 +00:00
Pyun YongHyeon 91eeae78c1 MFC r221817:
Explicitly clear 1000baseT control register for F1 PHY used in
  AR8132 FastEthernet controller. The PHY has no ability to
  establish a gigabit link. Previously only link parters which
  support down-shifting was able to establish link.
  This change should fix a long standing link establishment issue of
  AR8132.

  PR:	kern/156935
2011-05-19 17:20:13 +00:00
Andriy Gapon 70dfcf93b5 MFC r221803,221809: dsp/pcm: allow to mmap both read and write buffers 2011-05-19 07:09:13 +00:00
Andrey V. Elsukov 386868cba1 MFC r221433:
When checking existence of providers skip those which are orphaned.

  PR:		kern/132273
2011-05-18 16:28:28 +00:00
Andriy Gapon ed0d640a3e MFC r221585: scsi_cd: silence READ_TOC errors in CDIOREADTOCHEADER ioctl 2011-05-17 07:16:35 +00:00
Dimitry Andric f1dcc85d78 MFC r220630:
In r219639, SSSE3 instruction set support was backported to our gcc.

Therefore, we also need to install the new tmmintrin.h header containing
the related intrinsic functions, similar to xmmintrin.h, emmintrin.h,
etc.

Reported by:	George Liaskos <[email protected]>
2011-05-16 07:03:06 +00:00
Andriy Gapon 626a6371f1 MFC r221741: bitcount32: replace lengthy comment with a reference to SWAR 2011-05-15 08:27:32 +00:00
Andriy Gapon 7b869ad319 MFC r221740: dtrace: remove unused code 2011-05-15 08:24:26 +00:00
Doug Barton 383e3c1bee MFC r221475:
1. If PKG_DBDIR cannot be determined from make, set the default
2. Add the -H flag to tar in case /var/db/pkg itself is a symlink
3. Direct stderr to /dev/null to suppress the leading slash warning
2011-05-14 21:44:12 +00:00
Doug Barton fa89bae1fd MFC r221227:
Keep a list of the scripts run before early_late_divider, and use that list
to skip things in the second run.
2011-05-14 21:34:21 +00:00
Marius Strobl 125348bdd3 MFC: r220039, 220147
- A closer inspection of the OpenSolaris code indicates that the DMA
  syncing for Hummingbird and Sabre bridges should be applied with every
  BUS_DMASYNC_POSTREAD instead of in a wrapper around interrupt handlers
  for devices behind PCI-PCI bridges only as suggested by the documentation
  (code for the latter actually exists in OpenSolaris but is disabled by
  default), which also makes more sense.
- Take advantage of the ofw_pci_setup_device method introduced in r220038
  (MFC'ed to stable/7 in r221924) for disabling bus parking for certain
  EBus bridges in order to work around hardware bugs.
- Mark some unused parameters as such.
2011-05-14 21:15:50 +00:00
Marius Strobl b4882068fd MFC: r220038
- Merge the *_SET macros from fire(4) which generally print out the
  register changes when compiled with SCHIZO_DEBUG and take advantage
  of them.
- Add support for the XMITS Fireplane/Safari to PCI-X bridges. I tought
  I'd need this for a Sun Fire 3800, which then turned out to not being
  equipped with such a bridge though. The support for these should be
  complete but given that it hasn't actually been tested probing is
  disabled for now.
  This required a way to alter the XMITS configuration in case a PCI-X
  device is found further down the device tree so the sparc64 specific
  ofw_pci kobj was revived with a ofw_pci_setup_device method, which is
  called by the ofw_pcibus code for every device added.
- A closer inspection of the OpenSolaris code indicates that consistent
  DMA flushing/syncing as well as the block store workaround should be
  applied with every BUS_DMASYNC_POSTREAD instead of in a wrapper around
  interrupt handlers for devices behind PCI-PCI bridges only as suggested
  by the documentation (code for the latter actually exists in OpenSolaris
  but is disabled by default), which also makes more sense.
- Add a workaround for Casinni/Skyhawk combinations. Chances are that
  this solves the crashes seen when using the the on-board Casinni NICs
  of Sun Fire V480 equipped with centerplanes other than 501-6780 or
  501-6790. This also takes advantage of the ofw_pci_setup_device method.
- Mark some unused parameters as such.
2011-05-14 21:12:00 +00:00
Marius Strobl 16fd74e390 MFC: r218930
Resurrect ofw_pci_if.m from r178578.
2011-05-14 21:10:19 +00:00
Marius Strobl 541bfe4b27 MFC: r219785
- Make a panic message better reflect the actual problem.
- A closer inspection of the OpenSolaris code indicates the block store
  workaround is only necessary in case of BUS_DMASYNC_POSTREAD.
- Mark some unused parameters as such.
2011-05-14 21:07:52 +00:00
Marius Strobl 0ef16390bf MFC: r221341, r221713
- Probe the PHY accompanying BCM57765.
- Recognize BCM5719C PHY.
2011-05-14 20:51:19 +00:00
Max Laier 7a2a9d9b33 MFH r221714:
Another long standing vm bug found at Isilon:
  Fix a race between vm_object_collapse and vm_fault.

 Reviewed by:	alc@
2011-05-12 01:38:42 +00:00
Dag-Erling Smørgrav 331e3437ba Beware of blind MFCs...
Noticed by:	pluknet
2011-05-11 11:30:36 +00:00
Dag-Erling Smørgrav d622167334 Partially revert previous commit - WARNS does not default to 6 as in head. 2011-05-11 09:55:29 +00:00
Dag-Erling Smørgrav 33fca4b011 Sync with head: WARNS, static linking. 2011-05-11 09:51:42 +00:00
Dag-Erling Smørgrav 9b8375a262 Sync with head: proxy authentication, SSL hang, cached connection crash. 2011-05-11 09:46:36 +00:00
Andriy Gapon 542d483518 MFC r221593,221601: whitespace nits 2011-05-11 06:03:12 +00:00
Marius Strobl 2948a87335 Supply the correct size of the softc. This is a direct commit to stable/7
as in head the problem is no longer present as of r221407 but that revision
can't be MFC'ed.
2011-05-10 18:44:40 +00:00
Andriy Gapon 64f35ffc02 MFC r221388: SNDCTL_DSP_GETIPTR: set pointer to sndbuf_getfreeptr() 2011-05-07 09:33:37 +00:00
Glen Barber 7af6c4e508 MFC 205076 [1]:
manlint fixes.

Reported by:		manlint
Obtained from:		uqs [1]
2011-05-07 03:58:27 +00:00
Glen Barber 3f6c2df2aa MFC 173192 [1]:
manlint fixes.

Reported by:		manlint
Obtained from:		keramida [1]
2011-05-07 03:49:07 +00:00
Marius Strobl e749cb6de7 MFC: r216962
Inherit the APB and the generic OFW PCI-PCI bridge driver from the generic
PCI-PCI bridge driver in order to safe some code.
2011-05-06 20:04:47 +00:00
Marius Strobl dc20176741 MFC: r221343
Fix an logic bug which caused jumbo buffers to not be synced and unloaded.
Reported and tested by: Michael Moll
2011-05-06 20:02:26 +00:00
Xin LI 1ccd853222 MFC r221401:
Fix prototype for ffsll(3) and fls(3).

PR:		docs/156796
Submitted by:	Jean-Yves Migeon <jeanyves.migeon free.fr>
2011-05-06 18:40:51 +00:00
Fabien Thomas 19889bd0f9 MFC r220198:
Clearing the flag when preempting will let the preempted thread run
too much time. This can finish in a scheduler deadlock with ping-pong
between two threads.

One sample of this is:
- device lapic (to have a preemption point on critical_exit())
- options DEVICE_POLLING with HZ>1499 (to have lapic freq = hardclock freq)
- running a cpu intensive task (that does not enter the kernel)
- only one CPU on SMP or no SMP.

As requested by jhb@ 4BSD have received the same type of fix instead of
propagating the flag to the new thread.
2011-05-06 14:11:20 +00:00
Martin Matuska 669e56b57c MFC r221282:
Add ChangeLog.gcc43 for backported changes from gcc 4.3
2011-05-03 08:40:55 +00:00
Sergey Kandaurov f434c1ba34 MFC r221119:
Fix typo in "continuously" argument used in patrol auto command.

Unlike in head, this version preserves a misspelled argument.
2011-05-03 08:27:16 +00:00
Pyun YongHyeon ed115ac04d MFC r220368:
Add initial jumbo frame support for BCM5714/BCM5715 and BCM5780.
  Unlike other controllers which have more advanced jumbo support,
  these controllers have one send ring, one standard receive producer
  ring and one receive return ring. In order to receive jumbo frames
  on the controllers, driver now will increase Rx buffer size to 9k.
  Two Rx modes are supported on these controllers and I chose
  standard Rx BDs over extended Rx BDs. The extended Rx BD mode
  allows up to 4 segmentations for each Rx BDs such that kernel does
  not have to allocate large buffer of contiguous memory for
  receiving. The extended Rx BD mode is already used on controllers
  that have separate jumbo receive ring. However, using extended Rx
  BDs on BCM5714/BCM5715/BCM5780 reduces the number of Rx BDs to 256
  entries which in turn may reduce the performance.  Also UMA backed
  page allocator for jumbo frame returns contiguous memory so using
  extended Rx BD has no advantage on FreeBSD unless highly customized
  local allocator implemented in driver is used.
  To use jumbo buffers in standard receive ring, Rx buffer allocation
  handler was changed to allocate MJUM9BYTES sized mbuf.

  PR:		kern/155192
  Tested by:	Vijay Singh <vijju.singh <> gmail dot com>
  Submitted by:	mjacob (initial version)
2011-05-02 22:52:22 +00:00
Martin Matuska f06cfbc4e5 Bump __FreeBSD_version for the gcc MFC (r221317) 2011-05-02 08:33:20 +00:00
Martin Matuska 834a03a1c6 MFC 218895, 218896, 219374, 219376, 219639, 219640, 219697, 219711, 220150:
MFC r218895:
Backport svn r124339 from gcc 4.3 and add opteron-sse3, athlon64-sse3
and k8-sse3 cpu-types for -march=/-mtune= gcc options.
These new cpu-types include the SSE3 instruction set that is supported
by all newer AMD Athlon 64 and Opteron processors.
All three cpu-types are supported by clang and all gcc versions
starting with 4.3 SVN rev 124339 (at that time GPLv2 licensed).

Source: gcc-4_3-branch (rev. 124339; GPLv2)

MFC r218896:
Add opteron-sse3, athlon64-sse3 and k8-sse3 cpu types to bsd.cpu.mk.
- add "sse3" to MACHINE_CPU for the new cpu types
- for i386, default to CPUTYPE=prescott for the new cpu types

MFC r219374:
Backport Intel Core 2 and AMD Geode CPU types from gcc-4.3 (GPLv2)
These options are supported in this shape in all newer GCC versions.

Source:	gcc-4_3-branch (rev. 118090, 118973, 120846; GPLv2)

MFC r219376:
Add AMD Geode CPU type to bsd.cpu.mk and examples/etc/make.conf
For CPUTYPE=core2 use -march=core2

MFC r219639:
Backport SSSE3 instruction set support to base gcc.
Enabled by default for -march=core2

Source:	gcc-4_3-branch (rev. 117958, 121687, 121726, 123639; GPLv2)

MFC r219640:
Add ssse3 capability for CPUTYPE=core2 to MACHINE_CPU in bsd.cpu.mk

MFC r219697:
Fix -march/-mtune=native autodetection for Intel Core 2 CPUs

Source:	gcc-4_3-branch (partial rev. 119454; GPLv2)

MFC r219711:
Backport missing tunings for -march=core2:
- enable extra 80387 mathematical constants (ext_80387_constants)
- enable compare and exchange 16 bytes (cmpxchg16b)

Verified against llvm-gcc (and apple gcc)
Source:	gcc-4_3-branch (ref. svn revs. 119260, 121140; GPLv2)

MFC r220150:
Upgrade of base gcc and libstdc++ to the last GPLv2-licensed revision
(rev. 127959 of gcc-4_2-branch).

Resolved GCC bugs:
	c++: 17763, 29365, 30535, 30917, 31337, 31941, 32108, 32112, 32346,
	     32898, 32992
	debug: 32610, 32914
	libstdc++: 33084, 33128
	middle-end: 32563
	rtl-optimization: 33148
	tree-optimization: 25413, 32723
	target: 32218

Source:	gcc-4_2-branch (up to rev. 127959)

Obtained from:	gcc (var. revs of gcc-4_2-branch and gcc-4_3-branch; GPLv2)
PR:		gnu/153298, gnu/153959, gnu/154385, gnu/155308, gnu/154906
2011-05-02 08:31:53 +00:00
Doug Barton 74306c8540 MFC r192246:
do not create and mount new file systems on top of the old ones on every
invocation of this script once we already have one
(in case tmpmfs="YES").

MFC r221007:

Create a function for the code from r192246 so that it can be used both
times mount is called.

Limit the automatic behavior to when AUTO is specified (as it is in
etc/defaults/rc.conf) and for everything else take advantage of all
of the goodness in checkyesno.
2011-04-29 20:55:15 +00:00
Doug Barton 3a4c52e1a7 MFC r216744 for rc.d/devd:
Add pidfile [1]

While I'm here, don't run the sysctl frob unconditionally, and
s/sysctl/$SYSCTL/

MFC r220962:

Introduce to rc.subr get_pidfile_from_conf(). It does just what it sounds
like, determines the path to a pid file as it is specified in a conf file.

Use the new feature for rc.d/named and rc.d/devd, the 2 services in the
base that list their pid files in their conf files.

Remove the now-obsolete named_pidfile, and warn users if they have it set.

MFC r220963:

Improve the error handling for the new get_pidfile_from_conf()
2011-04-29 20:44:39 +00:00
Gavin Atkinson 9f53164a0d Merge r220652 from head:
Remove an incorrect be16toh() that prevented geom_part_apm from working on
  little-endian machines.
2011-04-29 10:33:54 +00:00
Yoshihiro Takahashi ccb12fc41c MFC: revision 218390
Clear the padding when returning context to the usermode, for
  MI ucontext_t and x86 MD parts.
2011-04-29 05:00:48 +00:00
John Baldwin 04073a360c MFC 186520:
Add support for the Oxford OX16PCI958-based card.
2011-04-28 19:08:31 +00:00
John Baldwin 557b82a9fe MFC 191897:
Add ID of one more SII3132 revision found on adaptec aar-1225sa rev a2.
2011-04-28 19:00:48 +00:00
Andrew Gallatin 14d4df9936 MFC r220424:
Fix a bug in mxge's LRO which can cause dup acks to
  get aggregated & hence prevent TCP from entering
  fast retransmit.

  Pointed out by: jeff
  Reviewed by: gnn
2011-04-28 14:55:41 +00:00
Andrew Gallatin 71559cbefa MFC r220385: Implement mxge_init()
This fixes a long standing bug in mxge(4) where "ifconfig mxge0 $IP"
  did not bring the interface into a RUNNING state, like it does on
  most (all?) other FreeBSD NIC drivers.

  Thanks to gnn for mentioning the bug, and yongari for pointing out that
  ether_ioctl() invokes ifp->if_init() in SIOCSIFADDR.
2011-04-28 14:42:55 +00:00
John Baldwin 262296bd18 MFC 210864:
- Retire acpi_pcib_resume().  It is has just been an alias for
  bus_generic_resume() since the pci_link(4) driver was added.
- Change the ACPI PCI-PCI bridge driver to inherit most of its methods
  from the generic PCI-PCI bridge driver.
- This also exposes the generic PCI-PCI bridge driver as pcib_driver so
  other drivers can inherit from it.
2011-04-27 21:13:40 +00:00
Edwin Groothuis 4149375beb MFC of 221092, tzdata2011g
- Egypt has cancelled the move to DST for now.
2011-04-26 22:16:22 +00:00
Glen Barber a14a2458fd MFC 220975:
- Clarification on kld_file_stat.size
- While here, remove a few C comments that don't seem to contribute
  anything additional to the man page.

PR:		146047
2011-04-26 13:09:54 +00:00
Andrey V. Elsukov ef0cf15368 MFC r220767:
Use M_WAITOK flag instead M_WAIT for malloc.

  Suggested by: glebius
2011-04-25 04:33:42 +00:00
Rick Macklem cbe1ff8a50 MFC: r220519
Fix a bug in the userland rpc library, where it would use a
negative return value from write to update its position in
a buffer. The patch, courtesy of Andrey Simonenko, also simplifies
a conditional by removing the "i != cnt" clause, since it is
always true at this point in the code. The bug caused problems
for mountd, when it generated a large reply to an exports RPC
request.
2011-04-24 22:12:00 +00:00
Doug Barton 40c3d4b375 MFC r201038:
Update the comments about files ending in .sh
2011-04-23 02:10:38 +00:00
Doug Barton c91d6ab83a MFC r220760:
The change in r206686 to allow the stop argument to work for a service
that is running even though not _enable'd had an annoying side effect.
If the service was already started at boot time by another means when
the related script came around again in rcorder it would start again,
regardless of _enable, because there was a valid pid. [1]

So, split the test into 2 parts, one for (!rcvar && !stop), and one
for (stop && !valid_pid). This preserves the behavior from r206686
while preventing the undesired side effect.
2011-04-22 23:45:33 +00:00
Jilles Tjoelker d62f5382b1 MFC r220646: getfh(2): Add xrefs for fhopen(2), open(2), stat(2). 2011-04-22 14:42:42 +00:00
Xin LI e566d55e53 MFC r219939:
humanize_number(3) multiply the input number by 100, which could cause an
integer overflow when the input is very large (for example, 100 Pi would
become about 10 Ei which exceeded signed int64_t).

Solve this issue by splitting the division into two parts and avoid the
multiplication.

PR:		bin/146205
Reviewed by:	arundel
2011-04-22 00:32:16 +00:00
Sergey Kandaurov 3392711984 MFC r220621:
Remove stale M_ZOMBIE malloc type.
2011-04-21 09:03:48 +00:00
Colin Percival c0324755de Fix CIDR parsing bug in mountd ACLs.
Approved by:	so (cperciva)
Security:	FreeBSD-SA-11:01.mountd
2011-04-20 21:00:24 +00:00
Sergey Kandaurov 311f1fa5b6 MFC r220594:
Remove the now defunct kern.ipc.nmbufs tunable.

PR:		kern/132497 (part)
2011-04-20 11:17:21 +00:00
Bjoern A. Zeeb 014d2e56e5 MFC r220619:
The mbuf_frag_size always was and is file local and not queried from base
  user space tools via kvm.  Mark it static.
2011-04-19 08:56:09 +00:00
Bjoern A. Zeeb f4d9ec0cad MFC r220463:
Remove a check in udp6_send() that prevented v4-mapped v6 addresses from
 working.  We store v4 and v6 addresses as a union but for v4-mapped
 addresses only store the 32bits w/o the ::ffff: word.  That failed the
 check as for example 127.0.0.1 would be ::7f00:1 rather than ::ffff:7f00:1
 and the IN6_IS_ADDR_V4MAPPED() never worked here.  Given we can hardly get
 here with an unbound local address or invalid inp_vflags remove the check.

 Reported by:	tuexen
 Reviewed by:	tuexen
2011-04-19 08:35:07 +00:00
Bjoern A. Zeeb 91be7a8e22 MFC r220462:
After r219579 and r219779 unbreak v4-mapped v6 sockets for UDP
 some more.  Similar to what we do for TCP check for v4-mapped
 addresses and then handle them or the normal v6 address case.
 For either set inp_vflags before calling into the pcb connect
 function so that we have an unambiguous view in case we need to
 set the local address or port.

 Looked at:	tuexen (as part of more)
2011-04-19 08:17:36 +00:00
Bjoern A. Zeeb 86091d0d6c MFC r219779:
Properly check for an IPv4 socket after r219579.

 In some cases as udp6_connect() without an earlier bind(2) to an
 address, v4-mapped sockets allowed and a non mapped destination
 address, we can end up here with both v4 and v6 indicated:
 	inp_vflag = (INP_IPV4|INP_IPV6|INP_IPV6PROTO)

 In that case however laddrp is NULL as the IPv6 path does not
 pass in a copy currently.

 Reported by:	Pawel Worach (pawel.worach gmail.com)
 Tested by:	Pawel Worach (pawel.worach gmail.com)
2011-04-19 08:00:44 +00:00
Bjoern A. Zeeb 8d3316076a MFC r219579:
Merge the two (logically) identical implementations for local port
 selections from in_pcbbind_setup() and in6_pcbsetport() in a single
 in_pcb_lport().
2011-04-19 07:45:54 +00:00
Bjoern A. Zeeb e4fb669105 MFC r220743:
Fix IPv6 ND.  After r219562 we in nd6_ns_input() were erroneously always
  passing the cached proxydl reference (sockaddr_dl initialized or not) to
  nd6_na_output().  nd6_na_output() will thus assume a proxy NA.  Revert to
  conditionally passing either &proxydl or NULL if no proxy case desired.

  Tested by:	ipv6gw and ref9-i386
  Tested by:	Pete French (petefrench ingresso.co.uk)
  Reported by:	Pete French (petefrench ingresso.co.uk on stable)
  Reported by:	bz, simon on Y! cluster
  Reported by:	kib
PR:		kern/151908
X-Early-MFC:	yes
2011-04-18 12:32:06 +00:00
Sergey Kandaurov da938a6065 MFC r220319:
Do not increment num_args if strsep(3) returned an empty field.
 That fixes devstat_buildmatch(3) crashes with certain strings.

Reported by:	arundel
2011-04-18 08:53:22 +00:00
Jilles Tjoelker 40c8cc00d8 MFC r220376: Allow strerror(0) and strerror_r(0, ...).
Of course, strerror_r() may still fail with ERANGE.

Although the POSIX specification said this could fail with EINVAL and
doing this likely indicates invalid use of errno, most other
implementations permitted it, various POSIX testsuites require it to
work (matching the older sys_errlist array) and apparently some
applications depend on it.

PR:		standards/151316
2011-04-17 22:26:07 +00:00
Edwin Groothuis c58e076985 MFC of r220448
When specifying the -t option (send tag in front of message), this tag
should also be forwarded to the remote logging host, not only when the
logging is done locally.

PR:             bin/154324
Submitted by:   Callum Gibson <[email protected]>
2011-04-17 21:57:08 +00:00
Konstantin Belousov aeb386efdd MFC r218327:
Clear the padding when returning context to the usermode, for
MI ucontext_t and x86 MD parts.

Tested-by: Oliver Pinter <oliver.pntr gmail com>
2011-04-17 11:35:22 +00:00
Rebecca Cran a52fae50af MFC r219522:
Fix warnings and set WARNS to 6.
2011-04-16 11:01:35 +00:00
Rebecca Cran 59b32312db MFC r219511:
Fix warnings and style(9) issues.
Set WARNS to 6.
2011-04-16 10:58:25 +00:00
Rebecca Cran d1fc8661de MFC r219527:
Fix warnings and style(9) issues.
Set WARNS to 6.
2011-04-16 10:22:06 +00:00
Rebecca Cran 3456fb99cc MFC r219613:
Fix typo.
2011-04-16 09:57:17 +00:00
John Baldwin 35041f541e MFC 220156:
Clamp the initial advertised receive window when responding to a SYN/ACK
to the maximum allowed window.  Growing the window too large would cause
an underflow in the calculations in tcp_output() to decide if a window
update should be sent which would prevent the persist timer from being
started if data was pending and the other end of the connection advertised
an initial window size of 0.
2011-04-15 20:42:14 +00:00
John Baldwin c105bc8bbd MFC 219276:
Use ffs() to locate free bits in the inode bitmap rather than a loop with
bit shifts.
2011-04-15 20:26:36 +00:00
John Baldwin 97d0fd4752 MFC 219865:
Add pci_find_cap() as an alias for pci_find_extcap() to ease driver
portability with 9+ where pci_find_extcap() has been renamed to
pci_find_cap().
2011-04-15 20:20:11 +00:00
John Baldwin 428ea8bb32 MFC 219717,220363:
- Add more details to the 'show battery' command including more raw
  capacity values, charge cycle count, temperature, and more detailed
  status.
- Add the ability to manage the state of write caching when the battery
  back-up is missing or dead.  The current state of this field is reported
  in 'mfiutil cache <volume>' and can be adjusted via
  'mfiutil cache <volume> bad-bbu-write-cache <enable|disable>'.  This
  setting should generally be disabled to avoid data loss.
2011-04-15 19:50:38 +00:00
Doug Barton af14c28eae MFC r220512:
Update recommendation for mergemaster. The -a and -i options are exclusive.
2011-04-13 19:55:58 +00:00
Jaakko Heinonen eeef122535 MFC r216391:
Handle the special ruleset 0 in devfs_ruleset_use(). An attempt set the
current ruleset to 0 with command "devfs ruleset 0" triggered a KASSERT
in devfs_ruleset_create().

PR:		kern/125030
2011-04-12 16:52:05 +00:00
Mikolaj Golub 2c3ac68909 MFC r220299:
In g_eli_read_done() and g_eli_write_done(), for a bio with
bio_children > 1, g_destroy_bio() is never called and the bio
leaks. Fix this by calling g_destroy_bio() earlier, before the check.

Submitted by:	Victor Balada Diaz <[email protected]> (initial version)

Tested by:	Oliver Pinter <[email protected]>
Approved by:	kib (co-mentor)
2011-04-12 09:36:38 +00:00
Edwin Groothuis 587ad4aa64 MFC of 220549, tzdata2011f:
- During 2011 the Falkland Islands will remain on Summer time.

Obtained from:  ftp://elsie.nci.nih.gov/pub/
2011-04-11 21:59:59 +00:00
Sergey Kandaurov f8f042171b MFC r220328:
Remove malloc type M_NETADDR unused since splitting into vfs_subr.c
 and vfs_export.c.
2011-04-11 09:28:28 +00:00
Marius Strobl 1000f490ad MFC: r220046, r220106
Wait until the DMA engine is stopped before unmapping buffers and
descriptors, which fixes DMA errors seen on sparc64.
2011-04-10 09:35:44 +00:00
Glen Barber 1a5b85d509 MFC 220382:
Correct 'list scan' description in the examples.  The previous description
was incorrect - 'list scan' does not actually do a scan, but instead lists
the results of the background 'scan' cache.
2011-04-09 19:07:44 +00:00
Bjoern A. Zeeb fd3c185903 MFC r219570:
Push a possible "unbind" in some situation from in6_pcbsetport() to
  callers.  This also fixes a problem when the prison call could set
  the inp->in6p_laddr (laddr) and a following priv_check_cred() call
  would return an error and will allow us to merge the IPv4 and IPv6
  implementation.
2011-04-09 12:38:09 +00:00
Bjoern A. Zeeb 45823e485f MFC r219562:
Make sure the locally cached value of rt->rt_gateway stays stable,
  even after dropping the reference and unlocking. Previously we
  have dereferenced a NULL pointer (after r121765).
  Simply unlocking after the block does not work either because of
  lock ordering (see r121765) and in addition we would still hold
  a pointer to something that might be gone by the time we access it.
  Thus take a copy of the value rather than just caching the pointer.

  Submitted by:	chenyl (netstar2008 126.com) (initial version)
PR:		kern/151908
2011-04-09 12:15:40 +00:00
Bjoern A. Zeeb b9ec6c7ed7 MFC r220247:
Do not allow directly recursive RFC3173 IPComp payload.

Security:	CVE-2011-1547
2011-04-09 10:58:38 +00:00
Bjoern A. Zeeb 65d5419deb MFC r219597:
Cross-reference ip(4) rather than sysctl(8) for the global, shared MIB
  values to control the various port ranges. ip(4) describes these in detail.
2011-04-09 10:44:53 +00:00
Bjoern A. Zeeb 97f9385afc MFC r219580:
INET6 for some time needed in_pcb.c so make sure we compile it in case of
  no inet.
2011-04-09 10:40:17 +00:00
Bjoern A. Zeeb 2d350f8ac7 MFC r219206:
Hide the outer IP addresses of a tunnel interfaces (gif(4), gre(4))
  from processes inside jails if the addresses do not belong to the jail.

  Originally reported by: Pieter de Boer via remko
  Tested by:	Piotr KUCHARSKI (nospam 42.pl) [gif]
PR:		kern/151119
2011-04-09 10:22:18 +00:00
Bjoern A. Zeeb 097419e267 MFC r219184:
Prevent crashes from a race when (cloned) interfaces go away.

PR:		bin/152143
  Submitted by:	Przemyslaw Frasunek (przemyslaw frasunek.com)
  Tested by:	Przemyslaw Frasunek (przemyslaw frasunek.com)
2011-04-09 10:18:46 +00:00
Andriy Gapon 75e4d27851 MFC r220031: linux compat: improve and fix sendmsg/recvmsg compatibility
PR:		kern/149168
2011-04-09 09:33:36 +00:00
Andriy Gapon 5d1fa5296f MFC r220030: drop dummy definitions
PR:		kern/149168
2011-04-09 09:27:11 +00:00
Andriy Gapon aa7975afce Regen after r220471
PR:		kern/149168
2011-04-09 09:20:11 +00:00
Andriy Gapon 7d1bb5bef3 MFC r220028: linux compat: add non-dummy capget and capset system calls
PR:		kern/149168
2011-04-09 09:12:44 +00:00
Pyun YongHyeon abf1ad1b7c MFC r220249,220252:
r220249:
  64bit DMA caused data corruption. Unfortunately there is no known
  workaround to use 64bit DMA.
  Disable 64bit DMA on Attansic L1 controller.

  Tested by:	Yamagi Burmeister (lists <> yamagi dot org)

r220252:
  Partially revert r184106. RX buffer ring also needs bus_dmamap_sync().

  Tested by:	Yamagi Burmeister (lists <> yamagi dot org)
2011-04-08 19:08:48 +00:00
Andriy Gapon 7a672b57b2 MFC r220004: rtld: eliminate double call to close(2) that may occur in load_object 2011-04-08 06:55:25 +00:00
Jaakko Heinonen 6181f17929 MFC r216224:
Don't write the terminating NUL past end of buffer.

PR:		bin/152345
2011-04-07 16:06:39 +00:00
Glen Barber 5006699767 MFC 219850:
s/buffer/buf as is used in the code.
2011-04-06 11:14:42 +00:00
Pyun YongHyeon f42e39675a MFC r219938:
Remove unused DMA map/tag in softc.
2011-04-04 20:45:39 +00:00
Pyun YongHyeon d2892646b3 MFC r220103:
Normally fxp(4) does not receive bad frames but promiscuous mode
  makes controller to receive bad frames and i82557 will also receive
  bad frames since fxp(4) have to receive VLAN oversized frames. If
  fxp(4) encounter DMA overrun error, the received frame size would
  be 0 so the actual frame size after checksum field extraction the
  length would be negative(-2). Due to signed/unsigned comparison
  used in driver, frame length check did not work for DMA overrun
  frames. Correct this by casting it to int.
  While I'm here explicitly check DMA overrun error and discard the
  frame regardless of result of received frame length check.

  Reported by:	n_hibma
  Tested by:	n_hibma
2011-04-04 20:41:35 +00:00
Navdeep Parhar a36105237f MFC r219945, r219946, r220009
r219945:
T3C initialization should setup the parity fence too.

r219946:
t3_free_sge_resources should be given the number of qsets it needs to free.

r220009:
Update T3 firmware to 7.11.0
2011-04-04 20:02:29 +00:00
Hajimu UMEMOTO 806fb0dc18 MFC r220055: getlogin() may return NULL. 2011-04-04 14:57:28 +00:00
Sergey Kandaurov b63324d057 MFC r220157:
Use FD_CLOEXEC explicitly.
2011-04-04 09:38:05 +00:00
Edwin Groothuis effdb879d2 MFC of 220286, tzdata2011e:
Change for Africa/Casablanca:
- The 3rd april 2011 at 00:00:00, [it] will be 3rd april 1:00:00
- The 31th july 2011 at 00:59:59,  [it] will be 31th July 00:00:00

Update for SouthAmerica/Chili:
- Chile's clocks will go back an hour this year on the 7th of May instead
  of this Saturday. They will go forward again the 3rd Saturday in
  August, not in October as they have since 1968. This is a pilot plan
  which will be reevaluated in 2012.
2011-04-03 03:44:48 +00:00
Dmitry Chagin cd6baa28e7 Revert r220263, SV_ABI patches was never merged to 7. 2011-04-02 10:31:41 +00:00
Dmitry Chagin 57f67552ea Revert r220268, SV_ABI patches was never merged to 7. 2011-04-02 10:28:08 +00:00
Dmitry Chagin 85d64e10a9 MFC r219043:
Teach kdump to understand sv_flags records in the trace files.

MFC r219044:

Update manual page to reflect latest changes of ABI description support.

MFC r219138:

Teach kdump to understand linux syscalls names too.

Fix bug introduced in r219043: the kernel always dump native
signal numbers, so no need to check the ABI in ktrpsig().
2011-04-02 08:34:24 +00:00
Dmitry Chagin 29ac7632d1 MFC r219041:
ktrace_resize_pool() locking slightly reworked:
1) do not take a lock around the single atomic operation.
2) do not lose the invariant of lock by dropping/acquiring
   ktrace_mtx around free() or malloc().

MFC r219042:

Introduce preliminary support of the show description of the ABI of
traced process by adding two new events which records value of process
sv_flags to the trace file at process creation/execing/exiting time.

MFC r219311:

Partially rework r219042.
The reason for this is a bug at ktrops() where process dereferenced
without having a lock. This might cause a panic if ktrace was runned
with -p flag and the specified process exited between the dropping
a lock and writing sv_flags.

Since it is impossible to acquire sx lock while holding mtx switch
to use asynchronous enqueuerequest() instead of writerequest().

Rename ktr_getrequest_ne() to more understandable name.

MFC r219312:

Fix indentation in comment, double ';' in variable declaration.

PR:		ports/155083
2011-04-02 06:25:13 +00:00
Doug Barton f8578f83e1 MFC r220020:
Add a daily period script to back up /var/db/pkg

MFC r220049:

Hook the 220.backup-pkgdb script I added to the build unconditionally
Hook up 610.ipf6denied based on MK_IPFILTER as 510.ipfdenied is now
2011-03-28 19:42:21 +00:00
Doug Barton b9a6814bc2 Direct commit to update svn:executable property on remaining scripts 2011-03-28 19:29:30 +00:00
Doug Barton a1cd42ffdf MFC r219587, r220017, r220048
Adjust svn:executable properties
2011-03-28 19:27:46 +00:00
Pyun YongHyeon b572ed4ce5 MFC r201449:
Fix CardBus spelling.
2011-03-28 00:19:01 +00:00
Pyun YongHyeon 6aa3b3c9ee MFC r219701:
Remove too expensive bus_dmamap_sync(9) call in dc_rx_resync().
  With this change, driver may not notice updated descriptor status
  change when bounce buffers are active. However, rxeof() in next run
  will handle the synchronization.

  Change dc_rxeof() a bit to return the number of processed frames in
  RX descriptor ring. Previously it returned the number of frames
  that were successfully passed to upper stack which in turn means it
  ignored frames that were discarded due to errors. The number of
  processed frames in RX descriptor ring is used to detect whether
  driver is out of sync with controller's current descriptor pointer.
  Returning number of processed frames reduces unnecessary (probably
  wrong) re-synchronization.

  Reviewed by:	marius
2011-03-28 00:14:56 +00:00
Pyun YongHyeon ec156ea67a MFC r219407:
Rearrange dc_tx_underrun() a bit to correctly set TX FIFO threshold
  value. Controllers that always require "store and forward" mode(
  Davicom and PNIC 82C168) have no way to recover from TX underrun
  except completely reinitializing hardware. Previously only Davicom
  was reinitialized and the TX FIFO threshold was changed not to use
  "store and forward" mode after reinitialization since the default
  FIFO threshold value was 0. This effectively disabled Davicom
  controller's "store and forward" mode once it encountered TX
  underruns. In theory, this can cause watchodg timeouts.

  Intel 21143 controller requires TX MAC should be idle before
  changing TX FIFO threshold. So driver tried to disable TX MAC and
  checked whether it saw the idle state of TX MAC. Driver should
  perform full hardware reinitialization on failing to enter to idle
  state and it should not touch TX MAC again once it performed full
  reinitialization.

  While I'm here remove resetting TX FIFO threshold to 0 when
  interface is put into down state. If driver ever encountered TX
  underrun, it's likely to trigger TX underrun again whenever
  interface is brought to up again. Keeping old/learned TX FIFO
  threshold value shall reduce the chance of seeing TX underrns in
  next run.
2011-03-27 23:14:02 +00:00
Pyun YongHyeon 9eb84f30de MFC r218834-218835:
r218834:
  Consistently use a tab character instead of space after #define.
  No functional changes.

r218835:
  s/u_intXX_t/uintXX_t/g
2011-03-27 23:09:09 +00:00
Pyun YongHyeon 119a488288 MFC r218833,218964:
r218833:
  Count how many frames driver lost in interrupt handler. This
  register is cleared on read so make sure to clear it in driver
  initialization phase.

r218964:
  Remove unnecessary controller reinitialization which resulted in
  link flips during alias address insertion or dhclient operation.
  While I'm here remove dc_reset() in DC_ISR_BUS_ERR case. Device is
  fully reinitialized again in dc_init_locked().
2011-03-27 23:03:15 +00:00
Pyun YongHyeon b32da909c4 MFC r218832:
Split common TX/RX descriptor DMA tag to TX and RX DMA tags
  respectively and fix all bus_dma(9) issues seen when bounce buffers
  are used.
   o Setup frame handling had no bus_dmamap_sync(9) which prevented
     driver from configuring RX filter. Add missing bus_dmamap_sync(9)
     in both dc_setfilt_21143()/dc_setfilt_xircom() and dc_txeof().
   o Use bus_addr_t for DMA segment instead of using u_int32_t.
   o Introduce dc_dma_alloc()/dc_dma_free() functions to allocate/free
     DMA'able memory.
   o Create two DMA descriptor list for each TX/RX lists. This change
     will minimize the size of bounce buffers that would be used in
     each TX/RX path.  Previously driver had to copy both TX/RX lists
     when bounce buffer is active.
   o 21143 data sheet says descriptor list requires 4 bytes alignment.
     Remove PAGE_SIZE alignment restriction and use
     sizeof(struct dc_dec).
   o Setup frame requires 4 bytes alignment.  Remove PAGE_SIZE
     alignment restriction and use sizeof(struct dc_dec).
   o Add missing DMA map unload for both setup frame and TX/RX
     descriptor list.
   o Overhaul RX handling logic such that make driver always allocate
     new RX buffer with dc_newbuf(). Previously driver allowed to
     copy received frame with m_devget(9) after passing the
     descriptor ownership to controller. This can lead to passing
     wrong frame to upper stack.
   o Introduce dc_discard_rxbuf() which will discard received frame
     and reuse loaded DMA map and RX mbuf.
   o Correct several wrong bus_dmamap_sync(9) usage in dc_rxeof and
     dc_txeof. The TX/RX descriptor lists are updated by both driver
     and HW so READ/WRITE semantics should be used.
   o If driver failed to allocate new RX buffer, update if_iqdrops
     counter instead of if_ierrors since driver received the frame
     without errors.
   o Make sure to unload loaded setup frame DMA map in dc_txeof and
     clear the mark of setup frame of the TX descriptor in dc_txeof().
   o Add check for possible TX descriptor overruns in dc_encap() and
     move check for free buffer to caller, dc_start_locked().
   o Swap the loaded DMA map and the last DMA map for multi-segmented
     frames. Since dc_txeof() assumes the last descriptor of the
     frame has the DMA map, driver should swap the first and the last
     DMA map in dc_encap(). Previously driver tried to unload
     not-yet-loaded DMA map such that the loaded DMA map was not
     unloaded at all for multi-segmented frames.
   o Rewrite DC_RXDESC/DC_TXDESC macro to simpler one.
   o Remove definition of ETHER_ALIGN, it's already defined in
     ethernet.h.
  With this changes, dc(4) works with bounce buffers and it shall
  also fix issues which might have shown in PAE environments.

  Tested by:	marius
2011-03-27 22:50:09 +00:00
Pyun YongHyeon 3bbd013c1e MFC r218830-218831:
r218830:
  Send frames only when there is a valid link and driver is running
  as well as controller has enough free TX descriptors.
  Remove check for number of queued frames before attempting to
  transmit. I guess it was added to allow draining queued frames
  even if there is no link. I'm under the impression this type of
  check should be done in upper layer. No other drivers in tree do
  that.

r218831:
  Rearrange interrupt handler a bit and remove forever loop.
  Previously dc(4) always checked whether there is pending interrupts
  and this consumed a lot of CPU cycles in interrupt handler. Limit
  the number of processing for TX/RX frames to 16. Also allow sending
  frames in the loop not to starve TX under high RX load.
  Reading DC_ISR register should be protected with driver lock,
  otherwise interrupt handler could be run(e.g. link state change)
  before the completion of dc_init_locked().

  While I'm here remove unneeded code.
2011-03-27 22:37:28 +00:00
Pyun YongHyeon b7e885665b MFC r218789,218820,218826-218828:
r218789:
  Remove use case of DC_TX_ONE. It was used to limit queue just 1 TX
  frame in DM910x controllers. In r67595(more than 10 years ago) it
  was replaced to use "Store and Forward" mode and made controller
  generate TX completion interrupt for every frame.

r218820:
  For controllers that have TX interrupt moderation capability,
  request TX completion interrupt for every 8-th frames. Previously
  dc(4) requested TX completion interrupt if number of queued TX
  descriptors is greater than 64. This caused a lot of TX completion
  interrupt under high TX load once driver queued more than 64 TX
  descriptors. It's quite normal to see more than 64 queued TX
  descriptors under high TX load.
  This change reduces the number of TX completion interrupts to be
  less than 17k under high TX load. Because this change does not
  generate TX completion interrupt for each frame, add reclaiming
  transmitted buffers in dc_tick not to generate false watchdog
  timeouts.
  While I'm here add check for queued descriptors in dc_txeof() since
  there is no more work to do when there is no pending descriptors.

r218826:
  Make sure to clear status word of TX descriptor in dc_list_tx_init().
  Do not update if_opackets if the transmission had failed.

r218827:
  There is no need to execute filter configuration when driver is not
  running. Remove wrong driver state change in dc_setfilt_xircom().
  While I'm here nuke unnecessary assignments.

r218828:
  Fix a long standing bug where driver handed over RX descriptor
  ownership to controller before completion of access to the
  descriptor. Driver is faking up status word so it should not give
  ownership to controller until it completes RX processing.
2011-03-27 22:32:14 +00:00
Pyun YongHyeon c28c32465e MFC r213841,218787-218788:
r213841:
  It seems some multi-port dc(4) controllers shares SROM of the first
  port such that reading station address from second port always
  returned 0xFF:0xFF:0xFF:0xFF:0xFF:0xFF Unfortunately it seems there
  is no easy way to know whether SROM is shared or not. Workaround
  the issue by traversing dc(4) device list and see whether we're
  using second port and use station address of controller 0 as base
  station address of second port.

  PR:		kern/79262

r218787:
  When driver have to use base softc due to lack of SROM on second
  port, copy SROM information from base softc as well and run SROM
  parser again.  This change is necessary for some dual port
  controllers to make dc(4) correctly detect PHY media based on first
  port configuration table.
  While I'm here add a check for validity of the base softc before
  duplicating SROM contents from base softc. If driver failed to
  attach to the first port it can access invalid area.

  PR:		kern/79262
  Reviewed by:	marius

r218788:
  Apply special PHY initialization code for 21143 controllers before
  any other media configuration. Otherwise some 21143 controller
  cannot establish a link. While I'm here remove the PHY
  initialization code in dc_setcfg(). Since dc_setcfg() is called
  whenever link state is changed, having the PHY initialization code
  in dc_setcfg() resulted in continuous link flips.
  After driver resets SIA, use default SIA transmit/receive
  configuration instead of disabling autosense/autonegotiation.
  Otherwise, controller fails to establish a link as well as losing
  auto-negotiation capability. For manual media configuration, always
  configure 21143 controller with specified media to ensure media
  change. This change makes ANA-6922 establish link with/without
  auto-negotiation.

  While I'm here be more strict on link UP/DOWN detection logic.

  Many thanks to marius who fixed several bugs in initial patch and
  even tested the patch on a couple of dc(4) controllers.

  PR:		kern/79262
  Reviewed by:	marius
  Tested by:	marius
2011-03-27 22:21:52 +00:00
Pyun YongHyeon c98c6cfb54 MFC r218786:
Always check memory allocation failure. If driver encounter memory
  allocation error, do not attach driver.

  Reviewed by:	marius
2011-03-27 22:14:14 +00:00
Pyun YongHyeon e174d2d871 MFC r219787:
Correct broadcast frame handling. Setting bit6 of MCR0 register
  enables broadcast filtering. Make sure to clear the bit to receive
  broadcast frames. While I'm here rename the bit definition to
  reflect reality.

  Reported by:  brad@OpenBSD
2011-03-26 21:32:10 +00:00
Matthew D Fleming 35e2fb61e6 Fix r220012 (MFC of r216060); the KBI of sysctl_oid was *supposed* to be
preserved, but I was hasty.
2011-03-25 22:17:24 +00:00
Matthew D Fleming 76842914af MFC r216060. This differs from the original commit in that it
preserves the KBI size of struct sysctl_oid.  Also, on stable/8 the
compiler thinks that 'len' in sysctl_sysctl_name2oid() is used
uninitialized.

Do not hold the sysctl lock across a call to the handler.  This fixes a
general LOR issue where the sysctl lock had no good place in the
hierarchy.  One specific instance is #284 on
http://sources.zabbadoz.net/freebsd/lor.html .
2011-03-25 22:11:54 +00:00
Matthew D Fleming e147e98731 MFC r216058 and r216059:
r216058:

Use the SYSCTL_CHILDREN macro in kern_sysctl.c to help de-obfuscate the
code.

r216059:

Slightly modify the logic in sysctl_find_oid to reduce the indentation.
There should be no functional change.
2011-03-25 22:00:43 +00:00
Matthew D Fleming 4f5b5d46e8 MFC r192908 (introduced before the stable/8 split from CURRENT):
fail(9) support:

Add support for kernel fault injection using KFAIL_POINT_* macros and
fail_point_* infrastructure. Add example fail point in vfs_bio.c to
simulate VM buf pressure.

MFC r192978:

Fix style/grammar issues in fail(9) man page.

MFC r216616:

Move the fail_point_entry definition from fail.h to kern_fail.c, which
allows putting the enumeration constants of fail point types with the
text string that matches them.

MFC r216620:

Initialize fp_location for explicitly managed fail points, and push
the parentheses around the location for simple fail points into the
location string.  This makes the print on fail point set more
consistent between the two versions.

Also fix up fail.h a little for style(9): only use one of sys/param.h
and sys/types.h, and use the existing __XSTRING() macro instead of
rolling our own.  Also fix up a few tabs on changed and nearby lines.

Lastly, since KFAIL_POINT_{BEGIN,END} are not meant for use outside
this file, just eliminate the macros entirely.
2011-03-25 20:51:20 +00:00
Matthew D Fleming c6b1cb8289 MFC r218825. [The implementation change to kdb_sysctl_available()
cannot be MFC'd as it requires a non-MFCable change (adding drains to
sbuf)].

Modify kdb_trap() so that it re-calls the dbbe_trap function as long as
the debugger back-end has changed.  This means that switching from ddb
to gdb no longer requires a "step" which can be dangerous on an
already-crashed kernel.

Also add a capability to get from the gdb back-end back to ddb, by
typing ^C in the console window.

While here, simplify kdb_sysctl_available() by using
sbuf_new_for_sysctl(), and use strlcpy() instead of strncpy() since the
strlcpy semantic is desired.
2011-03-25 18:16:49 +00:00
Ulrich Spörlein 863af340a9 MFH r219209: Unbreak .Aq for non-ASCII output like -Tps or -Tutf8.
PR:             gnu/154822
Submitted by:   Dominic Fandrey <[email protected]>
2011-03-24 17:09:37 +00:00
Glen Barber 1b1e7643d2 MFC 219834:
Bump date from previous commit.
2011-03-21 15:23:10 +00:00
Glen Barber bb94058dba MFC 219805:
- Use 'list scan' in favor of 'scan', as 'scan' has a different purpose.
2011-03-21 13:28:38 +00:00
Xin LI b3fc0d6f7d MFC r218816:
Add a helper script that detects which partition we are on and update the
other.

Obtained from:	FreeNAS
Sponsored by:	iXsystems, Inc.
2011-03-21 06:18:26 +00:00
Andriy Gapon 37793a427d MFC r219525: amd64/NOTES: use a greater number in KSTACK_PAGES example 2011-03-20 12:05:57 +00:00
Glen Barber 8f52c62ffc MFC 219723:
- Formatting fix.
2011-03-19 01:41:58 +00:00
Glen Barber e6e41aab35 MFC 219574:
- Add example of using 'scan' for wireless networks, similarly to
  OpenBSD's ifconfig(8).
- wlan0 isn't available on 7.x, so substitute ath0 for wlan0 in the
  example.

PR:		151952
2011-03-19 00:35:11 +00:00
John Baldwin 9d076ef3a5 MFC 219460: Remove now-obsolete comment. 2011-03-18 17:20:45 +00:00
John Baldwin 960ae6d612 MFC 219399:
When constructing a new cpuset, apply the parent cpuset's mask to the new
set's mask rather than the root mask.  This was causing the root mask to
be modified incorrectly.
2011-03-18 17:18:24 +00:00
John Baldwin 1135b14b60 MFC 219384:
The UFS dirhash code was attempting to update shared state in the dirhash
from multiple threads while holding a shared lock during a lookup operation.
This could result in incorrect ENOENT failures which could then be
permanently stored in the name cache.

Specifically, the dirhash code optimizes the case that a single thread is
walking a directory sequentially opening (or stat'ing) each file.  It uses
state in the dirhash structure to determine if a given lookup is using the
optimization.  If the optimization fails, it disables it and restarts the
lookup.  The problem arises when two threads both attempt the optimization
and fail.  The first thread will restart the loop, but the second thread
will incorrectly think that it did not try the optimization and will only
examine a subset of the directory entires in its hash chain.  As a result,
it may fail to find its directory entry and incorrectly fail with ENOENT.

To make this safe for use with shared locks, simplify the state stored in
the dirhash and move some of the state (the part that determines if the
current thread is trying the optimization) into a local variable.  One
result is that we will now try the optimization more often.  We still
update the value under the shared lock, but it is a single atomic store
similar to i_diroff that is stored in UFS directory i-nodes for the
non-dirhash lookup.
2011-03-18 17:15:46 +00:00
Glen Barber 9eff16f592 MFC 219455:
- Move the explanation of using arguments for the PRIMARIES above
  the list of PRIMARIES.

PR:		151812
2011-03-17 22:36:21 +00:00
Edwin Groothuis 8de67f4d3a MFC of 219687, tzdata2011d:
- Pacific/Apia will have DST on 2 April instead of 3 April in 2011.
- Turkye will go to DST on 28 April instead of 27 April in 2011.
- Cuba will go to DST on 20 April in 2011.

Obtained from:  ftp://elsie.nci.nih.gov/pub/
2011-03-16 03:34:41 +00:00
Andrey V. Elsukov a58fb7fd7b MFC r219127:
Add XMIT_FAILOVER transmit algorithm to ng_one2many node. Packets are
  delivered out the first active "many" hook.

  PR:           kern/137775
  Submitted by: Maxim Ignatenko
2011-03-15 07:15:46 +00:00
Konstantin Belousov b735d6e4f0 Fix mismerge.
Pointy hat to:	kib
2011-03-13 13:37:23 +00:00
Konstantin Belousov 04747e2ec5 MFC r219352:
The execution of the shebang script requires putting interpreter path,
possible option and script path in the place of argv[0] supplied to
execve(2).  It is possible and valid for the substitution to be shorter
then the argv[0].

Avoid signed underflow in this case.

PR:     kern/155321
2011-03-13 10:08:02 +00:00
Doug Barton b8fbfe335a MFC r219353:
mbone is no longer a physical category

Submitted by:	pav
2011-03-11 23:16:04 +00:00
Ulrich Spörlein 9d78f1e9d4 MFH r206622,210933,219210: Typo fixes, prologue ordering. 2011-03-11 22:09:13 +00:00
Andriy Gapon aed130a425 MFC r216505: cyclic xcall: use smp_no_rendevous_barrier as setup
function parameter
2011-03-11 18:42:17 +00:00
Andriy Gapon d3d32c4e2c MFC r216374: fix atomic_set_xxx misuse in drm 2011-03-11 18:21:16 +00:00
Andriy Gapon 0a5427cdbf MFC r216376: acpi_fujitsu: update for P8010
PR:		kern/121102
2011-03-11 18:10:37 +00:00
Andriy Gapon 16decc2383 MFC r216503: small cleanup of acpi battery status setting and checking
PR:		kern/124744
2011-03-11 17:12:39 +00:00
Andriy Gapon 4698d594ce MFC r216254: opensolaris cyclic: fix deadlock and make a little bit
closer to upstream
2011-03-11 16:13:26 +00:00
Andriy Gapon 14a5e6518e MFC r216252: opensolaris cyclic xcall: no need for special handling of curcpu 2011-03-11 16:07:20 +00:00
Andriy Gapon 1f98d3fe6d MFC r216251: dtrace_xcall: no need for special handling of curcpu 2011-03-11 16:02:38 +00:00
Andriy Gapon 71c0e158eb MFC r216373: fix incorrect use of atomic_set_xxx in cxgb 2011-03-11 15:53:11 +00:00
Andriy Gapon 34c98bcd91 MFC r215748: specialreg.h: add definitions for some useful bits found in
CPUID.6 EAX and ECX
2011-03-11 15:06:56 +00:00
Andriy Gapon 56434b075d MFC r215524: specialreg.h: add definitions for MPERF/APERF pair of MSRs 2011-03-11 15:01:54 +00:00
Andriy Gapon 576e8d569f MFC r215523: specialreg.h: add AMD-specific "Hardware Configuration
Register" MSR
2011-03-11 14:55:23 +00:00
Andriy Gapon a1b14400fc MFC r215522: specialreg.h: add definition for AMD Core Performance Boost bit 2011-03-11 14:46:27 +00:00
Jaakko Heinonen 48ec5f43e2 MFC r179926 by gonzo:
Get pointer to devfs_ruleset struct after garbage collection has been
performed. Otherwise if ruleset is used by given mountpoint and is empty
it's freed by devfs_ruleset_reap and pointer becomes bogus.

PR:		kern/124853
2011-03-10 16:51:28 +00:00
Xin LI 9a03170cba MFC r218432:
Don't consider ioctl returning error as a fatal error and move on to next
disk.  When multiple devices are specified, a non-supporting ioctl will
cause diskinfo(8) to stop at the point which does not seem to be necessary.
2011-03-10 01:02:53 +00:00
Edwin Groothuis f03e429fdb MFC of tzdata2011c, r219411
- No leapsecond in June 2011
- Add and update timezones for America/Juneau, America/Sitka,
  America/Metlakatla
- Change of Summer time to Winter time in Chili happens in April
  2011, not in March 2011.
2011-03-08 21:14:14 +00:00
Jaakko Heinonen d6d3f09801 MFC r196526 by delphij:
Add a missing .El.
2011-03-08 17:43:35 +00:00
Jilles Tjoelker d5e6e15732 MFC r198216 by ed: Fix quoting in a comment,
to make it look more consistent.
2011-03-07 22:50:27 +00:00
Jung-uk Kim 7e50f5099e MFC: r218293
Do not let pw.conf(5) or -M option affect creation of basehome, e.g., /home.
When the basehome does not exist, it creates all intermediate directories as
required, which is logically equivalent to mkdir(1) with -m and -p options.
However, it modifies all intermediate directories, not just the final home
directory unlike mkdir.  This problem was introduced in two revisions, i.e.,
r1.59 (SVN r167919) and r1.60 (SVN r168044).
2011-03-07 18:01:58 +00:00
John Baldwin b7a822b95b MFC 218970,219240:
Use umtx_key objects to uniquely identify futexes.  Private futexes in
different processes that happen to use the same user address in the
separate processes will now be treated as distinct futexes rather than the
same futex.  We can now honor shared futexes properly by mapping them to a
AUTO_SHARED umtx_key.  Private futexes use THREAD_SHARED umtx_key objects.
2011-03-07 17:14:18 +00:00
Xin LI b968aad7ab MFC r219158:
Correct a typo.

PR:		bin/155175
Submitted by:	Peter J. Philipp <pjp centroid.eu>
2011-03-07 09:04:06 +00:00
Pyun YongHyeon 3d3a13f25b MFC r219102:
Make sure changing ownership of RX descriptor to be done as last
  operation.  Previously ownership was transferred to hardware before
  setting address of new RX buffer such that it was possible for
  hardware to use wrong RX buffer address.
  While here keep compiler from re-ordering instructions by declaring
  descriptor members volatile. Memory barriers would do the same job
  but volatile is supposed to be cheaper than using memory barriers,
  especially on MP systems.

  Submitted by:	marius
2011-03-07 00:44:00 +00:00
Rebecca Cran e26231102a MFC r218965, r219055:
Fix typos - remove duplicate "is".

PR:           docs/154934
Submitted by: Eitan Adler <lists at eitanadler.com>
2011-03-05 04:33:42 +00:00
Rebecca Cran fd0fcd40aa MFC r219081:
Merge fix from r1.108 of NetBSD's usr.bin/ftp/main.c:

Only attempt to el_parse() a command unknown by the default parser
if editing is enabled.

PR:           bin/100089
2011-03-05 04:18:29 +00:00
Rebecca Cran 6ae715bdcd MFC r177626, r219096, r219126:
Fix some "in in" typos in comments.

PR:		121490
Submitted by:	Anatoly Borodin <anatoly.borodin at gmail.com>
2011-03-05 04:11:06 +00:00
Doug Barton 6b0db5d054 MFC r218535:
Synthesize the change from NetBSD's 1.33:

"Do not crash if a date cannot be represented (localtime returning
NULL), use the Epoch value instead."

Obtained from:  [email protected]
2011-03-05 04:08:07 +00:00
Doug Barton db46d76ca4 MFC r218961:
Update how accounting log files are rotated, clean up the rc.d script
a bit.

MFC r218986:

The new accounting file needs to be 644 so that unprivileged users
can use lastcomm(1)
2011-03-05 02:12:36 +00:00
Jung-uk Kim dc302c8dea MFC: r219046
Set C1 "I/O then Halt" capability bit for Intel EIST.  Some broken BIOSes
refuse to load external SSDTs if this bit is unset for _PDC.
2011-03-04 23:43:10 +00:00
Jung-uk Kim 4fe56f275f MFC: r218685, r218687
Copy just enough data for the resource type.
2011-03-04 23:12:14 +00:00
Rebecca Cran dde4add9cf MFC r218966, r219124:
Change the return type of vmspace_swap_count to a long to match the other
vmspace_*_count functions.

While here, clean up some style(9) issues.

PR:   kern/152200
2011-03-04 20:30:18 +00:00
Sergey Kandaurov 41ab8af109 MFC r219031:
Fix division by zero, causing floating point exception in a drive progress
 command.

Approved by:	avg (mentor), kib (mentor)
2011-03-04 12:20:14 +00:00
John Baldwin 27931c4b05 MFC 218969:
Expose the umtx_key structure and API to the rest of the kernel.
2011-03-03 22:09:10 +00:00
John Baldwin 258da4bb98 MFC 218968:
Properly handle BARs bigger than 4G.  The '1' was treated as an int
causing the size calculation to be truncated to the size of an int
(32-bits on all current architectures).
2011-03-03 20:14:00 +00:00
John Baldwin fe8fc10934 MFC 218777:
Save a copy of errno before invoking syslog() if accept() or select() fail.
syslog() can trash the errno value causing nfsd to exit for non-fatal
errors like ECONNABORTED from accept().
2011-03-03 19:57:49 +00:00
John Baldwin f892a24a95 MFC 218707: Properly check for errors from waitpid(). 2011-03-03 19:55:22 +00:00
John Baldwin c05afb7b92 MFC 218290: Correct include path. 2011-03-03 17:11:11 +00:00
John Baldwin 2bac0820ab MFC 200761,218272:
Always assert that the turnstile chain lock is held in turnstile_wait()
and remove a duplicate hash lookup.
2011-03-03 17:04:45 +00:00
John Baldwin b976d50e2e MFC 218270:
Use M_WAITOK rather than M_NOWAIT when creating taskqueues via the
TASKQUEUE_DEFINE macros.  All the places that use these macros to create
taskqueues assume that the operation succeeds.
2011-03-03 16:59:20 +00:00
John Baldwin fcae1141d8 MFC 217239:
Add a nested include of <sys/linker_set.h> to make the sysctl(9) manpage
accurate.  <sys/linker_set.h> is one of the very few headers similar to
<sys/queue.h> for which nested includes is allowed.
2011-03-02 21:51:22 +00:00
John Baldwin b7f0e024c2 MFC 217858: Remove dead code. 2011-03-02 19:29:35 +00:00
Edwin Groothuis 7c4a1dcb48 MFC of 219149, tzdata2011b:
USA/Mercer County, North Dakota - Moved from Mountain time to Central time.
2011-03-01 21:29:08 +00:00
Jaakko Heinonen 449533031b MFC r187105 by obrien:
Fix issue where ata_atapicmd() can never really return EBUSY which is
expected in acd_fixate().

This should fix various problems folks are having with 'burncd' reporting
"burncd: ioctl(CDRIOCFIXATE): Input/output error" during the fixate phase
when "fixate" is issued together with the "data" command.

PR:		95979
2011-03-01 18:05:57 +00:00
Pyun YongHyeon f51405ff64 MFC r217914:
Document newly added tunables.
   hw.re.intr_filter
   hw.re.msix_disable
   dev.re.%d.int_rx_mod
2011-03-01 00:13:50 +00:00
Pyun YongHyeon 7a1595aab0 MFC r218760:
Add initial support for RTL8401E PCIe Fast Ethernet.

  PR:	154789
2011-03-01 00:08:49 +00:00
Pyun YongHyeon 9959eb94a1 MFC r218289:
Disable TX IP checksum offloading for RTL8168C controllers.  The
  controller in question generates frames with bad IP checksum value
  if packets contain IP options.  For instance, packets generated by
  ping(8) with record route option have wrong IP checksum value. The
  controller correctly computes checksum for normal TCP/UDP packets
  though.
  There are two known RTL8168/8111C variants in market and the issue
  I observed happened on RL_HWREV_8168C_SPIN2. I'm not sure
  RL_HWREV_8168C also has the same issue but it would be better to
  assume it has the same issue since they shall share same core.
  RTL8102E which is supposed to be released at the time of
  RTL8168/8111C announcement does not have the issue.

  Tested by:	Konstantin V. Krotov ( kkv <> insysnet dot ru )
2011-03-01 00:05:46 +00:00
Pyun YongHyeon e24f8565ff MFC r217911:
Add support for RTL8105E PCIe Fast Ethernet controller. It seems
  the controller has a kind of embedded controller/memory and vendor
  applies a large set of magic code via undocumented PHY registers in
  device initialization stage. I guess it's a firmware image for the
  embedded controller in RTL8105E since the code is too big compared
  to other DSP fixups. However I have no idea what that magic code
  does and what's purpose of the embedded controller. Fortunately
  driver seems to still work without loading the firmware.

  While I'm here change device description of RTL810xE controller.

  H/W donated by:	Realtek Semiconductor Corp.
2011-03-01 00:02:46 +00:00
Pyun YongHyeon 931f26de41 MFC r217902:
Do not use interrupt taskqueue on controllers with MSI/MSI-X
  capability. One of reason using interrupt taskqueue in re(4) was
  to reduce number of TX/RX interrupts under load because re(4)
  controllers have no good TX/RX interrupt moderation mechanism.
  Basic TX interrupt moderation is done by hardware for most
  controllers but RX interrupt moderation through undocumented
  register showed poor RX performance so it was disabled in r215025.
  Using taskqueue to handle RX interrupt greatly reduced number of
  interrupts but re(4) consumed all available CPU cycles to run the
  taskqueue under high TX/RX network load.  This can happen even with
  RTL810x fast ethernet controller and I believe this is not
  acceptable for most systems.

  To mitigate the issue, use one-shot timer register to moderate RX
  interrupts. The timer register provides programmable one-shot timer
  and can be used to suppress interrupt generation. The timer runs at
  125MHZ on PCIe controllers so the minimum time allowed for the
  timer is 8ns. Data sheet says the register is 32 bits but
  experimentation shows only lower 13 bits are valid so maximum time
  that can be programmed is 65.528us. This yields theoretical maximum
  number of RX interrupts that could be generated per second is about
  15260. Combined with TX completion interrupts re(4) shall generate
  less than 20k interrupts. This number is still slightly high
  compared to other intelligent ethernet controllers but system is
  very responsive even under high network load.

  Introduce sysctl variable dev.re.%d.int_rx_mod that controls amount
  of time to delay RX interrupt processing in units of us. Value 0
  completely disables RX interrupt moderation. To provide old
  behavior for controllers that have MSI/MSI-X capability, introduce
  a new tunable hw.re.intr_filter. If the tunable is set to non-zero
  value, driver will use interrupt taskqueue. The default value of
  the tunable is 0. This tunable has no effect on controllers that
  has no MSI/MSI-X capability or if MSI/MSI-X is explicitly disabled
  by administrator.

  While I'm here cleanup interrupt setup/teardown since re(4) uses
  single MSI/MSI-X message at this moment.
2011-02-28 23:46:59 +00:00
Pyun YongHyeon 8dd85936fe MFC r217868:
Remove TX taskqueue and directly invoke re_start in interrupt task.
2011-02-28 23:37:38 +00:00
Pyun YongHyeon 0a9bb34bd9 MFC r217857:
Prefer MSI-X to MSI on controllers that support MSI-X. All
  recent PCIe controllers(RTL8102E or later and RTL8168/8111C or
  later) supports either 2 or 4 MSI-X messages. Unfortunately vendor
  did not publicly release RSS related information yet. However
  switching to MSI-X is one-step forward to support RSS.
2011-02-28 21:25:35 +00:00
Rebecca Cran ba69ec6760 MFC r218974:
Handle memory allocation failures in include().

PR:           i386/85652
Submitted by: Ben Thomas <bthomas at virtualiron.com>
2011-02-26 12:07:16 +00:00
Rebecca Cran 66f0d191ac MFC r218985:
Use the cprd_mem field when setting the start and length for a memory
resource - the layout of cprd_port is identical but using cprd_mem
makes the code easier to understand.

PR:           kern/118493
Submitted by: Weongyo Jeong <weongyo.jeong at gmail.com>
2011-02-26 11:52:34 +00:00
Alexander Leidinger 3922632bfd MFC r216591:
Suggest to run the delete-old target after the second mergemaster. If you run
  it before, your rc scripts may still reference old files/directories and
  if you are in the unlucky situation to have triggered a reboot (intentionally
  or not) between the delete-old run and the mergemaster, your system may not
  start anymore.

  While I'm here, give a hint about delete-old-libs.

  Noticed by:        bcr (luckily in a discussion and not by getting hit by
                          this)
2011-02-25 16:08:31 +00:00
Jilles Tjoelker a7c862c647 MFC r218724: test: Note that this is used both as a normal program and
a shell builtin.
2011-02-25 14:56:06 +00:00
Doug Barton ca1af199ee MFC r218753:
Remove in-addr.arpa from the list of zones it is possible to slave locally

MFC r218865:

Add a note about AXFR of important zones being available from ICANN
2011-02-24 23:45:13 +00:00
Ken Smith 438a7ba368 7.4-RELEASE has been announced, shift to -STABLE. 2011-02-24 21:19:30 +00:00
Hiroki Sato e7133e20ac Fix a typo. 2011-02-24 19:22:59 +00:00
Hiroki Sato 5827b22dd5 Add relnotes items for 7.4R. 2011-02-24 19:22:04 +00:00
Rebecca Cran 5ceeec32d6 MFC r218918:
Make private functions static.

PR:           kern/43611
Submitted by: Matt Emmerton <matt at gsicomp.on.ca>
2011-02-24 11:09:41 +00:00
Rebecca Cran 563f52a058 MFC r218910:
The FD_FORM ioctl used to ignore errors from the floppy controller; now when
it encounters an error it returns an error from the ioctl.
Ignore any errors when using the FD_FORM ioctl.

PR:   kern/103862
2011-02-24 11:04:47 +00:00
Rebecca Cran 5d332418b0 MFC r218909:
Fix typos - remove duplicate "the".

PR:		bin/154928
Submitted by:	Eitan Adler <lists at eitanadler.com>
2011-02-24 10:45:41 +00:00
Hiroki Sato a2496c19f5 Update release documents for 7.4R. Document OpenSSL vuln was fixed and
shlib version was decreased in Errata.
2011-02-23 20:50:42 +00:00
Ulrich Spörlein d68ed7345a MFH r218477: Fix termcap entry typo. 2011-02-23 20:24:20 +00:00
Pyun YongHyeon f6ae224355 MFC r218710:
Fix a regression introduced in r215906. The change made in r215906
  caused link re-negotiation whenever application joins or leaves a
  multicast group.  If driver is running, it would have established a
  link so there is no need to start re-negotiation. The re-negotiation
  broke established link which in turn stopped multicast application
  working while re-negotiation is in progress.

  PR:	kern/154667
2011-02-22 21:27:46 +00:00
Rebecca Cran 0a087f2a0d MFC r218854:
Update the icmp example to show allowing only the safe types.

Suggested by: Tom Judge <tom at tomjudge.com>
2011-02-22 17:51:45 +00:00
Rebecca Cran 2e3e0bf959 MFC r218839, r218840, r218841:
In the distribution list, 'A' is listed as the key to press to select both
'All' and 'Minimal'. Update the keys for Minimal and Custom to avoid the
conflict.

Remove the quotas option from the Startup Services menu.
GENERIC has no support for quotas so this option has no effect.

Allow users to create ufs1 filesystems via the noninteractive install.cfg
system.

PR:   bin/153809
PR:   bin/123237
PR:   bin/113979
2011-02-22 17:50:33 +00:00
Jaakko Heinonen da1cfb3ed4 MFC r216098:
- Report an error when a label with invalid name is attempted to be
  created with glabel(8).
- Fix a typo in an error message.
- Fix comment typos.
2011-02-21 16:33:01 +00:00
Pyun YongHyeon 69f953b2d0 MFC r217524,217766:
r217524:
  Change model names of controller RTL_HWREV_8168_SPIN[123] to real ones.
  s/RL_HWREV_8168_SPIN1/RL_HWREV_8168B_SPIN1/g
  s/RL_HWREV_8168_SPIN2/RL_HWREV_8168B_SPIN2/g
  s/RL_HWREV_8168_SPIN3/RL_HWREV_8168B_SPIN3/g
  No functional changes.

r217766:
  Apply TX interrupt moderation to all RTL810xE PCIe Fast Ethernet
  controllers. Experimentation with RTL8102E, RTL8103E and RTL8105E
  showed dramatic decrement of TX completion interrupts under high TX
  load(e.g.  from 147k interrupts/second to 10k interrupts/second)
  With this change, TX interrupt moderation is applied to all
  controllers except RTL8139C+.
2011-02-21 01:20:56 +00:00
Pyun YongHyeon 72309eb0f6 MFC r217499:
Implement initial jumbo frame support for RTL8168/8111 C/D/E PCIe
  GbE controllers. It seems these controllers no longer support
  multi-fragmented RX buffers such that driver have to allocate
  physically contiguous buffers.

   o Retire RL_FLAG_NOJUMBO flag and introduce RL_FLAG_JUMBOV2 to
     mark controllers that use new jumbo frame scheme.
   o Configure PCIe max read request size to 4096 for standard frames
     and reduce it to 512 for jumbo frames.
   o TSO/checksum offloading is not supported for jumbo frames on
     these controllers. Reflect it to ioctl handler and driver
     initialization.
   o Remove unused rl_stats_no_timeout in softc.
   o Embed a pointer to structure rl_hwrev into softc to keep track
     of controller MTU limitation and remove rl_hwrev in softc since
     that information is available through a pointer to structure
     rl_hwrev.

  Special thanks to Realtek for donating sample hardwares which made
  this possible.

  H/W donated by:	Realtek Semiconductor Corp.
2011-02-21 01:15:11 +00:00
Pyun YongHyeon 0bbdf15349 MFC r217498:
Add initial support for RTL8168E/8111E-VL PCIe GbE.
2011-02-21 01:05:23 +00:00
Pyun YongHyeon d5970684fe MFC r217247,217381-217382,217384-217385:
r217247:
  When driver is not running, do not send DUMP command to controller
  and just show old (cached) values. Controller will not respond to
  the command unless MAC is enabled so DUMP request for down
  interface caused request timeout.

r217381:
  Allow TX/RX checksum offloading to be configured independently.

r217382:
  re_reset() should be called only after setting device specific
  features.

r217384:
  Make sure to check validity of dma maps before destroying.

r217385:
  If driver is not able to allocate RX buffer, do not start driver.
  While I'm here move RX buffer allocation and descriptor
  initialization up to not touch hardware registers in case of RX
  buffer allocation failure.
2011-02-21 01:01:26 +00:00
Pyun YongHyeon 3bdb348260 MFC r217246,217832:
r217246:
  Implement TSO on RealTek RTL8168/8111 C or later controllers.
  RealTek changed TX descriptor format for later controllers so these
  controllers require MSS configuration in different location of TX
  descriptor. TSO is enabled by default for controllers that use new
  descriptor format.
  For old controllers, TSO is still disabled by default due to broken
  frames under certain conditions but users can enable it.
  Special thanks to Hayes Wang at RealTek.

r217832:
  Disable TSO for all Realtek controllers. Experimentation showed
  RTL8111C generated corrupted frames where TCP option header was
  broken. All other sample controllers I have did not show such
  problem so it could be RTL8111C specific issue. Because there are
  too many variants it's hard to tell how many controllers have such
  issue. Just disable TSO by default but have user override it.
2011-02-21 00:50:48 +00:00
Ulrich Spörlein 18accee950 MFH r218089:
syscons: install all available kbdmaps

us.dvorakl.kbd, and us.dvorakr.kbd were not installed.

Found by:     Neil Short <[email protected]>
2011-02-20 11:30:12 +00:00
Pyun YongHyeon d8769196e2 MFC r215432:
MCP55 is the only NVIDIA controller that supports VLAN tag
  insertion/stripping and it also supports TSO over VLAN. Implement
  TSO over VLAN support for MCP55 controller.

  While I'm here clean up SIOCSIFCAP ioctl handler. Since nfe(4)
  sets ifp capabilities based on various hardware flags in device
  attach, there is no need to check hardware flags again in
  SIOCSIFCAP ioctl handler. Also fix a bug which toggled both TX and
  RX checksum offloading even if user requested either TX or RX
  checksum configuration change.

  Tested by:	Rob Farmer ( rfarmer <> predatorlabs dot net )
2011-02-20 01:26:29 +00:00
Pyun YongHyeon bc7d04b566 MFC r217794:
Reinitialize driver when MTU is changed and driver is running.

  Reported by:	Huang, Yusheng ( yusheng.huang <> bluecoat com )
2011-02-20 01:22:48 +00:00
Pyun YongHyeon 45776486fc MFC r218141:
alc_rev was used without initialization such that it failed to
  apply AR8152 v1.0 specific initialization code. Fix this bug by
  explicitly reading PCI device revision id via PCI accessor.

  Reported by:	Gabriel Linder ( linder.gabriel <> gmail dot com )
2011-02-20 01:16:59 +00:00
Pyun YongHyeon 9c99b3bba5 MFC r217379:
- Move ether_ifdetach() earlier and remove now-unneeded IN_DETACH flag.
  - Expand locking in interrupt handler.
2011-02-20 01:10:14 +00:00
Pyun YongHyeon 3147cbfc4f MFC r217353:
- Add a locked variant of jme_start() and invoke it directly while holding
    the lock instead of queueing it to a task.
  - Do not invoke jme_rxintr() to reclaim any unprocessed but received
    packets when shutting down the interface.  Instead, just drop these
    packets to match the behavior of other drivers.
  - Hold the driver lock in the interrupt handler to avoid races with
    ioctl requests to down the interface.
2011-02-20 01:05:35 +00:00
Glen Barber adbeb29340 MFC 212492:
Bump date in cpuset_getaffinity(2).  Note, the original commit
also affects dbopen(3), however that change is not needed here.
2011-02-18 17:42:29 +00:00
Rebecca Cran 1bbb6266f6 MFC r218620:
If the pf.conf(5) example file is copied when setting up a firewall it's
easy to forget about icmp. Update the file to show allowing icmp through
the firewall.

PR:	docs/144986
2011-02-16 21:46:03 +00:00
Rebecca Cran ba388a1aa8 MFC r218619:
Fix typos.

PR:	docs/131625
Submitted by:	Andrew Wright <andrew at qemg.org>
2011-02-16 21:29:05 +00:00
Rebecca Cran e95637b031 MFC r218652, r218677:
Only print the unit number when invoked with the -n flag.

PR:	bin/144300
Submitted by:	arundel
2011-02-16 21:24:09 +00:00
Rebecca Cran 79d8a5f57a MFC r218650:
Move potentially offensive fortune to fortunes-o.

PR:	bin/137702
2011-02-16 21:13:02 +00:00
Ken Smith abc1590546 Guess when all the bits will be in place for announcing 7.4-RELEASE. 2011-02-16 15:18:28 +00:00
Bjoern A. Zeeb 4318543f7e MFC r218114:
Update interface stats counters to match the current format in linux and
  try to export as much information as we can match.

  Requested on: Debian GNU/kFreeBSD list (debian-bsd lists.debian.org) 2010-12
  Tested by:    Mats Erik Andersson (mats.andersson gisladisker.se)
2011-02-15 09:30:31 +00:00
Bjoern A. Zeeb 0ba33b7aca MFC r218078:
Remove duplicate printing of TF_NOPUSH in db_print_tflags().
2011-02-15 09:28:07 +00:00
Giorgos Keramidas a89d7a0fac MFC 216698 by maxim from /head
Fix -u flag description: it takes a username as an argument.

PR:             docs/153416
Submitted by:   Eitan Adler
2011-02-15 07:12:16 +00:00
Giorgos Keramidas f1179245b9 MFC 217746 from /head/usr.bin/top
Touch up the sample memory usage numbers a bit, to avoid wrapping
on terminal boundary.  While here add definition for ’G’ and fix
the indentation of ’K’ units.

Submitted by:   plunket
PR:             docs/153614
2011-02-15 06:34:30 +00:00
Glen Barber f56390439b MFC 212438:
Add EINVAL to list of possible return values for cpuset_getaffinity(2).

PR:		149978
Approved by:	keramida (mentor)
2011-02-15 01:34:46 +00:00
Ulrich Spörlein 937af6459a Add back soon-to-be-release FreeBSD 7.4 which got clobbered in the previous
merges.
2011-02-13 22:17:49 +00:00
Ulrich Spörlein b6f30a7001 MFH r202358,217595:
Pull up vendor changes.  The following local changes made obsolete:

- Addition of several FreeBSD versions.
- r192561 that attempted to fix UTF-8 issues.

Update groff manpage and symbols with what has been submitted upstream.
Also remove local overrides that are now in the contrib tree.
2011-02-13 22:09:33 +00:00
Ulrich Spörlein 5fb8a12850 MFH r209772,217890
Fix an error in the EXAMPLES section of getopt(1), which is based on
the same fix present in NetBSD.

Fix typo in example getopt(1) script: $i vs $1 [1]
While here apply style hammer.

PR:		docs/133118, docs/154289 [1]
Submitted by:	Oleg A. Mamontov, Jamie Landeg Jones
2011-02-13 19:07:17 +00:00
Rebecca Cran ff289d0a49 MFC r216156:
Document the fact that passing in a count of zero to the bus_space functions
will result in undefined behaviour.
Taken from NetBSD's bus_space(9).

PR:	kern/80980
2011-02-13 18:00:05 +00:00
Josh Paetzel a36566340d MFC 218523:
Netgear renamed the WG311 to the WG311v1 after they released a second
version of it.  There is also a WG311v3 which uses a chipset covered by
malo(4). Along the way add the WG311T to the list which is also an
atheros chipset.

Approved by:	kib (mentor)
2011-02-13 16:18:22 +00:00
Simon L. B. Nielsen 70d4990d67 MFC 218625:
Fix Incorrectly formatted ClientHello SSL/TLS handshake messages could
 cause OpenSSL to parse past the end of the message.

 Note: Applications are only affected if they act as a server and call
 SSL_CTX_set_tlsext_status_cb on the server's SSL_CTX. This includes
 Apache httpd >= 2.3.3, if configured with "SSLUseStapling On".

The very quick MFC is done to get this fix into 7.4 / 8.2.

Discussed with:	re
Approved by:	so (simon, for "instant" MFC)
Obtained from:	OpenSSL CVS
Security:	http://www.openssl.org/news/secadv_20110208.txt
Security:	CVE-2011-0014
2011-02-13 10:24:36 +00:00
Glen Barber 7228b164ac MFC 212827, 217717:
Note that devfs(5) and fdescfs(5) both create /dev/fd file descriptors.

PR:		144534
Approved by:	keramida (mentor)
2011-02-12 17:58:36 +00:00
Marius Strobl ae99feab4c MFC: r218478
Correct signedness and off-by-one issues in parameters used for DMA tag
creation.

PR:		154259
Submitted by:	Vladislav Movchan (partially)
2011-02-12 13:41:02 +00:00
John Baldwin 449f364b5c MFC 218271:
When turning off TCP_NOPUSH, only call tcp_output() to immediately flush
any pending data if the connection is established.
2011-02-11 15:13:03 +00:00
Glen Barber d2755d7826 MFC 212440,212493,212500:
Add RETURN VALUES section to devclass_get_maxunit(9).

PR:		149979
Approved by:	keramida (mentor)
2011-02-11 13:59:56 +00:00
Glen Barber 9d7c5319fe MFC 218398:
Fix typo in amdtemp(4).

Approved by:	keramida (mentor)
2011-02-11 13:56:06 +00:00
Glen Barber 2cfe7ffd16 MFC 218421:
Remove CRT reference from zmore(1).

PR:		154441
Approved by:	keramida (mentor)
2011-02-11 13:53:39 +00:00
Jaakko Heinonen 9053e754e7 MFC r217090:
Warn if rules could not be read from a ruleset file. Now at least
something gets logged if the file has syntax errors.

PR:		conf/91342
2011-02-11 10:06:49 +00:00
Doug Barton a1463e1cd1 MFC 218350:
Catch up with reality and references from the latest RFCs
(especially 5735) for our default empty zones.
2011-02-11 05:57:33 +00:00
Doug Barton fa78a2b30a MFC 218142:
Let rpcbind clean up after itself
2011-02-11 05:54:46 +00:00
Max Laier 65b46d724e MFH: r180238
Use bcopy instead of strlcpy in uipc_bind and unp_connect, since
  soun->sun_path isn't a null-terminated string.  As UNIX(4) states, "the
  terminating NUL is not part of the address." Since strlcpy has to return
  "the total length of the string [it] tried to create," it walks off the
  end of soun->sun_path looking for a \0.

  This reverts r105332.
2011-02-10 00:20:56 +00:00
Sergey Kandaurov cb922b29e8 MFC r218189:
Remove OpenSolaris include path referring to a non-existing directory.

Reported by:	arundel on freebsd-hackers@ via clang
Approved by:	kib (mentor)
2011-02-09 15:40:48 +00:00
Marius Strobl 893566a5de MFC: r216961
Reserve INTR_MD[1-4] similarly to what BUS_DMA_BUS[1-4] are intended for
and switch sparc64 to use the first one for bus error filter handlers of
bridge drivers instead of (ab)using INTR_FAST for that so we eventually
can get rid of the latter.

Reviewed by:	jhb
2011-02-08 22:14:19 +00:00
John Baldwin 9a4b32b19d Properly close a socket for a TCP NFS client if the NFS server notices that
the client has disconnected while attempting to fetch a request.  This
accidentally works most of the time because the socket upcall is invoked
twice for some reason causing two nfsd threads to be assigned to the
same connection.  The first thread notices the disconnect when soreceive()
fails, and the second thread will then cleanup the connection.  Occasionally
the second thread will grab the NFSD lock before the first thread has
returned from soreceive() to mark the connection as disconnected.  When that
happens, the socket is never cleaned up and is leaked.

Fix this by checking for the disconnect flag if there is an error pulling a
request from the connection and closing the socket if it nfsrv_rcv() marked
the connection as disconnected.  Now the first thread will close the socket
in most cases and the socket is never leaked.

This is a direct commit to 7 as it is specific to the pre-krpc code used
in 7.
2011-02-08 21:05:07 +00:00
Xin LI b88b263ed8 MFC r216675:
Allow overriding pidfile and dumpfile.

PR:		bin/153362
Submitted by:	Joe Holden <joe rewt org uk>
2011-02-08 11:48:47 +00:00
Glen Barber f7e416598b MFC 212610:
Synchronize newfs(8) manual with code.

PR:		61716
Approved by:	keramida (mentor)
2011-02-07 19:13:20 +00:00
Glen Barber bfc5dc38ad MFC 214374:
Minor grammar fixes.

Approved by:	keramida (mentor)
2011-02-07 11:13:28 +00:00
Ed Maste 08f7aa9d14 MFC r218207:
Revert part of r173264.  Both aac_ioctl_sendfib and aac_ioctl_send_raw_srb
  make use of the aac_ioctl_event callback, if acc_alloc_command fails.
  This can end up in an infinite loop in the while loop in
  aac_release_command.
2011-02-06 01:00:40 +00:00
Jilles Tjoelker 868ecc2864 MFC r217847: sh: Clean up some old comments:
* There is no plan for an alternative to the command "set".
* Attempting to unset a readonly variable has not raised an error for quite
  a while, so the order of unsetting a variable and a function with the same
  name does not matter.
2011-02-05 15:13:18 +00:00
Gordon Tetlow e622ae8bb5 MFC r217767:
Honor $PAGER instead of always calling more.

Approved by:	colin@
2011-02-05 06:26:16 +00:00
Pyun YongHyeon 148876b293 MFC r216831,216858:
r216831:
  Add vte(4) man page and hook up vte(4) to the build.
  Also add Xr to appropriate man pages.

r216858:
  Remove duplicated "perfect"
2011-02-04 20:59:45 +00:00
Pyun YongHyeon 2717aa09c9 MFC r216830:
Add vte(4) to the list of supported network interface.
2011-02-04 20:52:13 +00:00
Pyun YongHyeon b6732bb501 Make vte(4) work on stable/7. This is direct commit to stable/7
since if_maddr_rlock/if_maddr_runlock is not available in stable/7.
2011-02-04 20:48:53 +00:00
Pyun YongHyeon 32ae60bcdb MFC r216829,216833:
rr216829:
  Add driver for DM&P Vortex86 RDC R6040 Fast Ethernet.
  The controller is commonly found on DM&P Vortex86 x86 SoC.  The
  driver supports all hardware features except flow control.  The
  flow control was intentionally disabled due to silicon bug.

  DM&P Electronics, Inc. provided all necessary information including
  sample board to write driver and answered many questions I had.
  Many thanks for their support of FreeBSD.

  H/W donated by:	DM&P Electronics, Inc.

r216833:
  Remove debugging leftovers.
2011-02-04 20:47:46 +00:00
Pyun YongHyeon 525e466a34 MFC r216828:
Add RDC Semiconductor R6040 10/100 PHY driver.
2011-02-04 20:27:50 +00:00
Ed Schouten 96473996d7 MFC r217207:
Add missing __dead2 to __assert().

  __assert() is called when an assertion fails. After printing an error
  message, it will call abort(). abort() never returns, hence it has the
  __dead2 attribute. Also add this attribute to __assert().
2011-02-04 19:27:59 +00:00
John Baldwin ac6d344959 MFC 217351:
Introduce two new helper macros to define the priority ranges used for
interactive timeshare threads (PRI_*_INTERACTIVE) and non-interactive
timeshare threads (PRI_*_BATCH) and use these instead of PRI_*_REALTIME
and PRI_*_TIMESHARE.  No functional change.
2011-02-04 17:11:53 +00:00
John Baldwin 2d807df808 MFC 217292:
- Retire some unused ithread priorities: PI_TTYHIGH, PI_TAPE, and
  PI_DISKLOW.  While here, rename PI_TTYLOW to PI_TTY.
- Add a macro PI_SWI() that takes a SWI_* constant as an argument and
  returns the suitable thread priority.

To preserve the KBI, I did not renumber priorities but simply removed
unused ones.
2011-02-04 16:32:34 +00:00
John Baldwin ec31d6f609 MFC 217075:
Retire PCONFIG and leave the priority of thread0 alone when waiting for
interrupt config hooks to execute.

To preserve the KBI, I did not renumber priorities but simply removed
PCONFIG.
2011-02-04 14:44:59 +00:00
John Baldwin f1e38f821f MFC 218171:
Output an appropriate amount of padding to line up per-CPU state columns
rather than using a terminal sequence to move the cursor when drawing the
initial screen.
2011-02-04 14:25:39 +00:00
John Baldwin 1ddd7bc7aa MFC 200605:
Add entries to NOTES for the modular phy support so that these options are
documented.
2011-02-04 13:40:02 +00:00
Rebecca Cran 979b87c5a5 MFC r216873:
There can be more than 0x20000000 swap meta blocks allocated if a swap-backed
md(4) device is used. Don't panic when deallocating such a device is swap
has been used.

PR:	kern/133170
2011-02-04 10:22:19 +00:00
Pyun YongHyeon 8f1d29fecd MFC r216925,217331,217349,217542:
r216925:
  Add a 'locked' variant of the foo_start() routine and call it directly
  from interrupt handlers and watchdog routines instead of queueing a task
  to call foo_start().

r217331:
  Make sure to invoke unlocked foo_start since the taskqueue does not
  hold a driver lock. This should fix a regression introduced in
  r216925.

r217349:
  Forgot to remove unlock of the driver lock from age_start_locked() when
  converting it to a locked variant.

r217542:
  Fix some bugs in my last set of changes to ale(4):
  - Remove extra unlock from end of ale_start_locked().
  - Expand scope of locking in interrupt handler.
  - Move ether_ifdetach() earlier and retire now-unneeded DETACH flag.

  Tested by:	Aryeh Friedman
2011-02-02 18:44:02 +00:00
Ken Smith 5bf5880363 Update to reflect the package layout for 7.4-RELEASE. 2011-01-31 16:58:33 +00:00
Andrey V. Elsukov 9d23110dd1 MFC r188728 by pjd:
Document kern.geom.journal.* sysctls.

  PR:		docs/130548
  Submitted by:	Hywel Mallett <[email protected]>

MFC r188729 by pjd:
  Correct the year.

  Reported by:	Florian Smeets <[email protected]>
2011-01-31 16:20:28 +00:00
Edwin Groothuis 228c4953c1 MFC of 218122, tzdata2011a:
- Cleanup rules for Australia/South_Australia (nothing changed)
- Add historical information for Honolulu.
2011-01-31 09:30:25 +00:00
Pyun YongHyeon 91990e5a1b MFC r218038:
Fix logic error. Due to the bug, it incorrectly checked TXQ status
  which in turn can leave TXQ active.

  Submitted by:	Brad ( brad <> comstyle dot com )
2011-01-31 00:29:11 +00:00
Pyun YongHyeon 9e10df3712 MFC r216766:
Add device id for RDC M3010 which is found on Vortex86 SoC.

  Reviewed by:	mav
2011-01-30 23:29:45 +00:00
Pyun YongHyeon 6391d1cacd MFC r216596:
Document limitation of station address reprogramming.
2011-01-30 23:18:55 +00:00
Pyun YongHyeon 298692dbf8 MFC r216576,216578-216581,217974:
r216576,217974:
  ae(4), igb(4) and ixgbe(4) supports altq(4).

r216578:
  Add .Xr to altq(4).

r216579,216581:
  igb(4), ixgbe(4), mxge(4) and nxge(4) support VLAN hardware tag
  insertion/stripping.
  et(4) and fwe(4) support VLAN oversized frames.

r216580:
  Add ae(4) to the list of drivers use the miibus interface.
2011-01-30 23:16:49 +00:00
Jilles Tjoelker 3e3638cfcc MFC r217704: getgroups(2): Remove <sys/types.h> and refer to sysconf(3).
Because {NGROUPS_MAX} may become variable, its value should be obtained
using sysconf(3).

In head, r217704 removed mention of <sys/param.h>; this was not mentioned in
stable/7.
2011-01-30 21:00:57 +00:00
John Baldwin f523c3f58d MFC 217702:
Restore support for the 'async' and 'sync' mount options lost when
switching to nmount(2).  While here, sort the options.
2011-01-28 20:22:03 +00:00
John Baldwin 074863f062 MFC 217416:
Add two more features to cpuset(1):
- Add a new -C flag to create a new cpuset and move an existing pid into
  that set.
- Allow 'all' to be specified for a cpu list (e.g. cpuset -s 1 -l all)
  which maps to the list of all CPUs in the system.
2011-01-28 20:06:51 +00:00
Remko Lodder 1fd2419e7a MFC r174460,174478
Add information about the maximum file size for msdosfs.

  PR: docs/112935
  Submitted by: Julian Stacey <jhs at berklix dot org>
  Actually this was inspired by the ticket submitted
  by Julian.
  MFC After: 3 days

PR:		docs/112935
2011-01-28 07:04:01 +00:00
Gavin Atkinson 71c9428851 Merge r217264 from head:
Remove a bullet point that appears to have been accidentally inserted twice.
  It has also been included within the feature lists to which it is relevant.

PR:		tobez
2011-01-27 23:07:23 +00:00
Colin Percival 6a75f7039b MFC r217872: Unbreak .Dd line.
Approved by:	re (kib)
2011-01-27 21:39:03 +00:00
John Baldwin 1159bc87eb MFC 217237,217291:
- Fix two harmless off-by-one errors.
- Always use PRI_BASE() when checking the base type of a thread's priority
  class.
2011-01-27 21:33:06 +00:00
John Baldwin e4de498f21 MFC 217078,217079: Various priority fixes for creating new threads:
- Move sched_fork() later in fork() after the various sections of the new
  thread and proc have been copied and zeroed from the old thread and
  proc.  Otherwise attempts to modify thread or process data in sched_fork()
  could be undone.
- Don't copy td_{base,}_user_pri from the old thread to the new thread in
  sched_fork_thread() in ULE.  This is already done courtesy the bcopy()
  of the thread copy region.
- Always initialize the real priority (td_priority) of new threads to the
  new thread's base priority (td_base_pri) to avoid bogusly inheriting a
  borrowed priority from the parent thread.
- Properly initialize the base priority (td_base_pri) of thread0 to PVM
  to match the desired priority in td_priority.  Otherwise the first time
  thread0 used a borrowed priority it would drop down to PUSER instead of
  PVM.
- Explicitly initialize the starting priority of new kprocs to PVM to
  avoid inheriting some random priority from thread0.
2011-01-27 21:21:09 +00:00
Remko Lodder 3c1abbd5d4 MFC r183110
Document the -F 's return statement.
  If the application returns succesfully
  the return code is 7 (which means the
  filesystem is clean).

  PR: 127432
  Submitted by: edwin
  MFC after: 3 days

PR:		127432
2011-01-27 20:53:03 +00:00
Remko Lodder 770b9f5788 MFC r186424
Add quirk for the Storcase InfoStation 12bay
  SATA to FC SAN.

  PR:		129858
  Submitted by:	Nick Triantos <nick-freebsd at triantos dot com>
  MFC after:	1 week

PR:		129858
2011-01-27 20:50:03 +00:00
Remko Lodder 2a092a00b2 MFC r194558
Add architecture support for TinyBSD

  PR:	 135301
  Submitted by:	Olivier Cochard-Labbe <olivier at cochard dot me>
  Reviewed by:	Jean Milanez Melo <jmelo at freebsdbrasil dot com dot br> (maintainer)
  Approved by:	imp (mentor, implicit)
  MFC after:	1 week

PR:		135301
2011-01-27 20:39:19 +00:00
John Baldwin 3ead133faf MFC 217077:
Only change the priority of timeshare threads to PRI_MAX_TIMESHARE
when yield() is called.  Specifically, leave the priority of real time
and idle threads unchanged.
2011-01-27 20:12:35 +00:00
Pyun YongHyeon 0504797b69 MFC r182771:
Hook up ixgbe(4) to the build.  D'oh!
2011-01-27 19:38:03 +00:00
Remko Lodder 8955286bd6 MFC r194582
Add support for the Myson Heden 8813.
  Note that I also added the usbdev to the list, because the 8813 version
  is not yet known there. I might have twisted the sorting there but because
  8813 comes before 8818, I added it before that (with _8813 to differentiate)
  the item.

  PR:	 135628
  Submitted by:	Yoshikazu GOTO <goto at on-link dot jp>
  Approved by:	imp (mentor, implicit)

PR:		135628
2011-01-27 19:37:01 +00:00
Pyun YongHyeon 06a2614663 MFC r179724,179852:
r179724:
  Add man page for ixgbe driver

r179852:
  Bring this up to date with regard to our other section 4 and Intel manpages,
  also fixes a few mdoc bugs.
2011-01-27 19:32:53 +00:00
Pyun YongHyeon 761c1b43f1 MFC r183646,216552:
r183646:
  Add a HARDWARE section.  It doesn't contain any information not
  already in the DESCRIPTION section, but this allows for the manual
  page to be used in the automatic hardware notes generation.

r216552:
  Document JMC251/JMC261 support.
2011-01-27 19:17:31 +00:00
Remko Lodder de19ad271b MFC r198787
Document the WWWSUPFILE variable.

  PR:	 137723
  Submitted by:	Sofian Brabez <sbrabez at gmail dot com>
  Approved by:	imp (mentor, implicit)
  MFC after:	3 days
  Facilitated by:	Snow B.V.

PR:		137723
2011-01-27 19:12:04 +00:00
Remko Lodder a6c69b5f2c MFC r178987
Fix pstat behaviour when using coredumps. The reference to tp was
  incorrect and should have been poining to &tty, tp is a virtual
  address from the coredump, while we should obtain the address through
  the tty struct.

  Approved by:	imp (mentor, implicit trivial changes)
  MFC after:	1 week
  Submitted by:	Ed Schouten (ed at 80836 dot nl)

PR:		138131
2011-01-27 19:08:01 +00:00
Pyun YongHyeon 42d3dae271 MFC r216551:
Add support for JMicron JMC251/JMC261  Gigabit/Fast ethernet
  controller with Card Read Host Controller. These controllers are
  multi-function devices and have the same ethernet core of
  JMC250/JMC260. Starting from REVFM 5(chip full mask revision)
  controllers have the following features.
   o eFuse support
   o PCD(Packet Completion Deferring)
   o More advanced PHY power saving

  Because these controllers started to use eFuse, station address
  modified by driver is permanent as if it was written to EEPROM. If
  you have to change station address please save your controller
  default address to safe place before reprogramming it. There is no
  way to restore factory default station address.

  Many thanks to JMicron for continuing to support FreeBSD.

  HW donated by:	JMicron
2011-01-27 19:04:17 +00:00
Pyun YongHyeon 3268dff23f MFC r216546,216548-216550:
r216546:
  Consistently put a tab character between #define and the macro name.

r216548:
  Fix a regression introduced in r213893. FPGA version requires PHY
  probing so allow PHY probing on all possible addresses.

r216549:
  Make sure whether driver allocated resource before releasing it.

r216550:
  Use system defined PCIR_EXPRESS_DEVICE_CTL instead of using magic
  number.
2011-01-27 18:46:26 +00:00
Pyun YongHyeon 2587eeb43c MFC r216438:
Remove unecessary and clearly wrong usage of atomic(9).
2011-01-27 18:38:48 +00:00
Pyun YongHyeon 3648026a04 MFC r216362:
Remove unecessary and clearly wrong usage of atomic(9).
2011-01-27 18:34:05 +00:00
Colin Percival ae977a8212 MFC r217869,217870: Fix .Dd lines in re(4) and nfe(4). 2011-01-27 09:01:44 +00:00
John Baldwin c95ccceb65 MFC 216486,216764:
Use bus_alloc_resource_any() instead of bus_alloc_resource().
2011-01-26 20:36:20 +00:00
John Baldwin e5198831ae MFC 216621: Fix a typo in a comment. 2011-01-26 20:29:28 +00:00
John Baldwin 7c8010b18f MFC 216590:
Don't whine about child drivers calling pci_enable_busmaster().  That is
perfectly normal.
2011-01-26 20:26:58 +00:00
John Baldwin 8f744f99a2 MFC 216334:
When reopening a stream backed by an open file descriptor, do not close
the existing file descriptor.  Instead, let dup2() atomically close the
old file descriptor when assigning the newly opened file to the same
descriptor.  This closes a race in a multithreaded application where a
concurrent open() could allocate the existing file descriptor in between
the calls to close() and dup2().
2011-01-26 20:14:12 +00:00
John Baldwin 6b0dcb883e MFC 216235,216236:
When masking direct and processor devices during an inquiry, properly
preserve the upper bits of the first data byte.
2011-01-26 20:09:08 +00:00
John Baldwin ec2b33d4bd MFC 214835:
Adjust the order of operations in spinlock_enter() and spinlock_exit() to
work properly with single-stepping in a kernel debugger.
2011-01-25 22:08:43 +00:00
Jilles Tjoelker 1059eb5ba6 MFC r217484: mknod(2): The required include is <sys/stat.h>, not <unistd.h>.
This is what SUSv4 requires, and also the only thing that works if strict
standards compliance is requested.

PR:		standards/123688
Submitted by:	gcooper
2011-01-25 21:51:32 +00:00
John Baldwin d9bacaed68 MFC 215541:
Set the POSIX semaphore capability when the semaphore module is enabled.
2011-01-25 20:54:29 +00:00
John Baldwin 3470dbf518 MFC 215540:
Set various POSIX capability sysctls to the version of the API that is
supported rather than 1.  They are supposed to return a suitable value
for sysconf(3).  While here, make the fsync sysctl match <unistd.h>.
2011-01-25 20:49:24 +00:00
John Baldwin b7a5fc39dc MFC 204329,210723,210933,214778,215526:
Sync mfiutil(8) with HEAD:
- Handle malloc() failures more gracefully by error'ing out rather than
  segfaulting.
- Fixed dependencies (make checkdpadd).
- Fix typos and spelling mistakes.
2011-01-25 20:44:24 +00:00
John Baldwin c35bdea433 MFC 211514,214158:
- There isn't really a need to hold the ktrace mutex just to read the
  value of p_traceflag that is stored in the kinfo_proc structure.
- When disabling ktracing on a process, free any pending requests that
  may be left.  This fixes a memory leak that can occur when tracing is
  disabled on a process via disabling tracing of a specific file (or if
  an I/O error occurs with the tracefile) if the process's next system
  call is exit().  The trace disabling code clears p_traceflag, so exit1()
  doesn't do any KTRACE-related cleanup leading to the leak.  I chose to
  make the free'ing of pending records synchronous rather than patching
  exit1().
- Move KTRACE-specific logic out of kern_(exec|exit|fork).c and into
  kern_ktrace.c instead.  Make ktrace_mtx private to kern_ktrace.c as a
  result.
2011-01-25 20:33:47 +00:00
John Baldwin 9fa5972550 MFC 214144:
- Make 'vm_refcnt' volatile so that compilers won't be tempted to treat
  its value as a loop invariant.  Currently this is a no-op because
  'atomic_cmpset_int()' clobbers all memory on current architectures.
- Use atomic_fetchadd_int() instead of an atomic_cmpset_int() loop to drop
  a reference in vmspace_free().
2011-01-25 19:44:55 +00:00
Glen Barber 433b63f170 MFC 217148, 217786:
Document rc.conf.d in rc.conf(5).

PR:		140495
Approved by:	keramida (mentor)
2011-01-24 15:18:18 +00:00
Pyun YongHyeon 872f134e2e MFC r217649:
Correct wrong definition of PM timer mask and adjust L1/PM timer
  value. While I'm here enable all clocks before initializing
  controller. This change should fix lockup issue seen on AR8152
  v1.1 PCIe Fast Ethernet controller.

  PR:	kern/154076
2011-01-23 02:18:18 +00:00
Jack F Vogel d32bce51a8 MFC rev 217591 2011-01-22 20:01:46 +00:00
Jack F Vogel 4c4d37baed MFC rev 217295 2011-01-22 20:00:24 +00:00
Jung-uk Kim 16d3bd3750 MFC: r217424
Remove redundant, bogus, and even harmful uses of setting TS bit in CR0.
It is done from fpstate_drop() when it is really necessary.
2011-01-21 18:32:29 +00:00
Marius Strobl 87493022c0 MFC: r217417
- Even after masking the media with IFM_GMASK the result may have bits
  besides the duplex ones set so just comparing it with IFM_FDX may lead
  to false negatives.
- Just let the default case handle all unsupported media types.
- In pnphy_status() don't unnecessarily read a register twice.
- Remove unnused macros.
2011-01-21 00:53:37 +00:00
Marius Strobl f375fa35ad MFC: r217414
- Don't announce PAUSE support for half-duplex when MIIF_FORCEPAUSE is
  set.
- Let mii_phy_auto() also announce PAUSE support for 10baseT-FDX.
2011-01-21 00:50:34 +00:00
Marius Strobl 98b32890e8 MFC: r217413
- Even after masking the media with IFM_GMASK the result may have bits
  besides the duplex ones set so just comparing it with IFM_FDX may lead
  to false negatives.
- Simplify ciphy_service() to only set the manual configuration bits
  once after we have figured them all out. This also means we no longer
  unnecessarily update the hardware along the road.
2011-01-21 00:48:08 +00:00
Marius Strobl 4b6f70ff25 MFC: r217412
- Masking IFM_GMASK when also masking IFM_FDX is redundant and just
  complicates the code.
- Don't let atphy_setmedia() announce PAUSE support for half-duplex when
  MIIF_FORCEPAUSE is set.
- Simplify e1000phy_service() and ip1000phy_service() to only set the
  manual configuration bits once after we have figured them all out. For
  ip1000phy_service() this also means we no longer unnecessarily update
  the hardware along the road.
2011-01-21 00:40:51 +00:00
Pyun YongHyeon 3c93e27625 MFC r217548:
Rework RX filter programming by providing separate handler for
  DP8381[56] and SiS 900/7016 controllers.  After r212119, sis(4) no
  longer reinitializes controller if ALLMULTI/PROMISC was changed.
  However, RX filter handling code assumed some bits of the RX filter
  is programmed by driver initialization. This caused ALLMULTI/PROMISC
  configuration is ignored under certain conditions.
  Fix that issue by reprogramming all bits of RX filter register.
  While I'm here follow recommended RX filter programming steps
  recommended by National DP8381[56] data sheet(RX filter should be
  is disabled before programming).

  Reported by:	Paul Schenkeveld < freebsd () psconsult dot nl >
  Tested by:	Paul Schenkeveld < freebsd () psconsult dot nl >
2011-01-21 00:35:34 +00:00
Pyun YongHyeon 2af4b4c957 MFC r192784,192805:
Free the memory correctly in the error case

  PR:	misc/154152
2011-01-20 21:25:16 +00:00
Giorgos Keramidas cbd17187b8 MFC r217481 and r217606 from /head
r217481...
  Fix the mount example of xfs(5) filesystems by including the read-only
  option.  We only support ro mounts for xfs, so it’s nice if the examples
  we show in the manpage are easy to copy/paste.

  PR:           docs/149106
  Submitted by: amdmi3

r217606...
  Bump .Dd date of manpage for r217481
2011-01-19 21:49:42 +00:00
Giorgos Keramidas b3a890b1a5 MFC r199985 from /head
Describe what setpgid(2) does when pgid=0.  The text has been
copied from NetBSD’s manpage, and it also matches the behavior
described by the Open Group’s online copy of setpgid.2 at
http://www.opengroup.org/onlinepubs/009695399/functions/setpgid.html

Obtained from:        NetBSD
Submitted by:         Petros Barbayiannis <[email protected]>
2011-01-19 21:35:48 +00:00
Giorgos Keramidas 479b6f98db MFC r205978 from /head
Document DEBUG_FLAGS in a more visible place, in the build(7) manpage

Noticed by:     Alexander Best <alexbestms.at.wwu.de>
Reviewed by:    jhb
2011-01-19 21:28:21 +00:00
Giorgos Keramidas 3a8eb0b063 MFC r217064 - sort & fix includes, remove -include from CFLAGS of acct tests
- Sort the includes of pack.c, moving sys/*.h files near the top.
- Add a couple of missing #include lines, and remove the need for
  custom -include options in the CFLAGS of the test Makefile.
- Remove the ad-hoc ’all’ target, but keep its ’regress’ bits for
  testing.
- Convert the ad-hoc ’clean’ target to proper CLEANFILES stuff,
  so that the normal bsd.prog.mk machinery can clean up.
- Use ‘make -V .OBJDIR’ to detect the place where ’pack’ lives,
  so that regress.t works both with and without ’make obj’.
2011-01-19 21:19:23 +00:00
Giorgos Keramidas 495deeacb9 MFC -r188305 and r189207 from /head
: r188305 -->
: Fix language on atol(3) manpage.  Add a COMPATIBILITY section
: stating that in FreeBSD the atol() and atoll() functions affect
: errno in the same way as strtol() and stroll().
:
: PR:             docs/126487
: Submitted by:   edwin
: Reviewed by:    trhodes, gabor
: MFC after:      1 week

: r189207 -->
: "-isoC-99" should be spelled without 'c'.
2011-01-19 15:43:23 +00:00
Giorgos Keramidas a5d000269b MFC -r 186783 from /head
Document the NO_XXX options supported by our Makefile.inc1.

  Noticed by:   simon
  Reviewed by:  imp
2011-01-19 15:12:38 +00:00
Simon L. B. Nielsen c4bd91a017 Decrease the libcrypto and libssl shared object version numbers from 6
to 5. They were accidentally bumped in r215997 (on 2010-11-28) with the
merge of OpenSSL 0.9.8p, but unfortunately this was not caught until
now.

Also add compat links for libcrypto.so.6 / libssl.so.6 (pointing to
their .5 counterparts) in case any users have compiled any third party
during the time stable/7 (and releng/7.4) were broken.

This is deemed the last poor of bad options.  Had the number bump not
been reverted binary packages for stable/7 would not have worked on the
still supported 7.3 and 7.1 releases.

Discussed with:	re, portmgr
Approved by:	re (kensmith - in principle)
Pointyhat to:	simon
2011-01-18 22:19:55 +00:00
Marius Strobl a60256705b MFC: r217464, r217468, r217475
Add a manual page for rgephy(4) and reference it as appropriate. The
motivation for having rgephy.4 is to document the special media option
added in r217415 (MFC'ed to stable/7 in r217503).
2011-01-18 11:51:51 +00:00
Marius Strobl fd92aa79c0 MFC: r217415
- Allow IFM_FLAG0 to be set indicating that auto-negotiation with manual
  configuration, which is used to work around issues with certain setups
  (see r161237) by default, should not be triggered as it may in turn
  cause harm in some edge cases.
- Even after masking the media with IFM_GMASK the result may have bits
  besides the duplex ones set so just comparing it with IFM_FDX may lead
  to false negatives.
- Announce PAUSE support also for manually selected 1000BASE-T, but for
  all manually selected media types only in full-duplex mode. Announce
  asymmetric PAUSE support only for manually selected 1000BASE-T.
- Simplify setting the manual configuration bits to only once after we
  have figured them all out. This also means we no longer unnecessarily
  update the hardware along the road.
- Remove a stale comment.

Reviewed by:	yongari (plus additional testing)
2011-01-17 15:12:37 +00:00
Konstantin Belousov 6c883c20dd MFC r217383:
The (%esp & 0xf) == 0 should be true before the call instruction is
executed, for the properly aligned stack.
2011-01-16 10:47:35 +00:00
Jaakko Heinonen 893a742002 MFC r214748:
Extend the g_eventlock mutex coverage in one_event() to include setting
of the EV_DONE flag and use the mutex to protect against losing wakeups
in g_waitfor_event().
2011-01-15 09:36:31 +00:00
Pyun YongHyeon d4321c300b MFC r217296:
For re(4) controllers that uses new jumbo frame scheme(RTL8168C/D/E),
  limit maximum RX buffer size to RE_RX_DESC_BUFLEN instead of
  blindly configuring it to 16KB. Due to lack of documentation, re(4)
  didn't allow jumbo frame on these controllers. However it seems
  controller is confused with jumbo frame such that it can DMA the
  received frame to wrong address instead of splitting it into
  multiple RX buffers. Of course, this caused panic.

  Since re(4) does not support jumbo frames on these controllers,
  make controller drop frame that is longer than RE_RX_DESC_BUFLEN
  sized frame. Fortunately RTL810x controllers, which do not support
  jumbo frame, have no such issues but this change also limited
  maximum RX buffer size allowed to RTL810x controllers. Allowing
  16KB RX buffer for controllers that have no such capability is
  meaningless.
2011-01-15 00:34:50 +00:00
Pyun YongHyeon 37845ea117 MFC r216131:
Document loader tunable hw.re.prefer_iomap.
2011-01-14 22:58:41 +00:00
Marius Strobl 4faaf45890 MFC: r217013
Teach ifconfig(8) the handy shared option shortcut aliases the NetBSD
counterpart also takes, i.e. "fdx" for "full-duplex", "flow" for
"flowcontrol", "hdx" for "half-duplex" as well as "loop" and "loopback"
for "hw-loopback".
2011-01-14 20:43:24 +00:00
Marius Strobl 988b6c0984 MFC: r217010
Fix whitespace.
2011-01-14 20:30:17 +00:00
Marius Strobl 9460472653 MFC: r217009
Remove a redundant variable assignment found with the clang static analyzer.
2011-01-14 20:28:12 +00:00
Bjoern A. Zeeb 49bca232d0 MFC r217135:
Clarify when we switch from keepidle to keepinvtl intervals if sending
  TCP keepalive probes is enabled.
2011-01-14 13:35:55 +00:00
Lawrence Stewart a611ce592e MFC r216995,217043:
Add a man page for the Object Specific Data (OSD) KPI.

Although not directly related the FreeBSD Foundation funded "Five New TCP
Congestion Control Algorithms for FreeBSD" project, the understanding and
inspiration required to write this documentation was significantly bolstered by
the Foundation's support.

Reviewed by:	pjd
2011-01-14 01:07:39 +00:00
Giorgos Keramidas ae3d81a70c MFC r217208 - regression/date: unset all LC_xxx vars and set LANG/LC_ALL
When running with a custom locale setup, it's easy to confuse the
date regression tests and cause them to fail, e.g. when LANG='C'
but LC_ALL='el_GR.UTF-8'.  Set LC_ALL to 'C', which overrides all
other LC_xxx options, to avoid this sort of problem.
2011-01-13 12:26:39 +00:00
Doug Barton 49e5def9f9 For stat.c
==========

MFC r216196:

Bring in the change from NetBSD 1.18:

"If using stat (the -L flag) and it fails, fall back to lstat().  It
may be the case that we're examining a broken symlink, and anything is
better than nothing."

The changes in 1.14 through 1.17 were not relevant to us.

Obtained from:	[email protected]

MFC r216202:

Bring in the change from NetBSD 1.22:

"Fix a trivial truncation case, and eliminate a corner case that might
print a nul character."

I am purposely bypassing the following versions:
1.19	A build infrastructure change that does not apply to us
1.20	A feature I am not interested in, but don't object if someone else
	wants to pick it up
1.21	A build infrastructure change that does not apply to us

Obtained from:	[email protected]

MFC r216203:

Bring in a new feature, adding a -f option to readlink to print the path
of the target, similar to realpath(1). See the discussion at:
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=34662

This brings in the following changes:
1.24
"PR/34662: martijnb at atlas dot ipv6 dot stack dot nl: readlink doesn't
grok -f, and there's no alternative (+fix)

Patch applied with minor tweak (%y -> %R, as it was already taken) plus
some nits from myself. Thanks!"

Obtained from:	[email protected]

1.25
"Fix a segfault when doing 'stat -f %R' on the stdin file handle, instead
fake the filename '(stdin)' like the %N format."

Obtained from:	[email protected]

1.27
"The ofmt variable is actually a bit mask (not the character that was
in the format string) so that we can "or" it with the bits in the
formats variable.  This fixes the missing " -> " in front of the real
path (when you use %SR).

Also, the ?: needs another space."

Obtained from:	[email protected]

I am purposely omitting the following changes:
1.23	A humanize_number(3) clone that should better be implemented by
	actually using humanize_number(3)
1.26	This is the removal of license clause 3 and 4, already handled
	by imp in r203971

MFC 216205:

Bring in the update from NetBSD 1.28:

"Fix WARNS=4 issues (-Wcast-qual -Wsign-compare)"

Because of code differences I had to hand-apply parts of the patch,
so responsibility for errors goes to me.

Obtained from:	[email protected]

MFC 216206:	[ Also applies to Makefile ]

Fix an "unused variable" error that gets us all the way to WARNS=6

MFC 216207:

Bring in the following changes from NetBSD. See the discussion at:
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=44128

1.29
"Don't printf time_t with %d; fixes PR 44128 from yamt. With this change it
successfully prints mtimes after 2038."

1.30
"Improve previous with comments."

Obtained from:	[email protected] (both)

MFC 216343:

Bring in the change from OpenBSD's 1.14:

"synchronize synopsis and usage; "-l", "-r", "-s" and "-x" are mutually
exclusive; while here, slightly improve spacing in the source code
so it fits on a 80-column display again.

diff greatly improved by martynas@"

Obtained from:	[email protected]

MFC 216512:

Bring in the relevant changes from NetBSD's 1.31:

"Use strlcpy, not strncpy, when the desired semantics are strlcpy's
rather than strncpy's."

Note: NetBSD's 1.32 is their adoption of our r216206

Obtained from:	[email protected]

For stat.1
==========

MFC 216197:

Add my own documentation for the change in our r216196, aka NetBSD's 1.18
For -L if stat(2) fails, fall back to lstat(2).

.Dd purposely not bumped because more changes are coming.

MFC 216204:

Bring in the update from NetBSD 1.19, the documentation of readlink -f

"PR/34662: martijnb at atlas dot ipv6 dot stack dot nl: readlink doesn't
grok -f, and there's no alternative (+fix)

Patch applied with minor tweak (%y -> %R, as it was already taken) plus
some nits from myself. Thanks!"

Obtained from:	[email protected]

MFC 216209:

Bring in the change from NetBSD 1.12:

"document default format."

Obtained from:	[email protected]

MFC 216213:

Bring in the changes from NetBSD 1.13 that we did not already have, with
some differences.

"Sort options. Use more mdoc macros. Some nit fixes. Bump date."

Obtained from:	[email protected]

MFC 216215:

Bring in the changes from NetBSD 1.16 that we did not already have.

"Some fixes from jmc@openbsd."

Obtained from:	[email protected]

MFC 216216:

Bring in the change from NetBSD 1.20:

"Make sentence easier to parse. From jsing@openbsd via jmc@openbsd."

Obtained from:	[email protected]

MFC 216218:

Bring in the following changes from NetBSD:

1.21
"Document the flags displayed by the default format, and mention their short
names. From espie@openbsd via jmc@openbsd."

1.24
"Fix three variable names.
From Todd T. Fries via Jason McIntyre."

Obtained from:	[email protected] (previous 2)

1.25
"Be consistent: document the birthtime field of struct stat for
the "B" field specifier."

Obtained from:	[email protected]

1.26
"Drop trailing space."

Obtained from:	[email protected]

1.27
"Since we have st_birthtime in struct stat, it is in default display."

Obtained from:	[email protected]

Purposely skipping the following revisions:
1.22	NetBSD-specific change
1.23	Removal of license clauses 3 and 4, already handled by imp
	in our r203971

MFC 216219:

Bring in the change from NetBSD 1.28:

"\\ -> \e"

Obtained from:	[email protected]

Bump .Dd because we're now up to date with the latest NetBSD version
2011-01-12 07:38:48 +00:00
Doug Barton 5152a1cd78 MFC r188498 (partial):
"I've changed main() to set file properly, so output() is never called
with file set to NULL."

Obtained from:	ed

The other bits of that revision are related to using fdevname(3).
This was never merged back to RELENG_7, however the cleanup of
the code in this MFC is good both for general purposes, and diff
reduction to HEAD (which in turn will make the following MFCs easier).
2011-01-12 07:27:30 +00:00
Doug Barton 9affd66594 MFC 178651:
The referenced section name is 'Formats', not 'FORMATS'.
2011-01-12 05:37:13 +00:00
Doug Barton 3524148a59 MFC r203971:
The NetBSD Foundation has granted permission to remove clause 3 and 4
from their software.

Obtained from:  NetBSD
2011-01-11 20:05:53 +00:00
Pyun YongHyeon 789ab80d00 MFC r217226:
Apply DMA address space restriction to controllers that have 4GB
  DMA boundary bug and runs with PCI-X mode.  watchdog timeout was
  observed on BCM5704 which lives behind certain PCI-X bridge(e.g.
  AMD 8131 PCI-X bridge).  It's still not clear whether the root
  cause came from that PCI-X bridge or not. The watchdog timeout
  indicates the issue is in TX path. If the bridge reorders TX
  mailbox write accesses it would generate all kinds of problems but
  I'm not sure.  This should be revisited.

  Early MFC requested by re@ for inclusion in 8.2-RC2/7.4-RC2.

  Tested by:	Michael L. Squires (mikes <> siralan dot org)
2011-01-10 19:48:24 +00:00
Josh Paetzel c68e20ca30 MFC 216983:
Fix typo in comment.

Approved by:	Warner Losh <[email protected]>
2011-01-07 18:41:32 +00:00
Brian Somers 98dd30c6a1 MFC r216832: Make -S functional 2011-01-07 08:45:56 +00:00
Marius Strobl 2d1b306a52 MFC: r216820 (partial)
Add CPUTYPE support for sparc64. The net result is that it's now possible
to let the compiler optimize for the famility of UltraSPARC-III CPUs as the
default already was to optimize for UltraSPARC-I/II and generating generic
64-bit V9 is mainly for reference purposes. At least for SPARC64-V CPUs
code optimized for UltraSPARC-I/II still is the most performant one.
Thanks go to Michael Moll for testing SPARC64-V.
2011-01-05 13:36:59 +00:00
Marius Strobl 643b1615c1 MFC: r216802
- Move the macros for generating load and store instructions to asmacros.h
  so they can be shared by different source files and extend them by a
  variant for atomic compare and swap.
- Consistently use EMPTY.
2011-01-05 12:27:57 +00:00
Marius Strobl fac3d59ee7 MFC: r216801
Rename the "xor" parameter to "xorval" as the former is a reserved keyword
in C++.

Submitted by:	gahr
2011-01-05 12:20:55 +00:00
Marius Strobl 1e89a2cf1d MFC: r216628
Extend the hack of r182730 (MFC'ed to stable/7 in r190033) to trick
GAS/GCC into compiling access to STICK/STICK_COMPARE independently
of the selected instruction set by TICK_COMPARE so tick.c once again
can be compiled with gcc -mcpu=v9 for reference purposes.
2011-01-05 12:05:31 +00:00
Marius Strobl 5ca0753649 MFC: r216623
- Add a comment regarding the fact that as documented in the datasheet
  manual 1000BASE-T modes of DP83865 only work together with other National
  Semiconductor PHYs.
- Spell 10BASE-T correctly
- Remove some redundant braces.
2011-01-05 11:46:18 +00:00
Marius Strobl 85045c7cce MFC: r216085
- Remove the remaining support for older (in this case pre-7.0-RELEASE)
  versions of FreeBSD. In fact we are already missing a lot of conditional
  code necessary to support older versions of FreeBSD, including alternatives
  for vital functionality not yet provided by the respective subsystem back
  then (see for example r199663). So this change shouldn't actually break
  this driver on versions of FreeBSD that were supported before. Besides,
  this driver also isn't maintained as an multi-release version outside of
  the main repository, so removing the conditional code shouldn't be a
  problem in that regard either.
- Sprinkle some more const on tables.
2011-01-05 11:43:17 +00:00
Marius Strobl f44a32b942 MFC: r216891
Extend the section in which interrupts are disabled in the TLB demap
functions, otherwise if we get preempted after checking whether a certain
pmap is active on the current CPU but before disabling interrupts we might
operate on an outdated state as the pmap might have been deactivated in
the meantime. As the same issue may arises when the TLB demap function is
interrupted by a TLB demap IPI, just entering a critical section before
the check isn't sufficient so we have to fully disable interrupts instead.
2011-01-05 11:29:10 +00:00
Gavin Atkinson 3a0c7d068d Merge r216045 from head (by hand, due to code changes):
Support the Falcom Twist USB GSM/GPRS modem in uftdi(4)

PR:		usb/151862
Submitted by:	Alessandro de Manzano <demanzano dqmicro.it>
2011-01-04 20:38:52 +00:00
John Baldwin 2d7537be7a MFC 216769:
Start sentences on a new line to ease life for translators.  Tweak the
wording in a few places.
2011-01-04 15:11:08 +00:00
Lawrence Stewart ae2bb0acf4 MFC r210144 (originally committed by imp):
Put warnings out to stderr rather than stdout.
2011-01-02 13:31:10 +00:00
Bjoern A. Zeeb 9f83f5cafb MFC r216848:
Happy New Year 2011.

  Approved by:  core (kib)
2010-12-31 18:16:44 +00:00
John Baldwin 8219215297 MFC 199805,203532,204329,210063,210065:
- Change gcore in order to get rid of the procfs accesses and use FreeBSD's
  specific sysctls and ptrace interfaces.
  This change switches a bit gcore POLA that is summarized here:
  - now gcore can recognize threads within the process and handle dumps
    on thread-scope
  - the process to be analyzed will be stopped during its gcore run
  - gcore may not work with processes which are actively being analyzed
    by gdb or truss
  - the ptrace interface may cause syscalls to return EINTR, thus
    interferring with signals handling within the process
- Fix gcore so that it can have the '-s' flag without hanging.
- Fix the way the segments are included in the gcore outputs (with the
  default invokation):
  - Right now if segments are not writable are not included. Remove this.
  - Right now if a segment is mapped with NOCORE the check is not honoured.
    Change this by checking the newly added flag, from libutil,
    KVME_FLAG_NOCOREDUMP.

  Besides that, add a new flag (-f) that forces a 'full' dump of all the
  segments excluding just the malformed ones. This might be used very
  carefully as, among the reported segments, there could be memory
  mapped areas that could be vital to program execution.
2010-12-28 19:26:57 +00:00
John Baldwin 98d4669339 MFC 208587: Add support for reporting the NOCOREDUMP flag from
sysctl_kern_proc_vmmap().
2010-12-28 18:37:10 +00:00
Ken Smith 37b269a76f Add the package directories for the 7.4, 8.1, and 8.2 releases.
Approved by:	re (implicit)
2010-12-22 14:47:45 +00:00
Ken Smith 806667a621 Adjust __FreeBSD_version to reflect that the branch for the FreeBSD 7.4
release has happened.

Approved by:	re (implicit)
2010-12-22 14:45:43 +00:00
Ken Smith 855387ee45 Misc. 7.3 -> 7.4 adjustments as part of progress on the FreeBSD 7.4 release.
Approved by:	re (implicit)
2010-12-22 14:44:22 +00:00
Ken Smith 6578d88b02 Adjust the version of FreeBSD printed on the manual pages.
Approved by:	re (implicit)
2010-12-22 14:43:20 +00:00
Andrew Thompson 46d47d72ad MFC r216371:
Fix race in devfs by using LIST_FIRST() instead of
 LIST_FOREACH_SAFE() when freeing the devfs private
 data entries.

Approved by:	re (kib)
2010-12-21 09:33:06 +00:00
Doug Barton f99a868145 MFC r216187:
Add MAKEDEV.8

Submitted by:   Alex Kozlov <[email protected]>

Approved by:    re (kib)
2010-12-19 20:12:44 +00:00
Doug Barton 58dae595bd MFC r215824:
Add a sync to the shutdown step. In the common case this will be
harmless at worst. On a heavily loaded server it will give the fs a
chance to do its business without the axe hanging over its head.

Submitted by:   ivoras

Approved by:    re (kib)
2010-12-19 20:11:21 +00:00
Max Laier 057c7bb5de MFC r216335:
Fix a long standing (from the original 4.4BSD lite sources) race between
  vmspace_fork and vm_map_wire that would lead to "vm_fault_copy_wired: page
  missing" panics.  While faulting in pages for a map entry that is being
  wired down, mark the containing map as busy.  In vmspace_fork wait until
  the map is unbusy, before we try to copy the entries.

  Sponsored by:	Isilon Systems, Inc.

Approved by:	re (kib)
2010-12-19 06:09:02 +00:00
Jack F Vogel 649b83c468 MFC r216173
Remove the test for a minimum frame size from the IPV6 TX context
descriptor setup, when using VLANs and HW TAGGING the length of
an ICMP6 frame will fail this test and be discarded.

Approved by: re
2010-12-15 22:48:44 +00:00
John Baldwin 49749270a3 When the per-queueset transmit kthread is idle, do not pass a sleep
priority of '1' to tsleep().  This caused the priority of this kthread to
be raised higher than every other thread in the system.  Instead, leave
the priority of the kthread at its existing level.

This is a direct commit to stable/7 as this code is no longer present in
8.x and later.

Reviewed by:	np
Approved by:	re (kib)
2010-12-14 21:33:17 +00:00
Jack F Vogel c181afbca2 MFC r216172, r216176
Correct the RX discard and refresh_mbuf logic to match igb, the old
discard code could cause panics due to a bad pointer, now simply
have discard always free mbufs and depend on refresh. In the refresh
code, make sure the mbuf and soft buf struct are properly reset.

Approved by: re
2010-12-14 20:00:55 +00:00
Tijl Coosemans ebd10f733f MFC r216351:
Add a .note.ABI-tag section to ia64 startup files by linking crtbrand.c
in crt1.o. On other architectures crtbrand.c is included from crt1.c,
but that's not a C source code file on ia64. Instead it is compiled
separately and included in crt1.o using incremental linking.

Approved by:	re (kensmith), kib (mentor)
2010-12-14 15:35:44 +00:00
Bjoern A. Zeeb 8edab182af MFC r216192:
Use correct field to track statistics counting error as bad header length.
  This assimilates the code to what ip_input has been doing since r1.1 in
  this case.

  Submitted by: Rozhuk Ivan (rozhuk.im gmail.com)

Approved by:	re (kib)
2010-12-10 14:07:08 +00:00
Andrey V. Elsukov dd5ecaab44 MFC r206494 by luigi:
fix a buffer overflow with large (100k+) number of input lines.

Approved by:	re (bz)
2010-12-10 05:16:25 +00:00
Xin LI b9ba8e4041 MFC r216040:
Make German formal clause to be consistent with the keymap counterpart.

Submitted by:	arundel
Approved by:	re (kensmith, bz)
2010-12-10 00:53:16 +00:00
Simon L. B. Nielsen d89d6fa94e MFC r216166, r216167:
Merge in OpenSSL 0.9.8q.

Approved by:	re (kib)
Security:	CVE-2010-4180
Security:	http://www.openssl.org/news/secadv_20101202.txt
2010-12-09 22:05:16 +00:00
Doug Barton dde1cb5821 MFV: vendor/bind9/dist-9.4
Update to version 9.4-ESV-R4, the latest from ISC, which addresses
the following security vulnerabilities.

For more information regarding these issues please see:
http://www.isc.org/announcement/guidance-regarding-dec-1st-2010-security-advisories

1. Cache incorrectly allows ncache and rrsig for the same type

   http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-3613

   Affects resolver operators whose servers are open to potential
   attackers. Triggering the bug will cause the server to crash.

   This bug applies even if you do not have DNSSEC enabled.

2. Key algorithm rollover

   http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-3614

   Affects resolver operators who are validating with DNSSEC, and
   querying zones which are in a key rollover period. The bug will
   cause answers to incorrectly be marked as insecure.

Approved by:	re (kib)
2010-12-09 21:11:53 +00:00
Rebecca Cran ed1c12ad7d MFC r216229:
Revert r209469: it causes the rest of the function to be bypassed.

Approved by:	re (kensmith)
2010-12-09 15:28:59 +00:00
Rebecca Cran 3b333684d6 MFC r216243:
Ignore any failures with the "local" distribution since it's not present
on release CDs and so will normally fail.
installCommit() returns a DITEM_ value, not a Boolean.
distExtractAll() returns a Boolean, not a DITEM_ value.

Approved by:	re (kensmith)
2010-12-09 15:27:43 +00:00
Doug Barton 8fbf54f174 MFC r216065:
Update the description of green_saver.ko

Improvements to my suggested text from: jhb

Approved by:	re (kib)
2010-12-08 07:00:53 +00:00
Pyun YongHyeon ff4b8b226f MFC r216111:
If RX lockup workaround is enabled, fxp(4) will periodically reset
  the controller to workaround silicon bug of i82557. Each reset will
  re-establish link which in turn triggers MII status change
  callback. The callback will try to reconfigure controller if the
  controller is not i82557 to enable flow-control. This caused
  endless link UP/DOWN when the workaround was enabled on non-i82557
  controller.

  To fix the issue, apply RX lockup workaround only for i82557.
  Previously it blindly checked undocumented EEPROM location such
  that it sometimes enabled the workaround for other controllers. At
  this time, only i82557 is known to have the silicon bug.
  This fixes a regression introduced in r215906 which enabled flow
  control support for all controllers except i82557.

  Reported by:	Karl Denninger (karl <> denninger dot net)
  Tested by:	Karl Denninger (karl <> denninger dot net)
  Approved by:	re (kensmith)
2010-12-07 19:15:33 +00:00
Jung-uk Kim 163883fbf9 MFC: r216159
Do not change CPU ticker frequency if TSC is P-state invariant.

Approved by:	re (kib)
2010-12-07 18:15:18 +00:00
Colin Percival 47fed1f114 MFC r215105: Uninitialized buffers considered harmful.
Approved by:	re (bz)
2010-12-03 22:48:15 +00:00
Colin Percival 663b9c593e MFC r216077: Teach crashinfo(8) about the kern.bootfile sysctl.
Approved by:	re (bz)
2010-12-03 16:21:39 +00:00
Bjoern A. Zeeb 3800892398 MFC r206989:
Avoid memory access after free. Use the (shortend) copy for the
  ipsec mtu lookup as well.

  Submitted by:	Peter Molnar (peter molnar.cc)
PR:		kern/145736
Approved by:	re (kib)
2010-12-02 16:27:28 +00:00
John Baldwin ae10be2c3e MFC 215820:
Add device IDs for two more ServerWorks Host-PCI bridges so that we can
read their starting PCI bus number for older systems that do not support
ACPI (or have a broken _BBN method).

Approved by:	re (kib)
2010-12-02 15:59:41 +00:00
Rebecca Cran 326ef47d0c MFC r216053:
If no floppy drive is installed kldBrowser() can generate an error
early on. Initialize menu and count so the cleanup code doesn't try
and use their uninitialized values.

PR:	bin/152270
Submitted by:	Remi LAURENT <cloud at madpowah.org>

Approved by:	re (kensmith)
2010-12-02 09:10:45 +00:00
Andrew Gallatin cc4824933c MFC 215686:
Fix a TSO checksum bug on mxge(4):

The Myri10GE NIC will assume all TSO frames contain partial checksum,
and will emit TSO segments with bad TCP checksums if a TSO frame
contains a full checksum.  The mxge driver takes care to make sure
that TSO is disabled when checksum offload is disabled for this
reason.  However, modules that modify packet contents (like pf) may
end up completing a checksum on a TSO frame, leading to the NIC emitting
TSO segments with bad checksums.

To workaround this, restore the partial checksum in the mxge driver
when we're fed a TSO frame with a full checksum.
2010-11-29 13:36:37 +00:00
Simon L. B. Nielsen 6e6d2f6f63 Revert some FreeBSD specific changes (mainly made to fix various
security issues), and bring us back to using vendor versions of the
files.

This was already done on head and stable/8.
2010-11-29 08:44:32 +00:00
Pyun YongHyeon 8cde11f2ec MFC r215328:
Add flow control for 3C905B and newer controllers. Note, these
  controllers support RX pause only.

  Reviewed by:	marius
2010-11-29 01:50:58 +00:00
Pyun YongHyeon b54c265209 MFC r215329:
Add flow control for all re(4) controllers. re(4) controllers do
  not provide any MAC configuration interface for resolved flow
  control parameters. There is even no register that configures water
  mark which will control generation of pause frames.
  However enabling flow control surely enhanced performance a lot.
2010-11-29 01:43:17 +00:00
Pyun YongHyeon ec6260ff8c MFC r215849:
Enable ethernet flow-control on all jme(4) controllers.
2010-11-29 01:39:46 +00:00
Pyun YongHyeon 70f653493f MFC r215848:
Allocate 1 MSI/MSI-X vector. Originally jme(4) was designed to
  support multi-queue but the hardware limitation made it hard to
  implement supporting multi-queue. Allocating more than necessary
  vectors is resource waste and it can be added back when we
  implement multi-queue support.
2010-11-29 01:37:27 +00:00
Pyun YongHyeon a58a621a65 MFC r215847:
Disable retrying RX descriptor loading. The counter is used to set
  number of retry to be performed whenever controller found RX
  descriptor was empty. RX empty interrupt is generated only when the
  retry counter is over. Experimentation shows retrying RX descriptor
  loading increased number of dropped frames under flow-control
  enabled environments so disable it and have controller generate RX
  empty interrupt as fast as it can.
  While I'm here fix RXCSR_DESC_RT_CNT macro.
2010-11-29 01:34:43 +00:00
Pyun YongHyeon 6c3d99ad21 MFC r215850:
Enable ethernet flow-control on all alc(4) controllers. This change
  should reduce a lot of dropped frames under high network load.
2010-11-29 01:30:49 +00:00
Marius Strobl 49d99dc72d MFC: r215923
Allow pause support advertisement to be turned off again.

Submitted by:	yongari (ip1000phy(4))
2010-11-28 16:09:40 +00:00
Marius Strobl bd0ea1126a MFC: r215907
Remove the description of the dev.fxp.%d.noflow tunable as it was removed
in r215906 (MFC'ed to stable/7 in r216003) and the flowcontrol media option
now should be set as desired via ifconfig(8) instead.
2010-11-28 16:03:03 +00:00
Marius Strobl 1ab442be78 MFC: r215906
Fix and implement missing parts of flow control support. This also removes
the dev.fxp.%d.noflow tunable as the same effect can now be achieved with
ifconfig(8) by setting the flowcontrol media option as desired (besides
the tunable never having a chance to actually enable flow control support
so far).
In joint forces with:	yongari
2010-11-28 15:59:45 +00:00
Marius Strobl 8ac424ed08 MFC: r215905
Ensure Bay flow control is disabled as we're going to use IEEE 802.3 annex
31B full duplex flow control instead.
2010-11-28 15:57:26 +00:00
Bjoern A. Zeeb 84345413ac Make stable/7 LINT compile again unbreaking the if_lem polling interface
implementation (returning void rather than int).
2010-11-28 14:55:00 +00:00
Simon L. B. Nielsen f518f1a9d5 Merge OpenSSL 0.9.8p into stable/7.
This merges up to and including head/crypto/openssl/ r215697; and
head/secure/lib/libcrypto/, head/secure/lib/libssl/,
head/secure/usr.bin/openssl/ r215698.

To make the merge simpler, a hack was added to set MACHINE_CPUARCH.

A few old OpenSSL security fixes are still the stable/7 tree - these
will be backed out to the vendor version shortly.

Security:	CVE-2010-2939, CVE-2010-3864
Security:	http://www.openssl.org/news/secadv_20101116.txt
Security:	FreeBSD-SA-10:10.openssl
Approved by:	re (implicitly - they did not object of the general idea
		of OpenSSL update)
2010-11-28 13:45:51 +00:00
Bjoern A. Zeeb b19efb41b3 MFC r215559:
In case of an early return from the function there is no need to zero
  the route upfront, so defer as long as we can.
2010-11-28 13:01:10 +00:00
Martin Matuska 84c23723b4 MFC r213634, r213673:
MFC r213634:
Change FAPPEND to IO_APPEND as this is a ioflag and not a fflag.
This corrects writing to append-only files on ZFS.

MFC r213673 (pjd):
Provide internal ioflags() function that converts ioflag provided by FreeBSD's
VFS to OpenSolaris-specific ioflag expected by ZFS. Use it for read and write
operations.

PR:		kern/149495 [1], kern/151082 [2]
Submitted by:	Daniel Zhelev <[email protected]> [1], Michael Naef <[email protected]> [2]
Reviewed by:	mm (r213673)
Approved by:	delphij (mentor)
2010-11-28 10:05:26 +00:00
Brian Somers d56204f48f MFC r21584: Don't zero 'Info' after setting it up in the ASR_IOCTL_COMPAT case. 2010-11-27 21:20:51 +00:00
Jack F Vogel 553ab7d812 Correct em_poll type for stable/7 2010-11-27 18:18:09 +00:00
Xin LI 2cc6890dbc MFC r215236:
Sync with OpenBSD, primarily better signal and terminal handling.

Obtained from:	OpenBSD
2010-11-27 06:35:15 +00:00
Jack F Vogel 8fbcda7c04 Add missing shared code files. 2010-11-27 04:46:16 +00:00
Lawrence Stewart a40526ec06 MFC r215553:
Fix a minor code redundancy nit.
2010-11-27 03:46:32 +00:00
Lawrence Stewart d2aa905bc8 Partially MFC r215166:
Disable priming the congestion window from the host cache. The current method
interacts poorly with delayed ack amongst other things, resulting in undesired
delay during a connection's opening slow start.  Even if we did fix the issues,
the current method is still dubious at best and needs to be thought through
thoroughly.

Due to a mistake on my behalf, the change described above was committed to head
as part of a larger patch in revision 215166. Instead of waiting for the MFC of
215166, I'm merging just this small portion for the upcoming release without
bringing the mergeinfo for r215166 along. The mergeinfo will sort itself out
when r215166 is eventually merged.

This is an intentional direct commit to the 7-STABLE branch.

Reported by:    Maxim Dounin <mdounin at mdounin ru> and others
Submitted by:   andre
2010-11-27 03:12:39 +00:00
Jack F Vogel 560747b628 MFC: r214646, r215781, r215789, 215808
Brings 7.4 e1000 drivers to the same level as 8.2
2010-11-27 01:09:54 +00:00
Andriy Gapon c3b293be20 add UPDATING entry for amd64 minidump version 2
This is a direct commit.
2010-11-26 22:31:56 +00:00
Marius Strobl e42b691dcf MFC: r215780
Remove the description of the link0 link option, since r215297 (merged to
stable/7 in r215879) the master media option generally should be used
instead.

This is MFC'ed in order to discourage the use of the link0 link option,
although it's still available in stable/7).
2010-11-26 21:32:21 +00:00
Marius Strobl cecbb68f25 MFC: r215721
- Fix and enable support for flow control.
- Fix compilation with CAS_DEBUG defined.
2010-11-26 21:07:20 +00:00
Marius Strobl 2a73789642 MFC: r215768
- Sprinkle const on tables.
- Remove an alpha remnant.
- Minor comment and style fixes.
2010-11-26 21:02:54 +00:00
Marius Strobl 03e0f1cecf MFC: r215722
- Fix and enable support for flow control.
- Partially revert r172334; as it turns out the DELAYs in gem_reset_{r,t}x()
  are actually necessary although bus space barriers and gem_bitwait() are
  used, otherwise the controller may trigger an IOMMU errors on at least
  sparc64. This is in line with what Linux and OpenSolaris do.
2010-11-26 21:01:21 +00:00
Marius Strobl 30b098ec63 MFC: r215720
- Also probe BCM5214 and BCM5222.
- Add some DSP init code for BCM5221. The values derived from Apple's GMAC
  driver and the same init code also exists in Linux's sungem_phy driver.
- Only read media status bits when they are valid.

Obtained from:	NetBSD, OpenBSD
2010-11-26 20:59:43 +00:00
Marius Strobl 2236b9902a MFC: r215711
Add missing newlines.
2010-11-26 20:57:48 +00:00
Marius Strobl 21deedda73 MFC: r215302
Move the limiting of the PHY to 10/100 modes of operation due to limitations
of certain MAC models from brgphy(4) to bge(4) where it belongs. While at it,
update the list of models having that restriction to what OpenBSD uses, which
in turn seems to have obtained that information from the Linux tg3 driver.
2010-11-26 20:55:59 +00:00
Marius Strobl c4ca8f2bc9 MFC: r215298, r215459, r215714, r215716
- Change these drivers to take advantage and use the generic IEEE 802.3
  annex 31B full duplex flow control as well as the IFM_1000_T master
  support committed in r215297 (merged to stable/7 in r215879). For
  atphy(4) and jmphy(4) this includes changing these PHY drivers to no
  longer unconditionally advertise support for flow control but only if
  the selected media has IFM_FLOW set (or MIIF_FORCEPAUSE is set).
- Rename {atphy,jmphy}_auto() to {atphy,jmphy}_setmedia() as these handle
  other media types as well.

Reviewed by:	yongari (plus additional testing)
Obtained from:	NetBSD (partially), OpenBSD (partially)
2010-11-26 20:45:52 +00:00
Marius Strobl 277197cd7e MFC: r214608, r215297(partial), r215713
o Flesh out the generic IEEE 802.3 annex 31B full duplex flow control
  support in mii(4):
  - Merge generic flow control advertisement (which can be enabled by
    passing by MIIF_DOPAUSE to mii_attach(9)) and parsing support from
    NetBSD into mii_physubr.c and ukphy_subr.c. Unlike as in NetBSD,
    IFM_FLOW isn't implemented as a global option via the "don't care
    mask" but instead as a media specific option this. This has the
    following advantages:
    o allows flow control advertisement with autonegotiation to be
      turned on and off via ifconfig(8) with the default typically
      being off (though MIIF_FORCEPAUSE has been added causing flow
      control to be always advertised, allowing to easily MFC this
      changes for drivers that previously used home-grown support for
      flow control that behaved that way without breaking POLA)
    o allows to deal with PHY drivers where flow control advertisement
      with manual selection doesn't work or at least isn't implemented,
      like it's the case with brgphy(4), e1000phy(4) and ip1000phy(4),
      by setting MIIF_NOMANPAUSE
    o the available combinations of media options are readily available
      from the `ifconfig -m` output
  - Add IFM_FLOW to IFM_SHARED_OPTION_DESCRIPTIONS and IFM_ETH_RXPAUSE
    and IFM_ETH_TXPAUSE to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so
    these are understood by ifconfig(8).
o Make the master/slave support in mii(4) actually usable:
  - Change IFM_ETH_MASTER from being implemented as a global option via
    the "don't care mask" to a media specific one as it actually is only
    applicable to IFM_1000_T to date.
  - Let mii_phy_setmedia() set GTCR_MAN_MS in IFM_1000_T slave mode to
    actually configure manually selected slave mode (like we also do in
    the PHY specific implementations).
  - Add IFM_ETH_MASTER to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so it
    is understood by ifconfig(8).
o Switch bge(4), bce(4), msk(4), nfe(4) and stge(4) along with brgphy(4),
  e1000phy(4) and ip1000phy(4) to use the generic flow control support
  instead of home-grown solutions via IFM_FLAGs. This includes changing
  these PHY drivers and smcphy(4) to no longer unconditionally advertise
  support for flow control but only if the selected media has IFM_FLOW
  set (or MIIF_FORCEPAUSE is set) and implemented for these media variants,
  i.e. typically only for copper.
o Switch brgphy(4), ciphy(4), e1000phy(4) and ip1000phy(4) to report and
  set IFM_1000_T master mode via IFM_ETH_MASTER instead of via IFF_LINK0
  and some IFM_FLAGn.
o Switch brgphy(4) to add at least the the supported copper media based on
  the contents of the BMSR via mii_phy_add_media() instead of hardcoding
  them. The latter approach seems to have developed historically, besides
  causing unnecessary code duplication it was also undesirable because
  brgphy_mii_phy_auto() already based the capability advertisement on the
  contents of the BMSR though.
o Let brgphy(4) set IFM_1000_T master mode on all supported PHY and not
  just BCM5701. Apparently this was a misinterpretation of a workaround
  in the Linux tg3 driver; BCM5701 seem to require RGPHY_1000CTL_MSE and
  BRGPHY_1000CTL_MSC to be set when configuring autonegotiation but
  this doesn't mean we can't set these as well on other PHYs for manual
  media selection.
o Let ukphy_status() report IFM_1000_T master mode via IFM_ETH_MASTER so
  IFM_1000_T master mode support now is generally available with all PHY
  drivers.
o Don't let e1000phy(4) set master/slave bits for IFM_1000_SX as it's
  not applicable there.

Reviewed by:	yongari (plus additional testing)
Obtained from:	NetBSD (partially), OpenBSD (partially)

Unlike as in head, bge(4), bce(4), msk(4), nfe(4) and stge(4) are changed
to set MIIF_FORCEPAUSE in stable/7 so they continue to always advertise
support of flow control and brgphy(4), ciphy(4), e1000phy(4) as well as
ip1000phy(4) are changed to still also accept IFF_LINK0 in addition to
the master media option for setting master mode, both in order to not
violate POLA.
2010-11-26 19:48:27 +00:00
Andriy Gapon 09aca770f4 MFC r215131: make it possible to actually enable hwpstate_verbose 2010-11-26 17:14:38 +00:00
Andriy Gapon 6dbe22e4f9 MFC r215133: amd64: introduce minidump version 2
This should reduce size of the minidump.
Compatibility with version 1 should be preserved in libkvm.
2010-11-26 16:24:55 +00:00
Xin LI f65c740bd0 MFC r214426: Add a short note about kernel modules in FIXIT mode. 2010-11-26 02:18:52 +00:00
Brian Somers 7d436656a9 MF8: Don't abend if we get ENOMEM from sysctl(3). The data returned
is sufficient
2010-11-25 21:42:36 +00:00
Xin LI a19bc4f888 MFC r215234:
Update to vendor release 1.20.00.19.

Bug fixes:
  * Fixed "inquiry data fails comparion at DV1 step"
  * Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B
  * Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0

Many thanks to Areca for continuing to support FreeBSD.

MFC r215280:

Workaround build for PAE case for now - revert the PHYS
case to previous panic behavior.
2010-11-25 20:09:56 +00:00
Marius Strobl a06edd9992 MFC: r215259, r215272
- When printing media with more than one media option set aggregate these
  in a comma delimited list instead of repeating "mediaopt" for each one.
  This matches how the options of the active media are printed with
  print_media_word() and brings us in line what NetBSD does.
- When setting a media with no sub-type specified also reset the type
  specific options along with the global ones so these options don't
  stick when f.e. switching to IFM_AUTO.
2010-11-25 18:33:44 +00:00
Rebecca Cran 53f781b8db MFC r215637:
dispatch_add_command:
Modify the logic so there's only one exit point instead of two.
Only insert valid (non-NULL) values into the queue.

dispatch_free_command:
Ensure that item is not NULL before removing it from the queue and
dereferencing the pointer.
NULL out free'd pointers to catch any use-after-free bugs.

PR:	bin/146855
Submitted by:	gcooper
2010-11-24 21:58:15 +00:00
Kirk McKusick 5b005392d3 MFC of 215576
Delete /sys/ufs/ffs/README.snapshot as it is no longer relevant.
Drop reference to it in mount(8).

Reported by: Bruce Cran <[email protected]>
PR: docs/128325
2010-11-24 00:00:32 +00:00
Brian Somers 12f2da46bc MFC r197763, r198236, r212839 and r212886:
Handle extending a filesystem into unzeroed storage.
2010-11-23 21:45:14 +00:00
Ulrich Spörlein 9f9a8cc187 MFC r214237,214489:
Remove mention of non-existant -o flag for debugging options.

Fix CPU load reporting independent of scheduler used.
- Sample CPU usage data from kern.cp_times, this makes for a far more
  accurate and scheduler independent algorithm.
- Rip out the process list scraping that is no longer required.
- Don't update CPU usage sampling on every request, but every 15s
  instead. This makes it impossible for an attacker to hide the CPU load
  by triggering 4 samplings in short succession when the system is idle.
- After reaching the steady-state, the system will always report the
  average CPU load of the last 60 sampled seconds.
- Untangling of call graph.
2010-11-23 21:36:53 +00:00
Pyun YongHyeon 7093903a73 MFC r215353,215355:
r215353:
  Plug memory leakage introduced in r204989.

  Reported by:	yongari
r215355:
  Restore the previous behaviour of substring match.
2010-11-23 19:23:47 +00:00
Pyun YongHyeon 2e523ca9f1 MFC r215327,215350:
r215327:
  P5N32-SLI PREMIUM from ASUSTeK is known to have MSI/MSI-X issue
  such that nfe(4) does not work with MSI-X. When MSI-X support was
  introduced, I remember MCP55 controller worked without problems so
  the issue could be either PCI bridge or BIOS issue. But I also
  noticed snd_hda(4) disabled MSI on all MCP55 chipset so I'm still
  not sure this is generic issue of MCP55 chipset. If this was PCI
  bridge issue we would have added it to a system wide black-list
  table but it's not clear to me at this moment whether it was caused
  by either broken BIOS or silicon bug of MCP55 chipset.

  To workaround the issue, maintain a MSI/MSI-X black-list table in
  driver and lookup base board manufacturer and product name from the
  table before attempting to use MSI-X. If driver find an matching
  entry, nfe(4) will not use MSI/MSI-X and fall back on traditional
  INTx mode. This approach should be the last resort since it relies
  on smbios and if another instance of MSI/MSI-X breakage is reported
  with different maker/product, we may have to get the PCI bridge
  black-listed instead of adding an new entry.

  PR:	kern/152150

r215350:
  Plug memory leakage introduced in r215327.

  Submitted by:	jkim
2010-11-23 19:14:17 +00:00
Ulrich Spörlein d91b4b7bb1 MFC r215237: Fix bug in jn(3) and jnf(3) that led to -inf results 2010-11-23 18:48:57 +00:00
Sergey Kandaurov bb02cd0159 MFC r215176:
Stop documenting vgonel() after its converting to the static function:
  svn r147332 (by jeff): "Don't make vgonel() globally visible".
 While here, specify the vnode locking scheme for vgone().

MFC r176604 (by davidc):

 Minor grammar fixup.

Approved by:	avg (mentor), kib (mentor)
2010-11-23 11:41:40 +00:00
Fabien Thomas 1fe3daaa18 MFC 200669:
Recognize Intel CPUs with Family 0x6, Models 0x1E and 0x1F.
2010-11-23 09:17:00 +00:00
Kirk McKusick d0fa027d5a MFC of 213119
Reported problem:
Large (60GB) filesystems created using "newfs -U -O 1 -b 65536 -f 8192"
show incorrect results from "df" for free and used space when mounted
immediately after creation. fsck on the new filesystem (before ever
mounting it once) gives a "SUMMARY INFORMATION BAD" error in phase 5.

This error hasn't occurred in any runs of fsck immediately after
"newfs -U -b 65536 -f 8192" (leaving out the "-O 1" option).

Solution:
The default UFS1 superblock is located at offset 8K in the filesystem
partition; the default UFS2 superblock is located at offset 64K in
the filesystem partition. For UFS1 filesystems with a blocksize of
64K, the first alternate superblock resides at 64K which is the the
location used for the default UFS2 superblock. By default, the
system first checks for a valid superblock at the default location
for a UFS2 filoesystem. For a UFS1 filesystem with a blocksize of
64K, there is a valid UFS1 superblock at this location. Thus, even
though it is expected to be a backup superblock, the system will
use it as its default superblock. So, we have to ensure that all the
statistcs on usage are correct in this first alternate superblock
as it is the superblock that will actually be used.

While tracking down this problem, another limitation of UFS1 became
evident. For UFS1, the number of inodes per cylinder group is stored
in an int16_t. Thus the maximum number of inodes per cylinder group
is limited to 2^15 - 1. This limit can easily be exceeded for block
sizes of 32K and above. Thus when building UFS1 filesystems, newfs
must limit the number of inodes per cylinder group to 2^15 - 1.

Reported by: Guy Helmer<[email protected]>
Followup by: Bruce Cran <[email protected]>
PR: 107692
2010-11-23 01:32:44 +00:00
Max Laier ecb82ac830 MFH r215508:
Off by one page in vm_reserv_reclaim_contig(): reclaim reservations with
  only a single free page as well.

  Reviewed by:	alc
2010-11-22 21:22:08 +00:00
Ken Smith 3f677f374f We're a bit under a week from Code Freeze for the upcoming 7.4-RELEASE
cycle.  Warn people tracking stable/7 that the branch may be more
active than usual.
2010-11-22 16:10:54 +00:00
Brian Somers 4e89abacba MFC r212247 & r212724 from head:
Handle geli-encrypted root disk devices.
    Add support for identifying a journaled root filesystem.
    Fix support for identifying the given /dev/vinum/root example.
2010-11-22 09:34:38 +00:00
Alan Cox 4804cc4e6d MFC r204415, r204416, r209669
Improve the comment and man page for vm_page_alloc().
2010-11-22 07:17:27 +00:00
Doug Barton a37804137c MFC 215334:
Remove references to MAKEDEV(8)
2010-11-22 00:44:43 +00:00
Doug Barton cfdd22c17c MFC 215250:
Remove references to the long-gone ramdisk

Submitted by:	Garrett Cooper <[email protected]>
2010-11-22 00:12:24 +00:00
Jilles Tjoelker 9cbdf40ca3 MFC r215211: echo(1): Clarify portability and mention literal "--" handling. 2010-11-21 17:14:22 +00:00
Jilles Tjoelker 9360e116c9 MFC r215184: sh: Remove unused man page for echo builtin.
The information in sh(1) about the echo builtin is equivalent, though less
extensive.

The echo(1) man page (bin/echo/echo.1) is different.

Unfortunately, sh's echo builtin and /bin/echo have gone out of sync and
this probably cannot be fixed any more.
2010-11-21 17:12:27 +00:00
Rebecca Cran d6921b2b1b MFC r215286:
Connect to ftp2.tr.freebsd.org when the Turkey #2 mirror is selected.

PR:	bin/128587
Submitted by: 	Mehmet Kose <mehmet.kose at gmail.com>

MFC r215287:

"Web" should not be all upper-case because it's not an acronym.

PR:	bin/130366
Submitted by:	Royce Williams <royce at alaska.net>

MFC r215290:

ntpdate(8) hosts are now configured in rc.conf via ntpdate_hosts.

PR:	bin/148350
Submitted by: Joel FAEDI <joel.faedi at gmail.com>

MFC r215296:

Fix use of CD_VERSION=any in cdrom.inf by calling strcmp instead of
variable_cmp.

PR:	bin/142960
Submitted by: G. Paul Ziemba <p-fbsd-bugs at ziemba.us>
2010-11-21 13:22:05 +00:00
Rebecca Cran 0b53196b80 MFC r215284, r215285:
When rebooting the machine jump to 0xf000:0xfff0 instead of 0xffff:0x0.
This is the same change that was made in rev 1.33 of boot/i386/btx/btx.S.

PR:	i386/91871
Submitted by:	Bjorn Konig <bkoenig at cs.tu-berlin.de>
2010-11-21 13:11:50 +00:00
Bernhard Schmidt bb7c70be7a Revert r215619, ABI breakage ahead.
Pointy hat to:	me
2010-11-21 12:33:11 +00:00
Bernhard Schmidt 84dccc3ede MFC r199076:
The isr_intval in ieee80211req_scan_result structure should be 16 bit.
This makes ifconfig list scan display the correct beacon interval
(previously it would int overflow). As a side effect, this makes the
ieee80211req_scan_result word aligned.

Submitted by:	Paul B Mahol <onemda at gmail.com>
Committed by:	rpaulo
2010-11-21 10:58:37 +00:00
Bernhard Schmidt b7a903fd28 MFC r200242:
Fix typo in comment

Submitted by:	Paul B Mahol <onemda at gmail.com>
Committed by:	rpaulo
2010-11-21 10:56:04 +00:00
Bernhard Schmidt 5e32fcbfc7 MFC r207322:
Fix typo. No functional change.

Obtained from:	DragonFlyBSD
Committed by:	rpaulo
2010-11-21 10:52:47 +00:00
Marius Strobl 82960f324a MFC: r215325
Use the correct variable for determining the verbosity level in mpt_lprtc().
While at it, fix the whitespace of that macro.

PR:		149502
Submitted by:	Andrew Boyer
2010-11-21 00:53:27 +00:00
Marius Strobl 331a8a3146 MFC: r215295
Let cryptosoft(4) add its pseudo-device with a specific unit number and its
probe method return BUS_PROBE_NOWILDCARD so it doesn't get attached to real
devices hanging off of nexus(4) with no specific devclass set. Actually, the
more desirable fix for this would be to get rid of the newbus interface of
cryptosoft(4) altogether but apparently crypto(9) was written with support
for cryptographic hardware in mind so that approach would require some KPI
breaking changes which don't seem worth it.
2010-11-21 00:50:31 +00:00
Marius Strobl fb390151e4 MFC: r215093
Enable reservation-based physical memory allocation.  Even without the
creation of large page mappings in the pmap, it can provide modest
performance benefits.  In particular, for a "buildworld" on a 2x 1GHz
Ultrasparc IIIi it reduced the wall clock time by 2.2% and the system
time by 12.6%.

Tested by:	marius@
2010-11-21 00:45:24 +00:00
Jilles Tjoelker c6627208f2 MFC r215022: test: Move tests to tools/regression/bin/test.
Convert the tests to the perl prove format.
Remove obsolete TEST.README (results of an old TEST.sh for some old Unices)
and TEST.csh (old tests without correct values, far less complete than
TEST.sh).
2010-11-20 16:56:39 +00:00
Bernhard Schmidt cc79e1cfe5 MFC r201793:
Fix #ifdefs so that GCC 4.4 doesn't complain about it.

Committed by:	trasz
2010-11-20 13:30:48 +00:00
Bernhard Schmidt fff20a1483 MFC r203673:
Ensure that tkip_mixing_phase1() is called after a rekeying event when
using plain s/w crypto.
2010-11-19 18:59:35 +00:00
Marius Strobl ce967f9abb MFC: r176965
Any driver that relies on its parent to set the devclass has no way to
know if has siblings that need an actual probe.  Introduce a specail
return value called BUS_PROBE_NOOWILDCARD.  If the driver returns
this, the probe is only successful for devices that have had a
specific devclass set for them.

Reviewed by: current@, jhb@, grehan@
2010-11-19 17:24:03 +00:00
John Baldwin 575641b296 MFC 204352, 208028, 209266, 209399, 210723, 213672, 215046:
- Fixed static linkage.
- Document that mptutil/mpt do not support RAID volumes in excess of 2TB.
- Report subcommand handler errors so that tools that invoke mptutil can
  robustly report errors.
- Save errno values before calling warn(3) so that errors are correctly
  reported.
- Check for malloc() failures.
2010-11-19 17:08:29 +00:00
Marius Strobl 589dcb3e20 MFC: r215300
Remove redundant cases and a style(9) bug.
2010-11-19 17:07:33 +00:00
Marius Strobl 1645201dc2 MFC: r214879
Implement pmap_is_prefaultable().

Reviewed by:	alc (with bugfix)
2010-11-19 17:04:57 +00:00
John Baldwin 14a51fa0af MFC 215001:
Only dump the values of the PMC and CMCI local vector table entries on a
local APIC if those LVT entries are valid.  This quiets spurious illegal
register local APIC errors during boot on a CPU that doesn't support those
vectors.
2010-11-19 16:26:51 +00:00
Xin LI 71bd208837 RELENG_7 does not have IP_BINDANY yet so hide it under ifdef.
Reported by:	tinderbox
2010-11-19 09:59:41 +00:00
Jaakko Heinonen 25646695d7 MFC r215235:
Set FD_CLOEXEC for the output file only when the file has been specified
with the -o option. Setting the flag for stderr (the default) could
cause the traced process to redirect stderr to a random file.

PR:		bin/152151
2010-11-18 19:08:56 +00:00
Marius Strobl 0e36ba3353 MFC: r215348
Return from mii_attach() after calling bus_generic_attach(9) on the device_t
of the MAC driver in order to attach miibus(4) on the first pass instead of
falling through to also calling it on the device_t of miibus(4). The latter
code flow was intended to attach the PHY drivers the same way regardless of
whether it's the first or a repeated pass, modulo the bus_generic_attach()
call in miibus_attach() which shouldn't be there. However, it turned out
that these variants cause miibus(4) to be attached twice under certain
conditions when using MAC drivers as modules.

Submitted by:	yongari
2010-11-18 18:05:59 +00:00
Pyun YongHyeon 2febf31c55 MFC r215132,215194:
r215132:
  Add basic WOL support for MCP ethernet controllers. It seems the
  controller does not perform automatic switching from 1000Mbps link
  to 10/100Mbps link when WOL is activated. Implement establishing
  10/100Mps link with auto-negotiation in driver. Link status change
  handler was modified to remove taskqueue based approach since driver
  now needs synchronous handling for link establishment.

  Submitted by:	Yamagi Burmeister (lists <> yamagi.org ) (initial version)
  Tested by:	Yamagi Burmeister (lists <> yamagi.org )

r215194:
  Fix regression introduced in r215132. Caller always holds a driver
  lock before accessing mii, so locking is not needed here.

  Reported by:	Rob Farmer (rfarmer <> predatorlabs dot net)
2010-11-18 17:49:24 +00:00
Xin LI 7ae09a6270 MFC through r214047: nc from OpenBSD 4.8. 2010-11-18 01:21:55 +00:00
Jilles Tjoelker 96bd55f797 MFC r198406: wordexp(3): fix some bugs with signals and long outputs
* retry various system calls on EINTR
* retry the rest after a short read (common if there is more than about 1K
  of output)
* block SIGCHLD like system(3) does (note that this does not and cannot
  work fully in threaded programs, they will need to be careful with wait
  functions)

PR:		90580
2010-11-17 21:45:11 +00:00
Jilles Tjoelker 2ee3cee237 MFC r174692: Fix wordexp() testsuite.
Original commit by das.
2010-11-17 20:21:10 +00:00
Alan Cox 81a94910c3 MFC r209407, r209648, r209650
Introduce and use vm_page_next() and vm_page_prev().  They provide both
  a simpler and faster interface for iterating over the pages of an object.
2010-11-17 18:21:29 +00:00
Sergey Kandaurov ef51946ac8 MFC r215186:
Add 'jid' as a possible sort order to the help screen.

PR:		bin/150992
Submitted by:	Frederic Culot <frederic at culot dot org>
Approved by:	avg (mentor)
2010-11-17 09:49:51 +00:00
Pyun YongHyeon c81956af7e MFC r215018-215020:
r215018:
  Consistently use tab character instead of using space character.
  No functional changes.

r215019:
  Remove trailing white spaces.

r215020:
  Remove standard PCI configuration space register definitions.
2010-11-16 20:38:41 +00:00
Pyun YongHyeon 15cb872d5d MFC r215017,215025:
Follow the lead of vendor's interrupt moderation mechanism.
  It seems RTL8169/RTL8168/RTL810xE has a kind of interrupt
  moderation mechanism but it is not documented at all. The magic
  value dramatically reduced number of interrupts without noticeable
  performance drops so apply it to all RTL8169/RTL8169 controllers.
  Vendor's FreeBSD driver also applies it to RTL810xE controllers but
  their Linux driver explicitly cleared the register, so do not
  enable interrupt moderation for RTL810xE controllers.

  While I'm here sort 8169 specific registers.

  Obtained from:	RealTek FreeBSD driver

MFC r215025:
  Only moderate TX completion interrupts. Relying on taskqueue to
  suppress RX interrupts seems to give better RX performance than
  RX interrupt moderation.
2010-11-16 20:34:00 +00:00
Pyun YongHyeon 633aa0cf82 MFC r214992:
Reduce spin wait time consumed in GMII register access routine.
  There were a couple of attempts in the past to reduce it since it
  took more than 1ms. Because mii_tick() periodically polls link
  status, waiting more than 1ms for each GMII register access was
  overkill. Unfortunately all previous attempts were failed with
  various ways on different controllers.
  This time, add additional 20us dealy at the end of GMII register
  access which seems to requirement of all RealTek controllers to
  issue next GMII register access request. This is the same way what
  Linux does.
2010-11-16 20:27:01 +00:00
Maxim Sobolev a981a16bd2 Fix build problem introduced in r215368 MFC when IPX is enabled.
Submitted by:	des
2010-11-16 15:02:53 +00:00
Rebecca Cran 1077a65977 MFC r214021:
Fix grammar.
2010-11-16 07:39:52 +00:00
Rebecca Cran e0f253fecf MFC r213763:
Use the RFC2606 domain example.com in examples.
2010-11-16 07:35:29 +00:00
Rebecca Cran 846c7bce62 MFC r215239:
Memory stats are reported in bytes, not pages.

PR:	docs/151283
Submitted by:	Bas Smeelen <b.smeelen at ose.nl>
2010-11-16 07:26:49 +00:00
Rebecca Cran f4c8d6b3aa MFC r215263:
Add ftp4.se.freebsd.org to the set of mirrors.

PR:	bin/150552
Submitted by:	Niclas Zeising <zeising at lysator.liu.se>
2010-11-16 07:19:05 +00:00
Alan Cox 9635304928 MFC r213455
Initialize KPTmap in locore so that vm86.c can call vtophys() (or really
  pmap_kextract()) before pmap_bootstrap() is called.

  Document the set of pmap functions that may be called before
  pmap_bootstrap() is called.
2010-11-16 06:20:12 +00:00
Alan Cox 80a33eedbb MFC r214938
Eliminate a possible race between pmap_pinit() and pmap_kenter_pde() on
  superpage promotion or demotion.

  Micro-optimize pmap_kenter_pde().
2010-11-16 05:01:27 +00:00
Alan Cox 1c935031b8 MFC r214953
In case the stack size reaches its limit and its growth must be
  restricted, ensure that grow_amount is a multiple of the page size.
  Otherwise, the kernel may crash in swap_reserve_by_uid() on HEAD and
  FreeBSD 8.x, and produce a core file with a missing stack on FreeBSD
  7.x.
2010-11-16 04:51:07 +00:00
Maxim Sobolev 33277cd93a MFC r207554:
Add new tunable 'net.link.ifqmaxlen' to set default send interface
    queue length. The default value for this parameter is 50, which is
    quite low for many of today's uses and the only way to modify this
    parameter right now is to edit if_var.h file. Also add read-only
    sysctl with the same name, so that it's possible to retrieve the
    current value.
2010-11-16 04:40:03 +00:00
Bjoern A. Zeeb 380e098510 MFC r214565:
Announce IPsec if available for feature_present(3) checks.
2010-11-16 03:20:57 +00:00
Pyun YongHyeon 230b69e24f MFC r214968:
Use shorten model name instead of showing all controller model
  numbers. bge(4) supports too many models such that it's
  unreasonable to list all these controllers in one line description
  of name. While I'm here mention that BCM590x/BCM5779x is Fast
  Ethernet controller.
  bge(4) still lacks support for some controllers but supporting
  these controllers should be easy now and adding new controllers
  do not require touching .Nd any more.

  Obtained from:	OpenBSD
2010-11-16 00:32:45 +00:00
Lawrence Stewart 758540dec0 MFC r215154:
The first releases SIFTR will ship in will be 7.4 and 8.2.
2010-11-16 00:06:19 +00:00
Lawrence Stewart 82ac5ac5d9 MFC r215153:
Standardise all Swinburne related copyright/licence statements throughout the
tree in preparation for another large code import. Swinburne University is the
legal entity that owns copyright and the 2-clause BSD licence is acceptable.
2010-11-16 00:00:31 +00:00
Lawrence Stewart 67f3c58540 MFC r215152:
The university does not require that its CRICOS number be included in source
code. Remove all references from the tree.
2010-11-15 23:57:06 +00:00
Marius Strobl 92db457017 MFC: r214940
Add gpart and glabel to the release CD mfsroot.
2010-11-13 13:46:33 +00:00
Pyun YongHyeon f3aafae4eb MFC r214844:
Add simple MAC statistics counter reading support. Unfortunately
  useful counters like rl_missed_pkts is 16 bits quantity which is
  too small to hold meaningful information happened in a second. This
  means driver should frequently read these counters in order not to
  lose accuracy and that approach is too inefficient in driver's
  view. Moreover it seems there is no way to trigger an interrupt to
  detect counter near-full or wraparound event as well as lacking
  clearing the MAC counters. Another limitation of reading the
  counters from RealTek controllers is lack of interrupt firing at
  the end of DMA cycle of MAC counter read request such that driver
  have to poll the end of the DMA which is a time consuming process
  as well as inefficient. The more severe issue of the MAC counter
  read request is it takes too long to complete the DMA. All these
  limitation made maintaining MAC counters in driver impractical. For
  now, just provide simple sysctl interface to trigger reading the
  MAC counters. These counters could be used to track down driver
  issues. Users can read MAC counters maintained in controller with
  the following command.
  #sysctl dev.re.0.stats=1

  While I'm here add check for validity of dma map and allocated
  memory before unloading/freeing them.

  Tested by:	rmacklem
2010-11-13 01:11:13 +00:00
Pyun YongHyeon 4592d773f1 MFC r214841-214842:
r214841:
  Remove extra white spaces.

r214842:
  style(9).
2010-11-13 01:07:45 +00:00
Pyun YongHyeon ebcfb21d77 MFC r214840:
Enable 64bit DMA addressing for RTL810xE/RTL8168/RTL8111 PCIe
  controllers. Some old PCI controllers may work with DAC but it was
  known to be buggy so 64bit DMA addressing is used only on PCIe
  controllers.
2010-11-13 01:03:33 +00:00
Pyun YongHyeon 8df636c829 MFC r214899:
Fix a long standing bug in programming station address for Yukon
  controllers. sk(4) never reprogrammed station address for Yukon
  controllers so overriding station address with ifconfig(8) was not
  possible.
  Fix the bug by reprogramming all registers that control station
  address, flow-control and virtual station address. Virtual station
  address has no use at this moment since driver does not make use of
  fail over feature.

  Tested by:	"Mikhail T." <mi+thun <> aldan.algebra.com>
2010-11-13 01:00:00 +00:00
Pyun YongHyeon b5a35d64cc MFC r214898:
If we got an invalid station address, generate random address. This
  might be caused by broken BIOS.

  Reported by:	"Mikhail T." <mi+thun <> aldan.algebra.com>
2010-11-13 00:55:16 +00:00
Matthew D Fleming d540aa917b MFC r213813. This is a direct commit because the diff is against
several non-MFC'd changes.

Use a safer mechanism for determining if a task is currently running,
that does not rely on the lifetime of pointers being the same. This
also restores the task KBI.
2010-11-12 18:10:27 +00:00
Xin LI d85a770dbe MFC r214854:
Validate whether the zfs_cmd_t submitted from userland is not smaller than
what we have.  Without the check the kernel could accessing memory that
does not belong to the request struct.

Note that we do not test if the struct equals in size at this time, which
may faciliate forward compatibility with newer binaries.
2010-11-12 01:45:29 +00:00
Marius Strobl e59d324c61 MFC: r208459, r208511, r214873
- Move Sun Fire V240 to the list of known working machines.
- For the parallel stable/7 and stable/8 branches mention both releases that
  first supported a particular sparc64 machine and update the sparc64 hardware
  list regarding machines that were supported beginning with 8.1-RELEASE and
  will be supported beginning with 8.1-RELEASE.
2010-11-09 21:00:51 +00:00
Jean-Sébastien Pédron db53593b0d MFC r214893:
Fix a segmentation fault in argument processing.

The crash was caused by a command line such as this one:
# fold -b1

PR:		bin/151592
Reported by:	Marcus Reid <[email protected]>
Tested by:	Marcus Reid <[email protected]>
2010-11-09 20:56:55 +00:00
Ulrich Spörlein a9a4cf3f00 MFC r173289,174783,175454,191681,191698,191834,195044,197304,198210,199858-199859,201348,205578,208327,208336,210871,214628:
Sync bsd-family-tree with head.
2010-11-08 20:21:24 +00:00
Pyun YongHyeon 87f107bf30 MFC r214542:
Don't bother to enable ASPM L1 to save more power. Even though I am
  not able to trigger the issue with sample boards, some users seems
  to suffer from freeze/lockup when system is booted without UTP cable
  plugged in. I'm not sure whether this is BIOS issue or controller
  bug. This change fixes AR8132 lockup issue seen on EEE PC.

  Reported by:	kmoore
  Tested by:	kmoore
2010-11-08 20:16:42 +00:00
Pyun YongHyeon b897327cfe MFC r214428:
Add initial BCM5718 family support. The BCM5718 family includes
  the dual port BCM5717 and BCM5718 devices which are intended for
  mainstream workstation and entry-level server designs and
  represents the twelfth generation of NetXtreme Ethernet controllers.
  This family is the successor to the BCM5714/BCM5715 family and
  supports IPv4/IPv6 checksum offloading, TSO, VLAN hardware tagging,
  jumbo frames, MSI/MSIX, IOV, RSS and TSS.

  This change set supports all hardware features except IOV and
  RSS/TSS. Unlike its predecessors, only extended RX buffer
  descriptors can be posted to the jumbo producer ring. Single RX
  buffer descriptors for jumbo frame are not supported. RSS requires
  a more substantial set of changes and will apply to a larger set
  of NetXtreme devices so RSS/TSS multi-queue support will be
  implemented in a future releases.

  Special thanks to Broadcom who kindly sent a sample board to me
  and to davidch who gave provided the initial support code.

  Submitted by:	davidch (initial version)
  HW donated by:	Broadcom
2010-11-08 19:54:44 +00:00
Pyun YongHyeon d6c0f14923 MFC r213486:
Remove bge_tx_buf_ratio, unused member of softc.
2010-11-08 19:33:13 +00:00
Pyun YongHyeon 5164ef8d4b MFC r214427:
Add BCM5717C 10/100/1000TX PHY id.
2010-11-08 19:25:47 +00:00
Konstantin Belousov c9de83702b MFC r203072 (by rmacklem, to be reverted by MFC of r214026):
Fix a race that can occur when nfs nfsiod threads are being created.

MFC r212506:
Do not fork nfsiod directly from the vop methods.

MFC r214026:
Do not synchronously start the nfsiod threads at all.

Tested by:	jhb
2010-11-08 15:22:20 +00:00
Jilles Tjoelker d8ae88c811 MFC r214609: sh(1): Correct synopsis and make precise how $0 is set.
In particular, the extra argument to set $0 with -c was not documented.
2010-11-07 20:33:36 +00:00
Alan Cox 8aa65a37c4 MFC r214564
Correct some format strings used by sysctls.
2010-11-07 20:20:19 +00:00
Marius Strobl a60a82103b MFC: r214606
Try to make the style consistent (including regarding NetBSD bits not yet
merged) and adhere style(9).
2010-11-07 17:54:43 +00:00
Marius Strobl ae0c5ac79a MFC: r214528
- When resetting pm_active and pm_context of a pmap in pmap_pinit() we
  need locking as otherwise we may race against the other parts of the
  MD code which expects a consistent state of these. While at it move
  the resetting of the pmap before entering it in the TSB.
- Spell a 0 as TLB_CTX_KERNEL.
2010-11-07 17:50:55 +00:00
Marius Strobl 79bd758baf MFC: r214264
- Add IFM_10_2 and IFM_10_5 media via tlphy(4) only in case the respective
  interface also has such connectors.
- In tl_attach() unify three different ways of obtaining the device and
  vendor IDs and remove the now obsolete tl_dinfo from tl_softc.
- Given that tlphy(4) only handles the integrated PHYs of NICs driven by
  tl(4) make it only probe on the latter.
- Switch mlphy(4) and tlphy(4) to use mii_phy_add_media()/mii_phy_setmedia().
- Simplify looking for the respective companion PHY in mlphy(4) and tlphy(4)
  by ignoring the native one by just comparing the device_t's directly rather
  than the device name.
2010-11-07 17:48:11 +00:00
Marius Strobl 6641474963 MFC: r214263
Take advantage of mii_phy_add_media()/mii_phy_setmedia().
2010-11-07 17:41:09 +00:00
Marius Strobl 5ef253ad32 MFC: r213894, r213896, r214913
Converted the remainder of the NIC drivers to use the mii_attach()
introduced in r213878 (MFC'ed to stable/7 in r214685) instead of
mii_phy_probe(). Unlike r213893 (MFC'ed to stable/7 in r214910)
these are mostly straight forward conversions though.
2010-11-07 17:38:54 +00:00
Marius Strobl 4aec302884 MFC: r213893, r213908, r214566, r214605, r214846
Convert the PHY drivers to honor the mii_flags passed down and convert
the NIC drivers as well as the PHY drivers to take advantage of the
mii_attach() introduced in r213878 (MFC'ed to stable/8 in r214685) to
get rid of certain hacks. For the most part these were:
- Artificially limiting miibus_{read,write}reg methods to certain PHY
  addresses; we now let mii_attach() only probe the PHY at the desired
  address(es) instead.
- PHY drivers setting MIIF_* flags based on the NIC driver they hang
  off from, partly even based on grabbing and using the softc of the
  parent; we now pass these flags down from the NIC to the PHY drivers
  via mii_attach(). This got us rid of all such hacks except those of
  brgphy() in combination with bce(4) and bge(4), which is way beyond
  what can be expressed with simple flags.

While at it, I took the opportunity to change the NIC drivers to pass
up the error returned by mii_attach() (previously by mii_phy_probe())
and unify the error message used in this case where and as appropriate
as mii_attach() actually can fail for a number of reasons, not just
because of no PHY(s) being present at the expected address(es).

Reviewed by:	jhb, yongari
2010-11-07 11:12:30 +00:00
Lawrence Stewart 2347dd66d8 Remove siis.4 from the man4/Makefile. It was incorrectly included in r214875 as
part of the SIFTR MFC and breaks buildworld as siis.4 doesn't exist in stable/7.

This is an intentional direct commit to the 7-STABLE branch.

Pointy hat to:	lstewart
Noticed by:	Michael Butler <imb at protected-networks dot net>
2010-11-07 01:19:40 +00:00
Bjoern A. Zeeb 6263d099cd MFC r214250:
Make the IPsec SADB embedded route cache a union to be able to hold both the
  legacy and IPv6 route destination address.
  Previously in case of IPv6, there was a memory overwrite due to not enough
  space for the IPv6 address.

PR:		kern/122565
2010-11-06 15:56:44 +00:00
Lawrence Stewart cd152b0979 MFC r213913:
Retire the system-wide, per-reassembly queue segment limit. The mechanism is far
too coarse grained to be useful and the default value significantly degrades TCP
performance on moderate to high bandwidth-delay product paths with non-zero loss
(e.g. 5+Mbps connections across the public Internet often suffer).

Replace the outgoing mechanism with an individual per-queue limit based on the
number of MSS segments that fit into the socket's receive buffer.  This should
strike a good balance between performance and the potential for resource
exhaustion when FreeBSD is acting as a TCP receiver. With socket buffer
autotuning (which is enabled by default), the reassembly queue tracks the socket
buffer and benefits too.

As the XXX comment suggests, my testing uncovered some unexpected behaviour
which requires further investigation. By using so->so_rcv.sb_hiwat instead of
sbspace(&so->so_rcv), we allow more segments to be held across both the socket
receive buffer and reassembly queue than we probably should. The tradeoff is
better performance in at least one common scenario, versus a devious sender's
ability to consume more resources on a FreeBSD receiver.

The base code from r213913 was modified as part of this MFC in order to work
correctly on FreeBSD 7.

Sponsored by:	FreeBSD Foundation
Reviewed by:	andre, gnn, rpaulo
2010-11-06 15:49:59 +00:00
Lawrence Stewart 331999b64f MFC r213912:
- Switch the "net.inet.tcp.reass.cursegments" and
  "net.inet.tcp.reass.maxsegments" sysctl variables to be based on UMA zone
  stats. The value returned by the cursegments sysctl is approximate owing to
  the way in which uma_zone_get_cur is implemented.

- Discontinue use of V_tcp_reass_qsize as a global reassembly segment count
  variable in the reassembly implementation. The variable was used without
  proper synchronisation and was duplicating accounting done by UMA already. The
  lack of synchronisation was particularly problematic on SMP systems
  terminating many TCP sessions, resulting in poor TCP performance for
  connections with non-zero packet loss.

The base code from r213912 was modified as part of this MFC in order to work
correctly on FreeBSD 7.

Sponsored by:	FreeBSD Foundation
Reviewed by:	andre, gnn, rpaulo (as part of a larger patch)
2010-11-06 15:40:34 +00:00
Lawrence Stewart 078b8c8551 MFC r213910:
- Simplify implementation of uma_zone_get_max.
- Add uma_zone_get_cur which returns the current approximate occupancy of a
  zone. This is useful for providing stats via sysctl amongst other things.

Sponsored by:	FreeBSD Foundation
Reviewed by:	gnn, jhb
2010-11-06 15:21:46 +00:00
Lawrence Stewart d41da25b6d MFC r209050 (originally committed by jhb):
Add helper macros to iterate over available CPUs in the system.
CPU_FOREACH(i) iterates over the CPU IDs of all available CPUs.  The
CPU_FIRST() and CPU_NEXT(i) macros can also be used to iterate over
available CPU IDs.  CPU_NEXT(i) wraps around to CPU_FIRST() rather than
returning some sort of terminator.

Requested by:	rwatson
Reviewed by:	attilio
2010-11-06 15:10:31 +00:00
Lawrence Stewart 27c744850c MFC r213162:
Log the number of segments currently in the reassembly queue.

Sponsored by:	FreeBSD Foundation
2010-11-06 14:53:22 +00:00
Lawrence Stewart ca3c08e118 MFC r210203:
- Move common code from the hook functions that fills in a packet node struct to
  a separate inline function. This further reduces duplicate code that didn't
  have a good reason to stay as it was.

- Reorder the malloc of a pkt_node struct in the hook functions such that it
  only occurs if we managed to find a usable tcpcb associated with the packet.

- Make the inp_locally_locked variable's type consistent with the prototype of
  siftr_siftdata().

Sponsored by:	FreeBSD Foundation
2010-11-06 14:49:10 +00:00
Lawrence Stewart 9911e5e8c7 MFC r211396 (originally committed by andre):
Add uma_zone_get_max() to obtain the effective limit after a call to
uma_zone_set_max().

The UMA zone limit is not exactly set to the value supplied but rounded up to
completely fill the backing store increment (a page normally).  This can lead to
surprising situations where the number of elements allocated from UMA is higher
than the supplied limit value.  The new get function reads back the effective
value so that the supplied limit value can be adjusted to the real limit.

The base code from r211396 was modified as part of this MFC in order to work
correctly on FreeBSD 7.

Reviewed by:	jeffr
2010-11-06 14:38:57 +00:00
Lawrence Stewart 140c0b07c4 MFC r213158:
Internalise reassembly queue related functionality and variables which should
not be used outside of the reassembly queue implementation. Provide a new
function to flush all segments from a reassembly queue and call it from the
appropriate places instead of manipulating the queue directly.

The base code from r213158 was modified as part of this MFC in order to work
correctly on FreeBSD 7.

Sponsored by:	FreeBSD Foundation
Reviewed by:	andre, gnn, rpaulo
2010-11-06 13:46:58 +00:00
Lawrence Stewart fe9dd40d13 MFC r209662,209665:
Import the Statistical Information For TCP Research (SIFTR) kernel module into
FreeBSD. SIFTR logs a range of statistics on active TCP connections to a log
file, providing the ability to make highly granular measurements of TCP
connection state. The tool is aimed at system administrators, developers and
researchers alike. Please take it for a spin and test it out - the man page
should have all the information required to get you going.

Many thanks go to the Cisco University Research Program Fund at Community
Foundation Silicon Valley and the FreeBSD Foundation. Their support of our work
at the Centre for Advanced Internet Architectures, Swinburne University of
Technology is greatly appreciated.

The base SIFTR code from r209662 was modified as part of this MFC in order to
work correctly on FreeBSD 7.

r209980:

Catch up with the rename of DPCPU_SUM to DPCPU_VARSUM.

r209982:

The SIFTR DPCPU statistics struct was not being zeroed between enable/disable
cycles so the values would accumulate rather than reset for each cycle.

Sponsored by:	Cisco URP (r209662), FreeBSD Foundation
Reviewed by:	dwmalone, gnn, rpaulo (r209662)
Tested by:	Many on freebsd-current@ and elsewhere over the years
2010-11-06 13:03:33 +00:00
Lawrence Stewart 3d6b8b6ae9 The kthread/kproc KPI differs between 7.x and 8.x+ and requires the use of
kthread_exit() in order to get a wakeup delivered to the "struct proc *" which
ALQ relies on.

This is an intentional direct commit to the 7-STABLE branch.
2010-11-06 12:41:47 +00:00
Lawrence Stewart d0e4ee4699 MFC r207223:
- Rework the underlying ALQ storage to be a circular buffer, which amongst other
  things allows variable length messages to be easily supported.

- Extend KPI with alq_writen() and alq_getn() to support variable length
  messages, which is enabled at ALQ creation time depending on the arguments
  passed to alq_open(). Also add variants of alq_open() and alq_post() that
  accept a flags argument. The KPI is still fully backwards compatible and
  shouldn't require any change in ALQ consumers unless they wish to utilise the
  new features.

- Introduce the ALQ_NOACTIVATE and ALQ_ORDERED flags to allow ALQ consumers to
  have more control over IO scheduling and resource acquisition respectively.

- Strengthen invariants checking.

- Document ALQ changes in ALQ(9) man page.

Sponsored by:	FreeBSD Foundation
Reviewed by:	gnn, jeff, rpaulo, rwatson
2010-11-06 11:38:40 +00:00
Lawrence Stewart ff65dac1f4 MFC r206028:
The ALQ should not be considered drained until it has been made inactive.

Sponsored by:	FreeBSD Foundation
Reviewed by:	dwmalone, jeff, rpaulo, rwatson (as part of a larger patch)
2010-11-06 11:23:46 +00:00
Lawrence Stewart f586609039 MFC r206027:
According to SLEEP(9), msleep() is deprecated in favour of mtx_sleep().

Sponsored by:	FreeBSD Foundation
Reviewed by:	dwmalone, jeff, rpaulo, rwatson (as part of a larger patch)
2010-11-06 11:20:20 +00:00
Lawrence Stewart 0a3b5621e9 MFC r206026:
- Factor code to destroy an ALQ out of alq_close() into a private alq_destroy().

- Use the new alq_destroy() to properly handle a failure case in alq_open().

Sponsored by:	FreeBSD Foundation
Reviewed by:	dwmalone, jeff, rpaulo, rwatson (as part of a larger patch)
2010-11-06 11:17:30 +00:00
Lawrence Stewart db596e2c14 MFC r205959:
Add support for ALQ(9) to be compiled and loaded as a kernel module.

Sponsored by:	FreeBSD Foundation
Reviewed by:	dwmalone, jeff, rpaulo, rwatson
2010-11-06 11:09:04 +00:00
John Baldwin 896ebd20bf MFC 214673: Fix a few typos and style nits in the example code. 2010-11-05 13:45:26 +00:00
Doug Barton 58b526a93a MFV version 9.4-ESV-R3
This version contains several fixes for DNSSEC and DLV, as well as
fixes relevant to any resolving name server.
2010-11-04 21:50:19 +00:00
John Baldwin 915db9a062 MFC 214625: Correct the abbreviations for general I/O and signal traces. 2010-11-04 17:25:40 +00:00
John Baldwin 5359876c04 MFC 214449:
Set bootverbose directly in mi_startup() rather than via a SYSINIT.  This
ensures 'bootverbose' is in a valid state for all SYSINITs.
2010-11-04 17:23:06 +00:00
John Baldwin d0b0356e0c MFC 214203:
- Add a new PCI quirk to whitelist an old chipset that doesn't support
  PCI-express or PCI-X capabilities if we are running in a virtual machine.
- Whitelist the Intel 82440 chipset used by QEMU.
2010-11-04 17:13:30 +00:00
John Baldwin a28e78eba6 MFC 211820,211821,212292:
Intel QPI chipsets actually provide extra "non-core" PCI buses that
provide PCI devices for various hardware such as memory controllers,
etc.  for each socket.  These PCI buses are not enumerated via ACPI
however.  Add qpi(4) psuedo bus and Host-PCI bridge drivers to
enumerate these buses.  Currently the driver uses the CPU ID to
determine the bridges' presence.
2010-11-04 17:07:13 +00:00
John Baldwin 5e837fd60f Trim unneeded mergeinfo from a file. 2010-11-03 15:31:10 +00:00
John Baldwin bc23ace1a2 MFC 213672,213674,214396:
- Report subcommand handler errors in mfiutil so that tools that
  invoke the utilities can robustly report errors.
- Fix compile with -DDEBUG by using the correct mfi_pd_ref union definition
  in mfireg.h.
- Save errno values before calling warn(3) so that errors are correctly
  reported.
- Use powerof2() from <sys/param.h> rather than a copy and paste version.
2010-11-03 15:25:40 +00:00
Ed Schouten 9770f16cc4 MFC r214105:
Remove setpgid() call before executing child process.

  Using a separate process group here is bad, since (for example) job
  control in the TTY layer prevents interaction with the TTY, causing the
  child process to hang.
2010-11-03 10:24:57 +00:00
Edwin Groothuis 272c35d8b9 MFC of r214002, r214010
- Stylify of uudecode(1)
  Part of PR bin/124739.

- "b64decode -r" did not handle arbitary breaks in base64 encoded
  data. White space should be accepted anywhere in a base64 encoded
  stream, not just after every chunk (4 characters).

  Test-scenario:

  VmVsb2NpdHkgUmV3YXJkcw==

  and

  VmVsb2NpdHkgUmV3YXJkcw
  ==

  should both produce "Velocity Rewards"

PR:             bin/124739
Submitted by:   Mark Andrews <[email protected]>
2010-11-03 10:12:13 +00:00
Edwin Groothuis 6d57fbe734 MFC of r214722, tzdata2010o:
- Fiji goes into DST three weeks earlier in 2011.
2010-11-03 01:32:44 +00:00
Pyun YongHyeon c5af29deb0 MFC r214432:
Use shorten model name and add RTL8168, RTL8111 to the list of
  supported device. re(4) had been supported all variants of RTL8168,
  RTL8111 and RTL810x. I think this change will cover all controllers
  supported by re(4).
2010-11-03 01:28:57 +00:00
Pyun YongHyeon 70a755e6ca MFC r214302:
Add TSO support over VLAN for i82550/i82551. Controller requires
  VLAN hardware tagging to make TSO work over VLAN. So if VLAN
  hardware tagging is disabled explicitly clear TSO over VLAN. While
  I'm here allow disabling VLAN TX checksum offloading.

  Tested by:	Liudas < liudasb <> centras dot lt >
2010-11-03 01:26:11 +00:00
Pyun YongHyeon c51a786543 MFC r214087,214219,214251,214292:
r214087:
  Add workaround for BCM5906 controller silicon bug. If device
  receive two back-to-back send BDs with less than or equal to 8
  total bytes then the device may hang. The two back-to-back send
  BDs must be in the same frame for this failure to occur.
  Thanks to davidch for detailed errata information.

  Reviewed by:	davidch

r214219:
  Add workaround for BCM5906 A1 controller silicon bug. When
  auto-negotiation results in half-duplex operation, excess collision
  on the ethernet link may cause internal chip delays that may result
  in subsequent valid frames being dropped due to insufficient
  receive buffer resources. The workaround is to choose de-pipeline
  method as a flow control decision for SDI. De-pipeline method
  allows only 1 data in TxMbuf at a time such that a request to RDMA
  from SDI is made only when TxMbuf is empty. Thanks for david for
  providing detailed errata information.

r214251:
  Apply the same workaround for SDI flow control used on BCM5906 A1
  to BCM6906 A0/A2. This should fix a long standing BCM5906 A2 lockup
  issues. Data sheet explicitly mentions BCM5906 A0, A1 and A2 use
  de-pipelined mode on these revisions.
  Special thanks to Buganini who tried all combinations of
  experimental patches for more than 10 days.

  Tested by:	Buganini <buganini <> gmail dot com >

r214292:
  Use bge_chipid to compare controller ids. r214251 incorrectly used
  bge_chiprev.

  Reported by:	Buganini <buganini <> gmail dot com >
2010-11-03 00:13:22 +00:00
Pyun YongHyeon c6ec8b21d7 MFC r213747,213808,214216:
r213747:
  Protect bge(4) from accessing invalid NIC internal memory regions
  on BCM5906.

  Tested by:	Buganini < buganini <> gmail dot com >

r213808:
  Add more checks for resolved link speed in bge_miibus_statchg().
  Link UP state could be reported first before actual completion of
  auto-negotiation. This change makes bge(4) reprogram BGE_MAC_MODE,
  BGE_TX_MODE and BGE_RX_MODE register only after controller got a
  valid link.

r214216:
  Enable TX MAC state machine lockup fix for both BCM5755 or higher
  and BCM5906. Publicly available data sheet just says it may happen
  due to corrupted TxMbuf.
2010-11-02 23:56:35 +00:00
Pyun YongHyeon 37a0b0b2c0 MFC r213522,213587,213711:
r213522:
  Fix a long standing bug which regarded some revisions of controller
  as 5788. This caused BGE_MISC_LOCAL_CTL register is used to
  generate link state change interrupt for non-5788 controllers. The
  interrupt handler may or may not detect link state attention as
  status block wouldn't be updated when an interrupt was generated
  with BGE_MISC_LOCAL_CTL register. All controllers except 5700 and
  5788 should use host coalescing mode register to trigger an
  interrupt.

r213587:
  Do not blindly UP the interface when interface's MTU is changed. If
  driver is not running there is no need to up the interface. While
  I'm here hold driver lock before modifying MTU as it is referenced
  in RX handler.

r213711:
  The IFF_DRV_RUNNING flag is set at the end of bge_init_locked. But
  before setting the flag, interrupt was already enabled such that
  interrupt handler could be run before setting IFF_DRV_RUNNING flag.
  This can lose initial link state change interrupt which in turn
  make bge(4) think that it still does not have valid link. Fix this
  race by protecting the taskqueue with a driver lock.
  While I'm here move reenabling interrupt code after handling of link
  state chage.

  Reviewed by:	davidch
2010-11-02 23:49:48 +00:00
Pyun YongHyeon 9233214f1a MFC r213495,213742:
r213495:
  Add more comments to rings supported by the controller. Different
  versions of controller support different number of ring control
  blocks such that adjust code a bit to access known number of
  send/receive ring control blocks. Previously bge(4) blindly
  accessed 16 send/receive RCBs. Also move initializing standard
  receive producer ring producer index, jumbo receive producer ring
  producer index and mini receive producer ring producer index to
  the end of each receive producer ring initialization.

  Do not assume mini receive producer ring is available only when
  controller has jumbo frame capability, instead explicitly check
  ASIC version BCM5700 to disable mini receive producer ring.

  Additionally always enable send ring 0 regardless of controller
  versions. Previously bge(4) didn't enable send ring 0 if controller
  is BGE_IS_5705_PLUS. Becase bge(4) need 1 send ring to send frames
  at least, I have no idea how it would have worked so far.

  Submitted by:	davidch

r213742:
  Fix a regression introduced in r213495. r213495 disabled mini
  receive producer ring only for BCM5700. It was believed that
  BCM5700 with external SSRAM is the only controller that supports
  mini ring but it seems all BCM570[0-4] requires to disable mini
  receive producer ring. Otherwise, it caused unexpected RX DMA
  error or watchdog timeouts.

  Reported by:	marius, Steve Kargl <sgk <> troutmask dot apl dot washington dot edu>
  Tested by:	marius, Steve Kargl <sgk <> troutmask dot apl dot washington dot edu>
2010-11-02 23:43:27 +00:00
Pyun YongHyeon a2afaef94b MFC r213485,213710,213812:
r213485:
  Overhaul MII register access routine and remove unnecessary
  BGE_MI_MODE register accesses. Previously bge(4) used to read
  BGE_MI_MODE register to detect whether it needs to disable
  autopolling feature or not. Because we don't touch autopolling in
  other part of driver there is no reason to read BGE_MI_MODE
  register given that we know default value in advance. In order to
  achieve the goal, check whether the controller has CPMU(Central
  Power Mangement Unit) capability. If controller has CPMU feature,
  use 500KHz MII management interface(mdio/mdc) frequency regardless
  core clock frequency. Otherwise use default MII clock. While I'm
  here, add CPMU register definition.

  In bge_miibus_readreg(), rearrange code a bit and remove goto
  statement. In bge_miibus_writereg(), make sure to restore
  autopolling even if MII write failed. The delay time inserted after
  accessing BGE_MI_MODE register increased from 40us to 80us.

  The default PHY address is now stored in softc. All PHYs supported
  by bge(4) currently uses PHY address 1 but it will be changed when
  we add newer controllers. This change will make it easier to change
  default PHY address depending on PHY models.

  Submitted by:	davidch

r213710:
  Remove one last reference of BGE_MI_MODE register for auto polling.
  Previously bge(4) always enabled auto polling for non-BGE_FLAG_TBI
  controllers. With this change, auto polling is not used anymore so
  polling through mii(4) was introduced.

  Reviewed by:	davidch

r213812:
  Fix a regression introduced in r213710. r213710 removed the use of
  auto polling such that it made all controllers obtain link status
  information from the state of the LNKRDY input signal. Broadcom
  recommends disabling auto polling such that driver should rely on
  PHY interrupts for link status change indications. Unfortunately it
  seems some controllers(BCM5703, BCM5704 and BCM5705) have PHY
  related issues so Linux took other approach to workaround it.
  bge(4) didn't follow that and it used to enable auto polling to
  workaround it. Restore this old behavior for BCM5700 family
  controllers and BCM5705 to use auto polling. For BCM5700 and
  BCM5701, it seems it does not need to enable auto polling but I
  restored it for safety.
  Special thanks to marius who tried lots of patches with patience.

  Reported by:	marius
  Tested by:	marius
2010-11-02 23:36:54 +00:00
Pyun YongHyeon 2ad4ef902f MFC r213411,213464-213465,213468:
r213411:
  Enable fix for read DMA FIFO overruns on controllers that have this
  fix. Note, we still need workaround for controllers that lacks this
  fix and it needs more work in RX BD updating.

  Submitted by:	davidch

r213464:
  Separate common flags into controller specific and PHY related
  flags. There should be no functional changes. This change will make
  it easy to add more quirk/flags in future.

  Reviewed by:	davidch

r213465:
  Rearrange code a bit to correctly set PHY flags. This change make
  it easy to add more newer ASICs.

  Obtained from:	OpenBSD

r213468:
  Fix bge(4) build breakage when BGE_REGISTER_DEBUG is defined.
2010-11-02 23:26:07 +00:00
Pyun YongHyeon 85c5e1903c MFC r213316,213333-213334:
r213316:
  Fix IFCAP_TXCSUM/IFCAP_RXCSUM handling. Previously bge(4) used
  IFCAP_HWCSUM to know which capability should be changed such that
  disabling RX checksun offloading resulted in disabling TX checksum
  offloading.

r213333:
  Allow write DMA to request larger DMA burst size to get better
  performance on BCM5785.

  Obtained from:	OpenBSD

r213334:
  Remove extra semicolon.
2010-11-02 23:07:38 +00:00
Pyun YongHyeon 751007f3d3 MFC r213283,213410:
r213283:
  Implement hardware MAC statistics for BCM5705 or newer Broadcom
  controllers. bge(4) exported MAC statistics on controllers that
  maintain the statistics in the NIC's internal memory. Newer
  controllers require register access to fetch these values. These
  counters provide useful information to diagnose driver issues.

r213410:
  Consistently use ifHCOutOctets/ifHCInOctets instead of Octets as
  these names are used in data sheet. Also use UnicastPkts,
  MulticastPkts and BroadcastPkts instead of UcastPkts, McastPkts
  and BcastPkts to clarify its meaning.

  Suggested by:	bde
2010-11-02 22:59:45 +00:00
Pyun YongHyeon de48216b08 MFC r213081,213225,213280:
r213081:
  Always show asic/chip revision in device attach phase. There are
  too many bge(4) controllers there and model name does not
  necessarily match asic/chip revision. Relying on VPD string made
  it hard to identify exact asic/chip revision so the first step to
  debug bge(4) was getting exact asic/chip information with verbose
  boot which may not be available on production server.

r213255:
  Set the number of RX frames to receive after RX MBUF low watermark
  has reached. This reduced number of dropped frames when
  flow-control is enabled. Previously it dropped incoming frames once
  RX MBUF low watermark has reached. The value used in MAC RX MBUF
  low watermark is greater than or equal to 4 so receiving two more
  RX frames should not be a problem.

  Obtained from:	OpenBSD

r213280:
  After r207391, brgphy(4) passes resolved flow-control settings to
  parent driver. Use that information to configure flow-control.
  One drawback is there is no way to disable flow-control as we still
  don't have proper way to not advertise RX/TX pause capability to
  link partner. But I don't think it would cause severe problems and
  users can selectively disable flow-control in switch port.
2010-11-02 22:48:52 +00:00
Marius Strobl f0aedc5361 MFC: r214526
Partially revert r203829 (MFC'ed to stable/7 in r205921); as it turns out
what the PowerPC OFW loader did was incorrect as further down the road
cons_probe() calls malloc() so the former can't be called before init_heap()
has succeed. Instead just exit to the firmware in case init_heap() fails
like OF_init() does when hitting a problem as we're then likely running in
a very broken environment where hardly anything can be trusted to work.
2010-11-02 22:12:12 +00:00
Marius Strobl 2541d746d9 MFC: r201430
Fix card/device names, no functional change

The ADMtek AN985 is the cardbus variant of ADMtek AN983
The Netgear FA511 is just a relabled ADMtek AN985

PR:		kern/50574
2010-11-02 21:01:18 +00:00
Marius Strobl 662cb908fe MFC: r213878
Add a NetBSD-compatible mii_attach(), which is intended to eventually
replace mii_phy_probe() altogether. Compared to the latter the advantages
of mii_attach() are:
- intended to be called multiple times in order to attach PHYs in multiple
  passes (f.e. in order to only use sub-ranges of the 0 to MII_NPHY - 1
  range)
- being able to pass along the capability mask from the NIC to the PHY
  drivers
- being able to specify at which address (phyloc) to probe for a PHY
  (instead of always probing at all addresses from 0 to MII_NPHY - 1)
- being able to specify which PHY instance (offloc) to attach
- being able to pass along MIIF_* flags from the NIC to the PHY drivers
  (f.e. as required to indicated to the PHY drivers that flow control is
  supported by the NIC driver, which actually is the motivation for this
  change).

While at it, I used the opportunity to get rid of some hacks in mii(4)
like miibus_probe() generally doing work besides sheer probing and the
"EVIL HACK" (which will vanish entirely along with mii_phy_probe()) by
passing the struct ifnet pointer via an argument of mii_attach() as well
as to fix some resource leaks in mii(4) in case something fails.
Commits which will update the PHY drivers to honor the MII flags passed
down from the NIC drivers and take advantage of mii_attach() to get rid
of certain types of hacks in NIC and PHY drivers as well as a conversion
of the remaining uses of mii_phy_probe() will follow shortly.

Reviewed by:	jhb, yongari
Obtained from:	NetBSD (partially)
2010-11-02 20:06:49 +00:00
Bernhard Schmidt 381440db1c MFC r214160,214162,214236
r214236 & r214160:
The firmware does pad notifications to an even number of bytes (at least
the association notification), the included information though always
contains an elem block with an odd number of bytes. We handle the last
byte as if it might contain a whole elem block, this of course is not
true as one byte is not enough to hold a block, we therefore discard the
complete frame. The solution here is to subtract one from the actual
notification length, this is also what the Linux driver does. With this
change the frame ends exactly where the last elem block ends.

r214262:
The firmware always sets bit 14 and 15, to get the real associd we need
to clear those bits.
2010-11-01 19:04:16 +00:00
Yoshihiro Takahashi 2ebcfae63b MFC: revision 214258
Rewrite the i386 memory probe:
  - Move the base memory setup into a new basemem_setup() routine.
2010-10-31 08:50:31 +00:00
Bjoern A. Zeeb ec8b1338d4 MFC r214447:
Correct a typo.
2010-10-31 00:35:18 +00:00
Alan Cox f17b0df280 MFC r213408
If vm_map_find() is asked to allocate a superpage-aligned region of
  virtual addresses that is greater than a superpage in size but not a
  multiple of the superpage size, then vm_map_find() is not always
  expanding the kernel pmap to support the last few small pages being
  allocated.  Previously, we grew the kernel page table in
  vm_map_findspace() when we found the first available virtual address.
  Now, instead, we defer the call to pmap_growkernel() until we are
  committed to a range of virtual addresses in vm_map_insert().
2010-10-30 16:09:15 +00:00
Bjoern A. Zeeb bbba58fa26 MFC r214303:
Add initial inet DDB support for show in_ifaddr and show sin commands which
  proved to be useful while debugging address list problems.
2010-10-30 16:02:16 +00:00
Bjoern A. Zeeb e35584ea76 MFC r213930:
Close a race acquiring the IF_ADDR_LOCK() for each entry while iterating
  over all interfaces to make sure the address will neither change nor be
  freed while we are working on it.

  PR:		kern/146250
  Submitted by:	Mikolaj Golub (to.my.trociny gmail.com)
2010-10-30 11:30:49 +00:00
Hajimu UMEMOTO 38a897256c MFC r213453: When no protocol entry is found, getproto*_r(3)
should return zero.
2010-10-30 10:38:23 +00:00
Hajimu UMEMOTO 639315ad9b MFC r213403: Clear errno for each method dispatch. 2010-10-30 10:37:11 +00:00
Sergey Kandaurov 5cccfdc8e0 MFC r214131.
Enable copyback and system PD states.

Approved by:	kib (mentor)
2010-10-28 15:43:14 +00:00
Sergey Kandaurov ec5940cf97 MFC r214130.
Update PD state firmware definitions: add copyback, system.

Approved by:	kib (mentor)
2010-10-28 15:37:58 +00:00
Pyun YongHyeon 45b65c49fe MFC r213796:
Rewrite interrupt handler to give fairness for both RX and TX.
  Previously rl(4) continuously checked whether there are RX events
  or TX completions in forever loop. This caused TX starvation under
  high RX load as well as consuming too much CPU cycles in the
  interrupt handler. If interrupt was shared with other devices which
  may be always true due to USB devices in these days, rl(4) also
  tried to process the interrupt. This means polling(4) was the only
  way to mitigate the these issues.

  To address these issues, rl(4) now disables interrupts when it
  knows the interrupt is ours and limit the number of iteration of
  the loop to 16. The interrupt would be enabled again before exiting
  interrupt handler if the driver is still running. Because RX buffer
  is 64KB in size, the number of iterations in the loop has nothing
  to do with number of RX packets being processed. This change
  ensures sending TX frames under high RX load.

  RX handler drops a driver lock to pass received frames to upper
  stack such that there is a window that user can down the interface.
  So rl(4) now checks whether driver is still running before serving
  RX or TX completion in the loop.

  While I'm here, exit interrupt handler when driver initialized
  controller.

  With this change, now rl(4) can send frames under high RX load even
  though the TX performance is still not good(rl(4) controllers can't
  queue more than 4 frames at a time so low TX performance was one of
  design issue of rl(4) controllers). It's much better than previous
  TX starvation and you should not notice RX performance drop with
  this change. Controller still shows poor performance under high
  network load but for many cases it's now usable without resorting
  to polling(4).
2010-10-27 02:07:25 +00:00
Bernhard Schmidt c56f348311 MFC r213729:
Fix monitor mode which is implemented by doing a firmware scan. This
is a port from stable/6, seems like the code got lost during the
background scan changes in r170530.
2010-10-26 17:31:46 +00:00
Alexander Motin 5ee2647150 MFC r212754:
Add support for dumping kernel to gconcat.
Dumping goes to the component, where dump partition begins.
2010-10-25 08:23:38 +00:00
Andriy Gapon cc71ba4a47 MFC r214097: catch up manual pages with rename of vm_page_sleep_busy to
vm_page_sleep_if_busy
2010-10-25 08:11:51 +00:00
Andriy Gapon 6280c6508e MFC r214096: VOP_GETPAGES.9: clarify and correct description of
parameters and requirements
2010-10-25 08:09:19 +00:00
Andriy Gapon 559bbb5ef9 MFC r214095: PG_BUSY -> VPO_BUSY, PG_WANTED -> VPO_WANTED in manual
pages and comments
2010-10-25 08:07:57 +00:00
David E. O'Brien 5bb3ad6030 MFC r213814: Do not assume in growstackstr() that a "precious" character
will be immediately written into the stack after the call.  Instead let
the caller manage the "space left".
2010-10-24 23:09:00 +00:00
Pyun YongHyeon 467026d2d1 MFC r213844:
Make sure to not use stale ip/tcp header pointers. The ip/tcp
  header parser uses m_pullup(9) to get access to mbuf chain.
  m_pullup(9) can allocate new mbuf chain and free old one if the
  space left in the mbuf chain is not enough to hold requested
  contiguous bytes. Previously drivers can use stale ip/tcp header
  pointer if m_pullup(9) returned new mbuf chain.

  Reported by:	Andrew Boyer (aboyer <> averesystems dot com)
2010-10-24 21:17:23 +00:00
Pyun YongHyeon 21d640266c MFC r213842:
Backout r204230. TX mbuf parser for VLAN is still required to
  enable TX checksum offloading if VLAN hardware tagging is disabled.
2010-10-24 21:09:31 +00:00
Marius Strobl afe353da1e MFC: r213384
Consistently always explicitly set IFM_HDX for half-duplex.

Obtained from:	OpenBSD (mostly)
2010-10-24 13:42:03 +00:00
Marius Strobl 079faf2109 MFC: r213364
- In the spirit of previous simplifications factor out the checks for a
  different PHY instance being selected and isolation out into the wrappers
  around the service methods rather than duplicating them over and over
  again (besides, a PHY driver shouldn't need to care about which instance
  it actually is).
- Centralize the check for the need to isolate a non-zero PHY instance not
  supporting isolation in mii_mediachg() and just ignore it rather than
  panicing, which should sufficient given that a) things are likely to
  just work anyway if one doesn't plug in more than one port at a time and
  b) refusing to attach in this case just leaves us in a unknown but most
  likely also not exactly correct configuration (besides several drivers
  setting MIIF_NOISOLATE didn't care about these anyway, probably due to
  setting this flag for no real reason).
- Minor fixes like removing unnecessary setting of sc->mii_anegticks,
  using sc->mii_anegticks instead of hardcoded values etc.
2010-10-24 13:39:26 +00:00
Jilles Tjoelker 7c992d2cde MFC r213926: sh(1): Clarify subshells/processes for pipelines.
For multi-command pipelines,
1. all commands are direct children of the shell (unlike the original
   Bourne shell)
2. all commands are executed in a subshell (unlike the real Korn shell)
2010-10-23 14:16:33 +00:00
Jilles Tjoelker 3eeb422ca5 MFC r207831: sh(1): Fix "reserved word" vs "keyword" inconsistency.
Use "keyword" everywhere, like the output of the 'type' builtin, and only
mention "reserved word" once to say it is the same thing.
2010-10-23 14:15:10 +00:00
Jilles Tjoelker 5537520013 MFC r211621: sh(1): Add a brief summary of arithmetic expressions. 2010-10-23 14:04:04 +00:00
Jilles Tjoelker aab3358697 MFC r212417: sh(1): Remove xrefs for expr(1) and getopt(1).
expr(1) should usually not be used as various forms of parameter expansion
and arithmetic expansion replicate most of its functionality in an easier
way.

getopt(1) should not be used at all in new code. Instead, getopts(1) or
entirely manual parsing should be used.
2010-10-23 14:00:31 +00:00
Jilles Tjoelker a23ab3d0a8 MFC r197848: Clarify quoting of word in ${v=word} in sh(1). 2010-10-23 13:57:26 +00:00
Pyun YongHyeon aaf6bfb4d8 MFC r214089:
Correct handling of shared interrupt in sis_intr(). r212116 incorrectly
  released a drver lock for shared interrupt case such that it caused
  panic. While I'm here check whether driver is still running before
  serving TX/RX handler.

  Reported by:	Jerahmy Pocott < QUAKENET1 <> optusnet dot com dot au >
  Tested by:	Jerahmy Pocott < QUAKENET1 <> optusnet dot com dot au >
2010-10-23 00:44:16 +00:00
David E. O'Brien 37217529ab MFC
r213738: allow one to regression test 'sh' changes without having to
           install a potentially bad /bin/sh first.
  r213903: default to 'sh' from PATH if 'SH' env is not set.
2010-10-22 23:12:45 +00:00
David E. O'Brien a9e6070e06 MFC
r212243: improve comments in expand.c
  r214100: MFC r213815: only need to look as far as '..' to find 'test/'
  r214104:
    r213774: DEBUG_FLAGS should be used to enable extra debugging rather than
             frobbing CFLAGS directly.
    r213798: do not inline static functions if debugging
2010-10-22 17:49:11 +00:00
Matthew D Fleming 9a9404ef90 MFC r214062:
uma_zfree(zone, NULL) should do nothing, to match free(9).

Noticed by:	Ron Steinke <rsteinke at isilon dot com>
2010-10-22 16:00:45 +00:00
Sergey Kandaurov d6b7bbea4e MFC r214020:
Fix typo: Offlaod -> Offload.

PR:		docs/150756
Approved by:	avg (mentor)
2010-10-21 10:13:52 +00:00
Xin LI 8ce94c2765 MFC r190527,190528,190531:
190527(sam):
fix wired-wireless failover example and remove incorrect
comment about WPA not working

190528(sam):
remove bogus nwid use; that's a compat shim for netbsd

190531(bruffer):
Fix typo.

MFC r212100 (emaste),213632,214066:

Add a new syslog knob, net.link.lagg.failover_rx_all, to control
whether to accept input packets on any link in a failover lagg,
and add the corresponding documentation.
2010-10-20 17:58:12 +00:00
Edwin Groothuis 223ef9d219 MFC of r207830
strptime(3) confused July with June with the fr_FR locale.

When parsing the month "juillet" (abbr "jul"), %B recognized it as
"juin" (abbr "jui") because the full name of the month names is
checked at the same time as the abbrevation.

The new behaviour checks the full names first before checking the
abbrevation names.

PR:             kern/141939
Submitted by:   Denis Chatelain <[email protected]>
2010-10-19 21:05:22 +00:00
Sergey Kandaurov 7fae71e92c MFC r213574:
- tcpconnect incorrectly uses err() in usage() with errx() semantics [1]
- 64-bit aware fixes in printf() usage [2]
o   netrate/juggle: time_t has arch-dependent size
o   netrate/tcpconnect: don't assume %ll has always 64bit.

PR:		146088 [1], 146086 [2] (modified)
Approved by:	kib (mentor)
2010-10-19 14:11:50 +00:00
Sergey Kandaurov 7dd5fdf8bd MFC r213514:
Wrap lines for SiS and Promise entries to 80 columns.

PR:		docs/146195
Approved by:	avg (mentor)
2010-10-19 10:56:56 +00:00
Jaakko Heinonen 5760de4f61 MFC r213298:
Fix printing of the "rw" mount option in fstab(5) format (-p option).
fstab(5) format requires that one of "rw", "rq" or "ro" is always
specified.

PR:		bin/123021
2010-10-18 14:40:48 +00:00
Jaakko Heinonen 1fb4f626be Remove incorrectly placed mergeinfo. This is a direct commit to stable/7. 2010-10-18 14:36:51 +00:00
Marius Strobl 16e48ef8d6 MFC: r213868
- In the spirit of r212559 add a comment describing what will eventually
  lower the PIL.
- Just as with the AP ensure that the (S)TICK timer(s) are in a known
  state when starting BSPs.
2010-10-17 14:25:01 +00:00
Marius Strobl 948d865826 MFC: r213578
In the replacement text of the __bswapN_const() macros cast the argument
to the expected type so they work like the corresponding __bswapN_var()
functions and the compiler doesn't complain when arguments of different
width are passed.
2010-10-17 13:41:12 +00:00
Marius Strobl 14ed9b2014 MFC: r213575
Just use the sparc64 version of this header rather than duplicating it.
2010-10-17 13:13:12 +00:00
Marius Strobl e0d754da66 MFC: r185421
Renamed the FRAMELEN macro to TRUEPHY_FRAMELEN as for powerpc
it seems to be possible to collide with FRAMELEN from machine/frame.h.

Found by:	zec
2010-10-17 13:11:46 +00:00
Marius Strobl edae525d2c MFC: r173164
Setting sc->mii_anegticks to MII_ANEGTICKS_GIGE in rgephy_attach()
is redundant. mii_phy_add_media() already takes care of that.

Pointed out by:	marius
2010-10-17 13:10:22 +00:00
Marius Strobl 580f901331 MFC: r182067
Move the code that looks for the companion phy to a subroutine to make
sure we get the error handling right in both places.  This also
simplifies the code somewhat.
2010-10-17 13:07:35 +00:00
Marius Strobl 2cc212ea79 r182037, r182038, r182064
When there's an error, we don't want to free the children, since it
will be stack garbage.
2010-10-17 13:06:18 +00:00
Marius Strobl ea5a27f54b MFC: r182751
Recognize 88E1116R phy variation. This part is found on some embedded devices.

Obtained from:	Semihalf
2010-10-17 12:47:07 +00:00
Marius Strobl f5c9ebc27b MFC: r176773, r178598
Recognize Cicada CS8204 and CS8244 PHYs.
2010-10-17 12:43:15 +00:00
Marius Strobl e829747901 MFC: r175703
Fix a typo in a comment.
2010-10-17 12:34:20 +00:00
Marius Strobl dad9f13618 MFC: r213361
Try to adhere to style(9) and be consistent within this file.
2010-10-17 12:33:15 +00:00
Marius Strobl 127507f415 MFC: r213229
Use the mii_data provided via mii_attach_args and mii_pdata respectively
instead of reaching out for the softc of the parent.
2010-10-17 12:30:01 +00:00
Marius Strobl dc021cae96 MFC: r213188
- Remove clause 3 and 4 from TNF licenses.
- Remove closes 3 & 4 from Manuel Bouyer's license.

Obtained from:	NetBSD
2010-10-17 12:16:38 +00:00
Marius Strobl d2a030ba2f MFC: r204646
The NetBSD Foundation has granted permission to remove clause 3 and 4 from
the software.

Obtained from:	NetBSD
2010-10-17 12:11:43 +00:00
Marius Strobl 7738923e2f MFC: r213104
minor simplifications and cosmetics
2010-10-17 12:05:39 +00:00
Marius Strobl 37e3b113cd MFC: r213873
Explicitly lower the PIL to 0 as part of enabling interrupts, similar to
what is done on other platforms. Unlike as with the sched_throw(NULL)
called on BSPs during their startup apparently there's nothing which will
reliably lower it on APs. I'm unsure why this only came up on V215 though,
breaking these with r207248. My best guess is that these are the only
supported ones so far fast enough to lose some race.

PR:		151404
2010-10-17 11:51:59 +00:00
Bjoern A. Zeeb 9c9fa453b6 MFC r213837:
Remove dead code:
  assignment to a local variable not used anywhere after that.
2010-10-17 08:44:34 +00:00
Edwin Groothuis d051e0f752 Mega-merge of ncal into stable/7:
r186401:
Implement a new feature for the "-m" option: if the month number is
followed by 'f' or 'p', use the following or preceding month of that
number, respectively.  Document this.  Also includes other minor
grammatical and punctuation fixes to the manual page (capitalize
Easter, etc.).

r191330:
Implement highlighting of today in month view of cal/ncal just like
gnu cal does. This is currently disabled for year view because of hard
coded padding in that case. This will hopefully be fixed soon.

r191364:
Couple of changes based on feedback
o       Change mr/me to so/se [1].
o       Introduce a -h option to disable highlighting. [2]
o       Spell STDOUT_FILENO as such and pass NULL to tgetent()
to handle the case of unset TERM. [3]

r191687:
Fixed missing dependency.

r194366:
Fix column width of weekday names for multibyte locales.

r194447:
Since the width is always 2, it is enough to put just one
trailing space is enough.

r204697:
- Implement -3 option (show previous, this and next month) option.
- Add -A option (months after this month).
- Add -B option (months before this month).
- Fix highlighting of today in year overview.
- Fix aligning of "foreign" characters.

r204706:
Remove no-op of WARNS?=

r204849:
- document the -3, -A and -B properly in Synopsis.
- add highlight of current date for non-terminals.
- fix -J option.
- code cleanup.

r204908:
- Fix the highlighting for non-terminals when the last week is not
  7 days long.
- "-m <N> <YYYY>" now prints only the month, not the whole year.

r205071:
- With the introduction of -A, -B and -3, not all combinations of
  arguments makes sense anymore. For example, what would a combination
  of -3 (show three months) and -y (show the whole year) do?
  We will abort on these cases.
- Move the debug option -d to -H (from highlight), while -d is now
  used for setting the day of "today" so that -y and friends can
  be tested.

r205427:
Replace -b with -C and -B (as proposed by Alexander).
Add -3, -A and -B to the usage.
Update regression test for the new parameters.

r212032:
Use basename(3) to determine the name of the program.
2010-10-17 07:11:40 +00:00
Bjoern A. Zeeb 040bb6d0f4 MFC r213836:
Style: make the asterisk go with the variable name, not the type.
2010-10-17 03:13:30 +00:00
Andriy Gapon 112761755a MFC r213648: panic_cpu variable should be volatile 2010-10-16 20:01:41 +00:00
Andriy Gapon 88426b0f47 MFC r213651: add kmem_map_free sysctl: query largest contiguous free range in kmem_map 2010-10-16 11:44:58 +00:00
Andriy Gapon 4fb6831930 MFC r213527: vm.kmem_map_size: a sysctl to query current kmem_map->size 2010-10-16 11:41:20 +00:00
Bjoern A. Zeeb 6463946b4b MFC r186391,186483,186497 (qingli, kmacy 21 months ago):
r186391:
  Provide a condition variable to delay the cloned interface
  destroy operation until the referenced clone device has
  been closed by the process properly. The behavior is now
  consistently with the previous release.

r186483:
  - Close a race during which the open flag could be cleared but the
    tun_softc would still be referenced by adding a separate TUN_CLOSED
    flag that is set after tunclose is done referencing it.
  - drop the tun_mtx after the flag check to avoid holding it across
    if_detach which can recurse in to if_tun.c

r186497:
  The "tun?" dev need not be opened at all. One is allowed to perform
  the following operations, e.g.:
  1) ifconfig tun0 create
  2) ifconfig tun0 10.1.1.1 10.1.1.2
  3) route add -net 192.103.54.0/24 -iface tun0
  4) ifconfig tun0 destroy
  If cv wait on the TUN_CLOSED flag, then the last operation (4) will
  block forever.

  Revert the previous changes and fix the mtx_unlock() leak.

PR:		kern/116837
Submitted by:	Mikolaj Golub (to.my.trociny gmail.com)
		(Not used the patch, just did the MFC)
2010-10-15 15:06:32 +00:00
Bjoern A. Zeeb 81cf2a7df8 MFC r185963 (by csjp in 2008):
Consider processes attaching/detaching from tun(4) devices as being link
  state changes.  This change modifies tunopen and tunclose to call the
  if_link_state_change() function.  Among other things, this will result in
  devd(8) receiving events from devctl(4) for linkup/link down.  This allows
  us to do several useful things, including initializing tunnel parameters
  and adding routes.

  Discussed on:	freebsd-net
2010-10-15 14:33:46 +00:00
Edwin Groothuis c51b8948b9 Remove calendar.judaic from RELENG_7:
- It is out of date.
- It is properly fixed in HEAD and RELENG_8.
2010-10-14 21:51:53 +00:00
Edwin Groothuis d1309284a6 MFC of r206568
Allerheilingen -> Allerheiligen

Submitted by:   Ronald Klop <ronald at realworks dot nl>
2010-10-14 21:29:50 +00:00
Edwin Groothuis 7f577efa78 MFC of r212163
Adding a missing firstname (Monique)

PR:             conf/150049
Submitted by:   Thierry Thomas <[email protected]>
2010-10-14 21:19:04 +00:00
Edwin Groothuis 5d727e48ea MFC of r213032 r213033
Fix location and year of the Battle of the Plains of Abraham

PR:             150504
Submitted by:   Douglas Berry <[email protected]>
2010-10-14 21:17:32 +00:00
Jaakko Heinonen 4a8cd47e2c MFC r200036 by scottl:
Fix several cases where the periph lock was held over malloc.

PR:		kern/130735
2010-10-14 18:02:31 +00:00
David E. O'Brien cfd21e91da MFC r212770 & r212832:
+ Add the SCRIPT environmental variable to the sub-shell.
  + Add the 'command' argument (if supplied on the command line)
    to the typescript file.
2010-10-14 03:13:20 +00:00
David E. O'Brien 9681108efc MFC r212771:
Increase the hostname display width to >12 characters.
2010-10-14 02:19:53 +00:00
George V. Neville-Neil 3bcd71cde4 MFC 213691:
Add code to print the number and type of the CPU that is present in
the system as well has how many PMCs there are per CPU.  In this code
CPU and core are equivalent.
2010-10-12 22:11:31 +00:00
George V. Neville-Neil 5246b89b8f MFC 213409:
Fix two aliases that had the same name but were pointing to different
events.  These are now disamiguated.
2010-10-12 21:45:36 +00:00
George V. Neville-Neil f6621f2f94 MFC 177387,177388,177872,178456,179528,180394,186456,203800,204310,213327:
r177387

A multicast test.  The mctest program acts as both a source and a sink
for multicast packets.  Parameters for the interface, packet size,
number of packets, and interpacket gap may be given on the command line.
The sink records how many packets were missed, and at what time each
packet arrived.

r177388

Add the correct license.

r177872

Add a manual page and a Makefile.

Add code to reflect packets back from the sink so that we can measure
round trip at the source.

r178456

Updated the test to handle multiple sinks.  The sinks cut their
transmissions by the number of them running so that they do not
overwhelm the source.

Added a simple shell script to kick off sinks on multiple hosts as
well as a source on the host where the shell script is run.  The script
also collects the output of all the sinks and the source into files named
for the host on which the tests are run.  A date is appended to each output
file to make it unique per run.

r179528

Update mctest and its associated script to have a base port to listen
on so that multiple copies can be run easily.

Update documentation with group and port arguments which are optional.

r180394

Add a new program to the multicast test suite.  The mcgrab program
is used to grab and hold some number of multicast addresses in order
to test what happens when an interface goes over the number of multicast
addresses it can filter in hardware.

r186456

Fix a bug in the man page where we were not showing the correct flags
in the explanation. Several of the flags were -i, since it was a copy/paste
operation.

r203800

Fixed error checking of pthread(3) functions.

r204310

Moved mcgrab(1) into a separate directory -- our .mk infrastructure
doesn't currently have support for building multiple programs in a
single makefile.

While here, fixed manpages and makefiles (missing dependencies).

r213327

Change the output of mctest to give a summary of the results instead
of printing a long list.

Add a default base port, and default mulitcast address to the
runner script.

Add support for specifying a different local and remote interface
in the runner script.
2010-10-12 21:40:43 +00:00
John Baldwin 1d7872ac4b MFC 213226:
Rewrite the i386 memory probe:
- Check for SMAP data from the loader first.  If it exists, don't bother
  doing any VM86 calls at all.  This will be more friendly for non-BIOS
  boot environments such as EFI, etc.
- Move the base memory setup into a new basemem_setup() routine instead
  of duplicating it.
- Simplify the XEN case by removing all of the VM86/SMAP parsing code rather
  than just jumping over it.
- Adjust some comments to better explain the code flow.
2010-10-12 19:28:33 +00:00
Bernhard Schmidt d7572cb694 When bringing the interface down we clear the command queue but do
not reset the sc_cmd_cur and sc_cmd_next indices. If there are
still pending commands while clearing the queue those two indices
are off by at least one. This leads to no commands being sent
to the firmware until the queue overruns. Fix this by also resetting
the indices.

This is a direct commit as the code does not exist in head.
2010-10-12 17:12:35 +00:00
John Baldwin 0018e66602 MFC 213300:
If an RCS file is truncated, rcsfile_getdelta() will return NULL.  Instead
of faulting, check for NULL.  However, returning an error would cause csup
to just abort the entire update.  Instead, break out of the loop and
return ok.  The attempts to update the file will trigger a MD5 failure which
will cause csup to download the entire file as a fixup.
2010-10-12 17:12:22 +00:00
John Baldwin d33d48ee07 MFC 194070: Remove semicolon that should not have been there. 2010-10-12 17:09:33 +00:00
John Baldwin e34242e75f MFC 213028,213328:
- Expand scope of tun/tap softc locks to cover more softc fields and
  driver-maintained ifnet fields (such as if_drv_flags).
- Use soft locks as the mutex that protects each interface's knote list
  rather than using the global knote list lock.  Also, use the softc
  for kn_hook instead of the cdev.
- Use mtx_sleep() instead of tsleep() when blocking in the read routines.
  This fixes a lost wakeup race.
- Remove D_NEEDGIANT now that the cdevsw routines use the softc lock
  where locking is needed.
- Lock IFQ when calculating the result for FIONREAD in tap(4).  tun(4)
  already did this.
- Remove remaining spl calls.
2010-10-12 16:09:08 +00:00
John Baldwin 52de504a3c MFC 213271:
Account for unlocking a spin mutex in the lock profiling code in the !SMP
case.
2010-10-12 15:48:27 +00:00
John Baldwin 0b42e349f1 MFC 212974:
Comment nit, set TDF_NEEDRESCHED after the comment describing why it is
done rather than before.
2010-10-12 15:26:37 +00:00
George V. Neville-Neil 68b8e6f504 MFC 213402:
Fix punctuation and grammar, mostly by ending sentences with a period.
2010-10-11 16:57:02 +00:00
Jaakko Heinonen 82e41e5739 MFC r200752:
Avoid sharing the file descriptor of the output file with traced
processes by setting the FD_CLOEXEC flag for the output file.

PR:		bin/140493
2010-10-11 13:31:09 +00:00
Xin LI 961c41a252 MFC r213225:
Add a bandaid for a long-standing race condition during route entry
un-expiring.

The previous version of code have no locking when testing rt_refcnt.
The result of the lack of locking may result in a condition where
a routing entry have a reference count but at the same time have
RTPRF_OURS bit set and an expiration timer.  These would eventually
lead to a panic:

	panic: rtqkill route really not free

When the system have ICMP redirects accepted from local gateway
in a moderate frequency, for instance.

Commit this workaround for now until we have some better solution.

PR:		kern/149804
Reviewed by:	bz
Tested by:	Zhao Xin, Pete French
2010-10-11 11:25:37 +00:00
Kai Wang 286b2884f0 MFC r212373:
libelf is overly strict about the type and alignment of Elf_Data
  objects inside one ELF section, which prevents the creation of a ELF
  section with mixed data types. For example, gcc LTO use libelf to
  create a .gnu_lto_XXX section that contains integers and a string
  table, which doesn't work with our libelf implementation.

  The changes made in this commit include:
  * Allow Elf_Data type to be different than section type.
  * Relax Elf_Data alignment check.
  * Align each Elf_Data by their own alignment instead of section alignment.
2010-10-10 12:21:35 +00:00
Konstantin Belousov 166dec4937 MFC r213382:
In makectx(), always use the tf_rsp from trap frame. %rsp is pushed
unconditionally by hardware on the trap.

PR:   amd64/151167
2010-10-10 07:28:56 +00:00
Pyun YongHyeon 0604fc4422 Fix build breakage introducted in r213604. 2010-10-09 20:52:36 +00:00
Gavin Atkinson 083ea70d52 Merge r213061 from head:
Various changes from various sources:

  - Add "children" [1]
  - Add "acknowledgement", "acknowledgment", "Austria" and "haunted" [2]
  - Add "near", "antidisestablishmentarianism" and "Persephone" [2]
  - "Transvaal" should be capitalized [2]
  - Correct spelling of "structurelessness" and "Athena" [2]
  - Add missing atomic elements [3]
  - Add various words from "word of the day" lists [3]

Also, set fbsd:nokeywords on web2, to allow checkin.

PR:		conf/149756 [1]
Submitted by:	Nick Johnson <freebsd spatula.net> [1]
Obtained from:	NetBSD [2], OpenBSD [3]
2010-10-09 13:07:21 +00:00
Andriy Gapon a8829e1dc2 MFC r210782,210837: Update the "desiredvnodes" calculation.
On behalf of:	alc
2010-10-09 09:24:16 +00:00
Xin LI f655196920 MFC r213488:
Use a defined FreeBSD version.
2010-10-09 00:36:32 +00:00
Xin LI 4518a8912f MFC r213487:
Add definition for FreeBSD 7.4, which will be used in a manual page change.
2010-10-09 00:34:58 +00:00
Pyun YongHyeon 1a196a87fd MFC r212167:
Initial WOL support. NS DP8315 was tested but SiS900/SiS7016 was
  not tested.
  While I'm here, clean up SIOCSIFCAP handler.
2010-10-08 23:34:45 +00:00
Pyun YongHyeon ef92ac2492 MFC r188463:
Fix shutdown prototypes.
2010-10-08 23:29:45 +00:00
Pyun YongHyeon 551ef82f43 MFC r212166:
Implement initial device suspend/resume method.
2010-10-08 23:14:21 +00:00
Pyun YongHyeon 69aee01855 MFC r212159,212161:
r212159:
  Document tunable dev.sis.%unit.manual_pad
  While I'm here Xref vlan(4) as sis(4) supports VLAN oversized
  frames.

r212161:
  Better wording.

  Submitted by:	jkim
2010-10-08 20:58:48 +00:00
Pyun YongHyeon 9e573d2af8 MFC r212158:
Enable sis(4). sis(4) should work on all architectures.
2010-10-08 20:55:27 +00:00
Pyun YongHyeon 69cfda8857 MFC r212157:
Unlike most other controllers, NS DP83815/DP83816 controllers seem
  to pad with 0xFF when it encounter short frames.  According to RFC
  1042 the pad bytes should be 0x00.
  Because manual padding consumes extra CPU cycles, introduce a new
  tunable which controls the padding behavior. Turning this tunable
  on will have driver pad manually but it's disabled by default. Users
  can enable software padding by setting the following tunable to
  non-zero value.

  dev.sis.%d.manual_pad="1"

  PR:	kern/35422 (patch not used)
2010-10-08 20:52:47 +00:00
Pyun YongHyeon f84acbf8e9 MFC r212121,212156:
r212121:
  Move sis_reset() to sis_initl(). This ensures driver starts with
  known good state of controller.

r212156:
  Fix the last endianness issue on handling station address which
  prevented driver from working on big-endian machines. Also rewrite
  station address programming to make it work on strict-alignment
  architectures. With this change, sis(4) now works on sparc64 and
  performance number looks good even though sis(4) have to apply
  fixup code to align received frames on 2 bytes boundary on sparc64.
2010-10-08 20:49:44 +00:00
Pyun YongHyeon f0d28c37c2 MFC r212120:
Avoid controller reinitialization which could be triggered by
  dhclient(8) or alias addresses are added.

  PR:	kern/87506
2010-10-08 20:44:35 +00:00
Pyun YongHyeon d66bf03f29 MFC r212117,212119:
rr212117:
  Report result of link state change to caller. Previously it always
  returned success.

r212119:
  Do not reinitialize controller whenever promiscuous mode or
  allmulti is toggled. Controller does not require reinitialization.
  This removes unnecessary controller reinitialization whenever
  tcpdump is used.
  While I'm here remove unnecessary variable reinitialization.
2010-10-08 20:41:15 +00:00
Pyun YongHyeon 3f0f0e7b65 MFC r212116:
Overhaul link state change handling. Previously sis(4) blindly
  configured TX/RX MACs before getting a valid link. After that, when
  link state change callback is called, it called device
  initialization again to reconfigure TX/RX MACs depending on
  resolved link state. This hack created several bad side effects and
  it required more hacks to not collide with sis_tick callback as
  well as disabling switching to currently selected media in device
  initialization. Also it seems sis(4) was used to be a template
  driver for long time so other drivers which was modeled after
  sis(4) also should be changed.

  TX/RX MACs are now reconfigured after getting a valid link. Fix for
  short cable error is also applied after getting a link because it's
  only valid when the resolved speed is 100Mbps.

  While I'm here slightly reorganize interrupt handler such that
  sis(4) always read SIS_ISR register to see whether the interrupt is
  ours or not. This change removes another hack and make it possible
  to nuke sis_stopped variable in softc.
2010-10-08 20:37:13 +00:00
Pyun YongHyeon 676d4fbd2d MFC r212113:
s/u_intXX_t/uintXX_t/g
2010-10-08 20:31:35 +00:00
Pyun YongHyeon 9d7989f124 MFC r212109,212124,212185:
r212109:
  bus_dma(9) cleanup.
   o Enforce TX/RX descriptor ring alignment. NS data sheet says the
     controller needs 4 bytes alignment but use 16 to cover both SiS
     and NS controllers. I don't have SiS data sheet so I'm not sure
     what is alignment restriction of SiS controller but 16 would be
     enough because it's larger than the size of a TX/RX descriptor.
     Previously sis(4) ignored the alignment restriction.
   o Enforce RX buffer alignment, 4.
     Previously sis(4) ignored RX buffer alignment restriction.
   o Limit number of TX DMA segment to be used to 16. It seems
     controller has no restriction on number of DMA segments but
     using more than 16 looks resource waste.
   o Collapse long mbuf chains with m_collapse(9) instead of calling
     expensive m_defrag(9).
   o TX/RX side bus_dmamap_load_mbuf_sg(9) support and remove
     unnecessary callbacks.
   o Initial endianness support.
   o Prefer local alignment fixup code to m_devget(9).
   o Pre-allocate TX/RX mbuf DMA maps instead of creating/destroying
     these maps in fast TX/RX path. On non-x86 architectures, this is
     very expensive operation and there is no need to do that.
   o Add missing bus_dmamap_sync(9) in TX/RX path.
   o watchdog is now unarmed only when there are no pending frames
     on controller. Previously sis(4) blindly unarmed watchdog
     without checking the number of queued frames.
   o For efficiency, loaded DMA map is reused for error frames.
   o DMA map loading failure is now gracefully handled. Previously
     sis(4) ignored any DMA map loading errors.
   o Nuke unused macros which are not appropriate for endianness
     operation.
   o Stop embedding driver maintained structures into descriptor
     rings. Because TX/RX descriptor structures are shared between
     host and controller, frequent bus_dmamap_sync(9) operations are
     required in fast path. Embedding driver structures will increase
     the size of DMA map which in turn will slow down performance.

r212124:
  Fix stupid error in r212109 which didn't swap DMA maps. This caused
  IOMMU panic on sparc64 under high TX load.

r212185:
  Fix another bug introduced in r212109. We should unload DMA maps
  only after sending the last fragment of a frame so the mbuf pointer
  also should be stored in the last descriptor index.
2010-10-08 20:27:51 +00:00
Pyun YongHyeon b2e07ab223 MFC r212103-212105:
r212103:
  Remove leading and trailing white spaces.
  No functional changes.

r212104:
  style(9) - space after keywords.

r212105:
  Nuke unnecessary return at the end of function.
2010-10-08 20:13:42 +00:00
Pyun YongHyeon 8c43d4244c MFC r182065:
There actually were bugs in the original handling that I missed last
  night.

  Free the children after each pci bus that is searched.  Otherwise we
  leak them.  With free in the new place, we also have to free children
  before going to done when we find the device we're looking for.

  Also, if we can't get the children of a device, just ignore that bus.
2010-10-08 20:12:00 +00:00
Pyun YongHyeon f0bf00d962 MFC r212972,21300:
r212972:
  Remove unnecessary controller reinitialization.

  PR:	kern/87506

r213000:
  Fix build breakage introduced in r212972.
2010-10-08 19:34:23 +00:00
Pyun YongHyeon b2f3fb8b14 MFC r212971:
Remove unnecessary controller reinitialization.
  StarFire controller does not require controller reinitialization to
  program perfect filters. While here, make driver immediately exit
  from interrupt/polling handler if driver reinitialized controller.

  PR:	kern/87506
2010-10-08 19:29:17 +00:00
Pyun YongHyeon 38d1bcec10 MFC r212969:
Make sure to clear IFF_DRV_RUNNING to reinitialize controller.
  While I'm here update if_oerrors counter when driver encounters
  watchdog timeout.
2010-10-08 19:25:46 +00:00
Pyun YongHyeon 673ba9762e MFC r212968:
Remove unnecessary controller reinitialization.

  PR:	kern/87506
2010-10-08 19:21:16 +00:00
Pyun YongHyeon 89d01873be MFC r212306-212307,212342:
r212306:
  Remove trailing CR at EOL.

r212307:
  Consistently use tab characters instead of tab + space characters.
  No functional changes.

r212342:
  Correct definition of T2 mode bit of MRBE Message Page 5 Next Page
  Control Register.
2010-10-08 19:00:36 +00:00
Pyun YongHyeon dc93379bf4 MFC r212069,212071:
r212069:
  bge_txeof() already checks whether it has to free transmitted mbufs
  or not by comparing reported TX consumer index with saved index. So
  remove unnecessary check done after freeing transmitted mbufs.
  While I'm here nuke unnecessary variable initializations.

r212071:
  Remove unnecessary atomic operation in bge_poll. bge(4) always
  holds a driver lock in the function entry and
  memory synchronization is handled by bus_dmamap_sync(9).
2010-10-08 18:51:28 +00:00
Pyun YongHyeon 3a9d3553e5 MFC r212061,212065,212302:
r212061:
  Split common parent DMA tag into ring DMA tag and TX/RX mbuf DMA
  tag. All controllers that are not BCM5755 or higher have 4GB
  boundary DMA bug. Previously bge(4) used 32bit DMA address to
  workaround the bug(r199670). However this caused the use of bounce
  buffers such that it resulted in poor performance for systems which
  have more than 4GB memory. Because bus_dma(9) honors boundary
  restriction requirement of DMA tag for dynamic buffers, having a
  separate TX/RX mbuf DMA tag will greatly reduce the possibility of
  using bounce buffers. For DMA buffers allocated with
  bus_dmamem_alloc(9), now bge(4) explicitly checks whether the
  requested memory region crossed the boundary or not.
  With this change, only the DMA buffer that crossed the boundary
  will use 32bit DMA address. Other DMA buffers are not affected as
  separate DMA tag is created for each DMA buffer.
  Even if 32bit DMA address space is used for a buffer, the chance to
  use bounce buffer is still very low as the size of buffer is small.
  This change should eliminate most usage of bounce buffers on
  systems that have more than 4GB memory.

  More correct fix would be teaching bus_dma(9) to honor boundary
  restriction for buffers created with bus_dmamem_alloc(9) but it
  seems that is not easy.

  While I'm here cleanup bge_dma_map_addr() and remove unnecessary
  member variables in bge_dmamap_arg structure.

  Tested by:	marcel

r212065:
  Handle PAE case correctly. You cannot effectively specify a 4GB
  boundary in PAE case so use a 2GB boundary for PAE as suggested by
  jhb.

  Pointed out by:	jhb
  Reviewed by:	jhb

r212302:
  Make sure to create DMA'able memory for statistics block. This was
  missed in r212061 and it caused crashes for 570x controllers as
  controller DMAed statistics to physical address 0.

  Reported by:	kan
2010-10-08 18:46:02 +00:00
Pyun YongHyeon 558b019652 MFC r188392:
Destroy TX tag outside of loop scope.

  Found with:	Coverity Prevent(tm)
  CID:		3886
2010-10-08 18:31:56 +00:00
Pyun YongHyeon 12191c6347 MFC r213306:
Rename rl_setmulti() to rl_rxfilter() as rl_rxfilter() will handle
  IFF_ALLMULTI/IFF_PROMISC as well as multicast filter configuration.
  Rewrite RX filter logic to reduce number of register accesses and
  make it handle promiscuous/allmulti toggling without controller
  reinitialization.

  Previously rl(4) counted on controller reinitialization to reprogram
  promiscuous configuration but r211767 resulted in avoiding
  controller reinitialization whenever promiscuous mode is toggled.
  To address this, keep track of driver's view of interface state and
  handle IFF_ALLMULTI/IFF_PROMISC changes without reinitializing
  controller. This should fix a regression introduced in r211267.

  While I'm here remove unnecessary variable reassignment in ioctl
  handler.

  PR:	kern/151079
2010-10-08 18:26:14 +00:00
Matthew D Fleming 8d9ecdfa74 MFC r212926:
Use destroy_dev_sched(9) instead of destroy_dev(9) in passcleanup() as
it is indirectly a d_close method.
2010-10-08 18:06:30 +00:00
Andriy Gapon a772717cce MFC r213322: sysctls in kern_shutdown: add twin tunables 2010-10-08 08:14:43 +00:00
Andriy Gapon c7233cddc0 MFC r213305: there must be only one SYSINIT with
SI_SUB_RUN_SCHEDULER+SI_ORDER_ANY order
2010-10-08 08:09:45 +00:00
Andriy Gapon 0039f4ab72 MFC r213304: debug.kdb.stop_cpus sysctl: hint that this is also a
tunable
2010-10-08 07:58:57 +00:00
Andriy Gapon bcd6e153f6 MFC r213303: kmem_size* sysctls: hint that these are also tunables 2010-10-08 07:54:55 +00:00
David Xu d328c917de MFC r213258:
- kern_sched_rr_get_interval should return interval for thread 1 in
      target process.
- eliminate a goto.
2010-10-07 13:13:02 +00:00
David Xu 70c2e4da44 MFC r211833:
Decrease rdlock count only when thread unlocked a reader lock.
2010-10-07 12:57:16 +00:00
Xin LI 6ba5b27ed0 MFC r211059:
Address an edge condition that we found at work, where the carp(4)
interface goes to issue LINK_UP, then LINK_DOWN, then LINK_UP at
cold boot.  This behavior is not observed when carp(4) interface
is created slightly later, when the underlying interface is fully
up.

Before this change what happen at boot is roughly:

 - ifconfig creates em0 interface;
 - ifconfig clones a carp device using em0;
   (em0's link state is DOWN at this point)
 - carp state: INIT -> BACKUP [*]
 - carp state: BACKUP -> MASTER
 - [Some negotiate between em0 and switch]
 - em0 kicks up link state change event
   (em0's link state is now up DOWN at this point)
 - do_link_state_change() -> carp_carpdev_state()
 - carp state: MASTER -> INIT (via carp_set_state(sc, INIT)) [+]
 - carp state: INIT -> BACKUP
 - carp state: BACKUP -> MASTER

At the [*] stage, em0 did not received any broadcast message from other
node, and assume our node is the master, thus carp(4) sets the link
state to "UP" after becoming a master.  At [+], the master status
is forcely set to "INIT", then an election is casted, after which our
node would actually become a master.

We believe that at the [*] stage, the master status should remain as
"INIT" since the underlying parent interface's link state is not up.

Obtained from:  iXsystems, Inc.
Reported by:    jpaetzel
2010-10-07 00:37:40 +00:00
Xin LI 6d10ecfbf2 MFC r210344:
In the past gunzip(1) write()'s after each inflate return.  This is
not optimal from a performance standpoint since the write buffer is
not necessarily be filled up when the inflate rountine reached the
end of input buffer and it's not the end of file.

This problem gets uncovered by trying to pipe gunzip -c output to
a GEOM device directly, which enforces the writes be multiple of
sector size.

Sponsored by: iXsystems, Inc.
Reported by:  jpaetzel
2010-10-07 00:30:29 +00:00
Marius Strobl 6c11915d3f MFC: r213105, r213147
Improve r56796; the reply handler actually may remove the request from
the chain in which case it shouldn't be removed twice.
Reported by:	Staale Kristoffersen
2010-10-04 20:13:21 +00:00
Marius Strobl 698e72fe0f MFC: r213102
Remove the duplicate logging of failed read requests, whose error message
also was inappropriate as it triggered for every EACCESS and ENOTFOUND, not
just the case the -n option is intended to deal with and thus really spammed
us with ~20 messages in the default configuration when booting a diskless
FreeBSD client, introduced with r207608 commited to stable/7 in r213039)
again.
2010-10-04 20:02:54 +00:00
Marius Strobl 2bbbc918b5 MFC: r213099
Make WARNS=6 clean.
2010-10-04 19:59:11 +00:00
Marius Strobl 7568141cb6 MFC: r213075
Try to adhere to style.Makefile(5).
2010-10-04 19:51:16 +00:00
Marius Strobl 302bc3b614 MFC: r213053
Remove an explicit assignment of the CFLAGS variable intended for
debugging purposes only.
2010-10-04 19:40:01 +00:00
Bernhard Schmidt 000150aee2 Create the var/run/wpa_supplicant directory where the wpa_supplicant
RC script wants to save a pidfile for each interface.
2010-10-01 17:20:30 +00:00
Edwin Groothuis 41b6fcf3f3 MFC of 213312, tzdata2010m
- Fix historical data for Hongkong
- Fix location description for Antarctica/Vostok
2010-09-30 22:03:33 +00:00
Andriy Gapon 88aa887704 MFC r212993: acpi_attach: do not explicitly install default handlers for
default address spaces
2010-09-29 09:25:22 +00:00
Mike Silbersack 15f484cd13 MFC rev 198719: Fix sym driver for 64-bit platforms with > 4GB of ram. 2010-09-28 06:08:43 +00:00
Andriy Gapon 0f28cdd3bd MFC r212932,212949: tools/umastat: fix build on amd64 and more
PR:		misc/146119
2010-09-28 05:57:50 +00:00
Pyun YongHyeon 232910c04b MFC r211913:
Do not allocate multicast array memory in multicast filter
  configuration function. For failed memory allocations, em(4)/lem(4)
  called panic(9) which is not acceptable on production box.
  igb(4)/ixgb(4)/ix(4) allocated the required memory in stack which
  consumed 768 bytes of stack memory which looks too big.

  To address these issues, allocate multicast array memory in device
  attach time and make multicast configuration success under any
  conditions. This change also removes the excessive use of memory in
  stack.

  Reviewed by:	jfv
2010-09-27 18:34:04 +00:00
Pyun YongHyeon 7b79cb9e33 MFC r211909:
If em(4) failed to allocate RX buffers, do not call panic(9).
  Just showing some buffer allocation error is more appropriate
  action for drivers. This should fix occasional panic reported on
  em(4) when driver encountered resource shortage.

  Reviewed by:	jfv
2010-09-27 18:22:50 +00:00
Pyun YongHyeon 29648f5378 MFC r211907:
Do not call voluntary panic(9) in case of if_alloc() failure.

  Reviewed by:	jfv
2010-09-27 18:20:04 +00:00
Pyun YongHyeon e11e6fb939 MFC r211400:
Remove unnecessary clean target in em(4), igb(4) and ixgbe(4).
  While here also remove man target in igb(4).

  Reviewed by:	jfv
2010-09-27 17:38:30 +00:00
Pyun YongHyeon dfbbbc9557 MFC r212755:
Fix incorrect RX BD producer updates. The producer index was
  already updated after allocating mbuf so driver had to use the last
  index instead of using next producer index. This should fix driver
  hang which may happen under high network load.

  Reported by:	Igor Sysoev <is <> rambler-co dot ru>, Vlad Galu <dudu <> dudu dot ro>
  Tested by:	Igor Sysoev <is <> rambler-co dot ru>, Vlad Galu <dudu <> dudu dot ro>
2010-09-27 17:12:54 +00:00
John Baldwin 32f0e1ff2d MFC 212902:
Tweak the stats exported by the e1000 drivers:
- Add a single sysctl procedure to all three drivers to read an arbitrary
  register (the register is passed as arg2).  Use it to replace existing
  routines in igb(4) that used a separate routine for each register, and
  to add support for missing stats in em(4) and lem(4).
- Move the 'rx_overruns' and 'watchdog_timeouts' stats out of the MAC stats
  section as they are driver stats, not MAC counters.
- Simplify the code that creates per-queue stats in igb(4) to use a single
  loop and remove duplicated code.
- Properly read all 64 bits of the 'good octets received/transmitted' in
  em(4) and lem(4).
- Actually read the interrupt count registers in em(4), and drop the
  'host to card' sysctl stats from em(4) as they are not implemented in
  any of the hardware this driver supports.
- Restore several stats to em(4) that were lost in the earlier stats
  conversion including per-queue stats.
- Export several MAC stats in em(4) that were exported in igb(4) but not
  in em(4).
- Export stats in lem(4) using individual sysctls as in em(4) and igb(4).
2010-09-27 16:29:46 +00:00
Andriy Gapon aa648ec706 MFC r212544: bus_add_child: add specialized default implementation that
calls panic
2010-09-27 06:04:17 +00:00
Xin LI d3991b56da MFC r211393 (by des):
In setusercontext(), do not apply user settings unless running as the
user in question (usually but not necessarily because we were called
with LOGIN_SETUSER).  This plugs a hole where users could raise their
resource limits and expand their CPU mask.

Approved by:	des
2010-09-24 23:48:29 +00:00
Pyun YongHyeon 02791da0e9 MFC r191609:
remove dead code with reference to IFQ_HANDOFF
2010-09-24 20:08:59 +00:00
Pyun YongHyeon afe4048d1a MFC r195484:
Make xl(4) build with Tx checksum offload.

  PR:	kern/136409
2010-09-24 20:04:23 +00:00
Pyun YongHyeon 8db488f21b MFC r211768:
Remove unnecessary controller reinitialization.

  PR:	kern/87506
2010-09-24 19:31:53 +00:00
Pyun YongHyeon 2e7fdcbcff MFC r211767:
Remove unnecessary controller reinitialization.

  PR:	kern/87506
2010-09-24 19:29:01 +00:00
Pyun YongHyeon 1459ed3ef1 MFC r211766:
vr_init_locked() will stop and reset the controller. Remove
  unnecessary vr_stop()/vr_reset() calls.
2010-09-24 19:26:27 +00:00
Pyun YongHyeon 04dafe97c3 MFC r211765:
Remove unnecessary controller reinitialization.
  CAM filter handling was rewritten long time ago so it should not
  require controller reinitialization.

  PR:	kern/87506
2010-09-24 19:22:41 +00:00
Pyun YongHyeon cb35fa1c75 MFC r211764:
Add PNP id for Compex RL2000.
  I'm not sure whether adding this logical id is correct or not
  because Compex RL2000 is in the list of supported hardware list.
  I guess the Compex RL2000 could be PCI variant while the controller
  in question is ISA controller. It seems PNP compat id didn't match
  or it had multiple compat ids so isa_pnp_probe() seemed to return
  ENOENT.

  PR:	kern/80853
2010-09-24 19:18:03 +00:00
Pyun YongHyeon 3095edd178 MFC r211721:
Fix a possible unaligned access to savebyte array.

  PR:	kern/122195
2010-09-24 19:14:59 +00:00
Pyun YongHyeon 09f2d99033 MFC r211717:
Implement basic WOL support. Note, not all xl(4) controllers
  support WOL. Some controllers require additional 3-wire auxiliary
  remote wakeup connector to draw power. More recent xl(4)
  controllers may not need the wakeup connector though.
2010-09-24 19:11:22 +00:00
Pyun YongHyeon 05b87548ce MFC r211716:
Move xl_reset() to xl_init_locked(). This will make driver
  initialize controller from a known good state. Previously driver
  used to issue controller reset while TX/RX DMA are in progress.
  I guess resetting controller in active TX/RX DMA cycle is to ensure
  stopping I/Os in xl_shutdown(). I remember some buggy controllers
  didn't respond with stop command if controller is under high
  network load at the time of shutdown so resetting controller was
  the only safe way to stop the I/Os. However, from my experiments,
  controller always responded with stop command under high network
  load so I think it's okay to remove the xl_reset() in
  device_shutdown handler.
  Resetting controller also will clear configured RX filter which
  in turn will make WOL support hard because driver have to reprogram
  RX filter in WOL handler as well as setting station address.
2010-09-24 19:07:14 +00:00
Pyun YongHyeon 50ff7133bc MFC r211671:
Remove unnecessary controller reinitialization by checking
  IFF_DRV_RUNNING flag.
2010-09-24 19:00:15 +00:00
Pyun YongHyeon 81f8e1a6f4 MFC r211670:
Clean up SIOCSIFCAP handler and allow RX checksum offloading could
  be controlled by user.
2010-09-24 18:54:06 +00:00
Pyun YongHyeon 5a22df0123 MFC r211597:
Document newly introduced tunable dev.bge.%d.forced_udpcsum.
  While I'm here also mention tunable dev.bge.%d.forced_collapse.
2010-09-24 18:14:22 +00:00
Pyun YongHyeon 672b0ce0ff MFC r211596:
It seems all Broadcom controllers have a bug that can generate UDP
  datagrams with checksum value 0 when TX UDP checksum offloading is
  enabled.  Generating UDP checksum value 0 is RFC 768 violation.
  Even though the probability of generating such UDP datagrams is
  low, I don't want to see FreeBSD boxes to inject such datagrams
  into network so disable UDP checksum offloading by default.  Users
  still override this behavior by setting a sysctl variable or loader
  tunable, dev.bge.%d.forced_udpcsum.

  I have no idea why this issue was not reported so far given that
  bge(4) is one of the most commonly used controller on high-end
  server class systems. Thanks to andre@ who passed the PR to me.

  PR:	kern/104826
2010-09-24 18:01:43 +00:00
Pyun YongHyeon 08c1f2d587 MFC r211594:
Load tunable from loader.conf(5) instead of device.hints(5).
2010-09-24 17:56:12 +00:00
Andriy Gapon 31da5ef5c2 MFC r212789: nextboot: warn about limitations of /boot/nextboot.conf on ZFS 2010-09-24 07:29:29 +00:00
Jilles Tjoelker de5dc86fa5 MFC r212419: test(1): Fix markup, ( and ) must be separate arguments
so leave spaces.
2010-09-23 19:38:08 +00:00
Jilles Tjoelker 4ceaee9197 MFC r212418: test(1): Clarify grammar ambiguity and -a/-o vs shell &&/||. 2010-09-23 19:36:34 +00:00
Jilles Tjoelker d56787f4a6 MFC r212390: expr(1): Add sh(1) versions of examples, remove an incorrect
example.

The three examples are better done using sh(1) itself these days.

The example
  expr -- "$a" : ".*"
is incorrect in the general case, as "$a" may be an operator.
2010-09-23 19:21:49 +00:00
Xin LI ddf8f59359 MFC r212764:
status bits should be &'ed against status to be really functional.

Reported by:	Jike Song
Reviewed by:	yongari
2010-09-23 01:38:52 +00:00
Jung-uk Kim 39b243432c MFC: r212806
Rework r210248.  Although it fixed most of problems, it did not fix one
particular edge case where X-axis resolution is not multiple of font width.
Now we just advance enough scan lines, then deduct a partial scan line.
It is more intuitive than the previous code.  Apply the same wisdom to EGA
and VGA planar renderers for consistency.
2010-09-22 22:17:39 +00:00
Marius Strobl f7b1827a3c MFC: r207608, r207614, r212651, r212665
Go ahead and merge the work edwin@ on tftpd into the tree.  It is a
lot better than what's in the tree now.  Edwin tested it at a prior
employer, but can't test it today.  I've found that it works a lot
better with the various uboot versions that I've used in my embedded
work.  Here's the pkg-descr from the port that describes the changes:

It all started when we got some new routers, which told me the
following when trying to upload configuration or download images
from it: The TFTP server doesn't support the blocksize option.

My curiousity was triggered, it took me some reading of RFCs and
other documentation to find out what was possible and what could
be done. Was plain TFTP very simple in its handshake, TFTP with
options was kind of messy because of its backwards capability: The
first packet returned could either be an acknowledgement of options,
or the first data packet.

Going through the source code of src/libexec/tftpd and going through
the code of src/usr.bin/tftp showed that there was a lot of duplicate
code, and the addition of options would only increase the amount
of duplicate code. After all, both the client and the server can
act as a sender and receiver.

At the end, it ended up with a nearly complete rewrite of the tftp
client and server. It has been tested against the following TFTP
clients and servers:

- Itself (yay!)
- The standard FreeBSD tftp client and server
- The Fedora Core 6 tftp client and server
- Cisco router tftp client
- Extreme Networks tftp client

It supports the following RFCs:

RFC1350 - THE TFTP PROTOCOL (REVISION 2)
RFC2347 - TFTP Option Extension
RFC2348 - TFTP Blocksize Option
RFC2349 - TFTP Timeout Interval and Transfer Size Options
RFC3617 - Uniform Resource Identifier (URI) Scheme and Applicability
          Statement for the Trivial File Transfer Protocol (TFTP)

It supports the following unofficial TFTP Options as described at
http://www.compuphase.com/tftp.htm:

blksize2 - Block size restricted to powers of 2, excluding protocol headers
rollover - Block counter roll-over (roll back to zero or to one)

From the tftp program point of view the following things are changed:

- New commands: "blocksize", "blocksize2", "rollover" and "options"
- Development features: "debug" and "packetdrop"

If you try this tftp/tftpd implementation, please let me know if
it works (or doesn't work) and against which implementaion so I can
get a list of confirmed working systems.

Author: Edwin Groothuis <[email protected]>
2010-09-22 21:54:34 +00:00
Marius Strobl 77d9124d23 MFC: r207607, r207621, r209112, r209550, r209551
Go ahead and merge the work edwin@ on tftpd into the tree.  It is a
lot better than what's in the tree now.  Edwin tested it at a prior
employer, but can't test it today.  I've found that it works a lot
better with the various uboot versions that I've used in my embedded
work.  Here's the pkg-descr from the port that describes the changes:

It all started when we got some new routers, which told me the
following when trying to upload configuration or download images
from it: The TFTP server doesn't support the blocksize option.

My curiousity was triggered, it took me some reading of RFCs and
other documentation to find out what was possible and what could
be done. Was plain TFTP very simple in its handshake, TFTP with
options was kind of messy because of its backwards capability: The
first packet returned could either be an acknowledgement of options,
or the first data packet.

Going through the source code of src/libexec/tftpd and going through
the code of src/usr.bin/tftp showed that there was a lot of duplicate
code, and the addition of options would only increase the amount
of duplicate code. After all, both the client and the server can
act as a sender and receiver.

At the end, it ended up with a nearly complete rewrite of the tftp
client and server. It has been tested against the following TFTP
clients and servers:

- Itself (yay!)
- The standard FreeBSD tftp client and server
- The Fedora Core 6 tftp client and server
- Cisco router tftp client
- Extreme Networks tftp client

It supports the following RFCs:

RFC1350 - THE TFTP PROTOCOL (REVISION 2)
RFC2347 - TFTP Option Extension
RFC2348 - TFTP Blocksize Option
RFC2349 - TFTP Timeout Interval and Transfer Size Options
RFC3617 - Uniform Resource Identifier (URI) Scheme and Applicability
          Statement for the Trivial File Transfer Protocol (TFTP)

It supports the following unofficial TFTP Options as described at
http://www.compuphase.com/tftp.htm:

blksize2 - Block size restricted to powers of 2, excluding protocol headers
rollover - Block counter roll-over (roll back to zero or to one)

From the tftp program point of view the following things are changed:

- New commands: "blocksize", "blocksize2", "rollover" and "options"
- Development features: "debug" and "packetdrop"

If you try this tftp/tftpd implementation, please let me know if
it works (or doesn't work) and against which implementaion so I can
get a list of confirmed working systems.

Author: Edwin Groothuis <[email protected]>
2010-09-22 21:54:16 +00:00
Marius Strobl 283adc1c32 MFC: r183858
ANSIfy, plus constify interfaces where possible.
2010-09-22 21:44:55 +00:00
Marius Strobl df33d23f18 MFC: r183857
Use strlcpy() instead of strncpy() when we want the string to be
NUL-terminated.
2010-09-22 21:43:48 +00:00
Marius Strobl 64cce1724f MFC: r205076 (partial)
Fix several typos in macros or macro misusage.

Found by:	make manlint
Reviewed by:	ru
Approved by:	philip (mentor)
2010-09-22 21:06:43 +00:00
Marius Strobl fe6e81459a MFC: r173854
Add "with" to make the line go smoother.
2010-09-22 21:02:51 +00:00
Marius Strobl a52a51aebb MFC: r173852
Add the -W options, which acts the same as -w but will generate
unique names based on the submitted filename, a strftime(3) format
string and a two digit sequence number.

By default the strftime(3) format string is %Y%m%d (YYYYMMDD), but
this can be changed by the -F option.

PR:		bin/106049 (based on patch in that PR)
Approved by:	grog@ (mentor)
2010-09-22 20:27:59 +00:00
Marius Strobl 6db7da145b MFC: r212729
Merge from powerpc:
- Change putc_func_t to use a char instead of an int for the character.
- Make functions and variables not used outside of this source file static.
- Remove unused prototypes and variables.
- The OFW read and seek methods take 3 and not 4 input arguments.
2010-09-22 20:17:34 +00:00
Marius Strobl 67b651041b MFC: r212725
Merge r207585 (MFC'ed to stable/7 in r208087) from cas(4):
- Don't probe for PHYs if we already know to use a SERDES. Unlike as with
  cas(4) this only serves to speed up the the device attach though and can
  only be determined via the OFW device tree but not from the VPD.
- Don't touch the MIF when using a SERDES.
- Add some missing bus space barriers, mainly in the PCS code path.
2010-09-22 20:15:38 +00:00
Marius Strobl 433ff30e69 MFC: rr212709, r212730
Add a VIS-based block copy function for SPARC64 V and later, which
additionally takes advantage of the prefetch cache of these CPUs.
Unlike the uncommitted US-III version, which provide no measurable
speedup or even resulted in a slight slowdown on certain CPUs models
compared to using the US-I version with these, the SPARC64 version
actually results in a slight improvement.
2010-09-22 20:04:03 +00:00
Marius Strobl f2d112e2b1 MFC: r212705
Add macros for alternate entry points.
2010-09-22 20:01:35 +00:00
Marius Strobl 7cb93c2eac MFC: r212676
Sync with other platforms:
- make dflt_lock() always panic,
- add kludge to use contigmalloc() when the alignment is larger than the size
  and print a diagnostic when we didn't satisfy the alignment.
2010-09-22 19:59:11 +00:00
Marius Strobl 80db58621d MFC: r212663
- Update the comment in swi_vm() regarding busdma bounce buffers; it's
  unlikely that support for these ever will be implemented on sparc64 as
  the IOMMUs are able to translate to up to the maximum physical address
  supported by the respective machine, bypassing the IOMMU is affected
  by hardware errata and being able to support DMA engines which cannot
  do at least 32-bit DMA does not justify the costs.
- The page zeroing in uma_small_alloc() may use the VIS-based block zero
  function so take advantage of it.
2010-09-22 19:55:40 +00:00
Tijl Coosemans 07fce511c2 MFC r212286:
GCC defines built-ins for atomic instructions found on i486 and higher.
Because FreeBSD no longer supports the 80386 cpu all code targeting
FreeBSD/i386 necessarily runs on i486 or higher so the compiler
built-ins can be used by default inside libstdc++ and in C++ headers.
This allows newly compiled C++ code to inline some atomic operations.
Old binaries continue to use libstdc++ functions.

Approved by:	kib (mentor)
2010-09-21 12:57:43 +00:00
Brian Somers 567e2c8422 MFC r212253: Document how to use dhclient-{enter,exit}-hooks.
PR:		149351
2010-09-21 07:44:40 +00:00
John Baldwin 2033c01df0 MFC 212293:
Store the full timestamp when caching timestamps of files and
directories for purposes of validating name cache entries.  This
closes races where two updates to a file or directory within the same
second could result in stale entries in the name cache.

To preserve the ABI of 'struct nfsnode', the existing timestamp fields
are left with 'n_unusedX' placeholders along with the unused 'n_expiry'
field.  The larger n_ctime and n_dmtime fields are added to the end of
the structure.
2010-09-20 19:59:08 +00:00
John Baldwin 79572a19e2 MFC 209907,212326,212368,212749:
- Provide more defines for PCI-Express device ctrl.
- Add register definitions related to extended capability IDs in
  PCI-express.  I used PCIZ_* for ID constants (plain capability IDs use
  PCIY_*).
- Add register definitions for the Advanced Error Reporting, Virtual
  Channels, and Device Serial Number extended capabilities.
- Teach pciconf -c to list extended as well as plain capabilities for
  PCI-express devices.   Adds more detailed parsing for AER, VC, and
  device serial numbers.
2010-09-20 19:30:20 +00:00
John Baldwin b5e08a2d5a MFC 212369:
- Use 'sta' to hold the PCIR_STATUS register value instead of 'cmd' when
  walking the capability list.
- Use constants for PCI header types instead of magic numbers.
2010-09-20 19:25:27 +00:00
John Baldwin 93f9924bef MFC 212329:
Simplify chkattached().  The PCIOCATTACHED ioctl only needs the pi_sel
field populated, it ignores the rest of the 'pci_io' structure.
2010-09-20 19:17:31 +00:00
John Baldwin 952ba0f36c MFC 212338:
If autoboot_delay is set to -1, boot immediately without checking for
a keypress to match the behavior of the loader.
2010-09-20 18:58:44 +00:00
John Baldwin 88e89261e0 MFC 211888: Simplify the tcp pcblist estimate logic slightly. 2010-09-20 18:41:15 +00:00
Bjoern A. Zeeb a999f89d3b MFC r212403:
When using pf routing options, properly handle IP fragmentation
  for interfaces with TSO enabled, otherwise one would see an extra
  ICMP unreach, frag needed pre matching packet on lo0.
  This syncs pf code to ip_output.c r162084.

  Submitted by: yongari via mlaier

PR:	kern/144311
2010-09-20 18:26:37 +00:00
Colin Percival 4d070b3573 Fix an integer overflow in RLE length parsing when decompressing
corrupt bzip2 data.

Approved by:	so (cperciva)
Security:	FreeBSD-SA-10:08.bzip2
2010-09-20 14:58:08 +00:00
Alexander Motin 8277d029fd MFC r196415:
Fill cpi->transport in XPT_PATH_INQ.
2010-09-20 13:48:07 +00:00
Andriy Gapon a61e893139 MFC r212325: subr_bus: use hexadecimal representation for bit flags 2010-09-20 11:18:20 +00:00
Andriy Gapon 978d8f5950 MFC r212413: bus_add_child: change type of order parameter to u_int 2010-09-20 11:09:31 +00:00
Andriy Gapon 9024613b24 MFC r212213: struct device: widen type of flags and order fields to u_int 2010-09-20 05:58:55 +00:00
Andriy Gapon e398ab4c82 MFC r212549: acpi_cpu: do not apply P_LVLx_LAT rules to latencies
returned by _CST
2010-09-20 05:46:15 +00:00
Navdeep Parhar ee10e8f17e MFC r212710
Fix t3_gate_rx_traffic and t3_open_rx_traffic. Parts of them always operated
on XGMAC0 instead of the specified XGMAC.
2010-09-19 20:38:34 +00:00
Alexander Motin 98c613f608 MFC r201567:
Move wakeup() out of mutex to reduce contention.
2010-09-19 20:08:45 +00:00
Alexander Motin 508e97ef35 MFC r201545:
Slightly optimize XOR calculation.
2010-09-19 20:07:40 +00:00
Alexander Motin aea38f2dc5 MFC r196964:
Do not check proper request alignment here in geom_dev in production.
It will be checked any way later by g_io_check() in g_io_schedule_down().
It is only needed here to not trigger panic from additional check, when
INVARIANTS enabled. So cover it with #ifdef INVARIANTS. It saves two
64bit divisions per request.
2010-09-19 20:02:31 +00:00
Alexander Motin 7c889f99d9 MFC r174669:
Don't limit BIO_DELETE requests to MAXPHYS, they perform no data
transfers, so they are not subject to the VM system limitation.
2010-09-19 19:57:15 +00:00
Alexander Motin 586722648d MFC r205619:
Do not fetch precise time of request start when stats collection disabled.
2010-09-19 19:53:41 +00:00
Alexander Motin 533b588621 MFC r201264:
Call wakeup() only for the first request on the queue.
2010-09-19 19:52:26 +00:00
Alexander Motin 69e9b70a59 MFC r196904:
Remove msleep() timeout from g_io_schedule_up/down(). It works fine
without it, saving few percents of CPU on high request rates without
need to rearm callout twice per request.
2010-09-19 19:51:14 +00:00
Alexander Motin 687c2cc9bc MFC r201566:
Move wakeup() out of mutex to reduce contention.
2010-09-19 19:43:05 +00:00
Alexander Motin ee63929f1e MFC r199644:
Add some missing WDMA/UDMA modes.
2010-09-19 19:18:35 +00:00
Alexander Motin 0cd81532de MFC r194902, r197540, r198587, r198865:
Define some ATA IDENTIFY fields and bits.
2010-09-19 19:02:14 +00:00
Alexander Motin f20d2644ba MFC r209340:
Report transport type in XPT_PATH_INQ.
2010-09-19 13:49:02 +00:00
Alexander Motin f468001b99 MFC r209341:
Report transport type in XPT_PATH_INQ.
2010-09-19 13:44:46 +00:00
Alexander Motin 32038185d8 MFC r194900:
Remove unused ATAPI definitions, conflicting with ata.h.
2010-09-19 13:42:05 +00:00
Brian Somers bc82f106bb MFC r211864,211963,211964,211965, don't mis-handle path names of
101 characters beginning with '/'.
2010-09-19 11:22:22 +00:00
Marius Strobl c1c56ea31e MFC: r212620
Remove a KASSERT which will also trigger for perfectly valid combinations
of small maxsize and "large" (including BUS_SPACE_UNRESTRICTED) nsegments
parameters. Generally using a presz of 0 (which indeed might indicate the
use of bogus parameters for DMA tag creation) is not fatal, it just means
that no additional DVMA space will be preallocated.
2010-09-18 08:20:39 +00:00
Marius Strobl e1b1978615 MFC: r212619
Remove redundant raising of the PIL to PIL_TICK as the respective locore
code already did that.
2010-09-18 08:18:56 +00:00
Xin LI 635c0b2f17 MFC r211475:
Check return value of dup(), it could be -1 when the system is running
out of file descriptors for instance.

Found with:	Coverity Prevent(tm)
CID:		6084
2010-09-18 00:46:05 +00:00
Matthew D Fleming d30f607802 MFC r212153: Fix UP build. 2010-09-16 15:42:56 +00:00
Fabien Thomas a2f085a7e7 MFC r212176:
When an asm location cannot be resolved to a function the cost
will be spread as small value and then filtered by the threshold.
As a first step solution display the number of event that cannot
be resolved as a valid function location.
2010-09-16 15:22:30 +00:00
Fabien Thomas 9f96f67c5a MFC r212224:
Fix invalid class removal when IAF is not the last class.
Keep IAF class with 0 PMC and change the alias in libpmc to IAP.
2010-09-16 15:19:39 +00:00
Fabien Thomas bb00f4b601 MFC r212224:
Fix invalid class removal when IAF is not the last class.
 Keep IAF class with 0 PMC and change the alias in libpmc to IAP.
2010-09-16 15:18:46 +00:00
Marius Strobl bd046448b8 MFC: r208459
Use real atomic operations for sparc64.
2010-09-15 20:40:29 +00:00
Marius Strobl de7065aedd MFC: r210601 (partial), r211071, r211073
- As it is not possible for sched_bind(9) to context switch with
  td_critnest > 1 when not already running on the desired CPU read the
  TICK counter of the BSP via a direct cross trap request in that case
  instead.
- Provide a STICK based timecounter.
2010-09-15 20:17:20 +00:00
Marius Strobl 8d26d8c308 MFC: r211050 (partial)
- Introduce a cpu_ipi_single() function pointer in order to send IPIs
  to single CPUs more efficiently with Cheetah(-class) and Jalapeno CPUs.
- Factor out the Jalapeno support from the Cheetah IPI send functions
  in order to be able to more easily and efficiently implement support
  for more than 32 target CPUs as well as a workaround for Cheetah+
  erratum 25 for the latter.
2010-09-15 19:28:06 +00:00
Marius Strobl b21762295e MFC: r211049, r211568
For CPUs which ignore TD_CV and support hardware unaliasing don't
bother doing page coloring. This results in a small but measurable
performance improvement in buildworld times.
2010-09-15 18:51:15 +00:00
Marius Strobl 5c4ad679dd MFC: r210176
Allocate proper amount of memory for interrupt names on sparc64 and
sun4v, same as done on other architectures. This removes garbage from
`vmstat -ia` output.
2010-09-15 18:09:15 +00:00
Marius Strobl 8e726074c4 MFC: r208515
Fix some whitespace nits.
2010-09-15 17:39:15 +00:00
Xin LI baa677ddfe MFC r212008,212028,212210 the updated twa(4) driver minus maxio change
which depends on cam(4) revision r195534.

The change have been tested on stable/7 with 3ware 9650SE at iXsystems.
2010-09-15 17:25:51 +00:00
Matthew D Fleming 60e28f7825 MFC r212115:
Fix a bug with sched_affinity() where it checks td_pinned of another
thread in a racy manner, which can lead to attempting to migrate a
thread that is pinned to a CPU.  Instead, have sched_switch() determine
which CPU a thread should run on if the current one is not allowed.

KASSERT in sched_bind() that the thread is not yet pinned to a CPU.

KASSERT in sched_switch() that only migratable threads or those moving
due to a sched_bind() are changing CPUs.

Note that this is direct commit as ipi_cpu() only exists in CURRENT.
2010-09-15 15:55:58 +00:00
Matthew D Fleming 8558d01e13 Revert r212563, which was a MFC of r209053, as it introduced an unlocked
read/modify/write of b_vflags.  The unlocked access is fixed in CURRENT
and stable/8 by r211213 and its MFC, r212583.

Rather than MFC to stable/7, reverting the injecting code seems
preferable.
2010-09-15 15:33:51 +00:00
Andre Oppermann 84f6b5e5be MFC r211874:
Use timestamp modulo comparison macro for automatic receive buffer
  scaling to correctly handle wrapping of ticks value.
2010-09-15 09:38:42 +00:00
Andriy Gapon d9fe885b3b MFC r211762: zfs arc_reclaim_thread: no need to call arc_reclaim_needed
when resetting needfree
2010-09-15 08:07:58 +00:00
Glen Barber f1f6eec2d8 MFC 212269.
Add ECONNRESET to connect(2).

Approved by:	keramida (mentor)
2010-09-13 17:28:35 +00:00
Matthew D Fleming 15c9a9682c MFC r209053:
Add INVARIANTS checking that numfreebufs values are sane.  Also add a
per-buf flag to catch if a buf is double-counted in the free count.
This code was useful to debug an instance where a local patch at Isilon
was incorrectly managing numfreebufs for a new buf state.
2010-09-13 17:23:18 +00:00
Glen Barber 2c847dc294 MFC 212241.
Note that jail_list should contain alphanumeric characters only.

PR:		150098
Approved by:	keramida (mentor)
2010-09-12 18:50:57 +00:00
Rebecca Cran 6b922d9427 MFC r182194:
Add geom_journal

PR:		conf/126829
Approved by:	rrs (mentor)
2010-09-11 14:46:19 +00:00
Rebecca Cran bb1cd9f0c4 MFC r211415:
Add -m and -M options to control the minimum and maximum frequency.

PR:		bin/145063
Submitted by:	Boris Kochergin <spawk at acm.poly.edu>
Approved by:	rrs (mentor)
2010-09-11 14:39:53 +00:00
Rebecca Cran 1356f82cdc MFC r211419:
Since top displays the uptime including seconds, there is no need to add 30
onto it, which may have been used for rounding purposes in other utilities.

PR:		bin/147934
Submitted by:	Janne Snabb <snabb at epipe.com>
Approved by:	rrs (mentor)
2010-09-11 14:29:31 +00:00
Rebecca Cran 6cb42d2e86 MFC r206909:
It's not necessary to reset the chip every time an input overflow event
occurs. In addition, the delay when programming the short cable fix
should be 100us, not 100ms.

PR:		kern/64556
Submitted by:	Thomas Hurst <tom at hur.st>
Approved by:	rrs (mentor)
2010-09-11 14:21:02 +00:00
Matthew D Fleming c721f4c877 MFC r211194, r211229, r212058, r212063: memguard(9) rewrite
r211194:

Rework memguard(9) to reserve significantly more KVA to detect
use-after-free over a longer time.  Also release the backing pages of
a guarded allocation at free(9) time to reduce the overhead of using
memguard(9).  Allow setting and varying the malloc type at run-time.
Add knobs to allow:

 - randomly guarding memory
 - adding un-backed KVA guard pages to detect underflow and overflow
 - a lower limit on the size of allocations that are guarded

r211229:

Fix compile.  It seemed better to have memguard.c include opt_vm.h in
case future compile-time knobs were added that it wants to use.
Also add include guards and forward declarations to vm/memguard.h.

r212058:

The realloc case for memguard(9) will copy too many bytes when
reallocating to a smaller-sized allocation.  Fix this issue.

r212063:

Have memguard(9) crash with an easier-to-debug message on double-free.
2010-09-10 21:53:47 +00:00
Bjoern A. Zeeb 8b2b9d0522 MFC r212155:
MFp4 CH=183052 183053 183258:

    In protosw we define pr_protocol as short, while on the wire
    it is an uint8_t.  That way we can have "internal" protocols
    like DIVERT, SEND or gaps for modules (PROTO_SPACER).
    Switch ipproto_{un,}register to accept a short protocol number(*)
    and do an upfront check for valid boundries. With this we
    also consistently report EPROTONOSUPPORT for out of bounds
    protocols, as we did for proto == 0.  This allows a caller
    to not error for this case, which is especially important
    if we want to automatically call these from domain handling.

    (*) the functions have been without any in-tree consumer
    since the initial introducation, so this is considered save.

    Implement ip6proto_{un,}register() similarly to their legacy IP
    counter parts to allow modules to hook up dynamically.

  Reviewed by:  philip, will
2010-09-09 06:44:22 +00:00
Jaakko Heinonen 1b012d4f50 MFC r208612: Fixes from NetBSD for nvi visual mode
PR:		bin/21089, bin/136393
2010-09-08 18:06:05 +00:00
Jaakko Heinonen 37aa58ed3a MFC r208611: Fix misspelling of "substitution".
PR:		bin/130874
2010-09-08 18:03:40 +00:00
Xin LI bb033ab503 MFC r205662 + r212066 (except efi part):
Our boot loader is capable of booting both i386 and amd64 kernels so
call it "x86" instead of "i386".
2010-09-07 18:14:50 +00:00
Jaakko Heinonen edd9ef08f0 MFC r211342:
- Check that strtoul(3) succeeds to convert the entire string in a few
  places.
- In getasciilabel(), set the disk type only when a valid type is given.

PR:		bin/86765
2010-09-06 15:48:06 +00:00
Kai Wang d6e055cdf6 MFC r210351-r210353,r211192.
r210351:
  * Note that ar(1) archives may also be opened using `elf_memory(3)`.
  * Ignore the passed in value of the `fd` argument for ar(1) archives
    opened with elf_memory(3).

r210352:
  Add a cross-reference to `elf_rawfile(3)`.

r210353:
  * Remove a superfluous error description.
  * Document an additional error that may be returned: `ELF_E_ARCHIVE`.

r211192:
  Add translation support for section type SHT_SUNW_dof.
2010-09-04 13:00:28 +00:00
Kai Wang aa6412a09b MFC r210344,r210345,r210348.
r210344:
  Avoid switching between "unsigned char" and "char" in the C code
  generated from "libelf_convert.m4".

r210345:
  * Deprecate `elf_getshnum()`, `elf_getphnum()` and `elf_getshstrndx()` in
    favour of `elf_getshdrnum()`, `elf_getphdrnum()` and `elf_getshdrstrndx()`
    respectively.
  * Add new manual pages for `elf_getshdrstrndx()`, `elf_getphdrnum()` and
    `elf_getshdrnum()`.
  * Add a deprecation warning for `elf_getshstrndx()`, `elf_getphnum()` and
    `elf_getshnum()`.

r210348:
  Move helper functions `_libelf_ar_get_{name,number,string}()` and
  `_libelf_ar_open()` to a new compilation unit "libelf_ar_util.c"
  to break the circular dependency between "elf_memory.o" and
  "libelf_ar.o".
2010-09-04 12:52:51 +00:00
Kai Wang 70d3c34710 MFC r210329,r210330,r210347.
r210329:
  Use <unistd.h> to declare the prototype for ftruncate().

r210330:
  Allow an application that updates only the ELF Ehdr to work.

r210347:
  Fix a memory leak.
2010-09-04 12:40:16 +00:00
Kai Wang 3f416ccbed MFC r210325,r210326,r210328,r210349
r210325:
  Bug fix: when updating headers using the gelf_update_*() functions,
  the appropriate `dirty' bit needs to be set for both the Elf32 and
  Elf64 case.

r210326:
  Improve compatibility with other implementations of the ELF(3) API:
  when an output file has no program headers, set the 'e_phentsize'
  field of the ELF executable header to zero.

r210328:
  Bug fix: permit the creation of zero-sized sections.

r210349:
  Remove a redundant word.
2010-09-04 12:19:25 +00:00
Kai Wang f639b9496e MFC r210324, r210438.
r210324:
  - Correctly handle sections of type SHT_NOBITS.  For these sections:
    - elf_getdata() and elf_rawdata() should return an "Elf_Data" structure
      that has its "d_buf" member set to NULL and "d_size" member set to
      the nominal 'size' of the section.
    - Update the manual page for these functions.
  - Fix a memory leak in an error handling path inside elf_getdata().
  - Use _libelf_allocate_data() in elf_newdata() for consistency.

r210438: (np)
  Catch up with r210324.  d_buf will be NULL for SHT_NOBITS sections, do not
  attempt to copy from it in that case.
2010-09-04 12:06:09 +00:00
Kai Wang 2ae10a93c5 MFC r210321:
Remove a superfluous comment.
2010-09-04 11:50:23 +00:00
John Baldwin 3afd1b1f87 MFC: Use VN_LOCK_* macros to manipulate vnode lock flags. 2010-09-03 21:16:16 +00:00
Jilles Tjoelker aeb519b298 MFC r211155: sh: Fix heap-based buffer overflow in pathname generation.
The buffer for generated pathnames could be too small in some cases. It
happened to be always at least PATH_MAX long, so there was never an overflow
if the resulting pathnames would be usable.

This bug may be abused if a script subjects input from an untrusted source
to pathname generation, which a bad idea anyhow. Most shell scripts do not
work on untrusted data. secteam@ says no advisory is necessary.

PR:		bin/148733
Reported by:	Changming Sun snnn119 at gmail com
2010-09-01 21:51:29 +00:00
John Baldwin ca8a2caf3f Fix the build with DEVICE_POLLING enabled. Poll handlers return void
instead of int on 7.x and earlier.

Pointy hat to:	jhb
2010-09-01 14:31:05 +00:00
John Baldwin 836d2c8b73 MFC 206429:
Sync em(4) and igb(4) drivers with 8 except for VF support:
- Remove unneeded rxtx handler, make que handler generic in igb.
- Do not allocate header mbufs in rx ring if not doing hdr split in igb.
- Release the lock in rxeof call to stack.
- Change rxeof api for poll friendliness, and eliminate unnecessary link
  tasklet use.
- Move statistics for em into sysctl tree.
- Reenable hardware checksum offload for VLAN frames in igb.
- Fix for a panic when TX checksum offload is done and a packet has only
  a header in the first mbuf in em.

Approved by:	jfv
2010-08-31 19:26:29 +00:00
Pyun YongHyeon b5d0e0bef5 MFC r211650,211667:
r211650:
  Document tunable dev.rl.%unit.prefer_iomap

r211667:
  Better wording and fix wrong explanation.

  Submitted by:	Ben Kaduk ( minimarmot <> gmail dot com )
2010-08-31 00:20:10 +00:00
Pyun YongHyeon acff7a8800 MFC r211648:
It seems some newer RTL8139 controllers provides only memory space
  register mapping. I'm not sure whether it comes from the fact that
  controllers live behind certain PCI brdge(PLX PCI 6152 33BC) and
  the bridge has some issues in handling I/O space register mapping.
  Unfortunately it's not possible to narrow down to an exact
  controller that shows this issue because RealTek used the same PCI
  device/revision id again. In theory, it's possible to check parent
  PCI bridge device and change rl(4) to use memory space register
  mapping if the parent PCI bridge is PLX PCI 6152. But I didn't try
  to do that and we wouldn't get much benefit with added complexity.

  Blindly switching to use memory space register mapping for rl(4)
  may make most old controllers not to work. At least, I don't want
  to take potential risk from such change. So use I/O space register
  mapping by default but give users chance to override it via a
  tunable. The tunable to use memory space register mapping would be
  given by adding the following line to /boot/loader.conf file.

  dev.rl.%d.prefer_iomap="0"

  This change makes P811B quad-port work with this tunable.
2010-08-31 00:16:30 +00:00
Pyun YongHyeon a05a4a2dec MFC r184560:
Document dev.rl.%unit.twister_enable sysctl/tunable.
2010-08-30 22:19:41 +00:00
Pyun YongHyeon 7264eb6d50 MFC r184515,184524,184559:
r184515:
  Add RL_TWISTER_ENABLE option.  This enables the magic bits to do long
  cable tuning.  This has helped in some installations for hardware
  deployed by a former employer.  Made optional because the lists aren't
  full of complaints about these cards... even when they were wildly
  popular.

r184524:
  Fix a few typos/spelling errors in my comments from the last commit,
  plus a few others that had lingered in this driver...

  Submitted by: "b." bf2006a att yahoo KIBO com

r184559:
  Make RL_TWISTER_ENABLE a tunable/sysctl.  Eliminate it as an option.
  Fix module build.
2010-08-30 22:17:06 +00:00
Pyun YongHyeon 2233b5ff50 MFC r211106:
Document newly added controller AR8151 and AR8152.
2010-08-30 21:18:57 +00:00
Pyun YongHyeon 442fa92151 MFC r211105:
Add support for Atheros AR8151/AR8152 PCIe gigabit/fast ethernet
  controller. These controllers are known as L1D(AR8151) and
  L2CB/B2(AR8152). This change adds supports for the following
  controllers.
   o AR8151 v1.0(L1D) gigabit ethernet controller
   o AR8151 v2.0(L1D) gigabit ethernet controller
   o AR8152 v1.1(L2CB) fast ethernet controller
   o AR8152 v2.0(L2CB2) fast ethernet controller
  These controllers have the same feature of AR8131/AR8132 and
  support improved power saving control. The user visible change at
  this moment is reduced jumbo frame size from 9KB to 6KB. Many
  thanks to Atheros for continuing to support FreeBSD.

  HW donated by:	Atheros Communications, Inc.
2010-08-30 21:17:11 +00:00
Pyun YongHyeon 2f68cbe609 MFC r211103:
Add F1 PHY found on Atheros AR8151 v2.0 PCIe gigabit ethernet
  controller.
2010-08-30 21:13:08 +00:00
Pyun YongHyeon bcdfe8e57e MFC r211047-211048,211051-211053,211285:
r211047:
  Controller does not seem to support more than 1024 bytes DMA burst.
  Limit DMA burst size to be less than or equal to 1024 bytes.

r211048:
  Do not touch CMB TX threshold register when CMB is not used.
  Note, alc(4) does not use CMB at all due to silicon bug.

r211051:
  Always disable ASPM L0s and enable L1 before entering into WOL
  suspend state.  Also disable master clock after PHY power down,
  this is supposed to save more power. The master clock should be
  enabled if WOL is active.

r211052:
  Remove unnecessary assignment.

r211053:
  Cache PCIY_PMG and PCIY_EXPRESS capability pointer to softc and use
  it instead of calling pci_find_extcap().

r211285:
  Make sure to disable RX MAC in alc_stop_mac(). Previously there
  was a logic error which it always enabled RX MAC.
2010-08-30 21:09:37 +00:00
Pyun YongHyeon f62fd2083c MFC r211046:
Marvell model number 0x06 is 88E1101 PHY.
2010-08-30 21:00:37 +00:00
Pyun YongHyeon 9b4e4a7b7c MFC r210905:
Reflect default Tx interrupt moderation timer value change(50ms -> 1ms).
2010-08-30 20:56:59 +00:00
Pyun YongHyeon 0ae5f15698 MFC r210904:
Reduce Tx interrupt moderation timer from 50ms to 1ms. The default
  value resulted in poor performance for UDP packets. With this
  change, UDP bulk transfer performance is more than 940Mbps.

  While I'm here fix a wrong register definition.
2010-08-30 20:52:28 +00:00
Xin LI 1f1260c98c MFC r210624 and r210833:
Improve cputemp(4) driver wrt newer Intel processors, especially
Xeon 5500/5600 series:

 - Utilize IA32_TEMPERATURE_TARGET, a.k.a. Tj(target) in place
   of Tj(max) when a sane value is available, as documented
   in Intel whitepaper "CPU Monitoring With DTS/PECI"; (By sane
   value we mean 70C - 100C for now);
 - Print the probe results when booting verbose;
 - Replace cpu_mask with cpu_stepping;
 - Use CPUID_* macros instead of rolling our own.

Catch known CPUs before using IA32_TEMPERATURE_TARGET.
This way we would have an opportunity to hide the
Tj(target) value doesn't seem right stuff if we know
it's not working there.

Add temperature value for Core2 Duo Extreme Mobile that
I have access to.
2010-08-30 18:53:12 +00:00
Xin LI d325720823 MFC r210665:
In rdmsr_safe, use zero extend (by doing a 32-bit movl over
eax to itself) instead of a sign extend.

Discussed with: stas
2010-08-30 18:50:18 +00:00
Hajimu UMEMOTO f14823e3f5 MFC r211340: Correct the return code from _dns_gethostby*()
to correspond with h_errno.
2010-08-29 03:55:39 +00:00
Hajimu UMEMOTO d46c871bd6 MFC r211276:
- When there is no room for returning the result, nss backend
  have to return ERANGE and terminate with NS_RETURN.
- When gethostbyname_r(3) and the friends end with an error,
  set errno to the value nss backend returns, and return errno
  value.

PR:		kern/131623
2010-08-28 17:12:52 +00:00
Jaakko Heinonen 235ed5226c MFC r204636:
In reallocf(3), free the memory only when size != 0. Otherwise, when the
System V compatibility option (malloc "V" flag) is in effect a zero sized
reallocf() could cause a double free.

PR:		bin/141753
2010-08-28 06:33:01 +00:00
Bjoern A. Zeeb 3b00aa65e1 MFC r211451:
When calculating the expected memory size for userspace, also take the
  number of syncache entries into account for the surplus we add to account
  for a possible increase of records in the re-entry window.

  Discussed with:		jhb, silby
2010-08-27 21:52:54 +00:00
John Baldwin 8af3ed3c83 MFC 210774,210935:
- Tweak the logic to disable CLFLUSH in virtual environments to work around
  problems with flushing the local APIC register range so that it checks
  vm_guest directly.
- Add Xen to the list of virtual vendors.  In the non PV (HVM) case this
  fixes the virtualization detection successfully disabling the CLFLUSH
  instruction.
2010-08-27 18:55:48 +00:00
John Baldwin 49542ffbc6 MFC 211433:
Ensure a minimum "slop" of 10 extra pcb structures when providing a
memory size estimate to userland for pcb list sysctls.  The previous
behavior of a "slop" of n/8 does not work well for small values of n
(e.g. no slop at all if you have less than 8 open UDP connections).
2010-08-27 18:50:32 +00:00
Andre Oppermann dfae7417d4 MFC r211464:
If a TCP connection has been idle for one retransmit timeout or more
  it must reset its congestion window back to the initial window.

  RFC3390 has increased the initial window from 1 segment to up to
  4 segments.

  The initial window increase of RFC3390 wasn't reflected into the
  restart window which remained at its original defaults of 4 segments
  for local and 1 segment for all other connections.  Both values are
  controllable through sysctl net.inet.tcp.local_slowstart_flightsize
  and net.inet.tcp.slowstart_flightsize.

  The increase helps TCP's slow start algorithm to open up the congestion
  window much faster.

  Reviewed by:	lstewart
  MFC after:	1 week
2010-08-27 10:16:32 +00:00
Andre Oppermann 350e68d863 MFC r211462:
Untangle the net.inet.tcp.log_in_vain and net.inet.tcp.log_debug
  sysctl's and remove any side effects.
2010-08-27 09:59:51 +00:00
Navdeep Parhar 5fe72d0e12 MFC r209839-209841, r211345-211347
r209839
Fix bufsize calculation so that cxgbtool can display information for the
last I/O queue too.

r209840
Eliminate ext_intr_task.  The "slow" interrupt handler is already
running on the adapter's task queue.  Just do what the task does
instead of enqueueing it.

r209841
Improved link detection.

r211345
wakeup is required if the adapter lock is released anywhere during
init and not just for the may_sleep case.

r211346
Always reset the XGMAC's XAUI PCS on a link up.

r211347
Fix tx pause quanta and timer calculations.
2010-08-27 02:46:21 +00:00
Navdeep Parhar 23284f2ba7 MFC r207643, r207687, r208887, r209115
r207643
T3 hardware filters.

r207687
Do not hold the T3 firmware in memory all the time.

r208887
tunable to control mc5 partition

r209115
make format string a string literal
2010-08-27 02:29:16 +00:00
Navdeep Parhar 3818c41827 MFC r204348, r206109
r204348
Support IFCAP_VLAN_HWTSO capability.

r206109
Bump response queue size to 2K, add statistic for starvation.
2010-08-27 02:14:02 +00:00
Alexander Motin 97f5d6e2ef MFC r211455:
Remove bintime_cmp() function, unused since r200086.
2010-08-25 11:11:14 +00:00
John Baldwin ccdc25d97f MFC 210936,210946:
Ethernet vlan(4) interfaces have valid Ethernet link layer addresses but
use a different interface type (IFT_L2VLAN vs IFT_ETHER).  Treat IFT_L2VLAN
interfaces like IFT_ETHER interfaces when handling link layer addresses.
2010-08-23 20:53:24 +00:00
Maksim Yevmenkin a275d7954e MFC r210783 as requested by Helge Oldach on freebsd-bluetooth@
Fix typo

PR:	kern/140590
2010-08-23 17:48:50 +00:00
Ulrich Spörlein 47dd606578 MFC r205078,208483,211401-211402,211404: mdoc cleanup
- Fix typo in macro name and macro usage.
- Consistently spell our email addresses <[email protected]>
- Wordsmithing of bsnmpd.1; bump .Dd
- Fix two minor typos.
2010-08-23 11:58:45 +00:00
Brian Somers 0f85bd3b91 MFC r210407: Add a -S switch to override syslogd's pidfile. 2010-08-23 09:54:32 +00:00
Christian Brueffer 34a6bacfcb MFC: r148701
Fixed a typo.
2010-08-22 20:25:03 +00:00
Christian Brueffer 456bd08396 MFC: r148681
Fixed a typo and added a comma.
2010-08-22 20:22:56 +00:00
Gavin Atkinson 798235192a Merge r211026 from head:
Add a keymap for the Swiss-German Macbook keyboard.

PR:		conf/139997
Submitted by:	Andreas Tobler <andreast fgznet.ch>
2010-08-22 16:32:59 +00:00
Andriy Gapon 6f38f51684 Fix a mismerge in r211581, MFC of r210427
This is a direct commit.

Reported by:	many
Pointyhat to:	avg
2010-08-22 13:27:33 +00:00
Gavin Atkinson 7f29f06d45 Merge r211066 from head:
Add a termcap entry for rxvt-256color.

PR:		conf/147726
Submitted by:	Sterling (Chip) Camden <sterling camdensoftware.com>
2010-08-22 09:06:55 +00:00
Andre Oppermann 7e2f8ce56d MFC r211333:
Fix the interaction between 'ICMP fragmentation needed' MTU updates,
  path MTU discovery and the tcp_minmss limiter for very small MTU's.
2010-08-22 09:02:38 +00:00
Andre Oppermann 6bdd31058e MFC r211327:
Add more logging points for failures in syncache_socket() to
  report when a new socket couldn't be created because one of
  in_pcbinshash(), in6_pcbconnect() or in_pcbconnect() failed.
2010-08-22 08:47:51 +00:00
Andriy Gapon 84b58dfcdd MFC r210425: dtrace: correctly map sections to addresses in elf object
modules (amd64)
2010-08-21 19:09:34 +00:00
Andriy Gapon aebeab2b00 MFC r210424: kgdb: correctly map sections to addresses in elf object
modules (amd64)
2010-08-21 18:55:28 +00:00
Andriy Gapon d6e69ef4ef MFC r210423: completely ignore zero-sized elf sections in modules of elf
object type (amd64)
2010-08-21 18:51:25 +00:00
Andriy Gapon 23055db156 MFC r210245: binutils/ld: fix incorrect placement of __start_SECNAME in
some cases
2010-08-21 18:40:42 +00:00
Andriy Gapon e21af37945 MFC r210427: zfs arc_memory_throttle: available memory is free + cache 2010-08-21 18:26:55 +00:00
Andriy Gapon 08f94b7218 MFC r210422: cpufreq: allocate long-lived buffer for handling of sysctl
requests
2010-08-21 17:52:33 +00:00
Andriy Gapon c6f10c9d26 MFC r210454: ichwd: correct range check for timeout value 2010-08-21 16:47:41 +00:00
Andre Oppermann ad5757a60b MFC r211317:
Reset the internal tso flag in tcp_output() on every iteration
  of sendalot.
2010-08-21 11:11:32 +00:00
Andre Oppermann d795356ac8 MFC r211316:
Change the messages of the ICMP bad port bandwidth limiter from
  a kernel printf to a log output with the priority of LOG_NOTICE.
2010-08-21 11:02:18 +00:00
Andre Oppermann 9ae498b480 MFC r211315:
Disable TCP inflight limiter by default.
2010-08-21 10:39:51 +00:00
John Baldwin 24532883cf Revert 210173 as it did not properly fix the bug. It assumed that the
VI_LOCK() for a given vnode was used as the internal interlock for that
vnode's v_lock lockmgr lock.  This is not the case.  Instead, add dedicated
routines to toggle the LK_NOSHARE and LK_CANRECURSE flags.  These routines
lock the lockmgr lock's internal interlock to synchronize the updates to
the flags member with other threads attempting to acquire the lock.  The
VN_LOCK_A*() macros now invoke these routines, and the softupdates code
uses these routines to temporarly enable recursion on buffer locks.

Reviewed by:	kib
2010-08-20 20:58:57 +00:00
John Baldwin b7d4d7c225 MFC: Use VN_LOCK_AREC() and VN_LOCK_ASHARE() rather than manipulating
lockmgr lock flags directly.
2010-08-20 20:33:13 +00:00
Bjoern A. Zeeb 4620aaad27 MFC r211115:
MFp4 CH180235:

  Add proto spacers to inet6sw like we have for legacy IP. This allows us
  to dynamically pf_proto_register() for INET6 from modules, needed by
  upcoming CARP changes and SeND.
  MC and SCTP could make use of it as well in theory in the future after
  upcoming VIMAGE vnet teardown work.

  Discussed with:	will, anchie
2010-08-20 12:26:02 +00:00
Gavin Atkinson 443b7fe0de Merge r186427 from head (original commit by remko):
Add support for the MaxSream USB test carrier.

PR:		usb/117546
Submitted by:	Daniel J. O'Connor <darius midget.dons.net.au>
2010-08-19 08:11:07 +00:00
Gavin Atkinson 0bbe6d4e4c Merge r208016 from head:
Add new FTDI USB device ID for the Gamma-Scout radioactivity meter. [1]

Merge r210556 from head:
  Support the Pyramid KBS USB LCD under uftdi(4) [2]

PR:		kern/146483 [1] usb/129758 [2]
Submitted by:	Andre Albsmeier [1]
Submitted by:	joao lima <jlima visionware.pt> [2]
2010-08-19 07:54:15 +00:00
Gavin Atkinson e2db727009 Merge r210571 from head:
Add support for the Corega CG-USBRS232R to uplcom(4)

PR:		usb/129173
Submitted by:	SHIMAOKA Shunsuke <shimaoka.shunsuke gmail.com>
2010-08-18 21:51:05 +00:00
Gavin Atkinson 7449f1efa4 Merge r211077, r211079 from head:
Correct two error messages to match the failure they are reporting.

  Correct the login.conf variable name used for obtaining the login prompt.
2010-08-18 20:39:00 +00:00
Gavin Atkinson 7ab1bcfdd3 Merge 210839 from head:
Do not free sc if attach failed, as it was allocated by the bus
  infrastructure, not us.  This appears to be a leftover from an older
  version of the driver.

Submitted by:	avg
Tested by:	Anton Shterenlikht <mexas bristol.ac.uk>
2010-08-18 20:23:47 +00:00
Jaakko Heinonen d87a670bbf MFC r209614:
- Don't assign the return value from read(2) to a variable of type
  int.
- Use errx(3) instead of err(3) to print the error message on short
  reads in readlabel(). errno won't be set on short reads which can
  easily occur here due to the fixed size read request.

PR:		144307
2010-08-18 14:41:34 +00:00
John Baldwin 1879abaf5f MFC 175682,175683,175686:
Generally, anything that runs rc.d scripts internally should
start using the quiet prefix (i.e. quietstart, quietstop, etc...).
2010-08-17 21:28:40 +00:00
Edwin Groothuis 27c0d84f89 MFC of 211422, tzdata2010l
- Fix start times of DST for Egypt.
- clocks were set back one hour at 2010-08-11 00:00:00 local time
  in Gaza and the West Bank.

Obtained from:  ftp://elsie.nci.nih.gov/pub/
2010-08-17 12:17:32 +00:00
Pyun YongHyeon 6c6e116258 MFC r210271:
Specify BCE_RX_BUF_ALIGN alignment for RX buffers. All bce(4)
  controllers require RX buffers aligned on BCE_RX_BUF_ALIGN bytes.
2010-08-15 23:58:21 +00:00
Pyun YongHyeon 83e7fbbd00 MFC r210263,210267,210269-210270:
r210263:
  Do not report current link state if interface is not UP.

r210267:
  Add KASSERT to check number of returned DMA segments.

r210269:
  Use bus_get_dma_tag() to get parent tag. Also use
  BUS_SPACE_MAXSIZE_32BIT to specify sum of all segment lengths.
  Previously it used MAXBSIZE which was wrong.

r210270:
  Specify BUS_DMA_ZERO flag to bus_dmamem_alloc(9) and remove bzero()
  calls. Also add BUS_DMA_COHERENT flag to bus_dmamem_alloc(9) to
  take advantage of efficient synchronization for architectures that
  support that feature.
2010-08-15 23:48:58 +00:00
Pyun YongHyeon e2edff6f7a MFC r210257,210259-210261:
r210257:
  When we didn't find a matching flash device, do not touch flash
  config data. While I'm here, use return code of bce_init_nvram()
  to set error instead of directly setting ENODEV.

r210259:
  Have bce_init_ctx() return error code and make caller check the
  return code. If context was not setup correctly give up
  initialization. While I'm here move variable declarations to the
  beginning of the function.

r210260:
  Don't change current media in bce_stop(). There is no need to do
  this here.

r210261:
  Correctly check the result of media selection. Previously it always
  returned success.
2010-08-15 23:40:44 +00:00
Pyun YongHyeon ef7b34f1d7 MFC r207411:
- Enable flow control.
  - Print device details only when verbose boot is enabled.
  - Add debug output for shared memory access.
  - Add debug statistics (checksum offload & VLAN frame counters).
  - Modify TX path to update consumer index for each frame completed
    rather than updating the consumer index only once for a group of
    frames to improve small packet performance.
  - Print driver/firmware pulse messages only when verbose boot
    is enabled.
  - Add debug sysctl to clear statistics.
  - Fix more style(9) violations.
2010-08-15 23:32:23 +00:00
Pyun YongHyeon b6caca9240 MFC r207391:
- Pass flow control settings back to bce(4).
2010-08-15 23:28:11 +00:00
Pyun YongHyeon 2160213f85 MFC r210244:
Implement WOL. WOL is supported on RTL8139B or newer controllers.

  PR:	kern/148013
2010-08-15 23:13:09 +00:00
Pyun YongHyeon 5210affe49 MFC r205651:
Use pci_get_max_read_req() and pci_set_max_read_req() to set maximim
  read request size.
2010-08-15 23:07:06 +00:00
Pyun YongHyeon e7053419e2 MFC r210083,210152:
r210083:
  Remove enabling Data FIFO protection with indirect memory access.
  r165114 added that code and that change ignored the same logic
  committed in r135772. In addition, data FIFO protection should be
  selectively enabled instead of applying to all PCIe devices.
  While I'm here add BCM5785 to devices that do not require this
  fix.

r210152:
  Use Miscellaneous Configuration Register bit definition instead of
  magic number.
2010-08-15 22:59:35 +00:00
Pyun YongHyeon 522af745ef MFC r210011,210013-210015:
r210011:
  Make bge_stop_fw() static.
  While I'm here use ANSI function definitions.

r210013:
  style.

r210014:
  Fix error message for jumbo buffer allocation failure.

r210015:
  Prefer PCIR_BAR macro over BGE_PCI_BAR0.
2010-08-15 22:53:46 +00:00
Pyun YongHyeon d63c706ddf MFC r209741:
Zero entire status block and add missing bus_dmamap_sync(9).
2010-08-15 22:45:40 +00:00
Pyun YongHyeon 748e316616 MFC r209714:
It seems read DMA mode register requires both IPv4 TSO and IPv6 TSO
  configuration to get IPv4 TSO work on BCM57780. While I'm here
  apply the same fix to BCM5785 which shares similar hardware feature
  of BCM57780. This change makes TSO work on BCM57780.

  Tested by:	Tong Liu <nemoliu <> gmail dot com>
2010-08-15 22:42:15 +00:00
Pyun YongHyeon d29a105cbd MFC r208917:
Remove unused macros.
2010-08-15 22:37:32 +00:00
Pyun YongHyeon 6d5e75e701 MFC r209818:
Remove enabling RX checksum offloading in RX filter setup. RX
  checksum is enabled in sge_init_locked().
  While I'm here do not set RX checksum bits in RX descriptor
  initialization. It is controller's job to set these bits.

  Tested by:	xclin <xclin <> cs dot nctu dot edu dot tw >
2010-08-15 21:58:05 +00:00
Pyun YongHyeon 05cdae3a85 MFC r209865:
Some revision of Yukon controller generates corrupted frame when TX
  checksum offloading is enabled.  The frame has a valid checksum
  value so payload might be modified during TX checksum calculation.
  Disable TX checksum offloading but give users chance to enable it
  when they know their controller works without problems with TX
  checksum offloading.

  Reported by:	Andrzej Tobola <ato <> iem dot pw dot edu dot pl>
2010-08-15 21:53:07 +00:00
Pyun YongHyeon 6e02442a65 MFC r211089:
It seems some old Sundace(now IC Plus Corp.) controllers do not
  like memory mapped register access. Typical problem from the issue
  was MII access returned unreliable values. I'm not sure this comes
  from lack of register flushing in MII access after accessing
  STE_PHYCTL register though.
  To address the issue, read hints data that controls which type of
  memory mapping should be used in driver. ste(4) still prefers
  memory mapping to io mapping but honor hints entered by user except
  for controllers that have problems with memory mapping.
  The hint to use iomapping could be given by adding the following
  line to /boot/device.hints file.

  hint.ste.0.prefer_iomap="1"

  PR:	kern/149285
2010-08-15 21:46:23 +00:00
Andre Oppermann 3162d75c8b MFC r210666:
Fix a bug in syncache where the initial CWND for new incoming connections
  was limited to one segment under the faulty assumption of a retransmit.
  Due to this the opportunity to initialize the increased congestion window
  according to RFC3390 was missed.
2010-08-14 20:03:32 +00:00
Bjoern A. Zeeb 07c100e6d6 MFC r210686:
MFp4 @181628:

  Free the rtentry after we diconnected it from the FIB and are counting
  it as rttrash.  There might still be a chance we leak it from a different
  code path but there is nothing we can do about this here.
2010-08-14 13:47:34 +00:00
Fabien Thomas f214ec81b9 MFC r210797:
- Do not use the runtime mask when logfile is specified.
- Revert the fix on rtld path that is not necessary.
2010-08-09 14:33:25 +00:00
Fabien Thomas e316ccd2a5 MFC r210794:
Allow file as a top source, it works with socket now.
This will allow top monitoring using socket/ssh tunnelling
of system without local symbols.

client:
pmcstat -R <ip>:<port> -T -r <symbolspath>
monitored device:
pmcstat -Sinstructions -O <ip>:<port>

- Move the file read in the event loop
- Initialize and clean log in all cases
- Preserve global stats value during top refresh
- Fix the rtld/line resolver that ignore '-r' prefix
- Support socket for '-R' (server mode)
- Display the statistics when exiting top mode
2010-08-09 14:30:45 +00:00
Fabien Thomas af3edfeab6 MFC r210766:
Fix the calltree top view that incorrectly filter out some nodes.
2010-08-09 14:26:52 +00:00
Gavin Atkinson 928c4184a1 Fix mismerge in r211035.
Pointy hat:	me
2010-08-08 19:07:59 +00:00
Jilles Tjoelker 992634c0e1 MFC r210734: Allow starting ipmon if ipnat is enabled but ipfilter is not
(in /etc/rc.conf).

This fixes an apparent confusion between test(1) and sh(1) syntax for
AND/OR.

PR:		conf/149036
Submitted by:	pluknet
2010-08-08 13:45:47 +00:00
Gavin Atkinson dc53a9f679 Merge r210534 from head:
Add support for the Longcheer WM66 USB HSDPA Modem to u3g(4)

PR:		usb/129945
Submitted by:	Antonio Hilario <avahilario gmail.com>
2010-08-07 19:27:49 +00:00
Rebecca Cran 57782f3ec5 MFC r209469:
If a device can't be opened, don't keep going but display the error
returned from open() and quit.

PR: bin/81035
Submitted by: Peter Schuller <peter.schuller at infidyne.com>
Approved by: rrs (mentor)
2010-08-07 13:02:26 +00:00
Rebecca Cran 8555b5a97b MFC r209468:
Make it easier to cancel a failing installation by only attempting to
extract distributions once. If a distribution fails to fetch/extract
and the user doesn't want to retry, abort the installation.

Approved by: rrs (mentor)
2010-08-07 12:54:12 +00:00
Rebecca Cran 255aafdd3a MFC r209467:
When installing on a machine which doesn't have a VGA card installed, enable
a getty on the serial port so that it's possible to login when the system is
rebooted.

PR: bin/23098
Submitted by: Doug Ambrisko <ambrisko at whistle.com>
Approved by: rrs (mentor)
2010-08-07 12:46:49 +00:00
Rebecca Cran ea5934646d MFC r209764:
Increase the default and minimum partition sizes.
Bump / to 1GB, /var to 4GB and /tmp to 1GB.

A 512MB root partition is now too small to hold two kernels, so to
prevent installkernel failing 1GB is a better default. Likewise,
applications are storing more data in /var so 4GB is more reasonable
on a modern machine.

The previous minimum partition sizes were too small to hold a minimal
installation, and have been adjusted accordingly.

Approved by: rrs (mentor)
2010-08-07 12:21:29 +00:00
Rebecca Cran fa89b3db1a MFC r209235, r210381 (bug fix for r209235):
* Allow partial MB/GB values to be entered in the slice and label editor.
* Don't strdup the name when calling deviceRegister because the string is
copied within new_device.
* Use a subtype of 165, not 3, when creating a slice in noninteractive
mode.

PR: bin/135333
PR: bin/66350
Approved by: rrs (mentor)
2010-08-07 11:15:32 +00:00
Rebecca Cran 4d3a7a1cac MFC r209058:
sctp_recvmsg returns the number of bytes received, not sent.

Approved by:	rrs (mentor)
2010-08-06 18:57:09 +00:00
Bernhard Schmidt a21a9ba580 MFC r182236,r182238,182250,182251:
- Add recent ELSA additions to wi(4), plus make sure the list matches
  the driver for ELSA.
- The APDL-325 is a Wireless LAN pcmcia adapter that sits inside some
  Billion Access Points.  Fix wi(4) to recognise the adapter.
- Remove opt_wi.h

PR:		kern/77913
Submitted by:	Daan Vreeken [PA4DAN] <Danovitsch at Vitsch.net>
2010-08-06 18:57:09 +00:00
Ulrich Spörlein a985e494ba MFC r210641: Fix a couple of typos.
PR:		docs/148891
Submitted by:	olgeni
2010-08-06 09:21:07 +00:00
Brian Somers 54fe435d70 MFC r209756:
Log dhclient's reason for exiting and change the 10 second
    ignore-routing-messages dhclient-script timeout to be effective
    from script completion rather than from script start time.

    Ignore RTM_DELADDR and RTM_NEWADDR messages when the message
    contains no interface address (which should not happen) rather than
    exiting.
2010-08-06 08:21:03 +00:00
John Baldwin 24bb68c424 MFC 210623:
Mark the __curthread() functions as __pure2 and remove the volatile keyword
from the inline assembly.  This allows the compiler to cache invocations of
curthread since it's value does not change within a thread context.
2010-08-05 22:04:07 +00:00
John Baldwin f604d68db3 MFC 210577: The corrected error count field is dependent on CMCI, not TES. 2010-08-05 21:01:35 +00:00
John Baldwin efa2358b4d MFC 210505:
- Change the warning about PCI-e links narrower than x8 to only apply to
  10G cards.  1G cards are x4 only.
- Use constants from pcireg.h for reading the current link width.
- Use pci_set_max_read_req() rather than implementing it by hand.
2010-08-05 20:45:46 +00:00
George V. Neville-Neil d933096e42 MFC: 210621
Make sure that we clear the correct bits when we turn off
a PMC.  It was possible that we could have turned a bit on but
never cleared it.

Extend the calls to rdmsr() to all necessary functions, not
just those which previously caused a panic.

Pointed out by: jhb@
2010-08-05 20:40:13 +00:00
John Baldwin 8c68a8f7e3 MFC 210604:
Fix test for double-nul characters that terminate the string table at
the end of each SMBIOS/DMI structure.
2010-08-05 19:43:32 +00:00
John Baldwin 52a9b51eb3 MFC 210136:
Retire the NFS access cache timestamp structure.  It was used in VOP_OPEN()
to avoid sending multiple ACCESS/GETATTR RPCs during a single open()
between VOP_LOOKUP() and VOP_OPEN().  Now we always send the RPC in
VOP_LOOKUP() and not VOP_OPEN() in the cases that multiple RPCs could be
sent.

To preserve the ABI I have left the structure in place, but renamed it
to 'n_unused' and just removed the code that updates it.
2010-08-05 19:41:43 +00:00
George V. Neville-Neil a38294c19b Fix a build breakage foudn by the module build in tinderbox.
Update NOTES so that em and igb are both now part of the LINT
kernel.

Pointed out by: tinderbox
2010-08-04 15:59:45 +00:00
Tijl Coosemans 2ec84a6940 MFC r209955:
When switching the thread from the processor, store %dr7 content
into the pcb before disabling watchpoints. Otherwise, when the
thread is restored on a processor, watchpoints are still disabled.

Approved by:	kib (mentor)
2010-08-04 09:56:43 +00:00
Xin LI 689f6632de MFC r210358:
Apply vendor version 1.20.00.17.

This version adds support for ARC1880; additionally this version fixed
an issue where all devices on a SAS port gets offlined when any device
failed on the port [1].

Many thanks to Areca for continuing to support FreeBSD.

PR:		kern/148502 [1]
Submitted by:	Ching-Lung Huang <ching2048 areca com tw>
Obtained from:	Areca
Tested by:	Rich Ercolani <rercola acm jhu edu> [1]
2010-08-04 01:34:35 +00:00
Gavin Atkinson 36a6068cfd Merge r210515,210516,210543 from head:
Prevent ukbd(4) and uhid(4) from attaching when a WiSPY DBx Spectrum
  Analyzer is attached. [1]

  Prevent uhid(4) from attaching to the Gembird Silver Shield remote power
  plug. [2]

  Prevent uhid(4) from attaching to the Liebert PowerSure Personal XT UPS.
  [3]

PR:		usb/134631 [1], usb/132785 [2], usb/129251 [3]
Submitted by:	Jesse Kempf <jkempf davisvision.com> [1]
Submitted by:	Dirk-Willem van Gulik <dirkx webweaving.org> [2]
Submitted by:	Andrew D Wiles <adw+gnats avatastic.co.uk> [3]
2010-08-03 22:06:34 +00:00
Fabien Thomas c591af37c3 MFC r209196:
Set the comment at the right place for PMC uncore classes.
2010-08-03 16:37:29 +00:00
Fabien Thomas 94ebf27ffe MFC r208861:
Convert pm_runcount to int to correctly check for negative value.
Remove uncessary check for error.

Found with:	Coverity Prevent(tm)
2010-08-03 16:31:18 +00:00
Fabien Thomas 7d0c390dc9 MFC r208860:
Fix memory leak on error.

Found with:	Coverity Prevent(tm)
2010-08-03 16:27:13 +00:00
Fabien Thomas 8d8f126b1f MFC r208858:
Fix warnings found by Coverity.

Found with:   Coverity Prevent(tm)
2010-08-03 16:23:46 +00:00
George V. Neville-Neil 08ae1ff427 MFC: 209241, 209512, 210428, 210452
Move statistics into the sysctl tree making it easier to find
and use them.
Add previously hidden statistics, some of which include interrupt
and host/card communication counters.

Include all fixups pointed out by others in testing.
2010-08-03 15:07:38 +00:00
Ulrich Spörlein 0f476ee2e3 MFC r210662: Fix indention of attribution line for some recent additions. 2010-08-02 11:48:05 +00:00
Xin LI 2fe683488b MFC r210661:
Change copyright holder to author.  We prefer using a real legal
entity for copyright holders.

Approved by:	sephe
2010-08-02 08:31:31 +00:00
Edwin Groothuis 7bd7b2661d MFC of 210718, tzdata2010k:
- Daylight Saving Time will not be used in Egypt during Ramadan.
- Proper names for Pacific/Pohnpei and Pacific/Chuuk
- Fix historical information for Finland for 1981 and 1982
- No leap-second for December 2010.
- Fix historical information for Ontario (Canada)
2010-08-01 09:11:56 +00:00
Bjoern A. Zeeb 4a0775741e MFC r210532:
Return NULL rather than 0 for a pointer.
2010-07-30 21:28:25 +00:00
Ulrich Spörlein 98d97ccee8 MFC r208730:
Zero struct before reading from it

PR:		140384
2010-07-30 12:36:40 +00:00
Gavin Atkinson 7f4130bed7 - Support the Epson RX620 and HP ScanJet 3570C scanners in uscanner(4).
Direct commit to stable/7 as the uscanner driver no longer exists in head.

PR:		usb/121426, usb/122025
Submitted by:	Greg Mars <authentec gmail.com>
Submitted by:	Bjorn Konig <bkoenig alpha-tierchen.de>
2010-07-28 16:58:36 +00:00
Attilio Rao 7615dc2d93 MFC r203042, r203735:
Allow -o as a synonym for -s, for compatibility with other systems.
2010-07-28 16:32:30 +00:00
Andriy Gapon 13bfb6f39a MFC r199969: add amdsbwd.4
This part of r199969 was left during original MFC, only merge to sys was
done at that time.

Reported by:	hrs
Pointyhat to:	avg
2010-07-28 09:17:42 +00:00
Gavin Atkinson 957f96e56f Support the ZTE AC8700 EVDO modem in u3g(4)
No mergeinfo due to vastly differing stacks in head vs stable/7.

PR:		usb/129522
Submitted by:	Sergej Kandyla <sk.paix gmail.com>
2010-07-27 12:53:53 +00:00
John Baldwin c1dd22be51 MFC 209948:
A previous change moved the GETATTR RPC for open() calls that hit in the
name cache up into nfs_lookup() instead of nfs_open().  Continue this
trend by flushing the attribute cache for leaf nodes in nfs_lookup() during
an open() if we do a LOOKUP RPC.  For NFSv3 this should generally be a NOP
as the attributes are flushed before fetching the post-op attributes from
the LOOKUP RPC which most (all?) NFSv3 servers provide, so the post-op
attributes should populate the cache.

Now all NFS open() calls will always clear the cached attributes during the
nfs_lookup() prior to nfs_open() in the !NMODIFIED case to provide CTOC.
As a result, we can remove the conditional flushing of the attribute
cache from nfs_open().
2010-07-26 18:55:18 +00:00
John Baldwin 07491ee2b0 MFC 209212:
Restore the machine check register banks on resume.  For banks being
monitored via CMCI, reset the interrupt threshold to 1 on resume.
2010-07-26 18:23:05 +00:00
John Baldwin fae98397a2 MFC 208633 (Missed in earlier CMCI MFC):
Defer initializing machine checks for the boot CPU until the local APIC is
fully configured.
2010-07-26 17:39:11 +00:00
Gavin Atkinson 7c4a92ca3b Support the Novatel U760 dongle (Verizon and Bell Canada)
Note that this is a direct commit to stable/7 due to differences in the
code in head.  No mergeinfo as the commit that added this in head made
many other changes at the same time.

PR:		usb/138138
Submitted by:	mike tancsa <mike sentex.net>
2010-07-26 12:58:20 +00:00
Doug Barton 4709ec64d6 MFC 209531:
Taken from actual police videos ...

MFC 210484:
Correct a Cecil Beaton quote
2010-07-26 02:05:36 +00:00
Doug Barton 59b51a8b18 Pull mergeinfo up into the parent 2010-07-26 02:02:45 +00:00
Christian Brueffer 30572dbe84 MFC: r145251
Various wording, spelling and markup fixes.
2010-07-25 20:08:07 +00:00
Rong-En Fan a4e7a91ef4 MFC r210465
- Fix wrong manpage title for keybound.3X

 PR:            docs/148864
 Obtained from: ncurses-5.7-20081213 snapshot
2010-07-25 11:53:32 +00:00
John Baldwin 6aa4b8bbb6 MFC 209956:
Remove a dead test.  We already exclude NMI traps from this code in an
earlier condition.
2010-07-23 15:32:44 +00:00
John Baldwin 5bc8f6cd37 MFC 209946:
- Add missing locking around flushing of an NFS node's attribute cache
  in the NMODIFIED case of nfs_open().
- Cosmetic tweak to simplify an expression in nfs_lookup().
2010-07-23 15:26:32 +00:00
John Baldwin eb27cdd9f0 MFC 210068:
- Sort list of trace points.
- Note that 'y' (sysctl requests) is in the default set of trace points.
2010-07-23 15:16:37 +00:00
John Baldwin 4b132d20c2 MFC 210066:
Rework the SMBIOS table walker to make it operate like other table walkers
and remove a buffer overflow.
2010-07-23 14:30:31 +00:00
Jung-uk Kim 38515bedd9 MFC: r210248
Fix two long-standing line wrapping bugs in VGA renderer for pixel mode.
Font size may be smaller than 16 and logical scan line may be larger than
the displayed scan line.
2010-07-22 17:02:51 +00:00
Jung-uk Kim dfb32c2a49 MFC: r209965, r209966, r210129, r210137, r210155
- According to ACPICA User Guide and Programmer Reference, the read data
must be zero extended to fill the 32-bit or 64-bit return value even if
the bit width of the port or location is less than 32 or 64.
- Use pmap_mapdev()/pmap_unmapdev() to map device memory instead of using
AcpiOsMapMemory()/AcpiOsUnmapMemory() (-> pmap_mapbios()/pmap_unmapbios())
for AcpiOsReadMemory() and AcpiOsWriteMemory().  Although they do not sound
too obvious, these functions are exclusively used to access memory mapped
IO in ACPICA.
- Remove 64-bit access from AcpiOsReadMemory() and AcpiOsWriteMemory().
These functions do not support 64-bit access.  Likewise, return error when
64-bit access is requested for PCI configuration space.
- Clean up some white spaces.
2010-07-20 19:43:25 +00:00
Jung-uk Kim 4ea8db2549 MFC: r209837, r209842, r209949
Sync. printf() of libstand(3) with sys/kern/subr_prf.c.

CVS r1.94	jhb:
Cast the integer read as the first argument for %b to an unsigned integer
so it's value is not sign extended when assigned to the uintmax_t variable
used internally by printf.  For example, if bit 31 is set in the cpuid
feature word, then %b would print out the initial value as a 16 character
hexadecimal value.  Now it only prints out an 8 character value.

CVS r1.109	njl:
Add support for 'h' and 'hh' modifiers for printf(9).

CVS r1.117	phk:
If we ignore an unknown % sequence, we must stop interpreting the remaining
% arguments because the varargs are now out of sync and there is a risk that
we might for instance dereference an integer in a %s argument.

SVN r209836	jkim:
Implement optional 'precision' for numbers.  Previously, it was parsed but
ignored.  Some third-party modules (e.g., ACPICA) prefer this format over
zero padding flag '0'.
2010-07-20 19:13:31 +00:00
Jung-uk Kim e644883007 MFC: r209836, r209949
Implement optional 'precision' for numbers.  Previously, it was parsed but
ignored.  Some third-party modules (e.g., ACPICA) prefer this format over
zero padding flag '0'.
2010-07-20 19:11:47 +00:00
George V. Neville-Neil 37abf93899 MFC r210012:
Fix a panic brought about by writing an MSR without a proper mask.
All of the necessary wrmsr calls are now preceded by a rdmsr
and we leave the reserved bits alone.
Document the bits in the relevant registers for future reference.

Tested by: mdf
2010-07-20 17:57:03 +00:00
Benedict Reuschling 70639618d5 Revert to r172506, because sio(4) is still the default in stable/7.
Pointed out by:     gavin
2010-07-18 14:52:40 +00:00
Benedict Reuschling 9db59ba20e MFC r209703:
Let boot(8) refer to the uart(4) serial driver, which is the replacement
for the obsolete sio(4) driver.

PR:             docs/144498
Submitted by:   Bruce Cran (bruce at cran dot org dot uk)
Approved by:    marcel
2010-07-18 11:03:32 +00:00
Marius Strobl 7a5a0c0b69 MFC: r209961
Correct inverted parent DMA tag parameters.

Reviewed by:	ken
2010-07-17 15:47:28 +00:00
Giorgos Keramidas 045d3298bc MFC r209871 from /head
Fix reading of empty fifolog files.  When we don't have anything
    to inflate, skip the rest of the fifolog reader code to avoid
    hitting the assert about Z_OK a bit further down.
2010-07-17 07:59:53 +00:00
John Baldwin 99a6b2553e MFC 185507:
Don't manually track statistics.
2010-07-16 20:28:45 +00:00
John Baldwin fc475f0cea When the MNTK_EXTENDED_SHARED mount option was added, some filesystems were
changed to defer the setting of VN_LOCK_ASHARE() (which clears LK_NOSHARE
in the vnode lock's flags) until after they had determined if the vnode was
a FIFO.  This occurs after the vnode has been inserted into a VFS hash or
some similar table, so it is possible for another thread to find this vnode
via vget() on an i-node number and block on the vnode lock.  If the lockmgr
interlock (vnode interlock for vnode locks) is not held when clearing the
LK_NOSHARE flag, then the lk_flags field can be clobbered.  As a result
the thread blocked on the vnode lock may never get woken up.  Fix this by
holding the vnode interlock while modifying the lock flags in this case.

The softupdates code also toggles LK_NOSHARE in one function to close a
race with snapshots.  Fix this code to grab the interlock while fiddling
with lk_flags.
2010-07-16 20:23:24 +00:00
Warner Losh 9e92d59b60 MFC: r188277, r188280, r201227, r205880, r206664, r206915, r207260, r207263,
r207265, r209135, r209969

(I'm not repeating all that here, see the logs for all the details):

Config version is now 600010
option alias support
makefile parsing fixes
calloc failure coping
WARNS=6
comment placement correction
alpha vestige removal

This should allow building of -current kernels and modules on 7-stable
machines (although not officially supported, enough people do it to
make some efforts to make it work a big win).

imp, ed, wkoszek, ru, gcooper, and nwhitehorn authored the original revs
2010-07-15 23:07:02 +00:00
John Baldwin b872127bd5 MFC 209595:
Send SIGPIPE to the thread that issued the offending system call
rather than to the entire process.
2010-07-14 21:52:23 +00:00
John Baldwin 8546461846 MFC 208507,208556,208621:
Add support for corrected machine check interrupts.  CMCI is a new local
APIC interrupt that fires when a threshold of corrected machine check
events is reached.  CMCI also includes a count of events when reporting
corrected errors in the bank's status register.  Note that individual
banks may or may not support CMCI.  If they do, each bank includes its own
threshold register that determines when the interrupt fires.  Currently
the code uses a very simple strategy where it doubles the threshold on
each interrupt until it succeeds in throttling the interrupt to occur
only once a minute (this interval can be tuned via sysctl).  The threshold
is also adjusted on each hourly poll which will lower the threshold once
events stop occurring.
2010-07-14 21:10:47 +00:00
John Baldwin 692c8b8166 MFC 208787:
Assert that the thread lock is held in sched_pctcpu() instead of
recursively acquiring it.  All of the current callers already hold the
lock.
2010-07-14 19:01:08 +00:00
John Baldwin 38fc21c316 MFC 209588:
- The ETIMEDOUT error applies to pthread_timedjoin_np(), not pthread_join().
- Tweak wording in history section for pthread_timedjoin_np().
2010-07-14 18:55:45 +00:00
John Baldwin 2063ffff15 MFC 177446,177856:
Spell -t option's argument by name.
2010-07-14 18:23:19 +00:00
Mark Peek 1dedbad1e6 Merge r197812:
Fix tcsh losing history when tcsh terminates because the pty beneath it
is closed.
2010-07-14 15:18:22 +00:00
Mark Peek 0f1991b30c MFC: Update to tcsh 6.17.00.
Requested by: gnn
2010-07-14 15:14:52 +00:00
Mark Peek 02bb2b70f4 MFC r184072: Actually fix pty detection for autologout setting. 2010-07-14 15:11:29 +00:00
Andrey V. Elsukov ace3342eb7 MFC r208946:
New netgraph node ng_patch(4). It performs data modification of packets
  passing through. Modifications are restricted to a subset of C language
  operations on unsigned integers of 8, 16, 32 or 64 bit size.
  These are: set to new value (=), addition (+=), subtraction (-=),
  multiplication (*=), division (/=), negation (= -), bitwise AND (&=),
  bitwise OR (|=), bitwise eXclusive OR (^=), shift left (<<=),
  shift right (>>=). Several operations are all applied to a packet
  sequentially in order they were specified by user.

  Submitted by:	Maxim Ignatenko <gelraen.ua at gmail.com>
  		Vadim Goncharov <vadimnuclight at tpu.ru>
  Discussed with:	net@

MFC r208947:
  Fix typo.

MFC r208989:
  Style(9) fixes:
  * Sort includes
  * Replace #define<SPACE> to #define<TAB>
  * Split declarations and initializations
  * Split long lines

  Requested by:	kib

MFC r209194:
  * Include sys/systm.h for KASSERT()
  * Remove unneeded includes and comment
  * Replace home made OFFSETOF() macro with standard offsetof()

  Pointed out by:	bde

Tested by:	Vadim Goncharov <vadimnuclight at tpu.ru>
Approved by:	mav (mentor)
2010-07-13 20:13:38 +00:00
Konstantin Belousov c020255075 MFC r209743:
Calculate nshift only once.
2010-07-13 08:55:52 +00:00
Konstantin Belousov c6b7468e13 MFC r209742:
In revoke(), verify that VCHR vnode indeed belongs to devfs.
2010-07-13 08:53:41 +00:00
Colin Percival c4294203cb Correctly copy the M_RDONLY flag when duplicating a reference
to an mbuf external buffer.

Approved by:	so (cperciva)
Approved by:	re (kensmith)
Security:	FreeBSD-SA-10:07.mbuf
2010-07-13 02:45:17 +00:00
Remko Lodder 609b3fafb6 MFC r202917
Add support for the NM10 chipset.

 PR:		kern/143118
 Submitted by:	Koshin sumitani <ksumitani at mui dot biglobe dot ne dot jp>
 Approved by:	imp (mentor, implicit)
 MFC after:	3 days
2010-07-12 17:50:38 +00:00
Xin LI 30eab52b03 MFC r209860:
Don't use pack() for structures that is used purely for software state.
Otherwise the resulting, unaligned mutex structure would trigger panic.

Submitted by:		Tom Cough <tom.couch lsi.com>
Reported/Tested by:	jhb
PR:			kern/148464
2010-07-09 20:43:57 +00:00
Andriy Gapon 831ec4f90c MFC r209413: readelf.1: remove duplicate -u/--unwind option description 2010-07-08 21:35:57 +00:00
Andriy Gapon 950ae92b04 MFC r209228: device.hints: do install when WITHOUT_BOOT is set 2010-07-08 20:57:37 +00:00
Andriy Gapon 1fd4899e16 MFC r209425: udf_vnops: cosmetic followup to r208671 2010-07-08 20:43:20 +00:00
Andriy Gapon 6ff5e23f44 MFC r209056: vnode.h: expand debug macros to non-empty void statements
when DEBUG_VFS_LOCKS is disabled
2010-07-08 20:18:52 +00:00
John Baldwin 3cc66cc553 MFC 175676:
Implement a quiet prefix, which will disable some diagnostics. The
fast prefix also implies quiet. During boot we use either fast or
quiet. For shutdown we already use 'faststop'. So, this informational
message should only appear during interactive use.

Reviewed by:	silence on freebsd-rc@
2010-07-08 13:34:01 +00:00
Marius Strobl e2d0ec5643 MFC: r209695
- Pin the IPI cache and TLB demap functions in order to prevent migration
  between determining the other CPUs and calling cpu_ipi_selected(), which
  apart from generally doing the wrong thing can lead to a panic when a
  CPU is told to IPI itself (which sun4u doesn't support).
  Reported and tested by: Nathaniel W Filardo
- Add __unused where appropriate.
2010-07-07 19:52:57 +00:00
Christian Brueffer 53c491a6b4 MFC: r207948
- Missing full stops
- Upper case the first character of an description
- Section headings do not need to be quoted. From OpenBSD's make.1, revision 1.81
- Plural of suffix is suffixes. From OpenBSD's make.1, revision 1.61
- s/seperating/separating/
2010-07-04 18:49:15 +00:00
Christian Brueffer ea4b9721e6 MFC: r207946
The previous revision actually removed the bug being hinted at, so
go ahead and remove the hint.
2010-07-04 18:44:32 +00:00
Jilles Tjoelker bee6a7824c MFC r207944: sh: Fix pathname expansion with quoted slashes like *\/.
These are git commits 36f0fa8fcbc8c7b2b194addd29100fb40e73e4e9 and
d6d06ff5c2ea0fa44becc5ef4340e5f2f15073e4 in dash.

Because this is the first code I'm importing from dash to expand.c, add the
Herbert Xu copyright notice which is in dash's expand.c.

When pathname expanding *\/, the CTLESC representing the quoted state was
erroneously taken as part of the * pathname component. This CTLESC was then
seen by the pattern matching code as escaping the '\0' terminating the
string.

The code is slightly different because dash converts the CTLESC characters
to backslashes and removes all the other CTL* characters to allow
substituting glob(3).

The effect of the bug was also slightly different from dash (where nothing
matched at all). Because a CTLESC can escape a '\0' in some way, whether
files were included despite the bug depended on memory that should not be
read. In particular, on many machines /*\/ expanded to a strict subset of
what /*/ expanded to.

Example:
  echo /*"/null"

This should print /dev/null, not /*/null.

PR:		bin/146378
Obtained from:	dash
2010-07-03 21:06:48 +00:00
Christian Brueffer 0eb0758072 MFC: r207975
IBM ServeRAID M5015 SAS/SATA works.
2010-07-03 09:54:14 +00:00
Christian Brueffer 513c28882f MFC: r207945
Comment in the BUGS section header. Matches what's in ipfilter 5.10.
2010-07-03 09:47:12 +00:00
David E. O'Brien b18d4185b1 Cleanup svn merge conflict markers. 2010-06-30 07:43:49 +00:00
John Baldwin b4a42e4d51 Remove gratuitous whitespace changes accidentally added in the previous
commit.
2010-06-28 14:06:44 +00:00
John Baldwin c022309b0f Remove some gratuitous local diffs. 2010-06-28 14:04:19 +00:00
Jilles Tjoelker d5dbaaebf1 MFC r208647,r208654: Clarify devfs manpages slightly.
mount(8): add xref to devfs(5)
devfs(5): change example to something more likely to be useful (it is not
necessary to mount a devfs on /dev manually, but for chroots/jails it is
often needed), mention since when devfs is preferred to device nodes on ufs
and when device nodes on ufs stopped working

PR:		146600
2010-06-26 14:42:07 +00:00
John Baldwin 6705331a45 MFC 208391:
Assert that the thread passed to sched_bind() and sched_unbind() is
curthread as those routines are only supported for curthread currently.
2010-06-24 12:09:12 +00:00
John Baldwin 2780907192 MFC 208388:
- Set 'dmadat' earlier so that we properly setup the heap if we fail to
  locate a high memory area for the heap using the SMAP.
- Read the number of hard drive devices from the BIOS instead of hardcoding
  a limit of 128.  Some BIOSes duplicate disk devices once you get beyond
  the maximum drive number.
2010-06-23 17:56:51 +00:00
Doug Barton cb3e9e0a8a MFC 209286:
Add the AAAA address for i.root-servers.net
2010-06-22 21:13:35 +00:00
Andriy Gapon 10e01ddc1c MFC r208672: g_label: fix possible NULL pointer dereference 2010-06-22 08:17:55 +00:00
Andriy Gapon 4c7b27a939 MFC r208670: amdsbwd: fix nonsensical timeout calculations 2010-06-22 07:52:58 +00:00
Andriy Gapon 68418bf450 MFC r208669: zfs boot: fix error handling in zfs_readdir 2010-06-22 07:46:54 +00:00
Xin LI 2c2cf3e3e5 Fix a regression when dealing with tar(1) format files
introduced with GNU cpio 2.8.

This is a direct commit against stable/7 because the
code have been removed on -HEAD and stable/8.

PR:		bin/147969
Submitted by:	kientzle
2010-06-21 22:54:47 +00:00
Xin LI 8b0218f997 MFC r208969,209268:
Driver update of twa(4) from LSI.  Many thanks to LSI for continuing to
support FreeBSD.

  1) Timeout ioctl command timeouts.
       Do not reset the controller if ioctl command completed
       successfully.
  2) Remove G66_WORKAROUND code (this bug never shipped).
  3) Remove unnecessary interrupt lock (intr_lock).
  4) Timeout firmware handshake for PChip reset (don't wait forever).
  5) Handle interrupts inline.
  6) Unmask command interrupt ONLY when adding a command to the pending
     queue.
  7) Mask command interrupt ONLY after removing the last command from
     the pending queue.
  8) Remove TW_OSLI_DEFERRED_INTR_USED code.
  9) Replace controller "state" with separate data fields to avoid races:

       TW_CLI_CTLR_STATE_ACTIVE                     ctlr->active
       TW_CLI_CTLR_STATE_INTR_ENABLED               ctlr->interrupts_enabled
       TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY          ctlr->internal_req_busy
       TW_CLI_CTLR_STATE_GET_MORE_AENS              ctlr->get_more_aens
       TW_CLI_CTLR_STATE_RESET_IN_PROGRESS          ctlr->reset_in_progress
       TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS   ctlr->reset_phase1_in_progress

 10) Fix "req" leak in twa_action() when simq is frozen and req is NOT
     null.
 11) Replace softc "state" with separate data fields to avoid races:
       TW_OSLI_CTLR_STATE_OPEN                      sc->open
       TW_OSLI_CTLR_STATE_SIMQ_FROZEN               sc->simq_frozen
 12) Fix reference to TW_OSLI_REQ_FLAGS_IN_PROGRESS in
     tw_osl_complete_passthru()
 13) Use correct CAM status values.
       Change CAM_REQ_CMP_ERR to CAM_REQ_INVALID.
       Remove use of CAM_RELEASE_SIMQ for physical data addresses.
 14) Do not freeze/ release the simq with non I/O commands.
       When it is appropriate to temporarily freeze the simq with an I/O
       command use:
         xpt_freeze_simq(sim, 1);
         ccb->ccb_h.status |= CAM_RELEASE_SIMQ;
       otherwise use:
         xpt_freeze_simq(sim, 1);
         xpt_release_simq(sim, 1);

Submitted by:	Tom Couch <tom.couch lsi.com>
PR:		kern/147694
2010-06-21 22:20:52 +00:00
Kai Wang 028287255a MFC r209122:
* Improve compatibility with existing application code by permitting the
    use of `elf_getbase()` on non-archive members. This change is needed
    for gcc LTO (-flto) to work properly.
  * Style fix: paranthesize returned values.
  * Document the current behaviour of `elf_getbase()`.
2010-06-21 13:52:31 +00:00
Xin LI 71d9f649e7 Fix two regressions introduced by GNU cpio 2.8 import:
cpio/src/copyout.c:
	Old behavior is not to strip leading / from symbol link target.

	By default cpio will replace the symbol link rather than following
	it so this should not be a risk.

cpio/src/util.c:
	Zero out rdev_{maj,min} for files where they are not applicable.

This is a direct commit since GNU cpio has been removed from -HEAD.

Sorry for the breakage...

Reported by:	sbruno
2010-06-18 18:15:40 +00:00
Max Laier 4960c757f0 MFC r209063:
Cache the last result from if_indextoname for printing.  This speeds up
  "arp -an" when using a lot of aliases (on a single interface).

  A better fix would include a better interface for if_indextoname than
  getting the whole address list from the kernel just to find the one
  index->name mapping.
2010-06-17 20:38:18 +00:00
Marius Strobl 611b9690c9 MFC: r209138
Update a branch missed in r207537 (commited to stable/7 in r207891).
2010-06-17 20:10:41 +00:00
Bjoern A. Zeeb ac19d45204 "MFC" (parts of) r185849:
Fix a locking issue triggering an assertion in rt_setgate()
  via arp_rtrequest() due to no radix node head (rnh) lock held
  in case of a route change.

  The previous MFC in r189026 left out this hunk.

Reported by:	Haven Hash (haven.hash isilon.com)
Tested by:	Haven Hash (haven.hash isilon.com)
PR:		kern/147767
2010-06-12 15:42:54 +00:00
Marius Strobl 2e37738364 MFC: r208778
- Mention that VTOC8 labels are found in Fujitsu SPARC64 machines as well.
- Add information regarding VTOC8 bootrstrap code and how it's handled with
  r208777 in place.
- Document the mapping of partition types to VTOC8 tags.
- Add examples for VTOC8 to the respective section.
- Eliminated hard sentence breaks.

Reviewed by:	marcel (slightly buggy version)
2010-06-12 00:28:53 +00:00
Marius Strobl a0d02b3c24 Revert part of r209079 which shouldn't have been MFC'ed, yet. 2010-06-11 22:53:41 +00:00
Marius Strobl 6c62101e42 MFC: r208777
- In gpart_bootfile_read() fix an off-by-one error preventing the bootstrap
  file to be of maximum size.
- Add special handling required for SMI/VTOC8 disklabel partcode, i.e. avoid
  overwriting the label when writing the bootstrap code to the partition
  starting at 0 and install it to all partitions when the -i option is omitted
  just like geom_sunlabel(4) and sunlabel(8) do by default.
- Add missing prototypes.
- Add const where applicable.

Reviewed by:	marcel
2010-06-11 22:35:43 +00:00
Marius Strobl 26cdf34d53 MFC: r208776
Avoid possible NULL-dereferences.

Found with:	Coverity Prevent(tm)
CID:		3428
2010-06-11 22:01:58 +00:00
Marius Strobl 93236f4bcf MFC: r208746
Don't leak memory on destruction.

Reviewed by:	marcel
Approved by:    re (kib)
2010-06-11 21:54:06 +00:00
Xin LI 089356bce6 MFC r205940:
Remove unused files.

PR:		bin/38256
2010-06-10 22:46:12 +00:00
John Baldwin 664d4a501c MFC 208603:
More gracefully handle stale file handles and attributes when opening a
file via NFS.  Specifically, to satisfy close-to-open-consistency, the NFS
client always performs at least one RPC on a file during an open(2) to see
if the file has changed.  Normally this RPC is an ACCESS or GETATTR RPC
that is forced by flushing a file's attribute cache during nfs_open() and
then requesting new attributes.  However, if the file is noticed to be
stale during nfs_open(), the only recourse is to fail the open(2) call
with ESTALE.  On the other hand, if the ACCESS or GETATTR RPC is sent
during nfs_lookup(), then the NFS client can fall back to a LOOKUP RPC to
obtain the new file handle in the case that a file has been replaced.

This change causes the NFS client to flush the attribute cache during
nfs_lookup() when validating a name cache hit if the attributes fetched
during nfs_lookup() can be reused in nfs_open().  This allows the client
to open a replaced file via the new file handle the first time that it
notices a replaced file rather than failing with ESTALE in some cases.
2010-06-10 20:13:23 +00:00
John Baldwin 542a3d86d6 MFC 208925:
The lock associated with the /dev/apm knote is already held, so use
KNOTE_LOCKED() instead of KNOTE_UNLOCKED().
2010-06-10 20:02:13 +00:00
Pyun YongHyeon 2bd49bdfc4 MFC r208862:
Fix a bug introduced in r199011. When bge(4) reuses loaded RX
  buffers it should also reinitialize RX descriptors otherwise some
  stale data could be passed to controller. This could end up with
  mbuf double free or unexpected NULL pointer dereference in upper
  stack. To fix the issue, save loaded buffer's length and
  reinitialize RX descriptors with the saved value whenever bge(4)
  reuses the loaded RX buffers.
  While I'm here, increase the number of RX buffers to 512 from 256.
  This simplifies RX buffer handling as well as giving more RX
  buffers. Controller supports just fixed number of RX buffers
  (i.e. 512) and bge(4) used to rely on hope that our CPU is fast
  enough to keep up with the controller. With this change, bge(4)
  will use 1MB for RX buffers but I don't think it would cause
  problems in these days.

  Reported by:	marcel
  Tested by:	marcel
2010-06-10 18:04:25 +00:00
Andriy Gapon bfc20092d5 MFC r208671: udf_readlink: fix malloc call with uninitialized size
parameter

Found by:	clang static analyzer
2010-06-09 10:14:43 +00:00
Andriy Gapon 1ca4b5b67d MFC r208800: scsi_cd: pass correct pointer to free() 2010-06-09 09:51:16 +00:00
Brian Somers 414c915231 MFC r197477 - clean up keys deleted via pthread_key_delete()
PR:		135462
2010-06-09 07:36:35 +00:00
Pyun YongHyeon 34da376f86 MFC r208806:
Don't blindly set IFF_DRV_OACTIVE when sge_encap() fails. If there
  is no queued frame, IFF_DRV_OACTIVE would never be cleared.

  Submitted by:	Nikolay Denev < ndenev <> gmail at com >
2010-06-08 19:36:41 +00:00
Alan Cox d1cbb09d35 MFC r208765
In the unlikely event that pmap_ts_referenced() demoted five superpage
  mappings to the same underlying physical page, the calling thread would
  be left forever pinned to the same processor.
2010-06-08 04:48:36 +00:00
Andriy Gapon 0e19d2ece1 MFC r208610: boot/zfs: fix gang block reading code
- use correct size (512) while reading a gang block
- skip holes while reading child blocks
- advance buffer pointer while reading child blocks

PR:		144214
2010-06-07 13:44:04 +00:00
John Baldwin c581257df0 MFC 208555:
Ignore the 'addr' argument passed to PT_STEP (it is required to be '1'
for PT_STEP which means "ignore") and PT_DETACH.
2010-06-01 19:39:27 +00:00
Pyun YongHyeon 9e51a50bf3 MFC r208512:
sge_encap() can sometimes return an error with m_head set to NULL.
  Make sure not to requeue freed mbuf in sge_start_locked(). This
  should fix NULL pointer dereference panic.

  Reported by:	Nikolay Denev <ndenev <> gmail dot com>
  Submitted by:	jhb
2010-05-31 22:07:18 +00:00
Colin Percival cba6498271 Change the current working directory to be inside the jail created by
the jail(8) command. [10:04]

Fix a one-NUL-byte buffer overflow in libopie. [10:05]

Correctly sanity-check a buffer length in nfs mount. [10:06]

Approved by:	so (cperciva)
Approved by:	re (kensmith)
Security:	FreeBSD-SA-10:04.jail
Security:	FreeBSD-SA-10:05.opie
Security:	FreeBSD-SA-10:06.nfsclient
2010-05-27 03:15:04 +00:00
Matt Jacob 8afe9a1216 This is an MFC of 208119, 208129
Hook up some wires that were forgotten a few months ago and restore
the zombie device timeout code and the loop down time code and the fabric
hysteresis code.
2010-05-26 19:06:40 +00:00
Marius Strobl 997d287a80 MFC: r208468
At least on sparc64 this module requires ata_machdep.c.
2010-05-26 17:30:19 +00:00
Jung-uk Kim b9810a5392 Regen for r208551. 2010-05-25 20:35:39 +00:00
Jung-uk Kim 256427e2ef MFC: r208322
Add an option file for WITHOUT_MAN_UTILS to regenerate src.conf(5).
2010-05-25 20:33:49 +00:00
Jung-uk Kim 4e46d43fc3 MFC: r208320
Add a new build option, MAN_UTILS.  This option lets you control building
utilities and related support files for manual pages, which were previously
controlled by MAN.  For POLA, the default depends on MAN, i.e., WITHOUT_MAN
implies WITHOUT_MAN_UTILS and WITH_MAN implies WITH_MAN_UTILS.
Note this patch implicitly fixes a documentation bug of src.conf(5), which
says WITHOUT_MAN may be used to not build manual pages while it was also
disabling some utilities for manual pages.
2010-05-25 20:32:30 +00:00
Jung-uk Kim 9e5896f7d7 Regen for r208540. 2010-05-25 15:58:31 +00:00
Jung-uk Kim 954df5a569 MFC: r183305, r183306
Add mission options.
2010-05-25 15:51:36 +00:00
John Baldwin ceb36f9418 MFC 208350:
Add support for the Perle Speed4 LE.
2010-05-24 19:36:32 +00:00
Andrew Gallatin 4373085b17 MFC 208379: Add interrupt descriptions for mxge's msi-x vectors 2010-05-24 13:01:07 +00:00
Andrew Gallatin f9a7f6838c MFC 208312: Correctly identify some twinax cables, which report
a media type of 1
2010-05-24 12:50:55 +00:00
Andrew Gallatin 36fa3d03da MFC 208309: Update mxge firmware to latest available from Myricom. 2010-05-24 12:11:19 +00:00
Doug Barton 55ebf40509 Upgrade to 9.4-ESV-R2, which addresses the following:
Named could return SERVFAIL for negative responses
	from unsigned zones.
2010-05-24 06:41:57 +00:00
Christian Brueffer 3ba8584108 MFC: r207998
Fix grammar in a line of output.
2010-05-23 20:28:06 +00:00
Christian Brueffer ebc8ad5174 MFC: r208054
List /var/cron/tabs in FILES and add descriptions for the other entries.
2010-05-23 20:24:35 +00:00
Christian Brueffer b2e1eb2451 MFC: r208056
Wording fixes.
2010-05-23 20:20:04 +00:00
Christian Brueffer 998939f1eb MFC: r208053
Mention LSI Logic FC949E.
2010-05-23 20:16:18 +00:00
Benedict Reuschling bb2e16d4fc MFC r208273:
Add a sentence to the man page explaining that the -d option
can only be used when ntpd is compiled with DEBUG support.

PR:             docs/138206
Submitted by:   Oliver Pinter (oliver dot pntr at gmail dot com)
Approved by:    roberto
2010-05-23 11:28:04 +00:00
Navdeep Parhar a7de3ba0c9 MFC r208356.
Remove bad assertion.
2010-05-23 09:28:55 +00:00
Stefan Farfeleder 5761ad8eab Merge r193178 and r194897: Tests for the eval command. 2010-05-21 16:32:14 +00:00
Stefan Farfeleder 9ebb597808 Merge r199628 and r199632: Tests for the cd command. 2010-05-21 16:25:16 +00:00
John Baldwin c84bcea689 MFC 208213:
Prevent unloading a kld for a driver that has subinterfaces (vlan interfaces)
from being automatically reloaded via devd shutdown event handlers.
- Revert part of my previous changes to call ifn_stop on subinterfaces
  when an interface is detached.  It is better to destroy the interfaces
  first so that an 'ifconfig foo0.blah down' doesn't result in ifconfig
  auto-loading if_foo.ko.  The ifconfig command will not be invoked if
  foo0.blah is gone when ifn_stop() is called.  Furthermore, it is not
  necessary to explicitly invoke ifn_stop() after the subinterface is
  destroyed as devd will already do that.
- Pass -n to ifconfig when destroying interfaces so that destroying a
  cloned interface does not kldload any drivers.
2010-05-21 16:17:46 +00:00
John Baldwin 82cd7d33d0 MFC 208212:
Ignore failures from removing multicast addresses from the parent (trunk)
interface when tearing down a vlan interface.
2010-05-21 16:07:41 +00:00
Jaakko Heinonen 3128e7828b MFC r197956:
- Catch SIGHUP to perform cleanup before exiting.
- Exit if getch() returns with an error other than EINTR. Otherwise
  systat(1) may get stuck in an infinite loop if it doesn't receive
  SIGHUP when terminal closes.
- Remove attempt to clear stdio error indicators. getch() doesn't use
  stdio, making it useless.
- Remove unneeded masking of getch() return value.

PR:		bin/107171
2010-05-21 16:03:57 +00:00
Kenneth D. Merry 100c61f82e MFC r206844:
Don't clear other flags (e.g. CSUM_TCP) when setting CSUM_TSO.  This was
causing TSO to break for the Xen netfront driver.

Reviewed by:  gibbs, rwatson
2010-05-21 04:48:40 +00:00
Gordon Tetlow 43f75014d0 MFC r207981:
Fix a bug due to a type conversion from 64 to 32 bits. The side effect of
 this type conversion is the high bits which were used to indicate if a
 special character was a literal or special were dropped. As a result, all
 special character were treated as special, even if they were supposed to
 be literals.

Approved by:	mentor (wes@)
2010-05-20 23:06:53 +00:00
Xin LI d12fd16d6f MFC r180407 (peter):
Merge gnu cpio 2.6 -> 2.8 changes.
2010-05-20 19:45:11 +00:00
Marius Strobl fc3a092909 MFC: r208143
Add the ofw_bus_if.h dependency introduced with r207585 (MFC'ed to
stable/7 in r208087).
2010-05-20 08:43:31 +00:00
Xin LI dda77c9696 MFC r207733:
Plug memory leak.
2010-05-20 00:31:51 +00:00
Pyun YongHyeon e2c42d430e MFC r208084:
If controller received bad frames make sure to update newly added
  RFA. Also drop frames that have either CRC error or alignment
  error. Normally bad frames are not received at all. But controllers
  running in promiscuous mode will receive bad frames. 82557 will
  also receive bad frames to receive VLAN oversized frames.

  While I'm here mark RNR condition if driver happen to see RNR in
  RFA status and restart RU to receive frames again. Because driver
  checks all received frames in RX loop, RNR condition could be set
  in the middle of RX processing. Just relying on RNR interrupt was
  not enough.

  This change fixes "Memory modified after free" issue when fxp(4)
  is running as a member of if_bridge(4).

  Tested by:	Larry Baird <lab <> gta dot com>
2010-05-19 21:12:10 +00:00
Pyun YongHyeon b16648b59b MFC r208081,208083:
r208081:
  Controller updates RFA via DMA so driver needs synchronization.
  Add missing BUS_DMASYNC_POSTWRITE and BUS_DMASYNC_PREREAD.

r208083:
  Dont' allow dma map load deferring. fxp(4) is not able to handle
  EINPROGRESS.
2010-05-19 21:02:02 +00:00
John Baldwin 598b7efeee MFC 200637,207335:
- Don't panic due to unlocking an unowned mutex if we fail during attach.
- Initialize the callout structure earlier in attach before calling any
  routines that can fail since ciss_free() always tries to stop and drain
  the callout.
2010-05-19 19:45:17 +00:00
Andriy Gapon 635451d2f6 kern_ntptime: fix two problems with r208298 (MFC of r207360)
This is a direct commit to fix previous improperly done MFC.
- sys/clock.h include is needed for resettodr()
- there is no callout_schedule in 7, so callout_reset has to be used
2010-05-19 15:50:17 +00:00
Andriy Gapon dd24e809b6 MFC r207360: periodically save system time to hardware time-of-day clock 2010-05-19 10:35:53 +00:00
Andriy Gapon d1dd510942 MFC r207359,207362: kern_ntptime: abstract time error check into a
function
2010-05-19 10:29:37 +00:00
Marius Strobl 0341249c62 MFC: r208098
Document the led(4) interface to the identification LEDs.
2010-05-18 17:15:41 +00:00
Marius Strobl 56355c1680 MFC: r208117
Fix a mismerge in r206001 (MFC'ed to stable/7 in r208105).

PR:		146614
Approved by:	jfv (implicit)
2010-05-18 17:09:22 +00:00
Marius Strobl 5b078c04c5 MFC: r205254, r208097
- Add quirk handling for Sun Fire V1280. The firmware of these machines
  provides no ino-bitmap properties so forge them using the default set
  of controller interrupts and let schizo_setup_intr() take care of the
  children, hoping for non-fancy routing.
- Enable DMA write parity error interrupts on Schizo with a working
  implementation.
- Let schizo_pci_bus() only panic in case of fatal errors as the interrupt
  triggered by the error the firmware of Sun Fire V890 as well as 280R
  with version 7 Schizo caused may happen as late as using the HBA and not
  only prior to touching the PCI bus (in the former case the actual error
  still is fatal but we clear it before touching the PCI bus).
  While at it count and export non-fatal error interrupts via sysctl(9).
- Remove unnecessary locking from schizo_ue().
2010-05-18 17:02:35 +00:00
Doug Barton bbcbc7acb2 MFC r208089:
Remove duplicate
2010-05-18 02:23:04 +00:00
Doug Barton bc313c5dba MFC r208088:
Hide the creation and population of the temproot
2010-05-18 02:18:27 +00:00
Pyun YongHyeon 2dac3a02a3 MFC r207971:
Document undocumented tunables and sysctl variables.
  While here use actual string to specify width as well as using Cm
  to set command argument.
2010-05-17 17:18:58 +00:00
Pyun YongHyeon 69fc12389e MFC r207853:
Now sge(4) supports TCP segmentation offload (TSO).
2010-05-17 17:16:49 +00:00
Pyun YongHyeon 06b1d5c78e MFC r207852:
SiS190 supports RX 10 bytes padding, CRC stripping as well as VLAN
  hardware tag insertion/stripping. Remove conditional code that
  disables these hardware features on SiS190. Also nuke RX fixup code
  which is no more required on strict-alignment architectures because
  SiS190 supports RX 10 bytes padding.
  Now all hardware features except jumbo frame and WOL are supported.
  Thanks to Masa Murayama who confirmed SiS190 also has the same
  hardware features of SiS191.
  I guess the only difference between SiS191 and SiS190 would be
  jumbo frame support. It will be implemented in near future.
2010-05-17 17:14:25 +00:00
Pyun YongHyeon cfbddc8ff1 MFC r207851:
Implement TSO and TSO over VLAN. Increase number of allowed
  fragmentation of mbuf chain to 32 from 16 because TSO can send 64KB
  sized packet which in turn requires long list of mbuf chain. Due to
  lack of documentation, I'm not sure whether driver have to pull up
  ethernet/IP/TCP header with options to make controller work but
  driver have to parse TCP header to update pseudo TCP checksum
  anyway. The controller expects pseudo TCP checksum computed by
  upper stack and the checksum should follow the MS NDIS
  specification to make TSO work.

  Tested by:	xclin <xclin <> cs dot nctu dot edu dot tw >
2010-05-17 17:04:09 +00:00
Pyun YongHyeon 4bd8a41b09 MFC r207832:
Export hardware MAC statistics through sysctl node. Previously
  fxp(4) already used to extract most hardware MAC statistics but it
  didn't show them. With this change, all MAC statistics counters
  are exported. Because there are a couple of new counters for 82558
  and 82559, enable extended MAC statistics functionality to get
  these counters. Accoring to public data sheet, 82559 MAC statistics
  return 24 DWORD counters(3 counters are unknown at this moment) so
  increase MAC counter structure to meet the MAC statistics block size.
  The completion of MAC counter dump is now checked against
  FXP_STATS_DR_COMPLETE status code which is appended at the end of
  status block. Previously fxp(4) ignored the status of the
  FXP_SCB_COMMAND_CU_DUMPRESET command. fxp(4) does not wait for the
  completion of pending command before issuing
  FXP_SCB_COMMAND_CU_DUMPRESET. Instead it skips the command and try
  it next time. This scheme may show better performance but there is
  chance to loose updated counters after stopping controller. So make
  sure to update MAC statistics in fxp_stop().
  While I'm here move sysctl node creation to fxp_sysctl_node().

  Tested by:	Larry Baird < lab <> gta dot com >
2010-05-17 16:59:36 +00:00
Pyun YongHyeon a574eeb49a MFC r207750:
8255x configure command requires number of bytes of configuration
  table. The default size of the configuration table was 22 bytes. To
  use extended feature of 82550/82551 the configuration table size
  was expanded to 32 bytes. The added configuration for 82550/82551
  specifies VLAN hardware tagging and IPSec configuration as well as
  TCO.
  To make configuration easier fxp(4) used a configuration template
  and the template was copied to configuration table. After that,
  some parameters of the configuration table was changed depending on
  controller type and operation mode. However the size of template
  was 22 bytes so some configuration parameters were not properly
  initialized on 82550/82551.
  Fix this by increasing the template size. For 82557, 82558 and
  82559 the size of the configuration is still 22 bytes.
2010-05-17 16:54:31 +00:00
Konstantin Belousov 8383881bb2 Partial MFC r207847:
For detach procfs ctl command, clear P_STOPPED_TRACE process stop flag.
2010-05-17 08:46:27 +00:00
Konstantin Belousov 5ea2f5cfb9 MFC r207848:
The thread_unsuspend() requires both process mutex and process spinlock
locked. Postpone the process unlock till the thread_unsuspend() is called.
2010-05-17 08:35:14 +00:00
Jack F Vogel c21b247328 Change lem_poll to match em 2010-05-17 02:20:24 +00:00
Jaakko Heinonen 4e5dc88a89 MFC r203157, r203816:
Handle short reads when the -P option is used and remove some dead code.

PR:		bin/121502
2010-05-16 16:33:38 +00:00
Jilles Tjoelker c017559987 MFC r207817: builtin(1): sh has no @ builtin command. 2010-05-16 11:17:21 +00:00
Jilles Tjoelker b191a114b2 MFC r207816: Document clock and pshared condvar attributes.
Note: clock accepts CLOCK_VIRTUAL and CLOCK_PROF too, but this seems broken
as it simply waits for the difference of the current and given value of the
clock as if it were CLOCK_MONOTONIC. So document only CLOCK_REALTIME and
CLOCK_MONOTONIC as allowed.
2010-05-16 11:14:11 +00:00
Stefan Farfeleder c5c1a8e256 Merge r193169: Fix the eval command in combination with set -e. 2010-05-16 10:23:33 +00:00
Stefan Farfeleder e695f08e9e Merge r190698: Don't let trailing empty lines overwrite the result of the last
command with 0.
2010-05-16 10:20:54 +00:00
Stefan Farfeleder b7b2af1e5c Merge r199631: Handle current work directories of arbitrary length. 2010-05-16 09:59:28 +00:00
Jack F Vogel d575fde0f3 Change poll routine to conform to proper interface. 2010-05-16 04:31:16 +00:00
Jack F Vogel c515f0a9d9 Add missing lem files to the MFC 2010-05-15 07:01:41 +00:00
Jack F Vogel c848c9468f MFC the new em/lem/igb drivers for stable/7 2010-05-14 22:39:51 +00:00
Doug Barton 50591e4787 MFC 208060:
Remove trailing white space. No functional changes.

Hand-delete trailing ws from rc.firewall while I'm here.
2010-05-14 19:36:11 +00:00
Marius Strobl a3ca5bae5a MFC: r207885
Include <machine/ofw_machdep.h> for OF_getscsinitid().
2010-05-14 19:18:06 +00:00
Marius Strobl af316c71a6 MFC: r207586
Sun GigaSwift Ethernet 1.0 MMF work with r207585 (MFC'ed to stable/7 in
r208087) in place.
2010-05-14 19:15:55 +00:00
Marius Strobl a1dbdb7d22 MFC: r207585
- Don't set CAS_PCS_DATAPATH to anything except CAS_PCS_DATAPATH_SERDES
  on Cassini using the external PCS SERDES otherwise unaligned access
  traps and other strange effects happen with some machines. Don't touch
  the MIF which is unused in that case either. These changes require the
  PHY type to use to be determined via the OFW device tree or from the
  VPD in machines without the former.
- Disable the SERDES pins of Saturn when not used in order to save power
  and ensure they are enabled otherwise.
- In cas_attach() use the correct register offset for CAS_PCS_CONF_EN.
- Add some bus space barriers missing in the PCS code path.

These changes make the Sun GigaSwift Ethernet 1.0 MMF cards as well as
the on-board interfaces found in Sun Fire B100s Blade Server work.

PR:	144867
2010-05-14 19:12:01 +00:00
Fabien Thomas 4905403074 MFC r207755:
Rework the calltree top view by critical callchain.
The percentage shown is the sum of the cost for the codepath.
2010-05-14 13:43:23 +00:00
Martin Matuska 930eaf5fcd MFC r207910:
(cddl/contrib/opensolaris part)

Fix possible panic with zfs destroy.
OpenSolaris onnv revision:	8779:f164e0e90508

PR:		kern/146471
Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6784924)
2010-05-14 10:06:20 +00:00
Martin Matuska 353903283d MFC r207909, r207910, r207911:
MFC r207909:
Fix zfs rename (may occasionally fail with dataset busy).
OpenSolaris onnv revision:	8517:41a0783dde17

MFC r207910:
Fix possible panic with zfs destroy.
OpenSolaris onnv revision:	8779:f164e0e90508

MFC r207911:
Fix failed assertion on destroying datasets from an older pool version.
OpenSolaris onnv revision:	9390:887948510f80

PR:		kern/146471
Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6784757, 6784924, 6826861)
2010-05-14 10:04:11 +00:00
Martin Matuska ae2dcd390a MFC r207908:
Fix endianess bug in ZFS intent log (ZIL).

OpenSolaris onnv revision:	8109:6147a1bdd359

Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6760048)
2010-05-14 09:09:08 +00:00
Martin Matuska 9f1f7d6ff5 MFC r207427:
Fix improper pool write throughput calculation.

OpenSolaris onnv revision:      9366:17553395a745

PR:		kern/146108
Obtained from:	OpenSolaris (Bug ID 6817339)
Approved by:	pjd, delphij (mentor)
2010-05-14 09:02:31 +00:00
Martin Matuska b5d042dcaa MFC r207480:
Change description of tunable group vfs.zfs.txg to be more
understandable.

Approved by:	pjd, delphij (mentor)
2010-05-14 08:56:07 +00:00
Jilles Tjoelker 407aaa2bb1 MFC r207449: telnet: Fix infinite loop if local output generates SIGPIPE.
Instead of catching SIGPIPE and jumping out of the signal handler with
longjmp, ignore it and handle write errors to the local output by exiting
from there. I have changed the error message to mention the local output
instead of NetBSD's wrong "Connection closed by foreign host". Write errors
to the network were already handled by exiting immediately and this now
applies to EPIPE too.

The code assumed that SIGPIPE could only be generated by the network
connection; if it was generated by the local output, it would longjmp out of
the signal handler and write an error message which caused another SIGPIPE.

PR:		19773
Obtained from:	NetBSD
2010-05-13 15:28:34 +00:00
Pyun YongHyeon 3c7ccd67d4 MFC r207763:
Don't change PCIe maximum read request size to 2048 on RTL810x
  controllers. It caused device timeouts.

  Reported by:	McLone < mclone <> gmail dot com >
  Tested by:	McLone < mclone <> gmail dot com >
2010-05-12 17:34:51 +00:00
Pyun YongHyeon 8c285f14dc MFC r207748:
It seems controller has two types of promiscuous control, one for
  unicast and the other for multicast. To receive multicast frames
  that host didn't join in promiscuous mode, driver have to set
  promiscuous mode for multicast frames as well.
  The Open Source Software Developer Manual for i8255x was not clear
  how to handle promiscuous mode.

  PR:		kern/145905
2010-05-12 17:12:47 +00:00
Xin LI c7041a30ee MFC r205622:
Expose MACHINE_CPU while building lib32 target.
2010-05-11 19:26:17 +00:00
Martin Matuska 6e7a0629e1 MFC r207624:
Fix deadlock during zfs receive.

OpenSolaris onnv revision:	9299:8809e849f63e

PR:		kern/146296
Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6783818, 6826836)
2010-05-11 07:07:44 +00:00
Edwin Groothuis 25d1f60f47 MFC of 207898, tzdata2010j:
- Bahia de Banderas (Mexican state of Nayarit) changed time zone
  UTC-7 to new time zone UTC-6 on April 4, 2010 (to share the same
  time zone as nearby city Puerto Vallarta, Jalisco).
2010-05-10 21:04:40 +00:00
Marius Strobl 797ae9f5c5 MFC: r207683
- Fix broken symlinks on cross platform zfs send/recv. [1]
- Enable zfs_ace_byteswap() on FreeBSD as it works just fine (tested between
  amd64 and sparc64 in both directions by Michael Moll).

PR:		146272
Approved by:	mm, pjd
Obtained from:	OpenSolaris (onnv rev. 8283:1ca59f393041; Bug ID 6764193) [1]
2010-05-10 20:55:24 +00:00
Marius Strobl b87310cce4 MFC: r207570
On sparc64 obtain the initiator ID from the Open Firmware device tree
in order to match what the PROM built-in driver uses.
2010-05-10 20:34:19 +00:00
Marius Strobl c12fe46f30 MFC: r207537
Add support for SPARC64 V (and where it already makes sense for other
HAL/Fujitsu) CPUs. For the most part this consists of fleshing out the
MMU and cache handling, it doesn't add pmap optimizations possible with
these CPU, yet, though.
With these changes FreeBSD runs stable on Fujitsu Siemens PRIMEPOWER 250
and likely also other models based on SPARC64 V like 450, 650 and 850.
Thanks go to Michael Moll for providing access to a PRIMEPOWER 250.
2010-05-10 20:25:51 +00:00
Marius Strobl 18e3c7b534 MFC: r207533 (partial)
Remove redundant checking of sc_leaving (uart_intr() already handles this).
2010-05-10 20:15:40 +00:00
Pyun YongHyeon b49ccdd29d MFC r207622-207623,207638
r207622:
  Drop driver lock before exiting from interrupt handler.

r207623:
  Make sure to check whether driver is running before processing
  received frames. Also check driver has valid ifp pointer before
  calling msk_stop() in device_shutdown handler. While I'm here
  remove unnecessary accesses to interrupt mask registers in
  device_shutdown handler because driver puts the controller into
  reset state.
  With these changes, msk(4) now survive from heavy RX traffic(1byte
  UDP frame) while reboot is in progress.

r207638:
  When VLAN hardware tagging is disabled, make sure to disable VLAN
  checksum offloading as well as TSO over VLAN.
2010-05-10 20:08:01 +00:00
Marius Strobl c8e146cc22 Partial MFC 186347 and 186355 in order to remove differences in headers
required.
2010-05-10 20:00:50 +00:00
Pyun YongHyeon 578bf98b27 MFC r207628,207635:
r207628:
  Enable multi-descriptor transmisstion for fragmented mbufs. There
  is no more need to defragment mbufs. After transmitting the
  multi-fragmented frame, the controller updates only the first
  descriptor of multi-descriptor transmission so it's driver's
  responsibility to clear OWN bits of remaining descriptor of
  multi-descriptor transmission. It seems the controller behaves much
  like jme(4) controllers in descriptor handling.

r207635:
  Free entire mbuf chain instead of the first mbuf.
2010-05-10 19:54:01 +00:00
Jung-uk Kim c677e9d8b2 MFC: r207330, r207620
- Remove dead code.  Calculated greatest common divisor was not used at all.
- Prefer u_int32_t over unsigned int to make its intention more clearer.
- Move the function to a header file and make it a static inline function.
2010-05-10 19:22:34 +00:00
Marius Strobl 42c01297f2 MFC: r207500
Add a hack for SPARC64 V CPUs, which set some undocumented bits in the
first data word.
2010-05-10 19:02:22 +00:00
Marius Strobl 0285cc06f1 MFC: r207287
On sparc64 obtain the initiator ID to be used for SPI HBAs from the
Open Firmware device tree in order to match what the PROM built-in
driver uses. This is especially important when netbooting Fujitsu
Siemens PRIMEPOWER250 as in that case the built-in driver isn't used
and the port facts PortSCSIID defaults to 0, conflicting with the
disk at the same address.
2010-05-10 18:56:40 +00:00
Marius Strobl 32e119586a MFC: r207286
Replace a magic value with the appropriate macro.
2010-05-10 18:54:59 +00:00
Marius Strobl 056377ee7f MFC: r207285
- On sparc64 obtain the initiator ID from the Open Firmware device tree
  in order to match what the PROM built-in driver uses.
- Remove some no longer used includes.
2010-05-10 18:53:44 +00:00
Marius Strobl 6fe175a340 MFC: r207281
Take advantage of OF_getscsinitid().
2010-05-10 18:52:00 +00:00
Marius Strobl 14f45a979d MFC: r207248
Don't bother enabling interrupts before we're ready to handle them. This
prevents the firmware of Fujitsu Siemens PRIMEPOWER250, which both causes
stray interrupts and erroneously enables interrupts at least when calling
SUNW,set-trap-table, from shooting itself in the foot.
2010-05-10 18:50:28 +00:00
Marius Strobl fca76de477 MFC: r207243
Add OF_getscsinitid(), a helper similar to OF_getetheraddr() but for
obtaining the initiator ID to be used for SPI controllers from the
Open Firmware device tree.
2010-05-10 18:47:54 +00:00
Marius Strobl cdaa54b193 MFC: r207242
For the on-board interfaces found in Fujitsu SPARC64 machines obtain the
MAC address via OFW as well.
2010-05-10 18:46:37 +00:00
Marius Strobl a3e9e18dfb MFC: r207241
- Add a missing const.
- Map the NS16550 found in Fujitsu Siemens PRIMEPOWER250 to PNP0501 as well.
2010-05-10 18:45:20 +00:00
Marius Strobl 2493b1e8f0 MFC: r207240
Skip the pseudo-devices found in Fujitsu Siemens PRIMEPOWER250.
2010-05-10 18:43:44 +00:00
Pyun YongHyeon a26d93413d MFC r207545,207625:
r207545:
  Fix wrong dma tag usage. Previously it used TX descriptor ring dma
  tag which should be TX mbuf dma tag.

r207625:
  Remove clearing RxHashTable2 register. The register is reprogrammed
  in sge_rxfilter().
2010-05-10 18:40:37 +00:00
Xin LI 1ed81e350f MFC most of the recent changes to gzip(1) back to RELENG_7. 2010-05-10 02:09:53 +00:00
Ed Maste 8c6a30ffe3 MFC r207590:
Update GRANDPARENTED text to match the contents of tzdata/factory r19879.
  This eliminates "warning: time zone abbreviation differs from POSIX" on
  installworld.
2010-05-10 01:23:31 +00:00
Fabien Thomas f443834e81 MFC r207731:
Exclude undefined symbol from ELF file when doing function resolve.
2010-05-09 15:41:27 +00:00
Doug Barton f8ae501311 rc_quiet does not exist in RELENG_7, so hand-merge the part of r179870
that I did not think was applicable here (namely bailing out of
run_rc_command before printing the warning) but use rc_fast as the
trigger instead of rc_quiet. The former exists in all supported branches,
and is set at boot time so it does the job.

The only remaining element that isn't already covered by 'faststart' is
an instance of '/etc/rc.d/ipfilter resync' in rc.d/netif, so make that
fastresync to also silence the warning there. This is similar to what
was done in r175676, although that used quietresync (as described above).

Pointed out by:	jhell <[email protected]>
2010-05-09 08:22:33 +00:00
Doug Barton 4ddd483630 MFC 207346:
Fix named-checkconf in the situation where named_chroot_autoupdate
is NOT set, but named_chrootdir IS set.

Remove required_files for named.conf, named-checkconf is enough.
2010-05-08 22:24:31 +00:00
Doug Barton 3d330d125d MFC r206686:
Make 'stop' work even if ${name}_enable is not set.
2010-05-08 22:15:05 +00:00
Doug Barton 9d244fb21f MFC r179870:
Move the check for enabled knobs further down in run_rc_command() so
that bogus commands cause usage information to be printed instead of
diagnostics about enabling the knob.

This is a prerequisite for merging r206686.
2010-05-08 22:13:48 +00:00
Giorgos Keramidas cc0cb22a4c MFC r196254 iostat: add a bit of space between tty in/out columns
The columns for tty input and output may bump against each other
if the tty output needs more than 5 columns.  Add a bit of space
that pushes everything 1 column to the right, but also avoids the
problem.

Approved by:    rwatson
2010-05-08 20:02:39 +00:00
Warner Losh 680fd7068e MFC 185023 (by raj):
Initial gdbserver support for ARM.
  Obtained from:  Juniper Networks, Semihalf
2010-05-08 13:23:57 +00:00
Konstantin Belousov 940796fc94 MFC r207606:
Fix typo in comment.
2010-05-07 11:17:20 +00:00
Pyun YongHyeon 5e1b061cfe MFC r207447:
Marvell 88E8059(Yukon Optima) is now supported.
2010-05-06 18:53:43 +00:00
Pyun YongHyeon 6567bc2faf MFC r207446:
Add Marvell PHYG65G Gigabit PHY which is found on 88E8059 Yukon Optima.

  Tested by:	James LaLagna < jameslalagna <> gmail dot com >
2010-05-06 18:51:47 +00:00
Pyun YongHyeon d63eec4e07 MFC r207445:
Add basic support for Marvell 88E8059 Yukon Optima.

  Tested by:	James LaLagna < jameslalagna <> gmail dot com >
2010-05-06 18:48:44 +00:00
Pyun YongHyeon 6b9ab9ee2a MFC r207409,207442:
r207409:
  Both RX_GMF_LP_THR and RX_GMF_UP_THR must be 16 bits register. If
  it is 8bits register then RX FIFO size can't exceed 2KB which is
  not true for almost all Yukon II controller.

r207442:
  Disable non-ASF packet flushing on Yukon Extreme as vendor's driver
  does. Without this change, Yukon Extreme seems to generate lots of
  RX FIFO overruns even though controller has available RX buffers.
  These excessive RX FIFO overruns generated lots of pause frames
  which in turn killed devices plugged into switch. It seems there is
  still occasional RX frame corruption on Yukon Extreme but this
  change seems to fix the pause frame storm.

  Reported by:	jhb
  Tested by:	jhb
2010-05-06 18:44:49 +00:00
Pyun YongHyeon d2e0dcf090 MFC r207381:
Now sge(4) supports hardware VLAN tag insertion/stripping.
2010-05-06 18:38:19 +00:00
Pyun YongHyeon 115912c87a MFC r207380:
Enable VLAN hardware tag insertion/stripping. Due to lack of SiS190
  controller, I'm not sure whether this is also applicable to SiS190
  so this feature is only activated on SiS191 controller.
  In theory, controller reinitialization is not needed when VLAN tag
  configuration is changed, but xclin said controller was not stable
  whenever toggling VLAN tag bit. To address that, sge(4)
  reinitialize controller for VLAN configuration which seems to work
  as expected. VLAN tag information for TX/RX descriptor and
  configure bit of RxMacControl register was found by xclin.

  Submitted by:	xclin <xclin <> cs dot nctu dot edu dot tw > (initial version)
  Tested by:	xclin <xclin <> cs dot nctu dot edu dot tw >
2010-05-06 18:35:53 +00:00
Pyun YongHyeon b7494d7722 MFC r207379:
Enable FCS stripping and padding 10 bytes bit of RX MAC control
  register. Due to lack of SiS190 controller, I'm not sure whether
  this is also applicable to SiS190 so this feature is only activated
  on SiS191 controller.
  The controller can pad 10 bytes before DMAing a received frame to
  RX buffer and received bytes include the padded bytes. This padding
  is very useful on strict-alignment architectures because driver
  does not have to copy received frame to align IP header on 4 bytes
  boundary. It also gives better RX performance on non-strict
  alignment architectures. Special thanks to xclin to give me
  valuable register information. Without his enthusiastic trial and
  errors this wouldn't be even possible.

  While I'm here tighten validity check of received frame. Controller
  clears RDS_CRCOK bit when it received bad CRC frames. xclin found
  that using loop back testing.

  Tested by:	xclin <xclin <> cs dot nctu dot edu dot tw >
2010-05-06 18:32:02 +00:00
Pyun YongHyeon 3025db336e MFC r207375-207377.
r207375:
  Preserve unknown bits of RX MAC control register when driver
  programs RX filter configuration. It seems RX MAC control register
  is one of key registers to get various offloading features as well
  as performance. Blindly clearing unrelated bits can result in
  unexpected results.

  Tested by:    xclin <xclin <> cs dot nctu dot edu dot tw >

r207376:
  Remove wrong link state chage.

r207377:
  Explicitly marks SiS190 to differentiate it from SiS191.
2010-05-06 18:26:43 +00:00
Gavin Atkinson 2408c22dc2 Merge r202161 from head:
Spell "Hz" correctly wherever it is user-visible.

PR:		bin/142566
Submitted by:	N.J. Mann   njm njm.me.uk
2010-05-06 12:37:01 +00:00
Jilles Tjoelker 618e44f76d MFC r206760: getcwd(3): Clarify that EACCES may or may not be checked.
POSIX permits but does not require checking access on the current and parent
directories.

Because various programs do not like it if getcwd(3) fails, it seems best
to avoid checking access as much as possible. There are various reports in
GNATS about this (search for getcwd).

Our getcwd(3) implementation first queries the kernel for the pathname
directly, which does not check any permissions but sometimes fails, and then
falls back to reading all parent directories for the names.

PR:		standards/44425
2010-05-05 22:19:52 +00:00
Jilles Tjoelker 17583a2d82 MFC r207186: sysctl(3): Update description of various kern.* variables.
Also add xrefs for confstr(3) (as sysconf(3) but for strings) and kvm(3)
(which is a more convenient way to access some of the variables).

PR:		116480
2010-05-05 22:07:28 +00:00
Gavin Atkinson be24891f69 Fix merge botch.
Submitted by:	Sofian Brabez <sbrabez gmail.com>
Pointy hat:	Earned and deserved.
2010-05-05 20:54:16 +00:00
Gavin Atkinson ee2f97da4c Spell "Hz" correctly in arlcontrol.
Direct commit to stable/7 as this code no longer exists in head.

PR:		bin/142566
Submitted by:	N.J. Mann  <njm njm.me.uk>
2010-05-05 17:17:19 +00:00
Ken Smith 6811b3eb35 Merge r206423:
> Shift the version of perl used by the release build process over to
> perl-5.10.  This aligns the release build process with the current
> default version of perl in the ports tree.
2010-05-05 17:01:03 +00:00
Ken Smith 16f9aa8798 Merge r206422:
> Pass the HTTP_PROXY and FTP_PROXY environment variables through in addition
> to FTP_PASSIVE_MODE so release building works for a machine that needs
> to use a proxy.

PR:           misc/137688
Submitted by: Michael Leun
2010-05-05 16:41:14 +00:00
Gavin Atkinson 30825f3199 Merge r203310,203547,203717 from head:
Implement the "-i" option to sysctl(8), to ignore failures while
  retrieving individual OIDs.  This allows the same list of OIDs to be
  passed to sysctl(8) across different systems where particular OIDs may
  not exist, and still get as much information as possible from them.

PR:		bin/123644
Submitted by:	dhw
2010-05-05 12:48:30 +00:00
Dmitry Morozovsky efdf96ea82 MFC r207068:
Allow to modify directory's content even if the ZFS_NOUNLINK (SF_NOUNLINK,
  sunlnk) flag is set. We only deny dirctory's removal or rename.

  PR:           kern/143343
  Approved by:	pjd
2010-05-05 09:01:15 +00:00
Xin LI 7d3cd92b2f MFC r206973:
When CPUTYPE is defined to any value, on amd64 platform "mmx" is
available through MACHINE_CPU, indicating the CPU supports that
feature, as done by revision 138685.

This changeset adds "mmx" into the default amd64 MACHINE_CPU list
when no CPUTYPE is specified to provide consistent behavior.

PR:		amd64/145593
Submitted by:	mm
2010-05-05 00:39:06 +00:00
Jilles Tjoelker 9adee652c9 MFC r207153: stat: Allow -f %Sf to display the file flags symbolically.
PR:		124349
2010-05-04 21:56:16 +00:00
John Baldwin 3825be9635 MFC: 202767,202774
Add a timeout for the negative name cache entries in the NFS client.
This avoids a bogus negative name cache entry from persisting forever
when another client creates an entry with the same name within the
same NFS server time of day clock tick.  Unlike 8.x and later, the
timeout is only adjustable via a system-wide sysctl
(vfs.nfs.negative_name_timeout) rather than a mount option.  Setting
the timeout to 0 disables negative name caching.

I also fixed one obvious typo where args.timeo should be
args.maxgrouplist.
2010-05-04 21:21:05 +00:00
Brooks Davis 49fe672a98 MFC r205073
Regen:
* Hart:         rev 671 of pcidevs.txt; 22-01-2008 (D-M-Y).
* Boemler:      vendors.txt (2010-03126)

PR:             kern/133733
2010-05-04 15:52:17 +00:00
Warner Losh 4634deb157 MFC r207461:
sparc64, and possibly other architectures, pads the length of the
  section holding the config file to sh_addralign bytes using NULs.
  This bogusly triggers an assert.  Break out of the loop when we hit a
  NUL within that many bytes of the end.
2010-05-04 04:04:37 +00:00
Warner Losh c6942b5d58 MFC r188214 (by wkoszek):
Make config -x <kernel> only return non-zero characters,
   so that:
        config -x <kernel> | grep <something>
   just works.

   Reported by:    Danny Braniss <[email protected]>
2010-05-04 04:02:43 +00:00
Xin LI 50c0772971 MFC r202668 and r200806 [1]:
Add a new option, -P, which reverts newsyslog(8) to the old behavior,
which stops to proceed further, as it is possible that processes which
fails to create PID file get screwed by rotation.

----
Don't consider non-existence of a PID file an error, we should be able
to proceed anyway as this most likely mean that the process has been
terminated.

PR:             bin/140397
Submitted by:   Dan Lukes <dan obluda cz>
2010-05-03 22:09:06 +00:00
Xin LI 6d53df9030 MFC r196432 (partial, kensmith@) and 207383:
Add definition for FreeBSD 8.1 and 9.0.
2010-05-03 17:34:12 +00:00
Konstantin Belousov 6d6bdbdd96 MFC r203822:
Remove unused macros.
2010-05-03 12:06:40 +00:00
Pyun YongHyeon 9273a8701c MFC r207251:
It seems ale(4) controllers do not like to see TCP payload in the
  first descriptor in TSO case. Otherwise controller can generate bad
  frames during TSO. To address it, make sure to pull up ethernet +
  IP + TCP header with options in first buffer. Also ensure the
  buffer length of the first descriptor for TSO covers entire ethernet
  + IP + TCP with options and setup additional Tx descriptor if the
  first buffer includes TCP payload.

  Tested by:	Amar Takhar <verm <> darkbeer dot org >
2010-05-03 01:13:37 +00:00
Jilles Tjoelker 5322613a28 MFC r205398: Do not create *.gmon files for PIE executables on i386.
Scrt1_c.o was accidentally compiled with -DGCRT (profiling), like gcrt1_c.o.
This problem is i386-specific, the other architectures are OK.

If you have problems with PIE executables such as samba and cups leaving
behind gmon files, rebuild them after installing this change.

PR:		ports/143924
2010-05-02 20:12:20 +00:00
Marius Strobl f89f56f063 MFC: r207151
Add a TestFloat based test suite for floating-point implementations
currently supporting sparc64. After a `make depend all` there are
three programs; testsoftfloat for testing against the SoftFloat in
src/lib/libc/softfloat for reference purposes, testemufloat for
testing the emulator source in src/lib/libc/sparc64/fpu and testfloat
for testing with the installed libc. Support for other architectures
can be added as needed.

PR:		144900
Submitted by:	Peter Jeremy
2010-05-02 16:55:13 +00:00
Marius Strobl bf1a25bb18 MFC: r206490, r206492
While SPARC V9 allows tininess to be detected either before or after
rounding (impl. dep. #55), the SPARC JPS1 responsible for SPARC64 and
UltraSPARC processors defines that in all cases tininess is detected
before rounding therefore rounding up to the smallest normalized number
should set the underflow flag. This change is needed for using SoftFloat
on sparc64 for reference purposes.

PR:		144900
Submitted by:	Peter Jeremy
2010-05-02 16:52:24 +00:00
Marius Strobl 0a6030d52c MFC: r206480
Update for UltraSPARC-IV{,+} and SPARC64 V, VI, VII and VIIIfx CPUs.
2010-05-02 16:47:54 +00:00
Marius Strobl d0d9f03625 MFC: r206450
Correct the DCR_IPE macro to refer to the right bit. Also improve the
associated comment as besides US-IV+ these bits are only available with
US-III++, i.e. the 1.2GHz version of the US-III+.
2010-05-02 16:46:22 +00:00
Marius Strobl 8e905b8d0b MFC: r206449
Unlike the sun4v variant, the sun4u version of SUNW,set-trap-table
actually only takes one argument.
2010-05-02 16:45:09 +00:00
Marius Strobl 637ebf4a60 MFC: r206448
Do as the comment suggests and determine the bus space based on the last
bus we actually mapped at rather than always based on the last bus we
encountered while moving upward in the tree. Otherwise we might use the
wrong bus space in case the bridge directly underneath the nexus doesn't
require mapping, i.e. was skipped as it's the case for ssm(4) nodes.
2010-05-02 16:38:57 +00:00
Jilles Tjoelker 526e392ad5 MFC r207187: kvm(3): Mention that some of the functions use sysctl(3)
instead of kmem.

Additionally, because of sysctl(3) use (which is generally good), behaviour
for crash dumps differs slightly from behaviour for live kernels and this
will probably never be fixed entirely, so weaken that claim.
2010-05-02 13:53:08 +00:00
Jilles Tjoelker 76653bc8c3 MFC r207188: symlink(7): The ownership of symlinks is used by the system,
in at least three ways, so do not say it is ignored:
* who may delete/rename a symlink in a sticky directory
* who may do lchflags(2)/lchown(2)/lchmod(2)
* whose inode quota is charged
2010-05-02 13:38:08 +00:00
Jilles Tjoelker d25fead31f MFC r207168: builtin(1): Add missing escaping for !, . and : in the table.
This caused these commands to look differently (not bold) from the other
commands in the table (bold).
2010-05-01 15:00:00 +00:00
Jilles Tjoelker 61c5e6df82 MFC r207166: builtin(1): Mention [ sh builtin. 2010-05-01 14:57:35 +00:00
Matt Jacob 1e0ea34839 This is an MFC of 205932.
nit: xpt_bus_deregister has to be called with the sim lock held.
2010-04-29 19:13:42 +00:00
Matt Jacob 0d2513fd29 This is an MFC of 205847
Change how multipath labels are created and managed. This makes it easier
to support various storage boxes which really aren't active-active.

We only write the label on the *first* provider. For all other providers
we just "add" the disk. This also allows for an "add" verb.

A usage implication is that you should specificy the currently active
storage path as the first provider.

Note that this does not add RDAC-like functionality, but better allows for
autovolumefailover configurations (additional checkins elsewhere will support
this).
2010-04-29 19:07:58 +00:00
Xin LI ac80d74c7d MFC r205938:
Sync with OpenBSD:
 - avoid coredump when there's only one token on a line;
 - Use calloc();
 - Remove a line inherited from example mdoc.

Obtained from:	OpenBSD
2010-04-29 00:38:15 +00:00
Ed Maste 4ae82e0347 MFC r175406:
Eliminate warnings by adding headers.
2010-04-28 13:26:30 +00:00
Andrew Gallatin 4f679efba2 MFC 206662: Cleanup if_media handling in mxge(4) 2010-04-27 15:40:24 +00:00
Nick Hibma ad4f3b4265 Typo in comment. 2010-04-27 12:50:42 +00:00
Pyun YongHyeon cf5a46a5ca MFC r207071:
Intialize interrupt moderation control register. The magic value
  was chosen by lots of trial and errors. The chosen value shows
  good interrupt moderation without additional latency.
  Without this change, controller can generate more than 140k
  interrupts per second under high network load.

  Submitted by:	xclin <xclin <> cs dot nctu dot edu dot tw >
2010-04-26 18:09:12 +00:00
Pyun YongHyeon 1f4a36fb6c MFC r206876:
With r206844, CSUM_TCP is also set for CSUM_TSO case. Modify
  drivers to take into account for the change. Basically CSUM_TSO
  should be checked before checking CSUM_TCP.
2010-04-26 18:04:33 +00:00
Pyun YongHyeon 1381f93171 MFC r206672:
Fix include path.
2010-04-26 17:57:08 +00:00
Pyun YongHyeon 152109df40 MFC r206631:
Add sge(4) man page and hook up sge(4) to the build.
  Also add Xr to appropriate man pages.
2010-04-26 17:43:46 +00:00
Pyun YongHyeon 724206e965 MFC r206628:
Add sge(4) to the list of supported network interface.
2010-04-26 17:28:12 +00:00
Pyun YongHyeon 3621f25f39 MFC r206625:
Add driver for Silicon Integrated Systems SiS190/191 Fast/Gigabit Ethernet.
  This driver was written by Alexander Pohoyda and greatly enhanced
  by Nikolay Denev. I don't have these hardwares but this driver was
  tested by Nikolay Denev and xclin.

  Because SiS didn't release data sheet for this controller, programming
  information came from Linux driver and OpenSolaris. Unlike other open
  source driver for SiS190/191, sge(4) takes full advantage of TX/RX
  checksum offloading and does not require additional copy operation in
  RX handler.
  The controller seems to have advanced offloading features like VLAN
  hardware tag insertion/stripping, TCP segmentation offload(TSO) as
  well as jumbo frame support but these features are not available
  yet. Special thanks to xclin <xclin<> cs dot nctu dot edu dot tw>
  who sent fix for receiving VLAN oversized frames.
2010-04-26 17:22:02 +00:00
Nick Hibma 868f653f83 Remove the call to usbd_reset_device() as this panics the kernel on
devices with many serial ports (the device is reset for each port that
reports IOERROR).
Remove statements that should have been removed when rewriting the if
statement.
2010-04-25 19:22:06 +00:00
Warner Losh 62a7b516f6 Merge the ARM module building stuff from current (not done as a merge on
the makefile becuase there's too many conflicts).
2010-04-25 19:18:26 +00:00
Fabien Thomas e258dd0d9b MFC r206994:
Apply threshold filter to root node in calltree view.
2010-04-25 16:17:52 +00:00
Matt Jacob cb733994f6 This is an MFC of 205252.
We actually can generate a host number.
2010-04-24 23:13:05 +00:00
Matt Jacob d0aa30d02a This is an MFC of 205236
Put gone device timer into a structure tag that can hold more than 32 seconds. Oops.

Untangle some of the confusion about what role means when it's in the FCPARAM/SDPARAM
or isp_fc/isp_spi structures. This fixed a problem about seeing targets appear if you've
turned off autologin and find them, or rather don't, via camcontrol rescan.
2010-04-24 23:07:34 +00:00
Matt Jacob 149464bc45 This is an MFC of 205847, 204071, 196580 and 196579
------------------------------------------------------------------------
Change how multipath labels are created and managed. This makes it easier
to support various storage boxes which really aren't active-active.

We only write the label on the *first* provider. For all other providers
we just "add" the disk. This also allows for an "add" verb.

A usage implication is that you should specificy the currently active
storage path as the first provider.

Note that this does not add RDAC-like functionality, but better allows for
autovolumefailover configurations (additional checkins elsewhere will support
this).
------------------------------------------------------------------------

- Style fixes.
- Prefer strlcpy() over strncpy().

------------------------------------------------------------------------

There's no need for checking result of M_WAITOK allocation.

------------------------------------------------------------------------

Fix an obvious topology lock leak.
2010-04-23 19:35:07 +00:00
Matt Jacob a143933a1e This is an MFC of 205412.
Add 'rotate' and 'getactive' verbs to provide some control and information
about what the currently active path is.
2010-04-23 16:28:06 +00:00
Matt Jacob adab122503 This is an MFC of 205412.
Add 'rotate' and 'getactive' verbs to provide some control and information
about what the currently active path is.
2010-04-23 16:21:40 +00:00
Andriy Gapon 2e38150727 MFC r206996: indent.pro example: actually install the sample file 2010-04-23 15:51:13 +00:00
Andriy Gapon 6f061eda45 MFC r206687: indent(1): don't treat bare '_t' as a type name with -ta 2010-04-23 14:35:03 +00:00
Jaakko Heinonen 50ccb1e581 MFC r205385:
Escape characters unsafe for XML output in GEOM class, instance and
provider names.

- Characters in range 0x01-0x1f except '\t', '\n', and '\r' are replaced
  with '?'. Those characters are disallowed in XML.
- '&', '<', '>', '\'', '"' and characters in range 0x7f-0xff are
  replaced with XML numeric character reference.

If the kern.geom.confxml sysctl provides invalid XML, libgeom
geom_xml2tree() fails and utilities using it do not work. Unsafe
characters are common in msdosfs and cd9660 labels.

PR:		kern/104389
2010-04-22 14:54:54 +00:00
Andriy Gapon e06d699775 MFC r206650: g_io_check: respond to zero pp->mediasize with ENXIO 2010-04-22 12:50:01 +00:00
Andriy Gapon 1f30ceb25a MFC r206648,206651: scsi_cd: CD_FLAG_VALID_MEDIA is sufficient to set
d_sectorsize and d_mediasize

Note that there is a redundant assignment of d_maxsize.

PR:		kern/138789
2010-04-22 12:12:52 +00:00
Pyun YongHyeon bbad9ba8b7 MFC r206563:
Add Agere ET1011 PHY which is found on Belkin F5D5055 USB
  controller. Unlike Agere ET1011C, Agere ET1011 does not seem to
  need special DSP programming to workaround silicon bug.
2010-04-22 01:45:18 +00:00
Gavin Atkinson 10d4d6ea78 Merge r203027 from head:
Correct the HISTORY section of these man pages to show when the function,
  not the "manual page example" was introduced.
2010-04-21 17:00:15 +00:00
Konstantin Belousov b61f8c6c33 MFC r206549:
Align the declaration for sa_sigaction with POSIX.

MFC r206649:
Still reference struct __sigaction with clarification when this form
of argument declaration is needed.

MFC r206802:
Revert r206649. Simplify the presented declaration of struct sigaction.
2010-04-21 11:11:11 +00:00
Rebecca Cran 4517992cd9 MFC r205118:
Free the memory allocated via strdup.

PR:	bin/113881
Submitted by:	Alexander Drozdov <dzal_mail at mtu-net.ru>
Approved by:	rrs (mentor)
2010-04-20 20:26:26 +00:00
Rebecca Cran c0e4c6d8d5 MFC r205119 and r206056:
Prevent the SIZE field being corrupted when a process allocates more than
2TB.

PR:	bin/129706
Submitted by:	brucec
Approved by:	rrs (mentor)
2010-04-20 20:21:01 +00:00
Giorgos Keramidas 15791b9862 MFC 173194
Remove an extra (commented out) .Sh HISTORY section heading, to avoid
the risk of "shadowing" the following .El request, and delete an empty
line to fix mdoc warnings.
2010-04-19 21:02:54 +00:00
Edwin Groothuis 3eca53cb4d MFC of tzdata2010i, r206868
- Marocco does have DST this year between May and August.
- Historical data for Taiwan
- Argentina / San Luis does not do DST this year.
2010-04-19 21:01:29 +00:00
Giorgos Keramidas 169c90570f MFC 173190
Remove an extra (commented out) .Sh HISTORY section heading, to avoid
the risk of "shadowing" the following .El request, strip eol spaces
and delete an empty line to fix mdoc warnings.
2010-04-19 20:56:04 +00:00
Giorgos Keramidas 0aa5efc80e MFC 173189
Change a .PP request to a valid .Pp mdoc request, and remove an extra
(but commented out) .Sh HISTORY section heading.
2010-04-19 20:53:37 +00:00
Giorgos Keramidas d83fe60a67 MFC 173188
Remove duplicate (but commented out) .Sh HISTORY section heading.
It almost "shadows" the ending .El request of a list, which seems
to have caused mdoc buglets in some gss_*.3 manpages.
2010-04-19 20:51:54 +00:00
Giorgos Keramidas 5e6ab498b3 MFC 173187
Remove duplicate (but commented out) .Sh HISTORY section heading
and add a missing .El request.
2010-04-19 20:48:27 +00:00
Peter Holm 16b7da9694 Fix incorrect assertion. If the caller passed in no lock flags
(i.e. just checking the vnode for validity) then there is a window
between the VI_UNLOCK() in _vn_lock(9) and the subsequent VI_LOCK()
in vget() where another thread could have set VI_DOOMED.

Submitted by:	Matthew Fleming <matthew fleming isilon com>
Reviewed by:	kib
2010-04-18 12:50:26 +00:00
Konstantin Belousov f4e8785eb4 MFC r206671:
Fix typo.
2010-04-18 04:49:07 +00:00
Andriy Gapon d237bc399a MFC r206130: g_vfs_open: allow only one mount per device vnode 2010-04-17 12:01:50 +00:00
Andriy Gapon 66e6d0b849 MFC r206129: vn_stat: use va_blocksize when setting st_blksize 2010-04-17 11:38:18 +00:00
Andriy Gapon d958d0110e MFC r205860,206097: correctly set b_offset for getblk(devvp) 2010-04-17 11:12:20 +00:00
Fabien Thomas fff0b058c7 MFC r206089, r206684:
- Support for uncore counting events: one fixed PMC with the uncore
   domain clock, 8 programmable PMC.
- Westmere based CPU (Xeon 5600, Corei7 980X) support.
- New man pages with events list for core and uncore.
- Updated Corei7 events with Intel 253669-033US December 2009 doc.
  There is some removed events in the documentation, they have been
  kept in the code but documented in the man page as obsolete.
- Offcore response events can be setup with rsp token.

Sponsored by: NETASQ
2010-04-16 16:15:30 +00:00
Fabien Thomas 7ec406ff20 MFC r206089, r206684:
- Support for uncore counting events: one fixed PMC with the uncore
   domain clock, 8 programmable PMC.
- Westmere based CPU (Xeon 5600, Corei7 980X) support.
- New man pages with events list for core and uncore.
- Updated Corei7 events with Intel 253669-033US December 2009 doc.
  There is some removed events in the documentation, they have been
  kept in the code but documented in the man page as obsolete.
- Offcore response events can be setup with rsp token.

Sponsored by: NETASQ
2010-04-16 16:13:49 +00:00
Pyun YongHyeon 611bed2cef MFC r206268
- Fixed 5708S 2.5G support broken in last commit.
  - Added some new debug helper routines to systcl.
  - Fixed many of the style(9) violations that have crept into the code
    due to my use of a "smart" editor.
2010-04-15 19:31:21 +00:00
Pyun YongHyeon 32341a07cd MFC r205300:
- Added support for 5709S/5716S PHYs.
  - Update copyright to 2010.
  - Add new debug code for RV2P block.
  - Improve output formatting for various debug functions.

  PR:	kern/134658, kern/136417, kern/139761, kern/140970
2010-04-15 19:28:15 +00:00
Pyun YongHyeon 4d889f7dcc MFC r205299:
- Added support for 5709S/5716S PHYs.

  Submitted by: pyunyh
  PR:	kern/134658, kern/136417, kern/139761, kern/140970
2010-04-15 19:22:55 +00:00
Alexander Motin 6b7d1e56f9 MFC r205680:
Use last 16 bytes of serial number in metadata instead of first ones,
same as Intel MatrixRAID does.

PR:             kern/124064
2010-04-15 12:22:47 +00:00
John Baldwin dd42bde507 MFC 205900:
Use panic() (which the environment is required to provide to libstand) to
implement assert() instead of relying on a non-required exit().  The exit()
invocation also did not match the semantics of the exit() routine that
current boot environments happen to require.
2010-04-14 17:17:25 +00:00
Alan Cox 793e66cbb1 MFC r206409
Introduce the function kmem_alloc_attr(), which allocates kernel virtual
  memory with the specified physical attributes.

  Correct an error in the prototype for kmem_malloc().
2010-04-14 16:54:49 +00:00
John Baldwin ac05ca4ff1 MFC 205886:
Defer freeing a kevent list until after dropping kqueue locks.
2010-04-14 15:33:30 +00:00
John Baldwin af4b8626fc MFC 205536:
Reject attempts to create a MAP_ANON mapping with a non-zero offset.
2010-04-14 15:23:16 +00:00
John Baldwin b0e51be80c MFC 184226:
Add a statement about the non-portability of non-page-aligned offsets.
2010-04-14 15:20:30 +00:00
John Baldwin 5e1a6adeb8 MFC 185933,205851:
- Add constants for fields in the local APIC error status register.
- Add a handler for the local APIC error interrupt.  For now it just prints
  out the current value of the local APIC error register when the interrupt
  fires.
2010-04-14 15:01:49 +00:00
Pyun YongHyeon 552d46bc55 MFC r206436:
Consistently use capital letters.
2010-04-14 01:24:09 +00:00
Pyun YongHyeon 522b258b8b MFC r206433:
Add preliminary support for 8168E/8111E PCIe controller.
  While I'm here simplify device description string.

  Tested by:	Michael Beckmann < michael <> apfel dot de >
2010-04-14 01:14:40 +00:00
Pyun YongHyeon 12ca7c97c0 MFC r206364:
Partial revert r204545.
  Just relying on status LE ownership of status block seems to cause
  poor performance. Always read current status index register first
  and then check status ownership as we had before. Accessing status
  index register seems to trigger immediate status update if
  controller have pending status updates.

  Reported by:	Andre Albsmeier <Andre.Albsmeier <> siemens dot com>
  Tested by:	Andre Albsmeier <Andre.Albsmeier <> siemens dot com>
2010-04-14 01:09:14 +00:00
Doug Barton 4f2186720a MFC r205995:
Massive cleanup and synchronization with other *BSDs
2010-04-13 20:47:11 +00:00
Nick Hibma 9b9512a6ce Make the list of allocated ports dynamic. The Option GTM382 has 10
serial ports (yes, 10, it has a built in GPS and other stuff) and we
need to access the last one for PPP access to the card. Other ports
are HSO (Option specific protocol; see Linux driver).

Reviewed by:	thompsa
2010-04-13 19:43:16 +00:00
Ed Maste 32a058b162 MFC r201758:
Remove extraneous semicolons, no functional changes.
2010-04-13 00:20:40 +00:00
Fabien Thomas 2c0ed92d93 MFC r206090:
Improve "top" header by:
- Display sample received per PMCs (or merged PMCs).
- Display percentage vs all samples
2010-04-12 21:42:01 +00:00
Andriy Gapon ed5acd2a7a MFC r206102,206103,206175,206176: add example indent.pro file 2010-04-12 21:29:04 +00:00
Andriy Gapon 8b0482d98f MFC r206178: ibc/db/hash: cap auto-tuned block size 2010-04-12 21:13:03 +00:00
Andriy Gapon 6075b76ed7 MFC r206128: ffs_mount: remove redundant assignment to devvp.v_bufobj 2010-04-12 21:09:13 +00:00
Andriy Gapon 01f520a03f MFC r205989: indent(1): new option, -ta, to treat all *_t identifiers as
types
2010-04-12 21:05:36 +00:00
Andriy Gapon 5e9404cee3 MFC r206098: mountmsdosfs: reject too high value of bytes per cluster 2010-04-12 20:54:56 +00:00
Alan Cox afc68c59e1 MFC r204907, r204913, r205402, r205573, r205778
Implement AMD's recommended workaround for Erratum 383 on Family 10h
  processors.

  Enable machine check exceptions by default.
2010-04-10 22:24:03 +00:00
Ed Maste 0578626784 MFC r206383:
Remove extraneous '>'.
2010-04-09 22:51:19 +00:00
Ed Maste 14be458a54 MFC r192862: 2010-04-09 22:48:27 +00:00
Nick Hibma 6ad40f70e6 Add the ID for the Matrix Orbital LCD display MOU-Axxx series.
Simplify a switch statement in the uftdi driver to an if-then-else-endif
as it encoded those two cases only.

Reviewed by:	imp
2010-04-09 08:20:43 +00:00
Alan Cox bed8aa587a MFC r206174
vm_reserv_alloc_page() should never be called on an OBJT_SG object, just
  as it is never called on an OBJT_DEVICE object.  (This change should have
  been included in r195840.)
2010-04-09 06:47:36 +00:00
Matt Jacob f76d901b0b This is an MFC of 206029
Add a couple missing basic mode page codes.
2010-04-08 18:38:50 +00:00
Andriy Gapon 9f531cdb73 MFC r206177: hash.3: fix a factual mistake in the man page 2010-04-08 07:45:42 +00:00
Xin LI f55834899d MFC r204901
Remove the check for IFF_DRV_OACTIVE right before adding a port into lagg
interface.  The check itself seems to be coming from OpenBSD but does not
seem to be useful for our code.

Discussed with:	thomasa
2010-04-08 00:55:08 +00:00
Andriy Gapon fe3e44d7a5 MFC r205988: indent(1): correctly handle case/label at the very start of
a function
2010-04-07 22:28:16 +00:00
Jaakko Heinonen 70a783d38a MFC r198940:
File flags handling fixes for ext2fs:

- Disallow setting of flags not supported by ext2fs.
- Map EXT2_APPEND_FL to SF_APPEND.
- Map EXT2_IMMUTABLE_FL to SF_IMMUTABLE.
- Map EXT2_NODUMP_FL to UF_NODUMP.

Note that ext2fs doesn't support user settable append and immutable flags.
EXT2_NODUMP_FL is an user settable flag also on Linux.

PR:		kern/122047
2010-04-07 15:33:19 +00:00
Nick Hibma 03f4f9cc84 Add the ID of the Option GTM382 Mini PCI express module
Approved by:	re (implicit)
2010-04-06 13:12:11 +00:00
Edward Tomasz Napierala bb2b307780 MFC r201432:
Add manual page for gcache(8).
2010-04-06 10:09:03 +00:00
Navdeep Parhar ad44e4cef8 MFC r204921,r205944,r205945,r205946
r204921: Better TwinAx transceiver detection.
r205944: Refresh the firmware version immediately after it is upgraded (or downgraded).
r205945: Improved PHY EDC settings.
r205946: Do not attempt to retrieve interrupt information before it is available.
2010-04-06 03:07:39 +00:00
Navdeep Parhar b5362ca545 MFC r189643,r194928,r204267
r189643:
commands to fetch uP logic analyzer and IOQs information.

r194928:
"stdio" mode.

r204267:
Allow cxgbtool to build with WARNS=6
2010-04-06 01:17:47 +00:00
Xin LI 7b56f37c16 MFC r205534:
Add PCI ID for MCS9901's parallel port.

PR:		kern/144713
Submitted by:	gcooper
2010-04-06 00:52:45 +00:00
Xin LI 768e902f6b MFC r205520:
Correct cross reference.
2010-04-06 00:47:33 +00:00
Edwin Groothuis 1be2098dec MFC of tzdata2010h:
From tzdata2010h:

- Tunis will not go into DST this year.
- Pakistan will not go into DST this year.

From tzdata2010g:

- Bangladesh cancels DST.
- Palestine goes into DST one day later than expected.

- Russian timezones update:
  Europe/Samara goes to Moscow time.
  Asia/Kamchatka goes to Moscow+8 time.
  Asia/Anadyr goes to Moscow+8 time.
2010-04-05 23:44:39 +00:00
Matt Jacob 548354266d This is an MFC of 205712.
D'oh- isp_handle_index' logic was reversed (not used in FreeBSD).
2010-04-05 18:38:18 +00:00
Matt Jacob ac7bf7be4d This is an mfs of 205698.
Clean up some printing stuff so that we can have a bit finer control
on debug output. Add a new platform function requirement to allow
for printing based upon the ITL nexus instead of the isp unit plus
channel, target and lun. This allows some printouts and error messages
from the core code to appear in the same format as the platform's
subsystem (in FreeBSD's case, CAM path).
2010-04-05 18:29:45 +00:00
Marius Strobl 8d6acfc69d MFC: r206086
- Try do deal gracefully with correctable ECC errors.
- Improve the reporting of unhandled kernel and user traps.
2010-04-05 18:22:48 +00:00
Marius Strobl 6d07d8a8ba MFC: r206020
Use device_get_nameunit(9) rather than device_get_name(9) so one can
identify the reporting bridge in machines with multiple PCI domains.
2010-04-05 18:04:08 +00:00
Marius Strobl d6bd2c5d79 MFC: r206019
Don't re-implement device_get_nameunit(9).
2010-04-05 17:58:47 +00:00
Marius Strobl f1504dff75 MFC: r206018
- Take advantage of the INTCLR_* macros.
- Right-justify the backslashes as per style(9).
2010-04-05 17:57:46 +00:00
Jung-uk Kim bf6a107c79 MFC: r205858
Check the pointer to JIT binary filter before its de-allocation.
2010-04-05 17:33:33 +00:00
Marius Strobl b68661f02a MFC: r205269
o Add support for UltraSparc-IV+:
  - Swap the configuration of the first and second large dTLB as with
    US-IV+ these can only hold entries of certain page sizes each, which
    we happened to chose the non-working way around.
  - Additionally ensure that the large iTLB is set up to hold 8k pages
    (currently this happens to be a NOP though).
  - Add a workaround for US-IV+ erratum #2.
  - Turn off dTLB parity error reporting as otherwise we get seemingly
    false positives when copying in the user window by simulating a
    fill trap on return to usermode. Given that these parity errors can
    be avoided by disabling multi issue mode and the problem could be
    reproduced with a second machine this appears to be a silicon bug of
    some sort.
  - Add a membar #Sync also before the stores to ASI_DCACHE_TAG. While
    at it, turn of interrupts across the whole cheetah_cache_flush() for
    simplicity instead of around every flush. This should have next to no
    impact as for cheetah-class machines we typically only need to flush
    the caches a few times during boot when recovering from peeking/poking
    non-existent PCI devices, if at all.
  - Just use KERNBASE for FLUSH as we also do elsewhere as the US-IV+
    documentation doesn't seem to mention that these CPUs also ignore the
    address like previous cheetah-class CPUs do. Again the code changing
    LSU_IC is executed seldom enough that the negligible optimization of
    using %g0 instead should have no real impact.

  With these changes FreeBSD runs stable on V890 equipped with US-IV+
  and -j128 buildworlds in a loop for days are no problem. Unfortunately,
  the performance isn't were it should be as a buildworld on a 4x1.5GHz
  US-IV+ V890 takes nearly 3h while on a V440 with (theoretically) less
  powerfull 4x1.5GHz US-IIIi it takes just over 1h. It's unclear whether
  this is related to the supposed silicon bug mentioned above or due to
  another issue. The documentation (which contains a sever bug in the
  description of the bits added to the context registers though) at least
  doesn't mention any requirements for changes in the CPU handling besides
  those implemented and the cache as well as the TLB configurations and
  handling look fine.
o Re-arrange cheetah_init() so it's easier to add support for SPARC64
  V up to VIIIfx CPUs, which only require parts of this initialization.

Committed from:	EH2010
2010-04-04 14:57:45 +00:00
Alan Cox 7fde0e1cd6 MFC r205652
A ptrace(2) by one process may trigger a page size promotion in the
  address space of another process.  Modify pmap_promote_pde() to handle
  this.
2010-04-03 15:52:32 +00:00
Hiroki Sato 905323b684 - Typo (s/-p flag/-d flag/) in a ps(1) entry. [*]
- Use &man.*; wherever possible.

Spotted by:	pluknet gmail.com [*]
PR:		docs/145059 [*]
2010-04-03 10:07:10 +00:00
Fabien Thomas 0992d9c79e MFC r205998:
If there is multiple PMCs for the same interrupt ignore new post.
This will indirectly fix a bug where the thread will be pinned
forever if the assert is not compiled.
2010-04-03 07:19:31 +00:00
Andriy Gapon 2bf7f0c378 MFC r205854: calendar.freebsd: add my entry 2010-04-02 15:36:56 +00:00
Jaakko Heinonen 84ee02c5a4 MFC r197833:
When run() returns an error, print the error message also in
non-interactive mode. Previously error messages were printed only in
interactive mode.

PR:		bin/124517
2010-04-02 08:57:39 +00:00
Marius Strobl d986b9eba5 MFC: r205409
- The firmware of Sun Fire V1280 has a misfeature of setting %wstate to
  7 which corresponds to WSTATE_KMIX in OpenSolaris whenever calling into
  it which totally screws us even when restoring %wstate afterwards as
  spill/fill traps can happen while in OFW. The rather hackish OpenBSD
  approach of just setting the equivalent of WSTATE_KERNEL to 7 also is
  no option as we treat %wstate as a bit field. So in order to deal with
  this problem actually implement spill/fill handlers for %wstate 7 which
  just act as the WSTATE_KERNEL ones except of theoretically also handling
  32-bit, turn off interrupts completely so we don't even take IPIs while
  in OFW which should ensure we only take spill/fill traps at most and
  restore %wstate after calling into OFW once we have taken over the trap
  table. While at it, actually set WSTATE_{,PROM}_KMIX before calling into
  OFW just like OpenSolaris does, which should at least help testing this
  change on non-V1280.
- Remove comments referring to the %wstate usage in BSD/OS.
- Remove the no longer used RSF_ALIGN_RETRY macro.
- Correct some trap table addresses in comments.
- Ensure %wstate is set to WSTATE_KERNEL when taking over the trap table.
- Ensure PSTATE_AM is off when entering or exiting to OFW as well as that
  interrupts are also completely off when exiting to OFW as the firmware
  trap table shouldn't be used to handle our interrupts.
2010-04-01 15:17:52 +00:00
Xin LI d6c22fc9c3 MFC r205656:
Check that gl_pathc is bigger than zero before derefencing gl_pathv.
When gl_pathc == 0, the content of gl_pathv is undefined.

PR:		bin/144761
Submitted by:	David BERARD <contact davidberard fr>
Obtained from:	OpenBSD
2010-04-01 00:38:38 +00:00
Marius Strobl d440faef02 MFC: r205399
Improve the KVA space sizing of r186682 (r190080); on machines with large
dTLBs we can actually use all of the available lockable entries of the tiny
dTLB for the kernel TSB. With this change the KVA space sizing happens to
be more in line with the MI one so up to at least 24GB machines KVA doesn't
need to be limited manually. This is just another stopgap though, the
real solution is to take advantage of ASI_ATOMIC_QUAD_LDD_PHYS on CPUs
providing it so we don't need to lock the kernel TSB pages into the dTLB
in the first place.
2010-03-31 22:05:53 +00:00
Marius Strobl f4c9392e62 MFC: r205263
Add macros for the VER.impl of SPARC64 II to VIIIfx.
2010-03-31 22:00:22 +00:00
Marius Strobl 721216dfe9 MFC: r205258
- Add TTE and context register bits for the additional page sizes supported
  by UltraSparc-IV and -IV+ as well as SPARC64 V, VI, VII and VIIIfx CPUs.
- Replace TLB_PCXR_PGSZ_MASK and TLB_SCXR_PGSZ_MASK with TLB_CXR_PGSZ_MASK
  which just is the complement of TLB_CXR_CTX_MASK instead of trying to
  assemble it from the page size bits which vary across CPUs.
- Add macros for the remainder of the SFSR bits, which are useful for at
  least debugging purposes.
2010-03-31 21:57:49 +00:00
Marius Strobl 3a1b84d6bd MFC: r204153
Starting with UltraSPARC IV CPUs the CPU caches are described with different
OFW properties.
2010-03-31 21:41:03 +00:00
Marius Strobl abcc9afed0 MFC: r204152, r204164
Some machines can not only consist of CPUs running at different speeds
but also of different types, f.e. Sun Fire V890 can be equipped with a
mix of UltraSPARC IV and IV+ CPUs, requiring different MMU initialization
and different workarounds for model specific errata. Therefore move the
CPU implementation number from a global variable to the per-CPU data.
Functions which are called before the latter is available are passed the
implementation number as a parameter now.
2010-03-31 21:32:52 +00:00
Alexander Motin 040aaafb96 MFC r205074:
Mask disk_idx to avoid panic because of extra bits set.

PR:             kern/102211
Submitted by:   yoichi
2010-03-31 07:52:48 +00:00
Fabien Thomas df480375a1 MFC r205809:
Wait for pmc name in the log before displaying data.
This will solve an abort in case of low throughput PMCs.
2010-03-31 07:12:12 +00:00
Xin LI 6f3ab15087 MFC r204533:
Add PCI ID for MCS9901.

Submitted by:	gcooper
PR:		kern/144397
2010-03-31 00:42:18 +00:00
Marius Strobl 7d25428e91 MFC: r203846
Predict KASSERTs to be true.
2010-03-30 20:46:09 +00:00
Marius Strobl c06e007d35 MFC: r203845
- Add the 'cmp' and 'core' pseudo-busses which are used to group CPU cores
  to the exclusion lists as the CPU nodes aren't handled as regular devices
  either. Also add the pseudo-devices found in Sun Fire V1280.
- Allow nexus_attach() and nexus_alloc_resource() to be used by drivers
  derived from nexus(4) for subordinate busses.
- Don't add the zero-sized memory resources of glue devices to the resource
  lists.
2010-03-30 20:44:05 +00:00
Marius Strobl e24c69faf7 MFC: r203843
Resurrect nexusvar.h from r167307.
2010-03-30 20:39:48 +00:00
Marius Strobl af0a939e2c MFC: r203839
Style fixes
2010-03-30 20:38:20 +00:00
Marius Strobl 04270cca08 MFC: r203838
- Search the whole OFW device tree instead of only the children of the
  root nexus device for the CPUs as starting with UltraSPARC IV the 'cpu'
  nodes hang off of from 'cmp' (chip multi-threading processor) or 'core'
  or combinations thereof. Also in large UltraSPARC III based machines
  the 'cpu' nodes hang off of 'ssm' (scalable shared memory) nodes which
  group snooping-coherency domains together instead of directly from the
  nexus.
  It would be great if we could use newbus to deal with the different ways
  the 'cpu' devices can hang off of pseudo ones but unfortunately both
  cpu_mp_setmaxid() and sparc64_init() have to work prior to regular device
  probing.
- Add support for UltraSPARC IV and IV+ CPUs. Due to the fact that these
  are multi-core each CPU has two Fireplane config registers and thus the
  module/target ID has to be determined differently so the one specific
  to a certain core is used. Similarly, starting with UltraSPARC IV the
  individual cores use a different property in the OFW device tree to
  indicate the CPU/core ID as it no longer is in coincidence with the
  shared slot/socket ID.
  This involves changing the MD KTR code to not directly read the UPA
  module ID either. We use the MID stored in the per-CPU data instead of
  calling cpu_get_mid() as a replacement in order prevent clobbering any
  registers as side-effect in the assembler version. This requires CATR()
  invocations from mp_startup() prior to mapping the per-CPU pages to be
  removed though.
  While at it additionally distinguish between CPUs with Fireplane and
  JBus interconnects as these also use slightly different sizes for the
  JBus/agent/module/target IDs.
- Make sparc64_shutdown_final() static as it's not used outside of
  machdep.c.
2010-03-30 20:29:45 +00:00
Marius Strobl aed6aeec26 MFC: r203833
- At least the trap table of the Sun Fire V1280 firmware apparently has
  no cleanwindows handler so just remove trying to trigger it from _start
  and the AP trampoline code as that leads to a crash there. This should
  be okay as leaking data from the OFW via the CPU registers on start of
  the kernel should be no real concern.
- Make the comments of _start and the AP trampoline code regarding the
  initializations they perform match each other and reality.
- Make the comments of the AP trampoline code regarding iTLB accesses
  refer to the right macro.
2010-03-30 20:12:46 +00:00
Marius Strobl 37d73cf2fe MFC: r203830, r203831
Use the SUNW,{d,i}tlb-load methods for entering locked TLB entries like
OpenBSD and OpenSolaris do instead of fiddling with the MMUs ourselves.
Unlike direct access the firmware methods don't automatically use the
next free (?) TLB slot, instead the slot to be used has to be specified.
We allocate the TLB slots for the kernel top-down as OpenSolaris suggests
that the firmware will always allocate the ones for its own use bottom-up.
Besides being simpler, according to OpenBSD using the firmware methods is
required to allow booting on Sun Fire E10K with multi-systemboard domains.
2010-03-30 20:05:22 +00:00
Marius Strobl d4ed522501 MFC: r203829
- Assert that HEAPSZ is a multiple of PAGE_SIZE as at least the firmware
  of Sun Fire V1280 doesn't round up the size itself but instead lets
  claiming of non page-sized amounts of memory fail.
- Change parameters and variables related to the TLB slots to unsigned
  which is more appropriate.
- Search the whole OFW device tree instead of only the children of the
  root nexus device for the BSP as starting with UltraSPARC IV the 'cpu'
  nodes hang off of from 'cmp' (chip multi-threading processor) or 'core'
  or combinations thereof. Also in large UltraSPARC III based machines
  the 'cpu' nodes hang off of 'ssm' (scalable shared memory) nodes which
  group snooping-coherency domains together instead of directly from the
  nexus.
- Add support for UltraSPARC IV and IV+ BSPs. Due to the fact that these
  are multi-core each CPU has two Fireplane config registers and thus the
  module/target ID has to be determined differently so the one specific
  to a certain core is used. Similarly, starting with UltraSPARC IV the
  individual cores use a different property in the OFW device tree to
  indicate the CPU/core ID as it no longer is in coincidence with the
  shared slot/socket ID.
  While at it additionally distinguish between CPUs with Fireplane and
  JBus interconnects as these also use slightly different sizes for the
  JBus/agent/module/target IDs.
- Check the return value of init_heap(). This requires moving it after
  cons_probe() so we can panic when appropriate. This should be fine as
  the PowerPC OFW loader uses that order for quite some time now.
2010-03-30 20:02:28 +00:00
Marius Strobl 5416fb7aa4 MFC: r203731
Some style(9) fixes
2010-03-30 19:52:45 +00:00
Hiroki Sato d7ef2f0c92 Document fdopendir(3) missing prototype issue.
Submitted by:	delphij
2010-03-30 19:41:43 +00:00
Marius Strobl a66a3f3438 MFC: r203341
- Remove the BUS_HANDLE_MIN checking in the __BUS_DEBUG_ACCESS macro;
  for UPA it should have fulfilled its purpose by now and Fireplane-
  and JBus-based machines are way to messy in organization to implement
  something equivalent.
- Fix a bunch of style(9) bugs.
2010-03-30 19:37:55 +00:00
Marius Strobl 4b5496c830 MFC: r203335
- Const'ify the bus_stream_asi and bus_type_asi arrays.
- Replace hard-coded functions names missed in bus_machdep.c with __func__.
- Break some long lines.
2010-03-30 19:36:03 +00:00
Marius Strobl 1d8a71ad12 MFC: r203334
Sync with the other archs and declare the memory location referenced by
the address argument of the bus_space_write_multi_*() familiy as const.
2010-03-30 19:33:09 +00:00
Hiroki Sato 59c95a9161 Document zfsloader issue on 7.3R. 2010-03-30 19:31:58 +00:00
Marius Strobl 66f11a53d2 MFC: r173859, r205410
Avoid aliasing which leads to incorrect results when compiling with the
default strict aliasing rules.

PR:		144900
Submitted by:	Peter Jeremy
2010-03-30 19:15:57 +00:00
Marius Strobl 7f37c9ad97 MFC: r205397
- While SPARC V9 allows tininess to be detected either before or after
  rounding (impl. dep. #55), the SPARC JPS1 responsible for SPARC64 and
  UltraSPARC processors defines that in all cases tinyness is detected
  before rounding, therefore rounding up to the smallest normalised
  number should set the underflow flag.
- If an infinite result is rounded down, the result should have an
  exponent 1 less than the value for infinity.

PR:		144900
Submitted by:	Peter Jeremy
2010-03-30 19:08:01 +00:00
Marius Strobl 8178aba859 MFC: r205396
Division should take both arguments' signs into account when the
the dividend is infinity or zero and the divisor is not the same.

PR:		144900
Submitted by:	Peter Jeremy
2010-03-30 19:06:33 +00:00
Marius Strobl c2472ebf0e MFC: r205395
FPU_DEBUG requires <stdio.h>.

PR:		144900
Submitted by:	Peter Jeremy
2010-03-30 19:05:11 +00:00
Marius Strobl 76ae032b13 MFC: r205394
Ensure that __fpu_ftox() both returns the high bits and res[1] contains
the low bits also in the default case.

PR:		144900
Obtained from:	OpenBSD
2010-03-30 19:03:27 +00:00
Marius Strobl 6de27b496e MFC: r205393
- Remove a bogus forward declaration.
- Fix whitespace.
2010-03-30 18:58:10 +00:00
Jaakko Heinonen a97df478a4 MFC r205121:
Use an unique directory name instead of hardcoded /tmp/.diskless.
A malicious user could create a file named /tmp/.diskless and cause
the script to misbehave.

PR:		conf/141258
2010-03-30 15:25:16 +00:00
Attilio Rao 92b4a7328c MFC r205167:
Make the code more readable and compiling on 64-bits arch different
than amd64.

Sponsored by:	Sandvine Incorporated
2010-03-30 12:08:00 +00:00
Attilio Rao c40108a1d4 MFC r205160:
Checkin a facility for specifying a passthrough FIB from userland.
arcconf tool by Adaptec already seems to use for identifying the
Serial Number of the devices.

Sponsored by:	Sandvine Incorporated
2010-03-30 12:01:35 +00:00
Doug Barton d721231926 Update to 9.4-ESV-R1, the latest patchfix release which deals with
the problems related to the handling of broken DNSSEC trust chains.

This fix is only relevant for those who have DNSSEC validation
enabled and configure trust anchors from third parties, either
manually, or through a system like DLV.
2010-03-29 23:00:45 +00:00
Doug Barton 53c92a65cd MFC r205290:
MAKE_JUST_WORLDS
2010-03-29 22:59:35 +00:00
Warner Losh e134c4a158 MFC: r192058
- Remove nonexistent header file from includes list
2010-03-29 15:29:06 +00:00
Fabien Thomas a4ad14a48f MFC r205693:
Do not overflow the term in the case of multi-line display.
2010-03-29 06:59:08 +00:00
Fabien Thomas 82528cde50 MFC r205694:
Handling SIGPIPE will cause deadlock/crash.
Return an error immediatly in case of hard shutdown.
2010-03-29 06:56:17 +00:00
Ed Maste fa707b3e0b MFC aac(4) driver changes
r204019:

  Include command type in COMMAND TIMEOUT messages to aid in debugging.

r203885:

  Diff reduction with Adaptec's vendor driver.

  Driver version 2.1.9 chosen as that Adaptec version roughly corresponds
  with the current feature set merged to the in-tree driver.

r203801:

  Garbage collect Falcon/PPC support that has not been used in released
  products, based on discussion with Adaptec.

r198617:

  Rename aac_srb32 to aac_srb, to match Adaptec's vendor driver.
2010-03-29 00:39:09 +00:00
Ed Maste 9ac57a842c MFC r205411:
Avoid holding the VLAN_LOCK() over the parent interface SIOCGIFMEDIA
  ioctl call, as it may sleep.

  Reviewed by:    rwatson
2010-03-29 00:13:16 +00:00
Ed Maste 2633b9e122 MFC r204264:
Minor diff reduction with Adaptec's driver: in aac_release_command() set
  cm_queue to AAC_ADAP_NORM_CMD_QUEUE by default.  In every place it was
  set, it was set to AAC_ADAP_NORM_CMD_QUEUE anyhow.
2010-03-29 00:09:56 +00:00
John Baldwin 21b201e9a3 MFC 205332:
Use the same policy for rejecting / not-reject ACPI tables with incorrect
checksums as the base acpi(4) driver.  This fixes a problem where the MADT
parser would reject the MADT table during early boot causing the MP Table
to be, but then the acpi(4) driver would attach and use non-SMP interrupt
routing.
2010-03-26 19:00:17 +00:00
John Baldwin 8bba1454f7 MFC 204972:
Make NKPT a kernel option on i386 so that it can be set to a non-default
value from kernel config files.
2010-03-26 18:54:46 +00:00
John Baldwin 30c596d101 MFC 205214:
- Extend the machine check record structure to include several fields useful
  for parsing model-specific and other fields in machine check events
  including the global machine check capabilities and status registers,
  CPU identification, and the FreeBSD CPU ID.
- Report these added fields in the console log of a machine check so that
  a record structure can be reconstituted from the console messages.
- Parse new architectural errors including memory controller errors.
2010-03-26 13:50:19 +00:00
John Baldwin 26647c1701 MFC 205210,205448:
Remove unneeded type specifiers from 64-bit constants.  The compiler
infers their natural type from the constants' values.
2010-03-26 13:01:53 +00:00
Maxim Sobolev 03a888a4c7 MFC: workaround no-carrier issue on IBM HS21.
PR:		118238
2010-03-26 00:05:42 +00:00
Xin LI a9da4345a8 MFC r205654:
The rmt client in GNU cpio could have a heap overflow when a malicious
remote tape service returns deliberately crafted packets containing
more data than requested.

Fix this by checking the returned amount of data and bail out when it
is more than what we requested.

PR:		gnu/145010
Submitted by:	naddy
Reviewed by:	imp
Security:	CVE-2010-0624
2010-03-25 20:07:30 +00:00
Jaakko Heinonen 2884255c17 MFC r202944:
Print full path in the error message. It's possible that fts(3)
provides an empty fts_name and reporting the full path is more
appropriate especially with the -R option.

PR:		bin/107515
2010-03-25 16:31:05 +00:00
John Baldwin b525abdb18 MFC 205013:
Print out the family and model from the cpu_id.  This is especially useful
given the advent of the extended family and extended model fields.  The
values are printed in hex to match their common usage in documentation.
2010-03-25 15:53:02 +00:00
Gavin Atkinson 8e3c8a034a Merge r204165 from head:
Add a "-x" option to chown(8)/chgrp(1) similar to the same option in
  du(1), cp(1) etc, to prevent the crossing of mountpoints whilst using the
  commands recursively.

PR:		bin/130855
Submitted by:	keramida
2010-03-25 13:15:55 +00:00
Maxim Sobolev d2aa506a3d MFC: allow comment in the middle of configuration line not only at the
beginning.
2010-03-25 00:37:13 +00:00
Pyun YongHyeon a5636cc5f1 MFC r205161:
It seems PCI_OUR_REG_[1-5] registers are not mapped on PCI
  configuration space on Yukon Ultra(88E8056) such that accesses to
  these registers were NOPs which in turn make msk(4) instable on
  this controller. Use indirect access method to access
  PCI_OUR_REG_[1-5] registers. This should fix a long standing
  instability bug which prevented msk(4) working on Yukon Ultra.
  Special thanks to koitsu who gave me remote access to his system.

  PR:	kern/114631, kern/116853
2010-03-24 17:38:08 +00:00
Pyun YongHyeon ca8b6562fd MFC r204975,204978-204979,204981:
r204975:
  Enable hardware fixes for BCM5704 B0 as recommended by data sheet.
r204978:
  Set maximum read byte count to 2048 for PCI-X BCM5703/5704 devices.
  Also disable relaxed ordering as recommended by data sheet for
  PCI-X devices. For PCI-X BCM5704, set maximum outstanding split
  transactions to 0 as indicated by data sheet.
  For BCM5703 in PCI-X mode, DMA read watermark should be less than
  or equal to maximum read byte count configuration. Enforce this
  limitation in DMA read watermark configuration.
r204979:
  Fix typo in r204975.
r204981:
  Fix typo in r204978.
2010-03-24 17:32:20 +00:00
Pyun YongHyeon 434b0e8298 MFC r204545:
Remove taskqueue based interrupt handling. After r204541 msk(4)
  does not generate excessive interrupts any more so we don't need
  to have two copies of interrupt handler.
  While I'm here remove two STAT_PUT_IDX register accesses in LE
  status event handler. After r204539 msk(4) always sync status LEs
  so there is no need to resort to reading STAT_PUT_IDX register to
  know the end of status LE processing. Just trust status LE's
  ownership bit.
2010-03-24 17:21:05 +00:00
Pyun YongHyeon ec20a5073e MFC r204543:
Document newly added loader tunable and sysctl variable dev.mskc.%d.int_holdoff
2010-03-24 17:15:39 +00:00
Pyun YongHyeon 9f8b311c1c MFC r204541:
Implement rudimentary interrupt moderation with programmable
  countdown timer register. The timer resolution may vary among
  controllers but the value would be represented by core clock
  cycles. msk(4) will automatically computes number of required clock
  cycles from given micro-seconds unit.
  The default interrupt holdoff timer value is 100us which will
  ensure less than 10k interrupts under load. The timer value can be
  changed with dev.mskc.0.int_holdoff sysctl node.

  Note, the interrupt moderation is shared resource on dual-port
  controllers so you can't use separate interrupt moderation value
  for each port. This means we can't stop interrupt moderation in
  driver stop routine. Also have msk_tick() reclaim transmitted Tx
  buffers as safety belt. With this change there is no need to check
  missing Tx completion interrupt in watchdog handler, so remove it.
2010-03-24 17:13:19 +00:00
Jaakko Heinonen 47fd23ccf0 MFC r203551:
- Cast intptr_t, pid_t and time_t values to intmax_t and use %jd with
  printf.
- Cast the system call return value to long and use %ld in a printf in
  ktrsysret().

PR:		bin/123774
2010-03-24 16:47:12 +00:00
Konstantin Belousov 4c172a339b MFC r204957:
Fall back to wbinvd when region for CLFLUSH is >= 2MB.

MFC r205334 (by avg):
Fix a typo in a comment.
2010-03-24 10:02:10 +00:00
Xin LI 4bfef5fb7d MFC: less v436. 2010-03-23 23:28:14 +00:00
Xin LI 5616a59d97 MFC: nc from OpenBSD 4.6. 2010-03-23 23:09:38 +00:00
Pyun YongHyeon 6eb06ed981 MFC r204378:
Add TSO support on VLANs. While I'm here remove unnecessary check
  of VLAN hardware checksum offloading. vlan(4) already takes care of
  this.
2010-03-23 22:24:02 +00:00
Pyun YongHyeon ce2d1fa190 MFC r204377:
Add TSO support on VLANs. While I'm here remove unnecessary check
  of VLAN hardware checksum offloading. vlan(4) already takes care of
  this.
2010-03-23 22:20:51 +00:00
Pyun YongHyeon d3c376f55e MFC r204376:
Disable TSO on BCM5755M controller until I understand better for
  the issue. I still have no idea why TSO does not work on this
  controller. davidch@ also confirmed there is no known TSO related
  issues for this controller.
2010-03-23 22:17:49 +00:00
Pyun YongHyeon 96a689d683 MFC r204373-204374:
r204373:
  Move TSO setup to new function bce_tso_setup(). Also remove VLAN
  parsing code in TSO path as the controller requires VLAN hardware
  tagging to make TSO work over VLANs.
  While parsing the mbuf in TSO patch, always perform check for
  writable mbuf as bce(4) have to reset IP length and IP checksum
  field of IP header and make sure to ensure contiguous buffer before
  accessing IP/TCP headers. While I'm here replace magic number 40 to
  more readable sizeof(struct ip) + sizeof(struct tcphdr).

r204374:
  Add TSO support on VLANs. bce(4) controllers require VLAN hardware
  tagging to make TSO work on VLANs so explicitly disable TSO on VLAN
  if VLAN hardware tagging is disabled.
2010-03-23 22:14:05 +00:00
Pyun YongHyeon f7913c45a7 MFC r204368,204370-204372:
r204368:
  Allow disabling VLAN hardware tag stripping with software work
  around. Management firmware(ASF/IPMI/UMP) requires the VLAN
  hardware tag stripping so don't actually disable VLAN hardware tag
  stripping. If VLAN hardware tag stripping was disabled, bce(4)
  manually reconstruct VLAN frame by appending stripped VLAN tag.
  Also remove unnecessary IFCAP_VLAN_MTU message.

r204370:
  Make sure to stop controller first before changing MTU. And if
  interface is not running don't initialize controller.
  While here remove unnecessary update of error variable.

r204371:
  Make toggling TSO, VLAN hardware checksum offloading work. Also fix
  TX/RX checksum handler to set/clear relavant assist bits which was
  used to cause unexpected results.
  With this change, bce(4) can be bridged with other interfaces that
  lack TSO, VLAN checksum offloading.

r204372:
  Prefer m_collapse(9) over m_defrag(9).
2010-03-23 22:06:59 +00:00
Pyun YongHyeon 19d2b155d1 MFC r204363,204365-204367,204539-204540:
r204363:
  Optimize inserting LE for TX checksum computation. Controller does
  not require checksum LE configuration if checksum start and write
  position is the same as before. So keep track last checksum start
  and write position and insert new LE whenever the position is
  changed. This reduces number of LEs used in TX path as well as
  slightly enhance TX performance.

r204365:
  Don't hardcod register offset to set PCIe max read request size.
  The register offset is not valid on 88E8072 controller. Also don't
  blindly increase max read request size to 4096, instead, use 2048
  which seems to be more sane value and only change the value if the
  hardware default size(512) was used on that register.
  For PCIX controllers, use system defined constant rather than using
  magic value.
  While I'm here stop showing negotiated link width.

r204366:
  Allocate single MSI message. msk(4) used to allocate 2 MSI messages
  for controllers like 88E8053 which reports two MSI messages.
  Because we don't get anything useful things with 2 MSI messages,
  allocating 1 MSI message would be more sane approach.
  While I'm here, enable MSI for dual-port controllers too. Because
  status block is shared for dual-port controllers, I don't think
  msk(4) will encounter problem for using MSI on dual-port
  controllers.

r204367:
  Remove trailing white spaces.

r204539:
  Properly sync status LEs after processing.

r204540:
  Make sure to enable flow-control only if established link is
  full-duplex. Previously msk(4) used to allow flow-control on
  1000baseT half-duplex media. Also GMAC pause is enabled if link
  partner is capable of handling it.
  While I'm here use IFM_OPTIONS instead of using IFM_GMASK to check
  optional flags of link.
2010-03-23 21:56:07 +00:00
Pyun YongHyeon 500141a884 MFC r204361-204362:
r204361:
  Reuse the configured LE for VLAN if new LE was created for TSO.
  Only old controllers need to create new LE for TSO. This change
  makes TSO work over VLANs.

r204362:
  Add TSO support on VLANs. Controller requires VLAN hardware tagging
  to make TSO work over VLANs.
2010-03-23 21:43:01 +00:00
John Baldwin 2060aaa7ba Enable the ability to build ZFS into the loader so that /boot/zfsloader
actually contains ZFS support.

Submitted by:	Alexander Zagrebin  alexz of visp ru
2010-03-23 21:39:33 +00:00
Andrew Gallatin e7a35c936a MFC 204212: Update mxge to support IFCAP_VLAN_HWTSO 2010-03-23 21:38:41 +00:00
Pyun YongHyeon b73e2c2ee3 MFC r204228,204230:
r204228:
  Add TSO support on VLANs. Also make sure to update TSO capability
  whenever jumbo frame is configured.
  While I'm here remove unnecessary check of VLAN hardware checksum
  offloading. vlan(4) already takes care of this.

r204230:
  Remove Tx mbuf parsing code for VLAN in TSO path. Controller does
  not support TSO over VLAN if VLAN hardware tagging is disabled so
  there is no need to check VLAN here.
2010-03-23 19:44:59 +00:00
Pyun YongHyeon a05e3eb47f MFC r204225:
Add TSO support on VLANs. jme(4) controllers do not require VLAN
  hardware tagging to make TSO work over VLANs.
2010-03-23 19:38:45 +00:00
Pyun YongHyeon bd478f639b MFC r204155,204219:
r204155:
  Increase PCIe maximuim read request size to 2048. Because re(4) uses
  Tx DMA burst size 2048, I beleive PCIe maximum read request size
  also should match to the value of Tx DMA burst size. With this
  change I can get more than 800Mbps for TCP bulk transfers.
  Previously I was not able to get more than 700Mbps. If I enable TSO
  it now shows 927Mbps.

r204219:
  Add TSO on VLANs. Because re(4) has a TSO limitation for jumbo
  frame, make sure to update VLAN capabilities whenever jumbo frame
  is configured.
  While I'm here rearrange interface capabilities configuration. The
  controller requires VLAN hardware tagging to make TSO work on VLANs
  so explicitly check this requirement.
2010-03-23 19:34:34 +00:00
Pyun YongHyeon 5cbe7661f4 MFC r204151,204223:
r204151:
  Add TSO support on VLAN. Controller requires VLAN hardware tagging
  to make TSO work on VLAN. So if VLAN hardware tagging is disabled
  explicitly clear TSO on VLAN. While I'm here remove duplicated
  VLAN_CAPABILITIES call.

r204223:
  Remove Tx mbuf parsing code for VLAN in TSO path. Controller does
  not support TSO over VLAN if VLAN hardware tagging is disabled so
  there is no need to check VLAN here.
  While I'm here make sure to pullup IP/TCP headers in the first
  buffer.
2010-03-23 19:24:17 +00:00
Ken Smith 7fbe18de6f 7.3-RELEASE is out so shift from PRERELEASE to STABLE. 2010-03-23 19:11:25 +00:00
Hiroki Sato 3523a98e25 Trim old items and add an errata item for 7.3R. 2010-03-23 18:36:45 +00:00
Pyun YongHyeon fdb1769dba MFC r204156:
Add __FBSDID.
2010-03-22 23:27:08 +00:00
Pyun YongHyeon 3c2ad38307 MFC r203528:
Add pci_get|set_max_read_req() helper functions to control maximum PCIe
  read request size.
2010-03-22 23:15:19 +00:00
Edwin Groothuis 4dcba75b42 MFC of r205475, tzdata2010f:
The Australian Antartic Division:
- Macquarie Island will stay on UTC+11 for winter and not switch back from DST.
- Casey station reverted to its normal time of UTC+8 on 5 March 2010.
- Davis station will revert to its normal time of UTC+7 at 10 March 2010
- Mawson station stays on UTC+5.

Syria will start DST on Thursday 1 April 2010 at midnight.

Correct Samao DST start date (26 Sep vs 24 Oct)
2010-03-22 21:35:56 +00:00
Jung-uk Kim 736f521c56 MFC: r205223
Fix a long standing regression of readdir(3) in fdescfs(5) introduced
in r1.48.  We were stopping at the first null pointer when multiple file
descriptors were opened and one in the middle was closed.  This restores
traditional behaviour of fdescfs.
2010-03-22 20:41:44 +00:00
Jung-uk Kim 9e14ecacaa MFC: r205092
Tidy up callout for select(2) and read timeout.

- Add a missing callout_drain(9) before the descriptor deallocation.[1]
- Prefer callout_init_mtx(9) over callout_init(9) and let the callout
subsystem handle the mutex for callout function.

PR:		kern/144453
Submitted by:	Alexander Sack (asack at niksun dot com)[1]
2010-03-22 20:12:10 +00:00
Jung-uk Kim 974843e875 MFC: r203943
Remove COMPILATIONDATE from the default section.  This string is no longer
being substituted since r162063.
2010-03-22 19:52:06 +00:00
Pyun YongHyeon de25bbb0b9 MFC r204150:
Add TSO support on VLAN in fconfig(8).
2010-03-22 19:50:33 +00:00
Pyun YongHyeon ffb9c4e603 MFC r182414:
Add support in ifconfig to control the vlan hardware filter feature.
2010-03-22 19:36:47 +00:00
Pyun YongHyeon 93934d22e6 MFC r204149:
Add TSO support on VLANs. Intentionally separated IFCAP_VLAN_HWTSO
  from IFCAP_VLAN_HWTAGGING. I think some hardwares may be able to
  TSO over VLAN without VLAN hardware tagging.
  Driver changes and userland support will follow.
2010-03-22 19:04:02 +00:00
John Baldwin 9e67b248d2 MFC 204950,205020:
Use thr_once() with once_t controls to initialize various thread_key_t
objects used to provide per-thread storage in the RPC code.  Almost all
of these used double-checking with a dedicated mutex (tsd_lock) to do this
before.  However, that is not always safe with more relaxed memory orders.
There were also other bugs, such as one in __rpc_createrr() that caused a
new key to be allocated each time __rpc_createrr() was invoked.
2010-03-22 15:54:56 +00:00
Andrew Gallatin f60639d1b7 MFC 205255: Fix 2 bugs in mxge_attach() 2010-03-22 13:20:25 +00:00
Michael Tuexen a6d4dfd1d6 MFC 186815
Adds flag for SCTP checksum offloading.
Requested by Pyun YongHyeon.

Reviewed by: rrs
2010-03-22 00:11:31 +00:00
Ken Smith c5d86e6e59 Guess at the date the 7.3-RELEASE builds will be finished and everything
will be in place for the announcement.
2010-03-20 23:50:55 +00:00
Jaakko Heinonen a3155d529b MFC r204447:
In _gettemp(), check that the length of the path doesn't exceed
MAXPATHLEN. Otherwise the path name (or part of it) may not fit to
carrybuf causing a buffer overflow.

PR:		bin/140228
2010-03-19 12:04:56 +00:00
Pyun YongHyeon f241007553 MFC r202717:
- Added a workaround for NC-SI management firmware that would allow
    frames to be accepted while the driver is resetting the hardware.
    This failure is generally observed when broadcast frames are received
    during driver load and will generate "Unable to write CTX memory"
    errors.
  - Small changes to driver flags display.

PR:	kern/135836, kern/140684
2010-03-19 00:29:52 +00:00
Pyun YongHyeon 17d2620ac2 MFC r194781:
- Added code to read bootcode firwmare version.
  - Created dedicated shared memory access routines.
2010-03-19 00:18:53 +00:00
Pyun YongHyeon 1bbb1b99ac MFC r202826-202827,204146
r202826:
  s/Mhz/MHz/g

  Submitted by:	N.J. Mann <njm <> njm dot me dot uk >

r202827:
  Yukon Ultra2 has 125MHz clock.

r204146:
  Correct inversed programming of ethernet hardware address on
  big-endian architecture.

  Submitted by:	C. Jayachandran <c.jayachandran at gmail dot com> (initial version)
2010-03-18 19:00:37 +00:00
Pyun YongHyeon fff1160b65 MFC r203358,203716:
r203358:
  PCI express device status register has W1C feature. Writing 0 has
  no effect. Make sure to clear error bits by writing 1. [1]
  While I'm here use predefined value instead of hardcodig magic
  vlaue.

  Submitted by:	msaitoh at NetBSD [1]

r203716:
  Move device specific flag configuration to attach routine.
  The softc obtained in device probe wouldn't be the same one used in
  device attach. Drivers should not assume any values stored in softc
  structure in probe routine will be available for its attach routine.
2010-03-18 18:52:18 +00:00
Pyun YongHyeon f62eff8675 MFC r203355:
Add more bit definitions to PCI express device control and device
  status register.
2010-03-18 18:45:45 +00:00
Pyun YongHyeon 4c15f99a49 MFC r202821-202822.
r202821:
  Fix a long standing ASF heartbeat sending bug. The initial
  implementation of heartbeat interval was 2 but there was typo which
  caused the heartbeat is sent approximately every 5 seconds. This
  caused unintended controller reset by firmware because firmware
  thought OS was crashed.

  Submitted by:	Floris Bos < info <> je-eigen-domein dot nl >
  Tested by:	Andrzej Tobola < ato <> iem dot pw dot edu dot pl >

r202822:
  Use new handshake command for BCM5750 or new controllers.
2010-03-18 18:38:53 +00:00
Rui Paulo 48fa92006c Fix HTCAP's SM power save bits to match the ones in HEAD.
PR:		144476
Submitted by:	Alexander Egorenkov <egorenar at gmail.com>
2010-03-18 16:55:47 +00:00
Gavin Atkinson 68cc9e3f9f Merge r203622 from head:
Add support for a few more Sony-specific ACPI features (default display
  brightness, wired LAN power and bass gain), and update the description of
  one previously unknown feature (display contrast).  While here, expand on
  a comment and remove two defines left over from an old version of the code.

  Also update man page to document the above changes, and correct grammar.

PR:		kern/127581
2010-03-17 21:19:30 +00:00
Xin LI 19d233803c MFC 178256:
Add prototype for fdopendir().

Requested by:	naddy
2010-03-17 21:11:48 +00:00
Gavin Atkinson 9111d1a218 Merge r201401 from head:
Remove dead code.  This section of code is only run in the
  (sblock.fs_magic == FS_UFS1_MAGIC) case, so the check within the
  loop is redundant.

Merge 203835 from head:

  When growing a UFS1 filesystem, we need to initialise all inodes in any new
  cylinder groups that are created.  When the filesystem is first created,
  newfs always initialises the first two blocks of inodes, and then in the
  UFS1 case will also initialise the remaining inode blocks.  The changes in
  growfs.c 1.23 broke the initialisation of all inodes, seemingly based on
  this implementation detail in newfs(8).  The result was that instead of
  initialising all inodes, we would actually end up initialising all but the
  first two blocks of inodes.  If the filesystem was grown into empty
  (all-zeros) space then the resulting filesystem was fine, however when
  grown onto non-zeroed space the filesystem produced would appear to have
  massive corruption on the first fsck after growing.
  A test case for this problem can be found in the PR audit trail.

  Fix this by once again initialising all inodes in the UFS1 case.

PR:		bin/115174
Submitted by:	"Nate Eldredge" <nge cs.hmc.edu>
Reviewed by:	mjacob
2010-03-17 20:30:37 +00:00
Gavin Atkinson 1b7f5e05bf Merge r203865 from head:
The -newerXB option was being interpreted the same as the -newerXm option
  as a check for F_TIME2_B was missing.  Fix this.

PR:		bin/138245
Submitted by:	"David E. Cross"  <crossd cs.rpi.edu>
2010-03-17 20:17:25 +00:00
Doug Barton d7e2187844 MFC r205145:
Make it more clear in the docs that -a is not compatible with -iFU,
and enforce this in the code. Apparently a lot of users mistakenly
combine -a with these flags and are then mystified that no changes
were made.

While I'm here, fix a trailing space in mergemaster.8
2010-03-17 07:26:59 +00:00
Marius Strobl 0e29edd7c2 MFC: r204222
According to the Linux sungem driver, in case of Apple (K2) GMACs
GEM_MIF_CONFIG_MDI0 cannot be trusted when the firmware has powered
down the chip so the internal transceiver has to be hardcoded. This
is also in line with the AppleGMACEthernet driver, which just doesn't
distinguish between internal/external transceiver and MDIO/MDI1
respectively in the first place. Tested by: Andreas Tobler
2010-03-15 19:13:49 +00:00
Marius Strobl 80e46283b2 MFC: r204144
Add support for BCM54K2 found in combination with Apple K2 GMAC.

Submitted by:   Andreas Tobler
Obtained from:  OpenBSD
2010-03-15 19:04:51 +00:00
Marius Strobl dc2da26ad4 MFC: r204974, r205002
- The OPSZ macro actually only does the right thing for int32 and int64
  operands but not for double and extended double ones. Instead of trying
  to fix the macro just nuke it and unroll the loops in the correct way
  though as extended double operands turn out to be the only special case.
- For FxTO{s,d,q} the source operand is int64 so rs2 has to be re-decoded
  after setting type accordingly as it's generally decoded using the low
  2 bits as the type, which are 0 for these three instructions.
- Similarly, in case of F{s,d,q}TOx the target is int64 so rd has to be
  re-decoded using not only the operand mask appropriate for int64 but
  also the correct register number encoding.
- Use const where appropriate.
- Wrap long lines.

Submitted by:	Peter Jeremy (partly)
2010-03-15 18:33:23 +00:00
Gavin Atkinson dc82e6ff42 Merge r202461 from head:
Implement an "-x" option to cp(1), for compatibility with Linux and
  feature parity with du(1) and similar:  When set, cp(1) will not traverse
  mount points.

PR:		bin/88056
Initial patch by: Graham J Lee  <leeg teaching.physics.ox.ac.uk>
2010-03-14 16:03:36 +00:00
Gavin Atkinson 33878b41be Merge r183385 from head (by cognet)
Advertise bit 26 as sse2.

PR:		kern/130724
Approved by:	cognet
2010-03-14 13:32:40 +00:00
Xin LI 50f8e33866 MFC r203760: Improve time precision for grdc(6):
Traditionally, grdc would obtain time through time(3) which in turn gets
only the second part of clock (CLOCK_SECOND), and sleep for 1 second after
each screen refresh.

This approach would have two problems.  First, we are not guaranteed to
be waken up at the beginning of a whole second, which will typically
exhibit as a "lag" on second number.  Second, because we sleep for whole
second, and the refresh process would take some time, the error would
accumulate from time to time, making the lag variable.

Make grdc(6) to use time(3) to get time only at the beginning, and sample
time in CLOCK_REALTIME_FAST granularity after refreshing, and use the
nanosecond part to caculate how much time we want to sleep.

PR:		bin/120813
2010-03-12 00:51:25 +00:00
Fabien Thomas f3497883ee MFC r204878:
Change the way shutdown is handled for log file.

 pmc_flush_logfile is now non-blocking and just ask the kernel
 to shutdown the file. From that point, no more data is
 accepted by the log thread and when the last buffer is flushed
 the file is closed.

 This will remove a deadlock between pmcstat asking for
 flush while it cannot flush the pipe itself.
2010-03-11 07:39:36 +00:00
Fabien Thomas d9a41872e2 MFC r204878:
Change the way shutdown is handled for log file.

 pmc_flush_logfile is now non-blocking and just ask the kernel
 to shutdown the file. From that point, no more data is
 accepted by the log thread and when the last buffer is flushed
 the file is closed.

 This will remove a deadlock between pmcstat asking for
 flush while it cannot flush the pipe itself.
2010-03-11 07:38:27 +00:00
Pyun YongHyeon 3ad6e7a743 MFC r204647:
Remove programming LED register and enable 25MHz TX clock for
  88E1149 PHY. This will fix intermittent watchdog timeouts as well
  as very slow network performance on 88E8072 Yukon Extreme.

  PR:	kern/144148
2010-03-10 22:23:55 +00:00
John Baldwin 612afc958d MFC 204638:
Allow lseek(SEEK_END) to work on disk devices by using the DIOCGMEDIASIZE
to determine the media size.
2010-03-10 19:49:33 +00:00
Ken Smith 1df1e1f3f3 Package set for 7.3-RELEASE.
Reviewed by:	portmgr@, re@
2010-03-10 19:00:33 +00:00
Jung-uk Kim 37eadd8918 MFC: r197438, r203810, r203813, r203935, r203936
Sync acpi_video(4) with HEAD.

r197438:
Uninline an instance of STAILQ_FOREACH_SAFE().

r203810:
Implement LCD brightness control notify handler.

r203813:
Make sanity check slightly more useful and tweak an error message.

r203935:
Add support for `cycle' and `zero' events for LCD brightness control.

r203936:
Rename some macros to clarify their intentions and fix style nits.
2010-03-10 18:13:17 +00:00
John Baldwin 885296cbb4 Revert the change to increase MAXCPU to 32 on amd64 and i386. MAXCPU is
part of the de facto KBI currently.
2010-03-10 15:47:33 +00:00
Gavin Atkinson ada6493274 Merge r202000 from head:
Don't panic on attach if we can't allocate ifp
2010-03-10 13:54:13 +00:00
Gavin Atkinson 7e42b2cf7a Merge r204053 from head:
The correct value of DEL is 0x7f, not 0xff.  This is purely a documentation
  issue - od(1) and hexdump(1) behave as expected.

PR:		docs/143869
Submitted by:	gcooper
2010-03-10 13:42:37 +00:00
John Baldwin 5be5a478d3 MFC 183525: Bump MAXCPU to 32 now that 32 CPU x86 systems exist. 2010-03-09 22:10:11 +00:00
Konstantin Belousov 6ac88ff2ad MFC r204590:
Correct mfip module dependency on mfi. This allows mfip to be loaded as
module when mfi is a module itself.
2010-03-09 13:41:33 +00:00
John Baldwin 5c43a4e1b2 Don't include disabled CPUs in the topology map. ULE assumes that all CPUs
in the topology map were present and enabled.  Booting a system with
hyperthreading and at least one CPU would cause ULE to attempt to use a
disabled CPU when rebalancing load resulting in a panic.  This is a direct
commit to 7 as the topology code is different in 8 and later.
2010-03-09 13:08:57 +00:00
John Baldwin 7beeb7e2b1 MFC 204518:
Print the contents of the miscellaneous (MISC) register to the console if
it is valid along with the other register values when a machine check is
encountered.
2010-03-08 21:42:19 +00:00
Edwin Groothuis 779c88d8c5 MFC of tzdata2010e, r204887
- Adjust beginning / end of DST in Bangladesh (minimal impact)
- Fiji ends DST one month earlier to last Sunday of March
- Samoa changes
- Chile extends DST until 3 April this year.
2010-03-08 21:29:05 +00:00
Fabien Thomas a96d21ce7b MFC r204783:
Bug fixed:
  - no display on serial terminal in top mode.
  - display alignment for continuation string.
  - correct invalid value used for display limit.
2010-03-08 08:05:02 +00:00
Konstantin Belousov 649741b0ac MFC r204464:
Several fixes for miscellaneous clone handlers in if_tun and if_tap.

Tested by:	Mikolaj Golub <to.my.trociny gmail com>
2010-03-07 20:06:06 +00:00
Gregory Neil Shapiro 418df301f3 MFC: Enable the use of nanosleep() instead of using pause() and signals.
This Makefile change can be removed when the next version of sendmail
     is imported as it will have this built in to the FreeBSD conf.h section.
2010-03-07 02:03:25 +00:00
Ivan Voras 133097bc5c MFC virtual machine guest detection code and r204420 - code to disable
superpages on buggy AMD CPUs.

Reviewed by:	alc
2010-03-06 16:45:55 +00:00
Fabien Thomas 5efea86de5 MFC 180091:
Document messages printed in verbose mode.
2010-03-05 22:59:49 +00:00
Fabien Thomas 0caf7e25da MFC 204329 partially:
Fixed dependencies (make checkdpadd).
2010-03-05 22:53:31 +00:00
Fabien Thomas b1d3291292 MFC 203790:
- Reorganize code in 'plugin' to share log processing.
- Kcachegrind (calltree) support with assembly/source
  code mapping and call count estimator (-F).
- Top mode for calltree and callgraph plugin (-T).
2010-03-05 22:43:44 +00:00
Andriy Gapon 06a72f45e1 MFC r203061: KASSERT contract of return value of interrupt filter 2010-03-05 15:19:53 +00:00
Konstantin Belousov f0e1168e19 MFC r204308:
Do not restrict the allowed signals that can be specified by number
to the list of signals that has symbolic name. It was impossible to
send rt signals with kill(1) due to the check.
2010-03-04 07:24:09 +00:00
Andriy Gapon 295dee8012 MFC r203823: kgdb: initialize n_type field of nlist entry for kvm_nlist 2010-03-02 19:08:44 +00:00
Edwin Groothuis bf2901bca8 MFC of r204566, tzdata2010c:
Paraguay changes its DST schedule, postponing the March rule to
April and modifying the October date.
2010-03-02 10:05:24 +00:00
Matt Jacob abeb0c39c5 MFC of 184830 and 196007- pull latest firmware and ispfw.c
fixes into RELENG_7
2010-03-02 01:21:33 +00:00
John Baldwin 63ade98d43 MFC: Fix spelling of EACCES. 2010-03-01 21:04:10 +00:00
Maksim Yevmenkin 371ad52614 Use start/stop instead of quietstart/quietstop. Pointy hat goes to me.
Pointed out by:	jhb
2010-03-01 18:58:18 +00:00
Matt Jacob 5365c36425 MFC of 204397: fix problems with fast posting handles 2010-03-01 17:42:06 +00:00
Andriy Gapon b93a1c9822 MFC r203546: acpi_cpu: prefer _OSC over _PDC 2010-02-28 21:45:00 +00:00
Andriy Gapon 49b53b1e99 MFC r203430: acpi_cpu: correct capabilities arguments for Processor _OSC 2010-02-28 21:32:10 +00:00
Andriy Gapon 115aa22334 MFC r203062: acpi_hpet: correctly get number of timers/comparators 2010-02-28 21:23:50 +00:00
Andriy Gapon a39c34420e MFC r203160: add static qualifier to definition of already static function 2010-02-28 21:21:29 +00:00
Gavin Atkinson fb74d2eb20 Pull mergeinfo for r192215 up to the directory 2010-02-28 11:27:03 +00:00
Gavin Atkinson a9587ac8fb Merge r204166 from head:
Document the interaction between /etc/devfs.conf and
  /etc/defaults/devfs.conf

PR:		docs/117308
Submitted by:	Mel <mel.xyzzy rachie.is-a-geek.net> (partially)
2010-02-28 11:22:42 +00:00
Matt Jacob c5fbbca5d6 MFC of 204384: Fix misallocation error in target mode 2010-02-28 06:16:41 +00:00
Alan Cox 897f132836 MFC r203085
Optimize pmap_demote_pde() by using the new KPTmap to access a kernel
  page table page instead of creating a temporary mapping to it.

  Set the PG_G bit on the page table entries that implement the KPTmap.

  Locore initializes the unused portions of the NKPT kernel page table
  pages that it allocates to zero.  So, pmap_bootstrap() needn't zero
  the page table entries referenced by CMAP1 and CMAP3.

  Simplify pmap_set_pg().
2010-02-27 18:45:32 +00:00
Kirk McKusick 5b5268a82a MFC of 203763, 203764, 203768, 203769, 203770, 203782, and 203784.
These fixes correct a problem in the file system that treats large
inode numbers as negative rather than unsigned. For a default
(16K block) file system, this bug began to show up at a file system
size above about 16Tb.

These fixes also update newfs to ensure that it will never create a
filesystem with more than 2^32 inodes.

They also update libufs, tunefs, and growfs so that they properly
handle inode numbers as unsigned.

Reported by: Scott Burns, John Kilburg, and Bruce Evans
Followup by: Jeff Roberson
PR:          133980
2010-02-27 17:55:29 +00:00
Ed Maste 7fd261657a MFC r204106:
Avoid corrupting the list or queue if _REMOVE is invoked with a
  reference to the head.

PR:		kern/119307
2010-02-27 04:02:40 +00:00
Jung-uk Kim e8bb53166c MFC: r204105
Return partially filled buffer for non-blocking read(2)
in non-immediate mode.

PR:		kern/143855
Submitted by:	Guy Harris (guy at alum dot mit dot edu)
2010-02-26 00:12:48 +00:00
Maksim Yevmenkin 0ffd34fa03 MFC: r203676
Introduce new rc.conf variable firewall_coscripts. It can be used to
specify list of executables and/or rc scripts that should be executed
after firewall starts/stops.

Submitted by:	Yuri Kurenkov <y dot kurenkov at init dot ru>
Reviewed by:	rhodes, rc@
2010-02-25 18:02:52 +00:00
Rebecca Cran 9565f40b18 MFC r203323:
Remove extra semicolon.

Approved by:	rrs (mentor)
2010-02-24 22:04:49 +00:00
Rebecca Cran fdd11dd2e0 MFC r203322:
Fix typo of ENOTCONN.
Add missing RETURN VALUES section in sctp_opt_info(3).

Approved by:	rrs (mentor)
2010-02-24 22:02:25 +00:00
Rebecca Cran e94f99fcd6 MFC r203681:
Fix typo and remove extra spaces.

Approved by:	rrs (mentor)
2010-02-24 22:00:00 +00:00
Rebecca Cran 14895c3b57 MFC r203688:
Initialize the execfile argument to NULL instead of _PATH_DEVNULL. This allows
the -M option to be used without specifying -N.

Approved by:	rrs (mentor)
2010-02-24 21:57:51 +00:00
John Baldwin 4eb2ce74f0 MFC 204090:
Fix mptutil's method for locating disk devices attached to a specific
mpt(4) controller.  Previously, the code assumed that multiple match
patterns provided to an XPT_DEV_MATCH request were ANDed together.
Instead, they are ORed.  Instead, to match peripherals for a specific bus,
one query needs to be performed to lookup the path ID of the bus.  A second
query can then be performed matching peripherals attached to that path.
This approach also makes the code a bit cleaner as the returned match
results do not mix buses and perphierals.
2010-02-24 21:29:30 +00:00
John Baldwin 9a97255f8b MFC 204086:
- Don't emit a warning in 'show adapter' if the IOC2 or IOC6 pages are not
  present.  mpt(4) controllers that do not support RAID do not have an IOC6
  page, for example.
- Correct a check for a missing page error in a debug function.
2010-02-24 21:26:27 +00:00
Gavin Atkinson fa2bd43543 Merge r202931 from head:
Add support for four more nfsmb controllers, shipping on at least the
  ASUS Atom ION boards.

PR:		kern/142571
Submitted by:	oliver
2010-02-23 22:09:42 +00:00
Gavin Atkinson 24568a3cc1 Merge r202115 from head:
Our standard "xterm" termcap entry supports colour, so this tip is redundant.
  As it happens, "xterm-color" has just been an alias for "xterm" since
  src/share/termcap/termcap.src 1.131 in September 2002.

PR:		docs/132959
2010-02-23 21:15:05 +00:00
Gavin Atkinson 7e555def00 Merge r203636 from head:
Correct arguments to free_unr(), "item" was missing.
2010-02-23 20:28:15 +00:00
Gavin Atkinson 821d69ea13 Merge r203393,r203395 from head:
The multiplicand a = 0x5deece66d = 25214903917, not 0xfdeece66d.
  This bug in the man page has gone unnoticed for over 15 years!

PR:		docs/143461
Submitted by:	Jeremy Huddleston  jeremyhu apple.com
2010-02-23 19:37:00 +00:00
Gavin Atkinson f67dce937d Merge r203620,203621 from head:
Document support for the D-Link DFE520-TX card (supported with the vr(4)
  driver)

PR:		kern/135989
Submitted by:	"Rashid N. Achilov"  citycat4 ngs.ru
2010-02-23 19:34:22 +00:00
Matt Jacob 358f059986 MFC 196008 196162 197214 197372 197373
MFC 198822 200089 201325 201408 202418
MFC 203444 203463 203478 204050

Move back into RELENG_7 the current state of isp.
2010-02-23 18:37:21 +00:00
Matt Jacob ff846dae78 MFC 203505
Add the long missing "destroy" option.
2010-02-23 07:07:46 +00:00
Ed Maste 9a075cdd6f MFC r202812:
Add H55 ID from Mike Tancsa, with minor rewording from avg@.

PR:		kern/143068
Submitted by:	Mike Tancsa (Sentex)
2010-02-23 01:24:01 +00:00
Xin LI 80883315f4 MFC r203728:
- Return EAFNOSUPPORT instead of EINVAL for unsupported address family,
   this matches the Linux behavior.
 - Check if we have sufficient space allocated for socket structure, which
   fixes a buffer overflow when wrong length is being passed into the
   emulation layer. [1]

PR:		kern/138860
Submitted by:	Mateusz Guzik <mjguzik gmail com>
Reported by:	Alexander Best [1]
2010-02-23 00:41:40 +00:00
Xin LI 0a9d59c567 MFC r203533:
Remove two files that are not needed by FreeBSD.
2010-02-22 22:41:36 +00:00
Konstantin Belousov b1e1a121d8 MFC r203818:
Clear the bp pointer when buffer is already brelse()d.

Approved by:	re (bz)
2010-02-20 12:31:00 +00:00
John Baldwin a66b41ffa6 Fix a bug where MSI interrupts on x86 were always routed to APIC ID 0 rather
than the APIC ID of the boot CPU prior to SI_SUB_SMP.  This resulted in
some storage controllers not being able to enumerate attached devices when
using MSI/MSI-X interrupts.  This only affects <= 7.x, so it is a direct
commit to 7 rather than an MFC.

Reviewed by:	scottl
Approved by:	re (kib)
2010-02-17 21:17:54 +00:00
Konstantin Belousov 8cb1e4419d MFC r203441:
Placate new binutils, by using 16-bit %ax instead of 32-bit %eax as an
argument for fnstsw. Explicitely specify sizes for the XMM control and
status word and X87 control and status words.

Approved by:	re (bz)
2010-02-17 10:27:07 +00:00
Konstantin Belousov b4b2800503 MFC r203875:
Do not leak process lock when current thread is not allowed to see target.

Approved by:	re (bz)
2010-02-17 10:15:17 +00:00
Doug Barton fcbd7a3320 Upgrade to BIND 9.4-ESV. This version incorporates all bug and security
fixes since the release of 9.4.3, including the most recent -P5 security
fix detailed below.

From the README:
BIND 9.4-ESV will be supported until December 31, 2010, at
which time you will need to upgrade to the current release
of BIND.

This versions address the following vulnerabilities:

BIND 9 Cache Update from Additional Section
https://www.isc.org/advisories/CVE-2009-4022v6
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-4022
A nameserver with DNSSEC validation enabled may incorrectly add
unauthenticated records to its cache that are received during the
resolution of a recursive client query

BIND 9 DNSSEC validation code could cause bogus NXDOMAIN responses
https://www.isc.org/advisories/CVE-2010-0097
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-0097
There was an error in the DNSSEC NSEC/NSEC3 validation code that could
cause bogus NXDOMAIN responses (that is, NXDOMAIN responses for records
proven by NSEC or NSEC3 to exist) to be cached as if they had validated
correctly

These issues only affect systems with DNSSEC validation enabled.

Approved by:	re (kensmith)
2010-02-16 05:14:51 +00:00
Konstantin Belousov b807cef577 MFC r195635:
Properly set MAP_ENTRY_WIRE_SKIPPED when aborting the loop.

PR:	kern/143717 (for RELENG_7)
Approved by:	re (bz)
2010-02-13 10:42:29 +00:00
Ken Smith 9fc938161d Bump __FreeBSD_version to reflect that releng/7.3 has been branched.
Approved by:	re (implicit)
2010-02-10 04:12:55 +00:00
6333 changed files with 750585 additions and 206682 deletions

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@
The compilation of software known as FreeBSD is distributed under the
following terms:
Copyright (c) 1992-2010 The FreeBSD Project. All rights reserved.
Copyright (c) 1992-2013 The FreeBSD Project. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
+2 -1
View File
@@ -3,7 +3,7 @@ $FreeBSD$
Please note that the content of this file is strictly advisory.
No locks listed here are valid. The only strict review requirements
are granted by core. These are documented in src/LOCKS and enforced
by CVSROOT/approvers.
by svnadmin/conf/approvers.
The source tree is a community effort. However, some folks go to the
trouble of looking after particular areas of the tree. In return for
@@ -129,6 +129,7 @@ gnu/usr.bin/send-pr bugmaster Pre-commit review requested.
BSD.{local,x11*}.dist portmgr Pre-commit review requested, since these files interface with ports.
usb core Please contact core@ before any major changes
ncurses rafan Heads-up appreciated, try not to break it.
isci(4) jimharris Pre-commit review requested.
Following are the entries from the Makefiles, and a few other sources.
Please remove stale entries from both their origin, and this file.
+11 -7
View File
@@ -21,7 +21,7 @@
# check-old-dirs - List obsolete directories.
# check-old-files - List obsolete files.
# check-old-libs - List obsolete libraries.
# delete-old - Delete obsolete directories/files/libraries.
# delete-old - Delete obsolete directories/files.
# delete-old-dirs - Delete obsolete directories.
# delete-old-files - Delete obsolete files.
# delete-old-libs - Delete obsolete libraries.
@@ -57,7 +57,7 @@
# 6. `mergemaster -p'
# 7. `make installworld'
# 8. `make delete-old'
# 9. `mergemaster' (you may wish to use -U or -ai).
# 9. `mergemaster' (you may wish to use -i, along with -U or -F).
# 10. `reboot'
# 11. `make delete-old-libs' (in case no 3rd party program uses them anymore)
#
@@ -139,10 +139,12 @@ buildworld: upgrade_checks
#
# In the following, the first 'rm' in a series will usually remove all
# files and directories. If it does not, then there are probably some
# files with chflags set, so this unsets them and tries the 'rm' a
# files with file flags set, so this unsets them and tries the 'rm' a
# second time. There are situations where this target will be cleaning
# some directories via more than one method, but that duplication is
# needed to correctly handle all the possible situations.
# needed to correctly handle all the possible situations. Removing all
# files without file flags set in the first 'rm' instance saves time,
# because 'chflags' will need to operate on fewer files afterwards.
#
BW_CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR}
cleanworld:
@@ -270,9 +272,9 @@ make: .PHONY
# existing system is.
#
.if make(universe)
TARGETS?=amd64 arm i386 ia64 pc98 powerpc sparc64 sun4v
TARGETS?=amd64 arm i386 ia64 pc98 powerpc sparc64
universe: universe_prologue
universe: universe_prologue upgrade_checks
universe_prologue:
@echo "--------------------------------------------------------------"
@echo ">>> make universe started on ${STARTTIME}"
@@ -283,7 +285,7 @@ KERNCONFS!= cd ${.CURDIR}/sys/${target}/conf && \
! -name DEFAULTS ! -name LINT
KERNCONFS:= ${KERNCONFS:S/^NOTES$/LINT/}
universe: universe_${target}
.ORDER: universe_prologue universe_${target} universe_epilogue
.ORDER: universe_prologue upgrade_checks universe_${target}_prologue universe_${target} universe_epilogue
universe_${target}:
.if !defined(MAKE_JUST_KERNELS)
@echo ">> ${target} started on `LC_ALL=C date`"
@@ -295,6 +297,7 @@ universe_${target}:
"check _.${target}.buildworld for details")
@echo ">> ${target} buildworld completed on `LC_ALL=C date`"
.endif
.if !defined(MAKE_JUST_WORLDS)
.if exists(${.CURDIR}/sys/${target}/conf/NOTES)
@(cd ${.CURDIR}/sys/${target}/conf && env __MAKE_CONF=/dev/null \
${MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \
@@ -310,6 +313,7 @@ universe_${target}:
echo "${target} ${kernel} kernel failed," \
"check _.${target}.${kernel} for details")
.endfor
.endif
@echo ">> ${target} completed on `LC_ALL=C date`"
.endfor
universe: universe_epilogue
+12 -4
View File
@@ -88,7 +88,7 @@ CLEANDIR= cleandir
.endif
CVS?= cvs
CVSFLAGS?= -r RELENG_7_3 -P -d -I!
CVSFLAGS?= -r RELENG_7 -P -d -I!
SUP?= /usr/bin/csup
SUPFLAGS?= -g -L 2
.if defined(SUPHOST)
@@ -263,6 +263,7 @@ LIB32WMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \
VERSION="${VERSION}" \
MACHINE=i386 \
MACHINE_ARCH=i386 \
MACHINE_CPU="i686 mmx sse sse2" \
INSTALL="sh ${.CURDIR}/tools/install.sh" \
PATH=${TMPPATH} \
CC="${CC} ${LIB32FLAGS}" \
@@ -734,15 +735,17 @@ buildkernel:
@echo ">>> stage 2.3: build tools"
@echo "--------------------------------------------------------------"
cd ${KRNLOBJDIR}/${_kernel}; \
PATH=${BPATH}:${PATH} \
MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \
${MAKE} -DNO_CPU_CFLAGS -DNO_CTF \
${MAKE} -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF \
-f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile
# XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case.
.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules)
.for target in obj depend all
cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \
PATH=${BPATH}:${PATH} \
MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \
${MAKE} -DNO_CPU_CFLAGS -DNO_CTF ${target}
${MAKE} -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF ${target}
.endfor
.endif
.if !defined(NO_KERNELDEPEND)
@@ -887,6 +890,10 @@ _colldef= usr.bin/colldef
_gencat= usr.bin/gencat
.endif
.if ${BOOTSTRAPPING} >= 1000013
_yacc= usr.bin/yacc
.endif
.if ${BOOTSTRAPPING} < 600016
_mklocale= usr.bin/mklocale
.endif
@@ -921,6 +928,7 @@ bootstrap-tools:
${_gencat} \
usr.bin/lorder \
usr.bin/makewhatis \
${_yacc} \
${_mklocale} \
usr.bin/rpcgen \
usr.bin/xinstall \
@@ -985,7 +993,7 @@ build-tools:
#
# cross-tools: Build cross-building tools
#
.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING} < 702102
.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING} < 702104
.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
_btxld= usr.sbin/btxld
.endif
+10
View File
@@ -14,6 +14,16 @@
# The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
#
# 20110224: sticky.8 -> sticky.7
OLD_FILES+=usr/share/man/man8/sticky.8.gz
# 20101114: Remove long-obsolete MAKEDEV.8
OLD_FILES+=usr/share/man/man8/MAKEDEV.8.gz
# 20101112: vgonel(9) has gone to private API a while ago
OLD_FILES+=usr/share/man/man9/vgonel.9.gz
# 20101025: catch up with vm_page_sleep_if_busy rename
OLD_FILES+=usr/share/man/man9/vm_page_sleep_busy.9.gz
# 20100815: retired last traces of chooseproc(9)
OLD_FILES+=usr/share/man/man9/chooseproc.9.gz
# 20091129: pecoff image activator removed
.if ${TARGET_ARCH} == "i386"
OLD_FILES+=usr/include/machine/pecoff_machdep.h
+23 -5
View File
@@ -8,6 +8,19 @@ Items affecting the ports and packages system can be found in
/usr/ports/UPDATING. Please read that file before running
portupgrade.
20111101:
The broken amd(4) driver has been replaced with esp(4) in the amd64,
i386 and pc98 GENERIC kernel configuration files.
20110221:
FreeBSD 7.4-RELEASE
20101126:
New version of minidump format for amd64 architecture was
introduced in r215874. To analyze vmcore files produced by
kernels at or after this version you will need updated userland,
libkvm actually, that is able to handle the new version.
20100323:
FreeBSD 7.3-RELEASE
@@ -979,8 +992,8 @@ COMMON ITEMS:
<reboot in single user> [3]
mergemaster -p [5]
make installworld
make delete-old
mergemaster [4]
make delete-old [6]
<reboot>
@@ -1017,8 +1030,8 @@ COMMON ITEMS:
<reboot in single user> [3]
mergemaster -p [5]
make installworld
make delete-old
mergemaster -i [4]
make delete-old [6]
<reboot>
Make sure that you've read the UPDATING file to understand the
@@ -1060,6 +1073,10 @@ COMMON ITEMS:
install) after the buildworld before this step if you last updated
from current before 20020224 or from -stable before 20020408.
[6] This only deletes old files and directories. Old libraries
can be deleted by "make delete-old-libs", but you have to make
sure that no program is using those libraries anymore.
[8] In order to have a kernel that can run the 4.x binaries
needed to do an installworld, you must include the COMPAT_FREEBSD4
option in your kernel. Failure to do so may leave you with a system
@@ -1082,9 +1099,10 @@ COMMON ITEMS:
FORMAT:
This file contains a list, in reverse chronological order, of major
breakages in tracking -current. Not all things will be listed here,
and it only starts on October 16, 2004. Updating files can found in
previous releases if your system is older than this.
breakages in tracking -current. It is not guaranteed to be a complete
list of such breakages, and only contains entries since October 16, 2004.
If you need to see UPDATING entries from before that date, you will need
to fetch an UPDATING file from an older FreeBSD release.
Copyright information:
+1
View File
@@ -1072,6 +1072,7 @@ find_element(char *voltag, uint16_t *et, uint16_t *eu)
/* Read in the changer slots */
if (cp.cp_nslots > 0) {
(void) memset(&cesr, 0, sizeof(cesr));
cesr.cesr_element_type = CHET_ST;
cesr.cesr_element_base = 0;
cesr.cesr_element_count = cp.cp_nslots;
+7 -2
View File
@@ -32,7 +32,7 @@
.\" @(#)chmod.1 8.4 (Berkeley) 3/31/94
.\" $FreeBSD$
.\"
.Dd December 22, 2006
.Dd January 23, 2009
.Dt CHMOD 1
.Os
.Sh NAME
@@ -281,6 +281,10 @@ Operations upon the other permissions only (specified by the symbol
``o'' by itself), in combination with the
.Ar perm
symbols ``s'' or ``t'', are ignored.
.Pp
The ``w'' permission on directories will permit file creation, relocation,
and copy into that directory.
Files created within the directory itself will inherit its group ID.
.Sh EXAMPLES
.Bl -tag -width "u=rwx,go=u-w" -compact
.It Li 644
@@ -343,4 +347,5 @@ command appeared in
.Sh BUGS
There is no
.Ar perm
option for the naughty bits.
option for the naughty bits which are ``S'' and
``T'' respectively.
+5 -3
View File
@@ -32,7 +32,7 @@
.\" @(#)cp.1 8.3 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
.Dd October 27, 2006
.Dd January 17, 2010
.Dt CP 1
.Os
.Sh NAME
@@ -45,7 +45,7 @@
.Op Fl H | Fl L | Fl P
.Oc
.Op Fl f | i | n
.Op Fl alpv
.Op Fl alpvx
.Ar source_file target_file
.Nm
.Oo
@@ -53,7 +53,7 @@
.Op Fl H | Fl L | Fl P
.Oc
.Op Fl f | i | n
.Op Fl alpv
.Op Fl alpvx
.Ar source_file ... target_directory
.Sh DESCRIPTION
In the first synopsis form, the
@@ -183,6 +183,8 @@ permissions.
Cause
.Nm
to be verbose, showing files as they are copied.
.It Fl x
File system mount points are not traversed.
.El
.Pp
For each destination file that already exists, its contents are
+5 -2
View File
@@ -101,8 +101,9 @@ main(int argc, char *argv[])
int Hflag, Lflag, Pflag, ch, fts_options, r, have_trailing_slash;
char *target;
fts_options = FTS_NOCHDIR | FTS_PHYSICAL;
Hflag = Lflag = Pflag = 0;
while ((ch = getopt(argc, argv, "HLPRafilnprv")) != -1)
while ((ch = getopt(argc, argv, "HLPRafilnprvx")) != -1)
switch (ch) {
case 'H':
Hflag = 1;
@@ -150,6 +151,9 @@ main(int argc, char *argv[])
case 'v':
vflag = 1;
break;
case 'x':
fts_options |= FTS_XDEV;
break;
default:
usage();
break;
@@ -160,7 +164,6 @@ main(int argc, char *argv[])
if (argc < 2)
usage();
fts_options = FTS_NOCHDIR | FTS_PHYSICAL;
if (Rflag && rflag)
errx(1, "the -R and -r options may not be specified together");
if (rflag)
+2 -2
View File
@@ -429,8 +429,8 @@ usage(void)
{
(void)fprintf(stderr, "%s\n%s\n",
"usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpv] source_file target_file",
" cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpv] source_file ... "
"usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpvx] source_file target_file",
" cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpvx] source_file ... "
"target_directory");
exit(EX_USAGE);
}
+3 -3
View File
@@ -18,7 +18,7 @@ DFLAGS= -D_PATH_TCSHELL='"/rescue/${PROG}"'
DFLAGS= -D_PATH_TCSHELL='"/bin/${PROG}"'
.endif
CFLAGS+= -I. -I${.CURDIR} -I${TCSHDIR} ${DFLAGS}
WARNS?= 0
WARNS?= 1
SRCS= sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
@@ -107,10 +107,10 @@ gethost: gethost.c sh.err.h tc.const.h sh.h
@rm -f ${.TARGET}
${CC} -o gethost ${LDFLAGS} ${CFLAGS} ${TCSHDIR}/gethost.c
tc.defs.c: gethost ${.CURDIR}/host.defs
tc.defs.c: gethost ${TCSHDIR}/host.defs
@rm -f ${.TARGET}
@echo "/* Do not edit this file, make creates it */" > ${.TARGET}
./gethost ${.CURDIR}/host.defs >> ${.TARGET}
./gethost ${TCSHDIR}/host.defs >> ${.TARGET}
ed.defns.h: ed.defns.c
@rm -f ${.TARGET}
+57 -22
View File
@@ -1,5 +1,5 @@
/* $FreeBSD$ */
/* config.h. Generated by configure. */
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.in by autoheader. */
/* Define to the type of elements in the array set by `getgroups'. Usually
@@ -12,9 +12,6 @@
/* Define to 1 if you have the <auth.h> header file. */
/* #undef HAVE_AUTH_H */
/* Define to 1 if you have the `catgets' function. */
#define HAVE_CATGETS 1
/* Define to 1 if you have the <crypt.h> header file. */
/* #undef HAVE_CRYPT_H */
@@ -41,6 +38,9 @@
/* Define to 1 if you have the `dup2' function. */
#define HAVE_DUP2 1
/* Define to 1 if you have the <features.h> header file. */
/* #undef HAVE_FEATURES_H */
/* Define to 1 if you have the `getauthid' function. */
/* #undef HAVE_GETAUTHID */
@@ -56,7 +56,10 @@
/* Define to 1 if you have the `getutent' function. */
/* #undef HAVE_GETUTENT */
/* Define if you have the iconv() function. */
/* Define to 1 if you have the `getutxent' function. */
/* #undef HAVE_GETUTXENT */
/* Define if you have the iconv() function and it works. */
/* #undef HAVE_ICONV */
/* Define to 1 if you have the <inttypes.h> header file. */
@@ -65,6 +68,9 @@
/* Define to 1 if the system has the type `long long'. */
#define HAVE_LONG_LONG 1
/* Define to 1 if you have the `mallinfo' function. */
/* #undef HAVE_MALLINFO */
/* Define to 1 if mbrtowc and mbstate_t are properly declared. */
#define HAVE_MBRTOWC 1
@@ -77,6 +83,9 @@
/* Define to 1 if you have the `memset' function. */
#define HAVE_MEMSET 1
/* Define to 1 if you have the `mkstemp' function. */
#define HAVE_MKSTEMP 1
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
/* #undef HAVE_NDIR_H */
@@ -86,6 +95,9 @@
/* Define to 1 if you have the `nl_langinfo' function. */
#define HAVE_NL_LANGINFO 1
/* Define to 1 if you have the <paths.h> header file. */
#define HAVE_PATHS_H 1
/* Define to 1 if you have the `sbrk' function. */
#define HAVE_SBRK 1
@@ -120,22 +132,34 @@
/* Define to 1 if you have the `strstr' function. */
#define HAVE_STRSTR 1
/* Define to 1 if `d_ino' is member of `struct dirent'. */
/* Define to 1 if `d_ino' is a member of `struct dirent'. */
#define HAVE_STRUCT_DIRENT_D_INO 1
/* Define to 1 if `ss_family' is member of `struct sockaddr_storage'. */
/* Define to 1 if `ss_family' is a member of `struct sockaddr_storage'. */
#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
/* Define to 1 if `ut_host' is member of `struct utmp'. */
/* Define to 1 if `ut_host' is a member of `struct utmpx'. */
/* #undef HAVE_STRUCT_UTMPX_UT_HOST */
/* Define to 1 if `ut_tv' is a member of `struct utmpx'. */
/* #undef HAVE_STRUCT_UTMPX_UT_TV */
/* Define to 1 if `ut_user' is a member of `struct utmpx'. */
/* #undef HAVE_STRUCT_UTMPX_UT_USER */
/* Define to 1 if `ut_xtime' is a member of `struct utmpx'. */
/* #undef HAVE_STRUCT_UTMPX_UT_XTIME */
/* Define to 1 if `ut_host' is a member of `struct utmp'. */
#define HAVE_STRUCT_UTMP_UT_HOST 1
/* Define to 1 if `ut_tv' is member of `struct utmp'. */
/* Define to 1 if `ut_tv' is a member of `struct utmp'. */
/* #undef HAVE_STRUCT_UTMP_UT_TV */
/* Define to 1 if `ut_user' is member of `struct utmp'. */
/* Define to 1 if `ut_user' is a member of `struct utmp'. */
/* #undef HAVE_STRUCT_UTMP_UT_USER */
/* Define to 1 if `ut_xtime' is member of `struct utmp'. */
/* Define to 1 if `ut_xtime' is a member of `struct utmp'. */
/* #undef HAVE_STRUCT_UTMP_UT_XTIME */
/* Define to 1 if you have the `sysconf' function. */
@@ -179,25 +203,31 @@
/* Support NLS. */
#define NLS 1
/* Support NLS catalogs. */
#define NLS_CATALOGS 1
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
#define PACKAGE_BUGREPORT "http://bugs.gw.com/"
/* Define to the full name of this package. */
#define PACKAGE_NAME ""
#define PACKAGE_NAME "tcsh"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING ""
#define PACKAGE_STRING "tcsh 6.18.01"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME ""
#define PACKAGE_TARNAME "tcsh"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION ""
#define PACKAGE_VERSION "6.18.01"
/* Define to 1 if the `setpgrp' function takes no argument. */
/* #undef SETPGRP_VOID */
/* The size of a `wchar_t', as computed by sizeof. */
/* The size of `wchar_t', as computed by sizeof. */
#define SIZEOF_WCHAR_T 4
/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
@@ -206,6 +236,11 @@
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
/* #undef _UINT32_T */
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
@@ -215,7 +250,7 @@
/* Define to `int' if <sys/types.h> does not define. */
/* #undef mode_t */
/* Define to `unsigned' if <sys/types.h> does not define. */
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */
/* Define to `int' if neither <sys/types.h> nor <sys/socket.h> define. */
@@ -227,6 +262,10 @@
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef uid_t */
/* Define to the type of an unsigned integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
/* #undef uint32_t */
/* Define to empty if the keyword `volatile' does not work. Warning: valid
code using `volatile' can become incorrect without. Disable with care. */
/* #undef volatile */
@@ -234,9 +273,5 @@
#include "config_p.h"
#include "config_f.h"
#ifndef NO_NLS_CATALOGS
#define NLS_CATALOGS
#endif
/* Work around a vendor issue where config_f.h is #undef'ing this setting */
#define SYSMALLOC
-3
View File
@@ -105,9 +105,6 @@
#elif defined(__APPLE__)
# define SYSMALLOC
#else
# define NLS_CATALOGS
#endif
#endif /* _h_config */
-1140
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -124,7 +124,7 @@ main(int argc, char *argv[])
/* FALLTHROUGH */
case 'P':
/*
* POSIX specifically discusses the the behavior of
* POSIX specifically discusses the behavior of
* both -k and -P. It states that the blocksize should
* be set to 1024. Thus, if this occurs, simply break
* rather than clobbering the old blocksize.
+24 -11
View File
@@ -32,7 +32,7 @@
.\" @(#)echo.1 8.1 (Berkeley) 7/22/93
.\" $FreeBSD$
.\"
.Dd April 12, 2003
.Dd November 12, 2010
.Dt ECHO 1
.Os
.Sh NAME
@@ -56,24 +56,37 @@ The following option is available:
.Bl -tag -width flag
.It Fl n
Do not print the trailing newline character.
This may also be achieved by appending
.El
.Pp
The end-of-options marker
.Fl Fl
is not recognized and written literally.
.Pp
The newline may also be suppressed by appending
.Ql \ec
to the end of the string, as is done
by iBCS2 compatible systems.
Note that this option as well as the effect of
Note that the
.Fl n
option as well as the effect of
.Ql \ec
are implementation-defined in
.St -p1003.1-2001
as amended by Cor.\& 1-2002.
Applications aiming for maximum
portability are strongly encouraged to use
.Xr printf 1
to suppress the newline character.
.El
.Pp
Some shells may provide a builtin
For portability,
.Nm
command which is similar or identical to this utility.
should only be used if the first argument does not start with a hyphen
.Pq Ql "-"
and does not contain any backslashes
.Pq Ql "\e" .
If this is not sufficient,
.Xr printf 1
should be used.
.Pp
Most shells provide a builtin
.Nm
command which tends to differ from this utility
in the treatment of options and backslashes.
Consult the
.Xr builtin 1
manual page.
+3
View File
@@ -94,6 +94,7 @@ put_sbuf_line(const char *cs)
;
if (s - cs >= LINECHARS) {
errmsg = "line too long";
free(lp);
return NULL;
}
len = s - cs;
@@ -102,6 +103,7 @@ put_sbuf_line(const char *cs)
if (fseeko(sfp, (off_t)0, SEEK_END) < 0) {
fprintf(stderr, "%s\n", strerror(errno));
errmsg = "cannot seek temp file";
free(lp);
return NULL;
}
sfseek = ftello(sfp);
@@ -112,6 +114,7 @@ put_sbuf_line(const char *cs)
sfseek = -1;
fprintf(stderr, "%s\n", strerror(errno));
errmsg = "cannot write temp file";
free(lp);
return NULL;
}
lp->len = len;
+2 -2
View File
@@ -231,7 +231,7 @@ The current line (address) in the buffer.
The last line in the buffer.
.It n
The
.Em n Ns th,
.Em n Ns th
line in the buffer
where
.Em n
@@ -649,7 +649,7 @@ The mark is not cleared until the line is
deleted or otherwise modified.
.It (.,.)l
Print the addressed lines unambiguously.
If a single line fills for than one screen (as might be the case
If a single line fills more than one screen (as might be the case
when viewing a binary file, for instance), a
.Dq Li --More--
prompt is printed on the last line.
+21 -10
View File
@@ -30,7 +30,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd July 12, 2004
.Dd September 9, 2010
.Dt EXPR 1
.Os
.Sh NAME
@@ -217,6 +217,9 @@ command, one might rearrange the expression:
More generally, parenthesize possibly-negative values:
.Dl "a=$(expr \e( $a \e) + 1)"
.It
With shell arithmetic, no escaping is required:
.Dl "a=$((a + 1))"
.It
This example prints the filename portion of a pathname stored
in variable
.Va a .
@@ -229,6 +232,12 @@ The
.Li //
characters resolve this ambiguity.
.Dl "expr \*q//$a\*q \&: '.*/\e(.*\e)'"
.It
With modern
.Xr sh 1
syntax,
.Dl "\*q${a##*/}\*q"
expands to the same value.
.El
.Pp
The following examples output the number of characters in variable
@@ -237,19 +246,21 @@ Again, if
.Va a
might begin with a hyphen, it is necessary to prevent it from being
interpreted as an option to
.Nm .
.Nm ,
and
.Va a
might be interpreted as an operator.
.Bl -bullet
.It
If the
.Nm
command conforms to
.St -p1003.1-2001 ,
this is simple:
.Dl "expr -- \*q$a\*q \&: \*q.*\*q"
.It
For portability to older systems, however, a more complicated command
To deal with all of this, a complicated command
is required:
.Dl "expr \e( \*qX$a\*q \&: \*q.*\*q \e) - 1"
.It
With modern
.Xr sh 1
syntax, this can be done much more easily:
.Dl "${#a}"
expands to the required number.
.El
.Sh SEE ALSO
.Xr sh 1 ,
+1 -1
View File
@@ -108,7 +108,7 @@ main(int argc, char *argv[])
numsig = strtol(*argv, &ep, 10);
if (!**argv || *ep)
errx(1, "illegal signal number: %s", *argv);
if (numsig < 0 || numsig >= sys_nsig)
if (numsig < 0)
nosig(*argv);
} else
nosig(*argv);
+3 -3
View File
@@ -29,7 +29,7 @@
.\" @(#)symlink.7 8.3 (Berkeley) 3/31/94
.\" $FreeBSD$
.\"
.Dd March 31, 1994
.Dd April 25, 2010
.Dt SYMLINK 7
.Os
.Sh NAME
@@ -138,8 +138,8 @@ an existing symbolic link can be changed by means of the
and
.Xr lutimes 2
system calls, respectively.
Of these, only the flags are used by the system;
the access permissions and ownership are ignored.
Of these, only the flags and ownership are used by the system;
the access permissions are ignored.
.Pp
The
.Bx 4.4
+1 -1
View File
@@ -504,7 +504,7 @@ traverse(int argc, char *argv[], int options)
break;
case FTS_DNR:
case FTS_ERR:
warnx("%s: %s", p->fts_name, strerror(p->fts_errno));
warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
rval = 1;
break;
case FTS_D:
+1 -1
View File
@@ -183,7 +183,7 @@ do_move(char *from, char *to)
} else if (iflg) {
(void)fprintf(stderr, "overwrite %s? %s", to, YESNO);
ask = 1;
} else if (access(to, W_OK) && !stat(to, &sb)) {
} else if (access(to, W_OK) && !stat(to, &sb) && isatty(STDIN_FILENO)) {
strmode(sb.st_mode, modep);
(void)fprintf(stderr, "override %s%s%s/%s for %s? %s",
modep + 1, modep[9] == ' ' ? "" : " ",
-3
View File
@@ -29,9 +29,6 @@ PROG= pax
SRCS= ar_io.c ar_subs.c buf_subs.c cache.c cpio.c file_subs.c ftree.c \
gen_subs.c getoldopt.c options.c pat_rep.c pax.c sel_subs.c \
tables.c tar.c tty_subs.c
#XXX NOTYET
#MAN= pax.1 tar.1 cpio.1
#LINKS= ${BINDIR}/pax ${BINDIR}/tar ${BINDIR}/pax ${BINDIR}/cpio
.if ${MACHINE_ARCH} == "arm"
WARNS?= 3
-304
View File
@@ -1,304 +0,0 @@
.\"-
.\" Copyright (c) 1997 SigmaSoft, Th. Lockert
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by SigmaSoft, Th. Lockert.
.\" 4. The name of the author may not be used to endorse or promote products
.\" derived from this software without specific prior written permission
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $OpenBSD: cpio.1,v 1.16 2001/05/01 17:58:01 aaron Exp $
.\" $FreeBSD$
.\"
.Dd February 16, 1997
.Dt CPIO 1
.Os
.Sh NAME
.Nm cpio
.Nd copy file archives in and out
.Sh SYNOPSIS
.Nm
.Fl o
.Op Fl aABcLvzZ
.Op Fl C Ar bytes
.Op Fl F Ar archive
.Op Fl H Ar format
.Op Fl O Ar archive
.No < Ar name-list
.Op No > Ar archive
.Nm
.Fl i
.Op Fl bBcdfmrsStuvzZ6
.Op Fl C Ar bytes
.Op Fl E Ar file
.Op Fl F Ar archive
.Op Fl H Ar format
.Op Fl I Ar archive
.Op Ar pattern ...
.Op No < Ar archive
.Nm
.Fl p
.Op Fl adlLmuv
.Ar destination-directory
.No < Ar name-list
.Sh DESCRIPTION
The
.Nm
command copies files to and from a
.Nm
archive.
.Pp
The options are as follows:
.Bl -tag -width indent
.It Fl o
Create an archive.
Reads the list of files to store in the
archive from standard input, and writes the archive on standard
output.
.Bl -tag -width indent
.It Fl a
Reset the access times on files that have been copied to the
archive.
.It Fl A
Append to the specified archive.
.It Fl B
Set block size of output to 5120 bytes.
.It Fl c
Use
.Tn ASCII
format for
.Nm
header for portability.
.It Fl C Ar bytes
Set the block size of output to
.Ar bytes .
.It Fl F Ar archive
.It Fl O Ar archive
Use the specified file name as the archive to write to.
.It Fl H Ar format
Write the archive in the specified format.
Recognized formats are:
.Pp
.Bl -tag -width sv4cpio -compact
.It Cm bcpio
Old binary
.Nm
format.
.It Cm cpio
Old octal character
.Nm
format.
.It Cm sv4cpio
.Tn SVR4
hex
.Nm
format.
.It Cm tar
Old tar format.
.It Cm ustar
.Tn POSIX
ustar format.
.El
.It Fl L
Follow symbolic links.
.It Fl v
Be verbose about operations.
List filenames as they are written to the archive.
.It Fl z
Compress archive using
.Xr gzip 1
format.
.It Fl Z
Compress archive using
.Xr compress 1
format.
.El
.It Fl i
Restore files from an archive.
Reads the archive file from
standard input and extracts files matching the
.Ar patterns
that were specified on the command line.
.Bl -tag -width indent
.It Fl b
Do byte and word swapping after reading in data from the
archive, for restoring archives created on systems with
a different byte order.
.It Fl B
Set the block size of the archive being read to 5120 bytes.
.It Fl c
Expect the archive headers to be in
.Tn ASCII
format.
.It Fl C Ar bytes
Read archive written with a block size of
.Ar bytes .
.It Fl d
Create any intermediate directories as needed during
restore.
.It Fl E Ar file
Read list of file name patterns to extract or list from
.Ar file .
.It Fl f
Restore all files except those matching the
.Ar patterns
given on the command line.
.It Fl F Ar archive , Fl I Ar archive
Use the specified file as the input for the archive.
.It Fl H Ar format
Read an archive of the specified format.
Recognized formats are:
.Pp
.Bl -tag -width sv4cpio -compact
.It Cm bcpio
Old binary
.Nm
format.
.It Cm cpio
Old octal character
.Nm
format.
.It Cm sv4cpio
.Tn SVR4
hex
.Nm
format.
.It Cm tar
Old tar format.
.It Cm ustar
.Tn POSIX
ustar format.
.El
.It Fl m
Restore modification times on files.
.It Fl r
Rename restored files interactively.
.It Fl s
Swap bytes after reading data from the archive.
.It Fl S
Swap words after reading data from the archive.
.It Fl t
Only list the contents of the archive, no files or
directories will be created.
.It Fl u
Overwrite files even when the file in the archive is
older than the one that will be overwritten.
.It Fl v
Be verbose about operations.
List filenames as they are copied in from the archive.
.It Fl z
Uncompress archive using
.Xr gzip 1
format.
.It Fl Z
Uncompress archive using
.Xr compress 1
format.
.It Fl 6
Process old-style
.Nm
format archives.
.El
.It Fl p
Copy files from one location to another in a single pass.
The list of files to copy are read from standard input and
written out to a directory relative to the specified
.Ar directory
argument.
.Bl -tag -width indent
.It Fl a
Reset the access times on files that have been copied.
.It Fl d
Create any intermediate directories as needed to write
the files at the new location.
.It Fl l
When possible, link files rather than creating an
extra copy.
.It Fl L
Follow symbolic links.
.It Fl m
Restore modification times on files.
.It Fl u
Overwrite files even when the original file being copied is
older than the one that will be overwritten.
.It Fl v
Be verbose about operations.
List filenames as they are copied.
.El
.El
.Sh ENVIRONMENT
.Bl -tag -width TMPDIR
.It Ev TMPDIR
Path in which to store temporary files.
.El
.Sh EXIT STATUS
The
.Nm
utility will exit with one of the following values:
.Bl -tag -width 2n
.It 0
All files were processed successfully.
.It 1
An error occurred.
.El
.Pp
Whenever
.Nm
cannot create a file or a link when extracting an archive or cannot
find a file while writing an archive, or cannot preserve the user
ID, group ID, file mode, or access and modification times when the
.Fl p
option is specified, a diagnostic message is written to standard
error and a non-zero exit value will be returned, but processing
will continue.
In the case where
.Nm
cannot create a link to a file,
.Nm
will not create a second copy of the file.
.Pp
If the extraction of a file from an archive is prematurely terminated
by a signal or error,
.Nm
may have only partially extracted the file the user wanted.
Additionally, the file modes of extracted files and directories may
have incorrect file bits, and the modification and access times may
be wrong.
.Pp
If the creation of an archive is prematurely terminated by a signal
or error,
.Nm
may have only partially created the archive which may violate the
specific archive format specification.
.Sh SEE ALSO
.Xr pax 1 ,
.Xr tar 1
.Sh AUTHORS
.An Keith Muller
at the University of California, San Diego.
.Sh BUGS
The
.Fl s
and
.Fl S
options are currently not implemented.
+4 -2
View File
@@ -33,7 +33,7 @@
.\" @(#)pax.1 8.4 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
.Dd July 3, 2004
.Dd August 29, 2010
.Dt PAX 1
.Os
.Sh NAME
@@ -748,7 +748,9 @@ The extended tar interchange format specified in the
.St -p1003.2
standard.
The default blocksize for this format is 10240 bytes.
Pathnames stored by this format must be 250 characters or less in length.
Pathnames stored by this format must be 255 characters or less in length.
The directory part may be at most 155 characters and each path component
must be less than 100 characters.
.El
.Pp
The
-310
View File
@@ -1,310 +0,0 @@
.\"-
.\" Copyright (c) 1996 SigmaSoft, Th. Lockert
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by SigmaSoft, Th. Lockert.
.\" 4. The name of the author may not be used to endorse or promote products
.\" derived from this software without specific prior written permission
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $OpenBSD: tar.1,v 1.33 2001/05/01 17:58:01 aaron Exp $
.\" $FreeBSD$
.\"
.Dd February 7, 2001
.Dt TAR 1
.Os
.Sh NAME
.Nm tar
.Nd tape archiver
.Sh SYNOPSIS
.Nm
.Sm off
.Op Fl
.Brq Cm crtux
.Op Cm befhjmopqsvwyzHLOPXZ014578
.Sm on
.Op Ar blocksize
.Op Ar archive
.Op Ar replstr
.\" XXX how to do this right?
.Op Fl C Ar directory
.Op Fl I Ar file
.Op Ar
.Sh DESCRIPTION
The
.Nm
command creates, adds files to, or extracts files from an
archive file in
.Nm
format.
A
.Nm
archive is often stored on a magnetic tape, but can be
stored equally well on a floppy, CD-ROM, or in a regular disk file.
.Pp
One of the following flags must be present:
.Bl -tag -width indent
.It Fl c
Create new archive, or overwrite an existing archive,
adding the specified files to it.
.It Fl r
Append the named new files to existing archive.
Note that this will only work on media on which an end-of-file mark
can be overwritten.
.It Fl t
List contents of archive.
If any files are named on the
command line, only those files will be listed.
.It Fl u
Alias for
.Fl r .
.It Fl x
Extract files from archive.
If any files are named on the
command line, only those files will be extracted from the
archive.
If more than one copy of a file exists in the
archive, later copies will overwrite earlier copies during
extraction.
The file mode and modification time are preserved
if possible.
The file mode is subject to modification by the
.Xr umask 2 .
.El
.Pp
In addition to the flags mentioned above, any of the following
flags may be used:
.Bl -tag -width indent
.It Fl b Ar "blocking factor"
Set blocking factor to use for the archive, with 512 byte blocks.
The default is 20, the maximum is 126.
Archives with a blocking factor larger 63 violate the
.Tn POSIX
standard and will not be portable to all systems.
.It Fl e
Stop after first error.
.It Fl f Ar archive
Filename where the archive is stored.
Defaults to
.Pa /dev/sa0 .
.It Fl h
Follow symbolic links as if they were normal files
or directories.
.It Fl j
Compress archives using
.Xr bzip2 1 .
.It Fl m
Do not preserve modification time.
.It Fl O
Write old-style
.Pq non- Ns Tn POSIX
archives.
.It Fl o
Do not write directory information that the older (V7) style
.Nm
is unable to decode.
This implies the
.Fl O
flag.
.It Fl p
Preserve user and group ID as well as file mode regardless of
the current
.Xr umask 2 .
The setuid and setgid bits are only preserved if the user is
the superuser.
Only meaningful in conjunction with the
.Fl x
flag.
.It Fl q
Select the first archive member that matches each
.Ar pattern
operand.
No more than one archive member is matched for each
.Ar pattern .
When members of type directory are matched, the file hierarchy rooted at that
directory is also matched.
.It Fl s Ar replstr
Modify the file or archive member names specified by the
.Ar pattern
or
.Ar file
operands according to the substitution expression
.Ar replstr ,
using the syntax of the
.Xr ed 1
utility regular expressions.
The format of these regular expressions are:
.Dl /old/new/[gp]
As in
.Xr ed 1 ,
.Cm old
is a basic regular expression and
.Cm new
can contain an ampersand
.Pq Ql & ,
.Li \e Ns Ar n
(where
.Ar n
is a digit) back-references,
or subexpression matching.
The
.Cm old
string may also contain newline characters.
Any non-null character can be used as a delimiter
.Ql ( /
is shown here).
Multiple
.Fl s
expressions can be specified.
The expressions are applied in the order they are specified on the
command line, terminating with the first successful substitution.
The optional trailing
.Cm g
continues to apply the substitution expression to the pathname substring
which starts with the first character following the end of the last successful
substitution.
The first unsuccessful substitution stops the operation of the
.Cm g
option.
The optional trailing
.Cm p
will cause the final result of a successful substitution to be written to
standard error
in the following format:
.Pp
.Dl <original pathname> >> <new pathname>
.Pp
File or archive member names that substitute to the empty string
are not selected and will be skipped.
.It Fl v
Verbose operation mode.
.It Fl w
Interactively rename files.
This option causes
.Nm
to prompt the user for the filename to use when storing or
extracting files in an archive.
.It Fl y
Compress archives using
.Xr bzip2 1 .
.It Fl z
Compress archive using
.Xr gzip 1 .
.It Fl C Ar directory
This is a positional argument which sets the working directory for the
following files.
When extracting, files will be extracted into
the specified directory; when creating, the specified files will be matched
from the directory.
.It Fl H
Follow symlinks given on command line only.
.It Fl L
Follow all symlinks.
.It Fl P
Do not strip leading slashes
.Pq Ql /
from pathnames.
The default is to strip leading slashes.
.It Fl I Ar file
This is a positional argument which reads the names of files to
archive or extract from the given file, one per line.
.It Fl X
Do not cross mount points in the file system.
.It Fl Z
Compress archive using
.Xr compress 1 .
.El
.Pp
The options
.Op Fl 014578
can be used to select one of the compiled-in backup devices,
.Pa /dev/rst Ns Ar N .
.Sh ENVIRONMENT
.Bl -tag -width TMPDIR
.It Ev TMPDIR
Path in which to store temporary files.
.It Ev TAPE
Default tape device to use instead of
.Pa /dev/sa0 .
.El
.Sh FILES
.Bl -tag -width "/dev/sa0"
.It Pa /dev/sa0
default archive name
.El
.Sh EXIT STATUS
The
.Nm
utility will exit with one of the following values:
.Bl -tag -width 2n
.It 0
All files were processed successfully.
.It 1
An error occurred.
.El
.Pp
Whenever
.Nm
cannot create a file or a link when extracting an archive or cannot
find a file while writing an archive, or cannot preserve the user
ID, group ID, file mode, or access and modification times when the
.Fl p
option is specified, a diagnostic message is written to standard
error and a non-zero exit value will be returned, but processing
will continue.
In the case where
.Nm
cannot create a link to a file,
.Nm
will not create a second copy of the file.
.Pp
If the extraction of a file from an archive is prematurely terminated
by a signal or error,
.Nm
may have only partially extracted the file the user wanted.
Additionally, the file modes of extracted files and directories may
have incorrect file bits, and the modification and access times may
be wrong.
.Pp
If the creation of an archive is prematurely terminated by a signal
or error,
.Nm
may have only partially created the archive which may violate the
specific archive format specification.
.Sh COMPATIBILITY
The
.Fl L
flag is not portable to other versions of
.Nm
where it may have a different meaning.
.Sh SEE ALSO
.Xr cpio 1 ,
.Xr pax 1
.Sh HISTORY
A
.Nm
command first appeared in
.At v7 .
.Sh AUTHORS
.An Keith Muller
at the University of California, San Diego.
+2 -2
View File
@@ -1086,7 +1086,7 @@ name_split(char *name, int len)
*/
if (len <= TNMSZ)
return(name);
if (len > (TPFSZ + TNMSZ + 1))
if (len > TPFSZ + TNMSZ)
return(NULL);
/*
@@ -1095,7 +1095,7 @@ name_split(char *name, int len)
* to find the biggest piece to fit in the name field (or the smallest
* prefix we can find)
*/
start = name + len - TNMSZ - 1;
start = name + len - TNMSZ;
while ((*start != '\0') && (*start != '/'))
++start;
+18 -11
View File
@@ -29,7 +29,7 @@
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
.Dd May 16, 2009
.Dd October 1, 2011
.Dt PS 1
.Os
.Sh NAME
@@ -54,6 +54,11 @@ utility
displays a header line, followed by lines containing information about
all of your
processes that have controlling terminals.
If the
.Fl x
options is specified,
.Nm
will also display processes that do not have controlling terminals.
.Pp
A different set of processes can be selected for display by using any
combination of the
@@ -90,8 +95,8 @@ and
.Fl o
options).
The default output format includes, for each process, the process' ID,
controlling terminal, CPU time (including both user and system time),
state, and associated command.
controlling terminal, state, CPU time (including both user and system time)
and associated command.
.Pp
The process file system (see
.Xr procfs 5 )
@@ -103,13 +108,9 @@ The options are as follows:
.Bl -tag -width indent
.It Fl a
Display information about other users' processes as well as your own.
This will skip any processes which do not have a controlling terminal,
unless the
.Fl x
option is also specified.
This can be disabled by setting the
If the
.Va security.bsd.see_other_uids
sysctl to zero.
sysctl is set to zero, this option is honored only if the UID of the user is 0.
.It Fl c
Change the
.Dq command
@@ -213,6 +214,9 @@ with the standard input.
.It Fl t
Display information about processes attached to the specified terminal
devices.
Full pathnames, as well as abbreviations (see explanation of the
.Cm tt
keyword) can be specified.
.It Fl U
Display the processes belonging to the specified usernames.
.It Fl u
@@ -411,12 +415,15 @@ The process is being traced or debugged.
An abbreviation for the pathname of the controlling terminal, if any.
The abbreviation consists of the three letters following
.Pa /dev/tty ,
or, for the console,
.Dq Li con .
or, for pseudo-terminals, the corresponding entry in
.Pa /dev/pts .
This is followed by a
.Ql -
if the process can no longer reach that
controlling terminal (i.e., it has been revoked).
The full pathname of the controlling terminal is available via the
.Cm tty
keyword.
.It Cm wchan
The event (an address in the system) on which a process waits.
When printed numerically, the initial part of the address is
+2 -1
View File
@@ -212,7 +212,8 @@ main(int argc, char *argv[])
init_list(&sesslist, addelem_pid, sizeof(pid_t), "session id");
init_list(&ttylist, addelem_tty, sizeof(dev_t), "tty");
init_list(&uidlist, addelem_uid, sizeof(uid_t), "user");
memf = nlistf = _PATH_DEVNULL;
memf = _PATH_DEVNULL;
nlistf = NULL;
while ((ch = getopt(argc, argv, PS_ARGS)) != -1)
switch ((char)ch) {
case 'A':
+17 -4
View File
@@ -288,10 +288,16 @@ rm_tree(char **argv)
if (fflag)
continue;
/* FALLTHROUGH */
default:
case FTS_F:
case FTS_NSOK:
if (Pflag)
if (!rm_overwrite(p->fts_accpath, NULL))
if (!rm_overwrite(p->fts_accpath, p->fts_info ==
FTS_NSOK ? NULL : p->fts_statp))
continue;
/* FALLTHROUGH */
default:
rval = unlink(p->fts_accpath);
if (rval == 0 || (fflag && errno == ENOENT)) {
if (rval == 0 && vflag)
@@ -386,7 +392,7 @@ rm_file(char **argv)
int
rm_overwrite(char *file, struct stat *sbp)
{
struct stat sb;
struct stat sb, sb2;
struct statfs fsb;
off_t len;
int bsize, fd, wlen;
@@ -405,8 +411,15 @@ rm_overwrite(char *file, struct stat *sbp)
file, sbp->st_ino);
return (0);
}
if ((fd = open(file, O_WRONLY, 0)) == -1)
if ((fd = open(file, O_WRONLY|O_NONBLOCK|O_NOFOLLOW, 0)) == -1)
goto err;
if (fstat(fd, &sb2))
goto err;
if (sb2.st_dev != sbp->st_dev || sb2.st_ino != sbp->st_ino ||
!S_ISREG(sb2.st_mode)) {
errno = EPERM;
goto err;
}
if (fstatfs(fd, &fsb) == -1)
goto err;
bsize = MAX(fsb.f_iosize, 1024);
+5 -2
View File
@@ -21,12 +21,12 @@ LDADD= -ll -ledit -ltermcap
LFLAGS= -8 # 8-bit lex scanner for arithmetic
CFLAGS+=-DSHELL -I. -I${.CURDIR}
# for debug:
# CFLAGS+= -g -DDEBUG=2
# DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline
WARNS?= 2
WFORMAT=0
.PATH: ${.CURDIR}/bltin \
${.CURDIR}/../../bin/test
${.CURDIR}/../test
CLEANFILES+= mkinit mkinit.o mknodes mknodes.o \
mksyntax mksyntax.o
@@ -62,4 +62,7 @@ syntax.c syntax.h: mksyntax
token.h: mktokens
sh ${.CURDIR}/mktokens
regress:
cd ${.CURDIR}/../../tools/regression/bin/sh && ${MAKE} SH=${.OBJDIR}/sh
.include <bsd.prog.mk>
-114
View File
@@ -1,114 +0,0 @@
.\"-
.\" Copyright (c) 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" Kenneth Almquist.
.\" Copyright 1989 by Kenneth Almquist
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)echo.1 8.2 (Berkeley) 5/4/95
.\" $FreeBSD$
.\"
.Dd May 4, 1995
.Dt ECHO 1
.Os
.Sh NAME
.Nm echo
.Nd produce message in a shell script
.Sh SYNOPSIS
.Nm
.Op Fl n | Fl e
.Ar args...
.Sh DESCRIPTION
The
.Nm
utility prints its arguments on the standard output, separated by spaces.
Unless the
.Fl n
option is present, a newline is output following the arguments.
The
.Fl e
option causes
.Nm
to treat the escape sequences specially, as described in the following
paragraph.
The
.Fl e
option is the default, and is provided solely for compatibility with
other systems.
Only one of the options
.Fl n
and
.Fl e
may be given.
.Pp
If any of the following sequences of characters is encountered during
output, the sequence is not output.
Instead, the specified action is
performed:
.Bl -tag -width indent
.It Li \eb
A backspace character is output.
.It Li \ec
Subsequent output is suppressed.
This is normally used at the end of the
last argument to suppress the trailing newline that
.Nm
would otherwise output.
.It Li \ef
Output a form feed.
.It Li \en
Output a newline character.
.It Li \er
Output a carriage return.
.It Li \et
Output a (horizontal) tab character.
.It Li \ev
Output a vertical tab.
.It Li \e0 Ns Ar digits
Output the character whose value is given by zero to three digits.
If there are zero digits, a
.Dv NUL
character is output.
.It Li \e\e
Output a backslash.
.El
.Sh HINTS
Remember that backslash is special to the shell and needs to be escaped.
To output a message to standard error, say
.Pp
.D1 echo message >&2
.Sh BUGS
The octal character escape mechanism
.Pq Li \e0 Ns Ar digits
differs from the
C language mechanism.
.Pp
There is no way to force
.Nm
to treat its arguments literally, rather than interpreting them as
options and escape sequences.
+28 -21
View File
@@ -70,7 +70,7 @@ STATIC int docd(char *, int, int);
STATIC char *getcomponent(void);
STATIC char *findcwd(char *);
STATIC void updatepwd(char *);
STATIC char *getpwd2(char *, size_t);
STATIC char *getpwd2(void);
STATIC char *curdir = NULL; /* current working directory */
STATIC char *prevdir; /* previous working directory */
@@ -263,10 +263,8 @@ findcwd(char *dir)
* any more because we traversed a symbolic link or something
* we couldn't stat().
*/
if (dir == NULL || curdir == NULL) {
p = stalloc(PATH_MAX);
return getpwd2(p, PATH_MAX);
}
if (dir == NULL || curdir == NULL)
return getpwd2();
cdcomppath = stalloc(strlen(dir) + 1);
scopy(dir, cdcomppath);
STARTSTACKSTR(new);
@@ -313,7 +311,7 @@ updatepwd(char *dir)
int
pwdcmd(int argc, char **argv)
{
char buf[PATH_MAX];
char *p;
int ch, phys;
optreset = 1; optind = 1; opterr = 0; /* initialize getopt */
@@ -341,9 +339,9 @@ pwdcmd(int argc, char **argv)
out1str(curdir);
out1c('\n');
} else {
if (getcwd(buf, sizeof(buf)) == NULL)
if ((p = getpwd2()) == NULL)
error(".: %s", strerror(errno));
out1str(buf);
out1str(p);
out1c('\n');
}
@@ -356,36 +354,45 @@ pwdcmd(int argc, char **argv)
char *
getpwd(void)
{
char buf[PATH_MAX];
char *p;
if (curdir)
return curdir;
p = getpwd2(buf, sizeof(buf));
p = getpwd2();
if (p != NULL)
curdir = savestr(p);
return curdir;
}
#define MAXPWD 256
/*
* Return the current directory.
*/
STATIC char *
getpwd2(char *buf, size_t size)
getpwd2(void)
{
if (getcwd(buf, size) == NULL) {
char *pwd = getenv("PWD");
struct stat stdot, stpwd;
struct stat stdot, stpwd;
char *pwd;
int i;
if (pwd && *pwd == '/' && stat(".", &stdot) != -1 &&
stat(pwd, &stpwd) != -1 &&
stdot.st_dev == stpwd.st_dev &&
stdot.st_ino == stpwd.st_ino) {
for (i = MAXPWD;; i *= 2) {
pwd = stalloc(i);
if (getcwd(pwd, i) != NULL)
return pwd;
}
return NULL;
stunalloc(pwd);
if (errno != ERANGE)
break;
}
return buf;
pwd = getenv("PWD");
if (pwd && *pwd == '/' && stat(".", &stdot) != -1 &&
stat(pwd, &stpwd) != -1 &&
stdot.st_dev == stpwd.st_dev &&
stdot.st_ino == stpwd.st_ino) {
return pwd;
}
return NULL;
}
+6 -3
View File
@@ -83,6 +83,7 @@ MKINIT int evalskip; /* set if we are skipping commands */
STATIC int skipcount; /* number of levels to skip */
MKINIT int loopnest; /* current loop nesting level */
int funcnest; /* depth of function calls */
STATIC int builtin_flags; /* evalcommand flags for builtins */
char *commandname;
@@ -147,7 +148,7 @@ evalcmd(int argc, char **argv)
STPUTC('\0', concat);
p = grabstackstr(concat);
}
evalstring(p);
evalstring(p, builtin_flags & EV_TESTED);
}
return exitstatus;
}
@@ -158,7 +159,7 @@ evalcmd(int argc, char **argv)
*/
void
evalstring(char *s)
evalstring(char *s, int flags)
{
union node *n;
struct stackmark smark;
@@ -166,7 +167,8 @@ evalstring(char *s)
setstackmark(&smark);
setinputstring(s, 1);
while ((n = parsecmd(0)) != NEOF) {
evaltree(n, 0);
if (n != NULL)
evaltree(n, flags);
popstackmark(&smark);
}
popfile();
@@ -840,6 +842,7 @@ evalcommand(union node *cmd, int flags, struct backcmd *backcmd)
commandname = argv[0];
argptr = argv + 1;
optptr = NULL; /* initialize nextopt */
builtin_flags = flags;
exitstatus = (*builtinfunc[cmdentry.u.index])(argc, argv);
flushall();
cmddone:
+1 -1
View File
@@ -46,7 +46,7 @@ struct backcmd { /* result of evalbackcmd */
};
int evalcmd(int, char **);
void evalstring(char *);
void evalstring(char *, int);
union node; /* BLETCH for ansi C */
void evaltree(union node *, int);
void evalbackcmd(union node *, struct backcmd *);
+66 -45
View File
@@ -1,6 +1,8 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
* Copyright (c) 1997-2005
* Herbert Xu <herbert@gondor.apana.org.au>. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Kenneth Almquist.
@@ -137,12 +139,18 @@ expandhere(union node *arg, int fd)
/*
* Perform variable substitution and command substitution on an argument,
* placing the resulting list of arguments in arglist. If EXP_FULL is true,
* perform splitting and file name expansion. When arglist is NULL, perform
* here document expansion.
* Perform expansions on an argument, placing the resulting list of arguments
* in arglist. Parameter expansion, command substitution and arithmetic
* expansion are always performed; additional expansions can be requested
* via flag (EXP_*).
* The result is left in the stack string.
* When arglist is NULL, perform here document expansion. A partial result
* may be written to herefd, which is then not included in the stack string.
*
* Caution: this function uses global state and is not reentrant.
* However, a new invocation after an interrupted invocation is safe
* and will reset the global state for the new call.
*/
void
expandarg(union node *arg, struct arglist *arglist, int flag)
{
@@ -194,11 +202,14 @@ expandarg(union node *arg, struct arglist *arglist, int flag)
/*
* Perform variable and command substitution. If EXP_FULL is set, output CTLESC
* characters to allow for further processing. Otherwise treat
* $@ like $* since no splitting will be performed.
* Perform parameter expansion, command substitution and arithmetic
* expansion, and tilde expansion if requested via EXP_TILDE/EXP_VARTILDE.
* Processing ends at a CTLENDVAR character as well as '\0'.
* This is used to expand word in ${var+word} etc.
* If EXP_FULL, EXP_CASE or EXP_REDIR are set, keep and/or generate CTLESC
* characters to allow for further processing.
* If EXP_FULL is set, also preserve CTLQUOTEMARK characters.
*/
STATIC void
argstr(char *p, int flag)
{
@@ -211,7 +222,7 @@ argstr(char *p, int flag)
for (;;) {
switch (c = *p++) {
case '\0':
case CTLENDVAR: /* ??? */
case CTLENDVAR:
goto breakloop;
case CTLQUOTEMARK:
/* "$@" syntax adherence hack */
@@ -261,6 +272,10 @@ argstr(char *p, int flag)
breakloop:;
}
/*
* Perform tilde expansion, placing the result in the stack string and
* returning the next position in the input string to process.
*/
STATIC char *
exptilde(char *p, int flag)
{
@@ -361,12 +376,11 @@ expari(int flag)
int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR);
int quoted;
/*
* This routine is slightly over-complicated for
* efficiency. First we make sure there is
* enough space for the result, which may be bigger
* than the expression if we add exponentiation. Next we
* than the expression. Next we
* scan backwards looking for the start of arithmetic. If the
* next previous character is a CTLESC character, then we
* have to rescan starting from the beginning since CTLESC
@@ -405,9 +419,8 @@ expari(int flag)
/*
* Expand stuff in backwards quotes.
* Perform command substitution.
*/
STATIC void
expbackq(union node *cmd, int quoted, int flag)
{
@@ -931,7 +944,7 @@ numvar:
/*
* Record the the fact that we have to scan this region of the
* Record the fact that we have to scan this region of the
* string for IFS characters.
*/
@@ -959,6 +972,12 @@ recordregion(int start, int end, int nulonly)
* Break the argument string into pieces based upon IFS and add the
* strings to the argument list. The regions of the string to be
* searched for IFS characters have been stored by recordregion.
* CTLESC characters are preserved but have little effect in this pass
* other than escaping CTL* characters. In particular, they do not escape
* IFS characters: that should be done with the ifsregion mechanism.
* CTLQUOTEMARK characters are used to preserve empty quoted strings.
* This pass treats them as a regular character, making the string non-empty.
* Later, they are removed along with the other CTL* characters.
*/
STATIC void
ifsbreakup(char *string, struct arglist *arglist)
@@ -1046,15 +1065,14 @@ ifsbreakup(char *string, struct arglist *arglist)
}
STATIC char expdir[PATH_MAX];
#define expdir_end (expdir + sizeof(expdir))
/*
* Expand shell metacharacters. At this point, the only control characters
* should be escapes. The results are stored in the list exparg.
* Perform pathname generation and remove control characters.
* At this point, the only control characters should be CTLESC and CTLQUOTEMARK.
* The results are stored in the list exparg.
*/
STATIC char *expdir;
STATIC void
expandmeta(struct strlist *str, int flag __unused)
{
@@ -1076,14 +1094,7 @@ expandmeta(struct strlist *str, int flag __unused)
}
savelastp = exparg.lastp;
INTOFF;
if (expdir == NULL) {
int i = strlen(str->text);
expdir = ckmalloc(i < 2048 ? 2048 : i); /* XXX */
}
expmeta(expdir, str->text);
ckfree(expdir);
expdir = NULL;
INTON;
if (exparg.lastp == savelastp) {
/*
@@ -1122,10 +1133,11 @@ expmeta(char *enddir, char *name)
struct dirent *dp;
int atend;
int matchdot;
int esc;
metaflag = 0;
start = name;
for (p = name ; ; p++) {
for (p = name; esc = 0, *p; p += esc + 1) {
if (*p == '*' || *p == '?')
metaflag = 1;
else if (*p == '[') {
@@ -1150,12 +1162,14 @@ expmeta(char *enddir, char *name)
break;
else if (*p == CTLQUOTEMARK)
continue;
else if (*p == CTLESC)
p++;
if (*p == '/') {
if (metaflag)
break;
start = p + 1;
else {
if (*p == CTLESC)
esc++;
if (p[esc] == '/') {
if (metaflag)
break;
start = p + esc + 1;
}
}
}
if (metaflag == 0) { /* we've reached the end of the file name */
@@ -1169,6 +1183,8 @@ expmeta(char *enddir, char *name)
*enddir++ = *p;
if (*p == '\0')
break;
if (enddir == expdir_end)
return;
}
if (metaflag == 0 || lstat(expdir, &statb) >= 0)
addfname(expdir);
@@ -1183,6 +1199,8 @@ expmeta(char *enddir, char *name)
if (*p == CTLESC)
p++;
*enddir++ = *p++;
if (enddir == expdir_end)
return;
}
}
if (enddir == expdir) {
@@ -1201,7 +1219,8 @@ expmeta(char *enddir, char *name)
atend = 1;
} else {
atend = 0;
*endname++ = '\0';
*endname = '\0';
endname += esc + 1;
}
matchdot = 0;
p = start;
@@ -1215,21 +1234,23 @@ expmeta(char *enddir, char *name)
if (dp->d_name[0] == '.' && ! matchdot)
continue;
if (patmatch(start, dp->d_name, 0)) {
if (atend) {
scopy(dp->d_name, enddir);
if (enddir + dp->d_namlen + 1 > expdir_end)
continue;
memcpy(enddir, dp->d_name, dp->d_namlen + 1);
if (atend)
addfname(expdir);
} else {
for (p = enddir, q = dp->d_name;
(*p++ = *q++) != '\0';)
else {
if (enddir + dp->d_namlen + 2 > expdir_end)
continue;
p[-1] = '/';
expmeta(p, endname);
enddir[dp->d_namlen] = '/';
enddir[dp->d_namlen + 1] = '\0';
expmeta(enddir + dp->d_namlen + 1, endname);
}
}
}
closedir(dirp);
if (! atend)
endname[-1] = '/';
endname[-esc - 1] = esc ? CTLESC : '/';
}
@@ -1451,7 +1472,7 @@ breakloop:
/*
* Remove any CTLESC characters from a string.
* Remove any CTLESC and CTLQUOTEMARK characters from a string.
*/
void
+3 -3
View File
@@ -350,7 +350,7 @@ histcmd(int argc, char **argv)
if (displayhist) {
out2str(s);
}
evalstring(s);
evalstring(s, 0);
if (displayhist && hist) {
/*
* XXX what about recursive and
@@ -382,7 +382,7 @@ histcmd(int argc, char **argv)
fclose(efp);
editcmd = stalloc(strlen(editor) + strlen(editfile) + 2);
sprintf(editcmd, "%s %s", editor, editfile);
evalstring(editcmd); /* XXX - should use no JC command */
evalstring(editcmd, 0); /* XXX - should use no JC command */
INTON;
readcmdfile(editfile); /* XXX - should read back - quick tst */
unlink(editfile);
@@ -411,7 +411,7 @@ fc_replace(const char *s, char *p, char *r)
} else
STPUTC(*s++, dest);
}
STACKSTRNUL(dest);
STPUTC('\0', dest);
dest = grabstackstr(dest);
return (dest);
+1 -1
View File
@@ -178,7 +178,7 @@ state2:
state3:
state = 4;
if (minusc) {
evalstring(minusc);
evalstring(minusc, 0);
}
if (sflag || minusc == NULL) {
state4: /* XXX ??? - why isn't this before the "if" statement */
+10 -7
View File
@@ -295,6 +295,13 @@ grabstackblock(int len)
* is space for at least one character.
*/
static char *
growstrstackblock(int n)
{
growstackblock();
sstrnleft = stackblocksize() - n;
return stackblock() + n;
}
char *
growstackstr(void)
@@ -304,12 +311,10 @@ growstackstr(void)
len = stackblocksize();
if (herefd >= 0 && len >= 1024) {
xwrite(herefd, stackblock(), len);
sstrnleft = len - 1;
sstrnleft = len;
return stackblock();
}
growstackblock();
sstrnleft = stackblocksize() - len - 1;
return stackblock() + len;
return growstrstackblock(len);
}
@@ -323,9 +328,7 @@ makestrspace(void)
int len;
len = stackblocksize() - sstrnleft;
growstackblock();
sstrnleft = stackblocksize() - len;
return stackblock() + len;
return growstrstackblock(len);
}
+8 -1
View File
@@ -65,9 +65,16 @@ void ungrabstackstr(char *, char *);
#define stackblock() stacknxt
#define stackblocksize() stacknleft
#define STARTSTACKSTR(p) p = stackblock(), sstrnleft = stackblocksize()
#define STPUTC(c, p) (--sstrnleft >= 0? (*p++ = (c)) : (p = growstackstr(), *p++ = (c)))
#define STPUTC(c, p) (--sstrnleft >= 0? (*p++ = (c)) : (p = growstackstr(), --sstrnleft, *p++ = (c)))
#define CHECKSTRSPACE(n, p) { if (sstrnleft < n) p = makestrspace(); }
#define USTPUTC(c, p) (--sstrnleft, *p++ = (c))
/*
* STACKSTRNUL's use is where we want to be able to turn a stack
* (non-sentinel, character counting string) into a C string,
* and later pretend the NUL is not there.
* Note: Because of STACKSTRNUL's semantics, STACKSTRNUL cannot be used
* on a stack that will grabstackstr()ed.
*/
#define STACKSTRNUL(p) (sstrnleft == 0? (p = growstackstr(), *p = '\0') : (*p = '\0'))
#define STUNPUTC(p) (++sstrnleft, --p)
#define STTOPC(p) p[-1]
+77 -27
View File
@@ -32,7 +32,7 @@
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
.\" $FreeBSD$
.\"
.Dd October 7, 2006
.Dd October 31, 2010
.Dt SH 1
.Os
.Sh NAME
@@ -40,9 +40,24 @@
.Nd command interpreter (shell)
.Sh SYNOPSIS
.Nm
.Op Fl /+abCEefIimnPpsTuVvx
.Op Fl /+abCEefIimnPpTuVvx
.Op Fl /+o Ar longname
.Op Fl c Ar string
.Oo
.Ar script
.Op Ar arg ...
.Oc
.Nm
.Op Fl /+abCEefIimnPpTuVvx
.Op Fl /+o Ar longname
.Fl c Ar string
.Oo
.Ar name
.Op Ar arg ...
.Oc
.Nm
.Op Fl /+abCEefIimnPpTuVvx
.Op Fl /+o Ar longname
.Fl s
.Op Ar arg ...
.Sh DESCRIPTION
The
@@ -411,11 +426,11 @@ character, with the exception of the newline character
.Pq Ql \en .
A backslash preceding a newline is treated as a line continuation.
.El
.Ss Reserved Words
Reserved words are words that have special meaning to the
.Ss Keywords
Keywords or reserved words are words that have special meaning to the
shell and are recognized at the beginning of a line and
after a control operator.
The following are reserved words:
The following are keywords:
.Bl -column "doneXX" "elifXX" "elseXX" "untilXX" "whileX" -offset center
.It Li \&! Ta { Ta } Ta Ic case Ta Ic do
.It Ic done Ta Ic elif Ta Ic else Ta Ic esac Ta Ic fi
@@ -425,8 +440,8 @@ The following are reserved words:
An alias is a name and corresponding value set using the
.Ic alias
built-in command.
Whenever a reserved word may occur (see above),
and after checking for reserved words, the shell
Whenever a keyword may occur (see above),
and after checking for keywords, the shell
checks the word to see if it matches an alias.
If it does, it replaces it in the input stream with its value.
For example, if there is an alias called
@@ -465,7 +480,7 @@ of this man page (refer to the BNF in the
document).
Essentially though, a line is read and if
the first word of the line (or after a control operator)
is not a reserved word, then the shell has recognized a
is not a keyword, then the shell has recognized a
simple command.
Otherwise, a complex command or some
other special construct may have been recognized.
@@ -685,7 +700,7 @@ Signal numbers are defined in the header file
.In sys/signal.h .
.Ss Complex Commands
Complex commands are combinations of simple commands
with control operators or reserved words, together creating a larger complex
with control operators or keywords, together creating a larger complex
command.
More generally, a command is one of the following:
.Bl -item -offset indent
@@ -726,10 +741,17 @@ both of a command is considered to be assigned by the
pipeline before any redirection specified by redirection
operators that are part of the command.
.Pp
Note that unlike some other shells,
.Nm
executes each process in a pipeline with more than one command
in a subshell environment and as a child of the
.Nm
process.
.Pp
If the pipeline is not in the background (discussed later),
the shell waits for all commands to complete.
.Pp
If the reserved word
If the keyword
.Ic !\&
does not precede the pipeline, the
exit status is the exit status of the last command specified
@@ -763,15 +785,6 @@ to be executed sequentially;
an
.Ql &
causes asynchronous execution of the preceding AND-OR-list.
.Pp
Note that unlike some other shells,
.Nm
executes each process in the pipeline as a child of the
.Nm
process.
Shell built-in commands are the exception to this rule.
They are executed in the current shell, although they do not affect its
environment when used in pipelines.
.Ss Background Commands (&)
If a command is terminated by the control operator ampersand
.Pq Ql & ,
@@ -1101,7 +1114,12 @@ For a
pipeline, the process ID is that of the last command in the
pipeline.
.It Li $0
(zero) Expands to the name of the shell or shell script.
(zero) Expands to the name of the shell script if passed on the command line,
the
.Ar name
operand if given (with
.Fl c )
or otherwise argument 0 passed to the shell.
.El
.Ss Word Expansions
This clause describes the various expansions that are
@@ -1142,7 +1160,7 @@ Quote Removal.
The
.Ql $
character is used to introduce parameter expansion, command
substitution, or arithmetic evaluation.
substitution, or arithmetic expansion.
.Ss Tilde Expansion (substituting a user's home directory)
A word beginning with an unquoted tilde character
.Pq Ql ~
@@ -1221,6 +1239,9 @@ In all cases, the
final value of
.Ar parameter
is substituted.
Quoting inside
.Ar word
does not prevent field splitting or pathname expansion.
Only variables, not positional
parameters or special parameters, can be
assigned in this way.
@@ -1354,10 +1375,41 @@ The
shell expands all tokens in the
.Ar expression
for parameter expansion,
command substitution, and quote removal.
command substitution,
arithmetic expansion
and quote removal.
.Pp
Next, the shell treats this as an arithmetic expression and
substitutes the value of the expression.
The allowed expressions are a subset of C expressions,
summarized below.
.Bl -tag -width "Variables" -offset indent
.It Values
All values are of type
.Ft intmax_t .
.It Constants
Decimal, octal (starting with
.Li 0 )
and hexadecimal (starting with
.Li 0x )
integer constants.
.It Variables
Shell variables can be read and written
and contain integer constants.
.It Unary operators
.Li "! ~ + -"
.It Binary operators
.Li "* / % + - << >> < <= > >= == != & ^ | && ||"
.It Assignment operators
.Li "= += -= *= /= %= <<= >>= &= ^= |="
.It Short-circuit evaluation
The
.Li &&
and
.Li ||
operators always evaluate both sides.
This is a bug.
.El
.Pp
The result of the expression is substituted in decimal.
.Ss White Space Splitting (Field Splitting)
After parameter expansion, command substitution, and
arithmetic expansion the shell scans the results of
@@ -2352,8 +2404,6 @@ will return the argument.
.Xr echo 1 ,
.Xr ed 1 ,
.Xr emacs 1 ,
.Xr expr 1 ,
.Xr getopt 1 ,
.Xr pwd 1 ,
.Xr test 1 ,
.Xr vi 1 ,
+2 -2
View File
@@ -416,7 +416,7 @@ dotrap(void)
if (i == SIGCHLD)
ignore_sigchld++;
savestatus = exitstatus;
evalstring(trap[i]);
evalstring(trap[i], 0);
exitstatus = savestatus;
if (i == SIGCHLD)
ignore_sigchld--;
@@ -471,7 +471,7 @@ exitshell(int status)
handler = &loc1;
if ((p = trap[0]) != NULL && *p != '\0') {
trap[0] = NULL;
evalstring(p);
evalstring(p, 0);
}
l1: handler = &loc2; /* probably unnecessary */
flushall();
+3 -6
View File
@@ -523,9 +523,8 @@ var_compare(const void *a, const void *b)
/*
* Command to list all variables which are set. Currently this command
* is invoked from the set command when the set command is called without
* any variables.
* Command to list all variables which are set. This is invoked from the
* set command when it is called without any options or operands.
*/
int
@@ -760,9 +759,7 @@ setvarcmd(int argc, char **argv)
/*
* The unset builtin command. We unset the function before we unset the
* variable to allow a function to be unset when there is a readonly variable
* with the same name.
* The unset builtin command.
*/
int
-24
View File
@@ -1,24 +0,0 @@
# $FreeBSD$
OS/shell syntax error failed
--------------------------------------------------------------------
bash 1.14.5 3 0
pdksh 5.2.5 7 0
zsh 2.6-beta17 6 4
FreeBSD 2.1 /bin/test 8 0
IRIX 5.3 ksh 3 0
IRIX 5.3 sh 3 0
IRIX 5.3 /usr/bin/test 11 3
SunOS 5.4 ksh 3 0
SunOS 5.4 sh 3 0
SunOS 5.4 /usr/ucb/test 3 0
SunOS 5.5 ksh 0 0
SunOS 5.5 sh 3 0
SunOS 5.5 /usr/ucb/test 3 0
SunOS 4.1.3_U1 sh 3 0
SunOS 4.1.3_U1 /usr/bin/test 3 0
ULTRIX 4.2 /bin/test 9 0
ULTRIX 4.2 ksh 1 0
ULTRIX 4.2 sh5 4 0
96/06/16
-152
View File
@@ -1,152 +0,0 @@
# @(#)TEST.csh 5.2 (Berkeley) 4/30/93
# $FreeBSD$
#alias t '/usr/src/bin/test/obj/test \!*; echo $status'
alias t '/bin/test \!*; echo $status'
echo 't -b /dev/ttyp2'
t -b /dev/ttyp2
echo 't -b /dev/jb1a'
t -b /dev/jb1a
echo 't -c test.c'
t -c test.c
echo 't -c /dev/tty'
t -c /dev/tty
echo 't -d test.c'
t -d test.c
echo 't -d /etc'
t -d /etc
echo 't -e noexist'
t -e noexist
echo 't -e test.c'
t -e test.c
echo 't -f noexist'
t -f noexist
echo 't -f /dev/tty'
t -f /dev/tty
echo 't -f test.c'
t -f test.c
echo 't -g test.c'
t -g test.c
echo 't -g /bin/ps'
t -g /bin/ps
echo 't -n ""'
t -n ""
echo 't -n "hello"'
t -n "hello"
echo 't -p test.c'
t -p test.c
echo 't -r noexist'
t -r noexist
echo 't -r /etc/master.passwd'
t -r /etc/master.passwd
echo 't -r test.c'
t -r test.c
echo 't -s noexist'
t -s noexist
echo 't -s /dev/null'
t -s /dev/null
echo 't -s test.c'
t -s test.c
echo 't -t 20'
t -t 20
echo 't -t 0'
t -t 0
echo 't -u test.c'
t -u test.c
echo 't -u /bin/rcp'
t -u /bin/rcp
echo 't -w noexist'
t -w noexist
echo 't -w /etc/master.passwd'
t -w /etc/master.passwd
echo 't -w /dev/null'
t -w /dev/null
echo 't -x noexist'
t -x noexist
echo 't -x /bin/ps'
t -x /bin/ps
echo 't -x /etc/motd'
t -x /etc/motd
echo 't -z ""'
t -z ""
echo 't -z "foo"'
t -z "foo"
echo 't "foo"'
t "foo"
echo 't ""'
t ""
echo 't "hello" = "hello"'
t "hello" = "hello"
echo 't "hello" = "goodbye"'
t "hello" = "goodbye"
echo 't "hello" != "hello"'
t "hello" != "hello"
echo 't "hello" != "goodbye"'
t "hello" != "goodbye"
echo 't 200 -eq 200'
t 200 -eq 200
echo 't 34 -eq 222'
t 34 -eq 222
echo 't 200 -ne 200'
t 200 -ne 200
echo 't 34 -ne 222'
t 34 -ne 222
echo 't 200 -gt 200'
t 200 -gt 200
echo 't 340 -gt 222'
t 340 -gt 222
echo 't 200 -ge 200'
t 200 -ge 200
echo 't 34 -ge 222'
t 34 -ge 222
echo 't 200 -lt 200'
t 200 -lt 200
echo 't 34 -lt 222'
t 34 -lt 222
echo 't 200 -le 200'
t 200 -le 200
echo 't 340 -le 222'
t 340 -le 222
echo 't 700 -le 1000 -a -n "1" -a "20" = "20"'
t 700 -le 1000 -a -n "1" -a "20" = "20"
echo 't ! \( 700 -le 1000 -a -n "1" -a "20" = "20" \)'
t ! \( 700 -le 1000 -a -n "1" -a "20" = "20" \)
echo 't -5 -eq 5'
t -5 -eq 5
echo 't foo -a ""'
t foo -a ""
echo 't "" -a foo'
t "" -a foo
echo 't "" -a ""'
t "" -a ""
echo 't "" -o ""'
t "" -o ""
+13 -6
View File
@@ -32,7 +32,7 @@
.\" @(#)test.1 8.1 (Berkeley) 5/31/93
.\" $FreeBSD$
.\"
.Dd July 31, 2006
.Dd September 10, 2010
.Dt TEST 1
.Os
.Sh NAME
@@ -282,7 +282,7 @@ True if either
or
.Ar expression2
are true.
.It Cm \&( Ns Ar expression Ns Cm \&)
.It Cm \&( Ar expression Cm \&)
True if expression is true.
.El
.Pp
@@ -310,6 +310,14 @@ are evaluated consistently according to the rules specified in the
standards document.
All other cases are subject to the ambiguity in the
command semantics.
.Pp
In particular, only expressions containing
.Fl a ,
.Fl o ,
.Cm \&(
or
.Cm \&)
can be ambiguous.
.Sh EXIT STATUS
The
.Nm
@@ -338,12 +346,11 @@ specification.
Both sides are always evaluated in
.Fl a
and
.Fl o ,
unlike in the logical operators of
.Xr sh 1 .
.Fl o .
For instance, the writable status of
.Pa file
will be tested by the following command even though the former expression
indicated false, which results in a gratuitous access to the file system:
.Pp
.Dl "[ -z abc -a -w file ]"
To avoid this, write
.Dl "[ -z abc ] && [ -w file ]"
+63 -9
View File
@@ -9,6 +9,10 @@
*
* This program is in the Public Domain.
*/
/*
* Important: This file is used both as a standalone program /bin/test and
* as a builtin for /bin/sh (#define SHELL).
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -163,6 +167,7 @@ struct t_op {
struct t_op const *t_wp_op;
int nargc;
char **t_wp;
int parenlevel;
static int aexpr(enum token);
static int binop(void);
@@ -171,7 +176,9 @@ static int filstat(char *, enum token);
static int getn(const char *);
static intmax_t getq(const char *);
static int intcmp(const char *, const char *);
static int isoperand(void);
static int isunopoperand(void);
static int islparenoperand(void);
static int isrparenoperand(void);
static int newerf(const char *, const char *);
static int nexpr(enum token);
static int oexpr(enum token);
@@ -205,7 +212,14 @@ main(int argc, char **argv)
#endif
nargc = argc;
t_wp = &argv[1];
res = !oexpr(t_lex(*t_wp));
parenlevel = 0;
if (nargc == 4 && strcmp(*t_wp, "!") == 0) {
/* Things like ! "" -o x do not fit in the normal grammar. */
--nargc;
++t_wp;
res = oexpr(t_lex(*t_wp));
} else
res = !oexpr(t_lex(*t_wp));
if (--nargc > 0)
syntax(*t_wp, "unexpected operator");
@@ -268,12 +282,16 @@ primary(enum token n)
if (n == EOI)
return 0; /* missing expression */
if (n == LPAREN) {
parenlevel++;
if ((nn = t_lex(nargc > 0 ? (--nargc, *++t_wp) : NULL)) ==
RPAREN)
RPAREN) {
parenlevel--;
return 0; /* missing expression */
}
res = oexpr(nn);
if (t_lex(nargc > 0 ? (--nargc, *++t_wp) : NULL) != RPAREN)
syntax(NULL, "closing paren expected");
parenlevel--;
return res;
}
if (t_wp_op && t_wp_op->op_type == UNOP) {
@@ -410,8 +428,10 @@ t_lex(char *s)
}
while (op->op_text) {
if (strcmp(s, op->op_text) == 0) {
if ((op->op_type == UNOP && isoperand()) ||
(op->op_num == LPAREN && nargc == 1))
if (((op->op_type == UNOP || op->op_type == BUNOP)
&& isunopoperand()) ||
(op->op_num == LPAREN && islparenoperand()) ||
(op->op_num == RPAREN && isrparenoperand()))
break;
t_wp_op = op;
return op->op_num;
@@ -423,7 +443,7 @@ t_lex(char *s)
}
static int
isoperand(void)
isunopoperand(void)
{
struct t_op const *op = ops;
char *s;
@@ -431,19 +451,53 @@ isoperand(void)
if (nargc == 1)
return 1;
if (nargc == 2)
return 0;
s = *(t_wp + 1);
if (nargc == 2)
return parenlevel == 1 && strcmp(s, ")") == 0;
t = *(t_wp + 2);
while (op->op_text) {
if (strcmp(s, op->op_text) == 0)
return op->op_type == BINOP &&
(t[0] != ')' || t[1] != '\0');
(parenlevel == 0 || t[0] != ')' || t[1] != '\0');
op++;
}
return 0;
}
static int
islparenoperand(void)
{
struct t_op const *op = ops;
char *s;
if (nargc == 1)
return 1;
s = *(t_wp + 1);
if (nargc == 2)
return parenlevel == 1 && strcmp(s, ")") == 0;
if (nargc != 3)
return 0;
while (op->op_text) {
if (strcmp(s, op->op_text) == 0)
return op->op_type == BINOP;
op++;
}
return 0;
}
static int
isrparenoperand(void)
{
char *s;
if (nargc == 1)
return 0;
s = *(t_wp + 1);
if (nargc == 2)
return parenlevel == 1 && strcmp(s, ")") == 0;
return 0;
}
/* atoi with error detection */
static int
getn(const char *s)
+6 -3
View File
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd September 7, 2005
.Dd May 23, 2012
.Dt UUIDGEN 1
.Os
.Sh NAME
@@ -52,8 +52,11 @@ instructs
to not generate them in batch, but one at a time.
.It Fl n
This option controls the number of identifiers generated.
By default, multiple
identifiers are generated in batch.
By default, multiple identifiers are generated in batch.
The upper hard limit is 2048
.Po see
.Xr uuidgen 2
.Pc .
.It Fl o
Redirect output to
.Ar filename
+4 -2
View File
@@ -95,8 +95,10 @@ zmount(const char *spec, const char *dir, int mflag, char *fstype,
build_iovec(&iov, &iovlen, "fspath", __DECONST(char *, dir),
(size_t)-1);
build_iovec(&iov, &iovlen, "from", __DECONST(char *, spec), (size_t)-1);
for (p = optstr; p != NULL; strsep(&p, ",/ "))
build_iovec(&iov, &iovlen, p, NULL, (size_t)-1);
for (p = optstr; p != NULL; strsep(&p, ",/ ")) {
if (*p != '\0')
build_iovec(&iov, &iovlen, p, NULL, (size_t)-1);
}
rv = nmount(iov, iovlen, 0);
free(optstr);
return (rv);
+107 -1
View File
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -93,6 +93,7 @@
#include <sys/vdev_file.h>
#include <sys/spa_impl.h>
#include <sys/dsl_prop.h>
#include <sys/dsl_dataset.h>
#include <sys/refcount.h>
#include <stdio.h>
#include <stdio_ext.h>
@@ -174,6 +175,7 @@ ztest_func_t ztest_traverse;
ztest_func_t ztest_dsl_prop_get_set;
ztest_func_t ztest_dmu_objset_create_destroy;
ztest_func_t ztest_dmu_snapshot_create_destroy;
ztest_func_t ztest_dsl_dataset_promote_busy;
ztest_func_t ztest_spa_create_destroy;
ztest_func_t ztest_fault_inject;
ztest_func_t ztest_spa_rename;
@@ -208,6 +210,7 @@ ztest_info_t ztest_info[] = {
{ ztest_dsl_prop_get_set, 1, &zopt_sometimes },
{ ztest_dmu_objset_create_destroy, 1, &zopt_sometimes },
{ ztest_dmu_snapshot_create_destroy, 1, &zopt_sometimes },
{ ztest_dsl_dataset_promote_busy, 1, &zopt_sometimes },
{ ztest_spa_create_destroy, 1, &zopt_sometimes },
{ ztest_fault_inject, 1, &zopt_sometimes },
{ ztest_spa_rename, 1, &zopt_rarely },
@@ -1591,6 +1594,109 @@ ztest_traverse(ztest_args_t *za)
}
}
/*
* Verify dsl_dataset_promote handles EBUSY
*/
void
ztest_dsl_dataset_promote_busy(ztest_args_t *za)
{
int error;
objset_t *os = za->za_os;
objset_t *clone;
dsl_dataset_t *ds;
char snap1name[100];
char clone1name[100];
char snap2name[100];
char clone2name[100];
char snap3name[100];
char osname[MAXNAMELEN];
static uint64_t uniq = 0;
uint64_t curval;
curval = atomic_add_64_nv(&uniq, 5) - 5;
(void) rw_rdlock(&ztest_shared->zs_name_lock);
dmu_objset_name(os, osname);
(void) snprintf(snap1name, 100, "%s@s1_%llu", osname, curval++);
(void) snprintf(clone1name, 100, "%s/c1_%llu", osname, curval++);
(void) snprintf(snap2name, 100, "%s@s2_%llu", clone1name, curval++);
(void) snprintf(clone2name, 100, "%s/c2_%llu", osname, curval++);
(void) snprintf(snap3name, 100, "%s@s3_%llu", clone1name, curval++);
error = dmu_objset_snapshot(osname, strchr(snap1name, '@')+1, FALSE);
if (error == ENOSPC)
ztest_record_enospc("dmu_take_snapshot");
else if (error != 0 && error != EEXIST)
fatal(0, "dmu_take_snapshot = %d", error);
error = dmu_objset_open(snap1name, DMU_OST_OTHER,
DS_MODE_USER | DS_MODE_READONLY, &clone);
if (error)
fatal(0, "dmu_open_snapshot(%s) = %d", snap1name, error);
error = dmu_objset_create(clone1name, DMU_OST_OTHER, clone, 0,
NULL, NULL);
if (error)
fatal(0, "dmu_objset_create(%s) = %d", clone1name, error);
dmu_objset_close(clone);
error = dmu_objset_snapshot(clone1name, strchr(snap2name, '@')+1,
FALSE);
if (error == ENOSPC)
ztest_record_enospc("dmu_take_snapshot");
else if (error != 0 && error != EEXIST)
fatal(0, "dmu_take_snapshot = %d", error);
error = dmu_objset_snapshot(clone1name, strchr(snap3name, '@')+1,
FALSE);
if (error == ENOSPC)
ztest_record_enospc("dmu_take_snapshot");
else if (error != 0 && error != EEXIST)
fatal(0, "dmu_take_snapshot = %d", error);
error = dmu_objset_open(snap3name, DMU_OST_OTHER,
DS_MODE_USER | DS_MODE_READONLY, &clone);
if (error)
fatal(0, "dmu_open_snapshot(%s) = %d", snap3name, error);
error = dmu_objset_create(clone2name, DMU_OST_OTHER, clone, 0,
NULL, NULL);
if (error)
fatal(0, "dmu_objset_create(%s) = %d", clone2name, error);
dmu_objset_close(clone);
error = dsl_dataset_own(snap1name, 0, FTAG, &ds);
if (error)
fatal(0, "dsl_dataset_own(%s) = %d", snap1name, error);
error = dsl_dataset_promote(clone2name);
if (error != EBUSY)
fatal(0, "dsl_dataset_promote(%s), %d, not EBUSY", clone2name,
error);
dsl_dataset_disown(ds, FTAG);
error = dmu_objset_destroy(clone2name);
if (error)
fatal(0, "dmu_objset_destroy(%s) = %d", clone2name, error);
error = dmu_objset_destroy(snap3name);
if (error)
fatal(0, "dmu_objset_destroy(%s) = %d", snap2name, error);
error = dmu_objset_destroy(snap2name);
if (error)
fatal(0, "dmu_objset_destroy(%s) = %d", snap2name, error);
error = dmu_objset_destroy(clone1name);
if (error)
fatal(0, "dmu_objset_destroy(%s) = %d", clone1name, error);
error = dmu_objset_destroy(snap1name);
if (error)
fatal(0, "dmu_objset_destroy(%s) = %d", snap1name, error);
(void) rw_unlock(&ztest_shared->zs_name_lock);
}
/*
* Verify that dmu_object_{alloc,free} work as expected.
*/
@@ -137,6 +137,7 @@ typedef struct dt_module {
dt_idhash_t *dm_extern; /* external symbol definitions */
#if !defined(sun)
caddr_t dm_reloc_offset; /* Symbol relocation offset. */
uintptr_t *dm_sec_offsets;
#endif
} dt_module_t;
@@ -45,7 +45,7 @@
#undef input
#undef unput
#else
/*
/*
* Define YY_INPUT for flex since input() can't be re-defined.
*/
#define YY_INPUT(buf,result,max_size) \
@@ -60,6 +60,19 @@
buf[n] = *yypcb->pcb_strptr++; \
result = n; \
}
/*
* Do not EOF let tokens to be put back. This does not work with flex.
* On the other hand, leaving current buffer in same state it was when
* last EOF was received guarantees that input() will keep returning EOF
* for all subsequent invocations, which is the effect desired.
*/
#undef unput
#define unput(c) \
do { \
int _c = c; \
if (_c != EOF) \
yyunput(_c, yytext_ptr); \
} while(0)
#endif
static int id_or_type(const char *);
@@ -83,6 +83,14 @@ dt_module_syminit32(dt_module_t *dmp)
uint_t i, n = dmp->dm_nsymelems;
uint_t asrsv = 0;
#if defined(__FreeBSD__)
GElf_Ehdr ehdr;
int is_elf_obj;
gelf_getehdr(dmp->dm_elf, &ehdr);
is_elf_obj = (ehdr.e_type == ET_REL);
#endif
for (i = 0; i < n; i++, sym++) {
const char *name = base + sym->st_name;
uchar_t type = ELF32_ST_TYPE(sym->st_info);
@@ -97,8 +105,12 @@ dt_module_syminit32(dt_module_t *dmp)
(ELF32_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size)) {
asrsv++; /* reserve space in the address map */
#if !defined(sun)
#if defined(__FreeBSD__)
sym->st_value += (Elf_Addr) dmp->dm_reloc_offset;
if (is_elf_obj && sym->st_shndx != SHN_UNDEF &&
sym->st_shndx < ehdr.e_shnum)
sym->st_value +=
dmp->dm_sec_offsets[sym->st_shndx];
#endif
}
@@ -117,6 +129,14 @@ dt_module_syminit64(dt_module_t *dmp)
uint_t i, n = dmp->dm_nsymelems;
uint_t asrsv = 0;
#if defined(__FreeBSD__)
GElf_Ehdr ehdr;
int is_elf_obj;
gelf_getehdr(dmp->dm_elf, &ehdr);
is_elf_obj = (ehdr.e_type == ET_REL);
#endif
for (i = 0; i < n; i++, sym++) {
const char *name = base + sym->st_name;
uchar_t type = ELF64_ST_TYPE(sym->st_info);
@@ -130,9 +150,12 @@ dt_module_syminit64(dt_module_t *dmp)
if (sym->st_value != 0 &&
(ELF64_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size)) {
asrsv++; /* reserve space in the address map */
#if !defined(sun)
#if defined(__FreeBSD__)
sym->st_value += (Elf_Addr) dmp->dm_reloc_offset;
if (is_elf_obj && sym->st_shndx != SHN_UNDEF &&
sym->st_shndx < ehdr.e_shnum)
sym->st_value +=
dmp->dm_sec_offsets[sym->st_shndx];
#endif
}
@@ -722,7 +745,12 @@ dt_module_unload(dtrace_hdl_t *dtp, dt_module_t *dmp)
free(dmp->dm_asmap);
dmp->dm_asmap = NULL;
}
#if defined(__FreeBSD__)
if (dmp->dm_sec_offsets != NULL) {
free(dmp->dm_sec_offsets);
dmp->dm_sec_offsets = NULL;
}
#endif
dmp->dm_symfree = 0;
dmp->dm_nsymbuckets = 0;
dmp->dm_nsymelems = 0;
@@ -846,9 +874,12 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat)
(void) snprintf(fname, sizeof (fname),
"%s/%s/object", OBJFS_ROOT, name);
#else
GElf_Ehdr ehdr;
GElf_Phdr ph;
char name[MAXPATHLEN];
uintptr_t mapbase, alignmask;
int i = 0;
int is_elf_obj;
(void) strlcpy(name, k_stat->name, sizeof(name));
(void) strlcpy(fname, k_stat->pathname, sizeof(fname));
@@ -893,7 +924,20 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat)
dt_module_destroy(dtp, dmp);
return;
}
#if defined(__FreeBSD__)
mapbase = (uintptr_t)k_stat->address;
gelf_getehdr(dmp->dm_elf, &ehdr);
is_elf_obj = (ehdr.e_type == ET_REL);
if (is_elf_obj) {
dmp->dm_sec_offsets =
malloc(ehdr.e_shnum * sizeof(*dmp->dm_sec_offsets));
if (dmp->dm_sec_offsets == NULL) {
dt_dprintf("failed to allocate memory\n");
dt_module_destroy(dtp, dmp);
return;
}
}
#endif
/*
* Iterate over the section headers locating various sections of
* interest and use their attributes to flesh out the dt_module_t.
@@ -902,7 +946,19 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat)
if (gelf_getshdr(sp, &sh) == NULL || sh.sh_type == SHT_NULL ||
(s = elf_strptr(dmp->dm_elf, shstrs, sh.sh_name)) == NULL)
continue; /* skip any malformed sections */
#if defined(__FreeBSD__)
if (sh.sh_size == 0)
continue;
if (is_elf_obj && (sh.sh_type == SHT_PROGBITS ||
sh.sh_type == SHT_NOBITS)) {
alignmask = sh.sh_addralign - 1;
mapbase += alignmask;
mapbase &= ~alignmask;
sh.sh_addr = mapbase;
dmp->dm_sec_offsets[elf_ndxscn(sp)] = sh.sh_addr;
mapbase += sh.sh_size;
}
#endif
if (strcmp(s, ".text") == 0) {
dmp->dm_text_size = sh.sh_size;
dmp->dm_text_va = sh.sh_addr;
@@ -927,6 +983,13 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat)
#if defined(sun)
dmp->dm_modid = (int)OBJFS_MODID(st.st_ino);
#else
/*
* Include .rodata and special sections into .text.
* This depends on default section layout produced by GNU ld
* for ELF objects and libraries:
* [Text][R/O data][R/W data][Dynamic][BSS][Non loadable]
*/
dmp->dm_text_size = dmp->dm_data_va - dmp->dm_text_va;
#if defined(__i386__)
/*
* Find the first load section and figure out the relocation
@@ -644,7 +644,7 @@ write_file(Elf *src, const char *srcname, Elf *dst, const char *dstname,
}
#if !defined(sun)
if (ddata->d_buf == NULL) {
if (ddata->d_buf == NULL && sdata->d_buf != NULL) {
ddata->d_buf = xmalloc(shdr.sh_size);
bcopy(sdata->d_buf, ddata->d_buf, shdr.sh_size);
}
+1 -1
View File
@@ -11,7 +11,7 @@
# LIST_SRCS
.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/os
# ATOMIC_SRCS
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64"
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" || ${MACHINE_ARCH} == "sparc64"
.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}
ATOMIC_SRCS= opensolaris_atomic.S
.else
+151
View File
@@ -1,3 +1,154 @@
--- 9.4-ESV-R5-P1 released ---
3218. [security] Cache lookup could return RRSIG data associated with
nonexistent records, leading to an assertion
failure. [RT #26590]
--- 9.4-ESV-R5 released ---
3135. [port] FreeBSD: workaround broken IPV6_USE_MIN_MTU processing.
See http://www.freebsd.org/cgi/query-pr.cgi?pr=158307
[RT #24950]
3023. [bug] Named could be left in an inconsistent state when
receiving multiple AXFR response messages that were
not all TSIG-signed. [RT #23254]
--- 9.4-ESV-R5rc1 released ---
3124. [bug] Use an rdataset attribute flag to indicate
negative-cache records rather than using rrtype 0;
this will prevent problems when that rrtype is
used in actual DNS packets. [RT #24777]
3121. [security] An authoritative name server sending a negative
response containing a very large RRset could
trigger an off-by-one error in the ncache code
and crash named. [RT #24650]
3120. [bug] Named could fail to validate zones list in a DLV
that validated insecure without using DLV and had
DS records in the parent zone. [RT #24631]
3113. [doc] Document the relationship between serial-query-rate
and NOTIFY messages.
--- 9.4-ESV-R5b1 released ---
3095. [bug] Handle isolated reserved ports in the port range.
[RT #23957]
3088. [bug] Remove bin/tests/system/logfileconfig/ns1/named.conf
and add setup.sh in order to resolve changing
named.conf issue. [RT #23687]
3071. [bug] has_nsec could be used unintialised in
update.c:next_active. [RT #20256]
3067. [bug] ixfr-from-differences {master|slave}; failed to
select the master/slave zones. [RT #23580]
3065. [bug] RRSIG could have time stamps too far in the future.
[RT #23356]
3064. [bug] powerpc: add sync instructions to the end of atomic
operations. [RT #23469]
3058. [bug] Cause named to terminate at startup or rndc reconfig/
reload to fail, if a log file specified in the conf
file isn't a plain file. [RT #22771]
3051. [bug] NS records obsure DNAME records at the bottom of the
zone if both are present. [RT #23035]
3041. [bug] dnssec-signzone failed to generate new signatures on
ttl changes. [RT #23330]
3040. [bug] Named failed to validate insecure zones where a node
with a CNAME existed between the trust anchor and the
top of the zone. [RT #23338]
3037. [doc] Update COPYRIGHT to contain all the individual
copyright notices that cover various parts.
3014. [bug] Fix the zonechecks system test to match expected
behaviour for 9.4 and to fail on error. [RT #22905]
3009. [bug] clients-per-query code didn't work as expected with
particular query patterns. [RT #22972]
3007. [bug] Named failed to preserve the case of domain names in
rdata which is not compressible when writing master
files. [RT #22863]
2996. [security] Temporarily disable SO_ACCEPTFILTER support.
[RT #22589]
--- 9.4-ESV-R4 released ---
2970. [security] Adding a NO DATA negative cache entry failed to clear
any matching RRSIG records. A subsequent lookup of
of NO DATA cache entry could trigger a INSIST when the
unexpected RRSIG was also returned with the NO DATA
cache entry.
CVE-2010-3613, VU#706148. [RT #22288]
2968. [security] Named could fail to prove a data set was insecure
before marking it as insecure. One set of conditions
that can trigger this occurs naturally when rolling
DNSKEY algorithms.
CVE-2010-3614, VU#837744. [RT #22309]
2966. [bug] isc_print_vsnprintf() failed to check if there was
space available in the buffer when adding a left
justified character with a non zero width,
(e.g. "%-1c"). [RT #22270]
2962. [port] win32: add more dependancies to BINDBuild.dsw.
[RT #22062]
2786. [bug] Additional could be promoted to answer. [RT #20663]
--- 9.4-ESV-R3 released ---
2925. [bug] Named failed to accept uncachable negative responses
from insecure zones. [RT# 21555]
2921. [bug] The resolver could attempt to destroy a fetch context
too soon. [RT #19878]
2904. [bug] When using DLV, sub-zones of the zones in the DLV,
could be incorrectly marked as insecure instead of
secure leading to negative proofs failing. This was
a unintended outcome from change 2890. [RT# 21392]
2900. [bug] The placeholder negative caching element was not
properly constructed triggering a INSIST in
dns_ncache_towire(). [RT #21346]
2890. [bug] Handle the introduction of new trusted-keys and
DS, DLV RRsets better. [RT #21097]
2869. [bug] Fix arguments to dns_keytable_findnextkeynode() call.
[RT #20877]
2678. [func] Treat DS queries as if "minimal-response yes;"
was set. [RT #20258]
2427. [func] Treat DNSKEY queries as if "minimal-response yes;"
was set. [RT #18528]
--- 9.4-ESV-R2 released ---
2876. [bug] Named could return SERVFAIL for negative responses
from unsigned zones. [RT #21131]
--- 9.4-ESV-R1 released ---
2852. [bug] Handle broken DNSSEC trust chains better. [RT #15619]
--- 9.4-ESV released ---
2831. [security] Do not attempt to validate or cache
+491 -3
View File
@@ -1,4 +1,4 @@
Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC")
Copyright (C) 2004-2011 Internet Systems Consortium, Inc. ("ISC")
Copyright (C) 1996-2003 Internet Software Consortium.
Permission to use, copy, modify, and/or distribute this software for any
@@ -13,9 +13,15 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
$Id: COPYRIGHT,v 1.9.18.7 2010/01/07 23:46:07 tbox Exp $
$Id: COPYRIGHT,v 1.9.18.9 2011-02-22 06:45:07 marka Exp $
Portions Copyright (C) 1996-2001 Nominum, Inc.
Portions of this code release fall under one or more of the
following Copyright notices. Please see individual source
files for details.
For binary releases also see: OpenSSL-LICENSE.
Copyright (C) 1996-2001 Nominum, Inc.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
@@ -28,3 +34,485 @@ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-----------------------------------------------------------------------------
Copyright (C) 1995-2000 by Network Associates, Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND ISC AND NETWORK ASSOCIATES DISCLAIMS
ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE
FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-----------------------------------------------------------------------------
Copyright (C) 2002 Stichting NLnet, Netherlands, [email protected].
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the
above copyright notice and this permission notice appear in all
copies.
THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
USE OR PERFORMANCE OF THIS SOFTWARE.
The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
conceived and contributed by Rob Butler.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the
above copyright notice and this permission notice appear in all
copies.
THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
USE OR PERFORMANCE OF THIS SOFTWARE.
-----------------------------------------------------------------------------
Copyright (c) 1987, 1990, 1993, 1994
The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the University of
California, Berkeley and its contributors.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-----------------------------------------------------------------------------
Copyright (C) The Internet Society 2005. This version of
this module is part of RFC 4178; see the RFC itself for
full legal notices.
(The above copyright notice is per RFC 3978 5.6 (a), q.v.)
-----------------------------------------------------------------------------
Copyright (c) 2004 Masarykova universita
(Masaryk University, Brno, Czech Republic)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the University nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------------------------------------------
Copyright (c) 1997 - 2003 Kungliga Tekniska Högskolan
(Royal Institute of Technology, Stockholm, Sweden).
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the Institute nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-----------------------------------------------------------------------------
Copyright (c) 1998 Doug Rabson
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-----------------------------------------------------------------------------
Copyright ((c)) 2002, Rice University
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Rice University (RICE) nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
This software is provided by RICE and the contributors on an "as is"
basis, without any representations or warranties of any kind, express
or implied including, but not limited to, representations or
warranties of non-infringement, merchantability or fitness for a
particular purpose. In no event shall RICE or contributors be liable
for any direct, indirect, incidental, special, exemplary, or
consequential damages (including, but not limited to, procurement of
substitute goods or services; loss of use, data, or profits; or
business interruption) however caused and on any theory of liability,
whether in contract, strict liability, or tort (including negligence
or otherwise) arising in any way out of the use of this software, even
if advised of the possibility of such damage.
-----------------------------------------------------------------------------
Copyright (c) 1993 by Digital Equipment Corporation.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies, and that
the name of Digital Equipment Corporation not be used in advertising or
publicity pertaining to distribution of the document or software without
specific, written prior permission.
THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
-----------------------------------------------------------------------------
Copyright 2000 Aaron D. Gifford. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTOR(S) ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTOR(S) BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-----------------------------------------------------------------------------
Copyright (c) 1998 Doug Rabson.
Copyright (c) 2001 Jake Burkholder.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-----------------------------------------------------------------------------
Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the project nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-----------------------------------------------------------------------------
Copyright (c) 1999-2000 by Nortel Networks Corporation
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND NORTEL NETWORKS DISCLAIMS
ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NORTEL NETWORKS
BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
-----------------------------------------------------------------------------
Copyright (c) 2000-2002 Japan Network Information Center. All rights reserved.
By using this file, you agree to the terms and conditions set forth bellow.
LICENSE TERMS AND CONDITIONS
The following License Terms and Conditions apply, unless a different
license is obtained from Japan Network Information Center ("JPNIC"),
a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
Chiyoda-ku, Tokyo 101-0047, Japan.
1. Use, Modification and Redistribution (including distribution of any
modified or derived work) in source and/or binary forms is permitted
under this License Terms and Conditions.
2. Redistribution of source code must retain the copyright notices as they
appear in each source code file, this License Terms and Conditions.
3. Redistribution in binary form must reproduce the Copyright Notice,
this License Terms and Conditions, in the documentation and/or other
materials provided with the distribution. For the purposes of binary
distribution the "Copyright Notice" refers to the following language:
"Copyright (c) 2000-2002 Japan Network Information Center. All rights
reserved."
4. The name of JPNIC may not be used to endorse or promote products
derived from this Software without specific prior written approval of
JPNIC.
5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-----------------------------------------------------------------------------
Copyright (C) 2004 Nominet, Ltd.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND NOMINET DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
-----------------------------------------------------------------------------
Portions Copyright RSA Security Inc.
License to copy and use this software is granted provided that it is
identified as "RSA Security Inc. PKCS #11 Cryptographic Token Interface
(Cryptoki)" in all material mentioning or referencing this software.
License is also granted to make and use derivative works provided that
such works are identified as "derived from the RSA Security Inc. PKCS #11
Cryptographic Token Interface (Cryptoki)" in all material mentioning or
referencing the derived work.
RSA Security Inc. makes no representations concerning either the
merchantability of this software or the suitability of this software for
any particular purpose. It is provided "as is" without express or implied
warranty of any kind.
-----------------------------------------------------------------------------
Copyright (c) 1996, David Mazieres <[email protected]>
Copyright (c) 2008, Damien Miller <[email protected]>
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-----------------------------------------------------------------------------
Copyright (c) 2000-2001 The OpenSSL Project. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. All advertising materials mentioning features or use of this
software must display the following acknowledgment:
"This product includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
endorse or promote products derived from this software without
prior written permission. For written permission, please contact
[email protected].
5. Products derived from this software may not be called "OpenSSL"
nor may "OpenSSL" appear in their names without prior written
permission of the OpenSSL Project.
6. Redistributions of any form whatsoever must retain the following
acknowledgment:
"This product includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
+1 -1
View File
@@ -17,7 +17,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: FAQ.xml,v 1.4.4.29 2009/10/06 01:33:54 tbox Exp $ -->
<!-- $Id: FAQ.xml,v 1.4.4.29 2009-10-06 01:33:54 tbox Exp $ -->
<article class="faq">
<title>Frequently Asked Questions about BIND 9</title>
+1 -1
View File
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id: Makefile.in,v 1.43.18.8 2009/02/20 23:46:01 tbox Exp $
# $Id: Makefile.in,v 1.43.18.8 2009-02-20 23:46:01 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
+7 -3
View File
@@ -42,15 +42,19 @@ BIND 9
Stichting NLnet - NLnet Foundation
Nominum, Inc.
BIND 9.4-ESV-R5 (Extended Support Version)
BIND 9.4-ESV-R5 is expected to be the last release in the 9.4
series.
BIND 9.4-ESV (Extended Support Version)
BIND 9.4-ESV is the Extended Support Version of BIND 9.4
and incorporates the final maintenance release fixing bugs
in BIND 9.4.3.
BIND 9.4-ESV will be supported until December 31, 2010, at
which time you will need to upgrade to the current release
of BIND.
BIND 9.4-ESV will be supported until May 31, 2011, at which
time you will need to upgrade to the current release of BIND.
BIND 9.4.3
+1 -1
View File
@@ -109,4 +109,4 @@ about idnkit and this patch.
Bug reports and comments on this kit should be sent to
[email protected] and [email protected], respectively.
; $Id: README.idnkit,v 1.2.2.3 2009/01/19 00:36:25 marka Exp $
; $Id: README.idnkit,v 1.2.2.3 2009-01-19 00:36:25 marka Exp $
@@ -0,0 +1,203 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
- Copyright (C) 2010, 2011 Internet Systems Consortium, Inc. ("ISC")
-
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
- THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: RELEASE-NOTES-BIND-9.4-ESV.html,v 1.1.2.12 2011-07-24 08:05:11 tbox Exp $ -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><link rel="stylesheet" href="release-notes.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.71.1" /></head><body><div class="article" lang="en" xml:lang="en"><div class="titlepage"><hr /></div>
<div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3359578"></a>Introduction</h2></div></div></div>
<p>
BIND 9.4-ESV-R5 is the current production release
of BIND 9.4.
</p>
<p>
This document summarizes changes from BIND 9.4-ESV-R4 to BIND 9.4-ESV-R5.
Please see the CHANGES file in the source code release for a
complete list of all changes.
</p>
</div>
<div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3358597"></a>Download</h2></div></div></div>
<p>
The latest release of BIND 9 software can always be found
on our web site at
<a href="http://www.isc.org/downloads/all" target="_top">http://www.isc.org/downloads/all</a>.
There you will find additional information about each release,
source code, and some pre-compiled versions for certain operating
systems.
</p>
</div>
<div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3358630"></a>Support</h2></div></div></div>
<p>Product support information is available on
<a href="http://www.isc.org/services/support" target="_top">http://www.isc.org/services/support</a>
for paid support options. Free support is provided by our user
community via a mailing list. Information on all public email
lists is available at
<a href="https://lists.isc.org/mailman/listinfo" target="_top">https://lists.isc.org/mailman/listinfo</a>.
</p>
</div>
<div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3358679"></a>New Features</h2></div></div></div>
<div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="id3358720"></a>9.4-ESV-R5</h3></div></div></div>
<p>None.</p>
</div>
</div>
<div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3358748"></a>Feature Changes</h2></div></div></div>
<div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="id3358768"></a>9.4-ESV-R5</h3></div></div></div>
<p>None.</p>
</div>
</div>
<div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3358796"></a>Security Fixes</h2></div></div></div>
<div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="id3358816"></a>9.4-ESV-R5</h3></div></div></div>
<div class="itemizedlist"><ul type="disc"><li>
A bug in NetBSD and FreeBSD kernels with SO_ACCEPTFILTER enabled allows
for a TCP DoS attack. Until there is a kernel fix, ISC is disabling
SO_ACCEPTFILTER support in BIND. [RT #22589]
</li><li>
named, set up to be a caching resolver, is vulnerable to a
user querying a domain with very large resource record sets (RRSets)
when trying to negatively cache the response. Due to an off-by-one
error, caching the response could cause named to crash. [RT #24650]
[CVE-2011-1910]
</li><li>
Change #2912 (see CHANGES) exposed a latent bug in the DNS message
processing code that could allow certain UPDATE requests to crash
named. This was fixed by disambiguating internal database representation
vs DNS wire format data. [RT #24777] [CVE-2011-2464]
</li></ul></div>
</div>
</div>
<div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3358855"></a>Bug Fixes</h2></div></div></div>
<div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="id3358861"></a>9.4-ESV-R5</h3></div></div></div>
<div class="itemizedlist"><ul type="disc"><li>
During RFC5011 processing some journal write errors were not detected.
This could lead to managed-keys changes being committed but not
recorded in the journal files, causing potential inconsistencies
during later processing. [RT #20256]
<p>
A potential NULL pointer deference in the DNS64 code could cause
named to terminate unexpectedly. [RT #20256]
</p>
<p>
A state variable relating to DNSSEC could fail to be set during
some infrequently-executed code paths, allowing it to be used whilst
in an unitialized state during cache updates, with unpredictable results.
[RT #20256]
</p>
<p>
A potential NULL pointer deference in DNSSEC signing code could
cause named to terminate unexpectedly [RT #20256]
</p>
<p>
Several cosmetic code changes were made to silence warnings
generated by a static code analysis tool. [RT #20256]
</p>
</li><li>
Cause named to terminate at startup or rndc reconfig
reload to fail, if a log file specified in the
conf file isn't a plain file. (RT #22771]
</li><li>
Prior to this fix, when named was was writing a zone to disk (as slave,
when resigning, etc.), it might not correctly preserve the case of domain
name labels within RDATA, if the RDATA was not compressible. The result
is that when reloading the zone from disk would, named could serve data
that did not match the RRSIG for that data, due to case mismatch. named
now correctly preserves case. After upgrading to fixed code, the operator
should either resign the data (on the master) or delete the disk file
on the slave and reload the zone. [RT #22863]
</li><li>
Fix the zonechecks system test to fail on error (warning in 9.6,
fatal in 9.7) to match behaviour for 9.4. [RT #22905]
</li><li>
There was a bug in how the clients-per-query code worked with some
query patterns. This could result, in rare circumstances, in having all
the client query slots filled with queries for the same DNS label,
essentially ignoring the max-clients-per-query setting.
[RT #22972]
</li><li>
If a slave initiates a TSIG signed AXFR from the master and the master
fails to correctly TSIG sign the final message, the slave would be left
with the zone in an unclean state. named detected this error too late
and named would crash with an INSIST. The order dependancy has been
fixed. [RT #23254]
</li><li>
Fixed precedence order bug with NS and DNAME records if both are present.
(Also fixed timing of autosign test in 9.7+) [RT #23035]
</li><li>
Changing TTL did not cause dnssec-signzone to generate new signatures.
[RT #23330]
</li><li>
If named encountered a CNAME instead of a DS record when walking
the chain of trust down from the trust anchor, it incorrectly stopped
validating. [RT #23338]
</li><li>
RRSIG records could have time stamps too far in the future.
[RT #23356]
</li><li>
If running on a powerpc CPU and with atomic operations enabled,
named could lock up. Added sync instructions to the end of atomic
operations. [RT #23469]
</li><li>
ixfr-from-differences {master|slave};
failed to select the master/slave zones, resulting in on diff/journal
file being created.
[RT #23580]
</li><li>
Remove bin/tests/system/logfileconfig/ns1/named.conf and
add setup.sh in order to resolve changing named.conf issue. [RT #23687]
</li><li>
The autosign tests attempted to open ports within reserved ranges. Test
now avoids those ports.
[RT #23957]
</li><li>
Named could fail to validate zones list in a DLV that validated insecure
without using DLV and had DS records in the parent zone. [RT #24631]
</li><li>
A bug in FreeBSD kernels causes IPv6 UDP responses greater than
1280 bytes to not fragment as they should. Until there is a kernel
fix, named will work around this by setting IPV6_USE_MIN_MTU on a
per packet basis. [RT #24950]
</li></ul></div>
</div>
</div>
<div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3359002"></a>Thank You</h2></div></div></div>
<p>
Thank you to everyone who assisted us in making this release possible.
If you would like to contribute to ISC to assist us in continuing to make
quality open source software, please visit our donations page at
<a href="http://www.isc.org/supportisc" target="_top">http://www.isc.org/supportisc</a>.
</p>
</div>
</div></body></html>
Binary file not shown.
@@ -0,0 +1,129 @@
__________________________________________________________________
Introduction
BIND 9.4-ESV-R5 is the current production release of BIND 9.4.
This document summarizes changes from BIND 9.4-ESV-R4 to BIND
9.4-ESV-R5. Please see the CHANGES file in the source code release for
a complete list of all changes.
Download
The latest release of BIND 9 software can always be found on our web
site at http://www.isc.org/downloads/all. There you will find
additional information about each release, source code, and some
pre-compiled versions for certain operating systems.
Support
Product support information is available on
http://www.isc.org/services/support for paid support options. Free
support is provided by our user community via a mailing list.
Information on all public email lists is available at
https://lists.isc.org/mailman/listinfo.
New Features
9.4-ESV-R5
None.
Feature Changes
9.4-ESV-R5
None.
Security Fixes
9.4-ESV-R5
* A bug in NetBSD and FreeBSD kernels with SO_ACCEPTFILTER enabled
allows for a TCP DoS attack. Until there is a kernel fix, ISC is
disabling SO_ACCEPTFILTER support in BIND. [RT #22589]
* named, set up to be a caching resolver, is vulnerable to a user
querying a domain with very large resource record sets (RRSets)
when trying to negatively cache the response. Due to an off-by-one
error, caching the response could cause named to crash. [RT #24650]
[CVE-2011-1910]
* Change #2912 (see CHANGES) exposed a latent bug in the DNS message
processing code that could allow certain UPDATE requests to crash
named. This was fixed by disambiguating internal database
representation vs DNS wire format data. [RT #24777] [CVE-2011-2464]
Bug Fixes
9.4-ESV-R5
* During RFC5011 processing some journal write errors were not
detected. This could lead to managed-keys changes being committed
but not recorded in the journal files, causing potential
inconsistencies during later processing. [RT #20256]
A potential NULL pointer deference in the DNS64 code could cause
named to terminate unexpectedly. [RT #20256]
A state variable relating to DNSSEC could fail to be set during
some infrequently-executed code paths, allowing it to be used
whilst in an unitialized state during cache updates, with
unpredictable results. [RT #20256]
A potential NULL pointer deference in DNSSEC signing code could
cause named to terminate unexpectedly [RT #20256]
Several cosmetic code changes were made to silence warnings
generated by a static code analysis tool. [RT #20256]
* Cause named to terminate at startup or rndc reconfig reload to
fail, if a log file specified in the conf file isn't a plain file.
(RT #22771]
* Prior to this fix, when named was was writing a zone to disk (as
slave, when resigning, etc.), it might not correctly preserve the
case of domain name labels within RDATA, if the RDATA was not
compressible. The result is that when reloading the zone from disk
would, named could serve data that did not match the RRSIG for that
data, due to case mismatch. named now correctly preserves case.
After upgrading to fixed code, the operator should either resign
the data (on the master) or delete the disk file on the slave and
reload the zone. [RT #22863]
* Fix the zonechecks system test to fail on error (warning in 9.6,
fatal in 9.7) to match behaviour for 9.4. [RT #22905]
* There was a bug in how the clients-per-query code worked with some
query patterns. This could result, in rare circumstances, in having
all the client query slots filled with queries for the same DNS
label, essentially ignoring the max-clients-per-query setting. [RT
#22972]
* If a slave initiates a TSIG signed AXFR from the master and the
master fails to correctly TSIG sign the final message, the slave
would be left with the zone in an unclean state. named detected
this error too late and named would crash with an INSIST. The order
dependancy has been fixed. [RT #23254]
* Fixed precedence order bug with NS and DNAME records if both are
present. (Also fixed timing of autosign test in 9.7+) [RT #23035]
* Changing TTL did not cause dnssec-signzone to generate new
signatures. [RT #23330]
* If named encountered a CNAME instead of a DS record when walking
the chain of trust down from the trust anchor, it incorrectly
stopped validating. [RT #23338]
* RRSIG records could have time stamps too far in the future. [RT
#23356]
* If running on a powerpc CPU and with atomic operations enabled,
named could lock up. Added sync instructions to the end of atomic
operations. [RT #23469]
* ixfr-from-differences {master|slave}; failed to select the
master/slave zones, resulting in on diff/journal file being
created. [RT #23580]
* Remove bin/tests/system/logfileconfig/ns1/named.conf and add
setup.sh in order to resolve changing named.conf issue. [RT #23687]
* The autosign tests attempted to open ports within reserved ranges.
Test now avoids those ports. [RT #23957]
* Named could fail to validate zones list in a DLV that validated
insecure without using DLV and had DS records in the parent zone.
[RT #24631]
* A bug in FreeBSD kernels causes IPv6 UDP responses greater than
1280 bytes to not fragment as they should. Until there is a kernel
fix, named will work around this by setting IPV6_USE_MIN_MTU on a
per packet basis. [RT #24950]
Thank You
Thank you to everyone who assisted us in making this release possible.
If you would like to contribute to ISC to assist us in continuing to
make quality open source software, please visit our donations page at
http://www.isc.org/supportisc.
+1 -1
View File
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: acconfig.h,v 1.44.18.7 2008/12/01 23:45:56 tbox Exp $ */
/* $Id: acconfig.h,v 1.44.18.7 2008-12-01 23:45:56 tbox Exp $ */
/*! \file */
+1 -1
View File
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id: Makefile.in,v 1.23 2004/03/05 04:57:10 marka Exp $
# $Id: Makefile.in,v 1.23 2004-03-05 04:57:10 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
+1 -1
View File
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id: Makefile.in,v 1.24.18.6 2006/06/09 00:54:08 marka Exp $
# $Id: Makefile.in,v 1.24.18.6 2006-06-09 00:54:08 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
+1 -1
View File
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: check-tool.c,v 1.10.18.23 2009/09/24 21:38:50 jinmei Exp $ */
/* $Id: check-tool.c,v 1.10.18.23 2009-09-24 21:38:50 jinmei Exp $ */
/*! \file */
+1 -1
View File
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: check-tool.h,v 1.7.18.4 2005/06/20 01:19:25 marka Exp $ */
/* $Id: check-tool.h,v 1.7.18.4 2005-06-20 01:19:25 marka Exp $ */
#ifndef CHECK_TOOL_H
#define CHECK_TOOL_H
+1 -1
View File
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
.\" $Id: named-checkconf.8,v 1.16.18.14 2009/07/11 01:31:43 tbox Exp $
.\" $Id: named-checkconf.8,v 1.16.18.14 2009-07-11 01:31:43 tbox Exp $
.\"
.hy 0
.ad l
+1 -1
View File
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: named-checkconf.c,v 1.28.18.18 2009/02/16 23:46:03 tbox Exp $ */
/* $Id: named-checkconf.c,v 1.28.18.18 2009-02-16 23:46:03 tbox Exp $ */
/*! \file */
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: named-checkconf.docbook,v 1.8.18.10 2007/08/28 07:19:55 tbox Exp $ -->
<!-- $Id: named-checkconf.docbook,v 1.8.18.10 2007-08-28 07:19:55 tbox Exp $ -->
<refentry id="man.named-checkconf">
<refentryinfo>
<date>June 14, 2000</date>
+1 -1
View File
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: named-checkconf.html,v 1.9.18.21 2009/07/11 01:31:43 tbox Exp $ -->
<!-- $Id: named-checkconf.html,v 1.9.18.21 2009-07-11 01:31:43 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+1 -1
View File
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
.\" $Id: named-checkzone.8,v 1.18.18.25 2009/07/11 01:31:43 tbox Exp $
.\" $Id: named-checkzone.8,v 1.18.18.25 2009-07-11 01:31:43 tbox Exp $
.\"
.hy 0
.ad l
+1 -1
View File
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: named-checkzone.c,v 1.29.18.24 2009/05/29 02:19:20 marka Exp $ */
/* $Id: named-checkzone.c,v 1.29.18.24 2009-05-29 02:19:20 marka Exp $ */
/*! \file */
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: named-checkzone.docbook,v 1.11.18.23 2009/01/22 23:45:59 tbox Exp $ -->
<!-- $Id: named-checkzone.docbook,v 1.11.18.23 2009-01-22 23:45:59 tbox Exp $ -->
<refentry id="man.named-checkzone">
<refentryinfo>
<date>June 13, 2000</date>
+1 -1
View File
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: named-checkzone.html,v 1.11.18.32 2009/07/11 01:31:43 tbox Exp $ -->
<!-- $Id: named-checkzone.html,v 1.11.18.32 2009-07-11 01:31:43 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+1 -1
View File
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id: Makefile.in,v 1.33.18.6 2005/09/09 14:11:04 marka Exp $
# $Id: Makefile.in,v 1.33.18.6 2005-09-09 14:11:04 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
+1 -1
View File
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
.\" $Id: dig.1,v 1.23.18.27 2009/07/11 01:31:43 tbox Exp $
.\" $Id: dig.1,v 1.23.18.27 2009-07-11 01:31:43 tbox Exp $
.\"
.hy 0
.ad l
+1 -1
View File
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dig.c,v 1.186.18.37 2009/05/06 10:21:00 fdupont Exp $ */
/* $Id: dig.c,v 1.186.18.37 2009-05-06 10:21:00 fdupont Exp $ */
/*! \file */
+1 -1
View File
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: dig.docbook,v 1.17.18.27 2009/02/02 04:45:22 marka Exp $ -->
<!-- $Id: dig.docbook,v 1.17.18.27 2009-02-02 04:45:22 marka Exp $ -->
<refentry id="man.dig">
<refentryinfo>
+1 -1
View File
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: dig.html,v 1.13.18.33 2009/07/11 01:31:44 tbox Exp $ -->
<!-- $Id: dig.html,v 1.13.18.33 2009-07-11 01:31:44 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+1 -1
View File
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dighost.c,v 1.259.18.58 2009/06/24 03:44:52 marka Exp $ */
/* $Id: dighost.c,v 1.259.18.58 2009-06-24 03:44:52 marka Exp $ */
/*! \file
* \note
+1 -1
View File
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
.\" $Id: host.1,v 1.14.18.18 2009/07/11 01:31:44 tbox Exp $
.\" $Id: host.1,v 1.14.18.18 2009-07-11 01:31:44 tbox Exp $
.\"
.hy 0
.ad l
+1 -1
View File
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: host.c,v 1.94.18.22 2009/09/08 23:29:03 marka Exp $ */
/* $Id: host.c,v 1.94.18.22 2009-09-08 23:29:03 marka Exp $ */
/*! \file */
+1 -1
View File
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: host.docbook,v 1.5.18.15 2009/01/22 23:46:00 tbox Exp $ -->
<!-- $Id: host.docbook,v 1.5.18.15 2009-01-22 23:46:00 tbox Exp $ -->
<refentry id="man.host">
<refentryinfo>
+1 -1
View File
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: host.html,v 1.7.18.24 2009/07/11 01:31:44 tbox Exp $ -->
<!-- $Id: host.html,v 1.7.18.24 2009-07-11 01:31:44 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+1 -1
View File
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dig.h,v 1.82.18.25 2008/12/16 23:46:02 tbox Exp $ */
/* $Id: dig.h,v 1.82.18.25 2008-12-16 23:46:02 tbox Exp $ */
#ifndef DIG_H
#define DIG_H
+1 -1
View File
@@ -12,7 +12,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
.\" $Id: nslookup.1,v 1.1.10.15 2009/07/11 01:31:44 tbox Exp $
.\" $Id: nslookup.1,v 1.1.10.15 2009-07-11 01:31:44 tbox Exp $
.\"
.hy 0
.ad l
+1 -1
View File
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: nslookup.c,v 1.101.18.20 2009/05/06 23:45:59 tbox Exp $ */
/* $Id: nslookup.c,v 1.101.18.20 2009-05-06 23:45:59 tbox Exp $ */
#include <config.h>
+1 -1
View File
@@ -17,7 +17,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: nslookup.docbook,v 1.4.2.13 2007/08/28 07:19:55 tbox Exp $ -->
<!-- $Id: nslookup.docbook,v 1.4.2.13 2007-08-28 07:19:55 tbox Exp $ -->
<!--
- Copyright (c) 1985, 1989
- The Regents of the University of California. All rights reserved.
+1 -1
View File
@@ -13,7 +13,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: nslookup.html,v 1.1.10.22 2009/07/11 01:31:44 tbox Exp $ -->
<!-- $Id: nslookup.html,v 1.1.10.22 2009-07-11 01:31:44 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+1 -1
View File
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id: Makefile.in,v 1.26.18.4 2005/05/02 00:26:11 marka Exp $
# $Id: Makefile.in,v 1.26.18.4 2005-05-02 00:26:11 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
+1 -1
View File
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
.\" $Id: dnssec-keygen.8,v 1.23.18.17 2009/07/11 01:31:44 tbox Exp $
.\" $Id: dnssec-keygen.8,v 1.23.18.17 2009-07-11 01:31:44 tbox Exp $
.\"
.hy 0
.ad l
+1 -1
View File
@@ -16,7 +16,7 @@
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dnssec-keygen.c,v 1.66.18.10 2007/08/28 07:19:55 tbox Exp $ */
/* $Id: dnssec-keygen.c,v 1.66.18.10 2007-08-28 07:19:55 tbox Exp $ */
/*! \file */
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: dnssec-keygen.docbook,v 1.7.18.13 2008/10/15 23:46:06 tbox Exp $ -->
<!-- $Id: dnssec-keygen.docbook,v 1.7.18.13 2008-10-15 23:46:06 tbox Exp $ -->
<refentry id="man.dnssec-keygen">
<refentryinfo>
<date>June 30, 2000</date>
+1 -1
View File
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: dnssec-keygen.html,v 1.9.18.23 2009/07/11 01:31:44 tbox Exp $ -->
<!-- $Id: dnssec-keygen.html,v 1.9.18.23 2009-07-11 01:31:44 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+1 -1
View File
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
.\" $Id: dnssec-signzone.8,v 1.28.18.20 2009/07/11 01:31:44 tbox Exp $
.\" $Id: dnssec-signzone.8,v 1.28.18.20 2009-07-11 01:31:44 tbox Exp $
.\"
.hy 0
.ad l
Loaded 100 of 6333 files, more files were not shown because too many files have changed in this diff. Show more