]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoBuild the 32-bit ARM libstand and loader parts with -fPIC. Many of them are
andrew [Tue, 25 Jul 2017 10:41:34 +0000 (10:41 +0000)]
Build the 32-bit ARM libstand and loader parts with -fPIC. Many of them are
already built with this flag so libstand should also be build as such.
This will be needed when moving to lld as it refuses to link due to
incompatible relocations.

Sponsored by: DARPA, AFRL

6 years agoFix indent.
kib [Tue, 25 Jul 2017 09:48:33 +0000 (09:48 +0000)]
Fix indent.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

6 years agoReplace unnecessary _KERNEL by double-include protection.
dchagin [Tue, 25 Jul 2017 06:59:35 +0000 (06:59 +0000)]
Replace unnecessary _KERNEL by double-include protection.

MFC after: 2 week

6 years agoMark :reduction as an expected failure
ngie [Tue, 25 Jul 2017 03:56:42 +0000 (03:56 +0000)]
Mark :reduction as an expected failure

It fails with clang 5.0+.

PR: 220989
MFC after: 2 months
MFC with: r321369
Reported by: Jenkins

6 years agoConvert lib/msun/trig_test from TAP to ATF format
ngie [Tue, 25 Jul 2017 03:55:44 +0000 (03:55 +0000)]
Convert lib/msun/trig_test from TAP to ATF format

Only expose :accuracy and :reduction if !i386, similar to before,
but more holistically to avoid future -Wunused issue with the unused
functions.

MFC after: 1 month

6 years agoRaise WARNS to 1
ngie [Tue, 25 Jul 2017 03:54:35 +0000 (03:54 +0000)]
Raise WARNS to 1

This will enable warnings with the msun tests.

MFC after: 1 month

6 years agobsdgrep(1): Don't exit before processing every file
kevans [Tue, 25 Jul 2017 01:50:37 +0000 (01:50 +0000)]
bsdgrep(1): Don't exit before processing every file

Given an empty pattern (i.e. grep "" A B), bsdgrep(1) would previously exit()
with the appropriate exit code upon encountering an empty file. Likely intended
as an optimization, but this behavior is technically incorrect since an empty
pattern should match every line.

PR: 220924
Reviewed by: emaste, cem (earlier version), ngie
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D11698

6 years agoUnconditionally install etc/mtree/BSD.debug.dist again
ngie [Tue, 25 Jul 2017 00:28:23 +0000 (00:28 +0000)]
Unconditionally install etc/mtree/BSD.debug.dist again

r279248 unconditionally installed BSD.debug.dist for ease-of-developer-use.
Restore the previous behavior.

While here, add a comment to note that this is intentional to avoid accidental
future removal.

MFC after: 2 months
MFC with: r321444

6 years agocleandir: Fix ESTALE errors from parallel removals.
bdrewery [Tue, 25 Jul 2017 00:12:48 +0000 (00:12 +0000)]
cleandir: Fix ESTALE errors from parallel removals.

This fixes 'make cleandir' to use the same ordering as 'make cleanobj'.
Meaning that SUBDIR will be recursed before the current directory is
handled.  This avoids an 'rm -rf /usr/obj/usr/src/lib/libc' while
a child 'rm -rf /usr/obj/usr/src/lib/libc/tests' is being ran next,
or even removing the current directory and then recursing into a child
and using the 'missing OBJDIR' logic to remove files rather than the
directory.

The most ideal ordering here would be for 'cleanobj' and 'cleandir' to
simply remove the .OBJDIR and then not recurse at all.  This is only
safe if it is guaranteed that all children directories have no orphaned
files in their source checkout and are only using obj directories.  This
is usually safe from the top-level build targets and when using
WITH_AUTO_OBJ.  Improving the build for those cases is coming.

Reported by: cperciva, scottl
X-MFC-With: r321427
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoRemove ${MTREE} and leverage etc/mtree/Makefile instead with
ngie [Mon, 24 Jul 2017 23:57:43 +0000 (23:57 +0000)]
Remove ${MTREE} and leverage etc/mtree/Makefile instead with
"make distribution".

This also fixes the fact that BSD.debug.dist was being installed if/when
${MK_DEBUG_FILES} != "no" before this commit.

MFC after: 2 months

6 years agoNO_CLEAN: Utilize delete-old to remove old orphaned libraries/headers in WORLDTMP.
bdrewery [Mon, 24 Jul 2017 23:32:46 +0000 (23:32 +0000)]
NO_CLEAN: Utilize delete-old to remove old orphaned libraries/headers in WORLDTMP.

This prevents situations with -DNO_CLEAN from finding stale headers or
libraries in places that no longer exist or have moved.  It avoids
the need to remove all of WORLDTMP by reusing what we already know
is obsolete.

MFC after: 1 month
Sponsored by: Dell EMC Isilon

6 years agoThe .depend.obj cleanup hacks are only needed with -DNO_CLEAN.
bdrewery [Mon, 24 Jul 2017 23:32:43 +0000 (23:32 +0000)]
The .depend.obj cleanup hacks are only needed with -DNO_CLEAN.

Sponsored by: Dell EMC Isilon

6 years agoAllow disabling dependency tracking if DEPEND_CFLAGS is empty.
bdrewery [Mon, 24 Jul 2017 23:32:40 +0000 (23:32 +0000)]
Allow disabling dependency tracking if DEPEND_CFLAGS is empty.

This falls back on using the guesssed dependencies if so.
Also remove a pre-bmake check while here.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoSlightly simplify logic for which depend file is expected.
bdrewery [Mon, 24 Jul 2017 23:32:36 +0000 (23:32 +0000)]
Slightly simplify logic for which depend file is expected.

