]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoDIRDEPS_BUILD: Allow destroy-(arch|host|stage) from top-level.
bdrewery [Wed, 24 Feb 2016 17:20:28 +0000 (17:20 +0000)]
DIRDEPS_BUILD: Allow destroy-(arch|host|stage) from top-level.

Sponsored by: EMC / Isilon Storage Division

8 years agoDIRDEPS_BUILD: Allow 'make destroy*' to work from top-level.
bdrewery [Wed, 24 Feb 2016 17:20:25 +0000 (17:20 +0000)]
DIRDEPS_BUILD: Allow 'make destroy*' to work from top-level.

Sponsored by: EMC / Isilon Storage Division

8 years agoFAST_DEPEND: Skip 'make depend' for buildworld and kernel since it is auto-ran now.
bdrewery [Wed, 24 Feb 2016 17:20:22 +0000 (17:20 +0000)]
FAST_DEPEND: Skip 'make depend' for buildworld and kernel since it is auto-ran now.

Sponsored by: EMC / Isilon Storage Division

8 years agoDIRDEPS_BUILD: Regenerate without local dependencies.
bdrewery [Wed, 24 Feb 2016 17:20:11 +0000 (17:20 +0000)]
DIRDEPS_BUILD: Regenerate without local dependencies.

These are no longer needed after the recent 'beforebuild: depend' changes
and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports
skipping 'make depend'.

Sponsored by: EMC / Isilon Storage Division

8 years agoFAST_DEPEND: Always run depend via beforebuild which removes many hacks.
bdrewery [Wed, 24 Feb 2016 17:19:18 +0000 (17:19 +0000)]
FAST_DEPEND: Always run depend via beforebuild which removes many hacks.

This will generate dependencies rather than depending on the previous behavior
of depending on the guessed OBJS: *.h dependecies or a user running
'make depend'.

Experimentation showed that depending only on headers was not enough and
prone to .ORDER errors.  Downstream users may also have added
dependencies into beforedepend or afterdepend targets.  The safest way to
ensure dependencies are generated before build is to run 'make depend'
beforehand rather than just depending on DPSRCS+SRCS.

Note that the OBJS_DEPEND_GUESS mechanism (a.k.a .if !exists(.depend) then
foo.o: *.h) is still useful as it improves incremental builds with missing
.depend.* files and allows 'make foo.o' to usually work, while this
'beforebuild: depend' ensures that the build will always find all dependencies.
The 'make foo.o' case has no means of a 'beforebuild' hook.

This also removes several hacks in the DIRDEPS_BUILD:
- NO_INSTALL_INCLUDES is no longer needed as it mostly was to work around
  .ORDER problems with building the needed headers early.
- DIRDEPS_BUILD: It is no longer necesarry to track "local dependencies" in
  Makefile.depend.

  These were only in Makefile.depend for 'clean builds' since nothing would
  generate the files due to skipping 'make depend' and early dependency
  bugs that have been fixed, such as adding headers into SRCS for the
  OBJS_DEPEND_GUESS mechanism.  Normally if a .depend file does not exist then
  a dependency is added by bsd.lib.mk/bsd.prog.mk from OBJS: *.h.  However,
  meta.autodep.mk creates a .depend file from created meta files and inserts
  that into Makefile.depend.  It also only tracks *.[ch] files though which can
  miss some dependencies that are hooked into 'make depend'.  This .depend
  that is created then breaks incremental builds due to the !exists(.depend)
  checks for OBJS_DEPEND_GUESS.  The goal was to skip 'make depend' yet it only
  really works the first time.  After that files are not generated as expected,
  which r288966 tried to address but was using buildfiles: rather than
  beforebuild: and was reverted in r291725.  As noted previously,
  depending only on headers in beforebuild: would create .ORDER errors
  in some cases.

  meta.autodep.mk is still used to generate Makefile.depend though via:
    gendirdeps: Makefile.depend
    .END: gendirdeps

  This commit allows removing all of the "local dependencies" in
  Makefile.depend which cuts down on churn and removes some of the
  arch-dependent Makefile.depend files.

  The "local dependencies" were also problematic for bootstrapping.

Sponsored by: EMC / Isilon Storage Division

8 years agoHook the meta/nofilemon build into using FAST_DEPEND.
bdrewery [Wed, 24 Feb 2016 17:19:13 +0000 (17:19 +0000)]
Hook the meta/nofilemon build into using FAST_DEPEND.

FAST_DEPEND is intended to be the "skip 'make depend' and mkdep"
feature.  Since DIRDEPS_BUILD does this already with some of its own
hacks, and filemon doesn't need this, and nofilemon does, teach it how
to handle each of these cases.

In meta+filemon mode filemon will handle dependencies itself via the
meta mode logic in bmake.  We still want to set MK_FAST_DEPEND=yes to
enable some logic that indicates that 'make depend' is skipped in the
traditional sense.  The actual .depend.* files will be skipped.

When nofilemon is set though we still need to track and generate dependencies.

Sponsored by: EMC / Isilon Storage Division

8 years agoFAST_DEPEND: Don't waste time generating an empty .depend file.
bdrewery [Wed, 24 Feb 2016 17:19:09 +0000 (17:19 +0000)]
FAST_DEPEND: Don't waste time generating an empty .depend file.

The .depend file will still be generated if _EXTRADEPEND is used.  The target
is kept with a dependency on DPSRCS though so that 'make depend' will generate
all files.

Sponsored by: EMC / Isilon Storage Division

8 years agoFAST_DEPEND: Rework how guessed dependencies are handled.
bdrewery [Wed, 24 Feb 2016 17:19:05 +0000 (17:19 +0000)]
FAST_DEPEND: Rework how guessed dependencies are handled.

