]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 years agodb: Use O_CLOEXEC instead of separate fcntl() call.
jilles [Tue, 13 Aug 2013 19:20:50 +0000 (19:20 +0000)]
db: Use O_CLOEXEC instead of separate fcntl() call.

10 years agoinit: Set kernel login class and CPU mask on new processes.
jilles [Tue, 13 Aug 2013 18:51:26 +0000 (18:51 +0000)]
init: Set kernel login class and CPU mask on new processes.

In particular, this makes the kernel login class on processes started from
/etc/rc "daemon" instead of "default".

Reviewed by: trasz

10 years agoSome small cleanups to the fixes in r180340:
jhb [Tue, 13 Aug 2013 18:45:58 +0000 (18:45 +0000)]
Some small cleanups to the fixes in r180340:
- Set NOTE_TRACKERR before running filt_proc().  If the knote did not
  have NOTE_FORK set in fflags when registered, then the TRACKERR event
  could miss being posted.
- Don't pass the pid in to filt_proc() for NOTE_FORK events.  The special
  handling for pids is done knote_fork() directly and no longer in
  filt_proc().

MFC after: 2 weeks

10 years agoext2fs: update format specifiers for ext4 type.
pfg [Tue, 13 Aug 2013 18:39:36 +0000 (18:39 +0000)]
ext2fs: update format specifiers for ext4 type.

Reported by: Sam Fourman Jr.
MFC after: 3 weeks

10 years agoExpose _citrus_bcs_trunc_rws_len for libintl's use.
peter [Tue, 13 Aug 2013 18:14:53 +0000 (18:14 +0000)]
Expose _citrus_bcs_trunc_rws_len for libintl's use.

Submitted by: Jan Beich <jbeich@tormail.org>

10 years agoDefine ext2fs local types and use them.
pfg [Tue, 13 Aug 2013 15:40:43 +0000 (15:40 +0000)]
Define ext2fs local types and use them.

Add definitions for e2fs_daddr_t, e4fs_daddr_t in addition
to the already existing e2fs_lbn_t and adjust them for ext4.
Other than making the code more readable these changes should
fix problems related to big filesystems.

Setting the proper types can be tricky so the process was
helped by looking at UFS. In our implementation, logical block
numbers can be negative and the code depends on it. In ext2,
block numbers are unsigned so it is convenient to keep
e2fs_daddr_t unsigned and use the complete 32 bits. In the
case of e4fs_daddr_t, while the value should be unsigned, for
ext4 we only need to support 48 bits so preserving an extra
bit from the sign is not an issue.

While here also drop the ext2_setblock() prototype that was
never used.

Discussed with: mckusick, bde
MFC after: 3 weeks

10 years ago- Minor style(9) fix.
glebius [Tue, 13 Aug 2013 13:40:31 +0000 (13:40 +0000)]
- Minor style(9) fix.
- Bring a comment up to date.

10 years agoAdd imx6 compatibility and make the driver work for any clock frequency.
ian [Tue, 13 Aug 2013 13:14:13 +0000 (13:14 +0000)]
Add imx6 compatibility and make the driver work for any clock frequency.

There are still a couple references to imx51 ccm driver functions that will
need to be changed after an imx6 ccm driver is written.

Reviewed by: ray

10 years agoieee80211_rate2plcp() and ieee80211_rate2phytype() are both pre-11n
adrian [Tue, 13 Aug 2013 09:58:27 +0000 (09:58 +0000)]
ieee80211_rate2plcp() and ieee80211_rate2phytype() are both pre-11n
routines and thus assert if one passes in a rate code with the
high bit set.

Since the high bit can indicate either IEEE80211_RATE_BASIC or
IEEE80211_RATE_MCS, it's up to the caller to determine whether
the rate is 11n or not, and either mask out the BASIC bit, or
call a different function.

(Yes, this does mean that net80211 should grow 11n-aware rate2phytype()
and rate2plcp() functions..)

This may need to happen for the other drivers - it's currently only
done (now) for iwn(4) and bwi(4).

PR: kern/181100

10 years agoApply upstream revision 1.151 (fix relative symlinks)
des [Tue, 13 Aug 2013 09:06:18 +0000 (09:06 +0000)]
Apply upstream revision 1.151 (fix relative symlinks)

MFC after: 3 days

10 years agoTurn off warns for this do-nothing file. clang noticed.
peter [Tue, 13 Aug 2013 08:12:57 +0000 (08:12 +0000)]
Turn off warns for this do-nothing file.  clang noticed.

10 years agoReturn error when opening read-only volumes (like RAID4/5/...) for writing.
mav [Tue, 13 Aug 2013 07:56:40 +0000 (07:56 +0000)]
Return error when opening read-only volumes (like RAID4/5/...) for writing.
Previously opens succeeded, but actual write operations returned errors.

Requested by: peter
MFC after: 2 weeks

10 years agoAdd a note that if you were WITH_ICONV before, you should turn on
peter [Tue, 13 Aug 2013 07:31:27 +0000 (07:31 +0000)]
Add a note that if you were WITH_ICONV before, you should turn on
WITH_LIBICONV_COMPAT.

