]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoUpdate Dragonfly Mail Agent to v0.10
Baptiste Daroussin [Sat, 10 Oct 2015 23:31:47 +0000 (23:31 +0000)]
Update Dragonfly Mail Agent to v0.10

8 years agoImport dma 0.10
Baptiste Daroussin [Sat, 10 Oct 2015 23:22:05 +0000 (23:22 +0000)]
Import dma 0.10

8 years agoReplace a local sx lock that allowed only one client at a time to access
Ian Lepore [Sat, 10 Oct 2015 19:51:00 +0000 (19:51 +0000)]
Replace a local sx lock that allowed only one client at a time to access
an eeprom device with iicbus_request/release_bus(), which achieves the
same effect and also keeps other i2c slave drivers from clashing on the bus.

8 years agoThere's no way a fbsd install + kernel will fit into 4MB of flash.
Sean Bruno [Sat, 10 Oct 2015 19:08:34 +0000 (19:08 +0000)]
There's no way a fbsd install + kernel will fit into 4MB of flash.

Assume and enforce the fact that this will always boot a rootfs from
usb.

8 years agoRemove a double "as well as"
Poul-Henning Kamp [Sat, 10 Oct 2015 17:32:06 +0000 (17:32 +0000)]
Remove a double "as well as"

8 years agoFix installing config files as non root
Baptiste Daroussin [Sat, 10 Oct 2015 14:43:46 +0000 (14:43 +0000)]
Fix installing config files as non root

Reported by: adrian

8 years agoInstall bsd.confs.mk
Baptiste Daroussin [Sat, 10 Oct 2015 10:48:09 +0000 (10:48 +0000)]
Install bsd.confs.mk
Rename ETCDIR into CONFIGDIR to avoid conflicts with the ports tree

8 years agoAdd 'p' postfix to mdconfig(8).
Edward Tomasz Napierala [Sat, 10 Oct 2015 09:37:31 +0000 (09:37 +0000)]
Add 'p' postfix to mdconfig(8).

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoChange the default setting of kern.ipc.shm_allow_removed from 0 to 1.
Edward Tomasz Napierala [Sat, 10 Oct 2015 09:29:47 +0000 (09:29 +0000)]
Change the default setting of kern.ipc.shm_allow_removed from 0 to 1.

This removes the need for manually changing this flag for Google Chrome
users. It also improves compatibility with Linux applications running under
Linuxulator compatibility layer, and possibly also helps in porting software
from Linux.

Generally speaking, the flag allows applications to create the shared memory
segment, attach it, remove it, and then continue to use it and to reattach it
later. This means that the kernel will automatically "clean up" after the
application exits.

It could be argued that it's against POSIX. However, SUSv3 says this
about IPC_RMID: "Remove the shared memory identifier specified by shmid from
the system and destroy the shared memory segment and shmid_ds data structure
associated with it." From my reading, we break it in any case by deferring
removal of the segment until it's detached; we won't break it any more
by also deferring removal of the identifier.

This is the behaviour exhibited by Linux since... probably always, and
also by OpenBSD since the following commit:

revision 1.54
date: 2011/10/27 07:56:28; author: robert; state: Exp; lines: +3 -8;
Allow segments to be used even after they were marked for deletion with
the IPC_RMID flag.
This is permitted as an extension beyond the standards and this is similar
to what other operating systems like linux do.

MFC after: 1 month
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3603

8 years agoProvide better debug message on kernel module name clash.
Edward Tomasz Napierala [Sat, 10 Oct 2015 09:21:55 +0000 (09:21 +0000)]
Provide better debug message on kernel module name clash.

Reviewed by: kib@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoMake geom_nop(4) collect statistics on all types of BIOs, not just
Edward Tomasz Napierala [Sat, 10 Oct 2015 09:03:31 +0000 (09:03 +0000)]
Make geom_nop(4) collect statistics on all types of BIOs, not just
reads and writes.

PR: kern/198405
Submitted by: Matthew D. Fuller <fullermd at over-yonder dot net>
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3679

8 years agodrm/i915: Remove "Attempting to unbind pinned buffer" message
Jean-Sébastien Pédron [Sat, 10 Oct 2015 07:43:02 +0000 (07:43 +0000)]
drm/i915: Remove "Attempting to unbind pinned buffer" message

This error message is removed in later versions of Linux and currently,
it spams users.

PR: 200712
MFC after: 1 week

8 years agoUpdate the AP135 reference design flash layout to be more useful.
Adrian Chadd [Sat, 10 Oct 2015 05:00:18 +0000 (05:00 +0000)]
Update the AP135 reference design flash layout to be more useful.

* Shuffle the kernel to be at the beginning
* Give the kernel 2mb, the rootfs 6mb, and 'mib0' the rest
* put the cfg parition just before the ART calibration data for the
  wifi part in the SoC
* .. and make sure ART points to the right 64k region.

I've updated the freebsd-wifi-build wiki the instructions on using this.

If someone has an AP135 with 8MB SPI flash then this won't work; everything
minus the big mib0 partition is just a bit over 8MB.  Come see me if this
ever happens (you'll likely just have to shrink the rootfs and the kernel
a little in order to make it fit.)

Tested:

* AP135 reference board.

