freebsd.git
9 years agoD2432 (Patch for Amlogic single core PIC) moved the SMP option out
Ganbold Tsagaankhuu [Wed, 20 May 2015 05:49:52 +0000 (05:49 +0000)]
D2432 (Patch for Amlogic single core PIC) moved the SMP option out
of AML8726 and into board specific config files since some boards
(e.g. YYHD18) use the aml8726-m3 which only have a single core.

r283057 applied most of D2432, however while it removed SMP from
AML8726, it missed adding the SMP option to the board specific
config files.

Differential Revision: https://reviews.freebsd.org/D2589
Submitted by: John Wehle

9 years agoAdd a new sysctl net.inet.tcp.hostcache.purgenow=1 to expire and purge all
Hiren Panchasara [Wed, 20 May 2015 01:08:01 +0000 (01:08 +0000)]
Add a new sysctl net.inet.tcp.hostcache.purgenow=1 to expire and purge all
entries in hostcache immediately.

In collaboration with: bz, rwatson
MFC after: 1 week
Relnotes: yes
Sponsored by: Limelight Networks

9 years agoReduce overlinking.
Baptiste Daroussin [Tue, 19 May 2015 22:29:11 +0000 (22:29 +0000)]
Reduce overlinking.
Because of libdtrace there is still a bit a overlinking but nothing we can deal
with easily

9 years agoCorrectly link libdtrace and convert to LIBADD
Baptiste Daroussin [Tue, 19 May 2015 22:24:19 +0000 (22:24 +0000)]
Correctly link libdtrace and convert to LIBADD
Make dtrace only link to libdtrace

9 years agoFix underlinking
Baptiste Daroussin [Tue, 19 May 2015 22:23:15 +0000 (22:23 +0000)]
Fix underlinking

9 years agoRegister libdtrace and its direct and indirect dependencies
Baptiste Daroussin [Tue, 19 May 2015 22:22:53 +0000 (22:22 +0000)]
Register libdtrace and its direct and indirect dependencies
Register librdlt_db
Register libproc dependencies
Register libctf dependencies

9 years agoConvert to LIBADD
Baptiste Daroussin [Tue, 19 May 2015 21:59:00 +0000 (21:59 +0000)]
Convert to LIBADD

9 years agoConvert to LIBADD
Baptiste Daroussin [Tue, 19 May 2015 21:57:11 +0000 (21:57 +0000)]
Convert to LIBADD
Remove dependency on pthread, it is not needed

9 years agoRe-select the SD card before getting the SD status. On a couple Atmel
Warner Losh [Tue, 19 May 2015 21:16:53 +0000 (21:16 +0000)]
Re-select the SD card before getting the SD status. On a couple Atmel
boards, this prevents some error messages during enumeration and also
gives us the correct erase block size. They appear to be harmless
elsewhere.

# Note: we treat too many commands as 'can't fail' if they don't work
# after a couple of retries. We need to fix that, but not today...

9 years agoAdd NFS server to mix (for easier, in-place updates). Move to
Warner Losh [Tue, 19 May 2015 21:16:51 +0000 (21:16 +0000)]
Add NFS server to mix (for easier, in-place updates). Move to
partition 2 for root (since partition 1 is reserved for FAT
files the Atmel ROMs can load).

9 years agoImprove comment about unmapped I/O and fix typos.
Warner Losh [Tue, 19 May 2015 21:16:37 +0000 (21:16 +0000)]
Improve comment about unmapped I/O and fix typos.

Submitted by: Matteo Riondato
MFC After: 2 days

9 years agoAll FreeBSD platforms are elf: move i386-elf to i386
Ed Maste [Tue, 19 May 2015 21:00:53 +0000 (21:00 +0000)]
All FreeBSD platforms are elf: move i386-elf to i386

This was a leftover from when we had both i386 a.out and ELF.

Reviewed by: kib, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2591

9 years agoCorrect the wording as we are increasing the window size.
Hiren Panchasara [Tue, 19 May 2015 19:17:20 +0000 (19:17 +0000)]
Correct the wording as we are increasing the window size.

Reviewed by: jhb
Sponsored by: Limelight Networks

9 years agoFix two bugs that could result in PMC sampling effectively stopping.
John Baldwin [Tue, 19 May 2015 19:15:19 +0000 (19:15 +0000)]
Fix two bugs that could result in PMC sampling effectively stopping.
In both cases, the the effect of the bug was that a very small positive
number was written to the counter. This means that a large number of
events needed to occur before the next sampling interrupt would trigger.
Even with very frequently occurring events like clock cycles wrapping all
the way around could take a long time. Both bugs occurred when updating
the saved reload count for an outgoing thread on a context switch.

First, the counter-independent code compares the current reload count
against the count set when the thread switched in and generates a delta
to apply to the saved count. If this delta causes the reload counter
to go negative, it would add a full reload interval to wrap it around to
a positive value. The fix is to add the full reload interval if the
resulting counter is zero.

Second, occasionally the raw counter value read during a context switch
has actually wrapped, but an interrupt has not yet triggered. In this
case the existing logic would return a very large reload count (e.g.
2^48 - 2 if the counter had overflowed by a count of 2). This was seen
both for fixed-function and programmable counters on an E5-2643.
Workaround this case by returning a reload count of zero.