10 years agoThe iconv in libc did two things - implement the standard APIs, the GNU
peter [Tue, 13 Aug 2013 07:15:01 +0000 (07:15 +0000)]
The iconv in libc did two things - implement the standard APIs, the GNU
extensions and also tried to be link time compatible with ports libiconv.
This splits that functionality and enables the parts that shouldn't
interfere with the port by default.

WITH_ICONV (now on by default) - adds iconv.h, iconv_open(3) etc.
WITH_LIBICONV_COMPAT (off by default) adds the libiconv_open etc API, linker
symbols and even a stub libiconv.so.3 that are good enough to be able
to 'pkg delete -f libiconv' on a running system and reasonably expect it
to work.

I have tortured many machines over the last few days to try and reduce
the possibilities of foot-shooting as much as I can.  I've successfully
recompiled to enable and disable the libiconv_compat modes, ports that use
libiconv alongside system iconv etc.  If you don't enable the
WITH_LIBICONV_COMPAT switch, they don't share symbol space.

This is an extension of behavior on other system.  iconv(3) is a standard
libc interface and libiconv port expects to be able to run alongside it on
systems that have it.

Bumped osreldate.

10 years agoOops, wrong constant at r254269.
mav [Tue, 13 Aug 2013 06:25:34 +0000 (06:25 +0000)]
Oops, wrong constant at r254269.

10 years agoFix reasonable but safe Clang warnings.
mav [Tue, 13 Aug 2013 06:21:36 +0000 (06:21 +0000)]
Fix reasonable but safe Clang warnings.

10 years agoFreeBSD's DTrace implementation has a few problems with respect to handling
markj [Tue, 13 Aug 2013 03:10:39 +0000 (03:10 +0000)]
FreeBSD's DTrace implementation has a few problems with respect to handling
probes declared in a kernel module when that module is unloaded. In
particular,

* Unloading a module with active SDT probes will cause a panic. [1]
* A module's (FBT/SDT) probes aren't destroyed when the module is unloaded;
  trying to use them after the fact will generally cause a panic.

This change fixes both problems by porting the DTrace module load/unload
handlers from illumos and registering them with the corresponding
EVENTHANDLER(9) handlers. This allows the DTrace framework to destroy all
probes defined in a module when that module is unloaded, and to prevent a
module unload from proceeding if some of its probes are active. The latter
problem has already been fixed for FBT probes by checking lf->nenabled in
kern_kldunload(), but moving the check into the DTrace framework generalizes
it to all kernel providers and also fixes a race in the current
implementation (since a probe may be activated between the check and the
call to linker_file_unload()).

Additionally, the SDT implementation has been reworked to define SDT
providers/probes/argtypes in linker sets rather than using SYSINIT/SYSUNINIT
to create and destroy SDT probes when a module is loaded or unloaded. This
simplifies things quite a bit since it means that pretty much all of the SDT
code can live in sdt.ko, and since it becomes easier to integrate SDT with
the DTrace framework. Furthermore, this allows FreeBSD to be quite flexible
in that SDT providers spanning multiple modules can be created on the fly
when a module is loaded; at the moment it looks like illumos' SDT
implementation requires all SDT probes to be statically defined in a single
kernel table.

PR: 166927, 166926, 166928
Reported by: davide [1]
Reviewed by: avg, trociny (earlier version)
MFC after: 1 month

10 years agoRemove some unused fields from struct linker_file. They were added in
markj [Tue, 13 Aug 2013 03:09:00 +0000 (03:09 +0000)]
Remove some unused fields from struct linker_file. They were added in
r172862 for use by the DTrace SDT framework but don't seem to have ever
been used.

MFC after: 2 weeks

10 years agoAdd event handlers for module load and unload events. The load handlers are
markj [Tue, 13 Aug 2013 03:07:49 +0000 (03:07 +0000)]
Add event handlers for module load and unload events. The load handlers are
called after the module has been loaded, and the unload handlers are called
before the module is unloaded. Moreover, the module unload handlers may
return an error to prevent the unload from proceeding.

Reviewed by: avg
MFC after: 2 weeks

10 years agoMake sure bootonly.iso for -BETAs and -RCs use the releases/
gjb [Tue, 13 Aug 2013 02:31:46 +0000 (02:31 +0000)]
Make sure bootonly.iso for -BETAs and -RCs use the releases/
directory on the FTP mirrors to fetch distributions, since
these are always pushed to releases/ during the release cycle.

MFC after: 3 days
X-MFC-To: stable/9, releng/9.2

10 years agoAlter the mq_start routine to do a TRYLOCK and call to the locked routine
jfv [Tue, 13 Aug 2013 00:25:39 +0000 (00:25 +0000)]
Alter the mq_start routine to do a TRYLOCK and call to the locked routine
rather than just queueing. The former code was an attempt at getting
UDP performance up, but there have been customer reports of problems with it,
so the ixgbe approach seems the best solution for now.