8 years agoTranslate iic hardware layer status values to errno return values.
Ian Lepore [Sat, 10 Oct 2015 02:29:02 +0000 (02:29 +0000)]
Translate iic hardware layer status values to errno return values.

8 years agoAdd a short name, IIC_INTRWAIT, for the common case (IIC_INTR | IIC_WAIT).
Ian Lepore [Sat, 10 Oct 2015 02:06:07 +0000 (02:06 +0000)]
Add a short name, IIC_INTRWAIT, for the common case (IIC_INTR | IIC_WAIT).

8 years agoiw_cxgbe: fix for page fault in cm_close_handler().
Navdeep Parhar [Sat, 10 Oct 2015 01:41:07 +0000 (01:41 +0000)]
iw_cxgbe: fix for page fault in cm_close_handler().

This is roughly the iw_cxgbe equivalent of
https://github.com/torvalds/linux/commit/be13b2dff8c4e41846477b22cc5c164ea5a6ac2e
-----------------
RDMA/cxgb4: Connect_request_upcall fixes

When processing an MPA Start Request, if the listening endpoint is
DEAD, then abort the connection.

If the IWCM returns an error, then we must abort the connection and
release resources.  Also abort_connection() should not post a CLOSE
event, so clean that up too.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
-----------------

Submitted by: Krishnamraju Eraparaju at chelsio dot com.

8 years agoRemove all of the syncs
Enji Cooper [Sat, 10 Oct 2015 01:31:39 +0000 (01:31 +0000)]
Remove all of the syncs

They're unnecessary as shown by further testing on my VM

Requested by: jhb

8 years agoFlip on fast frames support for AR5416 and AR9300 series NICs.
Adrian Chadd [Sat, 10 Oct 2015 00:13:45 +0000 (00:13 +0000)]
Flip on fast frames support for AR5416 and AR9300 series NICs.

This was off because the net80211 aggregation code was using the same
state pointers for both fast frames and ampdu tx support which led to some
pretty unfortunate panic-y behaviour.

Now that net80211 doesn't panic, let's flip this back on.

It doesn't (yet) do the horrific sounding thing of A-MPDU aggregates
of fast frames; that'll come next.  It's a pre-requisite to supporting
AMSDU + AMPDU anyway, which actually speeds things up quite considerably
(think packing lots of little ACK frames into a single AMSDU.)

Tested:

* QCA955x SoC, AP mode
* AR5416, STA mode
* AR9170, STA mode (with local fast frame patches)

8 years agoFix more cases of iicbus-layer functions that must return IIC_Exxxx values.
Ian Lepore [Sat, 10 Oct 2015 00:12:03 +0000 (00:12 +0000)]
Fix more cases of iicbus-layer functions that must return IIC_Exxxx values.

8 years agoReturn only IIC_Exxxx status values from iicbus-layer functions. Most of
Ian Lepore [Fri, 9 Oct 2015 23:58:19 +0000 (23:58 +0000)]
Return only IIC_Exxxx status values from iicbus-layer functions.  Most of
these functions are thin wrappers around calling the hardware-layer driver,
but some of them do sanity checks and return an error.  Since the hardware
layer can only return IIC_Exxxxx status values, the iicbus helper functions
must also adhere to that, so that drivers at higher layers can assume that
any non-zero status value is an IIC_Exxxx value that provides details about
what happened at the hardware layer (sometimes those details are important
for certain slave drivers).

8 years agoMove ppp.conf into the ppp sources
Baptiste Daroussin [Fri, 9 Oct 2015 23:57:07 +0000 (23:57 +0000)]
Move ppp.conf into the ppp sources

8 years agoAdd iic2errno(), a helper function to translate IIC_Exxxxx status values to
Ian Lepore [Fri, 9 Oct 2015 23:20:08 +0000 (23:20 +0000)]
Add iic2errno(), a helper function to translate IIC_Exxxxx status values to
errno values that are at least vaguely equivelent.  Also add a new status
value, IIC_ERESOURCE, to indicate a failure to acquire memory or other
required resources to complete a transaction.

The IIC_Exxxxxx values are supposed to communicate low-level details of the
i2c transaction status between the lowest-layer hardware driver and
higher-layer bus protocol and device drivers for slave devices on the bus.
Most of those slave drivers just return all status values from the lower
layers directly to their callers, resulting in crazy error reporting from a
user's point of view (things like timeouts being reported as "no such
process").  Now there's a helper function to make it easier to start
cleaning up all those drivers.

8 years agoRename the dma directory into dmagent to avoid collision on unclean oject
Baptiste Daroussin [Fri, 9 Oct 2015 23:19:29 +0000 (23:19 +0000)]
Rename the dma directory into dmagent to avoid collision on unclean oject
directory where an old dma binary can remain

8 years agoUse IIC_EBUSBSY and IIC_BUSERR status values consistantly across all drivers.
Ian Lepore [Fri, 9 Oct 2015 22:49:50 +0000 (22:49 +0000)]
Use IIC_EBUSBSY and IIC_BUSERR status values consistantly across all drivers.
Make it clearer what each one means in the comments that define them.

