freebsd.git
8 hours agoAdd flag VM_ALLOC_NOWAIT for vm_page_grab() that prevents sleeping and master github/master
glebius [Mon, 22 Dec 2014 09:02:21 +0000 (09:02 +0000)]
Add flag VM_ALLOC_NOWAIT for vm_page_grab() that prevents sleeping and
allows the function to fail.

Reviewed by: kib, alc
Sponsored by: Nginx, Inc.

8 hours agoDo not clear flag that vm_page_alloc() doesn't support.
glebius [Mon, 22 Dec 2014 09:00:47 +0000 (09:00 +0000)]
Do not clear flag that vm_page_alloc() doesn't support.

Submitted by: kib

8 hours agoDocument flags of vm_page allocation functions.
glebius [Mon, 22 Dec 2014 08:59:44 +0000 (08:59 +0000)]
Document flags of vm_page allocation functions.

Reviewed by: alc

12 hours agoUpdate the text for building texinfo with build-tools to reflect the fact
ngie [Mon, 22 Dec 2014 04:54:57 +0000 (04:54 +0000)]
Update the text for building texinfo with build-tools to reflect the fact
that make install is being called as well

MFC after: 1 week
X-MFC with: r276052

12 hours agoBuild selective portions of gnu/usr.bin/texinfo as part of build-tools to
ngie [Mon, 22 Dec 2014 04:52:24 +0000 (04:52 +0000)]
Build selective portions of gnu/usr.bin/texinfo as part of build-tools to
ensure that building on a host without makeinfo (i.e. a host where
make delete-old -DWITHOUT_INFO was run), then building with MK_INFO == yes
doesn't manifest in build errors when building info pages

This manifested itself like the following when I was build testing an MFC
change on stable/10:

  makeinfo --no-split -I /usr/src/gnu/lib/libregex/doc -I /usr/src/gnu/lib/libregex/doc regex.texi  -o regex.info
  makeinfo: not found
  *** [regex.info] Error code 127

make[6]: stopped in /usr/src/gnu/lib/libregex/doc
1 error

Tested on a head VM without makeinfo installed and by building with MK_INFO=yes

MFC after: 1 week

16 hours agoReplace the clock divisor terms with values that also result in a 1 MHz
ian [Mon, 22 Dec 2014 00:50:01 +0000 (00:50 +0000)]
Replace the clock divisor terms with values that also result in a 1 MHz
clock, but actually work on real hardware, unlike the original set of
values I chose.

PR: 195009
Submitted by: Scott Ellis <jumpnowtek@gmail.com>

17 hours agoAdd -march=armv7a to the kernel compile for all ARM systems which are v7a.
ian [Sun, 21 Dec 2014 23:48:32 +0000 (23:48 +0000)]
Add -march=armv7a to the kernel compile for all ARM systems which are v7a.

Submitted by: Michal Meloun <meloun@miracle.cz>

17 hours agoAdd __FreeBSD_version guards around hsearch_r to ease MFCing the code to
ngie [Sun, 21 Dec 2014 23:47:30 +0000 (23:47 +0000)]
Add __FreeBSD_version guards around hsearch_r to ease MFCing the code to
stable/10

It was added when __FreeBSD_version was ~1100027

17 hours agoAllow -march=armv7a on the gcc command line, for compatibility with clang.
ian [Sun, 21 Dec 2014 23:45:13 +0000 (23:45 +0000)]
Allow -march=armv7a on the gcc command line, for compatibility with clang.
This will result in __ARM_ARCH_7A__ being defined during the compile.

When compiling with gcc, it will still only generate armv6 opcodes itself,
but should pass the arch to gas so that inline asm can use v7 opcodes.

18 hours agosh: Move some code from onint() to onsig(), making onint() noreturn.
jilles [Sun, 21 Dec 2014 23:09:59 +0000 (23:09 +0000)]
sh: Move some code from onint() to onsig(), making onint() noreturn.

As a result, the INTON macro which is used many times generates fewer
bytes of code.

19 hours agosh: Remove EXP_REDIR.
jilles [Sun, 21 Dec 2014 22:18:30 +0000 (22:18 +0000)]
sh: Remove EXP_REDIR.

EXP_REDIR was supposed to generate pathnames in redirection if exactly one
file matches, as permitted but not required by POSIX in interactive mode. It
is unlikely this will be implemented.

No functional change is intended.

MFC after: 1 week

20 hours agoFix the unwinder to get past functions with no stack but may cause an
andrew [Sun, 21 Dec 2014 21:38:12 +0000 (21:38 +0000)]
Fix the unwinder to get past functions with no stack but may cause an
exception. In this case no registers will be updated but the link register
will be copied to the program counter to be used to find the calling
function. In this case the program counter may be updated and we should
continue with the trace.

20 hours agoPull out the fdt mapping code into intr.c. The arm_intrng branch also
andrew [Sun, 21 Dec 2014 21:27:12 +0000 (21:27 +0000)]
Pull out the fdt mapping code into intr.c. The arm_intrng branch also
defines this function allowing the mapping method to change when we move
to it.