Rather than depend on .depend not existing, check the actual
.depend.OBJ file that will be used for that object.  If it doesn't
exist then use the guessed dependencies.

FAST_DEPEND may never have a .depend file.  Not having one means all of the
previous logic would over-depend all object files on all headers which is not
what we wanted.  It also means that if a .depend is generated before a build
is done for _EXTRADEPEND (such as for PROG or LIB) then all of these
dependencies would not be used since the .depend wasn't generated from mkdep
and the real .depend.* files are not generated until the build.

Sponsored by: EMC / Isilon Storage Division

8 years agoSupport beforebuild in the kernel.
bdrewery [Wed, 24 Feb 2016 17:19:02 +0000 (17:19 +0000)]
Support beforebuild in the kernel.

Sponsored by: EMC / Isilon Storage Division

8 years agoRemove ilinks in cleandepend directly via CLEANDEPENDFILES.
bdrewery [Wed, 24 Feb 2016 17:18:58 +0000 (17:18 +0000)]
Remove ilinks in cleandepend directly via CLEANDEPENDFILES.

The 'cleanilinks' target is kept since it may still be useful as added in
r200178, though never documented.

Sponsored by: EMC / Isilon Storage Division

8 years agoFollow-up r295667 with fixes for SRCS defined.
bdrewery [Wed, 24 Feb 2016 17:18:55 +0000 (17:18 +0000)]
Follow-up r295667 with fixes for SRCS defined.

cleandepend should always remove CLEANDEPEND* if they are not empty,
but bsd.dep.mk should not add the tags entries unless SRCS is defined
as it did before.  The .depend file itself it still always removed
to avoid accidentally keeping a stale one around as done in r295666.

Sponsored by: EMC / Isilon Storage Division

8 years agoConvert to LIBADD.
bdrewery [Wed, 24 Feb 2016 17:18:52 +0000 (17:18 +0000)]
Convert to LIBADD.

Sponsored by: EMC / Isilon Storage Division

8 years agoSupport a WANT_MAKE_VERSION.
bdrewery [Wed, 24 Feb 2016 17:18:49 +0000 (17:18 +0000)]
Support a WANT_MAKE_VERSION.

This will be used soon for .dinclude support in FAST_DEPEND.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoDIRDEPS_BUILD: Add some missing build dependencies for kerberos5.
bdrewery [Wed, 24 Feb 2016 17:18:43 +0000 (17:18 +0000)]
DIRDEPS_BUILD: Add some missing build dependencies for kerberos5.

Sponsored by: EMC / Isilon Storage Division

8 years agoDIRDEPS_BUILD: Update dependencies.
bdrewery [Wed, 24 Feb 2016 17:18:35 +0000 (17:18 +0000)]
DIRDEPS_BUILD: Update dependencies.

Sponsored by: EMC / Isilon Storage Division

8 years agoProperly fix these builds by adding NO_WMISSING_VARIABLE_DECLARATIONS from r249657.
bdrewery [Wed, 24 Feb 2016 17:18:31 +0000 (17:18 +0000)]
Properly fix these builds by adding NO_WMISSING_VARIABLE_DECLARATIONS from r249657.

This reverts r284374.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoPROGS: Only recurse on called targets like done for SUBDIR in r291635.
bdrewery [Wed, 24 Feb 2016 17:18:28 +0000 (17:18 +0000)]
PROGS: Only recurse on called targets like done for SUBDIR in r291635.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agodb(3): Fix aliasing warnings from modern GCC.
pfg [Wed, 24 Feb 2016 17:14:11 +0000 (17:14 +0000)]
db(3): Fix aliasing warnings from modern GCC.

While here also drop a malloc cast.

Obtained from: NetBSD (CVS Rev. 1.18 - 1.20)

8 years agoMake asynchronous connection failures on UNIX sockets fail with ECONNRESET.
ed [Wed, 24 Feb 2016 17:10:32 +0000 (17:10 +0000)]
Make asynchronous connection failures on UNIX sockets fail with ECONNRESET.

While making CloudABI work well on Linux, I discovered that I had a
FreeBSD-ism in one of my unit tests. The test did the following:

- Create UNIX socket 1, bind it, make it listen.
- Create UNIX socket 2, connect it to UNIX socket 1.
- Close UNIX socket 1.
- Obtain SO_ERROR from socket 2.

On FreeBSD this returns ECONNABORTED, while on Linux it returns
ECONNRESET. I dug through some of the relevant specifications[1] and it
looks like Linux is all right here. ECONNABORTED should only be returned
when the local connection (socket 2) is aborted; not the peer (socket 1).

It is of course slightly misleading: the function in which we set this
error is called uipc_abort(), but keep in mind that we're aborting the
peer, thus resetting the local socket.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/connect.html

Reviewed by: cem
Sponsored by: Nuxi, the Netherlands
Differential Revision: https://reviews.freebsd.org/D5419

8 years agodb(3): Fix aliasing warnings from modern GCC.
pfg [Wed, 24 Feb 2016 16:52:03 +0000 (16:52 +0000)]
db(3): Fix aliasing warnings from modern GCC.

Obtained from: NetBSD (CVS Rev. 1.20)

8 years agoAdd support for symmetric multiprocessing (SMP).
br [Wed, 24 Feb 2016 16:50:34 +0000 (16:50 +0000)]
Add support for symmetric multiprocessing (SMP).

Tested on Spike simulator with 2 and 16 cores (tlb enabled),
so set MAXCPU to 16 at this time.

This uses FDT data to get information about CPUs
(code based on arm64 mp_machdep).

Invalidate entire TLB cache as it is the only way yet.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