IIC_BUSBSY was used in many places to mean two different things, either
"someone else has reserved the bus so you have to wait until they're done"
or "the signal level on the bus was not in the state I expected before/after
issuing some command".

Now IIC_BUSERR is used consistantly to refer to protocol/signaling errors,
and IIC_BUSBSY refers to ownership/reservation of the bus.

8 years agoMostly rewrite the imx i2c driver. This started out as an attempt to fix
Ian Lepore [Fri, 9 Oct 2015 22:28:56 +0000 (22:28 +0000)]
Mostly rewrite the imx i2c driver.  This started out as an attempt to fix
one specific problem: the driver didn't check for ACK/NAK after writing a
slave address byte to the bus, and some slaves signal that they are busy
(such as when completing an internal write to flash memory) by sending a
NAK in response to being addressed.

While working on that problem I discovered that the driver's handling of
error conditions in general didn't match the state transition diagram in
the reference manual, and making that right resulted in a lot of code
reorganization.

Along the way various other changes also happened...

 - Remove a mutex that wasn't protecting anything.
 - Remove some mystery DELAY()s, document the few that remain.
 - Use pause_sbt(9) to yield the processor for the bulk of the time it
   takes to transfer each byte rather than busy-polling the whole time.
 - Disable the controller when no transfers are in progress; since we
   don't operate in slave mode, there's no reason to run the hardware.
 - Remove a bunch of unecessary code from probe().

8 years agoInstall configuration files with CONFMODE instead of SHAREMODE
Baptiste Daroussin [Fri, 9 Oct 2015 22:15:31 +0000 (22:15 +0000)]
Install configuration files with CONFMODE instead of SHAREMODE

8 years agoAdd installconfig as a top level target
Baptiste Daroussin [Fri, 9 Oct 2015 22:14:07 +0000 (22:14 +0000)]
Add installconfig as a top level target

8 years agoAdd missing Makefile
Baptiste Daroussin [Fri, 9 Oct 2015 22:10:54 +0000 (22:10 +0000)]
Add missing Makefile

8 years agoMove all the dma(8) components into one single directory
Baptiste Daroussin [Fri, 9 Oct 2015 22:09:44 +0000 (22:09 +0000)]
Move all the dma(8) components into one single directory

Simplifying maintainance and options (only one place to deal with MK_DMAGENT)

This also makes packaging base less intrusive by getting a single point where
to add tags.

8 years agoChange make distribution so that it now call installconfig in all dirs along
Baptiste Daroussin [Fri, 9 Oct 2015 22:05:31 +0000 (22:05 +0000)]
Change make distribution so that it now call installconfig in all dirs along
with the current behaviour of calling "distribution" in the etc target.

This allows mergemaster/etcupdate to still work when some configuration will be
moved to be handled in the same directories their source code lives in.

8 years agoAdd a new bsd.confs.mk similar to bsd.files.mk or bsd.incs.mk
Baptiste Daroussin [Fri, 9 Oct 2015 21:57:42 +0000 (21:57 +0000)]
Add a new bsd.confs.mk similar to bsd.files.mk or bsd.incs.mk

It defines a CONFS variable for all files supposed to be installed as a
configuration file and handle as such

8 years agoBugfix: Exit the transfer loop if any read or write operation fails. Also,
Ian Lepore [Fri, 9 Oct 2015 21:34:46 +0000 (21:34 +0000)]
Bugfix: Exit the transfer loop if any read or write operation fails.  Also,
perform a stop operation on the bus if there was an error, otherwise the
bus will remain hung forever.  Consistantly use 'if (error != 0)' style in
the function.

8 years agoStyle and whitespace cleanups. The only functional change is removal of
Ian Lepore [Fri, 9 Oct 2015 21:27:30 +0000 (21:27 +0000)]
Style and whitespace cleanups.  The only functional change is removal of
a printf that appears to be left over from development debugging.

8 years agoPull in r242623 from upstream libc++ trunk (by Eric Fiselier):
Dimitry Andric [Fri, 9 Oct 2015 21:04:28 +0000 (21:04 +0000)]
Pull in r242623 from upstream libc++ trunk (by Eric Fiselier):

  Enable and fix warnings during the build.

  Although CMake adds warning flags, they are ignored in the libc++ headers
  because the headers '#pragma system header' themselves.

  This patch disables the system header pragma when building libc++ and fixes
  the warnings that arose.

  The warnings fixed were:
  1. <memory> - anonymous structs are a GNU extension
  2. <functional> - anonymous structs are a GNU extension.
  3. <__hash_table> - Embedded preprocessor directives have undefined behavior.
  4. <string> - Definition is missing noexcept from declaration.
  5. <__std_stream> - Unused variable.

This should fix building world (in particular libatf-c++) with -std=c++11.

Reported by: Oliver Hartmann <ohartman@zedat.fu-berlin.de>

8 years agoAdd llvm patch corresponding to r289072.
Dimitry Andric [Fri, 9 Oct 2015 21:00:04 +0000 (21:00 +0000)]
Add llvm patch corresponding to r289072.

8 years agoLet -c imply -S (hide signal output).
Bryan Drewery [Fri, 9 Oct 2015 20:47:29 +0000 (20:47 +0000)]
Let -c imply -S (hide signal output).