This is a NOP.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoMove llvm Options.inc hack from r321433 for NO_CLEAN to lib/clang/libllvm.
bdrewery [Mon, 24 Jul 2017 23:32:24 +0000 (23:32 +0000)]
Move llvm Options.inc hack from r321433 for NO_CLEAN to lib/clang/libllvm.

The files are only ever generated to .OBJDIR, not to WORLDTMP (as a
sysroot) and are only ever included from a compilation.  So using
a beforebuild target here removes the file before the compilation
tries to include it.

MFC after: 2 months
X-MFC-With: r321369

6 years agoFix style and wrap lines to 80 columns in savecore.c.
markj [Mon, 24 Jul 2017 21:51:41 +0000 (21:51 +0000)]
Fix style and wrap lines to 80 columns in savecore.c.

No functional change intended.

MFC after: 3 days

6 years agoar: handle partial writes from archive_write_data
emaste [Mon, 24 Jul 2017 21:25:49 +0000 (21:25 +0000)]
ar: handle partial writes from archive_write_data

libarchive may limit a single archive_write_data call to handling
0x7fffffff bytes. Add a loop to handle partial writes.

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

6 years agocxgbe(4): Display some more TOE parameters related to retransmission
np [Mon, 24 Jul 2017 19:17:13 +0000 (19:17 +0000)]
cxgbe(4): Display some more TOE parameters related to retransmission
and keepalive in the sysctl MIB.  Provide tunables to change some of
these parameters.  These are supposed to be setup by the firmware so
these tunables are for experimentation only.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

6 years agoAdd some .ORDER for distrib-dirs, distribute, distribution and distributeworld.
bdrewery [Mon, 24 Jul 2017 18:54:56 +0000 (18:54 +0000)]
Add some .ORDER for distrib-dirs, distribute, distribution and distributeworld.

Reported by: Mark Millard
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoCleanup stale Options.inc files from the previous libllvm build for
dim [Mon, 24 Jul 2017 18:52:46 +0000 (18:52 +0000)]
Cleanup stale Options.inc files from the previous libllvm build for
clang 4.0.0.  Otherwise, these can get included before the two newly
generated ones (which are different) for clang 5.0.0.

Reported by: Mark Millard
MFC after: 2 months
X-MFC-With: r321369

6 years agoUse __DEFAULT_DEPENDENT_OPTIONS for articulating dependency relationship
ngie [Mon, 24 Jul 2017 18:21:01 +0000 (18:21 +0000)]
Use __DEFAULT_DEPENDENT_OPTIONS for articulating dependency relationship
between MK_STALE_STAGED and MK_STAGING instead of using equivalent ad hoc
logic.

MFC after: 1 month

6 years agofix typo
imp [Mon, 24 Jul 2017 18:10:42 +0000 (18:10 +0000)]
fix typo

6 years agoPROGS: Fix ESTALE errors on NFS while cleaning in directories with PROGS.
bdrewery [Mon, 24 Jul 2017 17:54:03 +0000 (17:54 +0000)]
PROGS: Fix ESTALE errors on NFS while cleaning in directories with PROGS.

- Only recurse on cleanobj/cleandir if there is no .OBJDIR being used.
  If we don't recurse then bsd.obj.mk will just rm -rf the OBJDIR dir.
- When recursing on cleanobj/cleandir don't remove dependfiles/dirs
  redundantly from the child and main processes.  Meaning '.depend', and
  'tags', and '.depend.*' will now only be removed from the main
  process.
- Stop recursing on 'cleandepend' since the main process can handle
  removing all files via the default glob patterns in CLEANDEPENDFILES.
- This reverts r288201, by readding recursion on 'cleanobj', due to
  r291635 changing how bsd.subdir.mk handles recursion.

This is primarily targeting ESTALE NFS errors from rm(1) during a
buildworld but is also a performance optimization as both issues fixed
were redundant anyway.

Reported by: cperciva, scottl
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agocleanobj: Unhide removal of directory.
bdrewery [Mon, 24 Jul 2017 17:53:45 +0000 (17:53 +0000)]
cleanobj: Unhide removal of directory.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoFix whitespace on a line in fix(..) accidentally missed in r321424
ngie [Mon, 24 Jul 2017 17:29:56 +0000 (17:29 +0000)]
Fix whitespace on a line in fix(..) accidentally missed in r321424

MFC after: 1 month
MFC with: r321424

6 years agoStyle cleanup: delete spurious trailing whitespace
ngie [Mon, 24 Jul 2017 17:27:21 +0000 (17:27 +0000)]
Style cleanup: delete spurious trailing whitespace

MFC after: 1 month

6 years agoChange the interactions of the interface functions with the "meta" and
alc [Mon, 24 Jul 2017 17:23:53 +0000 (17:23 +0000)]
Change the interactions of the interface functions with the "meta" and
"leaf" functions for alloc, free, and fill.  After the change, the interface
functions call "meta" unconditionally, and the "meta" functions recur
unconditionally in looping over their descendants. The "meta" functions
start with a validity test, and then a test for the "leaf" case, before
falling into the general recursive case.  This simplifies and shrinks the
code, and, for "free" and "fill" moves panic tests that check the same meta
node repeatedly in a loop to a place that will have each node tested once.

Remove irrelevant null checks from blist_free and blist_fill.

Make the code that initializes a meta node the same in blist_meta_alloc and
blist_meta_fill.

Parenthesize return expressions in blst_meta_fill.