10 years agoUpdate PCI drivers to no longer look at the MEMIO-enabled bit in the PCI
scottl [Mon, 12 Aug 2013 23:30:01 +0000 (23:30 +0000)]
Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCI
command register.  The lazy BAR allocation code in FreeBSD sometimes
disables this bit when it detects a range conflict, and will re-enable
it on demand when a driver allocates the BAR.  Thus, the bit is no longer
a reliable indication of capability, and should not be checked.  This
results in the elimination of a lot of code from drivers, and also gives
the opportunity to simplify a lot of drivers to use a helper API to set
the busmaster enable bit.

This changes fixes some recent reports of disk controllers and their
associated drives/enclosures disappearing during boot.

Submitted by: jhb
Reviewed by: jfv, marius, achadd, achim
MFC after: 1 day

10 years agoImprove the MSIX setup code in the drivers, thanks to Marius for
jfv [Mon, 12 Aug 2013 22:54:38 +0000 (22:54 +0000)]
Improve the MSIX setup code in the drivers, thanks to Marius for
the changes. Make sure that pci_alloc_msix() does give us the vectors
we need and fall back to MSI when it doesn't, also release any that
were allocated when insufficient.

MFC after: 3 days

10 years agoBlank m_nextpkt before passing it up.
adrian [Mon, 12 Aug 2013 22:27:53 +0000 (22:27 +0000)]
Blank m_nextpkt before passing it up.

10 years agoAdd read-only support for extents in ext2fs.
pfg [Mon, 12 Aug 2013 21:34:48 +0000 (21:34 +0000)]
Add read-only support for extents in ext2fs.

Basic support for extents was implemented by Zheng Liu as part
of his Google Summer of Code in 2010. This support is read-only
at this time.

In addition to extents we also support the huge_file extension
for read-only purposes. This works nicely with the additional
support for birthtime/nanosec timestamps and dir_index that
have been added lately.

The implementation may not work for all ext4 filesystems as
it doesn't support some features that are being enabled by
default on recent linux like flex_bg. Nevertheless, the feature
should be very useful for migration or simple access in
filesystems that have been converted from ext2/3 or don't use
incompatible features.

Special thanks to Zheng Liu for his dedication and continued
work to support ext2 in FreeBSD.

Submitted by: Zheng Liu (lz@)
Reviewed by: Mike Ma, Christoph Mallon (previous version)
Sponsored by: Google Inc.
MFC after: 3 weeks

10 years agoMake check for unknown login class actually work. Previously, using the "-c" option
trasz [Mon, 12 Aug 2013 21:01:01 +0000 (21:01 +0000)]
Make check for unknown login class actually work.  Previously, using the "-c" option
with login class not defined in login.conf(5) would silently fail, resulting in using
the default login class.

10 years agoAdd brace missing in r254253.
mav [Mon, 12 Aug 2013 20:17:37 +0000 (20:17 +0000)]
Add brace missing in r254253.

10 years agor253460 accidentally some moderately expensive debugging code, even
scottl [Mon, 12 Aug 2013 19:16:55 +0000 (19:16 +0000)]
r253460 accidentally some moderately expensive debugging code, even
when debugging isn't enabled.  Work around this.

Submitted by: mav
Obtained from: Netflix
MFC after: 3 days

10 years agoFix the formatting of the error message.
ed [Mon, 12 Aug 2013 18:17:45 +0000 (18:17 +0000)]
Fix the formatting of the error message.

The G_MIRROR_DEBUG() macro already appends a newline. Also, most of the
log messages emitted by gmirror start with an uppercase letter.

10 years agoTemporarily revert sendmail 8.14.7 change to getipnodebyname() flags to
gshapiro [Mon, 12 Aug 2013 17:22:39 +0000 (17:22 +0000)]
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.

MFC after: 3 days

10 years agoMake the features a 64-bit value instead of 32-bit.
tuexen [Mon, 12 Aug 2013 13:52:15 +0000 (13:52 +0000)]
Make the features a 64-bit value instead of 32-bit.
This will allow an easier integration of the support
for NDATA.
While there, do also some minor cleanups.
Obtained from: rrs@
MFC after: 2 weeks

10 years agoIt seems the pre-commit checker doesn't detect illegal character sets. Fix.
peter [Mon, 12 Aug 2013 10:11:10 +0000 (10:11 +0000)]
It seems the pre-commit checker doesn't detect illegal character sets. Fix.

10 years agoGive up on using iconv to convert to UTF-8 at build time. I don't see any
peter [Mon, 12 Aug 2013 09:56:52 +0000 (09:56 +0000)]
Give up on using iconv to convert to UTF-8 at build time.  I don't see any
practical way to make iconv(1) as a build tool.  Instead pre-convert.
This gives us UTF-8 nvi catalogs even on systems without iconv enabled.

10 years ago- Try to fix build of 32-bit compatibility USB support for FreeBSD and
hselasky [Mon, 12 Aug 2013 09:17:48 +0000 (09:17 +0000)]
- Try to fix build of 32-bit compatibility USB support for FreeBSD and
Linux targets without breaking the existing IOCTL API.

- Remove some not-needed header file inclusions.