Without this, the signals are shown seemingly randomly in the output before
the final summary is shown.  This is especially noticeable when there is
not much output from the application being traced.

Discussed with: jhb
Relnotes: yes

8 years agoAdd definitions for MIPS TLS relocations to elftoolchain.
Alexander Kabaev [Fri, 9 Oct 2015 18:39:55 +0000 (18:39 +0000)]
Add definitions for MIPS TLS relocations to elftoolchain.

This makes our readelf more useful when looking for TLS-related
issues.

8 years agoRemove some trailing space.
Alexander Kabaev [Fri, 9 Oct 2015 18:39:52 +0000 (18:39 +0000)]
Remove some trailing space.

8 years agoaddr2line: initialize die to NULL
Ed Maste [Fri, 9 Oct 2015 18:26:24 +0000 (18:26 +0000)]
addr2line: initialize die to NULL

GCC on MIPS produced a 'may be used uninitialized' warning after
r289071.

Reported by: sbruno
Pointy hat to: emaste

8 years agoRemove empty line again from libc++'s iostream.cpp. This was used to
Dimitry Andric [Fri, 9 Oct 2015 18:23:10 +0000 (18:23 +0000)]
Remove empty line again from libc++'s iostream.cpp.  This was used to
force updates to this file, so it will be rebuilt by the fixed clang
from r289072.

8 years agoTemporarily revert upstream llvm trunk r240144 (by Michael Zolotukhin):
Dimitry Andric [Fri, 9 Oct 2015 18:21:45 +0000 (18:21 +0000)]
Temporarily revert upstream llvm trunk r240144 (by Michael Zolotukhin):

  [SLP] Vectorize for all-constant entries.

This should fix libc++'s iostream initialization SIGBUSing on amd64,
whenever the global cout symbol is not aligned to 16 bytes.

Some further explanation: libc++'s iostream.cpp contains the definitions
of std::cout, std::cerr and so on.  These global objects are effectively
declared with an alignment of 8 bytes.  When an executable is linked
against libc++.so, it can sometimes get a copy of the global object,
which is then at the same alignment.

However, with clang 3.7.0, the initialization of these global objects
will incorrectly use SSE instructions (e.g. movdqa), whenever the
optimization level is high enough, and SSE is enabled, such as on amd64.
When any of these objects is not aligned to 16 bytes, this will result
in a SIGBUS during iostream initialization.  In contrast, clang 3.6.x
and earlier took the 8 byte alignment into consideration, and avoided
SSE for those particular operations.

After bisecting of upstream changes, I found that the above revision
caused the change of this behavior, so I am reverting it now as a
workaround, while a discussion and test case is being prepared for
upstream.

8 years agoUpdate to ELF Tool Chain r3250
Ed Maste [Fri, 9 Oct 2015 17:46:05 +0000 (17:46 +0000)]
Update to ELF Tool Chain r3250

Highlights (not already in the FreeBSD tree):
  - addr2line: Fixed multiple memory leaks related to DIE allocation
  - readelf: improve sh_link validation
  - various man page improvements

Sponsored by: The FreeBSD Foundation

8 years agoAdd .gnu.versym VERSYM_HIDDEN flag and related mask
Ed Maste [Fri, 9 Oct 2015 17:33:05 +0000 (17:33 +0000)]
Add .gnu.versym VERSYM_HIDDEN flag and related mask

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

8 years agoImport ELF Tool Chain snapshot revision 3250
Ed Maste [Fri, 9 Oct 2015 16:43:36 +0000 (16:43 +0000)]
Import ELF Tool Chain snapshot revision 3250

From http://svn.code.sf.net/p/elftoolchain/code

8 years agoFix a repeated typo: rootir -> rootdir.
Warren Block [Fri, 9 Oct 2015 14:55:55 +0000 (14:55 +0000)]
Fix a repeated typo: rootir -> rootdir.

Approved by: bapt
MFC after: 1 week

8 years agoSort function prototypes and add missing 'static' keywords.
Kevin Lo [Fri, 9 Oct 2015 14:31:32 +0000 (14:31 +0000)]
Sort function prototypes and add missing 'static' keywords.

Submitted by: Andriy Voskoboinyk <s3erios at gmail dot com>
Differential Revision: https://reviews.freebsd.org/D3847

8 years agoAdd --currently-running <release> option to freebsd-update.
Colin Percival [Fri, 9 Oct 2015 12:34:33 +0000 (12:34 +0000)]
Add --currently-running <release> option to freebsd-update.

This option tells freebsd-update to act as if it is running a specific
release instead of querying the kernel.  In particular, this can be
useful when upgrading jails.

Requested by: EuroBSDCon devsummit jails session
Tested by: allanjude
MFC after: 1 week

8 years agoRemove root_mount_wait(). It's not used anywhere.
Edward Tomasz Napierala [Fri, 9 Oct 2015 12:11:37 +0000 (12:11 +0000)]
Remove root_mount_wait(). It's not used anywhere.

Reviewed by: bapt@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3787

8 years agoUpgrade to Unbound 1.5.5.
Dag-Erling Smørgrav [Fri, 9 Oct 2015 11:46:27 +0000 (11:46 +0000)]
Upgrade to Unbound 1.5.5.

