freebsd.git
10 years agoUpdated dependencies
sjg [Fri, 16 May 2014 14:09:51 +0000 (14:09 +0000)]
Updated dependencies

10 years agoNew deps
sjg [Wed, 14 May 2014 04:02:59 +0000 (04:02 +0000)]
New deps

10 years agoUpdated depends
sjg [Sat, 10 May 2014 21:53:07 +0000 (21:53 +0000)]
Updated depends

10 years agoUpdated dependencies
sjg [Sat, 10 May 2014 05:16:28 +0000 (05:16 +0000)]
Updated dependencies

10 years agoUse src.opts.mk
sjg [Sat, 10 May 2014 05:14:29 +0000 (05:14 +0000)]
Use src.opts.mk

10 years agoToolchains are a pain - especially to bootstrap
sjg [Sat, 10 May 2014 05:13:29 +0000 (05:13 +0000)]
Toolchains are a pain - especially to bootstrap
rather than waste time optimizing for a rare? event,
leverage the targets in src/Makefile.inc1

10 years agoPrep stage tree for tests
sjg [Sat, 10 May 2014 05:11:34 +0000 (05:11 +0000)]
Prep stage tree for tests

10 years agoWe may need to supress SHLIB_LINKS with NO_SHLIB_LINKS
sjg [Sat, 10 May 2014 00:26:40 +0000 (00:26 +0000)]
We may need to supress SHLIB_LINKS with NO_SHLIB_LINKS

10 years agoWe now want src.opts.mk
sjg [Sat, 10 May 2014 00:25:21 +0000 (00:25 +0000)]
We now want src.opts.mk

10 years agoDon't make wildcards .PHONY
sjg [Sat, 10 May 2014 00:24:32 +0000 (00:24 +0000)]
Don't make wildcards .PHONY
Add pseudo machines host and common to machine list for destroy

10 years agoWhen bootstrapping tools MACHINE==host and EARLY_BUILD defined,
sjg [Sat, 10 May 2014 00:23:12 +0000 (00:23 +0000)]
When bootstrapping tools MACHINE==host and EARLY_BUILD defined,
so not use any of stage tree.

M_whence only first value counts

10 years agoHandle empty meta list
sjg [Sat, 10 May 2014 00:21:10 +0000 (00:21 +0000)]
Handle empty meta list

10 years agoMerge from head
sjg [Thu, 8 May 2014 23:54:15 +0000 (23:54 +0000)]
Merge from head

10 years agoHide debug messages under VT_DEBUG.
ray [Thu, 8 May 2014 22:52:05 +0000 (22:52 +0000)]
Hide debug messages under VT_DEBUG.

Sponsored by: The FreeBSD Foundation

10 years agoFix two more typos.
brueffer [Thu, 8 May 2014 21:02:23 +0000 (21:02 +0000)]
Fix two more typos.

Submitted by: Trond Endrestol

10 years agoUse KASSERTs as suggested by glebius@
tuexen [Thu, 8 May 2014 20:47:54 +0000 (20:47 +0000)]
Use KASSERTs as suggested by glebius@

MFC after: 3 days
X-MFC with: 265691

10 years agoAdd #ifdefs in the mpr(4) driver so that versions of stable/9 that
ken [Thu, 8 May 2014 20:46:46 +0000 (20:46 +0000)]
Add #ifdefs in the mpr(4) driver so that versions of stable/9 that
have implemented the PIM_NOSCAN rescan functionality will have it
enabled.

This is a no-op for head.

Reviewed by: slm
Sponsored by: Spectra Logic Corporation
MFC after: 3 days

10 years agoFix TLR (Transport Layer Retry) support in the mps(4) and mpr(4) drivers.
ken [Thu, 8 May 2014 20:28:22 +0000 (20:28 +0000)]
Fix TLR (Transport Layer Retry) support in the mps(4) and mpr(4) drivers.

TLR is necessary for reliable communication with SAS tape drives.

This was broken by change 246713 in the mps(4) driver.  It changed the
cm_data field for SCSI I/O requests to point to the CCB instead of the data
buffer.  So, instead, look at the CCB's data pointer to determine whether
or not we're talking to a tape drive.

Also, take the residual into account to make sure that we don't go off the
end of the request.

MFC after: 3 days
Sponsored by: Spectra Logic Corporation

10 years agoFix the incorrect handling of %b and \c in printf(1)
pfg [Thu, 8 May 2014 20:20:59 +0000 (20:20 +0000)]
Fix the incorrect handling of %b and \c in printf(1)

This is required for POSIX compliance.

Obtained from: Garrett D'Amore (Illumos)
MFC after: 4 days

