]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoUpdate to a 7-Aug-2011 release.
Ruslan Ermilov [Tue, 9 Aug 2011 12:54:43 +0000 (12:54 +0000)]
Update to a 7-Aug-2011 release.

Approved by: re (kib)

12 years agoVendor import of bwk's 7-Aug-2011 release.
Ruslan Ermilov [Tue, 9 Aug 2011 12:23:27 +0000 (12:23 +0000)]
Vendor import of bwk's 7-Aug-2011 release.

12 years agoDo not block zero report ID. It is correct value for devices with single
Alexander Motin [Tue, 9 Aug 2011 08:11:26 +0000 (08:11 +0000)]
Do not block zero report ID. It is correct value for devices with single
ID. This fixes USB_SET_IMMED call (synchronous operation) of the uhid(4)
driver on devices with single report ID.

Reviewed by: hselasky
Approved by: re (kib)
MFC after: 1 week

12 years agoMake clear that the -U option can be dangerous. [1]
Doug Barton [Tue, 9 Aug 2011 07:42:19 +0000 (07:42 +0000)]
Make clear that the -U option can be dangerous. [1]

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

Update the copyright.

Requested by: peter [1]

Approved by: re (kib)

12 years agoRemove this call, now that I've solved the radar module problem without
Adrian Chadd [Tue, 9 Aug 2011 04:24:56 +0000 (04:24 +0000)]
Remove this call, now that I've solved the radar module problem without
needing this particular modification.

It can be called during ath_dfs_radar_enable() and still achieve the
same functionality, so I am.

Approved by: re (kib, blanket)

12 years agoFix buffer overflow in sys/boot/common/util.c's printf(), when printing
Dimitry Andric [Mon, 8 Aug 2011 20:53:04 +0000 (20:53 +0000)]
Fix buffer overflow in sys/boot/common/util.c's printf(), when printing
large (>= 10^10) numbers.  In theory, 20 characaters should be enough,
but bump the buffer to 32 characters, so we have some room for the
future.

Reviewed by: pjd
Approved by: re (kib)

12 years agoCreate timeval2timespec() and timespec2timeval().
Jonathan Anderson [Mon, 8 Aug 2011 20:36:52 +0000 (20:36 +0000)]
Create timeval2timespec() and timespec2timeval().

These functions will be used by process descriptors to convert process
creation time into process descriptor [acm]time.

Approved by: re (kib), mentor (rwatson)
Suggested by: jhb
Sponsored by: Google Inc

12 years agoAnd add another missing brace. Another pointy hat moment.
Adrian Chadd [Mon, 8 Aug 2011 19:03:26 +0000 (19:03 +0000)]
And add another missing brace. Another pointy hat moment.
This one however isn't used by any public code yet, so it
didn't break the build.

Approved by: re (kib, blanket)

12 years agoBitten again by the optional HALDEBUG compilation.
Adrian Chadd [Mon, 8 Aug 2011 18:05:22 +0000 (18:05 +0000)]
Bitten again by the optional HALDEBUG compilation.

Remove this debugging, it's not needed anymore and when not enabled,
those variables trigger a compiler warning.

Approved by: re (kib, blanket)
Pointy-hat-to: adrian, for not testing a non-debug compile of this code enough

12 years agoThe older HAL code sets up the regulatory domain once; FreeBSD/net80211
Adrian Chadd [Mon, 8 Aug 2011 17:33:35 +0000 (17:33 +0000)]
The older HAL code sets up the regulatory domain once; FreeBSD/net80211
allows it to be overridden at runtime.

Thus, add a function which updates ah_dfsDomain after a channel set
call to ath_hal_set_channels().

Approved by: re (kib, blanket)

12 years agoWhen setting a fixed channel on adapters with 11n support the scan
Bernhard Schmidt [Mon, 8 Aug 2011 16:29:07 +0000 (16:29 +0000)]
When setting a fixed channel on adapters with 11n support the scan
channel list ends up with 2 entries, the HT and the legacy channel.
The scan itself is currently always done at legacy rates so we end
up receiving scan results for legacy networks on the HT channel and
erroneously assigning the BSS to the 11n channel. As the channel's
capabilities are used to setup the adapter we might end up with
non-working settings and/or firmware crashes.

Fix this by ensuring that scan results received on a HT channel
are only assigned to that channel if the htcap IE is available,
else use the legacy channel equivalent.

Tested by: Pawel Worach, Raoul Megelas, Maciej Milewski,
Andrei <az at azsupport dot com>
Approved by: re (kib)

12 years agoIntroduce some more DFS related hooks, inspired both by local work
Adrian Chadd [Mon, 8 Aug 2011 16:22:42 +0000 (16:22 +0000)]
Introduce some more DFS related hooks, inspired both by local work
and the Atheros reference code.

The radar detection code needs to know what the current DFS domain is.
Since net80211 doesn't currently know this information, it's extracted
from the HAL regulatory domain information.

The specifics:

* add a new ath_dfs API hook, ath_dfs_init_radar_filters(), which
  updates the radar filters whenever the regulatory domain changes.
* add HAL_DFS_DOMAIN which describes the currently configured DFS domain .
* add a new HAL internal variable which tracks the currently configured
  HAL DFS domain.
* add a new HAL capability, HAL_CAP_DFS_DMN, which returns the currently
  configured HAL DFS domain setting.
* update the HAL DFS domain setting whenever the channel setting is
  updated.

Since this isn't currently used by any radar code, these should all
be no-ops for existing users.

Obtained from: Atheros
Submitted by: KBC Networks, sibridge
Approved by: re (kib, blanket)

12 years ago.. and add a missing bracket.
Adrian Chadd [Mon, 8 Aug 2011 15:42:37 +0000 (15:42 +0000)]
.. and add a missing bracket.

Approved by: re (kib, blanket)

12 years agoFix method naming to match the reference HAL definition.
Adrian Chadd [Mon, 8 Aug 2011 15:41:03 +0000 (15:41 +0000)]
Fix method naming to match the reference HAL definition.

Obtained from: Atheros
Approved by: re (kib, blanket)

