]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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 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.

10 years agoFix include statement to accept src.opts.mk from a source directory
se [Tue, 6 May 2014 12:31:17 +0000 (12:31 +0000)]
Fix include statement to accept src.opts.mk from a source directory
instead of from /usr/share/mk.

I'm not sure that this will let buildworld complete on a system with
no installed src.opts.mk (make buildworld is still running), but the
tinderbox builds are all failing earlyon without this patch.

10 years agoFix buildkernel breakage, which was fall-out from the move of options to
se [Tue, 6 May 2014 11:12:56 +0000 (11:12 +0000)]
Fix buildkernel breakage, which was fall-out from the move of options to
src.opts.mk.

10 years agoSpell raccdt in a more conventional way in a comment.
rwatson [Tue, 6 May 2014 10:53:51 +0000 (10:53 +0000)]
Spell raccdt in a more conventional way in a comment.

MFC after: 3 days

10 years agoReduce the number of interrupts in USB host mode for the DWC OTG
hselasky [Tue, 6 May 2014 09:12:32 +0000 (09:12 +0000)]
Reduce the number of interrupts in USB host mode for the DWC OTG
controller driver by piggybacking the SOF interrupt when issuing new
and checking old transfers. Number of interrupts was reduced by 30%
when doing Isochronous transfers.

Use correct GINTMSK_XXX macros when accessing the DWC OTG interrupt
mask register.

Add code to adjust the frame interval register which influences the
SOF rate.

MFC after: 2 weeks

10 years agoFix a problem with async notifications in the mpr(4) driver.
ken [Tue, 6 May 2014 06:18:43 +0000 (06:18 +0000)]
Fix a problem with async notifications in the mpr(4) driver.

This problem only occurs on versions of FreeBSD prior to the recent CAM
locking changes.  (i.e. stable/9 and older versions of stable/10)  This
change should be a no-op for head and stable/10.

If a path isn't specified, xpt_register_async() will create a fully
wildcarded path and acquire a lock (the XPT lock in older versions,
and via xpt_path_lock() in newer versions) to call xpt_action() for the
XPT_SASYNC_CB CCB.  It will then drop the lock and if the requested event
includes AC_FOUND_DEVICE or AC_PATH_REGISTERED, it will get the caller up
to date with any device arrivals or path registrations.

The issue is that before the locking changes, each SIM lock would get
acquired in turn during the EDT tree traversal process.  If a path is
specified for xpt_register_async(), it won't acquire and drop its own lock,
but instead expects the caller to hold its own SIM lock.  That works for
the first part of xpt_register_async(), but causes a recursive lock
acquisition once the EDT traversal happens and it comes to the SIM in
question.  And it isn't possible to call xpt_action() without holding a SIM
lock.

The locking changes fix this by using the XPT topology lock for EDT
traversal, so it is no longer an issue to hold the SIM lock while calling
xpt_register_async().

The solution for FreeBSD versions before the locking changes is to request
notification of all device arrivals (so we pass a NULL path into
xpt_register_async()) and then filter out the arrivals that are not ours.

MFC After: 3 days
Sponsored by: Spectra Logic Corporation

10 years agoRemove support for WITHOUT_BMAKE. bmake is now the only make that can
imp [Tue, 6 May 2014 04:22:37 +0000 (04:22 +0000)]
Remove support for WITHOUT_BMAKE. bmake is now the only make that can
build world, so it is the only make we build or install. fmake is
still in the tree, but disconnected, and upgrades from older systems
that still have bmake has not been removed, but its state has not been
tested (it should work given how minimal the work to upgrade to bmake
is).

10 years agoDocument src.opts.mk changes and the decoupling of /etc/src.conf from
imp [Tue, 6 May 2014 04:22:29 +0000 (04:22 +0000)]
Document src.opts.mk changes and the decoupling of /etc/src.conf from
anything but the source tree.

10 years agoUse src.opts.mk in preference to bsd.own.mk except where we need stuff
imp [Tue, 6 May 2014 04:22:01 +0000 (04:22 +0000)]
Use src.opts.mk in preference to bsd.own.mk except where we need stuff
from the latter.

10 years agoMove the /usr/src specific options to src.opts.mk. Move inclusion of
imp [Tue, 6 May 2014 04:21:48 +0000 (04:21 +0000)]
Move the /usr/src specific options to src.opts.mk. Move inclusion of
/etc/src.conf to this file as well. Now, it will only affect builds of
/usr/src and not others that use the bsd.*.mk files. Specifically
don't install src.opts.mk so we can catch when it 'leaks' into
bsd.*.mk again and have there be errors when this happens. Future
commits will move to including src.opts.mk instead of bsd.own.mk when
all that's needed is one of the MK_FOO options from src.opts.mk.
Future options should be placed here, unless they directly affect a
bsd.*.mk file, in which case they should be placed in bsd.opts.mk.

10 years agoPrior to r254304, a separate function, vm_pageout_page_stats(), was used to
alc [Tue, 6 May 2014 03:42:04 +0000 (03:42 +0000)]
Prior to r254304, a separate function, vm_pageout_page_stats(), was used to
periodically update the reference status of the active pages.  This function
was called, instead of vm_pageout_scan(), when memory was not scarce.  The
objective was to provide up to date reference status for active pages in
case memory did become scarce and active pages needed to be deactivated.