10 years agoConsolitate all the AP core startup stuff under a single #ifdef SMP block.
ian [Thu, 8 May 2014 20:02:38 +0000 (20:02 +0000)]
Consolitate all the AP core startup stuff under a single #ifdef SMP block.
Remove some other ifdefs that came in with a copy/paste that mean basically
"if this processor supports multicore stuff", because if you're starting up
an AP core... it does.

10 years agoModify Copyright information and other strings to reflect Qlogic Corporation's purcha...
davidcs [Thu, 8 May 2014 19:40:37 +0000 (19:40 +0000)]
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 (davidcs@freebsd.org) QLogic Corporation
MFC after:5 days

10 years agoIncorporate feedback from bde and jilles regarding r265472 to dd(1).
asomers [Thu, 8 May 2014 19:10:04 +0000 (19:10 +0000)]
Incorporate feedback from bde and jilles regarding r265472 to dd(1).

* Don't use sysexits.h.  Just exit 1 on error and 0 otherwise.
* Don't sacrifice precision by converting the output of clock_gettime() to a
  double and then comparing the results.  Instead, subtract the values of
  the two clock_gettime() calls, then convert to double.
* Don't use CLOCK_MONOTONIC_PRECISE.  It's an unportable synonym for
  CLOCK_MONOTONIC.
* Use more appropriate names for some local variables.
* In the summary message, round elapsed time to the nearest microsecond.

Reported by: bde, jilles
MFC after: 3 days
X-MFC-With: 265472

10 years agoMove the mptramp code which is specific to the Marvell ArmadaXP SoC out of
ian [Thu, 8 May 2014 18:36:42 +0000 (18:36 +0000)]
Move the mptramp code which is specific to the Marvell ArmadaXP SoC out of
the common locore.S file and into the mv/armadaxp directory.

10 years agoFor some UDP packets (for example with 200 byte payload) and IP options,
tuexen [Thu, 8 May 2014 17:27:46 +0000 (17:27 +0000)]
For some UDP packets (for example with 200 byte payload) and IP options,
the IP header and the UDP header are not in the same mbuf.
Add code to in_delayed_cksum() to deal with this case.

MFC after: 3 days

10 years agoUse edge-triggered interrupts rather than polling loops to avoid missing
ian [Thu, 8 May 2014 17:20:45 +0000 (17:20 +0000)]
Use edge-triggered interrupts rather than polling loops to avoid missing
transitions of the INIT_B line.  Also, release the mutex during uiomove().

Submitted by: Thomas Skibo <ThomasSkibo@sbcglobal.net>

10 years agoImport adapted OpenSolaris' thread pool API implementation.
mav [Thu, 8 May 2014 16:59:36 +0000 (16:59 +0000)]
Import adapted OpenSolaris' thread pool API implementation.

The thread pool is used by libzfs to implement parallel disk scanning.
Without this change our dummy wrapper made `zpool import ZZZ` command to
scan all disks sequentially from the single thread when searching for pools.
This change makes it use two threads per CPU, same as in OpenSolaris.

On system with 200 HDDs this change reduces ZFS pool import time from 35
to 22 seconds.

10 years agoAdd usr/share/mk/src.opts.mk to obsolete files. It never should have
imp [Thu, 8 May 2014 15:58:34 +0000 (15:58 +0000)]
Add usr/share/mk/src.opts.mk to obsolete files. It never should have
been installed in the first place, and it must be removed ASAP or
weird build errors may start happening in the future if this file is
ever taken from the installed system. Add note to UPDATING.

10 years agoRename rt_msg1() to more handy rtsock_msg_mbuf().
melifaro [Thu, 8 May 2014 13:54:57 +0000 (13:54 +0000)]
Rename rt_msg1() to more handy rtsock_msg_mbuf().
(Just for history purposes: rt_msg2() was renamed
 to rtsock_msg_buffer() in r265019).

Sponsored by: Yandex LLC
MFC after: 1 month

10 years agoFix scrollback.
ray [Thu, 8 May 2014 13:46:36 +0000 (13:46 +0000)]
Fix scrollback.

Sponsored by: The FreeBSD Foundation

10 years agoNo need to assign fields required and checked on probe.
ray [Thu, 8 May 2014 13:38:29 +0000 (13:38 +0000)]
No need to assign fields required and checked on probe.

Sponsored by: The FreeBSD Foundation

10 years agoFix incorrect netmasks being passed via rtsock.
melifaro [Thu, 8 May 2014 11:56:06 +0000 (11:56 +0000)]
Fix incorrect netmasks being passed via rtsock.

Since radix has been ignoring sa_family in passed sockaddrs,
no one ever has bothered filling valid sa_family in netmasks.
Additionally, radix adjusts sa_len field in every netmask not to
compare zero bytes at all.

This leads us to rt_mask with sa_family of AF_UNSPEC (-1) and
arbitrary sa_len field (0 for default route, for example).