12 years agoRevert r224655 and r224614 because vn_fullpath* does not always work
Martin Matuska [Mon, 8 Aug 2011 14:02:08 +0000 (14:02 +0000)]
Revert r224655 and r224614 because vn_fullpath* does not always work
on nullfs mounts.

Change shall be reconsidered after 9.0 is released.

Requested by: re (kib)
Approved by: re (kib)

12 years agoAdd another HAL method - ah_isFastClockEnabled - which returns AH_TRUE
Adrian Chadd [Mon, 8 Aug 2011 13:15:39 +0000 (13:15 +0000)]
Add another HAL method - ah_isFastClockEnabled - which returns AH_TRUE
if 5ghz fast clock is enabled in the current operating mode.

It's slightly dirty, but it's part of the reference HAL and used by
the (currently closed-source) radar event code to map radar pulses
back to microsecond durations.

Obtained from: Atheros
Approved by: re (kib, blanket)

12 years agoChange "options NFSCLIENT" to "options NFSCL" in diskless.8,
Rick Macklem [Mon, 8 Aug 2011 13:13:22 +0000 (13:13 +0000)]
Change "options NFSCLIENT" to "options NFSCL" in diskless.8,
since that is now the default NFS client.
This is a content change.

Reported by: shuvaev at physik.uni-wuerzburg.de
Approved by: re (hrs)

12 years agoIn rtinit1(), before rtrequest1_fib() is called, info.rti_flags is
Kevin Lo [Mon, 8 Aug 2011 05:25:51 +0000 (05:25 +0000)]
In rtinit1(), before rtrequest1_fib() is called, info.rti_flags is
initialized by flags (function argument) or-ed with ifa->ifa_flags.
If both NIC has a loopback route to itself, so IFA_RTSELF is set on ifa(s).
As IFA_RTSELF is defined by RTF_HOST, rtrequest1_fib() is called with
RTF_HOST flag even if netmask is not NULL. Consequently, netmask is set
to zero in rtrequest1_fib(), and request to add network route is changed
under hands to request to add host route.

Tested by: Andrew Boyer <aboyer at averesystems.com>
Submitted by: Svatopluk Kraus <onwahe at gmail dot com>
Approved by: re (hrs)

12 years agocatstrg() does not set the resulting string length.
Kevin Lo [Mon, 8 Aug 2011 05:22:09 +0000 (05:22 +0000)]
catstrg() does not set the resulting string length.

PR: bin/152549
Submitted by: Henning Petersen <henning dot petersen at t-online dot de>
Approved by: re (hrs)

12 years agoFix a pathname (s,netinet/if_ether.h,net/ethernet.h,).
Hiroki Sato [Mon, 8 Aug 2011 03:09:03 +0000 (03:09 +0000)]
Fix a pathname (s,netinet/if_ether.h,net/ethernet.h,).

PR: docs/159341
Submitted by: Garrett Cooper
Approved by: re (kib)

12 years agoMerge revision 3554 from libarchive's release/2.8 branch:
Martin Matuska [Sun, 7 Aug 2011 20:24:32 +0000 (20:24 +0000)]
Merge revision 3554 from libarchive's release/2.8 branch:

Partial merge of 2431 from trunk:  Retry writes on EINTR.
This should fix the SIGINT handler in bsdtar.
Note:  The rest of r2431 can't be merged, since it interacts
with a big write-side rearchitecture.

PR: bin/149409
Reviewed by: kientzle
Approved by: re (kib)
MFC after: 3 days

12 years agoChange all the sample kernel configurations to use
Rick Macklem [Sun, 7 Aug 2011 20:16:46 +0000 (20:16 +0000)]
Change all the sample kernel configurations to use
NFSCL, NFSD instead of NFSCLIENT, NFSSERVER since
NFSCL and NFSD are now the defaults. The client change is
needed for diskless configurations, so that the root
mount works for fstype nfs.
Reported by seanbru at yahoo-inc.com for i386/XEN.

Approved by: re (hrs)

12 years agoConvert pmcstat about using cpuset_t rather than relying on plain 32 bit
Attilio Rao [Sun, 7 Aug 2011 18:37:05 +0000 (18:37 +0000)]
Convert pmcstat about using cpuset_t rather than relying on plain 32 bit
ints.  That fixes a first bug where pmcstat wasn't using the old
cpumask_t interface and now also brings the full support for more
than 32 cpus.

While here, make the functions pmcstat_clone_event_descriptor() and
pmcstat_get_cpumask() private to pmcstat.

The problem of assuming cpu dense masks still persists and should be
eventually fixed, as reported by avg.

Tested by: pluknet
Reviewed by: gnn
Approved by: re (kib)

12 years agoChange lwp to int64_t as thr_pread_long() always uses a 64-bit value
Marius Strobl [Sun, 7 Aug 2011 15:52:13 +0000 (15:52 +0000)]
Change lwp to int64_t as thr_pread_long() always uses a 64-bit value
in order to account for LP64 targets when cross-debugging on ILP32,
allowing r224683 to compile on ILP32.
Note that thr_p{read,write}_{long,ptr}() still incorrectly use the size
of the respective types on the host rather than that on the target when
accessing the target address space which still needs to be fixed. This
means that r224683 alone may not be sufficient to solve the problem it's
intended to fix when cross-debugging.

Approved by: re (hrs)

12 years agoAdd compatibility for ISO images created with unfixed makefs that
Martin Matuska [Sun, 7 Aug 2011 08:42:36 +0000 (08:42 +0000)]
Add compatibility for ISO images created with unfixed makefs that
violated ECMA-119 (ISO9660): allow reserved4 to be 0x20 in PVD.
This allows tar to read FreeBSD distribution ISO images created
with makefs prior to NetBSD bin/45217 bugfix (up to 9.0-BETA1).

In addition, merge following important bugfixes from
libarchive's release/2.8 branch:

Revision 2812:
Merge 2811 from trunk:  Don't try to verify that compression-level=0
produces larger results than the default compression, since this isn't
true for all versions of liblzma.