20 hours agoEliminate a "cast discards qualifiers" warning when building with gcc.
ian [Sun, 21 Dec 2014 21:24:19 +0000 (21:24 +0000)]
Eliminate a "cast discards qualifiers" warning when building with gcc.

20 hours agoEliminate a redundant declaration.
ian [Sun, 21 Dec 2014 21:23:53 +0000 (21:23 +0000)]
Eliminate a redundant declaration.

20 hours agoRemove a volatile qualifier on return type that is ignored and results in
ian [Sun, 21 Dec 2014 21:11:54 +0000 (21:11 +0000)]
Remove a volatile qualifier on return type that is ignored and results in
a -Wreturn-type warning when compiled with gcc.

24 hours agoFurther reduce the diff between the arm_intrng gic driver and the version
andrew [Sun, 21 Dec 2014 17:25:21 +0000 (17:25 +0000)]
Further reduce the diff between the arm_intrng gic driver and the version
in head.

24 hours agoSwitch zfsboot installer force 4K option to use vfs.zfs.min_auto_ashift=12
smh [Sun, 21 Dec 2014 17:21:29 +0000 (17:21 +0000)]
Switch zfsboot installer force 4K option to use vfs.zfs.min_auto_ashift=12

Previously we used gnop(8) to fake 4K sector size disks but ZFS now has a
sysctl to control this when creating new top level vdev's so use that
instead.

Differential Revision: D566
MFC after: 1 month
Sponsored by: Multiplay

24 hours agoAllow whitspace to appear between device name and unit number in loaderdev.
ian [Sun, 21 Dec 2014 17:10:24 +0000 (17:10 +0000)]
Allow whitspace to appear between device name and unit number in loaderdev.
This allows the same value to be used in u-boot commands and the loaderdev
env var that gets passed to ubldr, for example 'fatload mmc 1 ${bootfile}".

24 hours agoReduce the diff between the lpc interrupt controller in head and arm_intrng
andrew [Sun, 21 Dec 2014 16:59:41 +0000 (16:59 +0000)]
Reduce the diff between the lpc interrupt controller in head and arm_intrng

24 hours agoReduce the diff in the Ti aintc between head and arm_intrng
andrew [Sun, 21 Dec 2014 16:48:57 +0000 (16:48 +0000)]
Reduce the diff in the Ti aintc between head and arm_intrng

25 hours agostyle (9) nits
smh [Sun, 21 Dec 2014 16:38:29 +0000 (16:38 +0000)]
style (9) nits

Use return (val); instead of return val;

Differential Revision: D838
MFC after: 2 weeks
Sponsored by: Multiplay

25 hours agoReduce the diff between head and arm_intrng with the bcm2835 interrupt
andrew [Sun, 21 Dec 2014 16:35:42 +0000 (16:35 +0000)]
Reduce the diff between head and arm_intrng with the bcm2835 interrupt
controller.

25 hours agoReturn the error from ahci_setup_interrupt in ahci_attach
smh [Sun, 21 Dec 2014 16:32:57 +0000 (16:32 +0000)]
Return the error from ahci_setup_interrupt in ahci_attach

Previously ahci_attach returned a hard coded ENXIO instead of the value
from ahci_setup_interrupt. This is effectively a NOOP change as currently
ahci_setup_interrupt only ever returns 0 or ENXIO, so just there to protect
against any future changes to that.

Differential Revision: D838
MFC after: 2 weeks
Sponsored by: Multiplay

25 hours agoReduce the diff to the arm_intrng project branch by having the read/write
andrew [Sun, 21 Dec 2014 16:21:56 +0000 (16:21 +0000)]
Reduce the diff to the arm_intrng project branch by having the read/write
macros take the softc they are accessing.

25 hours agoClamp ahci max irq's to AHCI_MAX_IRQS
smh [Sun, 21 Dec 2014 16:15:29 +0000 (16:15 +0000)]
Clamp ahci max irq's to AHCI_MAX_IRQS

This prevents the possiblity of any overruns on the statically allocated
struct irqs field.

Differential Revision: D838
MFC after: 2 weeks
X-MFC-With: r276012
Sponsored by: Multiplay

25 hours agoAdd a constant AHCI_MAX_IRQS removing magic number
smh [Sun, 21 Dec 2014 16:07:46 +0000 (16:07 +0000)]
Add a constant AHCI_MAX_IRQS removing magic number

Sponsored by: Multiplay

27 hours agoDon't check twice that inp is not NULL.
tuexen [Sun, 21 Dec 2014 13:58:53 +0000 (13:58 +0000)]
Don't check twice that inp is not NULL.

Reported by: Coverity
CID: 748671
MFC after: 3 days

28 hours agoAdd VN_OPEN_NAMECACHE flag for vn_open_cred(9), which requests that
kib [Sun, 21 Dec 2014 13:32:07 +0000 (13:32 +0000)]
Add VN_OPEN_NAMECACHE flag for vn_open_cred(9), which requests that
the created file name was cached.  Use the flag for core dumps.