PR: 198149
Differential Revision: https://reviews.freebsd.org/D2557
Reviewed by: emaste
MFC after: 1 week
Sponsored by: Norse Corp, Inc.

9 years agoUse the proper mask when reloading sampling PMCs for Core CPUs.
John Baldwin [Tue, 19 May 2015 19:01:22 +0000 (19:01 +0000)]
Use the proper mask when reloading sampling PMCs for Core CPUs.

Differential Revision: https://reviews.freebsd.org/D2492
Reviewed by: emaste
MFC after: 1 month

9 years agoUse fixed enum values for PMC_CLASSES().
John Baldwin [Tue, 19 May 2015 18:58:18 +0000 (18:58 +0000)]
Use fixed enum values for PMC_CLASSES().

This removes one of the frequent causes of ABI breakage when new CPU
types are added to hwpmc(4).

Differential Revision: https://reviews.freebsd.org/D2586
Reviewed by: davide, emaste, gnn (earlier version)
MFC after: 2 weeks

9 years agoRemove executable property from several ixl(4) source files.
John Baldwin [Tue, 19 May 2015 18:35:18 +0000 (18:35 +0000)]
Remove executable property from several ixl(4) source files.

Differential Revision: https://reviews.freebsd.org/D2583
Reviewed by: erj

9 years agoBring back support for checking tables via "ipfw -n".
Alexander V. Chernikov [Tue, 19 May 2015 18:29:13 +0000 (18:29 +0000)]
Bring back support for checking tables via "ipfw -n".

Currently we have different table key types which can easily interfere
with each other (numbers and IPv4 address, interface names and hostnames,
  flows and hostnames/addresses).
This conflicts are solved by [auto-]creating _typed_ tables, so after
table is created, only keys of given type can be inserted to that table.
ipfw(8) consults with kernel about key/value type for particular table so
it knows key/value interpretation.
However, we have 2 cases (adding entries to non-existing table and
  parsing configuration file via `ipfw -n`) when kernel is unable to
  provide us table info we need. Fix the latter case by partially importing
  old `table_fill_xentry()` parse function responsible for guessing key type.

Sponsored by: Yandex LLC

9 years agoRemove unneded mbuf length adjustment, M_PREPEND() already did that.
Andrey V. Elsukov [Tue, 19 May 2015 17:14:27 +0000 (17:14 +0000)]
Remove unneded mbuf length adjustment, M_PREPEND() already did that.

PR: 139387
MFC after: 1 week

9 years agouse proper types to represent function pointers
Luigi Rizzo [Tue, 19 May 2015 16:51:30 +0000 (16:51 +0000)]
use proper types to represent function pointers

9 years agoProperly null-terminate strings in a kernel dump header. A version string
Alan Somers [Tue, 19 May 2015 16:23:47 +0000 (16:23 +0000)]
Properly null-terminate strings in a kernel dump header.  A version string
longer than 192 bytes will cause the version field of a dump header to
overflow. strncpy doesn't null terminate it, so savecore will print a
corrupted info file. Using strlcpy fixes the bug.

Differential Revision: https://reviews.freebsd.org/D2560
Reviewed by: markj
MFC after: 3 weeks
Sponsored by: Spectra Logic

9 years agoFixup to the kern_psignal manpage
Benjamin Kaduk [Tue, 19 May 2015 15:43:20 +0000 (15:43 +0000)]
Fixup to the kern_psignal manpage

r283105 misspelled kern_psignal as kernel_psignal in one occurrence, and
added trailing whitespace.

While here, change 'call' to the more standard 'function', and say why
the name was changed (taken from the commit message for r225617).

9 years agoremove a redundant ; at the end of a function
Luigi Rizzo [Tue, 19 May 2015 15:29:00 +0000 (15:29 +0000)]
remove a redundant ; at the end of a function

MFC after: 1 week

9 years agoAdd Performance Monitoring Counters support for AArch64.
Ruslan Bukin [Tue, 19 May 2015 15:25:47 +0000 (15:25 +0000)]
Add Performance Monitoring Counters support for AArch64.
Family-common and CPU-specific counters implemented.

Supported CPUs: ARM Cortex A53/57/72.

Reviewed by: andrew, bz, emaste, gnn, jhb
Sponsored by: ARM Limited
Differential Revision: https://reviews.freebsd.org/D2555

9 years agoremove an extra ; after MODULE_DEPEND
Luigi Rizzo [Tue, 19 May 2015 14:49:31 +0000 (14:49 +0000)]
remove an extra ; after MODULE_DEPEND
(would otherwise generate a warning with more verbose compiler flags)

MFC after: 1 week

9 years agoAdd GRP_COMDAT section group flag to ELF header
Ed Maste [Tue, 19 May 2015 14:23:33 +0000 (14:23 +0000)]
Add GRP_COMDAT section group flag to ELF header

Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2582

9 years agoWhen sleeping in Sx state using MWAIT instruction, accept fast wakeup
Konstantin Belousov [Tue, 19 May 2015 14:21:00 +0000 (14:21 +0000)]
When sleeping in Sx state using MWAIT instruction, accept fast wakeup
requests from writes to the monitored line.

Submitted by: avg

9 years agoUpdate crunch bootstrapping test for recent fixes
Ed Maste [Tue, 19 May 2015 14:05:15 +0000 (14:05 +0000)]
Update crunch bootstrapping test for recent fixes