However, rtsock have been passing that rt_mask intact for ages,
requiring all rtsock consumers to make ther own local hacks.
We even have unfixed on in base:

do `route -n monitor` in one window and issue `route -n get addr`
for some directly-connected address. You will probably see the following:

got message of size 304 on Thu May  8 15:06:06 2014
RTM_GET: Report Metrics: len 304, pid: 30493, seq 1, errno 0, flags:<UP,DONE,PINNED>
locks:  inits:
sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA>
 10.0.0.0 link#1 (255) ffff ffff ff em0:8.0.27.c5.29.d4 10.0.0.92
_________________^^^^^^^^^^^^^^^^^^

after the change:

got message of size 312 on Thu May  8 15:44:07 2014
RTM_GET: Report Metrics: len 312, pid: 2895, seq 1, errno 0, flags:<UP,DONE,PINNED>
locks:  inits:
sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA>
 10.0.0.0 link#1 255.255.255.0 em0:8.0.27.c5.29.d4 10.0.0.92
_________________^^^^^^^^^^^^^^^^^^

Sponsored by: Yandex LLC
MFC after: 1 month

10 years agoRe-apply r248644. This fixes an annoying problem which caused dtrace -c to
markj [Thu, 8 May 2014 03:43:18 +0000 (03:43 +0000)]
Re-apply r248644. This fixes an annoying problem which caused dtrace -c to
fail to attach to stripped binaries. With the _r_debug_postinit symbol,
dtrace(1) can now set a breakpoint in the victim process after it has
registered its DOF table(s) with the kernel. r_debug_state cannot be used
for this purpose since it is called before DOF is made available, in which
case dtrace(1) cannot create USDT probes before the program begins
execution.

MFC after: 2 weeks

10 years agoFix the rd_event_addr prototype and slightly clarify the use of the "event"
markj [Thu, 8 May 2014 03:33:54 +0000 (03:33 +0000)]
Fix the rd_event_addr prototype and slightly clarify the use of the "event"
parameter.

MFC after: 3 days

10 years agoHandle the different event types properly in rd_event_addr(). In particular,
markj [Thu, 8 May 2014 03:26:25 +0000 (03:26 +0000)]
Handle the different event types properly in rd_event_addr(). In particular,
with r265456 _r_debug_postinit can be used for RD_POSTINIT events. rtld(1)
uses r_debug_state for dl state transitions, so we use its address for
RD_DLACTIVITY events.

MFC after: 2 weeks

10 years agoPut bsd.own.mk back in the list, and take src.opts.mk out.
imp [Thu, 8 May 2014 02:24:30 +0000 (02:24 +0000)]
Put bsd.own.mk back in the list, and take src.opts.mk out.
Fix a silly typo.

10 years agoFix a typo make should have complained about.
imp [Thu, 8 May 2014 02:18:36 +0000 (02:18 +0000)]
Fix a typo make should have complained about.

Submitted by: Mark Johnston

10 years agoSilence no interrupt-parent found message during boot.
ganbold [Thu, 8 May 2014 00:26:21 +0000 (00:26 +0000)]
Silence no interrupt-parent found message during boot.

Approved by: stas (mentor)

10 years agoUpdate - allow collecting stats when WITH_META_STATS is defined.
sjg [Wed, 7 May 2014 23:50:44 +0000 (23:50 +0000)]
Update - allow collecting stats when WITH_META_STATS is defined.

10 years agosh: Add some tests for normal use of getopts.
jilles [Wed, 7 May 2014 21:45:25 +0000 (21:45 +0000)]
sh: Add some tests for normal use of getopts.

10 years agoHandle ELF files with 65280 or more sections
emaste [Wed, 7 May 2014 21:16:47 +0000 (21:16 +0000)]
Handle ELF files with 65280 or more sections

If e_shnum or e_shstrndx are at least SHN_LORESERVE (0xff00) then an
escape value is used to indicate that the actual value is found in one
of section 0's fields.

Sponsored by: DARPA, AFRL

10 years agoDocument r265555, addition of mrsas(4).
gjb [Wed, 7 May 2014 21:00:09 +0000 (21:00 +0000)]
Document r265555, addition of mrsas(4).

Sponsored by: The FreeBSD Foundation

10 years agoSeparate &darpa; entity and create &darpa_afrl to
gjb [Wed, 7 May 2014 20:31:44 +0000 (20:31 +0000)]
Separate &darpa; entity and create &darpa_afrl to
avoid confusion.

Suggested by: rwatson
Sponsored by: The FreeBSD Foundation

10 years agoCorrect attribution for casperd, co-sponsored by
gjb [Wed, 7 May 2014 20:27:57 +0000 (20:27 +0000)]
Correct attribution for casperd, co-sponsored by
The FreeBSD Foundation and Google, Inc.[1]