Revision 2817:
Merge 2814 from trunk: Fix Issue 121 (mtree parser error)
http://code.google.com/p/libarchive/issues/detail?id=121

Revision 2820:
Fix issue 119.
Change the file location check that a file location does not exceed
volume block. New one is that a file content does not exceed volume
block(end of an ISO image). It is better than previous check even
if the issue did not happen.

While reading an ISO image generated by an older version of mkisofs
utility, a file location indicates the end the ISO image if its file
size is zero and it is the last file of all files of the ISO image,
so it is possible that the location value is the same as the number
of the total block of the ISO image.

http://code.google.com/p/libarchive/issues/detail?id=119

Revision 2955:
Issue 134:  Fix libarchive 2.8 crashing in archive_write_finish() when
the open has failed and we're trying to write Zip format.

http://code.google.com/p/libarchive/issues/detail?id=134

Revision 2958:
Followup on Issue 134:
 1) Port test_open_failure to libarchive 2.8 branch to test
    the problem reported in Issue 134.
    This test also shows that archive_read_open() sometimes
    fails to report open errors correctly.
 2) Fix the bug in archive_read.c
 3) Comment out the tests that close functions are invoked
    promptly when open fails; that's fully fixed in libarchive 3.0,
    but I don't think it's worth fixing here.

Revision 3484:
Use uintmax_t with %ju

Revision 3487:
Fix issue 163.
Correctly allocate enough memory for a input buffer saved.

http://code.google.com/p/libarchive/issues/detail?id=163

Revision 3542:
Merge 2516, 2536 from trunk:  Allow path table offset values of
0 and 18, which are used by some ISO writers.

Reviewed by: kientzle
Approved by: re (kib)
MFC after: 3 days

12 years agoFix NetBSD PR bin/44114:
Martin Matuska [Sun, 7 Aug 2011 08:35:15 +0000 (08:35 +0000)]
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
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
Approved by: re (kib)
Obtained from: NetBSD
MFC after: 3 days

12 years agoFix an error in kmem_alloc_attr(). Unless "tries" is updated,
Alan Cox [Sun, 7 Aug 2011 00:11:39 +0000 (00:11 +0000)]
Fix an error in kmem_alloc_attr().  Unless "tries" is updated,
kmem_alloc_attr() could get stuck in a loop.

Approved by: re (kib)
MFC after: 3 days

12 years agoProperly initialise the "len" argument to getsockname(2) in the tcpdrop
Robert Watson [Sat, 6 Aug 2011 19:20:17 +0000 (19:20 +0000)]
Properly initialise the "len" argument to getsockname(2) in the tcpdrop
regression test so that it works (more) consistently.

Approved by: re (bz)
Sponsored by: Juniper Networks

12 years agoCompile fbsd-threads.c. Amongst others this is necessary for a working
Marius Strobl [Sat, 6 Aug 2011 17:53:45 +0000 (17:53 +0000)]
Compile fbsd-threads.c. Amongst others this is necessary for a working
kgdb(1).

Reviewed by: marcel
Approved by: re (kib)
MFC after: 1 week

12 years agoImplement functions necessary for compiling fbsd-threads.c.
Marius Strobl [Sat, 6 Aug 2011 17:52:25 +0000 (17:52 +0000)]
Implement functions necessary for compiling fbsd-threads.c.

Reviewed by: marcel
Approved by: re (kib)
MFC after: 1 week

12 years agoImplement
Marius Strobl [Sat, 6 Aug 2011 17:50:37 +0000 (17:50 +0000)]
Implement

Reviewed by: marcel
Approved by: re (kib)
MFC after: 1 week

12 years agoUse the size of struct fpreg rather than of the pointer to it when copying
Marius Strobl [Sat, 6 Aug 2011 17:49:21 +0000 (17:49 +0000)]
Use the size of struct fpreg rather than of the pointer to it when copying
the FPU state.

Reviewed by: marcel
Approved by: re (kib)
MFC after: 1 week

12 years agoThe tid member of struct pthread actually is long so read it as such.
Marius Strobl [Sat, 6 Aug 2011 17:48:30 +0000 (17:48 +0000)]
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
Approved by: re (kib)
MFC after: 1 week

12 years ago- Merge from r147740:
Marius Strobl [Sat, 6 Aug 2011 17:45:52 +0000 (17:45 +0000)]
- 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.
- Wrap a too long line.

Approved by: re (kib)
MFC after: 1 week

12 years agoRemove a shortcut which is invalid with MAXCPU > IDR_CHEETAH_MAX_BN_PAIRS.
Marius Strobl [Sat, 6 Aug 2011 17:45:11 +0000 (17:45 +0000)]
Remove a shortcut which is invalid with MAXCPU > IDR_CHEETAH_MAX_BN_PAIRS.

Approved by: re (kib)

12 years agoAdd support for PBVM addresses. In a nutshell this means:
Marcel Moolenaar [Sat, 6 Aug 2011 15:59:54 +0000 (15:59 +0000)]
Add support for PBVM addresses. In a nutshell this means:
o   get the physical address and size of the PBVM page table. This
    can be found in the bootinfo structure, of which the physical
    address is recorded as the ELF entry point.
o   translate region 4 virtual addresses to physical addresses using
    the PBVM page table.

In _kvm_kvatop() make the distinction between physical address and
core file offset a little clearer to avoid confusion. To further
enhance readability, always store the translated address into pa
so that it's obvious how the translation from va to pa happened.

Approved by: re (blanket)

12 years agoRather than edit the nsswitch.conf file based on ${MK_NIS} == "no"
Doug Barton [Sat, 6 Aug 2011 09:16:53 +0000 (09:16 +0000)]
Rather than edit the nsswitch.conf file based on ${MK_NIS} == "no"
comment out the NIS _compat options by default, but leave them in
the file for the convenience of users who want to enable it.

Update the comment in the file accordingly.

Reviewed by: ed
Approved by: re (hrs)