8 years agoimport unbound 1.5.5
Dag-Erling Smørgrav [Fri, 9 Oct 2015 11:29:49 +0000 (11:29 +0000)]
import unbound 1.5.5

8 years agoDocument iSCSI and autofs(5) variables in rc.conf(5).
Edward Tomasz Napierala [Fri, 9 Oct 2015 08:13:59 +0000 (08:13 +0000)]
Document iSCSI and autofs(5) variables in rc.conf(5).

PR: 203119
Reviewed by: bjk@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3671

8 years agoExploit r288122 to avoid pointlessly enqueueing a page that is about to be
Alan Cox [Fri, 9 Oct 2015 03:38:58 +0000 (03:38 +0000)]
Exploit r288122 to avoid pointlessly enqueueing a page that is about to be
freed.

Submitted by: kmacy
Differential Revision: https://reviews.freebsd.org/D1674

8 years agoFix missing semi-colon from r289055.
Conrad Meyer [Thu, 8 Oct 2015 23:27:45 +0000 (23:27 +0000)]
Fix missing semi-colon from r289055.

Obtained from: mjg
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove comment obsoleted by r289056.
Edward Tomasz Napierala [Thu, 8 Oct 2015 21:52:20 +0000 (21:52 +0000)]
Remove comment obsoleted by r289056.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoRemove unused SI_SUB_* #defines.
Edward Tomasz Napierala [Thu, 8 Oct 2015 21:28:06 +0000 (21:28 +0000)]
Remove unused SI_SUB_* #defines.

Reviewed by: kib@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3708

8 years agolinux: fix handling of out-of-bounds syscall attempts
Mateusz Guzik [Thu, 8 Oct 2015 21:08:35 +0000 (21:08 +0000)]
linux: fix handling of out-of-bounds syscall attempts

Due to an off by one the code would read an entry past the table, as
opposed to the last entry which contains the nosys handler.

Reported by: Pawel Biernacki <pawel.biernacki gmail.com>

8 years agoIf we can't open the file, skip devclose() for the exclusive_file_system
Marcel Moolenaar [Thu, 8 Oct 2015 17:59:05 +0000 (17:59 +0000)]
If we can't open the file, skip devclose() for the exclusive_file_system
case. We never called devopen(), so we know there's nothing to close.

8 years agoFix short month names and replace %b with %_m in date_fmt for Chinese
Xin LI [Thu, 8 Oct 2015 17:48:49 +0000 (17:48 +0000)]
Fix short month names and replace %b with %_m in date_fmt for Chinese
locales.

When using a Chinese locale, such as zh_TW.UTF-8 or zh_CN.UTF-8,
nl_langinfo(ABMON_*) only returned numbers.  For instance,
nl_langinfo(ABMON_1) returns 1, nl_langinfo(ABMON_2) returns 2, and
so on.

This causes problems in applications that put the short month name
and the day of the month together.  For example, 'Apr 14' in English
becomes '414日' in Chinese on the top bar of GNOME Shell.

This problem may be resolved by appending '月' to all short month
names and replacing %b with %_m in date_fmt. ja_JP.UTF-8 already
does this, and this matches the en_US.ISO8859-1 behavior, which
returns 'Oct'.  The GNU C Library also returns values with '月'
appended.

PR: 199441
Submitted by: Ting-Wei Lan <lantw44 gmail com>
MFC after: 2 weeks

8 years agoBuild changes that allow the modules on arm64.
Konstantin Belousov [Thu, 8 Oct 2015 17:42:08 +0000 (17:42 +0000)]
Build changes that allow the modules on arm64.
- Move the required kernel compiler flags from Makefile.arm64 to kern.mk.
- Build arm64 modules as PIC; non-PIC relocations in .o for shared object
  output cannot be handled.
- Do not try to install aarch64 symlink.
- A hack for arm64 to avoid ld -r stage.  See the comment for the explanation.
  Some functionality is lost, like ctf handling, but hopefully will be
  restored after newer linker is available.

Reviewed by: andrew, emaste
Tested by: andrew (on real hardware)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3796

8 years agoAdd encoding for mime-types.
Xin LI [Thu, 8 Oct 2015 17:41:17 +0000 (17:41 +0000)]
Add encoding for mime-types.

MFC after: 2 weeks

8 years agoDisable syscons and vpo modules for arm64.
Konstantin Belousov [Thu, 8 Oct 2015 17:32:45 +0000 (17:32 +0000)]
Disable syscons and vpo modules for arm64.

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

8 years agoAdd the arm64 define.
Konstantin Belousov [Thu, 8 Oct 2015 17:32:17 +0000 (17:32 +0000)]
Add the arm64 define.

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

8 years agoImplement in-kernel relocator for the arm64 module linker.
Konstantin Belousov [Thu, 8 Oct 2015 16:58:01 +0000 (16:58 +0000)]
Implement in-kernel relocator for the arm64 module linker.

It is decided to go with the shared object file format for modules on
arm64, due to the Aarch64 instruction set details.  Combination of the
signed 28-bit offset in the branch instructions encoding together with
the supported memory model of compilers makes the relocatable object
support impossible or at least too hard.

Reviewed by: andrew, emaste
Tested by: andrew (on real hardware)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3796