8 years agoProvide more correct sizing of the KVA consumed by a vnode, used by
kib [Wed, 24 Feb 2016 15:15:46 +0000 (15:15 +0000)]
Provide more correct sizing of the KVA consumed by a vnode, used by
the virtvnodes calculation.  Include the size of fs-specific v_data as
the nfs nclnode inline, the NFS nclnode is bigger than either ZFS
znode or UFS inode.  Include the size of namecache_ts and short cache
path element, multiplied by the name cache population factor, again
inline.

Inline defines are used to avoid pollution of the vnode.h with the
subsystem-private objects.  Non-significant unsynchronized changes of
the definitions are fine, we do not care about that precision, and
e.g. ZFS consumes much malloced memory per vnode for reasons
unaccounted in the formula.

Lower the partition of kmem dedicated to vnodes, from 1/7 to 1/10.

The measures reduce vnode cache pressure on kmem and bring the vnode
cache memory use below some apparent thresholds that were exceeded by
r291244 due to more robust vnode reuse.

Reported and tested by: marius (i386, previous version)
Reviewed by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoFix bug in filling and handling ipfw's O_DSCP opcode.
ae [Wed, 24 Feb 2016 13:16:03 +0000 (13:16 +0000)]
Fix bug in filling and handling ipfw's O_DSCP opcode.
Due to integer overflow CS4 token was handled as BE.

PR: 207459
MFC after: 1 week

8 years agoFix useless check. m_pkthdr.len should be equal to orglen.
ae [Wed, 24 Feb 2016 12:28:49 +0000 (12:28 +0000)]
Fix useless check. m_pkthdr.len should be equal to orglen.

MFC after: 2 weeks

8 years agoReturn dst as the result from memcpy(9) on amd64.
kib [Wed, 24 Feb 2016 11:58:15 +0000 (11:58 +0000)]
Return dst as the result from memcpy(9) on amd64.

PR: 207422
MFC after: 1 week

8 years agoCall cap_rights_init() properly.
ed [Wed, 24 Feb 2016 10:54:26 +0000 (10:54 +0000)]
Call cap_rights_init() properly.

Even though or'ing the individual rights works in this specific case, it
may not work in general. Pass them in as varargs.

8 years agohyperv/vmbus: Use free(9) for interrupt page; it is allocated by malloc(9)
sephe [Wed, 24 Feb 2016 08:54:50 +0000 (08:54 +0000)]
hyperv/vmbus: Use free(9) for interrupt page; it is allocated by malloc(9)

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5417

8 years agoMake pci_host_generic and thunderx_pci common
wma [Wed, 24 Feb 2016 06:05:30 +0000 (06:05 +0000)]
Make pci_host_generic and thunderx_pci common
  * provided OFW interface for pci_host_generic (for handling devices which are present in DTS under the PCI node)
  * removed support for internal PCI from arm64/cavium
  * cleaned up and made most of the code common

Obtained from:         Semihalf
Sponsored by:          Cavium
Approved by:           cognet (mentor)
Reviewed by:           zbb
Differential revision: https://reviews.freebsd.org/D5261

8 years agoo kill few remaining references to the GEOM_UNCOMPRESS;
sobomax [Wed, 24 Feb 2016 05:17:52 +0000 (05:17 +0000)]
o kill few remaining references to the GEOM_UNCOMPRESS;

o add GEOM_UZIP_DEBUG.

8 years agoKill few remaininng instances of GEOM_UNCOMPRESS.
sobomax [Wed, 24 Feb 2016 05:16:24 +0000 (05:16 +0000)]
Kill few remaininng instances of GEOM_UNCOMPRESS.

8 years agohyperv/utils: Code rearrange and cleanup
sephe [Wed, 24 Feb 2016 05:01:18 +0000 (05:01 +0000)]
hyperv/utils: Code rearrange and cleanup

Split heartbeat, shutdown and timesync out of utils code
and name them properly.

Submitted by: Jun Su <junsu microsoft com>
Reviewed by: adrian, sephe, Hongjiang Zhang <honzhan microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5216

8 years agoMigrate UNCOMPRESS -> UZIP
adrian [Wed, 24 Feb 2016 03:06:26 +0000 (03:06 +0000)]
Migrate UNCOMPRESS -> UZIP

8 years agoFixes to make it compile under gcc-4.2.
adrian [Wed, 24 Feb 2016 02:52:49 +0000 (02:52 +0000)]
Fixes to make it compile under gcc-4.2.

8 years agoThe UFS filesystem requires that the last block of a file always be
mckusick [Wed, 24 Feb 2016 01:58:40 +0000 (01:58 +0000)]
The UFS filesystem requires that the last block of a file always be
allocated. When shortening the length of a file in which the new end
of the file contains a hole, the hole must have a block allocated.

Reported by: Maxim Sobolev
Reviewed by: kib
Tested by:   Peter Holm

8 years ago- Add a global option where we can protect processes when swap space
araujo [Wed, 24 Feb 2016 01:32:12 +0000 (01:32 +0000)]
- Add a global option where we can protect processes when swap space
  is exhausted.

How to use:

Basically we need to add on rc.conf an another option like:

    If we want to protect only the main processes.
    syslogd_oomprotect="YES"

    If we want to protect all future children of the specified processes.
    syslogd_oomprotect="ALL"

PR: 204741 (based on)
Submitted by: eugen@grosbein.net
Reviewed by: jhb, allanjude, rpokala and bapt
MFC after: 4 weeks
Relnotes: Yes
Sponsored by: gandi.net
Differential Revision: https://reviews.freebsd.org/D5176

8 years agoixl(4)/ixlv(4): Remove a couple unnecessary register writes/flushes.
erj [Wed, 24 Feb 2016 01:11:51 +0000 (01:11 +0000)]
ixl(4)/ixlv(4): Remove a couple unnecessary register writes/flushes.

The one in ixl_xmit() has brought up to us as being unnecessary at least a
couple times.