12 years agoGavin documented these alternate options in good faith in r222751
Doug Barton [Sat, 6 Aug 2011 09:13:09 +0000 (09:13 +0000)]
Gavin documented these alternate options in good faith in r222751
based on the patch in the PR, however he was unaware that they were
undocumented intentionally. This patch moves the information about
these alternates into a comment which also explains why they are
undocumented.

Approved by: re (hrs)

12 years agoFix a silly typo on my part.
Doug Barton [Sat, 6 Aug 2011 09:11:30 +0000 (09:11 +0000)]
Fix a silly typo on my part.

Approved by: re (hrs)

12 years agoFix kernel core dumps now that the kernel is using PBVM. The basic
Marcel Moolenaar [Sat, 6 Aug 2011 03:40:33 +0000 (03:40 +0000)]
Fix kernel core dumps now that the kernel is using PBVM. The basic
problem to solve is that we don't have a fixed mapping from kernel
text to physical address so that libkvm can bootstrap itself. We
solve this by passing the physical address of the bootinfo structure
to the consumer as the entry point of the core file. This way,
libkvm can extract the PBVM page table information and locate the
kernel in the core file.
We also need to dump memory chunks of type loader data, because
those hold the kernel and the PBVM page table (among other things).

Approved by: re (blanket)

12 years agoFollow-up commit: refactor pmap_kextract() to make it easier to
Marcel Moolenaar [Fri, 5 Aug 2011 23:10:47 +0000 (23:10 +0000)]
Follow-up commit: refactor pmap_kextract() to make it easier to
catch and debug issues like the one fixed in the previous commit:
Replace all return statements with goto statements so that we end
up at a single place with a value for the physical address.
Print a message for all unknown KVA addresses.

Approved by: re (blanket)

12 years agoRemove stray semicolon in pmap_kextract() that turned the conditional
Marcel Moolenaar [Fri, 5 Aug 2011 23:05:46 +0000 (23:05 +0000)]
Remove stray semicolon in pmap_kextract() that turned the conditional
"return (0)" into an unconditional one and as such broke PBVM address
queries -- such as during kernel core dumps.

Approved by: re (blanket)

12 years agoMake octeon_ap_boot 64 bits to handle MAXCPU up to 64.
Marcel Moolenaar [Fri, 5 Aug 2011 22:54:42 +0000 (22:54 +0000)]
Make octeon_ap_boot 64 bits to handle MAXCPU up to 64.
Better construction of CPU mask in platform_cpu_mask().
Release cores still in reset when platform_start_ap() is called.

Reviewed by: imp, marcel
Obtained from: Juniper Networks, Inc
Author: Andrew Duane
Approved by: re (kib)

12 years agoExpect fchflags(2) to fail with EOPNOTSUPP on NFS.
Jonathan Anderson [Fri, 5 Aug 2011 17:43:11 +0000 (17:43 +0000)]
Expect fchflags(2) to fail with EOPNOTSUPP on NFS.

Even if we have CAP_FCHFLAGS, fchflags(2) fails on NFS. This is normal
and expected, so don't fail the test because of it.

Note that, whether or not we are on NFS, fchflags(2) should always fail
with ENOTCAPABLE if we are using a capability that does not have the
CAP_FCHFLAGS right.

Approved by: re (kib), mentor (rwatson)
Sponsored by: Google Inc

12 years agoRemove NIS entries from /etc/nsswitch.conf for WITHOUT_NIS.
Ed Schouten [Fri, 5 Aug 2011 17:33:12 +0000 (17:33 +0000)]
Remove NIS entries from /etc/nsswitch.conf for WITHOUT_NIS.

We already modify various configuration files in /etc based on build
configuration. This is not done for nsswitch.conf right now when setting
WITHOUT_NIS. This breaks various utilities, including crond, that depend
on working databases.

Approved by: re (kib)
MFC after: 1 month

12 years agoFor POLA reasons, disable SGR sequences in catpages.
Ulrich Spörlein [Fri, 5 Aug 2011 15:07:28 +0000 (15:07 +0000)]
For POLA reasons, disable SGR sequences in catpages.

See r222647 for a similar change to bsd.doc.mk after SGR was generally
turned on in groff.

Suggested by: ru
Approved by: re (kib)

12 years agoAdd back ftp4, a new machine has taken its place. ftp2 and ftp8 are both IPv6 capable
Ollivier Robert [Fri, 5 Aug 2011 15:02:17 +0000 (15:02 +0000)]
Add back ftp4, a new machine has taken its place. ftp2 and ftp8 are both IPv6 capable
mirrors.  cvsup4/ftp4 have already been added to the handbook.

Reviewed by: nathanw
Approved by: re (kib)

12 years agoThe change in r224615 didn't take into account that vn_fullpath_global()
Martin Matuska [Fri, 5 Aug 2011 11:12:50 +0000 (11:12 +0000)]
The change in r224615 didn't take into account that vn_fullpath_global()
doesn't operate on locked vnode. This could cause a panic.

Fix by unlocking vnode, re-locking afterwards and verifying that it wasn't
renamed or deleted. To improve readability and reduce code size, move code
to a new static function vfs_verify_global_path().

In addition, fix missing giant unlock in unmount().

Reported by: David Wolfskill <david@catwhisker.org>
Reviewed by: kib
Approved by: re (bz)
MFC after: 2 weeks

12 years agoFlesh out the cap_test regression test.
Jonathan Anderson [Thu, 4 Aug 2011 17:17:57 +0000 (17:17 +0000)]
Flesh out the cap_test regression test.

Add more regression testing, some of which is expected to fail until we
commit more kernel implementation.

Approved by: re (kib), mentor (rwatson)
Sponsored by: Google Inc

12 years agoThe release/pc98/mkisoimages.sh added as part of r221466 now also takes "-b"
Marius Strobl [Thu, 4 Aug 2011 14:38:30 +0000 (14:38 +0000)]
The release/pc98/mkisoimages.sh added as part of r221466 now also takes "-b"
to indicate the creation of a bootable image.

Approved by: re (kib)

12 years agoFlesh out the cap_test regression test.
Jonathan Anderson [Thu, 4 Aug 2011 14:20:13 +0000 (14:20 +0000)]
Flesh out the cap_test regression test.