8 years agoMake the copyright notice in the file to match reality. Use the
Konstantin Belousov [Thu, 8 Oct 2015 16:46:11 +0000 (16:46 +0000)]
Make the copyright notice in the file to match reality.  Use the
recommended FreeBSD license text.

Approved by: andrew
Discussed with: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3846

8 years agoxen/console: Introduce a new console driver for Xen guest
Roger Pau Monné [Thu, 8 Oct 2015 16:39:43 +0000 (16:39 +0000)]
xen/console: Introduce a new console driver for Xen guest

The current Xen console driver is crashing very quickly when using it on
an ARM guest. This is because the console lock is recursive and it may
lead to recursion on the tty lock and/or corrupt the ring pointer.

Furthermore, the console lock is not always taken where it should be and has
to be released too early because of the way the console has been designed.

Over the years, code has been modified to support various new features but
the driver has not been reworked.

This new driver has been rewritten with the idea of only having a small set
of specific function to write either via the shared ring or the hypercall
interface.

Note that HVM support has been left aside for now because it requires
additional features which are not yet supported. A follow-up patch will be
sent with HVM guest support.

List of items that may be good to have but not mandatory:
 - Avoid to flush for each character written when using the tty
 - Support multiple consoles

Submitted by: Julien Grall <julien.grall@citrix.com>
Reviewed by: royger
Differential Revision: https://reviews.freebsd.org/D3698
Sponsored by: Citrix Systems R&D

8 years agoChange gptldr from relocating 0xfff1 bytes of boot2 to relocating 0x20000
Colin Percival [Thu, 8 Oct 2015 15:38:34 +0000 (15:38 +0000)]
Change gptldr from relocating 0xfff1 bytes of boot2 to relocating 0x20000
bytes of boot2.  Since we're in 16-bit mode, we can't copy all 128kB at
once; instead we loop four times and copy 32 kB each time.

This change was made necessary by an upcoming increase in the size of the
boot2 binary; should it increase further, the COPY_BLKS value can be
adjusted without anyone needing to remember 8086 assembly language again.

Requested by: allanjude
Tested by: allanjude
MFC after: 1 week

8 years agoAdd support for Fresco Logic USB 3.0 host controller.
Kevin Lo [Thu, 8 Oct 2015 15:13:57 +0000 (15:13 +0000)]
Add support for Fresco Logic USB 3.0 host controller.

Fresco Logic hosts advertise MSI, but fail to actually generate MSI
interrupts.  We have to disable MSI use.

Reviewed by: hselasky

8 years agoAdd quirk for USB 3.0 PCI device.
Hans Petter Selasky [Thu, 8 Oct 2015 13:39:27 +0000 (13:39 +0000)]
Add quirk for USB 3.0 PCI device.

Submitted by: Gary Jennejohn <gj@freebsd.org>
MFC after: 1 week

8 years agoRecognise the Netgear WNDA4100 (N900) 3x3 device in run(4).
Gavin Atkinson [Thu, 8 Oct 2015 12:55:21 +0000 (12:55 +0000)]
Recognise the Netgear WNDA4100 (N900) 3x3 device in run(4).

8 years agoMerge:
Craig Rodrigues [Thu, 8 Oct 2015 11:42:15 +0000 (11:42 +0000)]
Merge:
   commit 400ecf36bb0b73f6390f9641e6cb8bbfb91a5cfd
   Author: Paul Eggert <eggert@cs.ucla.edu>
   Date:   Fri Oct 12 07:53:12 2012 -0700

   Assume C89.

https://github.com/eggert/tz/commit/400ecf36bb0b73f6390f9641e6cb8bbfb91a5cfd

8 years agoEnforce the maxproc limitation before allocating struct proc, initial
Konstantin Belousov [Thu, 8 Oct 2015 11:07:09 +0000 (11:07 +0000)]
Enforce the maxproc limitation before allocating struct proc, initial
struct thread and kernel stack for the thread.  Otherwise, a load
similar to a fork bomb would exhaust KVA and possibly kmem, mostly due
to the struct proc being type-stable.

The nprocs counter is changed from being protected by allproc_lock sx
to be an atomic variable.  Note that ddb/db_ps.c:db_ps() use of nprocs
was unsafe before, and is still unsafe, but it seems that the only
possible undesired consequence is the harmless warning printed when
allproc linked list length does not match nprocs.

Diagnosed by: Svatopluk Kraus <onwahe@gmail.com>
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoFix r283120 which use class size larger than 8bits.
Fabien Thomas [Thu, 8 Oct 2015 10:00:41 +0000 (10:00 +0000)]
Fix r283120 which use class size larger than 8bits.
The new mapping will restore binary compatibility with stable_10
but file generated since r283120 are broken.

Reviewed by: jhb
Sponsored by: Stormshield

8 years agoFix r283998 that broke mapin events for hwpmc.
Fabien Thomas [Thu, 8 Oct 2015 09:54:33 +0000 (09:54 +0000)]
Fix r283998 that broke mapin events for hwpmc.

Reviewed by: jhb
Sponsored by: Stormshield

8 years agoFix for r288176 changes related to debug symbols move.
Fabien Thomas [Thu, 8 Oct 2015 09:46:35 +0000 (09:46 +0000)]
Fix for r288176 changes related to debug symbols move.