Submitted by: Doug Moore <dougm@rice.edu>
MFC after: 1 week

6 years agoImprove the ktrace(1) man page to make it slightly more obvious that there
trasz [Mon, 24 Jul 2017 16:58:54 +0000 (16:58 +0000)]
Improve the ktrace(1) man page to make it slightly more obvious that there
are _two_ options that control its behaviour wrt child processes; slightly
improve the example[1], and add Xrefs.

Discussed with: wblock [1]
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoAdd a few more object files to liblldb, which should solve errors when
dim [Mon, 24 Jul 2017 16:33:06 +0000 (16:33 +0000)]
Add a few more object files to liblldb, which should solve errors when
linking the lldb executable in some cases.  In particular, when the
-ffunction-sections -fdata-sections options are turned off, or
ineffective.

Reported by: Shawn Webb, Mark Millard
MFC after: 2 months
X-MFC-With: r308421

6 years agolld 5.0 supports filter libraries, so enable linker feature flag
emaste [Mon, 24 Jul 2017 15:39:09 +0000 (15:39 +0000)]
lld 5.0 supports filter libraries, so enable linker feature flag

Also switch the logic to enable this for any non-lld linker, since
filter library support is fairly simple and is very likely supported
by any other linker capable of linking the FreeBSD base system.

MFC after: 2 months
MFC with: r321369
Sponsored by: The FreeBSD Foundation

6 years agoImport bmake-20170720
sjg [Mon, 24 Jul 2017 04:38:05 +0000 (04:38 +0000)]
Import bmake-20170720

Includes fix for compat handling of interrupts.

6 years agohyperv/hn: Ignore LINK_SPEED_CHANGE status.
sephe [Mon, 24 Jul 2017 04:00:43 +0000 (04:00 +0000)]
hyperv/hn: Ignore LINK_SPEED_CHANGE status.

This status will be reported if the backend NIC is wireless; it's not
useful.  Due to the high frequency of the reporting, this could be
pretty annoying; ignore it.

MFC after: 3 days
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D11651

6 years agorndis: Add LINK_SPEED_CHANGE status
sephe [Mon, 24 Jul 2017 03:59:50 +0000 (03:59 +0000)]
rndis: Add LINK_SPEED_CHANGE status

Reviewed by: hselasky
MFC after: 3 days
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D11650

6 years agohyperv/hn: Export VF list and VF-HN mapping
sephe [Mon, 24 Jul 2017 03:52:32 +0000 (03:52 +0000)]
hyperv/hn: Export VF list and VF-HN mapping

The VF-HN map will be used later on to implement "transparent VF".

MFC after: 3 days
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D11618

6 years agoethernet: Add ethernet interface attached event and devctl notification.
sephe [Mon, 24 Jul 2017 03:32:10 +0000 (03:32 +0000)]
ethernet: Add ethernet interface attached event and devctl notification.

ifnet_arrival_event may not be adequate under certain situation; e.g.
when the LLADDR is needed.  So the ethernet ifattach event is announced
after all necessary bits are setup.

MFC after: 3 days
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D11617

6 years agonet80211: do not allow to unload rate control module if it is still in use.
avos [Sun, 23 Jul 2017 22:38:00 +0000 (22:38 +0000)]
net80211: do not allow to unload rate control module if it is still in use.

Keep 'nrefs' counter up-to-date, so 'kldunload wlan_amrr' with 1+ active
wlan(4) interface will not lead to kernel panic.

MFC after: 5 days

6 years agoAdd common code to support realtime clocks that store year without century.
ian [Sun, 23 Jul 2017 21:28:00 +0000 (21:28 +0000)]
Add common code to support realtime clocks that store year without century.

Most realtime clocks store the year as 2 BCD digits.  Some add a century bit
to extend the range another hundred years.  Every clock driver has its own
code to determine the century and pass a full year value to clock_ct_to_ts().
Now clock drivers can just convert BCD to bin and store the result in the
clocktime struct and let the common code figure out the century.  Clocks
with a century bit can just add 100 to year if the century bit is on.

6 years agoChange my email address to wulf@FreeBSD.org in copyright headers.
wulf [Sun, 23 Jul 2017 20:41:58 +0000 (20:41 +0000)]
Change my email address to wulf@FreeBSD.org in copyright headers.

Approved by: gonzo (mentor)
MFC after: 2 weeks

6 years agoevdev: Macroize common locking sequences
wulf [Sun, 23 Jul 2017 20:35:26 +0000 (20:35 +0000)]
evdev: Macroize common locking sequences

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks

6 years agoevdev: style(9), sort headers alphabetically
wulf [Sun, 23 Jul 2017 20:32:54 +0000 (20:32 +0000)]
evdev: style(9), sort headers alphabetically

Pointed out by: bde
Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks

6 years agoindent(1): better alignment of comments on code.
pstef [Sun, 23 Jul 2017 20:25:53 +0000 (20:25 +0000)]
indent(1): better alignment of comments on code.

If aligning the beginning of a comment to -cn would mean no space between
code and the comment, align it to the next tab stop.

6 years agoAddress a compilation warning on some architectures that was introduced
alc [Sun, 23 Jul 2017 19:35:14 +0000 (19:35 +0000)]
Address a compilation warning on some architectures that was introduced
by the previous change, r321386.

Reported by: ian
MFC after: 10 days
X-MFC after: r321386

6 years agoAdd myself (mw) as a src committer and cognet as my mentor.
mw [Sun, 23 Jul 2017 19:00:28 +0000 (19:00 +0000)]
Add myself (mw) as a src committer and cognet as my mentor.