Differential Revision: https://reviews.freebsd.org/D5208
Tested by: jeffrey.e.pieper@intel.com
Sponsored by: Intel Corporation

8 years agoixl(4): Fix potential driver interrupt setup issues and startup crash.
erj [Wed, 24 Feb 2016 00:42:43 +0000 (00:42 +0000)]
ixl(4): Fix potential driver interrupt setup issues and startup crash.

- Limit queue autoconfiguration to 8 queues to prevent the driver from
  requesting a large number of MSI-X vectors at boot.

- Fix potential kernel panic that occurs when the driver loads and cannot
  get all requested MSIX vectors. Instead, attach() will fail with an error.
  - Move taskqueue setup to later in attach() to prevent having to free
    taskqueues if some other error in attach() occurs.

Differential Revision:  https://reviews.freebsd.org/D5205
MFC after: 1 month
Tested by: jeffrey.e.pieper@intel.com
Sponsored by: Intel Corporation

8 years agoObsolete mkulzma(8) and geom_uncompress(4), their functionality
sobomax [Wed, 24 Feb 2016 00:39:36 +0000 (00:39 +0000)]
Obsolete mkulzma(8) and geom_uncompress(4), their functionality
is now provided by mkuzip(8) and geom_uzip(4) respectively.

MFC after: 1 month

8 years agonvme: fix intx handler to not dereference ioq during initialization
jimharris [Wed, 24 Feb 2016 00:01:10 +0000 (00:01 +0000)]
nvme: fix intx handler to not dereference ioq during initialization

This was a regression from r293328, which deferred allocation
of the controller's ioq array until after interrupts are enabled
during boot.

PR: 207432
Reported and tested by: Andy Carrel <wac@google.com>
MFC after: 3 days
Sponsored by: Intel

8 years agoImprove mkuzip(8) and geom_uzip(4), merge in LZMA support from mkulzma(8)
sobomax [Tue, 23 Feb 2016 23:59:08 +0000 (23:59 +0000)]
Improve mkuzip(8) and geom_uzip(4), merge in LZMA support from mkulzma(8)
and geom_uncompress(4):

1. mkuzip(8):

 - Proper support for eliminating all-zero blocks when compressing an
   image. This feature is already supported by the geom_uzip(4) module
   and CLOOP format in general, so it's just a matter of making mkuzip(8)
   match. It should be noted, however that this feature while it sounds
   great, results in very slight improvement in the overall compression
   ratio, since compressing default 16k all-zero block produces only 39
   bytes compressed output block, which is 99.8% compression ratio. With
   typical average compression ratio of amd64 binaries and data being
   around 60-70% the difference between 99.8% and 100.0% is not that
   great further diluted by the ratio of number of zero blocks in the
   uncompressed image to the overall number of blocks being less than
   0.5 (typically). However, this may be important from performance
   standpoint, so that kernel are not spinning its wheels decompressing
   those empty blocks every time this zero region is read. It could also
   be important when you create huge image mostly filled with zero
   blocks for testing purposes.

 - New feature allowing to de-duplicate output image. It turns out that
   if you twist CLOOP format a bit you can do that as well. And unlike
   zero-blocks elimination, this gives a noticeable improvement in the
   overall compression ratio, reducing output image by something like
   3-4% on my test UFS2 3GB image consisting of full FreeBSD base system
   plus some of the packages (openjdk, apache etc), about 2.3GB worth of
   file data (800+MB compressed). The only caveat is that images created
   with this feature "on" would not work on older versions of FeeBSDxi
   kernel, hence it's turned off by default.

 - provide options to control both features and document them in manual
   page.

 - merge in all relevant LZMA compression support from the mkulzma(8),
   add new option to select between both.

 - switch license from ad-hoc beerware into standard 2-clause BSD.

2. geom_uzip(4):

 - implement support for de-duplicated images;

 - optimize some code paths to handle "all-zero" blocks without reading
   any compressed data;

 - beef up manual page to explain that geom_uzip(4) is not limited only
   to md(4) images. The compressed data can be written to the block
   device and accessed directly via magic of GEOM(4) and devfs(4),
   including to mount root fs from a compressed drive.

 - convert debug log code from being compiled in conditionally into
   being present all the time and provide two sysctls to turn it on or
   off. Due to intended use of the module, it can be used in
   environments where there may not be a luxury to put new kernel with
   debug code enabled. Having those options handy allows debug issues
   without as much problem by just having access to serial console or
   network shell access to a box/appliance. The resulting additional
   CPU cycles are just few int comparisons and branches, and those are
   minuscule when compared to data decompression which is the main
   feature of the module.

 - hopefully improve robustness and resiliency of the geom_uzip(4) by
   performing some of the data validation / range checking on the TOC
   entries and rejecting to attach to an image if those checks fail.

 - merge in all relevant LZMA decompression support from the
   geom_uncompress(4), enable automatically when appropriate format is
   indicated in the header.

 - move compilation work into its own worker thread so that it does not
   clog g_up. This allows multiple instances work in parallel utilizing
   smp cores.

 - document new knobs in the manual page.

Reviewed by: adrian
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D5333

8 years agoSilence PVS-Studio warning (V595). It can never be NULL here.
jkim [Tue, 23 Feb 2016 23:57:24 +0000 (23:57 +0000)]
Silence PVS-Studio warning (V595).  It can never be NULL here.

8 years agoFix build after r295934.
bdrewery [Tue, 23 Feb 2016 23:37:10 +0000 (23:37 +0000)]
Fix build after r295934.

8 years agoSilence PVS-Studio warning (V595).
jkim [Tue, 23 Feb 2016 23:09:45 +0000 (23:09 +0000)]
Silence PVS-Studio warning (V595).