Since this was dual-sponsored, the sponsorurl needs
to be empty.

Add Google to the sponsor.ent file.

Reminded by: rwatson [1]
Sponsored by: The FreeBSD Foundation

10 years agoAdd a note to keep the entity lists sorted alphabetically.
gjb [Wed, 7 May 2014 20:18:50 +0000 (20:18 +0000)]
Add a note to keep the entity lists sorted alphabetically.

Sponsored by: The FreeBSD Foundation

10 years agoAdd attribution for r265348.
gjb [Wed, 7 May 2014 20:15:36 +0000 (20:15 +0000)]
Add attribution for r265348.
Add Netgate to sponsor.ent.

Sponsored by: The FreeBSD Foundation

10 years agoAdd attribution for r265236.
gjb [Wed, 7 May 2014 20:15:34 +0000 (20:15 +0000)]
Add attribution for r265236.
Add LSI and Spectra Logic to sponsor.ent.

Sponsored by: The FreeBSD Foundation

10 years agoAdd attribution for r264601.
gjb [Wed, 7 May 2014 20:15:32 +0000 (20:15 +0000)]
Add attribution for r264601.

Sponsored by: The FreeBSD Foundation

10 years agoAdd attribution for r258884.
gjb [Wed, 7 May 2014 20:15:30 +0000 (20:15 +0000)]
Add attribution for r258884.
Add DARPA, AFRL to sponsor.ent.

Sponsored by: The FreeBSD Foundation

10 years agoAdd sponsorship attribution for r258838 (casperd(8)).
gjb [Wed, 7 May 2014 19:53:51 +0000 (19:53 +0000)]
Add sponsorship attribution for r258838 (casperd(8)).

Sponsored by: The FreeBSD Foundation

10 years agoAdd references to sponsor.ent and vendor.ent in
gjb [Wed, 7 May 2014 19:44:44 +0000 (19:44 +0000)]
Add references to sponsor.ent and vendor.ent in
relnotes/article.xml and share/xml/catalog.xml.

Sponsored by: The FreeBSD Foundation

10 years agoAdd two new entity files in followup to r265590,
gjb [Wed, 7 May 2014 19:43:23 +0000 (19:43 +0000)]
Add two new entity files in followup to r265590,
sponsor.ent and vendor.ent, which will be used for
sponsor/vendor names and URLs.

Sponsored by: The FreeBSD Foundation

10 years ago(dd_out): Fix handling of all-zeroes block at end of input with
thomas [Wed, 7 May 2014 19:33:29 +0000 (19:33 +0000)]
(dd_out): Fix handling of all-zeroes block at end of input with
conv=sparse.

This change fixes two separate issues observed when the last output
block is all zeroes, and conv=sparse is in use. In this case, care
must be taken to roll back the last seek and write the entire last zero
block at the original offset where it should have occurred: when the
destination file is a block device, it is not possible to roll back
by just one character as the write would then not be properly aligned.

Furthermore, the buffer used to write this last all-zeroes block
needs to be properly zeroed-out. This was not the case previously,
resulting in a junk data byte appearing instead of a zero in the
output stream.

PR: bin/189174
PR: bin/189284
Reviewed by: kib
MFC after: 2 weeks

10 years agoAdd width and precision specifiers to printf(1) %n$.
pfg [Wed, 7 May 2014 19:30:28 +0000 (19:30 +0000)]
Add width and precision specifiers to printf(1) %n$.

This actually completes r264743 so that width and precision
specifiers work properly with %n$. These keeps consistency
with  ksh93 and zsh.

Requested by: jilles
Obtained from: Garrett D'Amore (Illumos)
MFC after: 4 days

10 years agoIntroduce a new command line switch '-H' for stat(1)
thomas [Wed, 7 May 2014 19:22:54 +0000 (19:22 +0000)]
Introduce a new command line switch '-H' for stat(1)
causing arguments to be interpreted as NFS file handles.

Reviewed by: -arch (jhb, eadler)
MFC after: 1 month

10 years agoModify release.xsl to allow proper attribution for
gjb [Wed, 7 May 2014 19:20:54 +0000 (19:20 +0000)]
Modify release.xsl to allow proper attribution for
sponsored and/or contributed works.

This works similarly to how the subversion revision is
suffixed in release notes entries when 'revision="NNNNNN"'
is set.

The <para> tag in relnotes/article.xml can now take the
following new elements:

 - contrib: defined to what type of contribution the change
   is.  Right now, only 'vendor' or 'sponsor' are used.
   'vendor' is intended for vendor-contributed code, such as
   driver updates, etc.  'sponsor' is intended for sponsored
   work (the 'Sponsored by:' in the commit template).

 - vendor: The canonical name of the vendor.

 - sponsor: The canonical name of the sponsor.

 - vendorurl: The URL for the vendor website, if applicable.

 - sponsorurl: The URL for the sponsor website, if applicable.