Add more regression testing, some of which is expected to fail until we
commit more kernel implementation.

Approved by: re (kib), mentor (rwatson)
Sponsored by: Google Inc

12 years agoDon't try to free() an address returned by mmap(). This appears to be
Ed Maste [Thu, 4 Aug 2011 14:18:09 +0000 (14:18 +0000)]
Don't try to free() an address returned by mmap().  This appears to be
triggered by the same .o being included twice on the command line.

Found by: Nima Misaghian at Sandvine
Reviewed by: kientzle, kaiw
Approved by: re
MFC after: 1 week

12 years agoClean up markup.
Ruslan Ermilov [Thu, 4 Aug 2011 08:50:33 +0000 (08:50 +0000)]
Clean up markup.

Approved by: re (kib)

12 years agoUndo this for now. It's "right", but it means everything will rely on
Adrian Chadd [Wed, 3 Aug 2011 23:57:38 +0000 (23:57 +0000)]
Undo this for now. It's "right", but it means everything will rely on
the ar9130 code.

Since at least one kernel config specifies individual ath HAL chips
rather than just "device ath_hal" (arm/AVILA), I'm doing this so people
aren't caught out when they update to -HEAD or 9.0 and discover their
ath setup doesn't compile.

I'll revisit this with a proper fix sometime before 9.0-RELEASE.

Approved by: re (kib, blanket)
Pointed out by: ray@
Pointy hat to: adrian@

12 years agoFix two more $FreeBSD$ keywords.
Brooks Davis [Wed, 3 Aug 2011 20:21:52 +0000 (20:21 +0000)]
Fix two more $FreeBSD$ keywords.

Reported by: pluknet
Approved by: re (implicit)

12 years agoThe result of a joint work between rrs@ and myself at the IETF:
Michael Tuexen [Wed, 3 Aug 2011 20:21:00 +0000 (20:21 +0000)]
The result of a joint work between rrs@ and myself at the IETF:
* Decouple the path supervision using a separate HB timer per path.
* Add support for potentially failed state.
* Bring back RTO.min to 1 second.
* Accept packets on IP-addresses already announced via an ASCONF
* While there: do some cleanups.

Approved by: re@
MFC after: 2 months.

12 years agoEnable keyword expansion for $FreeBSD$ on files where it was added it
Brooks Davis [Wed, 3 Aug 2011 20:00:36 +0000 (20:00 +0000)]
Enable keyword expansion for $FreeBSD$ on files where it was added it
r224638.

Submitted by: bz
Approved by: re (implicit)
Point hat to: brooks

12 years agoUnbreak catman(1) by removing calls to col(1).
Ulrich Spörlein [Wed, 3 Aug 2011 19:26:57 +0000 (19:26 +0000)]
Unbreak catman(1) by removing calls to col(1).

col(1) was mangling the SGR escapes and is not strictly required.

See r222647, r222648, r222650, and r222653 for more details.

Reported by: delphij
Reviewed by: ru
Approved by: re (kib)
MFC after: 3 weeks

12 years agoAdd support for dynamically adjusted buffers to allow the full use of
Brooks Davis [Wed, 3 Aug 2011 19:14:22 +0000 (19:14 +0000)]
Add support for dynamically adjusted buffers to allow the full use of
the bandwidth of long fat pipes (i.e. 100Mbps+ trans-oceanic or
trans-continental links).  Bandwidth-delay products up to 64MB are
supported.

Also add support (not compiled by default) for the None cypher.  The
None cypher can only be enabled on non-interactive sessions (those
without a pty where -T was not used) and must be enabled in both
the client and server configuration files and on the client command
line.  Additionally, the None cypher will only be activated after
authentication is complete.  To enable the None cypher you must add
-DNONE_CIPHER_ENABLED to CFLAGS via the make command line or in
/etc/make.conf.

This code is a style(9) compliant version of these features extracted
from the patches published at:

http://www.psc.edu/networking/projects/hpn-ssh/

Merging this patch has been a collaboration between me and Bjoern.

Reviewed by: bz
Approved by: re (kib), des (maintainer)

12 years agoFix an NFS server issue where it was not correctly setting the eof flag when a
Zack Kirsch [Wed, 3 Aug 2011 18:50:19 +0000 (18:50 +0000)]
Fix an NFS server issue where it was not correctly setting the eof flag when a
READ had hit the end of the file. Also, clean up some cruft in the code.

Approved by:    re (kib)
Reviewed by:    rmacklem
MFC after:      2 weeks

12 years agoAdd in a dirty hack that allows for AR9280/AR9285/AR9287 embedded
Adrian Chadd [Wed, 3 Aug 2011 13:39:11 +0000 (13:39 +0000)]
Add in a dirty hack that allows for AR9280/AR9285/AR9287 embedded
systems, in the same way that AR9130 embedded systems work.

This isn't -everything- that is required - the PCI glue still
needs to be taught about the eepromdata hint, along the same
lines as the AHB glue.

Approved by: re (kib, blanket)

12 years ago* Fix a clash in structure naming which occurs with (closed source)
Adrian Chadd [Wed, 3 Aug 2011 13:36:14 +0000 (13:36 +0000)]
* Fix a clash in structure naming which occurs with (closed source)
  radar detection code. This is just to make porting the atheros
  radar code easier.

* add a missing space.

Approved by: re (kib, blanket)

12 years agofix a serious bug in libproc's proc_attach
Andriy Gapon [Wed, 3 Aug 2011 09:55:59 +0000 (09:55 +0000)]
fix a serious bug in libproc's proc_attach

proc_attach always frees any struct proc_handle data
that it allocates, but that is supposed to be done
only in error conditions.

PR: bin/158431
Approved by: re (kib)
MFC after: 1 week

12 years agoRemove the EEPROM minor >= 19 check for txgaintype; that's only needed for
Adrian Chadd [Wed, 3 Aug 2011 06:51:14 +0000 (06:51 +0000)]
Remove the EEPROM minor >= 19 check for txgaintype; that's only needed for
Merlin / v14 eeprom formats.