8 years agoSilence PVS-Studio warning (V595).
jkim [Tue, 23 Feb 2016 22:55:44 +0000 (22:55 +0000)]
Silence PVS-Studio warning (V595).

8 years agoRemove brightness notify handler before reinstalling new one.
jkim [Tue, 23 Feb 2016 22:50:45 +0000 (22:50 +0000)]
Remove brightness notify handler before reinstalling new one.

8 years agosh: Fix set -v and multiline history after r295825.
jilles [Tue, 23 Feb 2016 22:44:01 +0000 (22:44 +0000)]
sh: Fix set -v and multiline history after r295825.

r295825 erroneously dropped the newline from the input data for 'set -v'
output and multiline history.

Reported by: vangyzen

8 years agoFix white spaces.
jkim [Tue, 23 Feb 2016 22:30:45 +0000 (22:30 +0000)]
Fix white spaces.

8 years agoFix style(9) bugs.
jkim [Tue, 23 Feb 2016 22:22:15 +0000 (22:22 +0000)]
Fix style(9) bugs.

8 years agoAccording to the sys/kern/capabilities.conf, gethostid(3) should be allowed.
oshogbo [Tue, 23 Feb 2016 22:02:25 +0000 (22:02 +0000)]
According to the sys/kern/capabilities.conf, gethostid(3) should be allowed.

Pointed out by: Milosz Kaniewski <m.kaniewski@wheelsystems.com>
Approved by: pjd (mentor)
MFC after: 3 days
Sponsored by: Wheel Systems, http://wheelsystems.com

8 years agoFix build after r29592.
bdrewery [Tue, 23 Feb 2016 21:21:47 +0000 (21:21 +0000)]
Fix build after r29592.

8 years agonet80211: fix TIM cleanup.
avos [Tue, 23 Feb 2016 21:11:42 +0000 (21:11 +0000)]
net80211: fix TIM cleanup.

Remove duplicate 'ni->ni_associd = 0' assignment from
ieee80211_node_leave(), since it breaks iv_set_tim() in
ic->ic_node_cleanup() (associd is cleared right after this call).

Tested with RTL8188EU (HOSTAP mode) and
WUSB54GC (STA mode, with powersaving enabled).

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D5398

8 years agoAdd handling for non-native error values to libsysdecode.
jhb [Tue, 23 Feb 2016 20:00:55 +0000 (20:00 +0000)]
Add handling for non-native error values to libsysdecode.

Add two new functions, sysdecode_abi_to_freebsd_errno() and
sysdecode_freebsd_to_abi_errno(), which convert errno values between
the native FreeBSD ABI and other supported ABIs. Note that the
mappings are not necessarily perfect meaning in some cases multiple
errors in one ABI might map to a single error in another ABI. In that
case, the reverse mapping will return one of the errors that maps, but
which error is non-deterministic.

Change truss to always report the raw error value to the user but
use libsysdecode to map it to a native errno value that can be used
with strerror() to generate a description. Previously truss reported
the "converted" error value. Now the user will always see the exact
error value that the application sees.

Change kdump to report the truly raw error value to the user. Previously
kdump would report the absolute value of the raw error value (so for
Linux binaries it didn't output the FreeBSD error value, but the positive
value of the Linux error). Now it reports the real (i.e. negative) error
value for Linux binaries. Also, use libsysdecode to convert the native
FreeBSD error reported in the ktrace record to the raw error used by the
ABI. This means that the Linux ABI can now be handled directly in
ktrsysret() and removes the need for linux_ktrsysret().

Reviewed by: bdrewery, kib
Helpful notes: wblock (manpage)
Differential Revision: https://reviews.freebsd.org/D5314

8 years agoAdd support for displaying thread IDs to truss(1).
jhb [Tue, 23 Feb 2016 19:56:29 +0000 (19:56 +0000)]
Add support for displaying thread IDs to truss(1).

- Consolidate duplicate code for printing the metadata at the start of
  each line into a shared function.
- Add an -H option which will log the thread ID of the relevant thread
  for each event.

While here, remove some extraneous calls to clock_gettime() in
print_syscall() and print_syscall_ret().  The caller of print_syscall_ret()
always updates the current thread's "after" time before it is called.

Reviewed by: kib
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D5363

8 years agoDon't leak an address in an error path.
tuexen [Tue, 23 Feb 2016 18:50:34 +0000 (18:50 +0000)]
Don't leak an address in an error path.

CID: 1351729
MFC after: 3 days

8 years agoConfigure the correct bMaxPacketSize for control endpoints before
hselasky [Tue, 23 Feb 2016 18:17:01 +0000 (18:17 +0000)]
Configure the correct bMaxPacketSize for control endpoints before
requesting the initial complete device descriptor and not as part of
the subsequent babble error recovery. Babble means that the received
USB packet was bigger than than configured maximum packet size. This
only affects enumeration of FULL speed USB devices which use a
bMaxPacketSize different from 8 bytes. This patch might help fix
enumeration of USB devices which exhibit USB I/O errors in dmesg
during boot.

MFC after: 1 week

8 years agoThis fixes the fastpath code to have a better module initialization sequence when
rrs [Tue, 23 Feb 2016 17:53:39 +0000 (17:53 +0000)]
This fixes the fastpath code to have a better module initialization sequence when
included in loader.conf. It also fixes it so that no matter if some one incorrectly
specifies a load order, the lists and such will be initialized on demand at that
time so no one can make that mistake.

Reviewed by: hiren
Differential Revision: D5189

8 years agoFollowing revision r295924, the changes to a db file should be fsynced
dwmalone [Tue, 23 Feb 2016 15:28:13 +0000 (15:28 +0000)]
Following revision r295924, the changes to a db file should be fsynced
before the file is closed. Consequently, it shouldn't be necessary to
open the file with O_SYNC any more.