- Wrap a long line.

MFC after: 1 week
Reported by: Damjan Jovanovic <damjan.jov@gmail.com>

10 years agoFix some signed comparison compile warnings.
hselasky [Mon, 12 Aug 2013 09:15:33 +0000 (09:15 +0000)]
Fix some signed comparison compile warnings.

10 years agoCorrect an EHCI register write.
hselasky [Mon, 12 Aug 2013 06:09:28 +0000 (06:09 +0000)]
Correct an EHCI register write.

MFC after: 1 week
Reported by: aseem.jolly@gmail.com

10 years agoAdd optional support for default override of standard setup; but only if
dteske [Mon, 12 Aug 2013 03:52:23 +0000 (03:52 +0000)]
Add optional support for default override of standard setup; but only if
corresponding functions are provided. If override function does not exist,
boot remains unmodified. This patch should not result in any changes.

10 years agoWhen flushing packets from the powersave queue, make sure that
adrian [Mon, 12 Aug 2013 02:21:44 +0000 (02:21 +0000)]
When flushing packets from the powersave queue, make sure that
m_nextpkt is NULL before passing it up to the parent transmit
method.

10 years agoAdd a missing break.
adrian [Mon, 12 Aug 2013 00:38:47 +0000 (00:38 +0000)]
Add a missing break.

10 years agofnmatch(): Add test for r254091 (pattern with single backslash).
jilles [Sun, 11 Aug 2013 21:54:20 +0000 (21:54 +0000)]
fnmatch(): Add test for r254091 (pattern with single backslash).

This test cannot be converted to an sh(1) test because the syntax would be
invalid.

PR: 181129
MFC after: 1 week

10 years agoDon't build the UTF-8 version of the catalogs without iconv enabled.
peter [Sun, 11 Aug 2013 21:46:06 +0000 (21:46 +0000)]
Don't build the UTF-8 version of the catalogs without iconv enabled.