- r277259 crunchide: Correct 64-bit section header offset
- r281674 crunchide: always include both 32- and 64-bit ELF support

With built-in cross-size support we also no longer need a special case
for cross-build crunchide.

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

9 years agoUse MTX_SYSINIT() instead of mtx_init() to separate mutex initialization
Gleb Smirnoff [Tue, 19 May 2015 14:04:21 +0000 (14:04 +0000)]
Use MTX_SYSINIT() instead of mtx_init() to separate mutex initialization
from associated structures initialization.  The mutexes are global, while
the structures are per-vnet.

Submitted by: Nikos Vassiliadis <nvass gmx.com>

9 years agoDuring module unload unlock rules before destroying UMA zones, which
Gleb Smirnoff [Tue, 19 May 2015 14:02:40 +0000 (14:02 +0000)]
During module unload unlock rules before destroying UMA zones, which
may sleep in uma_drain(). It is safe to unlock here, since we are already
dehooked from pfil(9) and all pf threads had quit.

Sponsored by: Nginx, Inc.

9 years agoOnly several years late, catch the psignal man page up to the
Julian Elischer [Tue, 19 May 2015 11:33:04 +0000 (11:33 +0000)]
Only several years late, catch the psignal man page up to the
fact that psignal has been renamed to kern_psignal since 9.0.

MFC after: 1 week

9 years agoRead GEOM_UNCOMPRESS metadata using several requests that fit into
Andrey V. Elsukov [Tue, 19 May 2015 09:28:52 +0000 (09:28 +0000)]
Read GEOM_UNCOMPRESS metadata using several requests that fit into
MAXPHYS. For large compressed images the metadata size can be bigger
than MAXPHYS and this triggers KASSERT in g_read_data().
Also use g_free() to free memory allocated by g_read_data().

PR: 199476
MFC after: 2 weeks

9 years agoFix for DWC OTG device side isochronous transfers. The even or odd
Hans Petter Selasky [Tue, 19 May 2015 09:22:06 +0000 (09:22 +0000)]
Fix for DWC OTG device side isochronous transfers. The even or odd
isochronous frame bit needs to be flipped.

MFC after: 3 days

9 years agoChange SA's state before sending SADB_EXPIRE message. This state will
Andrey V. Elsukov [Tue, 19 May 2015 08:37:03 +0000 (08:37 +0000)]
Change SA's state before sending SADB_EXPIRE message. This state will
be reported to keying daemon.

MFC after: 2 weeks

9 years agoTeach key_expire() send SADB_EXPIRE message with the SADB_EXT_LIFETIME_HARD
Andrey V. Elsukov [Tue, 19 May 2015 08:30:04 +0000 (08:30 +0000)]
Teach key_expire() send SADB_EXPIRE message with the SADB_EXT_LIFETIME_HARD
extension header type. The key_flush_sad() now will send SADB_EXPIRE
message when HARD lifetime expires. This is required by RFC 2367 and some
keying daemons rely on these messages. HARD lifetime messages have
precedence over SOFT lifetime messages, so now they will be checked first.
Also now SADB_EXPIRE messages will be send even the SA has not been used,
because keying daemons might want to rekey such SA.

PR: 200282, 200283
Submitted by: Tobias Brunner <tobias at strongswan dot org>
MFC after: 2 weeks

9 years agoConvert routerstation to use geom_uncompress.
Adrian Chadd [Tue, 19 May 2015 06:45:56 +0000 (06:45 +0000)]
Convert routerstation to use geom_uncompress.

9 years agoMigrate RSPRO to use the uncompress module, not uzip.
Adrian Chadd [Tue, 19 May 2015 06:45:06 +0000 (06:45 +0000)]
Migrate RSPRO to use the uncompress module, not uzip.