This improves the performance of building large .db files for large
password files a lot and should resolve this problem:

https://forums.freebsd.org/threads/10-2-pre-pwd_mkdb-slow-on-larger-master-passwd.52700/

Differential Revision: https://reviews.freebsd.org/D5186
Reviewed by: garga, vangyzen, bapt, se
MFC after: 1 week

8 years agoIf we close or sync a hash-based db file, make sure to call fsync to
dwmalone [Tue, 23 Feb 2016 15:21:13 +0000 (15:21 +0000)]
If we close or sync a hash-based db file, make sure to call fsync to
make sure the changes are on disk. The people at pfSense noticed that
it didn't always make it to the disk soon enough with soft updates.

Differential Revision: https://reviews.freebsd.org/D5186
Reviewed by: garga, vangyzen, bapt, se
MFC after: 1 week

8 years agoBe more verbose when truncating number of HID items.
hselasky [Tue, 23 Feb 2016 14:58:20 +0000 (14:58 +0000)]
Be more verbose when truncating number of HID items.

Suggested by: Larry Rosenman <ler@lerctr.org>
MFC after: 1 week

8 years agoSet a dependencies for stack(9) RISC-V MD part.
br [Tue, 23 Feb 2016 14:29:22 +0000 (14:29 +0000)]
Set a dependencies for stack(9) RISC-V MD part.

Pointed out by: andrew

8 years agoo Grab physical memory regions information from the device tree.
br [Tue, 23 Feb 2016 14:21:46 +0000 (14:21 +0000)]
o Grab physical memory regions information from the device tree.
o Increase memory size.

8 years agoRemove redundant __ARM_ARCH >= 6 check in armv6 specific files.
skra [Tue, 23 Feb 2016 10:12:50 +0000 (10:12 +0000)]
Remove redundant __ARM_ARCH >= 6 check in armv6 specific files.

8 years agohyperv/stor: Fix print format
sephe [Tue, 23 Feb 2016 09:29:45 +0000 (09:29 +0000)]
hyperv/stor: Fix print format

Detected by: PVS Static Analysis
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5388

8 years agohyperv/hn: Use IFQ_DRV_PREPEND instead of IF_PREPEND
sephe [Tue, 23 Feb 2016 09:25:20 +0000 (09:25 +0000)]
hyperv/hn: Use IFQ_DRV_PREPEND instead of IF_PREPEND

IF_PREPEND promises out-of-order packet sending when the TX desc list
is depleted. It was overlooked and copied blindly when the transmission
path was partially rewritten.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5386

8 years agoMake handling of mmap()'s prot argument more strict.
ed [Tue, 23 Feb 2016 09:22:00 +0000 (09:22 +0000)]
Make handling of mmap()'s prot argument more strict.

- Make the system call fail if prot contains bits other than read, write
  and exec.
- Similar to OpenBSD's W^X, don't allow write and exec to be set at the
  same time. I'd like to see for now what happens if we enforce this
  policy unconditionally. If it turns out that this is far too strict,
  we'll loosen this requirement.

8 years agohyperv/hn: Factor out hn_send_pkt() from hn_start_locked()
sephe [Tue, 23 Feb 2016 09:20:33 +0000 (09:20 +0000)]
hyperv/hn: Factor out hn_send_pkt() from hn_start_locked()

It will be shared w/ the upcoming ifnet.if_transmit method
implementation.

No functional change.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5385

8 years agoMFV r295913:
delphij [Tue, 23 Feb 2016 07:13:22 +0000 (07:13 +0000)]
MFV r295913:

Partially apply upstream changeset 6e06b1c8 (kientzle).

Limit filter recursion level to 25 (instead of infinite).  This fixes a
potential crash issue discovered by Alexander Cherepanov.

PR: 207362
Reported by: Robert Clausecker
Obtained from: libarchive github project

8 years agoStop using the global fdtbus_bs_tag and instead use the tag from the softc
ian [Tue, 23 Feb 2016 03:34:36 +0000 (03:34 +0000)]
Stop using the global fdtbus_bs_tag and instead use the tag from the softc
that was set up properly at init time.

8 years agoThis code no longer references fdtbus_bs_tag, no need for a special extern
ian [Tue, 23 Feb 2016 03:01:46 +0000 (03:01 +0000)]
This code no longer references fdtbus_bs_tag, no need for a special extern
declaration of it for aarch64.

8 years agoNow that we have OF_decode_addr(), with proper MD implementations, to obtain
ian [Tue, 23 Feb 2016 02:57:45 +0000 (02:57 +0000)]
Now that we have OF_decode_addr(), with proper MD implementations, to obtain
the bus space tag and handle for a uart console, use the values returned by
that routine to set the global uart_bus_space_mem, instead of assuming that
there will be a global variable named fdtbus_bs_tag to set it from.

Also, use OF_getencprop() instead calling fdt32_to_cpu() separately.

8 years agoAllow the size argument for law_enable() to be non-power-of-2.
jhibbits [Tue, 23 Feb 2016 02:28:19 +0000 (02:28 +0000)]
Allow the size argument for law_enable() to be non-power-of-2.

Although the local access windows are powers of 2 in size, allow arguments that
aren't power of 2, and round up.

8 years agoAdd device ID for 'AboCom 802.11n' usb.
kevlo [Tue, 23 Feb 2016 01:56:58 +0000 (01:56 +0000)]
Add device ID for 'AboCom 802.11n' usb.

PR: 207412
Submitted by: Philippe Michaud-Boudreault <pitwuu at gmail dot com>

