]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoFix various mdoc issues.
brueffer [Sun, 21 Dec 2014 09:53:29 +0000 (09:53 +0000)]
Fix various mdoc issues.

Found with: mandoc -Tlint

9 years 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).

9 years 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

9 years 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.

9 years 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.

9 years 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.

9 years 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.

9 years 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

9 years 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>

9 years 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

9 years 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!

9 years 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

9 years 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

9 years 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"

9 years 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

9 years 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

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

MFC after: 3 days

9 years 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.

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

Reported by: Coverity
CID: 1232003

9 years 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

9 years 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

9 years 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.

9 years 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>

9 years 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>

9 years 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.

9 years 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.

9 years 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>

9 years 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>

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

MFC after: 2 weeks

9 years 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

9 years 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

9 years 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.

9 years 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

9 years 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

9 years 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

9 years 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

9 years 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>

9 years 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>

9 years 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

9 years 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

9 years 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

9 years 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

9 years 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

9 years 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

9 years 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

9 years 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

9 years 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

9 years 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

9 years 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

9 years 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>

9 years 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.

9 years 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

9 years 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

9 years 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.

9 years 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

9 years 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

9 years 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.

9 years 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.

9 years 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

9 years 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

9 years 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

9 years 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

9 years 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

9 years 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

9 years agoDo not strip all when stripping an explicit symbol
emaste [Wed, 17 Dec 2014 14:46:21 +0000 (14:46 +0000)]
Do not strip all when stripping an explicit symbol

When requested to strip specific symbols (-N flag) the default should be
to strip nothing (other than the requested symbols). This is consistent
with binutils strip(1).

PR: 196038
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1327

9 years agoAdd configuration files for BERI soft-core synthesized on
br [Wed, 17 Dec 2014 11:36:31 +0000 (11:36 +0000)]
Add configuration files for BERI soft-core synthesized on
Terasic SoCKit board (Altera FPGA).

Use virtio block as root filesystem device.

Sponsored by: DARPA, AFRL

9 years agoMove memory node to the root, so fdt_get_mem_regions() can find it.
br [Wed, 17 Dec 2014 11:05:44 +0000 (11:05 +0000)]
Move memory node to the root, so fdt_get_mem_regions() can find it.

9 years agoo Add PIO[2,3] devices information
br [Wed, 17 Dec 2014 10:48:53 +0000 (10:48 +0000)]
o Add PIO[2,3] devices information
o Enable Virtio Block

9 years agoUse memory regions information provided in FDT.
br [Wed, 17 Dec 2014 09:34:54 +0000 (09:34 +0000)]
Use memory regions information provided in FDT.

Reviewed by: brooks
Sponsored by: DARPA, AFRL

9 years agoInitilize the msg_flags field consistently in all code paths.
tuexen [Wed, 17 Dec 2014 07:47:25 +0000 (07:47 +0000)]
Initilize the msg_flags field consistently in all code paths.

Reported by: Coverity
CID: 1018726

9 years agoAdjust printf format specifiers for dev_t and ino_t in kernel.
gleb [Wed, 17 Dec 2014 07:27:19 +0000 (07:27 +0000)]
Adjust printf format specifiers for dev_t and ino_t in kernel.

ino_t and dev_t are about to become uint64_t.

Reviewed by: kib, mckusick

9 years agoAdjust printf format specifiers for dev_t and ino_t in user space.
gleb [Wed, 17 Dec 2014 07:10:48 +0000 (07:10 +0000)]
Adjust printf format specifiers for dev_t and ino_t in user space.

ino_t and dev_t are about to become uint64_t.

Reviewed by: kib, mckusick

9 years agoMFV r275844:
delphij [Wed, 17 Dec 2014 06:55:44 +0000 (06:55 +0000)]
MFV r275844:

Fix unbound remote denial of service vulnerability.

Security: FreeBSD-SA-14:30.unbound
Security: CVE-2014-8602

9 years agoPrefix all the vxlan ifconfig commands so they are unique
bryanv [Wed, 17 Dec 2014 05:36:34 +0000 (05:36 +0000)]
Prefix all the vxlan ifconfig commands so they are unique

And rehook ifvxlan back into the build.

9 years agoFix 8259 IRQ priority resolver.
neel [Wed, 17 Dec 2014 03:04:43 +0000 (03:04 +0000)]
Fix 8259 IRQ priority resolver.
Initialize the 8259 such that IRQ7 is the lowest priority.

Reviewed by: tychon
Differential Revision: https://reviews.freebsd.org/D1322
MFC after: 1 week

9 years agoBump Dd for r275846
bdrewery [Wed, 17 Dec 2014 01:36:00 +0000 (01:36 +0000)]
Bump Dd for r275846