Reviewed by: cognet (mentor)
Approved by: cognet (mentor)

6 years agocxgbe(4): Install the firmware bundled with the driver to the card if it
np [Sun, 23 Jul 2017 18:10:47 +0000 (18:10 +0000)]
cxgbe(4): Install the firmware bundled with the driver to the card if it
doesn't seem to have one.  This lets the driver recover automatically
from incomplete firmware upgrades (panic, reboot, power loss, etc. in
the middle of an upgrade).

MFC after: 2 weeks
Sponsored by: Chelsio Communications

6 years agoDon't use incorrect hardcoded path to ksh -- use /usr/bin/env
ngie [Sun, 23 Jul 2017 17:57:00 +0000 (17:57 +0000)]
Don't use incorrect hardcoded path to ksh -- use /usr/bin/env
to find ksh instead

MFC after: 1 month

6 years agoUtilize pmap_enter(..., psind=1) in vm_fault_soft_fast() on amd64. (The
alc [Sun, 23 Jul 2017 16:28:13 +0000 (16:28 +0000)]
Utilize pmap_enter(..., psind=1) in vm_fault_soft_fast() on amd64.  (The
Differential Revision discusses the benefits of this change.)

Add a function, vm_reserv_to_superpage(), that returns the superpage
containing the specified base page.

Reviewed by: kib, markj
Tested by: pho
MFC after: 10 days
Differential Revision: https://reviews.freebsd.org/D11556

6 years agoo Add support for eMMC HS200 and HS400 bus speed modes at 200 MHz to
marius [Sun, 23 Jul 2017 16:11:47 +0000 (16:11 +0000)]
o Add support for eMMC HS200 and HS400 bus speed modes at 200 MHz to
  sdhci(4), mmc(4) and mmcsd(4). For the most part, this consists of:
  - Correcting and extending the infrastructure for negotiating and
    enabling post-DDR52 modes already added as part of r315598. In
    fact, HS400ES now should work as well but hasn't been activated
    due to lack of corresponding hardware.
  - Adding support executing standard SDHCI initial tuning as well
    as re-tuning as required for eMMC HS200/HS400 and the fast UHS-I
    SD card modes. Currently, corresponding methods are only hooked
    up to the ACPI and PCI front-ends of sdhci(4), though. Moreover,
    sdhci(4) won't offer any modes requiring (re-)tuning to the MMC/SD
    layer in order to not break operations with other sdhci(4) front-
    ends. Likewise, sdhci(4) now no longer offers modes requiring the
    set_uhs_timing method introduced in r315598 to be implemented/
    hooked up (previously, this method was used with DDR52 only, which
    in turn is only available with Intel controllers so far, i. e. no
    such limitation was necessary before). Similarly for 1.2/1.8 V VCCQ
    support and the switch_vccq method.
  - Addition of locking to the IOCTL half of mmcsd(4) to prevent races
    with detachment and suspension, especially since it's required to
    immediately switch away from RPMB partitions again after an access
    to these (so re-tuning can take place anew, given that the current
    eMMC specification v5.1 doesn't allow tuning commands to be issued
    with a RPMB partition selected). Therefore, the existing part_mtx
    lock in the mmcsd(4) softc is additionally renamed to disk_mtx in
    order to denote that it only refers to the disk(9) half, likewise
    for corresponding macros.

  On the system where the addition of DDR52 support increased the read
  throughput to ~80 MB/s (from ~45 MB/s at high speed), HS200 yields
  ~154 MB/s and HS400 ~187 MB/s, i. e. performance now has more than
  quadrupled compared to pre-r315598.

  Also, with the advent of (re-)tuning support, most infrastructure
  necessary for SD card UHS-I modes up to SDR104 now is also in place.
  Note, though, that the standard SDHCI way of (re-)tuning is special
  in several ways, which also is why sending the actual tuning requests
  to the device is part of sdhci(4). SDHCI implementations not following
  the specification, MMC and non-SDHCI SD card controllers likely will
  use a generic implementation in the MMC/SD layer for executing tuning,
  which hasn't been written so far, though.

  However, in fact this isn't a feature-only change; there are boards
  based on Intel Bay Trail where DDR52 is problematic and the suggested
  workaround is to use HS200 mode instead. So far exact details are
  unknown, however, i. e. whether that's due to a defect in these SoCs
  or on the boards.

  Moreover, due to the above changes requiring to be aware of possible
  MMC siblings in the fast path of mmc(4), corresponding information
  now is cached in mmc_softc. As a side-effect, mmc_calculate_clock(),
  mmc_delete_cards(), mmc_discover_cards() and mmc_rescan_cards() now
  all are guaranteed to operate on the same set of devices as there no
  longer is any use of device_get_children(9), which can fail in low
  memory situations. Likewise, mmc_calculate_clock() now longer will
  trigger a panic due to the latter.

o Fix a bug in the failure reporting of mmcsd_delete(); in case of an
  error when the starting block of a previously stored erase request
  is used (in order to be able to erase a full erase sector worth of
  data), the starting block of the newly supplied bio_pblkno has to be
  returned for indicating no progress. Otherwise, upper layers might
  be told that a negative number of BIOs have been completed, leading
  to a panic.

o Fix 2 bugs on resume:
  - Things done in fork1(9) like the acquisition of an SX lock or the
    sleepable memory allocation are incompatible with a MTX_DEF taken.
    Thus, mmcsd_resume() must not call kproc_create(9), which in turn
    uses fork1(9), with the disk_mtx (formerly part_mtx) held.
  - In mmc_suspend(), the bus is powered down, which in the typical
    case of a device being selected at the time of suspension, causes
    the device deselection as part of the bus acquisition by mmc(4) in
    mmc_scan() to fail as the bus isn't powered up again before later
    in mmc_go_discovery(). Thus, power down with the bus acquired in
    mmc_suspend(), which will trigger the deselection up-front.

o Fix a memory leak in mmcsd_ioctl() in case copyin(9) fails. [1]

o Fix missing variable initialization in mmc_switch_status(). [2]

o Fix R1_SWITCH_ERROR detection in mmc_switch_status(). [3]

o Handle the case of device_add_child(9) failing, for example due to
  a memory shortage, gracefully in mmc(4) and sdhci(4), including not
  leaking memory for the instance variables in case of mmc(4) (which
  might or might not fix [4] as the latter problem has been discovered
  independently).

o Handle the case of an unknown SD CSD version in mmc_decode_csd_sd()
  gracefully instead of calling panic(9).

o Again, check and handle the return values of some additional function
  calls in mmc(4) instead of assuming that everything went right or mark
  non-fatal errors by casting the return value to void.

o Correct a typo in the Linux IOCTL compatibility; it should have been
  MMC_IOC_MULTI_CMD rather than MMC_IOC_CMD_MULTI.

o Now that we are reaching ever faster speeds (more improvement in this
  regard is to be expected when adding ADMA support to sdhci(4)), apply
  a few micro-optimizations like predicting mmc(4) and sdhci(4) debugging
  to be off or caching erase sector and maximum data sizes as well support
  of block addressing in mmsd(4) (instead of doing 2 indirections on every
  read/write request for determining the maximum data size for example).

Reported by: Coverity
CID: 1372612 [1], 1372624 [2], 1372594 [3], 1007069 [4]

6 years agoindent(1): rename the profile file.
pstef [Sun, 23 Jul 2017 15:07:52 +0000 (15:07 +0000)]
indent(1): rename the profile file.

Currently, indent's testing mechanism will attempt to apply options from
a file named ${test}.pro - and this test's filename is comments.0.

6 years agoindent(1): don't produce unnecessary blank lines.
pstef [Sun, 23 Jul 2017 14:33:04 +0000 (14:33 +0000)]
indent(1): don't produce unnecessary blank lines.

Don't force a blank line between an opening brace and a block comment -- not
even if -bbb (blank lines before block comments) is on.

6 years agoindent(1): don't produce unneeded space character in function declarators.
pstef [Sun, 23 Jul 2017 14:04:45 +0000 (14:04 +0000)]
indent(1): don't produce unneeded space character in function declarators.

6 years ago[ar933x] make carambola2 work again!
adrian [Sun, 23 Jul 2017 07:10:41 +0000 (07:10 +0000)]
[ar933x] make carambola2 work again!

* Add in the hints needed for AR933x ath(4) support - this is the nicer way
  that allows ath to be a module;
* ATH_EEPROM_FIRMWARE is also required for all AR933x chipsets.

Tested:

* Carambola2, AR933x

6 years ago[ar933x] re-add the ar71xx_apb device for AR933x.
adrian [Sun, 23 Jul 2017 07:02:10 +0000 (07:02 +0000)]
[ar933x] re-add the ar71xx_apb device for AR933x.

This prevents the console from working!

Tested:

* carambola2, AR933x

6 years agoAdd support for pmap_enter(..., psind=1) to the amd64 pmap. In other words,
alc [Sun, 23 Jul 2017 06:33:58 +0000 (06:33 +0000)]
Add support for pmap_enter(..., psind=1) to the amd64 pmap.  In other words,
add support for explicitly requesting that pmap_enter() create a 2MB page
mapping.  (Essentially, this feature allows the machine-independent layer to
create superpage mappings preemptively, and not wait for automatic promotion
to occur.)

Export pmap_ps_enabled() to the machine-independent layer.

Add a flag to pmap_pv_insert_pde() that specifies whether it should fail or
reclaim a PV entry when one is not available.

Refactor pmap_enter_pde() into two functions, one by the same name, that is
a general-purpose function for creating PDE PG_PS mappings, and another,
pmap_enter_2mpage(), that is used to prefault 2MB read- and/or execute-only
mappings for execve(2), mmap(2), and shmat(2).

Submitted by: Yufeng Zhou <yz70@rice.edu> (an earlier version)
Reviewed by: kib, markj
Tested by: pho
MFC after: 10 days
Differential Revision: https://reviews.freebsd.org/D11556

6 years agoIn vm_page_ps_test(), always check that the base pages within the specified
alc [Sun, 23 Jul 2017 05:54:56 +0000 (05:54 +0000)]
In vm_page_ps_test(), always check that the base pages within the specified
superpage all belong to the same object.  To date, that check has not been
needed, but upcoming changes require it.  (See the Differential Revision.)

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

6 years agolinuxkpi compiler.h: avoid gcc -Wunused-value in dummy expressions
rlibby [Sat, 22 Jul 2017 21:29:44 +0000 (21:29 +0000)]
linuxkpi compiler.h: avoid gcc -Wunused-value in dummy expressions

It looks like the __acquire and __release macros are for the consumption
of static analysis tools and have no semantic effect.  Transform the
definitions from constant expressions to empty statements in order to
avoid -Wunused-value from gcc.

Likewise avoid future warnings for __chk_{user,io}_ptr, but with a cast
to void, because it looks like some linux kernel code may use those in
expression contexts.

Reviewed by: hselasky, markj
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11695

6 years agoDo not allocate struct kinfo_vmobject on stack.
kib [Sat, 22 Jul 2017 13:33:06 +0000 (13:33 +0000)]
Do not allocate struct kinfo_vmobject on stack.

Its size is 1184 bytes.

Noted by: eugen
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoHandle WITH/WITHOUT_PF in libsysdecode
kp [Sat, 22 Jul 2017 12:51:19 +0000 (12:51 +0000)]
Handle WITH/WITHOUT_PF in libsysdecode

Only filter out the PF ioctls if we're building without pf support.
Until now those were always filtered out, so truss did not show symbolic
names for pf ioctls.

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

6 years agoUpgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
dim [Sat, 22 Jul 2017 11:08:25 +0000 (11:08 +0000)]
Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
5.0.0 (trunk r308421).  Upstream has branched for the 5.0.0 release,
which should be in about a month.  Please report bugs and regressions,
so we can get them into the release.

Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11
support to build; see UPDATING for more information.

MFC after: 2 months

6 years agoUse the "tree" word in ps(1) -d option description, to make it easier
trasz [Sat, 22 Jul 2017 10:38:44 +0000 (10:38 +0000)]
Use the "tree" word in ps(1) -d option description, to make it easier
to find.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoStyle(9) whitespace fix.
dchagin [Sat, 22 Jul 2017 09:03:40 +0000 (09:03 +0000)]
Style(9) whitespace fix.

MFC after: 1 week

6 years agoFix top(1) output when zfs.ko is loaded but ZFS is not in use.
markj [Fri, 21 Jul 2017 23:53:48 +0000 (23:53 +0000)]
Fix top(1) output when zfs.ko is loaded but ZFS is not in use.

Reviewed by: allanjude
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D11693

6 years agoMerge ^/head r321307 through r321350.
dim [Fri, 21 Jul 2017 18:54:34 +0000 (18:54 +0000)]
Merge ^/head r321307 through r321350.

6 years agoSet tentative merge dates, bump __FreeBSD_version.
dim [Fri, 21 Jul 2017 18:53:43 +0000 (18:53 +0000)]
Set tentative merge dates, bump __FreeBSD_version.

6 years agoImprove publication of the newly allocated snapdata.
kib [Fri, 21 Jul 2017 18:42:35 +0000 (18:42 +0000)]
Improve publication of the newly allocated snapdata.

For freshly allocated snapdata, Lock sn_lock in advance, so
si_snapdata readers see the locked snapdata and not race.

For existing snapdata, if the thread was put to sleep waiting for
sn_lock, re-read si_snapdata.  This either closes the race or makes
the reliance on LK_DRAIN less important.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

6 years agoUnlock correct lock in ffs_snapblkfree().
kib [Fri, 21 Jul 2017 18:36:17 +0000 (18:36 +0000)]
Unlock correct lock in ffs_snapblkfree().

It is possible for ffs_snapblkfree() to race and lock snaplock while
the devvp snapdata is instantiated, but no snapshots exist.  In this
case the loop over snapshots in ffs_snapblkfree() is not executed, and
the local variable vp is left initialized to NULL.

Unlock using &sn->sn_lock and not vp->v_vnlock.  For the inodes on the
snapshot list, the locks are same.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

6 years agoAccount for lock recursion when transfering snaplock to the vnode lock
kib [Fri, 21 Jul 2017 18:28:27 +0000 (18:28 +0000)]
Account for lock recursion when transfering snaplock to the vnode lock
in ffs_snapremove().

Apparently ffs_snapremove() may be called with the snap lock recursed,
at least one trace demonstrated this when snapshot vnode was unlinked
while synced.  It was inactivated from the syncer thread.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

6 years agoPull in r295886 from upstream clang trunk (by Richard Smith):
dim [Fri, 21 Jul 2017 17:59:54 +0000 (17:59 +0000)]
Pull in r295886 from upstream clang trunk (by Richard Smith):

  PR32034: Evaluate _Atomic(T) in-place when T is a class or array type.

  This is necessary in order for the evaluation of an _Atomic
  initializer for those types to have an associated object, which an
  initializer for class or array type needs.

This fixes an assertion when building recent versions of LinuxCNC.

Reported by: trasz
PR: 220883
MFC after: 1 week

6 years agoDo not update stats counter in SWI context. Defer to the already existing
sbruno [Fri, 21 Jul 2017 17:42:54 +0000 (17:42 +0000)]
Do not update stats counter in SWI context.  Defer to the already existing
admin thread.

Submitted by: Matt Macy <mmacy@mattmacy.io>
Sponsored by: Limelight Networks

6 years ago__pcpu: gcc -Wredundant-decls
rlibby [Fri, 21 Jul 2017 17:11:36 +0000 (17:11 +0000)]
__pcpu: gcc -Wredundant-decls

Pollution from counter.h made __pcpu visible in amd64/pmap.c.  Delete
the existing extern decl of __pcpu in amd64/pmap.c and avoid referring
to that symbol, instead accessing the pcpu region via PCPU_SET macros.
Also delete an unused extern decl of __pcpu from mp_x86.c.

Reviewed by: kib
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11666

6 years agoRespect INSTALL_AS_USER for FILES.
bdrewery [Fri, 21 Jul 2017 16:14:35 +0000 (16:14 +0000)]
Respect INSTALL_AS_USER for FILES.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoProperly set userid for truncate_test.
bdrewery [Fri, 21 Jul 2017 16:14:06 +0000 (16:14 +0000)]
Properly set userid for truncate_test.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

6 years agoImplement SIGEV_THREAD notifications for lio_listio(2)
asomers [Fri, 21 Jul 2017 15:09:24 +0000 (15:09 +0000)]
Implement SIGEV_THREAD notifications for lio_listio(2)

Our man pages have always indicated that this was supported, but in fact the
feature was never implemented for lio_listio(2).

Reviewed by: jhb, kib (earlier version)
MFC after: 20 days
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D11680

6 years agoAdd warning flags for GCC 7.1.0 compiler.
br [Fri, 21 Jul 2017 14:50:32 +0000 (14:50 +0000)]
Add warning flags for GCC 7.1.0 compiler.

Sponsored by: DARPA, AFRL

6 years agoFix style: change spaces to tabs.
br [Fri, 21 Jul 2017 14:14:47 +0000 (14:14 +0000)]
Fix style: change spaces to tabs.

Sponsored by: DARPA, AFRL

6 years agoMake truss(1) cross-reference dtrace(1) and bump .Dd.
trasz [Fri, 21 Jul 2017 13:58:51 +0000 (13:58 +0000)]
Make truss(1) cross-reference dtrace(1) and bump .Dd.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoUse more usual formatting for the EXAMPLES section of truss(1).
trasz [Fri, 21 Jul 2017 13:50:59 +0000 (13:50 +0000)]
Use more usual formatting for the EXAMPLES section of truss(1).

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoUse more usual formatting for the EXAMPLES section of ktrace(1).
trasz [Fri, 21 Jul 2017 13:27:25 +0000 (13:27 +0000)]
Use more usual formatting for the EXAMPLES section of ktrace(1).

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoRemove stack guard option from hardening menu.
robak [Fri, 21 Jul 2017 08:50:22 +0000 (08:50 +0000)]
Remove stack guard option from hardening menu.

Since kib's change the stack guard is now ON by default,
this option in hardening menu of bsdinstall is no longer needed.

Submitted by: Bartlomiej Rutkowski <robak@FreeBSD.org>
Reviewed by: bapt
Approved by: bapt
MFC after: 1 day
Sponsored by: Pixeware LTD
Differential Revision: https://reviews.freebsd.org/D11686

6 years agoFix getsockopt() for listening sockets when using SO_SNDBUF, SO_RCVBUF,
tuexen [Fri, 21 Jul 2017 07:44:43 +0000 (07:44 +0000)]
Fix getsockopt() for listening sockets when using SO_SNDBUF, SO_RCVBUF,
SO_SNDLOWAT, SO_RCVLOWAT. Since r31972 it only worked for non-listening
sockets.

Sponsored by: Netflix, Inc.

6 years agoRestore the changes done in r313982: Replace zero with NULL for pointers.
loos [Fri, 21 Jul 2017 03:59:56 +0000 (03:59 +0000)]
Restore the changes done in r313982: Replace zero with NULL for pointers.

Spotted by: Harry Schmalzbauer
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC (Netgate)

6 years agoCompile the atomic64 emulation for powerpcspe
jhibbits [Fri, 21 Jul 2017 03:48:09 +0000 (03:48 +0000)]
Compile the atomic64 emulation for powerpcspe

With this, ZFS builds for and runs (not quite stablely) on powerpcspe.

6 years agoUpdate netmap_user.h with the current version of netmap. This file should
loos [Fri, 21 Jul 2017 03:42:09 +0000 (03:42 +0000)]
Update netmap_user.h with the current version of netmap.  This file should
have been committed together with r319881.

MFC after: 1 week
MFC with: r319881
Pointy hat to: loos

6 years agoAdd cpufreq support for P1022 and MPC8536
jhibbits [Fri, 21 Jul 2017 03:40:05 +0000 (03:40 +0000)]
Add cpufreq support for P1022 and MPC8536

P1022 and MPC8536  include a 'jog' feature for clock control
(jog being a slower form of run mode).  This is done by changing the
PLL multiplier, and cannot be done if any core is in doze or sleep mode.

6 years agoDo not allow the use of the loopback interface in netmap.
loos [Fri, 21 Jul 2017 03:28:35 +0000 (03:28 +0000)]
Do not allow the use of the loopback interface in netmap.

The generic support in netmap send the packets using if_transmit() and the
loopback do not support packets coming from if_transmit()/if_start().

This avoids the use of the loopback interface and the subsequent crash that
happens when the application send packets to the loopback interface.

Details in: https://github.com/luigirizzo/netmap/issues/322
Reported by: Vincenzo Maffione <v.maffione@gmail.com>
Sponsored by: Rubicon Communications, LLC (Netgate)

6 years agoFix a couple of typos in a comment.
loos [Fri, 21 Jul 2017 03:04:55 +0000 (03:04 +0000)]
Fix a couple of typos in a comment.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC (Netgate)

6 years agoAdd regression test for recent regex(3) breakage
kevans [Fri, 21 Jul 2017 01:35:55 +0000 (01:35 +0000)]
Add regression test for recent regex(3) breakage

BREs recently became prematurely sensitive to the branching operator, which
outright broke expressions that used it instead of failing silently. Test
that \| is matching a literal | for the time being.

Reviewed by: cem, emaste, ngie
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D11577

6 years agor320062 introduced a bug when doing NFSv4.1 mounts against some non-FreeBSD servers.
rmacklem [Fri, 21 Jul 2017 00:14:43 +0000 (00:14 +0000)]
r320062 introduced a bug when doing NFSv4.1 mounts against some non-FreeBSD servers.

r320062 used nm_rsize, nm_wsize to set the maximum request/response sizes for
the NFSv4.1 session. If rsize,wsize are not specified as options, the
value of nm_rsize, nm_wsize is 0 at session creation, resulting in
values for request/response that are too small.
This patch fixes the problem. A workaround is to specify rsize=N,wsize=N
mount options explicitly, so they are set before session creation.
This bug only affects NFSv4.1 mounts against some non-FreeBSD servers.

MFC after: 1 week

6 years agoRevert r321308. I'll commit a better fix soon.
rmacklem [Thu, 20 Jul 2017 23:59:47 +0000 (23:59 +0000)]
Revert r321308. I'll commit a better fix soon.

6 years agor320062 introduced a bug when doing NFSv4.1 mounts against some non-FreeBSD servers.
rmacklem [Thu, 20 Jul 2017 23:15:50 +0000 (23:15 +0000)]
r320062 introduced a bug when doing NFSv4.1 mounts against some non-FreeBSD servers.

r320062 used nm_rsize, nm_wsize to set the maximum request/response sizes for
the NFSv4.1 session. If rsize,wsize are not specified as options, the
value of nm_rsize, nm_wsize is 0 at session creation, resulting in
values for request/response that are too small.
This patch fixes the problem. A workaround is to specify rsize=N,wsize=N
mount options explicitly, so they are set before session creation.
This bug only affects NFSv4.1 mounts against some non-FreeBSD servers.

MFC after: 1 week

6 years agoMerge ^/head r321239 through r321306.
dim [Thu, 20 Jul 2017 20:37:23 +0000 (20:37 +0000)]
Merge ^/head r321239 through r321306.

6 years agoFix printf format warning in iflib.c
dim [Thu, 20 Jul 2017 20:28:31 +0000 (20:28 +0000)]
Fix printf format warning in iflib.c

Clang 5.0.0 got better warnings about printf format strings using %zd,
and this leads to the following -Werror warning on e.g. arm:

    sys/net/iflib.c:1517:8: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'bus_size_t' (aka 'unsigned long') [-Werror,-Wformat]
                                              sctx->isc_tx_maxsize, nsegments, sctx->isc_tx_maxsegsize);
                                              ^~~~~~~~~~~~~~~~~~~~
    sys/net/iflib.c:1517:41: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'bus_size_t' (aka 'unsigned long') [-Werror,-Wformat]
                                              sctx->isc_tx_maxsize, nsegments, sctx->isc_tx_maxsegsize);
                                                                               ^~~~~~~~~~~~~~~~~~~~~~~