Reviewed by: emaste
Sponsored by: Stormshield

8 years agoAdd -n to the ntpq command line so it will show IP addresses instead of
Dag-Erling Smørgrav [Thu, 8 Oct 2015 08:55:08 +0000 (08:55 +0000)]
Add -n to the ntpq command line so it will show IP addresses instead of
host names, which rarely fit in the available space.

MFC after: 1 week

8 years agoAdd missing vnode lock in case of file modify request.
Alexander Motin [Thu, 8 Oct 2015 07:34:30 +0000 (07:34 +0000)]
Add missing vnode lock in case of file modify request.

Submitted by: Richard Kojedzinszky
MFC after: 1 week

8 years agowpi(4): check size before transmitting frames
Adrian Chadd [Thu, 8 Oct 2015 07:22:40 +0000 (07:22 +0000)]
wpi(4): check size before transmitting frames

In addition to https://bz-attachments.freebsd.org/attachment.cgi?id=156112;
fixes https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=144987.

Tested:

* Tested with Intel 3945BG, STA mode

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3762

8 years agowpi(4): fix some byteorder conversions
Adrian Chadd [Thu, 8 Oct 2015 07:21:36 +0000 (07:21 +0000)]
wpi(4): fix some byteorder conversions

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3761

8 years agowpi(4): fix 'maybe uninitialized' warnings
Adrian Chadd [Thu, 8 Oct 2015 07:20:22 +0000 (07:20 +0000)]
wpi(4): fix 'maybe uninitialized' warnings

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3760

8 years agowpi(4): add some branch predictions.
Adrian Chadd [Thu, 8 Oct 2015 07:18:28 +0000 (07:18 +0000)]
wpi(4): add some branch predictions.

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3759

8 years agowpi(4): drop unnecessary locking in wpi_set_pslevel().
Adrian Chadd [Thu, 8 Oct 2015 07:17:11 +0000 (07:17 +0000)]
wpi(4): drop unnecessary locking in wpi_set_pslevel().

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3758

8 years agoProperly format pointer size independent CloudABI system calls.
Ed Schouten [Thu, 8 Oct 2015 05:27:45 +0000 (05:27 +0000)]
Properly format pointer size independent CloudABI system calls.

CloudABI has approximately 50 system calls that do not depend on the
pointer size of the system. As the ABI is pretty compact, it takes
little effort to each truss(8) the formatting rules for these system
calls. Start off by formatting pointer size independent system calls.

Changes:

- Make it possible to include the CloudABI system call definitions in
  FreeBSD userspace builds. Add ${root}/sys to the truss(8) Makefile so
  we can pull in <compat/cloudabi/cloudabi_syscalldefs.h>.
- Refactoring: patch up amd64-cloudabi64.c to use the CLOUDABI_*
  constants instead of rolling our own table.
- Add table entries for all of the system calls.
- Add new generic formatting types (UInt, IntArray) that we'll be using
  to format unsigned integers and arrays of integers.
- Add CloudABI specific formatting types.

Approved by: jhb
Differential Revision: https://reviews.freebsd.org/D3836

8 years agoUse print as a function, not operator.
Craig Rodrigues [Thu, 8 Oct 2015 03:28:15 +0000 (03:28 +0000)]
Use print as a function, not operator.

8 years agoAdd option -l for specifying which OS loader to dlopen(3). By default
Marcel Moolenaar [Thu, 8 Oct 2015 02:28:22 +0000 (02:28 +0000)]
Add option -l for specifying which OS loader to dlopen(3). By default
this is /boot/userboot.so. This option allows for the development and
use of other OS loaders.

8 years agoMove SHLIBDIR?=/lib before <src.opts.mk> so that it works again.
Peter Wemm [Thu, 8 Oct 2015 01:17:45 +0000 (01:17 +0000)]
Move SHLIBDIR?=/lib before <src.opts.mk> so that it works again.

8 years agowpi(4): remove software queues
Adrian Chadd [Thu, 8 Oct 2015 00:52:41 +0000 (00:52 +0000)]
wpi(4): remove software queues

Use direct dispatch into the destination hardware ring instead of using
a staging queue.

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3757

8 years agoUse -fpermissive if compiling with GCC.
Craig Rodrigues [Thu, 8 Oct 2015 00:48:29 +0000 (00:48 +0000)]
Use -fpermissive if compiling with GCC.

Works around GCC bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67888
when compiling Module.cpp

8 years agoCorrect a comment.
Bryan Drewery [Thu, 8 Oct 2015 00:31:11 +0000 (00:31 +0000)]
Correct a comment.

8 years agoCorrect the command-line utility in the r285420 entry:
Glen Barber [Wed, 7 Oct 2015 20:04:32 +0000 (20:04 +0000)]
Correct the command-line utility in the r285420 entry:
s/jail/jexec/

Sponsored by: The FreeBSD Foundation

8 years agoUse proper function prototypes.
Craig Rodrigues [Wed, 7 Oct 2015 19:55:58 +0000 (19:55 +0000)]
Use proper function prototypes.
Eliminates -Wstrict-prototypes warning