Approved by: re (kib, blanket)

12 years agoCross a T and dot an I:
Marcel Moolenaar [Tue, 2 Aug 2011 23:49:23 +0000 (23:49 +0000)]
Cross a T and dot an I:
o   Fix awkward use of braces in combination with mis-indentation.
    A mistake, that happened to yield the right behaviour?
o   Fix typo in comment.

No functional change.

Approved by: re (blanket)

12 years agoIt's invalid to use GLOBAL() for kernload_ap, as the macro switches
Marcel Moolenaar [Tue, 2 Aug 2011 23:33:44 +0000 (23:33 +0000)]
It's invalid to use GLOBAL() for kernload_ap, as the macro switches
to the .data section. We need kernload_ap in the boot page.

Approved by: re (blanket)

12 years agoThere's no ':' after GLOBAL(). Missed due to no SMP testing.
Marcel Moolenaar [Tue, 2 Aug 2011 23:06:59 +0000 (23:06 +0000)]
There's no ':' after GLOBAL(). Missed due to no SMP testing.

Approved by: re (blanket)

12 years agoAlways disable mount and unmount for jails with enforce_statfs==2.
Martin Matuska [Tue, 2 Aug 2011 19:44:40 +0000 (19:44 +0000)]
Always disable mount and unmount for jails with enforce_statfs==2.
A working statfs(2) is required for umount(8) in jail.

Reviewed by: pjd, kib
Approved by: re (kib)
MFC after: 2 weeks

12 years agoFor mount, discover f_mntonname from supplied path argument
Martin Matuska [Tue, 2 Aug 2011 19:13:56 +0000 (19:13 +0000)]
For mount, discover f_mntonname from supplied path argument
using vn_fullpath_global(). This fixes f_mntonname if mounting
inside chroot, jail or with relative path as argument.

For unmount in jail, use vn_fullpath_global() to discover
global path from supplied path argument. This fixes unmount in jail.

Reviewed by: pjd, kib
Approved by: re (kib)
MFC after: 2 weeks

12 years agoCorrections for the iBCS2 support that seems to regressed from 4.x times.
Konstantin Belousov [Tue, 2 Aug 2011 18:12:19 +0000 (18:12 +0000)]
Corrections for the iBCS2 support that seems to regressed from 4.x times.

In particular:
- fix format specifiers in the DPRINTFs;
- do not use kernel_map for temporal mapping backed by the vnode, this
  cannot work since kernel map is a system map. Use exec_map instead.
- ignore error code from an attempt to insert the hole. If supposed hole
  is located at the region already populated by .bss, it is not an error.
- correctly translate vm error codes to errno, when appropriate.

Reported and tested by: Rich Naill <rich enterprisesystems net>
Approved by: re (kensmith)
MFC after: 1 week

12 years agoFix for arm and mips case the size of storage for sintrcnt/sintrnames.
Attilio Rao [Tue, 2 Aug 2011 17:49:27 +0000 (17:49 +0000)]
Fix for arm and mips case the size of storage for sintrcnt/sintrnames.
It seems that "info as" is not much precise on what expect by pseudo-op
.word, by the way.

No MFC is previewed for this patch.

Tested by: andreast, pluknet
Approved by: re (kib)

12 years agoAdd support for Juniper's loader. The difference between FreeBSD's and
Marcel Moolenaar [Tue, 2 Aug 2011 15:35:43 +0000 (15:35 +0000)]
Add support for Juniper's loader. The difference between FreeBSD's and
Juniper's loader is that Juniper's loader maps all of the kernel and
preloaded modules at the right virtual address before jumping into the
kernel. FreeBSD's loader simply maps 16MB using the physical address
and expects the kernel to jump through hoops to relocate itself to
it's virtual address. The problem with the FreeBSD loader's approach is
that it typically maps too much or too little. There's no harm if it's
too much (other than wasting space), but if it's too little then the
kernel will simply not boot, because the first thing the kernel needs
is the bootinfo structure, which is never mapped in that case. The page
fault that early is fatal.

The changes constitute:
1.  Do not remap the kernel in locore.S. We're mapped where we need to
    be so we can pretty much call into C code after setting up the
    stack.
2.  With kernload and kernload_ap not set in locore.S, we need to set
    them in pmap.c: kernload gets defined when we preserve the TLB1.
    Here we also determine the size of the kernel mapped. kernload_ap
    is set first thing in the pmap_bootstrap() method.
3.  Fix tlb1_map_region() and its use to properly externd the mapped
    kernel size to include low-level data structures.

Approved by: re (blanket)
Obtained from: Juniper Networks, Inc

12 years agoProvide a more user friendly URL to the IETF site in faithd(8).
Glen Barber [Tue, 2 Aug 2011 11:35:28 +0000 (11:35 +0000)]
Provide a more user friendly URL to the IETF site in faithd(8).

Pointed out by: dougb
Approved by: re (kib)
MFC after: 3 days

12 years agoFix a LOR in the NFS client which could cause a deadlock.
Rick Macklem [Tue, 2 Aug 2011 11:28:42 +0000 (11:28 +0000)]
Fix a LOR in the NFS client which could cause a deadlock.
This was reported to the mailing list freebsd-net@freebsd.org
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.

Tested by: pho, jlott at averesystems.com
Submitted by: jhb (earlier version)
Reviewed by: kib
Approved by: re (kib)
MFC after: 2 weeks

12 years agoFix panic in zfs_read() if IO_SYNC flag supplied by checking for
Martin Matuska [Tue, 2 Aug 2011 11:28:33 +0000 (11:28 +0000)]
Fix panic in zfs_read() if IO_SYNC flag supplied by checking for
zfsvfs->z_log before calling zil_commit(). [1]
Do not call zfs_read() from zfs_getextattr() with the IO_SYNC flag.

Submitted by: Alexander Zagrebin <alex@zagrebin.ru> [1]
Reviewed by: pjd@
Approved by: re (kib)
MFC after: 3 days