Fix this by casting bus_size_t arguments to uintmax_t, and using %ju
instead.

Reviewed by: emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D11679

6 years agoFix printf format warning in zfs_module.c
dim [Thu, 20 Jul 2017 20:27:19 +0000 (20:27 +0000)]
Fix printf format warning in zfs_module.c

Clang 5.0.0 got better warnings about print format strings using %zd,
and this leads to the following -Werror warning on e.g. arm:

    sys/boot/efi/boot1/zfs_module.c:186:18: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'off_t' (aka 'long long') [-Werror,-Wformat]
                        "(%lu)\n", st.st_size, spa->spa_name, filepath, EFI_ERROR_CODE(status));
                                   ^~~~~~~~~~

Fix this by casting off_t arguments to intmax_t, and using %jd instead.

Reviewed by: tsoome
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D11678

6 years agoadd arm64 objcopy output target for embedfs
emaste [Thu, 20 Jul 2017 18:22:49 +0000 (18:22 +0000)]
add arm64 objcopy output target for embedfs

PR: 220877
Submitted by: David NewHamlet
MFC after: 1 week

6 years agoAdd myself and mentor line to committers-src.dot.
mjoras [Thu, 20 Jul 2017 18:14:27 +0000 (18:14 +0000)]
Add myself and mentor line to committers-src.dot.