8 years agoFix and clean up usage of DMA and TSO segments:
marius [Tue, 23 Feb 2016 01:19:26 +0000 (01:19 +0000)]
Fix and clean up usage of DMA and TSO segments:
- At Intel it is believed that most of their products support "only"
  40 DMA segments so lower {EM,IGB}_MAX_SCATTER accordingly. Actually,
  40 is more than plenty to handle full size TSO packets so it doesn't
  make sense to further distinguish between MAC variants that really
  can do 64 DMA segments. Moreover, capping at 40 DMA segments limits
  the stack usage of {em,igb}_xmit() that - given the rare use of more
  than these - previously hardly was justifiable, while still being
  sufficient to avoid the problems seen with em(4) and EM_MAX_SCATTER
  set to 32.
- In igb(4), pass the actually supported TSO parameters up the stack.
  Previously, the defaults set in if_attach_internal() were applied,
  i. e. a maximum of 35 TSO segments, which made supporting more than
  these in the driver pointless. However, this might explain why no
  problems were seen with IGB_MAX_SCATTER at 64.
- In em(4), take the 5 m_pullup(9) invocations performed by em_xmit()
  in the TSO case into account when reporting TSO parameters upwards.
  In the worst case, each of these calls will add another mbuf and,
  thus, the requirement for an additional DMA segment. So for best
  performance, it doesn't make sense to advertize a maximum of TSO
  segments that typically will require defragmentation in em_xmit().
  Again, this leaves enough room to handle full size TSO packets.
- Drop TSO macros from if_lem.h given that corresponding MACS don't
  support TSO in the first place.

Reviewed by: erj, sbruno, jeffrey.e.pieper_intel.com
Approved by: erj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D5238

8 years agoMake imx6 systems work again after recent import of new dts files.
ian [Tue, 23 Feb 2016 01:08:39 +0000 (01:08 +0000)]
Make imx6 systems work again after recent import of new dts files.

Linux-driven changes to the way the chip's two interrupt controllers are
defined (we only support one of them) led to no interrupt processing, so
the system would hang after device instantiation.  This workaround just
rewrites the FDT data on the fly to get interrupt handling back under the
control of the main GIC device.

If/when we ever support deep sleep modes that involve powering down the
main GIC, we'll have to undo this change, write a driver for the GPC-PIC,
and somehow manage the handoff of responsibilities between the two drivers
as the chip transitions in/out of deep sleep mode.

8 years agoFix a problem in ld, causing it to sometimes print messages similar to
dim [Mon, 22 Feb 2016 22:16:32 +0000 (22:16 +0000)]
Fix a problem in ld, causing it to sometimes print messages similar to
"invalid string offset 65521 >= 27261 for section `.strtab'". for object
files produced by recent versions of clang.

In BFD's elf_create_symbuf() function, the size of the symbol buffer
('ssymbuf') is not calculated correctly, and the initial value for the
'ssym' variable is off by one, since 'ssymbuf' has shndx_count + 1
members.

MFC after: 1 week

8 years agoFix the usr.sbin/iostat build with GCC, broken by r295768
asomers [Mon, 22 Feb 2016 21:40:53 +0000 (21:40 +0000)]
Fix the usr.sbin/iostat build with GCC, broken by r295768

Renamed some local variables for compatibility with -Wshadow

Reported by: Andrew Turner
Tested by: ken
MFC after: 4 weeks
X-MFC-with: 295768
Sponsored by: Spectra Logic Corp

8 years agoAlways remove .depend.* in case switching between FAST_DEPEND on/off.
bdrewery [Mon, 22 Feb 2016 21:01:25 +0000 (21:01 +0000)]
Always remove .depend.* in case switching between FAST_DEPEND on/off.

This was missed in r295666.

Sponsored by: EMC / Isilon Storage Division

8 years agoIf the user has set a u-boot env var named rootpath, automatically
ian [Mon, 22 Feb 2016 18:53:55 +0000 (18:53 +0000)]
If the user has set a u-boot env var named rootpath, automatically
import it into the loader(8) env as dhcp.root-path, so that it overrides
any dhcp/bootp server-provided path.

Now if you have a dhcp server available you can easily net-boot a u-boot
system even if you don't control the dhcp server config, by setting just
two variables in the u-boot env:

  loaderdev=net
  rootpath=<nfsserverip>:<pathname>

Previously you had to either accept all the dhcp parameters from the
server without the ability to locally provide the rootpath, or you had
to forego dhcp and set more vars (ipaddr, netmask, serverip, rootpath).

8 years agoAdd basic trap handlers for illegal instruction and breakpoint
br [Mon, 22 Feb 2016 14:54:50 +0000 (14:54 +0000)]
Add basic trap handlers for illegal instruction and breakpoint
exceptions.

8 years agoFix comment.
br [Mon, 22 Feb 2016 14:19:45 +0000 (14:19 +0000)]
Fix comment.

8 years agoRemove duplicates.
br [Mon, 22 Feb 2016 14:13:05 +0000 (14:13 +0000)]
Remove duplicates.

8 years agoProvide stack(9) MD stubs for RISC-V so ktr(9) can be compiled in.
br [Mon, 22 Feb 2016 14:01:46 +0000 (14:01 +0000)]
Provide stack(9) MD stubs for RISC-V so ktr(9) can be compiled in.

8 years agoFix ktrace call.
br [Mon, 22 Feb 2016 13:52:08 +0000 (13:52 +0000)]
Fix ktrace call.

8 years agoAdd Intel 10Gb support to ARM64 GENERIC kernel config
wma [Mon, 22 Feb 2016 13:34:43 +0000 (13:34 +0000)]
Add Intel 10Gb support to ARM64 GENERIC kernel config

Obtained from:         Semihalf
Sponsored by:          Cavium
Approved by:           cognet (mentor)
Reviewed by:           zbb
Differential revision: https://reviews.freebsd.org/D5347