12 years agoFix a LOR in the NFS client which could cause a deadlock.
Rick Macklem [Tue, 2 Aug 2011 11:24:42 +0000 (11:24 +0000)]
Fix a LOR in the NFS client which could cause a deadlock.
This was reported to the mailing list freebsd-net@freebsd.org
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.

Tested by: pho, jlott at averesystems.com
Submitted by: jhb (earlier version)
Reviewed by: kib
Approved by: re (kib)
MFC after: 2 weeks

12 years agoDo not force AHCI mode on NVIDIA MCP89 SATA controllers. Recent Apple
Alexander Motin [Tue, 2 Aug 2011 11:07:47 +0000 (11:07 +0000)]
Do not force AHCI mode on NVIDIA MCP89 SATA controllers.  Recent Apple
Mac with this chipset does not initialize AHCI mode unless it is started
from EFI loader.  However, legacy ATA mode works.

Submitted by: jkim@ (original version)
Approved by: re (kib)
MFC after: 1 week

12 years agoFix a corner case in RXEOL handling which was likely introduced by yours
Adrian Chadd [Tue, 2 Aug 2011 02:46:03 +0000 (02:46 +0000)]
Fix a corner case in RXEOL handling which was likely introduced by yours
truly.

Before 802.11n, the RX descriptor list would employ the "self-linked tail
descriptor" trick which linked the last descriptor back to itself.
This way, the RX engine would never hit the "end" of the list and stop
processing RX (and assert RXEOL) as it never hit a descriptor whose next
pointer was 0. It would just keep overwriting the last descriptor until
the software freed up some more RX descriptors and chained them onto the
end.

For 802.11n, this needs to stop as a self-linked RX descriptor tickles the
block-ack logic into ACK'ing whatever frames are received into that
self-linked descriptor - so in very busy periods, you could end up with
A-MPDU traffic that is ACKed but never received by the 802.11 stack.
This would cause some confusion as the ADDBA windows would suddenly
be out of sync.

So when that occured here, the last descriptor would be hit and the PCU
logic would stop. It would only start again when the RX descriptor list
was updated and the PCU RX engine was re-tickled. That wasn't being done,
so RXEOL would be continuously asserted and no RX would continue.

This patch introduces a new flag - sc->sc_kickpcu - which when set,
signals the RX task to kick the PCU after its processed whatever packets
it can. This way completed packets aren't discarded.

In case some other task gets called which resets the hardware, don't
update sc->sc_imask - instead, just update the hardware interrupt mask
directly and let either ath_rx_proc() or ath_reset() restore the imask
to its former setting.

Note: this bug was only triggered when doing a whole lot of frame snooping
with serial console IO in the RX task. This would defer interrupt processing
enough to cause an RX descriptor overflow. It doesn't happen in normal
conditions.

Approved by: re (kib, blanket)

12 years agoProvide a more user friendly URL to the IETF site in gif(4).
Glen Barber [Tue, 2 Aug 2011 01:48:45 +0000 (01:48 +0000)]
Provide a more user friendly URL to the IETF site in gif(4).

Pointed out by: dougb
MFC after: 3 days
Approved by: re (hrs)

12 years agoFix broken mdoc.
Ulrich Spörlein [Mon, 1 Aug 2011 22:21:18 +0000 (22:21 +0000)]
Fix broken mdoc.

Found by: manlint
Approved by: re (kib)

12 years agoAdd PCI ID for RocketRAID 4321 and 4322. A FreeNAS user have tested the
Xin LI [Mon, 1 Aug 2011 21:12:41 +0000 (21:12 +0000)]
Add PCI ID for RocketRAID 4321 and 4322.  A FreeNAS user have tested the
change on RocketRAID 4322.

Sponsored by: iXsystems, Inc.
MFC after: 3 days
Approved by: re (kib)

12 years agoImplement the linprocfs swaps file, providing information about the
Konstantin Belousov [Mon, 1 Aug 2011 19:12:15 +0000 (19:12 +0000)]
Implement the linprocfs swaps file, providing information about the
configured swap devices in the Linux-compatible format.

Based on the submission by: Robert Millan <rmh debian org>
PR: kern/159281
Reviewed by: bde
Approved by: re (kensmith)
MFC after: 2 weeks

12 years agoFix the LK_NOSHARE lockmgr flag interaction with LK_UPGRADE and
Konstantin Belousov [Mon, 1 Aug 2011 19:07:03 +0000 (19:07 +0000)]
Fix the LK_NOSHARE lockmgr flag interaction with LK_UPGRADE and
LK_DOWNGRADE lock ops. Namely, the ops should be NOP since LK_NOSHARE
locks are always exclusive.

Reported by: rmacklem
Reviewed by: attilio
Tested by: pho
Approved by: re (kensmith)
MFC after: 1 week

12 years agoI've rewritten most of this file so assign the copyright to me.
Joel Dahl [Mon, 1 Aug 2011 15:56:40 +0000 (15:56 +0000)]
I've rewritten most of this file so assign the copyright to me.

Approved by: re (kib)

12 years agoFix integer overflow in txg_delay() by initializing
Martin Matuska [Mon, 1 Aug 2011 14:50:31 +0000 (14:50 +0000)]
Fix integer overflow in txg_delay() by initializing
the variable "timeout" as clock_t.

Filed as Illumos Bug #1313

Reviewed by: avg
Approved by: re (kib)
MFC after: 3 days

12 years agoAdd missing break; in r223593.
Gleb Smirnoff [Mon, 1 Aug 2011 13:41:38 +0000 (13:41 +0000)]
Add missing break; in r223593.

Submitted by: sem
Pointy hat to: glebius
Approved by: re (kib)

12 years agoAdd missing MODULE_VERSION() definition to protect against duplicating
Sergey Kandaurov [Mon, 1 Aug 2011 11:24:55 +0000 (11:24 +0000)]
Add missing MODULE_VERSION() definition to protect against duplicating
module loads.

PR: kern/159345
Reported by: Eugene Grosbein <egrosbein att rdtc ru>
Tested by: Eugene Grosbein <egrosbein att rdtc ru>
Approved by: re (kib)
MFC after: 1 week