Approved by: rstone (mentor)
Differential Revision: https://reviews.freebsd.org/D11672

6 years agoacpidump: add GIC ITS srat type
emaste [Thu, 20 Jul 2017 17:36:17 +0000 (17:36 +0000)]
acpidump: add GIC ITS srat type

From ACPI 6.2, 5.2.16.5

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agoacpidump: add ACPI NFIT (NVDIMM Firmware Interface Table)
emaste [Thu, 20 Jul 2017 17:31:27 +0000 (17:31 +0000)]
acpidump: add ACPI NFIT (NVDIMM Firmware Interface Table)

Submitted by: Guangyuan Yang <yzgyyang@outlook.com>
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11479

6 years agoRemove some private symbols from librt
asomers [Thu, 20 Jul 2017 16:24:29 +0000 (16:24 +0000)]
Remove some private symbols from librt

Private functions like __aio_read and _aio_read were exposed in
FBSDprivate_1.0 by r169090, even though they've never been used outside of
librt. Also, remove some weak references from r156136 that have never
resolved.

Reviewed by: kib
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D11649

6 years agoacpidump: use C99 designated initializers
emaste [Thu, 20 Jul 2017 15:52:36 +0000 (15:52 +0000)]
acpidump: use C99 designated initializers

Submitted by: Guangyuan Yang <yzgyyang@outlook.com>
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11659

6 years agodate: avoid crash on invalid time
emaste [Thu, 20 Jul 2017 15:28:48 +0000 (15:28 +0000)]
date: avoid crash on invalid time

localtime(3) returns NULL when passed an invalid time_t but date(1)
previously did not handle it. Exit with an error in that case.

PR: 220828
Reported by: Vinícius Zavam
Reviewed by: cem, kevans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11660

6 years agoDeal with listening socket correctly.
tuexen [Thu, 20 Jul 2017 14:50:13 +0000 (14:50 +0000)]
Deal with listening socket correctly.