MFC after: 3 weeks

9 years agoAdd some additional clarification and fix a few gammer nits.
mckusick [Wed, 17 Dec 2014 01:32:27 +0000 (01:32 +0000)]
Add some additional clarification and fix a few gammer nits.

Reviewed by: kib
MFC after:   3 weeks

9 years agoInitialize an argument to NULL instead of expecting dlinfo() to do it.
will [Wed, 17 Dec 2014 00:22:41 +0000 (00:22 +0000)]
Initialize an argument to NULL instead of expecting dlinfo() to do it.

dlinfo() is a weak reference that may not be initialized at the time of
execution. The default implementation (in lib/libc/gen/dlfcn.c) neither
modifies the address pointed to by the third argument nor returns an error.

Differential Revision: https://reviews.freebsd.org/D1326
Reviewed by: markj
MFC after: 1 week

9 years agoDo not count RCTD bit set as an error.
mav [Tue, 16 Dec 2014 21:51:21 +0000 (21:51 +0000)]
Do not count RCTD bit set as an error.

We can not really implement it, but specification tells that it "shall"
work, so it can be safely ignored.

MFC after: 1 week

9 years agoAdd an UPDATING entry and warning about the change in r274807 to help users
brooks [Tue, 16 Dec 2014 20:45:17 +0000 (20:45 +0000)]
Add an UPDATING entry and warning about the change in r274807 to help users
transition to the new behavior.

Discussed with: jmallett
Sponsored by: DARPA, AFRL

9 years agosed: Bounds check the file path used in the 'w' command.
pfg [Tue, 16 Dec 2014 20:26:11 +0000 (20:26 +0000)]
sed: Bounds check the file path used in the 'w' command.

Modified version of a diff from Sebastien Marie to prevent a crash found
with the afl fuzzer.

Obtained from: OpenBSD (CVS Rev. 1.37)
MFC after: 1 week

9 years agoThe iret instruction may generate #np and #ss fault, besides #gp.
kib [Tue, 16 Dec 2014 18:28:33 +0000 (18:28 +0000)]
The iret instruction may generate #np and #ss fault, besides #gp.
When returning to usermode, the handler for that exceptions is also
executed with wrong gs base.  Handle all three possible faults in the
same way, checking for iret fault, and performing full iret.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

9 years agoMake NanoBSD source-able from other scripts.
will [Tue, 16 Dec 2014 17:59:05 +0000 (17:59 +0000)]
Make NanoBSD source-able from other scripts.

Summary:
This change converts NanoBSD into a two-script bundle.
- defaults.sh contains all non-CLI code.  Most NanoBSD code is moved into
  this file.
- nanobsd.sh now consists just of a command line interface that calls into
  functions in defaults.sh.

Test Plan: Run NanoBSD using a previously-working configuration.

Reviewers: imp

Reviewed By: imp

Differential Revision: https://reviews.freebsd.org/D1321

9 years agoCopy elftoolchain readelf from vendor branch
emaste [Tue, 16 Dec 2014 16:23:54 +0000 (16:23 +0000)]
Copy elftoolchain readelf from vendor branch

9 years agoAdd ability to not specify a zone identifier twice, when both source and
ae [Tue, 16 Dec 2014 14:59:20 +0000 (14:59 +0000)]
Add ability to not specify a zone identifier twice, when both source and
destination addresses are specified.
For example:
# ping6 -S fe80::1%ix0 ff02::1
or
# ping6 -S fe80::1 fe80::2%ix0

Obtained from: Yandex LLC
Sponsored by: Yandex LLC

9 years agoAdd tests for pw -N
brd [Tue, 16 Dec 2014 14:50:33 +0000 (14:50 +0000)]
Add tests for pw -N

PR: 150449
Submitted by: Robert O'Neil <oneil.rs@gmail.com>
Approved by: will

9 years agoAdd missed break.
kib [Tue, 16 Dec 2014 09:49:07 +0000 (09:49 +0000)]
Add missed break.

CID: 1258587
Sponsored by: The FreeBSD Foundation
MFC after: 20 days

9 years agoAdd missed break.
kib [Tue, 16 Dec 2014 09:48:23 +0000 (09:48 +0000)]
Add missed break.

CID: 1258586
Sponsored by: The FreeBSD Foundation
MFC after: 4 days

9 years agoRename cpack*() to CMPLX*().
ed [Tue, 16 Dec 2014 09:21:56 +0000 (09:21 +0000)]
Rename cpack*() to CMPLX*().

The C11 standard introduced a set of macros (CMPLX, CMPLXF, CMPLXL) that
can be used to construct complex numbers from a pair of real and
imaginary numbers. Unfortunately, they require some compiler support,
which is why we only define them for Clang and GCC>=4.7.