12 years agoGet rid of MAXCPU knowledge used for internal needs only. Switch to
Sergey Kandaurov [Mon, 1 Aug 2011 09:43:35 +0000 (09:43 +0000)]
Get rid of MAXCPU knowledge used for internal needs only. Switch to
dynamic memory allocation to hold per-CPU memory types data (sized to
mp_maxid for UMA, and to mp_maxcpus for malloc to match the kernel).

That fixes libmemstat with arbitrary large MAXCPU values and therefore
eliminates MEMSTAT_ERROR_TOOMANYCPUS error type.

Reviewed by: jhb
Approved by: re (kib)

12 years agoFix markup.
Konstantin Belousov [Mon, 1 Aug 2011 08:52:05 +0000 (08:52 +0000)]
Fix markup.

Approved by: re (hrs)

12 years agoCorrectly link bsdcpio and bsdtar against libmd and libcrpyto
Martin Matuska [Mon, 1 Aug 2011 08:22:40 +0000 (08:22 +0000)]
Correctly link bsdcpio and bsdtar against libmd and libcrpyto
by applying the change from r221472 (libarchive).

Reviewed by: kientzle
Approved by: re (kib)
MFC after: 3 days

12 years agoUpdate vfs_getopt(9) to reflect 32-bit to 64-bit change from
Glen Barber [Sun, 31 Jul 2011 21:04:47 +0000 (21:04 +0000)]
Update vfs_getopt(9) to reflect 32-bit to 64-bit change from
r224290.

PR: 159324
Submitted by: Brandon Gooch (jamesbrandongooch % gmail ! com)
Approved by: re (kib)

12 years agoFix rename in the new NFS server so that it does not require a
Rick Macklem [Sun, 31 Jul 2011 20:06:11 +0000 (20:06 +0000)]
Fix rename in the new NFS server so that it does not require a
recursive vnode lock on the directory for the case where the
new file name is in the same directory as the old one. The patch
handles this as a special case, recognized by the new directory
having the same file handle as the old one and just VREF()s the old
dir vnode for this case, instead of doing a second VFS_FHTOVP() to get it.
This is required so that the server will work for file systems like
msdosfs, that do not support recursive vnode locking.
This problem was discovered during recent testing by pho@
when exporting an msdosfs file system via the new NFS server.

Tested by: pho
Reviewed by: zkirsch
Approved by: re (kib)
MFC after: 2 weeks

12 years agoApply r221124 to Book-E: switch to the new NFS client.
Marcel Moolenaar [Sun, 31 Jul 2011 18:34:38 +0000 (18:34 +0000)]
Apply r221124 to Book-E: switch to the new NFS client.

Approved by: re (blanket)

12 years agoFix r222813: we need to include sys/cpuset.h. because the PIC interface
Marcel Moolenaar [Sun, 31 Jul 2011 18:30:38 +0000 (18:30 +0000)]
Fix r222813: we need to include sys/cpuset.h. because the PIC interface
uses cpuset_t. While here, fix the redundant inclusion of sys/bus.h and
order the includes.

Approved by: re (blanket)

12 years agoFix r224187: .word defines a 16-bit object and size_t is defined as
Marcel Moolenaar [Sun, 31 Jul 2011 18:26:47 +0000 (18:26 +0000)]
Fix r224187: .word defines a 16-bit object and size_t is defined as
a 32-bit intergal. Use .long to define sintrcnt and sintrname.

Approved by: re (blanket)

12 years agoDisable the RXORN/RXEOL interrupts if RXEOL occurs, preventing an
Adrian Chadd [Sun, 31 Jul 2011 16:16:25 +0000 (16:16 +0000)]
Disable the RXORN/RXEOL interrupts if RXEOL occurs, preventing an
interrupt storm.

This is easily triggered by flipping on and off tcpdump -y IEEE802_11_RADIO
w/ witness enabled. This causes a whole lot of console IO and when you're
attached to a serial console (eg on my AR7161 embedded board), the RX
interrupt doesn't get called quickly enough and the RX queue fills up.

This wasn't a problem in the past because of the self-linked RX descriptor
trick - the RX would never hit the "end" of the RX descriptor list.
However this isn't possible for 802.11n (see previous commit history for
why.)

Both Linux ath9k and the Atheros reference driver code do this; I'm just
looking now for where they then restart the PCU receive. Right now the RX
will just stop until the interface is reset.

Obtained from: Linux, Atheros
Approved by: re (kib)

12 years agomdoc(7) fix for the pcm(4) manual
Glen Barber [Sun, 31 Jul 2011 15:23:21 +0000 (15:23 +0000)]
mdoc(7) fix for the pcm(4) manual

Spotted by: manlint
Approved by: re (kib)

12 years agoDon't leak kld_sx lock in kldunloadf().
Gleb Smirnoff [Sun, 31 Jul 2011 13:49:15 +0000 (13:49 +0000)]
Don't leak kld_sx lock in kldunloadf().

Approved by: re (kib)

12 years agoRemove two debugging printf()s which snuck in during the testing of the
Adrian Chadd [Sun, 31 Jul 2011 08:13:25 +0000 (08:13 +0000)]
Remove two debugging printf()s which snuck in during the testing of the
last commit.

Approved by: re (kib)
Pointy-hat-to: adrian@

12 years agoImplement the 4KB split transaction workaround for Merlin (AR9280).
Adrian Chadd [Sun, 31 Jul 2011 08:01:41 +0000 (08:01 +0000)]
Implement the 4KB split transaction workaround for Merlin (AR9280).

The AR9280 apparently has an issue with descriptors which straddle a page
boundary (4k). I'm not yet sure whether I should use PAGE_SIZE in the
calculations or whether I should use 4096; the reference code uses 4096.

This patch fiddles with descriptor allocation so a descriptor entry
doesn't straddle a 4kb address boundary. The descriptor memory allocation
is made larger to contain extra descriptors and then the descriptor
address is advanced to the next 4kb boundary where needed.

I've tested this both on Merlin (AR9280) and non-Merlin (in this case,
AR9160.)

Obtained from: Linux, Atheros
Approved by: re (kib)