Requested by: rpaulo
Tested by: pho (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

28 hours agoHandle MAKEENTRY cnp flag in the VOP_CREATE(). Curiously, some
kib [Sun, 21 Dec 2014 13:29:33 +0000 (13:29 +0000)]
Handle MAKEENTRY cnp flag in the VOP_CREATE().  Curiously, some
fs, e.g. smbfs, already did it.

Tested by: pho (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

29 hours agoVarious mdoc fixes and a few EOL whitespace removals.
brueffer [Sun, 21 Dec 2014 12:36:36 +0000 (12:36 +0000)]
Various mdoc fixes and a few EOL whitespace removals.

Found with: mandoc -Tlint

29 hours agoVarious mdoc fixes.
brueffer [Sun, 21 Dec 2014 12:13:49 +0000 (12:13 +0000)]
Various mdoc fixes.

Found with: mandoc -Tlint

29 hours agoFix the indentation to simplify comparing the ARM config files.
andrew [Sun, 21 Dec 2014 11:55:40 +0000 (11:55 +0000)]
Fix the indentation to simplify comparing the ARM config files.

30 hours agotart to clean up the armv6 kernel configs by reducing the diff between
andrew [Sun, 21 Dec 2014 11:37:00 +0000 (11:37 +0000)]
tart to clean up the armv6 kernel configs by reducing the diff between
them in the first sections and the later FDT support.

Differential Revision: https://reviews.freebsd.org/D1346
Reviewed by: rpaulo (earlier version)

30 hours agoFix various mdoc issues and some EOL whitespace.
brueffer [Sun, 21 Dec 2014 10:57:42 +0000 (10:57 +0000)]
Fix various mdoc issues and some EOL whitespace.

Found with: mandoc -Tlint

31 hours agoRemove EOL whitespace.
brueffer [Sun, 21 Dec 2014 10:04:26 +0000 (10:04 +0000)]
Remove EOL whitespace.

Found with: mandoc -Tlint

31 hours agoFix various mdoc issues.
brueffer [Sun, 21 Dec 2014 09:53:29 +0000 (09:53 +0000)]
Fix various mdoc issues.

Found with: mandoc -Tlint

36 hours agoWhere appropriate, use the modern terms for the one true time base
imp [Sun, 21 Dec 2014 05:07:11 +0000 (05:07 +0000)]
Where appropriate, use the modern terms for the one true time base
(UTC) rather than the archaic (GMT) in comments. Except where the
comments are making fun of people doing this (and pedants who insist
on the new terms).

36 hours agoUpdate ieee80211_sta_tim_notify() to do double duty - handle STA sleep
adrian [Sun, 21 Dec 2014 04:58:45 +0000 (04:58 +0000)]
Update ieee80211_sta_tim_notify() to do double duty - handle STA sleep
to awake transition as well as handle waking up a VAP in STA powersave
mode if it's in bgscan.

This was a reasonably hairy bug to try and figure out and it became
more obvious because of stuff I've done.

Specifically:

* a NIC would go into bgscan mode - either because of a bgscan timer
  or wpa_supplicant asked it to;
* the AP would indicate there's traffic for the STA by setting the TIM
  bitmap bit for it;
* mindwell would be met during scan, so it'd wake up and break out of
  the scan loop in scan_task(), but
* because the scan wasn't completed, it wouldn't bring the VAP out of
  STA mode powersave (so it wouldn't tell the AP about it and it would
  block VAP TX);
* .. but because we kept seeing the TIM bit set, ic->ic_lastdata was
  being constantly updated, and ..
* bgscancont() would thus never say "yes we can continue a bgscan"
  so the bgscan would hang and never make progress.

Now, I do see this particular state occur on iwn(4) - /however/ -
this NIC has the firmware call ieee80211_scan_next() once the firmware
scan for that channel has completed.  This has the effect of moving
the scan along to the next channel.  I do see the debug that I'm adding
where we see a beacon with a TIM bit set whilst we're in bgscan, so
the condition about waking up to receive traffic is triggering.
It just won't cause a hang.

For other NICs - all of the USB ones and at least ath(4) -
ieee80211_scan_next() / ieee80211_scan_done() isn't called.
So it relies upon the mindwell timer, the beacon receive and the
beacon / probe response -> ieee80211_add_scan() to move along
the scan state.

In the above case, mindwell triggered, there's no beacons triggering
the scan_add code to move things along, and we weren't waking things
up when seeing the TIM set for us.  So it just hung until the interface
was dropped.

So, the short-term fix here is to do what the comment in scan_task()
says - if we are in bgscan mode and we see our TIM bit set, just wake
up the VAP.  If it's already awake then it's a nop.  If we're awake
then we transition to awake and handle the traffic.  Once there's no
TX or RX traffic going on, ic->ic_lastdata won't be updated anymore
and bgscancont() will continue.

This was triggered more often after my initial SLEEP state handling
for software sleep states - because now I update ic->ic_lastdata
upon seeing a TIM bit set, not just the RX of the subsequent traffic.
That's needed so the thing doesn't ping-pong up and down between
seeing the TIM bit set, sending the "I'm awake" NULL data frame, and
starting to receive data from the AP.

I'd like to subsequently split ic_lastdata into two - one for TX and
one for RX - so it becomes easier to use the correct one (or both!)
when making decisions like whether to scan, go to sleep, etc.

I'd appreciate this getting some further testing.

Tested:

* rsu(4), STA mode, bgscan on
* iwn(4), STA mode, bgscan on

36 hours agoBreak out the unicast/multicast TIM bit setting into "set something
adrian [Sun, 21 Dec 2014 04:48:54 +0000 (04:48 +0000)]
Break out the unicast/multicast TIM bit setting into "set something
that indicates we have traffic" bit and a "do something if we have
traffic bit."

I'm going to be fleshing out this stuff more over time and it'll make
more sense to have it broken out into two pieces here.

40 hours agoAdd more debugging to try and track down this scan hang nonsense.
adrian [Sun, 21 Dec 2014 01:15:55 +0000 (01:15 +0000)]
Add more debugging to try and track down this scan hang nonsense.

42 hours agoAdd some more debugging to the scan cancel methods - I'd like to see
adrian [Sat, 20 Dec 2014 23:41:37 +0000 (23:41 +0000)]
Add some more debugging to the scan cancel methods - I'd like to see
what situations would cause the scan cancel's to not complete.

43 hours agoRevert r274494, r274712, r275955 and provide extra comments explaining
glebius [Sat, 20 Dec 2014 22:12:04 +0000 (22:12 +0000)]
Revert r274494, r274712, r275955 and provide extra comments explaining
why there could appear a zero-sized mbufs in socket buffers.

A proper fix would be to divorce record socket buffers and stream
socket buffers, and divorce pru_send that accepts normal data from
pru_send that accepts control data.

44 hours agoFix and harmonize the validation of PR-SCTP policies.
tuexen [Sat, 20 Dec 2014 21:17:28 +0000 (21:17 +0000)]
Fix and harmonize the validation of PR-SCTP policies.

Reported by: Coverity
CID: 1232044
MFC after: 3 days

45 hours agoRemove some hard-coded IE assembly over to use net80211 methods.
adrian [Sat, 20 Dec 2014 20:07:48 +0000 (20:07 +0000)]
Remove some hard-coded IE assembly over to use net80211 methods.

PR: kern/196069
Submitted by:  Andriy Voskoboinyk <s3erios@gmail.com>

45 hours agoEmulate writes to the IA32_MISC_ENABLE MSR.
neel [Sat, 20 Dec 2014 19:47:51 +0000 (19:47 +0000)]
Emulate writes to the IA32_MISC_ENABLE MSR.

PR: 196093
Reported by: db
Tested by: db
Discussed with: grehan
MFC after: 1 week

46 hours agoDocument where in scan_task the scan state can change, and potentially
adrian [Sat, 20 Dec 2014 19:41:31 +0000 (19:41 +0000)]
Document where in scan_task the scan state can change, and potentially
deal/log a warning if the scan flags change during one of those race
windows.

It's highly likely that I need to actually sit down and replace this
scan infrastructure at some point.  It has some other side effects too -
the scan task is a blocking task scheduled in the net80211 taskqueue;
so drivers that use this taskqueue have other things not run.  Eek.

If you see this printf happen then please let me know!

46 hours agoDriver for CPU frequency/voltage control on the Raspberry Pi.
rpaulo [Sat, 20 Dec 2014 19:15:10 +0000 (19:15 +0000)]
Driver for CPU frequency/voltage control on the Raspberry Pi.

Differential Revision: https://reviews.freebsd.org/D1025
Submitted by: Daisuke Aoyama aoyama@peach.ne.jp
Reviewed by: ian (earlier version), rpaulo
MFC after: 1 month
Relnotes: yes

46 hours agoClean up the style of the CUBIEBOARD2 config file
andrew [Sat, 20 Dec 2014 18:42:20 +0000 (18:42 +0000)]
Clean up the style of the CUBIEBOARD2 config file

47 hours agoClean up to use the standard style of "options \t" and "device\t\t"
andrew [Sat, 20 Dec 2014 18:15:23 +0000 (18:15 +0000)]
Clean up to use the standard style of "options \t" and "device\t\t"

2 days agoIncrease allowed size of the microcode blob to 32KB. Some Intel CPU's
kib [Sat, 20 Dec 2014 16:40:49 +0000 (16:40 +0000)]
Increase allowed size of the microcode blob to 32KB.  Some Intel CPU's
updates weight 28KB.

PR: 179523
MFC after: 1 week

2 days agoReport initiator id in portlist XML in more formalized way.
mav [Sat, 20 Dec 2014 16:39:56 +0000 (16:39 +0000)]
Report initiator id in portlist XML in more formalized way.

MFC after: 3 days

2 days agoReport XML parsing errors.
mav [Sat, 20 Dec 2014 16:13:31 +0000 (16:13 +0000)]
Report XML parsing errors.

MFC after: 3 days

2 days agoAdd to sbappendstream_locked() a check against NULL mbuf, like it is done
glebius [Sat, 20 Dec 2014 14:19:46 +0000 (14:19 +0000)]
Add to sbappendstream_locked() a check against NULL mbuf, like it is done
in sbappend_locked() and sbappendrecord_locked().

This is a quick fix to the panic introduced by r274712.

A proper solution should be to make sosend_generic() avoid calling
pru_send() with NULL mbuf for the protocols that do not understand
control messages. Those protocols that understand control messages,
should be able to receive NULL mbuf, if control is non-NULL.

2 days agoCleanup the code.
tuexen [Sat, 20 Dec 2014 13:47:38 +0000 (13:47 +0000)]
Cleanup the code.

Reported by: Coverity
CID: 1232003

2 days agoReplace ctl_min() macro with MIN().
mav [Sat, 20 Dec 2014 13:33:31 +0000 (13:33 +0000)]
Replace ctl_min() macro with MIN().

MFC after: 1 week

2 days agoVarious 8259 device model improvements:
neel [Sat, 20 Dec 2014 04:57:45 +0000 (04:57 +0000)]
Various 8259 device model improvements:

- implement 8259 "polled" mode.
- set 'atpic->sfn' if bit 4 in ICW4 is set during master initialization.
- report error if guest tries to enable the "special mask" mode.

Differential Revision: https://reviews.freebsd.org/D1328
Reviewed by: tychon
Reported by: grehan
Tested by: grehan
MFC after: 1 week

2 days agoLog mmc and sd command failures. Reporting of routine expected errors,
ian [Sat, 20 Dec 2014 04:24:40 +0000 (04:24 +0000)]
Log mmc and sd command failures.  Reporting of routine expected errors,
such as timeouts while probing a bus or testing for a feature, is
squelched.  Also, error reporting is limited to 5 events per second,
because when an sdcard goes bad on a low-end embedded board, flooding
the console at high speed isn't helpful.

Original logging code contributed by Michal Meloun, but then I fancied
it up with squelching and ppsratecheck.

2 days agoAdd a new sdhci quirk, SDHCI_QUIRK_WAITFOR_RESET_ASSERTED, to work around
ian [Sat, 20 Dec 2014 01:13:13 +0000 (01:13 +0000)]
Add a new sdhci quirk, SDHCI_QUIRK_WAITFOR_RESET_ASSERTED, to work around
TI OMAP controllers which will return the reset-in-progress bit as zero if
you read the status register too fast after setting the reset bit.

The zero is apparently from a stale snapshot of the internal state presented
in the interface register, and leads to a false indication that the reset
is complete when it either hasn't started yet or is in-progress.  The
workaround is to first loop until the bit is seen as asserted, then do the
normal loop waiting to see it de-asserted.

Submitted by: Michal Meloun <meloun@miracle.cz>

2 days agoWhen command and data interrupts have been aggregated together, don't do
ian [Sat, 20 Dec 2014 00:37:56 +0000 (00:37 +0000)]
When command and data interrupts have been aggregated together, don't do
the data-completed processing if a command-error interrupt is also asserted.

Reviewed by: Michal Meloun <meloun@miracle.cz>

2 days agoRemove comments relevant to 6.x only.
imp [Sat, 20 Dec 2014 00:07:53 +0000 (00:07 +0000)]
Remove comments relevant to 6.x only.

2 days agoRemove support for FreeBSD 7 and really old FreeBSD 8. The classifiers
imp [Sat, 20 Dec 2014 00:04:01 +0000 (00:04 +0000)]
Remove support for FreeBSD 7 and really old FreeBSD 8. The classifiers
have been in the base for a while, so the gymnastics here aren't
needed. In addition, the bugs in subr_disk.c have been fixed since
2009, so there's no need for an identical copy of it in the tree
anymore. There's really no need to binary patch g_io_request, so let's
get rid of the code (not compiled in anymore) lest others think it is
a good idea.

2 days agoRewrap long lines; no functional changes.
ian [Fri, 19 Dec 2014 23:24:54 +0000 (23:24 +0000)]
Rewrap long lines; no functional changes.

Submitted by: Michal Meloun <meloun@miracle.cz>

2 days agoAdd code to set and reset open-drain mode on the bus when requested.
ian [Fri, 19 Dec 2014 23:13:46 +0000 (23:13 +0000)]
Add code to set and reset open-drain mode on the bus when requested.

Submitted by: Michal Meloun <meloun@miracle.cz>

2 days agoConstify some static data.
mav [Fri, 19 Dec 2014 20:51:54 +0000 (20:51 +0000)]
Constify some static data.

MFC after: 2 weeks

2 days agoReduce number of places where global control_softc is used.
mav [Fri, 19 Dec 2014 20:35:06 +0000 (20:35 +0000)]
Reduce number of places where global control_softc is used.

At some point we may want to have several CTL instances, and that is not
really impossible.

MFC after: 2 weeks

2 days agoAdjust the test of a KASSERT to better match the intent.
benno [Fri, 19 Dec 2014 19:09:22 +0000 (19:09 +0000)]
Adjust the test of a KASSERT to better match the intent.

This assertion was added in r246213 as a guard against corrupted mbufs
arriving from drivers, the key distinguishing factor of said mbufs being
that they had a negative length. Given we're in a while loop specifically
designed to skip over zero-length mbufs, panicking on a zero-length mbuf
seems incorrect.

No objection from: kib

2 days agoBump the largest record we can cope with from 1k to 8k. Other users of
imp [Fri, 19 Dec 2014 18:45:52 +0000 (18:45 +0000)]
Bump the largest record we can cope with from 1k to 8k. Other users of
the hints file don't have any real limits, and longer records will
need to be written shortly.

3 days agoAdd support for empty ranges properties within the tree, some vendor
andrew [Fri, 19 Dec 2014 13:07:36 +0000 (13:07 +0000)]
Add support for empty ranges properties within the tree, some vendor
device trees have these, for example the ARM AArch64 Foundation Model.

Sponsored by: The FreeBSD Foundation

3 days agoCorrect the end address of the memory regions.
br [Fri, 19 Dec 2014 12:09:29 +0000 (12:09 +0000)]
Correct the end address of the memory regions.

Pointed out by: ian

3 days agoFix `make depend` in sys/modules
lwhsu [Fri, 19 Dec 2014 06:51:01 +0000 (06:51 +0000)]
Fix `make depend` in sys/modules

Differential Revision: https://reviews.freebsd.org/D1338
Reviewed by: delphij
Approved by: delphij

3 days agoPlug a memory leak.
delphij [Fri, 19 Dec 2014 06:48:47 +0000 (06:48 +0000)]
Plug a memory leak.

Obtained from: DragonFlyBSD (commit 5119ece)
MFC after: 2 weeks

3 days agoRemove a private copy of ieee80211_add_ssid().
adrian [Fri, 19 Dec 2014 01:41:51 +0000 (01:41 +0000)]
Remove a private copy of ieee80211_add_ssid().

PR: kern/196116
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

3 days agoMake ieee80211_add_ssid() public.
adrian [Fri, 19 Dec 2014 01:39:58 +0000 (01:39 +0000)]
Make ieee80211_add_ssid() public.

Some drivers use private copies of this.

PR: kern/196116
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

3 days agoSlightly polish iSCSI parameters negotiation.
mav [Fri, 19 Dec 2014 01:12:22 +0000 (01:12 +0000)]
Slightly polish iSCSI parameters negotiation.

MFC after: 1 week

3 days agoAdd missing continue: we can't proceed further if the
delphij [Fri, 19 Dec 2014 00:20:29 +0000 (00:20 +0000)]
Add missing continue: we can't proceed further if the
kernel does not panic with zfs_panic_recover.

Illumos issue:
    5438 zfs_blkptr_verify should continue after zfs_panic_recover

Reported by: Coverity
CID: 1232014

3 days agoMFV r275914:
delphij [Thu, 18 Dec 2014 23:45:26 +0000 (23:45 +0000)]
MFV r275914:

As of r270383, the dbuf_compare comparator compares the dbuf
attributes in the following order:

db_level (indirect level)
db_blkid (block number)
db_state (current state)
the address of the element

Because db_state is being considered before the element's state,
changing of db_state would affect balancedness of the AVL tree,
even when the address of element compares differently.  For
instance, in dbuf_create, db_state may be altered after the
node is inserted into the AVL tree and may break AVL tree
balancedness.

Instead of using db_state as a comparision critera (introduced
in r270383), consider it only when we are doing a lookup, that
is one of the two dbuf pointers contains DB_SEARCH.

Illumos issue:
    5422 preserve AVL invariants in dn_dbufs

MFC after: 2 weeks

3 days agoPass real optimal transfer size supported by backend.
mav [Thu, 18 Dec 2014 22:32:22 +0000 (22:32 +0000)]
Pass real optimal transfer size supported by backend.

For files and ZVOLs that is 1MB now, not 128K.

MFC after: 1 week

3 days agoSync with NetBSD, mainly address NetBSD bug #43355:
delphij [Thu, 18 Dec 2014 20:23:19 +0000 (20:23 +0000)]
Sync with NetBSD, mainly address NetBSD bug #43355:

Fix valid_format() to be more careful about allowing only valid
printf formats.

Obtained from: NetBSD
MFC after: 2 weeks

3 days agoInclude section name in strip warning message
emaste [Thu, 18 Dec 2014 19:09:59 +0000 (19:09 +0000)]
Include section name in strip warning message

3 days agoFix accidental MK_DEBUG_FILES=no addition to NXBMAKE in r275909
ngie [Thu, 18 Dec 2014 18:30:33 +0000 (18:30 +0000)]
Fix accidental MK_DEBUG_FILES=no addition to NXBMAKE in r275909

X-MFC with: r275909
Sponsored by: EMC / Isilon Storage Division

3 days agoDon't build full clang toolchain or clang extras in stages 1-3 of buildworld
ngie [Thu, 18 Dec 2014 18:26:10 +0000 (18:26 +0000)]
Don't build full clang toolchain or clang extras in stages 1-3 of buildworld

MFC after: 1 week
Reviewed by: dim (as part of a "larger" diff)
Phabric: D1336
Sponsored by: EMC / Isilon Storage Division

3 days agoDocument STRIP_CMD in build(7) and note its importance with LOCAL_ITOOLS
ngie [Thu, 18 Dec 2014 18:20:33 +0000 (18:20 +0000)]
Document STRIP_CMD in build(7) and note its importance with LOCAL_ITOOLS

MFC after: 1 week
Phabric: D1335
Reviewed by: brueffer
Sponsored by: EMC / Isilon Storage Division

3 days agoFix building/installing tests when TESTSBASE != /usr/tests
ngie [Thu, 18 Dec 2014 18:16:00 +0000 (18:16 +0000)]
Fix building/installing tests when TESTSBASE != /usr/tests

The work in r258233 hardcoded the assumption that tests was the last component
of the tests tree by pushing tests as an explicit prefix for the paths in
BSD.tests.dist and /usr was the prefix for all tests, per BSD.usr.dist and all
of the mtree calls used in Makefile.inc1. This assumption breaks if/when one
provides a custom TESTSBASE "prefix", e.g. TESTSBASE=/mytests .

One thing that r258233 did properly though was remove "/usr/tests" creation
from BSD.usr.dist -- that should have not been there in the first place. That
was an "oops" on my part for the work that was originally committed in r241823

MFC after: 2 weeks
Phabric: D1301
Reviewed by: imp
Sponsored by: EMC / Isilon Storage Division

3 days agoSetgid before running a command as a specified user. Previously only
jamie [Thu, 18 Dec 2014 18:10:39 +0000 (18:10 +0000)]
Setgid before running a command as a specified user.  Previously only
initgroups(3) was called, what isn't quite enough.  This brings jail(8)
in line with jexec(8), which was already doing the right thing.

PR: 195984
MFC after: 1 week

4 days agoDon't deselect the card too soon. To set the block size or switch the
imp [Thu, 18 Dec 2014 16:57:22 +0000 (16:57 +0000)]
Don't deselect the card too soon. To set the block size or switch the
function parameters, the card has to be in transfer state. If it is in
the idle state, the commands are ignored. This caused us not to set
the proper parameters that we later assume to be present, leading to
downstream failures of the card / interface as our state machine
mismatches the card's.

Submitted by: Svatopluk Kraus <onwahe at gmail.com>, Michal Meloun
<meloun at miracle.cz>

4 days agoRemove -fno-strict-alias, as it is no longer needed.
imp [Thu, 18 Dec 2014 16:57:19 +0000 (16:57 +0000)]
Remove -fno-strict-alias, as it is no longer needed.

4 days agoAdd AArch64 64-bit relocation values. These will be needed by rtld when
andrew [Thu, 18 Dec 2014 14:31:30 +0000 (14:31 +0000)]
Add AArch64 64-bit relocation values. These will be needed by rtld when
we import it along with utilities in elftoolchain.

Differential Revision: https://reviews.freebsd.org/D1330
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation

4 days agoThe VOP_LOOKUP() implementations for CREATE op do not put the name
kib [Thu, 18 Dec 2014 10:01:12 +0000 (10:01 +0000)]
The VOP_LOOKUP() implementations for CREATE op do not put the name
into namecache, to avoid cache trashing when doing large operations.
E.g., tar archive extraction is not usually followed by access to many
of the files created.

Right now, each VOP_LOOKUP() implementation explicitely knowns about
this quirk and tests for both MAKEENTRY flag presence and op != CREATE
to make the call to cache_enter().  Centralize the handling of the
quirk into VFS, by deciding to cache only by MAKEENTRY flag in VOP.
VFS now sets NOCACHE flag for CREATE namei() calls.

Note that the change in semantic is backward-compatible and could be
merged to the stable branch, and is compatible with non-changed
third-party filesystems which correctly handle MAKEENTRY.

Suggested by: Chris Torek <torek@pi-coral.com>
Reviewed by: mckusick
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

4 days agoFix the scan handling for 11b->11g upgrades in a world where, well,
adrian [Thu, 18 Dec 2014 05:17:18 +0000 (05:17 +0000)]
Fix the scan handling for 11b->11g upgrades in a world where, well,
it's not just 11b/11g.

The following was happening, and it's quite .. annoyingly grr-y.

* create vap, setup wpa_supplicant with no bgscanning, etc - there's
  no call to ieee80211_media_change, so vap->iv_des_mode is
  IEEE80211_MODE_AUTO;
* do ifconfig wlan0 scan - same thing, media_change doesn't get called,
  iv_des_mode stays as auto.
* But then, run wpa_cli and do 'scan' - it'll do a media change.
* if you're on 11ng, vap->iv_des_mode gets changed to IEEE80211_MODE_11NG
* Then makescanlist() is called.  There's a block of code that gets
  called if iv_des_mode != IEEE80211_MODE_AUTO, and it does this:

if (vap->iv_des_mode != IEEE80211_MODE_11G ||
    mode != IEEE80211_MODE_11B)
continue;
mode = IEEE80211_MODE_11G; /* upgrade */

* .. now, iv_des_mode is not IEEE80211_MODE_11G, so it always runs
  'continue'
* .. and thus the scan list stays empty and no further channel
  scans occur. Ever.(1)

If you then disassociate and try associating to something, your
scan table has likely been purged / aged out and you'll never
see anything in the scan list.

(1) You need to do 'ifconfig wlan0 mode auto' or just destroy/re-create
    the VAP to get working wireless again.

Tested:

* iwn(4) - intel 5300 wifi; STA mode; using wpa_supplicant; bgscan
  enabled -and- wpa_supplicant scanning.

Thanks to:

* Everyone who kept poking me about this and wondering why the hell
  their wifi would eventually stop seeing scan lists.  Grr.
  I eventually snapped this evening and dug back into this code.

4 days agoIn bsdinstall's distextract, replace mixed_gauge() of dialog(3) with
dteske [Thu, 18 Dec 2014 03:51:09 +0000 (03:51 +0000)]
In bsdinstall's distextract, replace mixed_gauge() of dialog(3) with
new dpv(3) wrapper to dialog(3) dialog_gauge(). The dpv(3) library provides
a more flexible and refined interface similar to dialog_mixedgauge() however
is implemented atop the more generalized dialog_gauge() for portability.
Noticeable improvements in bsdinstall's distextract will be a status line
showing data rate information (with support for localeconv(3) to format
numbers according to $LANG or $LC_ALL conversion information), i18n support,
improved auto-sizing of gauge widget, a ``wheel barrow'' to keep the user
informed that things are moving (even if status/progress has not changed),
improved color support (mini-progress bars use the same color, if enabled,
as the main gauge bar), and several other improvements (some not visible).
dpv stands for "dialog progress view" (dpv was introduced in SVN r274116).

Differential Revision: https://reviews.freebsd.org/D714
Discussed on: -current
Reviewed by: julian
MFC after: 3 days
X-MFC-to: stable/10
Relnotes: Improved installer feedback from bsdinstall distextract

4 days agoMake gas parse '__tls_get_addr(foo@tlsgd)'.
jhibbits [Thu, 18 Dec 2014 03:12:46 +0000 (03:12 +0000)]
Make gas parse '__tls_get_addr(foo@tlsgd)'.

Corresponds to 727fc41e077139570ea8b8ddfd6c546b2a55627c.

This allows us to use -no-integrated-as with clang, if we prefer.

Obtained from: binutils-gdb (Relicensed from Alan Modra as GPLv2)
MFC after: 2 weeks
X-MFC-with: r275718

4 days agoUpdate the use of bus space macros to be more correct.
adrian [Wed, 17 Dec 2014 21:27:27 +0000 (21:27 +0000)]
Update the use of bus space macros to be more correct.

This was a problem on i386 PAE builds.

4 days agoUse the correct macro for listing the maximum bus space size.
adrian [Wed, 17 Dec 2014 21:26:25 +0000 (21:26 +0000)]
Use the correct macro for listing the maximum bus space size.

Without this, it fails to compile on i386 PAE builds.

4 days agoAdd a missing break.
tuexen [Wed, 17 Dec 2014 20:34:38 +0000 (20:34 +0000)]
Add a missing break.

Reported by: Coverity
CID: 1232014
MFC after:  3 days

4 days agoPlug a memory leak in an error code path.
tuexen [Wed, 17 Dec 2014 20:19:57 +0000 (20:19 +0000)]
Plug a memory leak in an error code path.

Reported by: Coverity
CID: 1018936
MFC after:  3 days

4 days agoFix sporadic build failures due to race when running make installworld
ngie [Wed, 17 Dec 2014 20:02:07 +0000 (20:02 +0000)]
Fix sporadic build failures due to race when running make installworld
when strip gets replaced at install time by adding it to ITOOLS for the
default usr.bin/xinstall STRIP_CMD

This will fix the failure noted in this Jenkins build step:
https://jenkins.freebsd.org/job/Build-UFS-image/688/

This will also fix the issue reported by alfred@ dealing with installing on
targets that differ from build hosts (e.g. installing on i386/i386 when built
on amd64/amd64)

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

4 days agoParallelize building gnu/usr.bin/groff
ngie [Wed, 17 Dec 2014 19:46:12 +0000 (19:46 +0000)]
Parallelize building gnu/usr.bin/groff

This speeds up building the directory from the bootstrap-tools stage in
buildworld as well as building from the subdirectory

Based on a patch submitted via -arch:
https://lists.freebsd.org/pipermail/freebsd-arch/2014-December/016493.html

MFC after: 1 week
Submitted by: Jia-Shiun Li <jiashiun@gmail.com>
Sponsored by: EMC / Isilon Storage Division

5 days agoAdd configuration options to override physical and UNMAP blocks geometry.
mav [Wed, 17 Dec 2014 17:30:54 +0000 (17:30 +0000)]
Add configuration options to override physical and UNMAP blocks geometry.

While in most cases CTL should correctly fetch those values from backing
storages, there are some initiators (like MS SQL), that may not like large
physical block sizes, even if they are true.  For such cases allow override
fetched values with supported ones (like 4K).

MFC after: 1 week

5 days agoMake sequence numbers checks more strict.
mav [Wed, 17 Dec 2014 15:13:21 +0000 (15:13 +0000)]
Make sequence numbers checks more strict.

While we don't support MCS, hole in received sequence numbers may mean
only PDU loss.  While we don't support lost PDU recovery, terminate the
connection to avoid stuck commands.

While there, improve handling of sequence numbers wrap after 2^32 PDUs.

MFC after: 2 weeks