The active page queue scan performed by vm_pageout_page_stats() was
virtually identical to that performed by vm_pageout_scan(), and so r254304
eliminated vm_pageout_page_stats().  Instead, vm_pageout_scan() is
called with the parameter "pass" set to zero.  The intention was that when
pass is zero, vm_pageout_scan() would only scan the active queue.  However,
the variable page_shortage can still be greater than zero when memory is not
scarce and vm_pageout_scan() is called with pass equal to zero.
Consequently, the inactive queue may be scanned and dirty pages laundered
even though that was not intended by r254304.  This revision fixes that.

Reported by: avg
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

10 years agoModify Copyright information to reflect Qlogic Corporation's purchase
davidcs [Tue, 6 May 2014 02:32:27 +0000 (02:32 +0000)]
Modify Copyright information to reflect Qlogic Corporation's purchase
of Broadcom's NetXtreme business

Submitted by:David C Somayajulu (davidcs@freebsd.org) QLogic Corporation
MFC after:5 days

10 years agoModify the RX path to keep the previous RX descriptor around once it's
adrian [Tue, 6 May 2014 01:15:42 +0000 (01:15 +0000)]
Modify the RX path to keep the previous RX descriptor around once it's
used.

It turns out that the RX DMA engine does the same last-descriptor-link-
pointer-re-reading trick that the TX DMA engine.  That is, the hardware
re-reads the link pointer before it moves onto the next descriptor.
Thus we can't free a descriptor before we move on; it's possible the
hardware will need to re-read the link pointer before we overwrite
it with a new one.

Tested:

* AR5416, STA mode

TODO:

* more thorough AP and STA mode testing!
* test on other pre-AR9380 NICs, just to be sure.
* Break out the RX descriptor grabbing bits from the RX completion
  bits, like what is done in the RX EDMA code, so ..
* .. the RX lock can be held during ath_rx_proc(), but not across
  packet input.

10 years ago- Remove net.inet.tcp.reass.overflows sysctl. It counts exactly
glebius [Tue, 6 May 2014 00:00:07 +0000 (00:00 +0000)]
- Remove net.inet.tcp.reass.overflows sysctl. It counts exactly
  same events that tcpstat's tcps_rcvmemdrop counter counts.
- Rename tcps_rcvmemdrop to tcps_rcvreassfull and improve its
  description in netstat(1) output.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

10 years agoDisable the 'uart_drain()' callback when the emulated receive FIFO is full.
neel [Mon, 5 May 2014 23:54:13 +0000 (23:54 +0000)]
Disable the 'uart_drain()' callback when the emulated receive FIFO is full.

Failing to do this will cause the kevent(2) notification to trigger
continuously and the bhyve(8) mevent thread will hog the cpu until the
characters on the backend tty device are drained.

Also, make the uart backend file descriptor non-blocking to avoid a
select(2) before every byte read from that backend.

Reviewed by: grehan

10 years agoUse 'return' instead of 'exit' in main(), since the script exits
gjb [Mon, 5 May 2014 23:36:46 +0000 (23:36 +0000)]
Use 'return' instead of 'exit' in main(), since the script exits
with the last returned exit code.

Sponsored by: The FreeBSD Foundation

10 years agoAdd a helper script for parsing 'svn log' for the
gjb [Mon, 5 May 2014 23:01:01 +0000 (23:01 +0000)]
Add a helper script for parsing 'svn log' for the
'Relnotes:' tag in case 'yes' is not explicitly
the first string value following the tab.

As it turns out, a number of commits have bypassed
my filters (both email and 'svn log --search'), and
this script returns the results I want when doing
these searches.

Sponsored by: The FreeBSD Foundation

10 years agoSwitch vga drivers to use names and new vt(4) driver probe method.
ray [Mon, 5 May 2014 22:12:46 +0000 (22:12 +0000)]
Switch vga drivers to use names and new vt(4) driver probe method.

Sponsored by: The FreeBSD Foundation

10 years agoRevert r264997 and r265026. It is not required anymore.
ray [Mon, 5 May 2014 22:10:31 +0000 (22:10 +0000)]
Revert r264997 and r265026. It is not required anymore.

Sponsored by: The FreeBSD Foundation

10 years agoSimplify use of the semi-bogus EARLY_BUILD variable. Also, simplify
imp [Mon, 5 May 2014 22:03:08 +0000 (22:03 +0000)]
Simplify use of the semi-bogus EARLY_BUILD variable. Also, simplify
use of semi-bogus NO_WARNS variable. Both of these, in this case,
should collapse to WITHOUT_WARNS in a future commit.

10 years agoIntroduce CWARNFLAGS.${COMPILER_TYPE} and use that to simplify the
imp [Mon, 5 May 2014 22:03:01 +0000 (22:03 +0000)]
Introduce CWARNFLAGS.${COMPILER_TYPE} and use that to simplify the
thicket of .if ${COMPILER_TYPE} == "clang" that controls
warnings. Also, use CFLAGS.clang in a couple places in preference to
having a similar construct that's related to the CWARNFLAGS changes.

10 years ago[1] Make WITHOUT_FOO alway trump WITH_FOO, regardless of the system
imp [Mon, 5 May 2014 22:02:48 +0000 (22:02 +0000)]
[1] Make WITHOUT_FOO alway trump WITH_FOO, regardless of the system
    default. This restores more of the historical expectations that
    were broken when we started disallowing both WITH_FOO and
    WITHOUT_FOO to be defined.
[2] Document this new behavior, and improve the documentation in
    general here.

Submitted by: sjg@ [1].

10 years agoAdd vt(4) driver name for ofwfb driver.
ray [Mon, 5 May 2014 21:49:31 +0000 (21:49 +0000)]
Add vt(4) driver name for ofwfb driver.

Sponsored by: The FreeBSD Foundation