(This is hand-in-hand with what I'm about to do with freebsd-wifi-build.)

9 years agoQCA955x / AP135 platform tidyups.
Adrian Chadd [Tue, 19 May 2015 05:41:00 +0000 (05:41 +0000)]
QCA955x / AP135 platform tidyups.

* Change mips24k -> mips74k for hwpmc, but leave it disabled for now.
* don't build pci by default.
* build pci and qca955x_pci for AP135, as theres a PCIe NIC.
* don't build a hwpmc module, it doesn't really work out well
  for the mips boards at the moment.
* add ipfw and DEFAULT_TO_ACCEPT.

9 years agoThe AP135 PCIe NIC isn't an ath device, it's an 11ac part (linux ath10k.)
Adrian Chadd [Tue, 19 May 2015 05:33:07 +0000 (05:33 +0000)]
The AP135 PCIe NIC isn't an ath device, it's an 11ac part (linux ath10k.)
So, don't try to attach hints to it here.

9 years agoAdd initial support for the QCA955x PCIe host controller.
Adrian Chadd [Tue, 19 May 2015 05:31:58 +0000 (05:31 +0000)]
Add initial support for the QCA955x PCIe host controller.

The QCA955x looks a lot like the AR724x PCIe controller, except it
supports two root complexes.  Unfortunately I only have one, so
although this code has started down the path of supporting more than
one, it's definitely not yet ready.

Tested:

* AP135 board (QCA9558 SoC), with the 11ac NIC swapped for an AR9380
  PCIe NIC.

Notes:

* Yes, this driver isn't very pretty.  I decided to commit what I have
  versus holding onto something that isn't yet finished.  It is enough
  to bring up the above NIC and interrupt routing works, so it's a good
  start.

* However, yes, the DDR flush routine hooks need to be fixed up.
  I don't think I'm firing the right one at the moment.

9 years agoAdd mv / expr ; these are used by the updated freebsd-wifi-build environment.
Adrian Chadd [Tue, 19 May 2015 03:02:52 +0000 (03:02 +0000)]
Add mv / expr ; these are used by the updated freebsd-wifi-build environment.

9 years agoAdded description of POSIX-specified behavior when invoked on a key from within that...
Patrick Kelsey [Tue, 19 May 2015 02:24:55 +0000 (02:24 +0000)]
Added description of POSIX-specified behavior when invoked on a key from within that key's destructor.

Reviewed by: jhb, -doc
Approved by: jmallett (mentor)
MFC after: 3 days
Sponsored by: Norse Corp, Inc.

9 years agoMerge ACPICA 20150515.
Jung-uk Kim [Mon, 18 May 2015 23:46:11 +0000 (23:46 +0000)]
Merge ACPICA 20150515.

9 years agoImport ACPICA 20150515.
Jung-uk Kim [Mon, 18 May 2015 23:17:05 +0000 (23:17 +0000)]
Import ACPICA 20150515.

9 years agoSynchronize with OpenBSD
Baptiste Daroussin [Mon, 18 May 2015 22:40:12 +0000 (22:40 +0000)]
Synchronize with OpenBSD

Obtained from: OpenBSD

9 years agoddb: stop boolean screaming.
Pedro F. Giffuni [Mon, 18 May 2015 22:27:46 +0000 (22:27 +0000)]
ddb: stop boolean screaming.

TRUE --> true
FALSE--> false

Hinted by: NetBSD

9 years agoSynchronize libedit with NetBSD
Baptiste Daroussin [Mon, 18 May 2015 22:03:05 +0000 (22:03 +0000)]
Synchronize libedit with NetBSD

It incorporates and fixes our patches to get el_gets return the proper count of
characters in unicode mode.

9 years agoMFV of 283077,tzdata2015d
Edwin Groothuis [Mon, 18 May 2015 21:05:11 +0000 (21:05 +0000)]
MFV of 283077,tzdata2015d

Update to tzdata2015d:

Release 2015d - 2015-04-24 08:09:46 -0700

  Changes affecting future time stamps

    Egypt will not observe DST in 2015 and will consider canceling it
    permanently.  For now, assume no DST indefinitely.
    (Thanks to Ahmed Nazmy and Tim Parenti.)

  Change affecting past and future time zone abbreviations

    The abbreviations for Hawaii-Aleutian standard and daylight times
    have been changed from HAST/HADT to HST/HDT, as per US Government
    Printing Office style.  This affects only America/Adak since 1983,
    as America/Honolulu was already using the new style.

9 years agoVendor import of tzdata2015d:
Edwin Groothuis [Mon, 18 May 2015 21:02:33 +0000 (21:02 +0000)]
Vendor import of tzdata2015d:

Update to tzdata2015d:

Release 2015d - 2015-04-24 08:09:46 -0700

  Changes affecting future time stamps

    Egypt will not observe DST in 2015 and will consider canceling it
    permanently.  For now, assume no DST indefinitely.
    (Thanks to Ahmed Nazmy and Tim Parenti.)

  Change affecting past and future time zone abbreviations

    The abbreviations for Hawaii-Aleutian standard and daylight times
    have been changed from HAST/HADT to HST/HDT, as per US Government
    Printing Office style.  This affects only America/Adak since 1983,
    as America/Honolulu was already using the new style.

Obtained from: ftp://ftp.iana.org/tz/releases/

9 years agoFix off-by-one in array index bounds check
Allan Jude [Mon, 18 May 2015 19:45:46 +0000 (19:45 +0000)]
Fix off-by-one in array index bounds check

bhyveload would allow you to create 33 entries on an array that only has 32 slots

Differential Revision: https://reviews.freebsd.org/D2569
Reviewed by: araujo
Approved by: neel
MFC after: 1 week
Sponsored by: ScaleEngine Inc.

9 years agoFix error in gmountver(8) man page
Allan Jude [Mon, 18 May 2015 19:37:55 +0000 (19:37 +0000)]
Fix error in gmountver(8) man page

Also fixes the usage statement for the binary to use the correct terms (provider and geom name, rather than dev and prov, which is incorrect in the latter case)
Sync the man page summary with the new usage statement

PR: 199540
Differential Revision: https://reviews.freebsd.org/D2329
Submitted by: Fabian Keil
Reviewed by: trasz
Approved by: eadler (mentor)
Obtained from: ElectroBSD (original)
MFC after: 1 week
Sponsored by: ScaleEngine Inc.

9 years agoDon't do things we aren't allowed to do in a signal handler... Defer
John-Mark Gurney [Mon, 18 May 2015 19:18:42 +0000 (19:18 +0000)]
Don't do things we aren't allowed to do in a signal handler...  Defer
the work to the main thread...  This fixes a possible crash if SIGINFO
is delivered at the wrong time...

This still leaves getrusage broken for some reason, but I believe that
is a kernel issue and cannot be fixed here...

9 years agoRemove unnecessary devices from allwinner kernels.
Luiz Otavio O Souza [Mon, 18 May 2015 18:25:38 +0000 (18:25 +0000)]
Remove unnecessary devices from allwinner kernels.

9 years agoProperly align the header and the data columns for netstat -r with and
Luiz Otavio O Souza [Mon, 18 May 2015 18:03:47 +0000 (18:03 +0000)]
Properly align the header and the data columns for netstat -r with and
without the -W flag.

9 years agoGarbage collect GNU soelim Makefiles which are not in used anymore
Baptiste Daroussin [Mon, 18 May 2015 16:51:05 +0000 (16:51 +0000)]
Garbage collect GNU soelim Makefiles which are not in used anymore

9 years agoEnable the NETIF_OPEN_CLOSE_ONCE option for ubldr. This keeps the network
Ian Lepore [Mon, 18 May 2015 16:43:21 +0000 (16:43 +0000)]
Enable the NETIF_OPEN_CLOSE_ONCE option for ubldr.  This keeps the network
interface open continuously instead of closing it after each filesystem
access and reopening it before the next (causing it to re-obtain network
params each time).  This vastly speeds up netbooting.

9 years agoDrop some unnecessary casts.
Pedro F. Giffuni [Mon, 18 May 2015 16:28:13 +0000 (16:28 +0000)]
Drop some unnecessary casts.

Reported by: Clang static analyzer
Obtained from: NetBSD

9 years agoMake the FIFO configuration a bit more flexible for the DWC OTG in
Hans Petter Selasky [Mon, 18 May 2015 16:18:04 +0000 (16:18 +0000)]
Make the FIFO configuration a bit more flexible for the DWC OTG in
device side mode.

9 years agoAdd a routine to obtain netboot parameters from the U-Boot env vars. Call
Ian Lepore [Mon, 18 May 2015 16:12:41 +0000 (16:12 +0000)]
Add a routine to obtain netboot parameters from the U-Boot env vars.  Call
it from the uboot net_init() implementation.  The routine uses the standard
U-Boot env vars plus a freebsd-specific variable named "rootpath" (the
corresponding u-boot variable for that would be "bootfile" except that it
refers to ubldr, so a new name was needed to communicate the path to ubldr).

This allows ubldr to load a kernel from nfs without requiring a dhcp or
bootp server to provide the server ip and rootpath parameters.

9 years agoOnly build libreadline if gdb is going to be built
Baptiste Daroussin [Mon, 18 May 2015 16:05:41 +0000 (16:05 +0000)]
Only build libreadline if gdb is going to be built

gdb is the only consumer of libreadline which is an INTERNALLIB

9 years agoFix an off-by-one error by adding proper range checks when parsing the
Hans Petter Selasky [Mon, 18 May 2015 16:02:44 +0000 (16:02 +0000)]
Fix an off-by-one error by adding proper range checks when parsing the
HDA association descriptors. This fixes a crash during device probe
for some HDA PCI devices.

Reported by: David Wolfskill <david@catwhisker.org>
Reviewed by: mav @
MFC after: 1 week

9 years agoA miss from r283061: don't dereference NULL is pf_get_mtag() fails.
Gleb Smirnoff [Mon, 18 May 2015 15:51:27 +0000 (15:51 +0000)]
A miss from r283061: don't dereference NULL is pf_get_mtag() fails.

PR: 200222
Submitted by: Franco Fichtner <franco opnsense.org>

9 years agoRefactor net_getparams() to make it easier to get params from sources other
Ian Lepore [Mon, 18 May 2015 15:46:43 +0000 (15:46 +0000)]
Refactor net_getparams() to make it easier to get params from sources other
than bootp and rarp.

The code which splits a serverip:/rootpath string into rootip and a plain
pathname is now a separate net_parse_rootpath() function that can be
called by others.  The code that sets the kernel env vars needed for
nfs_diskless is moved into net_open() so that the variables get set no
matter where the params came from.

There was already code in net_open() that allowed for the possibility that
some other entity has set up the network-related global variables.  It uses
the rootip variable as the key, assuming that if it is set all the other
required variables are set too.  These changes don't alter the existing
behavior, they just make it easier to actually write some new code to get
the params from another source (such as the U-Boot environment).

9 years agoDon't dereference NULL is pf_get_mtag() fails.
Gleb Smirnoff [Mon, 18 May 2015 15:05:12 +0000 (15:05 +0000)]
Don't dereference NULL is pf_get_mtag() fails.

PR: 200222
Submitted by: Franco Fichtner <franco opnsense.org>

9 years agoBuild libgcov only if we're building base system GCC
Ed Maste [Mon, 18 May 2015 15:02:35 +0000 (15:02 +0000)]
Build libgcov only if we're building base system GCC

Clang uses compiler-rt for the code coverage runtime, and ports GCC
provides its own libgcov.

PR: 200203 (exp-run)
Sponsored by: The FreeBSD Foundation

9 years agofd: fix imbalanced fdp unlock in F_SETLK and F_GETLK
Mateusz Guzik [Mon, 18 May 2015 14:27:04 +0000 (14:27 +0000)]
fd: fix imbalanced fdp unlock in F_SETLK and F_GETLK

MFC after: 3 days

9 years agoTidy up sys_umask a little bit
Mateusz Guzik [Mon, 18 May 2015 13:43:33 +0000 (13:43 +0000)]
Tidy up sys_umask a little bit

Consistently use saved fdp pointer as it cannot change. If it could change the
code would be already incorrect.

No functional changes.

9 years agoClean up the Amlogic interrupt controller driver to handle the case where
Andrew Turner [Mon, 18 May 2015 11:04:07 +0000 (11:04 +0000)]
Clean up the Amlogic interrupt controller driver to handle the case where
we have both the Amlogic pic and a GIC. This may be the case in some
configurations.

Differential Revision: https://reviews.freebsd.org/D2432
Submitted by: John Wehle <john@feith.com>

9 years agoMove all test integration pieces for etc/ from etc/ to tests/
Enji Cooper [Mon, 18 May 2015 11:02:43 +0000 (11:02 +0000)]
Move all test integration pieces for etc/ from etc/ to tests/

This is being done to fix breakage with make distribution with read-only
source trees as make distribution doesn't use make obj like building
tests/ does in all cases

Reported by: Wolfgang Zenker <wolfgang@lyxys.ka.sub.org>
Suggested by: jhb
X-MFC with: r282059
MFC after: 1 week

9 years agoAdd support for SCSI disk hot add and remove. Also add padding according to
Wei Hu [Mon, 18 May 2015 10:31:23 +0000 (10:31 +0000)]
Add support for SCSI disk hot add and remove. Also add padding according to
the requirement of different hypervisor releases.

Submitted by: whu
Reviewed by: royger
Approved by: royger
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D2512

9 years agoClean up the style to be "include<space><tab>" and remove options already
Andrew Turner [Mon, 18 May 2015 08:12:08 +0000 (08:12 +0000)]
Clean up the style to be "include<space><tab>" and remove options already
in std.armv6.

9 years agosfxge: do not advertise LRO capability if LRO is compiled out
Andrew Rybchenko [Mon, 18 May 2015 06:07:02 +0000 (06:07 +0000)]
sfxge: do not advertise LRO capability if LRO is compiled out

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2565

9 years agosfxge: automatically turn off TSO when Tx checksum offload is disabled
Andrew Rybchenko [Mon, 18 May 2015 06:04:20 +0000 (06:04 +0000)]
sfxge: automatically turn off TSO when Tx checksum offload is disabled

Also return error if TSO is requested without Tx checksum offload.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2564

9 years agosfxge: allow to disable checksum offloads over VLAN
Andrew Rybchenko [Mon, 18 May 2015 06:03:21 +0000 (06:03 +0000)]
sfxge: allow to disable checksum offloads over VLAN

It just affects capabilities of the created VLAN interface.

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2563

9 years agosfxge: fix overflow queue freeze
Andrew Rybchenko [Mon, 18 May 2015 06:02:22 +0000 (06:02 +0000)]
sfxge: fix overflow queue freeze

If TxQ lock is obtained, deferred packet list shold be serviced even if
the packet addition fails because of overflow.

Without the patch freeze happens if:
 - queue is not blocked (i.e. completion does not trigger unblock and service)
 - put-list overflow (1024 entries)
 - sfxge_tx_packet_add() acquires TxQ lock just as it is released it in
   sfxge_tx_qdpl_service() on the second CPU but before pending check
 - sfxge_tx_packet_add() swizzles put-list to get-list, fails because of
   non-tcp get-list overflow and returns without packet list service
 - sfxge_tx_qdpl_service() on the second CPU checks that there are no
   pending packets in the put-list and returns

Other possible solution is to guaranee that maximum length of the put-list
is less than maximum length of any get-list.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2562

9 years agoMFV of 283040,tzdata{2015c}
Edwin Groothuis [Mon, 18 May 2015 01:59:02 +0000 (01:59 +0000)]
MFV of 283040,tzdata{2015c}

Update to tzdata2015c:

    Release 2015c - 2015-04-11 08:55:55 -0700

    Changes affecting future time stamps

    Egypt's spring-forward transition is at 24:00 on April's last Thursday,
    not 00:00 on April's last Friday.  2015's transition will therefore be on
    Thursday, April 30 at 24:00, not Friday, April 24 at 00:00.  Similar fixes
    apply to 2026, 2037, 2043, etc.  (Thanks to Steffen Thorsen.)

9 years agoVendor import of tzdata2015c:
Edwin Groothuis [Mon, 18 May 2015 01:57:31 +0000 (01:57 +0000)]
Vendor import of tzdata2015c:

Update to tzdata2015c:

    Release 2015c - 2015-04-11 08:55:55 -0700

    Changes affecting future time stamps

    Egypt's spring-forward transition is at 24:00 on April's last Thursday,
    not 00:00 on April's last Friday.  2015's transition will therefore be on
    Thursday, April 30 at 24:00, not Friday, April 24 at 00:00.  Similar fixes
    apply to 2026, 2037, 2043, etc.  (Thanks to Steffen Thorsen.)

Obtained from: ftp://ftp.iana.org/tz/releases/

9 years agoFix a typo that snuck in with r283024, and remove the EXFAIL annotation from
Mark Johnston [Sun, 17 May 2015 23:09:58 +0000 (23:09 +0000)]
Fix a typo that snuck in with r283024, and remove the EXFAIL annotation from
a test which now passes as a result of that change.

9 years agoRespect the libdir option when linking drti.o, rather than hardcoding the
Mark Johnston [Sun, 17 May 2015 23:08:01 +0000 (23:08 +0000)]
Respect the libdir option when linking drti.o, rather than hardcoding the
default path of /usr/lib(32)/dtrace.

MFC after: 3 weeks

9 years agoAn ARM kernel can be loaded at any 2MB boundary, make ubldr aware of that.
Ian Lepore [Sun, 17 May 2015 19:59:05 +0000 (19:59 +0000)]
An ARM kernel can be loaded at any 2MB boundary, make ubldr aware of that.

Previously, ubldr would use the virtual addresses in the elf headers by
masking off the high bits and assuming the result was a physical address
where the kernel should be loaded.  That would sometimes discard
significant bits of the physical address, but the effects of that were
undone by archsw copy code that would find a large block of memory and
apply an offset to the source/dest copy addresses.  The result was that
things were loaded at a different physical address than requested by the
higher code layers, but that worked because other adjustments were applied
later (such as when jumping to the entry point).  Very confusing, and
somewhat fragile.

Now the archsw copy routines are just simple copies, and instead
archsw.arch_loadaddr is implemented to choose a load address.  The new
routine uses some of the code from the old offset-translation routine to
find the largest block of ram, but it excludes ubldr itself from that
range, and also excludes   If ubldr splits the largest block of ram in
two, the kernel is loaded into the bottom of whichever resulting block is
larger.

As part of eliminating ubldr itself from the ram ranges, export the heap
start/end addresses in a pair of new global variables.

This change means that the virtual addresses in the arm kernel elf headers
now have no meaning at all, except for the entry point address.  There is
an implicit assumption that the entry point is in the first text page, and
that the address in the the header can be turned into an offset by masking
it with PAGE_MASK.  In the future we can link all arm kernels at a virtual
address of 0xC0000000 with no need to use any low-order part of the
address to influence where in ram the kernel gets loaded.

9 years agoClean up struct syscall_args:
Andrew Turner [Sun, 17 May 2015 18:35:58 +0000 (18:35 +0000)]
Clean up struct syscall_args:
 1. Align to a 64-bit address so 64-bit data will be correctly aligned.
 2. Add a comment explaining why.
 3. Remove an unneeded value from the struct.

This fixes an issue where the struct may not be correctly aligned on the
stack in the syscall function. This may lead to accesing a 64-bit value
at a non 64-bit. This will raise an exception and panic the kernel.

We have been lucky where on arm and armv6 both clang and gcc correctly
align the data, even without us asking to, however, on armeb with clang to
not be the case. This tells the compiler we really do need this to be
aligned.

Reported and tested by: jmg (on armeb with clang)
MFC after: 1 Week [1, 2]

9 years agoDo not set preload_addr_relocate for ARM. Apparently there was a time
Ian Lepore [Sun, 17 May 2015 17:03:37 +0000 (17:03 +0000)]
Do not set preload_addr_relocate for ARM.  Apparently there was a time
when loader(8) passed physical addresses in loader metadata for arm, but
that is no longer true; all metadata has already been adjusted to vitual
addresses by loader.

I can't track down the exact revision in loader where a change from physical
to virtual metadata addresses happened.  The code involved is very twisty
and complicated.  I suspect the change was an unintended consequence of the
r247301, r247413, r248118 series of changes I made a couple years ago.

9 years agoIn r279493, the functions pzero[f](), qzero[f], pone[f](),
Steve Kargl [Sun, 17 May 2015 16:27:06 +0000 (16:27 +0000)]
In r279493, the functions pzero[f](), qzero[f], pone[f](),
and qone[f]() were marked as __inline, but their forward
declarations were not updated.  Fix the forward declarations
to match the actual function declarations.

Requested by:  bde

9 years agoUpdate intree gdb/kgdb to handle 2 dwarf types:
Sean Bruno [Sun, 17 May 2015 15:49:38 +0000 (15:49 +0000)]
Update intree gdb/kgdb to handle 2 dwarf types:
DW_OP_GNU_uninit
DW_OP_piece

This squashes the warnings about type 0x93 not known in kgdb when opening a kernel crash dump.

Upstream refs:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=87808bd699575a850139a1f916512ab7a47fd496
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=42be36b328ae784ae6981da7c7cab95b67ed7737
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=23572ecadc89af384c1804ad7692f32c55fbfc80

Differential Revision: https://reviews.freebsd.org/D2534
Reviewed by: emaste, jhb, davide

9 years agoAdjust the string format to match the actual number of arguments.
Luiz Otavio O Souza [Sun, 17 May 2015 15:12:55 +0000 (15:12 +0000)]
Adjust the string format to match the actual number of arguments.

This fix a segmentation fault on ARM when netstat -r is used together with
-W.

This issue was introduced in r279122.

9 years agoActually remove siftr-related definitions from tcp.d, missed in r283026.
Mark Johnston [Sun, 17 May 2015 04:17:08 +0000 (04:17 +0000)]
Actually remove siftr-related definitions from tcp.d, missed in r283026.

9 years agoMove siftr-related definitions out of tcp.d and into a separate library
Mark Johnston [Sun, 17 May 2015 04:09:22 +0000 (04:09 +0000)]
Move siftr-related definitions out of tcp.d and into a separate library
which declares a dependency on siftr(4). This is necessitated by a
reference to struct pkt_node, which is defined in siftr(4): otherwise,
dtrace(1) will return an error during startup if siftr.ko is not loaded.

9 years agoAs dtrace(1) processes D libraries under /usr/lib/dtrace, the compiler may
Mark Johnston [Sun, 17 May 2015 03:59:08 +0000 (03:59 +0000)]
As dtrace(1) processes D libraries under /usr/lib/dtrace, the compiler may
return an error if one of the depends_on directives in a library is not
satisfied. In this case, libdtrace is supposed to ignore the library and
carry on. However, the remainder of the library may still be buffered by
the lexer, causing libdtrace to erroneously continue processing it on the
next call to yyparse(). Fix this by explicitly flushing the input buffer
each time the compiler state is reset.

MFC after: 3 weeks

9 years agoWhen in lazyload mode, write the DOF to a temporary file and rename it
Mark Johnston [Sun, 17 May 2015 03:50:42 +0000 (03:50 +0000)]
When in lazyload mode, write the DOF to a temporary file and rename it
rather than writing directly to the output file.

CID: 1147172

9 years agobsdinstall/zfsboot: Skip adding swap lines to /etc/fstab if swap is 0 sized
Allan Jude [Sun, 17 May 2015 00:55:44 +0000 (00:55 +0000)]
bsdinstall/zfsboot: Skip adding swap lines to /etc/fstab if swap is 0 sized

Differential Revision: https://reviews.freebsd.org/D2571
Reviewed by: dim
Approved by: eadler (mentor)
Sponsored by: ScaleEngine Inc.

9 years agoIncrement the vm stats "v_intr" counter so the global system interrupt
Adrian Chadd [Sat, 16 May 2015 23:51:24 +0000 (23:51 +0000)]
Increment the vm stats "v_intr" counter so the global system interrupt
statistics work again.

I'm not sure why/when this broke, only that it used to work fine.

This commit is brought to you by Maker Faire Bay Area 2015.

9 years agoFix more warnings related to missing headers
Enji Cooper [Sat, 16 May 2015 22:53:26 +0000 (22:53 +0000)]
Fix more warnings related to missing headers

MFC after: 1 week

9 years agoDon't allow unmapped I/O. The pmap isn't quite up to the task. Add a
Warner Losh [Sat, 16 May 2015 21:24:32 +0000 (21:24 +0000)]
Don't allow unmapped I/O. The pmap isn't quite up to the task. Add a
comment to this effect and switch the default. My old AT91SAM9G20
now boots, fsck's the SD card and runs w/o an issue for the first
time since a 9.1-ish stable build I did a few years ago.

Problems with unmapped I/O:
o un-page-aligned I/O requests to devices fail (notably fsck
  and newfs).
o write-back caching was totally broken. write-through caching
  needed to be enabled.
o Even page-aligned I/O requests sometimes failed for reasons
  not thoroughly investigated.

Suggested by: ian@
MFC after: 2 days

9 years agoRe-link ubldr when any of its libraries change.
Ian Lepore [Sat, 16 May 2015 21:08:33 +0000 (21:08 +0000)]
Re-link ubldr when any of its libraries change.

9 years agoacpi_ibm: whitespace.
Rui Paulo [Sat, 16 May 2015 20:06:39 +0000 (20:06 +0000)]
acpi_ibm: whitespace.

9 years agoMore tr -d '\r' t make config happy and
Bjoern A. Zeeb [Sat, 16 May 2015 20:04:49 +0000 (20:04 +0000)]
More tr -d '\r' t make config happy and
some re-alignment whitespace changes.

9 years ago* Update SFF-8024 Identifier constants.
Alexander V. Chernikov [Sat, 16 May 2015 13:11:35 +0000 (13:11 +0000)]
* Update SFF-8024 Identifier constants.
* Fix SFF_8436_CC_EXT in SFF-8436 memory map.
* Add SFF-8436/8636 bits (revision compliance/nominal bitrate).
* Do some small style/type fixes.

9 years agoAdd a warning message to mountd for exported file
Rick Macklem [Sat, 16 May 2015 12:05:26 +0000 (12:05 +0000)]
Add a warning message to mountd for exported file
systems that are automounted, since that configuration
isn't supported. This still allows the export, since
two emails I received felt that this should not be
disabled. It sends the message to syslog(LOG_ERR..), so that
it goes to the same places as the other messages related
to /etc/exports problems, even though it is a warning and not an error.

Reviewed by: trasz
MFC after: 2 weeks

9 years agosfxge: avoid usage of ifm_data
Andrew Rybchenko [Sat, 16 May 2015 10:35:30 +0000 (10:35 +0000)]
sfxge: avoid usage of ifm_data

The driver uses ifm_data to save capabilities mask calculated during
initialization when supported phy modes are discovered.
The patch simply calculates it when either media or options are changed.

Reviewed by:    glebius
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2540

9 years agoMinor comments fixes
Thomas Quinot [Sat, 16 May 2015 10:31:15 +0000 (10:31 +0000)]
Minor comments fixes