8 years agoRemove armv6 specific part from armv4 specific file and update comment.
skra [Mon, 22 Feb 2016 12:57:08 +0000 (12:57 +0000)]
Remove armv6 specific part from armv4 specific file and update comment.
No functional change.

8 years agoMove ARM_L2_PIPT option to std.armv6 for all armv6 platforms.
skra [Mon, 22 Feb 2016 11:47:28 +0000 (11:47 +0000)]
Move ARM_L2_PIPT option to std.armv6 for all armv6 platforms.
Only L2 PIPT cache is supported for __ARM_ARCH >= 6.

In fact, this is just a pure proclamation as this option is used
only in armv4 specific files now.

8 years agoAs <machine/vm.h> is included from <vm/vm.h>, there is no need to
skra [Mon, 22 Feb 2016 09:10:23 +0000 (09:10 +0000)]
As <machine/vm.h> is included from <vm/vm.h>, there is no need to
include it explicitly when <vm/vm.h> is already included.

Reviewed by: alc, kib
Differential Revision: https://reviews.freebsd.org/D5380

8 years agoAs <machine/vmparam.h> is included from <vm/vm_param.h>, there is no
skra [Mon, 22 Feb 2016 09:08:04 +0000 (09:08 +0000)]
As <machine/vmparam.h> is included from <vm/vm_param.h>, there is no
need to include it explicitly when <vm/vm_param.h> is already included.

Suggested by: alc
Reviewed by: alc
Differential Revision: https://reviews.freebsd.org/D5379

8 years agoAs <machine/param.h> is included from <sys/param.h>, there is no need
skra [Mon, 22 Feb 2016 09:04:36 +0000 (09:04 +0000)]
As <machine/param.h> is included from <sys/param.h>, there is no need
to include it explicitly when <sys/param.h> is already included.

Reviewed by: alc, kib
Differential Revision: https://reviews.freebsd.org/D5378

8 years agoAs <machine/pmap.h> is included from <vm/pmap.h>, there is no need to
skra [Mon, 22 Feb 2016 09:02:20 +0000 (09:02 +0000)]
As <machine/pmap.h> is included from <vm/pmap.h>, there is no need to
include it explicitly when <vm/pmap.h> is already included.

Reviewed by: alc, kib
Differential Revision: https://reviews.freebsd.org/D5373

8 years agohyperv/hn: Add TX method for txeof processing.
sephe [Mon, 22 Feb 2016 06:28:18 +0000 (06:28 +0000)]
hyperv/hn: Add TX method for txeof processing.

Preamble to implement ifnet.if_transmit method.

Reviewed by: adrian
Approved by: adrian (mentor)
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5346

8 years agohyperv/hn: Staticize and rename packet TX done function
sephe [Mon, 22 Feb 2016 06:22:47 +0000 (06:22 +0000)]
hyperv/hn: Staticize and rename packet TX done function

It is only used in hv_netvsc_drv_freebsd.c; and rename it to hn_tx_done()
mainly to reserve "xmit" for ifnet.if_transmit implement.

While I'm here, remove unapplied comment.

Reviewed by: adrian
Approved by: adrian (mentor)
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5345

8 years agohyperv/hn: Rename TX related function and struct fields a bit
sephe [Mon, 22 Feb 2016 06:17:26 +0000 (06:17 +0000)]
hyperv/hn: Rename TX related function and struct fields a bit

Preamble to implement the ifnet.if_transmit method.

Reviewed by: adrian
Approved by: adrian (mentor)
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5344

8 years agourtwn: shutdown the device properly
avos [Mon, 22 Feb 2016 01:15:02 +0000 (01:15 +0000)]
urtwn: shutdown the device properly

- R92C path: NetBSD (mostly)
- R88E path: TP-Link driver

Tested with RTL8188EU and RTL8188CUS.

Reviewed by: kevlo
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D5198

8 years agoifnet lock was changed to use sx(9) long time ago.
yongari [Mon, 22 Feb 2016 00:58:04 +0000 (00:58 +0000)]
ifnet lock was changed to use sx(9) long time ago.
Don't hold a driver lock for if_free(9).

8 years agourtwn: add an option to compile the driver without firmware specific code
avos [Mon, 22 Feb 2016 00:48:53 +0000 (00:48 +0000)]
urtwn: add an option to compile the driver without firmware specific code

- Add URTWN_WITHOUT_UCODE option (will disable any firmware specific code
when set).
- Do not exclude the driver from build when MK_SOURCELESS_UCODE is set
(URTWN_WITHOUT_UCODE will be enforced unconditionally).
- Do not abort initialization when firmware cannot be loaded;
behave like the URTWN_WITHOUT_UCODE option was set.
- Drop some unused variables from urtwn_softc structure.

Tested with RTL8188EU and RTL8188CUS in HOSTAP and STA modes.

Reviewed by: kevlo
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D4849

8 years agoMake efi_time and EFI_GetTimeOfDay static, neither are used by other parts
andrew [Sun, 21 Feb 2016 21:20:23 +0000 (21:20 +0000)]
Make efi_time and EFI_GetTimeOfDay static, neither are used by other parts
of the efi code.

Sponsored by: ABT Systems Ltd

8 years agosh: Don't hash alias name when there are no aliases.
jilles [Sun, 21 Feb 2016 20:58:24 +0000 (20:58 +0000)]
sh: Don't hash alias name when there are no aliases.

8 years agoDocument the ability to override compiled-in env and hints using variables
ian [Sun, 21 Feb 2016 18:58:05 +0000 (18:58 +0000)]
Document the ability to override compiled-in env and hints using variables
in the bootloader-provided env.

8 years agosh: Optimize setprompt(0).
jilles [Sun, 21 Feb 2016 18:54:17 +0000 (18:54 +0000)]
sh: Optimize setprompt(0).

Avoid doing work to print an empty prompt (such as when reading scripts).