If 'vendor' or 'sponsor' are set, but 'contrib' is not, nothing
is rendered.  If 'contrib' is set, but no 'vendor' or 'sponsor'
are defined, nothing is printed.  If 'vendorurl' or 'sponsorurl'
are set, the 'vendor' or 'sponsor' text is link, otherwise is
non-clickable text.

Sponsored by: The FreeBSD Foundation

10 years agoAdd casts to have it compile on amd64 without complaining about
adrian [Wed, 7 May 2014 19:07:45 +0000 (19:07 +0000)]
Add casts to have it compile on amd64 without complaining about
mismatched types.

Tested:

* AR9280, TDMA slave, amd64.

10 years agoGenerate hardware notes for mrsas(4).
brueffer [Wed, 7 May 2014 18:27:12 +0000 (18:27 +0000)]
Generate hardware notes for mrsas(4).

10 years agoFirst cleanup pass: new sentence -> new line, mdoc, typos and style.
brueffer [Wed, 7 May 2014 18:21:38 +0000 (18:21 +0000)]
First cleanup pass: new sentence -> new line, mdoc, typos and style.

10 years agobsd.compiler.mk was implicitly included by bsd.own.mk in historical
imp [Wed, 7 May 2014 18:15:02 +0000 (18:15 +0000)]
bsd.compiler.mk was implicitly included by bsd.own.mk in historical
versions. With its movement to src.opts.mk, bsd.prog.mk was testing
COMPILER_TYPE without including the bsd.compiler.mk anymore. In the
source tree, this caused no problems, for reasons that aren't clear,
but does cause problems outside of the source tree. Allow
bsd.compiler.mk to be included multiple times safely, and always
include bsd.compiler.mk at the top of bsd.prog.mk. Resist the urge to
put it in bsd.init.mk, since that would reintroduce the implicit
include.

10 years agoAll the NO_foo options processed in src.opts.mk are really bsd.opts.mk
imp [Wed, 7 May 2014 18:14:56 +0000 (18:14 +0000)]
All the NO_foo options processed in src.opts.mk are really bsd.opts.mk
options, so move their processing there. This fixes issues with
Makefiles that define NO_MAN=t and only inlcude bsd.*.mk files. A few
ports fell into this category, and they should be fixed by this change.
Also, for now, disable the warning about NO_foo being deprecated. More
work is needed than anticipated before we can do that, so kill the
noise for now.

10 years ago- Export the function added in r265456 rather than the non-existent
markj [Wed, 7 May 2014 17:21:22 +0000 (17:21 +0000)]
- Export the function added in r265456 rather than the non-existent
  _rtld_debug_postinit(). [1]
- Use __compiler_membar() instead of inline asm in _r_debug_state() and
  _r_debug_postinit(). [2]

Pointy hat to: markj [1]
Reported by: attilio [2]
Discussed with: kib
X-MFC-With: r265456

10 years agoAdd mrsas(4) driver from LSI official support of newer MegaRAID SAS
ambrisko [Wed, 7 May 2014 16:16:49 +0000 (16:16 +0000)]
Add mrsas(4) driver from LSI official support of newer MegaRAID SAS
cards.  LSI has been maintaining this driver outside of the FreeBSD
tree.  It overlaps support of ThunderBolt and Invader cards that mfi(4)
supports.  By default mfi(4) will attach to cards.  If the tunable:
hw.mfi.mrsas_enable=1
is set then mfi(4) will not probe and attach to these newer cards and
allow mrsas(4) to attach.  So by default this driver will not effect
a FreeBSD system unless mfi(4) is removed from the kernel or the
tunable is enabled.

mrsas(4) attaches disks to the CAM layer so it depends on CAM and devices
show up as /dev/daX.  mfiutil(8) does not work with mrsas.  The FreeBSD
version of MegaCli and StorCli from LSI do work with mrsas.  It appears
that StorCli only works with mrsas.  MegaCli appears to work with mfi(4)
and mrsas(4).

It would be good to add mfiutil(4) support to mrsas, emulations modes,
kernel logging, device aliases to ease the transition between mfi(4)
and mrsas(4).

Style issues should be resolved by LSI when they get committers approved.
The plan is get this driver in FreeBSD 9.3 to improve HW support.

Thanks to LSI for developing, testing and working with FreeBSD to
make this driver co-exist in FreeBSD.  This improves the overall
support of MegaRAID SAS.

Submitted by: Kashyap Desai <Kashyap.Desai@lsi.com>
Reviewed by: scottl
MFC after: 3 days
Sponsored by: LSI