8 years agoRemove redundant RFFPWAIT/vfork(2) handling in Linux fork(2) and clone(2) wrappers.
Bryan Drewery [Wed, 7 Oct 2015 19:10:38 +0000 (19:10 +0000)]
Remove redundant RFFPWAIT/vfork(2) handling in Linux fork(2) and clone(2) wrappers.

r161611 added some of the code from sys_vfork() directly into the Linux
module wrappers since they use RFSTOPPED.  In r232240, the RFFPWAIT handling
was moved to syscallret(), thus this code in the Linux module is no longer
needed as it will be called later.

This also allows the Linux wrappers to benefit from the fix in r275616 for
threads not getting suspended if their vforked child is stopped while they
wait on them.

Reviewed by: jhb, kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D3828

8 years agoDocument the recently added pl_syscall_* fields in struct ptrace_lwpinfo.
John Baldwin [Wed, 7 Oct 2015 17:52:18 +0000 (17:52 +0000)]
Document the recently added pl_syscall_* fields in struct ptrace_lwpinfo.

Reviewed by: emaste, kib
Differential Revision: https://reviews.freebsd.org/D3833

8 years agoMove pmu.c to files.arm and rename the option to pmu. This is not hwpmc
Andrew Turner [Wed, 7 Oct 2015 13:19:44 +0000 (13:19 +0000)]
Move pmu.c to files.arm and rename the option to pmu. This is not hwpmc
specific as we may use the pmu registers for other uses. No configs seem
to currently build this.

This will allow for more use of this device.

Discussed with: bz
Sponsored by: ABT Systems Ltd

8 years agoFix regression from r287779, that bite me. If we call m_pullup()
Gleb Smirnoff [Wed, 7 Oct 2015 13:10:26 +0000 (13:10 +0000)]
Fix regression from r287779, that bite me. If we call m_pullup()
unconditionally, we end up with an mbuf chain of two mbufs, which
later in in_arpreply() is rewritten from ARP request to ARP reply
and is sent out. Looks like igb(4) (at least mine, and at least
at my network) fails on such mbuf chain, so ARP reply doesn't go
out wire. Thus, make the m_pullup() call conditional, as it is
everywhere. Of course, the bug in igb(?) should be investigated,
but better first fix the head. And unconditional m_pullup() was
suboptimal, anyway.

8 years agoFix regression from r248371. We need to copy packet header to new
Gleb Smirnoff [Wed, 7 Oct 2015 12:40:00 +0000 (12:40 +0000)]
Fix regression from r248371. We need to copy packet header to new
mbuf. Unlike in the pre-r248371 code, assert that M_PKTHDR is set
only on a first mbuf.

Reported & tested by: Andriy Voskoboinyk <s3erios gmail.com>
Sponsored by: Nginx, Inc.

8 years agoIn softdep_setup_freeblocks():
Gleb Smirnoff [Wed, 7 Oct 2015 12:36:28 +0000 (12:36 +0000)]
In softdep_setup_freeblocks():
- Move the bread() to the beginning of function.
- Return if it fails, otherwise we will panic.

Submitted by: mckusick
Sponsored by: Netflix

8 years agoOnly print the errno string in case sysctl(3) does not file with ENOENT
Baptiste Daroussin [Wed, 7 Oct 2015 09:28:54 +0000 (09:28 +0000)]
Only print the errno string in case sysctl(3) does not file with ENOENT
This reduces the noise in error reporing from sysctl(8):

Before:
$ sysctl bla=something
sysctl: unknown oid 'bla': No such file or directory

After:
$ sysctl bla=something
sysctl: unknown oid 'bla'

MFC after: 1 week
Sponsored by: Gandi.net

8 years agoA follow-up to r288492. In fact, revert the mentioned commit for
Konstantin Belousov [Wed, 7 Oct 2015 09:12:49 +0000 (09:12 +0000)]
A follow-up to r288492.  In fact, revert the mentioned commit for
pre-VFPv3 processors, since they do require software support code to
handle denormals.  For VFPv3 and later, enable flush-to-zero if
hardware does not claim full denormals arithmetic support by VMVFR1_FZ
field in mvfr1 register.

The end result is that we do use correct fpu environment on Cortexes
with VFPv3, while ARM11 (e.g. rpi) is in non-compliant flush-to-zero
mode.  At least CPUs without complete hardware implementation of
IEEE 754 do not cause unhandled floating point exception on underflow,
as it was before r288492.

Noted by: ian
Tested by: gjb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoTrim spaces at the end of the buffer before trying to convert it to an oid
Baptiste Daroussin [Wed, 7 Oct 2015 08:56:01 +0000 (08:56 +0000)]
Trim spaces at the end of the buffer before trying to convert it to an oid

This allows to write entries in sysctl.conf with spaces before the '=' like
kern.ipc.shmmax = 9663676416

MFC after: 1 week
Sponsored by: Gandi.net

8 years agoFix a bug that caused reinitialization failure of MAC addresses on
Hiroki Sato [Wed, 7 Oct 2015 06:32:34 +0000 (06:32 +0000)]
Fix a bug that caused reinitialization failure of MAC addresses on
the lagg interface when removing the primary port.

PR: 201916
Differential Revision: https://reviews.freebsd.org/D3301