Pointy-hat to: peter (don't do things at 4am!)

10 years agoOnly allocate 2 bounce pages for maps that can only use them for buffers that
cognet [Sun, 11 Aug 2013 21:21:02 +0000 (21:21 +0000)]
Only allocate 2 bounce pages for maps that can only use them for buffers that
are unaligned on cache lines boundary, as we will never need more.

10 years agoCorrect the recovery logic in vm_page_alloc_contig:
attilio [Sun, 11 Aug 2013 21:15:04 +0000 (21:15 +0000)]
Correct the recovery logic in vm_page_alloc_contig:
what is really needed on this code snipped is that all the pages that
are already fully inserted gets fully freed, while for the others the
object removal itself might be skipped, hence the object might be set to
NULL.

Sponsored by: EMC / Isilon storage division
Reported by: alc, kib
Reviewed by: alc

10 years agoDon't install a ru_SU.KOI8-R symlink, 'make delete-old' will just remove
peter [Sun, 11 Aug 2013 20:46:05 +0000 (20:46 +0000)]
Don't install a ru_SU.KOI8-R symlink, 'make delete-old' will just remove
it again.

10 years agoUpdate nvi-1.79 to 2.1.1-4334a8297f
peter [Sun, 11 Aug 2013 20:03:12 +0000 (20:03 +0000)]
Update nvi-1.79 to 2.1.1-4334a8297f

This is the gsoc-2011 project to clean up and backport multibyte support
from other nvi forks in a form we can use.

USE_WIDECHAR is on unless building for the rescue crunchgen. This should
allow editing in the native locale encoding.

USE_ICONV depends on make.conf having 'WITH_ICONV=YES' for now.  This
adds the ability to do things like edit a KOI8-R file while having $LANG
set to (say) en_US.UTF-8.  iconv is used to transcode the characters for
display.

Other points:
* It uses gencat and catopen/etc instead of homegrown msg catalog stuff.
* A lot of stuff has been trimmed out, eg: the perl and tcl bindings which
  we could never use in base anyway.
* It uses ncursesw when in widechar mode.  This could be interesting.

GSoC info: http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/zy/1
Repo at: https://github.com/lichray/nvi2

Obtained from:  Zhihao Yuan <lichray@gmail.com>

10 years ago- Update the wrapper script to 'release.sh', as used by the FreeBSD
gjb [Sun, 11 Aug 2013 18:57:27 +0000 (18:57 +0000)]
- Update the wrapper script to 'release.sh', as used by the FreeBSD
  Release Engineering Team as of 9.2-RELEASE.

- Document that a cross-build release is possible by setting the
  TARGET and TARGET_ARCH variables.

- Include an example of using release.sh with and without the
  optional configuration file.

- Document the supported release.sh configuration file variables.

- Update the 'cdrom' target output file to disc1.iso.

- Update the 'memstick' target output file to memstick.img.

- Add attributions for the last major updates to this manual page.

- Fix some mdoc(7) style nits:
  - Sentences should begin on a new line
  - Use .Pq to enclose full lines in parenthesis

10 years agoAdd FreeBSD 9.2 to mdoc.local.
gjb [Sun, 11 Aug 2013 18:05:20 +0000 (18:05 +0000)]
Add FreeBSD 9.2 to mdoc.local.

10 years agodb/hash: Use O_CLOEXEC instead of separate fcntl() call.
jilles [Sun, 11 Aug 2013 15:38:48 +0000 (15:38 +0000)]
db/hash: Use O_CLOEXEC instead of separate fcntl() call.

In particular, a hash db is used by getpwnam() and getpwuid().

MFC after: 1 week

10 years agowait: Make sure WIFSIGNALED(s) is false if WIFCONTINUED(s) is true.
jilles [Sun, 11 Aug 2013 14:15:01 +0000 (14:15 +0000)]
wait: Make sure WIFSIGNALED(s) is false if WIFCONTINUED(s) is true.

10 years agoUse realpath(1) to determine the location of the newvers.sh script,
gjb [Sun, 11 Aug 2013 13:57:14 +0000 (13:57 +0000)]
Use realpath(1) to determine the location of the newvers.sh script,
since the current working directory might not be what is expected,
causing svn{,lite}version to fail to find ${0} (itself).

Submitted by: Dan Mack

10 years agoIn su(1), fix option ordering and clarify that the login class specified
trasz [Sun, 11 Aug 2013 11:06:49 +0000 (11:06 +0000)]
In su(1), fix option ordering and clarify that the login class specified
must be defined in login.conf.

MFC after: 1 month

10 years agoUse device_printf().
rpaulo [Sun, 11 Aug 2013 06:57:57 +0000 (06:57 +0000)]
Use device_printf().

10 years agoUse the correct structure size when flipping the BT coex state machine.
adrian [Sun, 11 Aug 2013 03:39:28 +0000 (03:39 +0000)]
Use the correct structure size when flipping the BT coex state machine.

This showed up when doing some basic testing on the Intel 6230.

Tested:

* Intel 6230, STA mode

10 years agoPrepare for the PAN (personal area network) support for iwn(4).
adrian [Sun, 11 Aug 2013 01:57:54 +0000 (01:57 +0000)]
Prepare for the PAN (personal area network) support for iwn(4).

* Break out the single, static RX context into a pointer, and ..
* .. extend it to two RX contexts - a default and a PAN context.

Whilst here, add a few extra fields in preparation for further iwn(4)
work.

Tested:

* Intel 4965, STA mode - same level of stability
* Intel 5100, STA mode - no change

Submitted by: Cedric Gross <cg@gross.info>

10 years agoAdd firmware for the Intel 2030 and variants.
adrian [Sun, 11 Aug 2013 01:09:16 +0000 (01:09 +0000)]
Add firmware for the Intel 2030 and variants.

Submitted by: Cedric GROSS <cg@gross.info>
Obtained from: Linux, Intel

10 years agoRemove a now-unused firmware.
adrian [Sun, 11 Aug 2013 01:04:07 +0000 (01:04 +0000)]
Remove a now-unused firmware.

10 years agoUpdate the 6000g2a image.
adrian [Sun, 11 Aug 2013 01:03:32 +0000 (01:03 +0000)]
Update the 6000g2a image.

Obtained from: Linux, Intel

10 years agofasttrap_fork(): unlock the processes before removing the tracepoints.
rpaulo [Sun, 11 Aug 2013 00:57:01 +0000 (00:57 +0000)]
fasttrap_fork(): unlock the processes before removing the tracepoints.

In the future, we'll need to come up with new proc_*() functions that accept
locked processes. For now, this prevents postgresql + DTrace from crashing the
system.

MFC after: 1 month

10 years agoLoad the dtraceall module if /dev/dtrace/dtrace doesn't exist.
rpaulo [Sat, 10 Aug 2013 23:17:09 +0000 (23:17 +0000)]
Load the dtraceall module if /dev/dtrace/dtrace doesn't exist.

MFC after: 3 days

10 years agoAdd in missing m_free()'s during error conditions.
adrian [Sat, 10 Aug 2013 21:46:58 +0000 (21:46 +0000)]
Add in missing m_free()'s during error conditions.

10 years agoThe r254167 moved initialization of the sleepqueues before the witness
kib [Sat, 10 Aug 2013 21:42:14 +0000 (21:42 +0000)]
The r254167 moved initialization of the sleepqueues before the witness
is operational.  init_sleepqueues() initializes 256 mutexes, which,
due to witness still being cold, started to overflow the pending_locks
array.

As stated in the reported panic message, increase WITNESS_PENDLIST
from 768 to 1024, which provides space for additional 256 locks.

Reported by: many
Tested by: rakuco, bdrewery

10 years agoParseGetLine: don't treat a zero byte as end of buffer if P_end says it isn't.
sjg [Sat, 10 Aug 2013 21:31:35 +0000 (21:31 +0000)]
ParseGetLine: don't treat a zero byte as end of buffer if P_end says it isn't.
Consume up to next newline, and issue a parse warning.
If no newline found before P_end, carry on as before.

10 years agoMatch malloc(9) calls with free(9), not contigfree(9). Also remove
kib [Sat, 10 Aug 2013 20:54:15 +0000 (20:54 +0000)]
Match malloc(9) calls with free(9), not contigfree(9).  Also remove
unneeded checks for NULL, free(9) can handle NULL pointers on its own,
and the regions were allocated with M_WAITOK flag as well.

Reported and tested by: Larry Rosenman <ler@lerctr.org>
MFC after: 1 week

10 years agoThe random_adapters.c is standard in the conf/files. Revert wrong
kib [Sat, 10 Aug 2013 19:38:29 +0000 (19:38 +0000)]
The random_adapters.c is standard in the conf/files.  Revert wrong
r254185.

Pointed out by: peter

10 years agoRestore the ability to kldload random.ko, by linking in the newly
kib [Sat, 10 Aug 2013 18:23:28 +0000 (18:23 +0000)]
Restore the ability to kldload random.ko, by linking in the newly
added random_adaptors.c.

10 years agoFix a typo. The script should run /usr/bin/svnliteversion instead of
gjb [Sat, 10 Aug 2013 18:23:18 +0000 (18:23 +0000)]
Fix a typo.  The script should run /usr/bin/svnliteversion instead of
/usr/bin/svnversion in the affected section.

Reported by: lev, Dan Mack

10 years agoDifferent consumers of the struct vm_page abuse pageq member to keep
kib [Sat, 10 Aug 2013 17:36:42 +0000 (17:36 +0000)]
Different consumers of the struct vm_page abuse pageq member to keep
additional information, when the page is guaranteed to not belong to a
paging queue.  Usually, this results in a lot of type casts which make
reasoning about the code correctness harder.

Sometimes m->object is used instead of pageq, which could cause real
and confusing bugs if non-NULL m->object is leaked.  See r141955 and
r253140 for examples.

Change the pageq member into a union containing explicitly-typed
members.  Use them instead of type-punning or abusing m->object in x86
pmaps, uma and vm_page_alloc_contig().

Requested and reviewed by: alc
Sponsored by: The FreeBSD Foundation

10 years agoFix the return value when we found a symbol in .dynstr. This nasty bug was
rpaulo [Sat, 10 Aug 2013 07:39:15 +0000 (07:39 +0000)]
Fix the return value when we found a symbol in .dynstr. This nasty bug was
preventing a lot of symbol lookups in dtruss -s, for example.

10 years agomdoc: remove commented out macro, sort SEE ALSO and add missing .El.
joel [Sat, 10 Aug 2013 06:48:20 +0000 (06:48 +0000)]
mdoc: remove commented out macro, sort SEE ALSO and add missing .El.

10 years agoMinor mdoc nits.
joel [Sat, 10 Aug 2013 06:39:42 +0000 (06:39 +0000)]
Minor mdoc nits.

10 years agomdoc: document title should be all caps.
joel [Sat, 10 Aug 2013 06:37:53 +0000 (06:37 +0000)]
mdoc: document title should be all caps.

10 years agoFix bug in r253719: fix command line watchdog disable.
alfred [Sat, 10 Aug 2013 01:48:15 +0000 (01:48 +0000)]
Fix bug in r253719: fix command line watchdog disable.

r253719 disallowed watchdog(8) from disabling the watchdog
by breaking the ability to pass 0 as a timeout arg.  Fix this.

10 years agoUse the correct address when calling kva_free()
cognet [Sat, 10 Aug 2013 00:53:22 +0000 (00:53 +0000)]
Use the correct address when calling kva_free()

Pointy hat to: cognet
Spotted out by: alc

10 years ago- The address lies in the bus space handle, not in the cookie
cognet [Sat, 10 Aug 2013 00:31:49 +0000 (00:31 +0000)]
- The address lies in the bus space handle, not in the cookie
- Use the right address when calling kva_free()
(Is there any reason why the s3c2xx0 comes with its own version of bs_map/
 bs_unmap ? It seems to be just the same as in bus_space_generic.c)

10 years agoRemove unused definition for CTL_VM_NAMES.
zont [Fri, 9 Aug 2013 23:47:43 +0000 (23:47 +0000)]
Remove unused definition for CTL_VM_NAMES.

Suggested by: bde

10 years agoDon't call sleepinit() from proc0_init(), make it a SYSINIT instead.
cognet [Fri, 9 Aug 2013 23:13:52 +0000 (23:13 +0000)]
Don't call sleepinit() from proc0_init(), make it a SYSINIT instead.
vmem needs the sleepq locks to be initialized when free'ing kva, so we want it
called as early as possible.

10 years agoInstead of just trying to do it for arm, make sure vm_kmem_size is properly
cognet [Fri, 9 Aug 2013 22:30:54 +0000 (22:30 +0000)]
Instead of just trying to do it for arm, make sure vm_kmem_size is properly
aligned in kmeminit(), where it'll work for any arch.

Suggested by: alc

10 years ago- The address lies in the bus space handle, not in the cookie
cognet [Fri, 9 Aug 2013 21:56:28 +0000 (21:56 +0000)]
- The address lies in the bus space handle, not in the cookie
- Use the right address when calling kva_free()

10 years agoMake sure vm_kmem_size is aligned on a page boundary, since that's what vmem
cognet [Fri, 9 Aug 2013 21:53:02 +0000 (21:53 +0000)]
Make sure vm_kmem_size is aligned on a page boundary, since that's what vmem
expects.

10 years agoRevert the addition of VPO_BUSY and instead update vm_page_replace() to
jhb [Fri, 9 Aug 2013 21:14:55 +0000 (21:14 +0000)]
Revert the addition of VPO_BUSY and instead update vm_page_replace() to
properly unbusy the page.

Submitted by: alc

10 years agoInitial commit of my USB test code which can exercise connected USB
hselasky [Fri, 9 Aug 2013 20:08:42 +0000 (20:08 +0000)]
Initial commit of my USB test code which can exercise connected USB
devices and the FreeBSD USB stack itself. This program can be used to
test compliance against well established usb.org standards, also
called chapter-9 tests. The host platform can act as either USB device
or USB host depending on the available hardware. The basic USB
communication happens through FreeBSD's own libusb v2, and some
sysctls are also used to invoke specific error conditions. This test
program can be used to verify correct operation of external USB
harddisks under heavy load and various other conditions. The software
is driven via a simple command line interface. Main supported USB host
classes are "USB mass storage" and "USB modems".

10 years agoFix the freaddir implementation for the stand-alone interpreter.
marcel [Fri, 9 Aug 2013 19:10:56 +0000 (19:10 +0000)]
Fix the freaddir implementation for the stand-alone interpreter.

Bug pointed out by: Jan Beich <jbeich@tormail.org>

10 years agoAdd mkostemp() and mkostemps().
jilles [Fri, 9 Aug 2013 17:24:23 +0000 (17:24 +0000)]
Add mkostemp() and mkostemps().

These are like mkstemp() and mkstemps() but allow passing open(2) flags like
O_CLOEXEC.

10 years agoAdd missing 'VPO_BUSY' from r254141 to fix kernel build break.
obrien [Fri, 9 Aug 2013 16:43:50 +0000 (16:43 +0000)]
Add missing 'VPO_BUSY' from r254141 to fix kernel build break.

10 years ago* Add random_adaptors.[ch] which is basically a store of random_adaptor's.
obrien [Fri, 9 Aug 2013 15:31:50 +0000 (15:31 +0000)]
* Add random_adaptors.[ch] which is basically a store of random_adaptor's.
  random_adaptor is basically an adapter that plugs in to random(4).
  random_adaptor can only be plugged in to random(4) very early in bootup.
  Unplugging random_adaptor from random(4) is not supported, and is probably a
  bad idea anyway, due to potential loss of entropy pools.
  We currently have 3 random_adaptors:
  + yarrow
  + rdrand (ivy.c)
  + nehemeiah

* Remove platform dependent logic from probe.c, and move it into
  corresponding registration routines of each random_adaptor provider.
  probe.c doesn't do anything other than picking a specific random_adaptor
  from a list of registered ones.

* If the kernel doesn't have any random_adaptor adapters present then the
  creation of /dev/random is postponed until next random_adaptor is kldload'ed.

* Fix randomdev_soft.c to refer to its own random_adaptor, instead of a
  system wide one.

Submitted by: arthurmesh@gmail.com, obrien
Obtained from: Juniper Networks
Reviewed by: so (des)

10 years agoOn all the architectures, avoid to preallocate the physical memory
attilio [Fri, 9 Aug 2013 11:28:55 +0000 (11:28 +0000)]
On all the architectures, avoid to preallocate the physical memory
for nodes used in vm_radix.
On architectures supporting direct mapping, also avoid to pre-allocate
the KVA for such nodes.

In order to do so make the operations derived from vm_radix_insert()
to fail and handle all the deriving failure of those.

vm_radix-wise introduce a new function called vm_radix_replace(),
which can replace a leaf node, already present, with a new one,
and take into account the possibility, during vm_radix_insert()
allocation, that the operations on the radix trie can recurse.
This means that if operations in vm_radix_insert() recursed
vm_radix_insert() will start from scratch again.

Sponsored by: EMC / Isilon storage division
Reviewed by: alc (older version)
Reviewed by: jeff
Tested by: pho, scottl

10 years agoGive mutex(9) the ability to recurse on a per-instance basis.
attilio [Fri, 9 Aug 2013 11:24:29 +0000 (11:24 +0000)]
Give mutex(9) the ability to recurse on a per-instance basis.
Now the MTX_RECURSE flag can be passed to the mtx_*_flag() calls.
This helps in cases we want to narrow down to specific calls the
possibility to recurse for some locks.

Sponsored by: EMC / Isilon storage division
Reviewed by: jeff, alc
Tested by: pho

10 years agoThe soft and hard busy mechanism rely on the vm object lock to work.
attilio [Fri, 9 Aug 2013 11:11:11 +0000 (11:11 +0000)]
The soft and hard busy mechanism rely on the vm object lock to work.
Unify the 2 concept into a real, minimal, sxlock where the shared
acquisition represent the soft busy and the exclusive acquisition
represent the hard busy.
The old VPO_WANTED mechanism becames the hard-path for this new lock
and it becomes per-page rather than per-object.
The vm_object lock becames an interlock for this functionality:
it can be held in both read or write mode.
However, if the vm_object lock is held in read mode while acquiring
or releasing the busy state, the thread owner cannot make any
assumption on the busy state unless it is also busying it.

Also:
- Add a new flag to directly shared busy pages while vm_page_alloc
  and vm_page_grab are being executed.  This will be very helpful
  once these functions happen under a read object lock.
- Move the swapping sleep into its own per-object flag

The KPI is heavilly changed this is why the version is bumped.
It is very likely that some VM ports users will need to change
their own code.

Sponsored by: EMC / Isilon storage division
Discussed with: alc
Reviewed by: jeff, kib
Tested by: gavin, bapt (older version)
Tested by: pho, scottl

10 years agoDon't dereference null pointer should acl_alloc() be passed M_NOWAIT
trasz [Fri, 9 Aug 2013 08:40:31 +0000 (08:40 +0000)]
Don't dereference null pointer should acl_alloc() be passed M_NOWAIT
and allocation failed.  Nothing in the tree passed M_NOWAIT.

Obtained from: mjg
MFC after: 1 month

10 years agoAdd -c flag to pgrep(1) and pkill(1), to match login classes.
trasz [Fri, 9 Aug 2013 08:38:51 +0000 (08:38 +0000)]
Add -c flag to pgrep(1) and pkill(1), to match login classes.

MFC after: 1 month

10 years agofollow up to r254051
avg [Fri, 9 Aug 2013 08:11:09 +0000 (08:11 +0000)]
follow up to r254051

- update powerpc/GENERIC64 as well, suggested by mdf
- update comments so that they make sense after the change, suggested by
  jhb

X-MFC after: never (change specific to head)

10 years agoAdd empty zones for Shared Address Space (RFC 6598)
erwin [Fri, 9 Aug 2013 07:57:04 +0000 (07:57 +0000)]
Add empty zones for Shared Address Space (RFC 6598)

Approved by: delphij (mentor)
MFC after: 3 days
Sponsored by: DK Hostmaster A/S

10 years ago - Fix compile errors from the clang conversion
jeff [Fri, 9 Aug 2013 03:29:46 +0000 (03:29 +0000)]
 - Fix compile errors from the clang conversion
 - Grab AF_SDP_INET from sys/socket.h

Submitted by: Garrett Cooper
Sponsored by: EMC / Isilon Storage Division

10 years ago - Reserve a special AF for SDP. The one we were incorrectly using before
jeff [Fri, 9 Aug 2013 03:26:17 +0000 (03:26 +0000)]
 - Reserve a special AF for SDP.  The one we were incorrectly using before
   was taken by another AF.

Sponsored by: EMC / Isilon Storage Division

10 years ago - Correctly handle various edge cases in sysfs emulation.
jeff [Fri, 9 Aug 2013 03:24:48 +0000 (03:24 +0000)]
 - Correctly handle various edge cases in sysfs emulation.

Sponsored by: EMC / Isilon Storage Division

10 years ago - Use the correct type in the linux bitops emulation.
jeff [Fri, 9 Aug 2013 03:24:12 +0000 (03:24 +0000)]
 - Use the correct type in the linux bitops emulation.

Submitted by: Maxim Ignatenko <gelraen.ua@gmail.com>

10 years agoFix for IPv4 fragment packets treated as RMCP.
yongari [Fri, 9 Aug 2013 01:15:32 +0000 (01:15 +0000)]
Fix for IPv4 fragment packets treated as RMCP.

bit25 of rxMode MAC register of 5762 needs to be set for rx mgmt
filter to work correctly when processing match for UDP header
fields.  Otherwise false positive can occur which causes IPv4
fragment to be received by APE instead of host.

Reported by: Geans Pin <geanspin@broadcom.com>

10 years agoRate limit the 'out of chain frame' messages to once per 60 seconds.
scottl [Fri, 9 Aug 2013 01:10:33 +0000 (01:10 +0000)]
Rate limit the 'out of chain frame' messages to once per 60 seconds.

Obtained from: Netflix
MFC after: 3 days

10 years agoSometimes a device misbehaves so badly that it disrupts the entire system.
scottl [Fri, 9 Aug 2013 01:09:02 +0000 (01:09 +0000)]
Sometimes a device misbehaves so badly that it disrupts the entire system.
Add a tunable that allows such a device to be excluded from the driver.
The id parameter is the target id that the driver assigns to a given device.

dev.mps.X.exclude_ids=<id>,<id>

Obtained from: Netflix
MFC after: 3 days

10 years agoAdd a helpful message that can help point to why a sysctl tree removal failed
scottl [Fri, 9 Aug 2013 01:04:44 +0000 (01:04 +0000)]
Add a helpful message that can help point to why a sysctl tree removal failed

Obtained from: Netflix
MFC after: 3 days