The cpack() function in libm performs the same task as CMPLX(), but
cannot be used to generate compile-time constants. This means that all
invocations of cpack() can safely be replaced by C11's CMPLX(). To keep
the code building with GCC 4.2, provide copies of CMPLX() that can at
least be used to generate run-time complex numbers.

This makes it easier to build some of the functions outside of libm.

9 years agosbin/shutdown: Support time units as in 'shutdown -r +5sec'
gleb [Tue, 16 Dec 2014 08:29:02 +0000 (08:29 +0000)]
sbin/shutdown: Support time units as in 'shutdown -r +5sec'

Units supported: s, sec, m, min, h, hour.

Differential Revision: https://reviews.freebsd.org/D1272

9 years agoFor level triggered interrupts clear the PIC IRR bit when the interrupt pin
neel [Tue, 16 Dec 2014 06:33:57 +0000 (06:33 +0000)]
For level triggered interrupts clear the PIC IRR bit when the interrupt pin
is deasserted. Prior to this change each assertion on a level triggered irq
pin resulted in two interrupts being delivered to the CPU.

Differential Revision: https://reviews.freebsd.org/D1310
Reviewed by: tychon
MFC after: 1 week

9 years agoFix a bug introdiced in r217548. According to NS DP83815 data
yongari [Tue, 16 Dec 2014 06:13:30 +0000 (06:13 +0000)]
Fix a bug introdiced in r217548.  According to NS DP83815 data
sheet, RX filter should be disabled before programming.
Previously it was clearing wrong bits so RX filter was not
disabled in RX filter configuration.

Reported by: brad@OpenBSD.org

9 years agoUse standard BSD license disclaimer text
emaste [Mon, 15 Dec 2014 22:20:14 +0000 (22:20 +0000)]
Use standard BSD license disclaimer text

Approved by: benno, nwhitehorn

9 years agoProperly sort Xr to silence mandoc warnings.
dchagin [Mon, 15 Dec 2014 20:48:06 +0000 (20:48 +0000)]
Properly sort Xr to silence mandoc warnings.

Differential Revision: https://reviews.freebsd.org/D1314
Reviewed by: wblock
MFC after: 1 Month

9 years agoMFV r275784:
delphij [Mon, 15 Dec 2014 18:28:22 +0000 (18:28 +0000)]
MFV r275784:

Plug a memory leak in libzfs.  In zfs_iter_bookmarks, an nvlist is allocated
before calling lzc_get_bookmarks, which allocates the nvlist again (and
overwrites the pointer to previously allocated list).

Illumos issue:
    5427 memory leak in libzfs when doing rollback

MFC after: 2 weeks

9 years agoMFV r275783:
delphij [Mon, 15 Dec 2014 18:22:45 +0000 (18:22 +0000)]
MFV r275783:

Convert ARC flags to use enum.  Previously, public flags are defined in
arc.h and private flags are defined in arc.c which can lead to confusion
and programming errors.

Consistently use 'hdr' (when referencing arc_buf_hdr_t) instead of 'buf'
or 'ab' because arc_buf_t are often named 'buf' as well.

Illumos issue:
    5369 arc flags should be an enum
    5370 consistent arc_buf_hdr_t naming scheme

MFC after: 2 weeks

9 years agoCorrect elftoolchain strip(1) memory size calculation
emaste [Mon, 15 Dec 2014 18:18:57 +0000 (18:18 +0000)]
Correct elftoolchain strip(1) memory size calculation

Calculate the segment's memory size (p_memsz) using the virtual
addresses, not the file offsets. Otherwise padding preceeding SHT_NOBITS
sections may be excluded from the calculation, resulting in a segment
that is too small.

PR: 195653
Sponsored by: The FreeBSD Foundation

9 years agoCheck for SS_NBIO in so->so_state instead of sb->sb_flags in
jhb [Mon, 15 Dec 2014 17:52:08 +0000 (17:52 +0000)]
Check for SS_NBIO in so->so_state instead of sb->sb_flags in
soreceive_stream().

Differential Revision: https://reviews.freebsd.org/D1299
Reviewed by: bz, gnn
MFC after: 1 week

9 years agoMarkup fixes for kqueue(2), no content changes.
kib [Mon, 15 Dec 2014 14:58:10 +0000 (14:58 +0000)]
Markup fixes for kqueue(2), no content changes.

Reviewed by: brueffer (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

9 years agoFix incorrect type of "invalids" argument in __iconv() prototype.
kuriyama [Mon, 15 Dec 2014 14:36:04 +0000 (14:36 +0000)]
Fix incorrect type of "invalids" argument in __iconv() prototype.