10 years agoFix possible divide by zero.
ray [Wed, 7 May 2014 13:53:38 +0000 (13:53 +0000)]
Fix possible divide by zero.

Spotted by: many

Sponsored by: The FreeBSD Foundation

10 years agoAdd svn revision number to sendmail entry and wrap
gjb [Wed, 7 May 2014 12:45:33 +0000 (12:45 +0000)]
Add svn revision number to sendmail entry and wrap
line.
Fix capitalization of Sendmail.

Sponsored by: The FreeBSD Foundation

10 years agoSort entries by svn revision as oldest-newest to match
gjb [Wed, 7 May 2014 12:45:31 +0000 (12:45 +0000)]
Sort entries by svn revision as oldest-newest to match
entry order in other branches.

Sponsored by: The FreeBSD Foundation

10 years agoMove r265348 to 'net-if' section.
gjb [Wed, 7 May 2014 12:45:30 +0000 (12:45 +0000)]
Move r265348 to 'net-if' section.

Sponsored by: The FreeBSD Foundation

10 years agoDocument r265348, Atheros AR1111 support.
gjb [Wed, 7 May 2014 12:45:28 +0000 (12:45 +0000)]
Document r265348, Atheros AR1111 support.

Sponsored by: The FreeBSD Foundation

10 years agoDocument r265236, addition of mpr(4).
gjb [Wed, 7 May 2014 12:45:26 +0000 (12:45 +0000)]
Document r265236, addition of mpr(4).

Sponsored by: The FreeBSD Foundation

10 years agoIt is safe to allow shrinking, when aligned size is bigger than current.
ae [Wed, 7 May 2014 11:18:27 +0000 (11:18 +0000)]
It is safe to allow shrinking, when aligned size is bigger than current.

Tested by: jmg
MFC after: 1 week

10 years ago- Sprinkle const and static as appropriate.
marius [Wed, 7 May 2014 09:15:46 +0000 (09:15 +0000)]
- Sprinkle const and static as appropriate.
- Fix whitespace bugs.
- Remove pointless returns in void functions.
- Nuke pointless switch cases mirroring the default.

MFC after: 3 days
Sponsored by: Bally Wulff Games & Entertainment GmbH

10 years agomsync(2) must return ENOMEM and not EINVAL when the address is outside the
pho [Wed, 7 May 2014 08:38:02 +0000 (08:38 +0000)]
msync(2) must return ENOMEM and not EINVAL when the address is outside the
allowed range or when one or more pages are not mapped. This according to
The Open Group Base Specifications Issue 7.

Discussed with:  attilio, Bruce Evans
Reviewed by:  alc, Garrett Cooper
Reported by:  ATF
MFC after:  2 weeks
Sponsored by: EMC / Isilon storage division

10 years agoThere's no need to be this paranoid - ni is deferenced before this
adrian [Wed, 7 May 2014 07:57:50 +0000 (07:57 +0000)]
There's no need to be this paranoid - ni is deferenced before this
point.

Coverity ID:  CID 1211937

10 years agoHold the SIM lock when calling xpt_create_path() and xpt_action() in
ken [Wed, 7 May 2014 05:14:48 +0000 (05:14 +0000)]
Hold the SIM lock when calling xpt_create_path() and xpt_action() in
mprsas_SSU_to_SATA_devices().

This fixes an assertion on shutdown with INVARIANTS enabled with SATA
drives present on an IR firmware controller.

Reviewed by: Steve McConnell <stephen.mcconnell@avagotech.com>.
MFC after: 3 days

10 years agoRemove some debugging code.
ken [Wed, 7 May 2014 05:11:16 +0000 (05:11 +0000)]
Remove some debugging code.

Submitted by: Steve McConnell <stephen.mcconnell@avagotech.com>
MFC after: 3 days

10 years agoMerge -fstandalone-debug from Clang r198655:
emaste [Wed, 7 May 2014 00:51:24 +0000 (00:51 +0000)]
Merge -fstandalone-debug from Clang r198655:

  Implement a new -fstandalone-debug option. rdar://problem/15685848
  It controls everything that -flimit-debug-info used to, plus the
  vtable type optimization. The old -fno-limit-debug-info option is now an
  alias to -fstandalone-debug and vice versa.

  Standalone is the default on Darwin until dtrace is updated to work with
  non-standalone debug info (rdar://problem/15758808).

  Note: I kept the LimitedDebugInfo name in CodeGenOptions::DebugInfoKind
  because NoStandaloneDebugInfo sounded even more confusing.

10 years agoBump the default C-state to Cmax, rather than the kernel default
adrian [Tue, 6 May 2014 23:28:37 +0000 (23:28 +0000)]
Bump the default C-state to Cmax, rather than the kernel default
of C1.

This may not stay through 11.0-RELEASE, but at least having it
on by default in -HEAD will expose (more) issues with broken hardware.

Note: I have no plans or desire to MFC this to stable/10.

10 years agoChange the device name for mpr(4) from /dev/mpr_N to /dev/mprN.
ken [Tue, 6 May 2014 22:13:38 +0000 (22:13 +0000)]
Change the device name for mpr(4) from /dev/mpr_N to /dev/mprN.

This is more consistent with the existing mps(4) behavior.

Reviewed by: Steve McConnell <stephen.mcconnell@avagotech.com>
MFC after: 3 days

10 years agodd(1) uses gettimeofday(2) to compute the throughput statistics. However,
asomers [Tue, 6 May 2014 22:06:39 +0000 (22:06 +0000)]
dd(1) uses gettimeofday(2) to compute the throughput statistics.  However,
gettimeofday returns the system clock, which may jump forward or back,
especially if NTP is in use.  If the time jumps backwards, then dd will see
negative elapsed time, round it up to 1usec, and print an absurdly fast
transfer rate.

The solution is to use clock_gettime(2) with CLOCK_MONOTONIC_PRECISE as the
clock_id.  That clock advances steadily, regardless of changes to the system
clock.

Reviewed by: delphij
MFC after: 3 days
Sponsored by: Spectra Logic

10 years agoAdd mkimg_write() which combines lseek(2) and write(2) and uses
marcel [Tue, 6 May 2014 21:54:05 +0000 (21:54 +0000)]
Add mkimg_write() which combines lseek(2) and write(2) and uses
sector granularity for both offset and length. Have all schemes
use mkimg_write() instead of mkimg_seek() followed by write(2).

Now that schemes don't use lseek(2) nor write(2) directly, it's
easier to support output formats other than raw disks.

10 years agoAdd missing svn:keywords property.
marcel [Tue, 6 May 2014 21:51:16 +0000 (21:51 +0000)]
Add missing svn:keywords property.

10 years agoDon't reply monlist request when it's not enabled.
delphij [Tue, 6 May 2014 21:34:01 +0000 (21:34 +0000)]
Don't reply monlist request when it's not enabled.

No objection from: roberto (but all bugs are mine)
MFC after: 2 weeks

10 years agoSort .ALLSRC before concatenating files together. This makes sure that the
delphij [Tue, 6 May 2014 21:30:58 +0000 (21:30 +0000)]
Sort .ALLSRC before concatenating files together.  This makes sure that the
file are always built the same.

(Note that Header and Localstuff must appear first and in that order, the
sorting does not affect as a coincident effect).

Submitted by: sjg
MFC after: 3 days

10 years agoDue to reasons unknown at this time, the system can be forced to write
scottl [Tue, 6 May 2014 20:40:16 +0000 (20:40 +0000)]
Due to reasons unknown at this time, the system can be forced to write
a journal block even when there are no journal entries to be written.
Until the root cause is found, handle this case by ensuring that a
valid journal segment is always written.

Second, the data buffer used for writing journal entries was never
being scrubbed of old data.  Fix this.

Submitted by: Takehara Mikihito
Obtained from: Netflix, Inc.
MFC after: 3 days

10 years agoIn apm_write(), both fd and imgsz are referenced, so don't mark the
marcel [Tue, 6 May 2014 20:34:21 +0000 (20:34 +0000)]
In apm_write(), both fd and imgsz are referenced, so don't mark the
arguments as unused.

10 years agoImport George Wilson's change for Illumos #4730:
delphij [Tue, 6 May 2014 19:03:04 +0000 (19:03 +0000)]
Import George Wilson's change for Illumos #4730:

4730 metaslab group taskq should be destroyed in metaslab_group_destroy()
Reviewed by: Alex Reece <alex.reece@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>

Original author: George Wilson

MFC after: 3 days

10 years agoAdd a postinit debugger hook to rtld. This will be used by dtrace(1) to halt
markj [Tue, 6 May 2014 18:07:58 +0000 (18:07 +0000)]
Add a postinit debugger hook to rtld. This will be used by dtrace(1) to halt
the victim process before its entry point is called, at which point probes
and DOF data are registered with the kernel. The r_debug_state hook cannot
be used for this purpose, as it is called before the program's init routines
are invoked and in particular before DOF data is registered (via drti.o).

Reviewed by: kib
MFC after: 2 weeks

10 years agoRemove unused code. This is triggered by the bugreport of Sylvestre Ledru
tuexen [Tue, 6 May 2014 16:51:07 +0000 (16:51 +0000)]
Remove unused code. This is triggered by the bugreport of Sylvestre Ledru
which deal with useless code in the user land stack:
https://bugzilla.mozilla.org/show_bug.cgi?id=1003929

MFC after: 3 days

10 years ago- Allow foot shooting with the resetconfig command via the -f option.
marius [Tue, 6 May 2014 16:29:02 +0000 (16:29 +0000)]
- Allow foot shooting with the resetconfig command via the -f option.
- Fix typos preventing -f to actually work with the create command.
- Initialize flags to zero rather than using stack garbage when handling
  the grow command.

MFC after: 3 days
Sponsored by: Bally Wulff Games & Entertainment GmbH

10 years agoNo need to install man pages for bootstrapping new make. Some
imp [Tue, 6 May 2014 15:44:46 +0000 (15:44 +0000)]
No need to install man pages for bootstrapping new make. Some
environments (that I can't reproduce locally, but that others have
reported) seem to get tripped up by this man page install. There's
really no need to do it, so turn off the man pages using the most
portable method. We can't just directly set MK_MAN=no here because
we're bootstrapping in the host environment and such a setting was
forbidden until very recently. NO_MAN= can produce a warning, but for
now the warning is benign.

10 years agoTime to prune entries for RELENG_7 and stable/8. They are still in
imp [Tue, 6 May 2014 15:44:41 +0000 (15:44 +0000)]
Time to prune entries for RELENG_7 and stable/8. They are still in
svn, for the historically minded.

10 years agoAdd helpful note about possible workarounds for (as yet) unknown
imp [Tue, 6 May 2014 15:44:34 +0000 (15:44 +0000)]
Add helpful note about possible workarounds for (as yet) unknown
breakage. Also fix typo.

10 years agoFix the upgrade path for fmake by allowing the include of src.opts.mk
imp [Tue, 6 May 2014 14:33:18 +0000 (14:33 +0000)]
Fix the upgrade path for fmake by allowing the include of src.opts.mk
to fail and falling back on the conservative testing of variables
already in place. This should stop the tide of tinderbox mail.

10 years agoEnable PL310 power-saving modes and tune the cache ram latencies for imx6.
ian [Tue, 6 May 2014 14:26:24 +0000 (14:26 +0000)]
Enable PL310 power-saving modes and tune the cache ram latencies for imx6.

10 years agoAdd a public routine to set the L2 cache ram latencies. This can be
ian [Tue, 6 May 2014 14:19:54 +0000 (14:19 +0000)]
Add a public routine to set the L2 cache ram latencies.  This can be
called by platform init routines to fine-tune cache performance.

10 years agoAdd defines for the bits in the PL310 debug control register.
ian [Tue, 6 May 2014 14:08:42 +0000 (14:08 +0000)]
Add defines for the bits in the PL310 debug control register.

This should have been part of r265444.

10 years agoCall platform_pl310_init() before enabling the controller, and handle the
ian [Tue, 6 May 2014 14:03:35 +0000 (14:03 +0000)]
Call platform_pl310_init() before enabling the controller, and handle the
case where the controller is already enabled.

Some of the pl310 configuration registers cannot be changed while the
controller is active, so if there is any platform-specific init to be done
it must happen before enabling the controller.

The controller should not be enabled upon entry to the kernel, but u-boot
has recently developed the bad habit of leaving caches enabled when
launching the kernel, and since we have no control over that source code
we have to do our best to cope with it.  The PL310 manual doesn't document
a safe sequence for disabling the controller, but the sequence used here
(force write-through mode and disable linefill allocations, then clean and
invalidate the current contents before disabling the hardware) appears to
be sound both by analysis and empirical testing.

These changes were developed and tested in collaboration with
Svatopluk Kraus <onwahe@gmail.com>.

Reviewed by: cognet@

10 years agoRevert r265436, since it is not the correct fix.
se [Tue, 6 May 2014 14:01:48 +0000 (14:01 +0000)]
Revert r265436, since it is not the correct fix.

10 years agoImplement KDMKTONE ioctl.
ray [Tue, 6 May 2014 13:52:13 +0000 (13:52 +0000)]
Implement KDMKTONE ioctl.

Submitted by: Matthew D.Fuller <fullermd@over-yonder.net> (original version)
MFC: 7 days
PR: kern/189170

Sponsored by: The FreeBSD Foundation

10 years agoBreak out the code that figures out the L2 cache geometry to its own
ian [Tue, 6 May 2014 13:46:36 +0000 (13:46 +0000)]
Break out the code that figures out the L2 cache geometry to its own
routine, so that it can be called from multiple places in upcoming changes.

10 years agoMove the pl310.enabled tunable to hw.pl310.enabled. Clean up a few minor
ian [Tue, 6 May 2014 13:38:34 +0000 (13:38 +0000)]
Move the pl310.enabled tunable to hw.pl310.enabled.  Clean up a few minor
style(9) nits.  Use DEVMETHOD_END.