]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFV r302003,r302037,r302038,r302056:
mm [Wed, 22 Jun 2016 07:49:59 +0000 (07:49 +0000)]
MFV r302003,r302037,r302038,r302056:

Update libarchive to 3.2.1 (bugfix and security fix release)

List of vendor fixes:
- fix exploitable heap overflow vulnerability in Rar decompression
  (vendor issue 719, CVE-2016-4302, TALOS-2016-0154)
- fix exploitable stack based buffer overflow vulnebarility in mtree
  parse_device functionality (vendor PR 715, CVE-2016-4301, TALOS-2016-0153)
- fix exploitable heap overflow vulnerability in 7-zip read_SubStreamsInfo
  (vendor issue 718, CVE-2016-4300, TALOS-2016-152)
- fix integer overflow when computing location of volume descriptor
  (vendor issue 717)
- fix buffer overflow when reading a crafred rar archive (vendor issue 521)
- fix possible buffer overflow when reading ISO9660 archives on machines
  where sizeof(int) < sizeof(size_t) (vendor issue 711)
- tar and cpio should fail if an input file named on the command line is
  missing (vendor issue 708)
- fix incorrect writing of gnutar filenames that are exactly 512 bytes
  long (vendor issue 682)
- allow tests to be run from paths that are equal or longer than 128
  characters (vendor issue 657)
- add memory allocation errors in archive_entry_xattr.c (vendor PR 603)
- remove dead code in archive_entry_xattr_add_entry() (vendor PR 716)
- fix broken decryption of ZIP files (vendor issue 553)
- manpage style, typo and description fixes

Post-3.2.1 vendor fixes:
- fix typo in cpio version reporting (Vendor PR 725, 726)
- fix argument range of ctype functions in libarchive_fe/passphrase.c
- fix ctype use and avoid empty loop bodies in WARC reader

MFC after: 1 week
Security: CVE-2016-4300, CVE-2016-4301, CVE-2016-4302
Approved by: re (kib)

7 years agoAccount for AIO socket operations in thread/process resource usage.
jhb [Tue, 21 Jun 2016 22:19:06 +0000 (22:19 +0000)]
Account for AIO socket operations in thread/process resource usage.

File and disk-backed I/O requests store counts of read/written disk
blocks in each AIO job so that they can be charged to the thread that
completes an AIO request via aio_return() or aio_waitcomplete().  This
change extends AIO jobs to store counts of received/sent messages and
updates socket backends to set these counts accordingly.  Note that
the socket backends are careful to only charge a single messages for
each AIO request even though a single request on a blocking socket might
invoke sosend or soreceive multiple times.  This is to mimic the
resource accounting of synchronous read/write.

Adjust the UNIX socketpair AIO test to verify that the message resource
usage counts update accordingly for aio_read and aio_write.

Approved by: re (hrs)
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D6911

7 years agoMETA_MODE: Don't generate or read _EXTRADEPEND dependencies when using filemon.
bdrewery [Tue, 21 Jun 2016 21:55:03 +0000 (21:55 +0000)]
META_MODE: Don't generate or read _EXTRADEPEND dependencies when using filemon.

The DPADD data in .depend will be redundant with what is in the .meta file.

Also extend NO_EXTRADEPEND support to bsd.prog.mk.

Approved by: re (blanket, META_MODE)
Sponsored by: EMC / Isilon Storage Division

7 years agoBump __FreeBSD_version to 1100118 for r302069, which breaks binary
ken [Tue, 21 Jun 2016 20:28:30 +0000 (20:28 +0000)]
Bump __FreeBSD_version to 1100118 for r302069, which breaks binary
compatibility for loadable modules that depend on struct disk.

Approved by: re (delphij)
Sponsored by: Spectra Logic

7 years agoFix a bug that caused da(4) instances to hang around after the underlying
ken [Tue, 21 Jun 2016 20:18:19 +0000 (20:18 +0000)]
Fix a bug that caused da(4) instances to hang around after the underlying
device is gone.

The problem was that when disk_gone() is called, if the GEOM disk
creation process has not yet happened, the withering process
couldn't start.

We didn't record any state in the GEOM disk code, and so the d_gone()
callback to the da(4) driver never happened.

The solution is to track the state of the creation process, and
initiate the withering process from g_disk_create() if the disk is
being created.

This change does add fields to struct disk, and so I have bumped
DISK_VERSION.

geom_disk.c: Track where we are in the disk creation process,
and check to see whether our underlying disk has
gone away or not.

In disk_gone(), set a new d_goneflag variable that
g_disk_create() can check to see if it needs to
clean up the disk instance.

geom_disk.h:    Add a mutex to struct disk (for internal use) disk
init level, and a gone flag.

Bump DISK_VERSION because the size of struct disk has
changed and fields have been added at the beginning.

Sponsored by: Spectra Logic
Approved by: re (marius)

7 years agoFix top-level builds with fmake / 9.x.
bdrewery [Tue, 21 Jun 2016 20:14:32 +0000 (20:14 +0000)]
Fix top-level builds with fmake / 9.x.

Reported by: allanjude
Approved by: re (marius)
Sponsored by: EMC / Isilon Storage Division

7 years agoRevert the recent armv6 changes to ALIGNED_POINTER(), restoring the
ian [Tue, 21 Jun 2016 17:53:42 +0000 (17:53 +0000)]
Revert the recent armv6 changes to ALIGNED_POINTER(), restoring the
fully-pessimized implementation that requires a type to be aligned to
its natural size.

On armv6+ the compiler might generate load-/store-multiple instructions
which require 4-byte alignment even though the source code is only
accessing individual uint32_t values in a way that doesn't require any
particular alignment at all.  The compiler apparently feels free to
combine multiple accesses into a single instruction that requires a
more-strict alignment, and no set of compiler flags seems to disable
this behavior (at least in clang 3.8).

This fixes alignment faults on arm systems using wifi adapters.  The
wifi code uses ALIGNED_POINTER(p, uint32_t) to decide whether it needs
to copy-align tcp headers.  Because clang is combining several uint32_t
accesses into a single ldm instruction, we need to say that accessing a
uint32_t requires 4-byte alignment.

Approved by: re(gjb)

7 years agoThe vmtotal sysctl handler marks active vm objects to calculate
kib [Tue, 21 Jun 2016 17:49:33 +0000 (17:49 +0000)]
The vmtotal sysctl handler marks active vm objects to calculate
statistics.  Marking is done by setting the OBJ_ACTIVE flag.  The
flags change is locked, but the problem is that many parts of system
assume that vm object initialization ensures that no other code could
change the object, and thus performed lockless.  The end result is
corrupted flags in vm objects, most visible is spurious OBJ_DEAD flag,
causing random hangs.

Avoid the active object marking, instead provide equally inexact but
immutable is_object_alive() definition for the object mapped state.

Avoid iterating over the processes mappings altogether by using
arguably improved definition of the paging thread as one which sleeps
on the v_free_count.

PR: 204764
Diagnosed by: pho
Tested by: pho (previous version)
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (gjb)

7 years ago[ath] fix TX throughput for EDMA chips by pushing more into the TX FIFO.
adrian [Tue, 21 Jun 2016 15:38:20 +0000 (15:38 +0000)]
[ath] fix TX throughput for EDMA chips by pushing more into the TX FIFO.

It turns out that getting decent performance requires stacking the TX
FIFO a little more aggressively.

* Ensure that when we complete a frame, we attempt to push a new frame
  into the FIFO so TX is kept as active as it needs to be
* Be more aggressive about batching non-aggregate frames into a single
  TX FIFO slot.  This "fixes" TDMA performance (since we only get one
  TX FIFO slot ungated per DMA beacon alert) but it does this by pushing
  a whole lot of work into the TX FIFO slot.

I'm not /entirely/ pleased by this solution, but it does fix a whole bunch
of corner case issues in the transmit side and fix TDMA whilst I'm at it.
I'll go revisit transmit packet scheduling in ath(4) post 11.

Tested:

* AR9380, STA mode
* AR9580, hostap mode
* AR9380, TDMA client mode

Approved by: re (hrs)

7 years agoFix uninitialized variable from r300881
asomers [Tue, 21 Jun 2016 15:27:16 +0000 (15:27 +0000)]
Fix uninitialized variable from r300881

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
Initialize needs_update in vdev_geom_set_physpath

PR: 210409
Reported by: kp
Reviewed by: kp
Approved by: re (hrs)
MFC after: 4 weeks
X-MFC-With: 300881
Sponsored by: Spectra Logic Corp

7 years agosyscons.4,vt.4: update kern.vty description reflecting vt as default
emaste [Tue, 21 Jun 2016 14:16:32 +0000 (14:16 +0000)]
syscons.4,vt.4: update kern.vty description reflecting vt as default

rS274085 made vt(4) the default system console. Catch up to this in
the man page description for the kern.vty tunable.

Reviewed by: bz
Approved by: re (hrs)
Differential Revision: https://reviews.freebsd.org/D6901

7 years agoGet closer to a VIMAGE network stack teardown from top to bottom rather
bz [Tue, 21 Jun 2016 13:48:49 +0000 (13:48 +0000)]
Get closer to a VIMAGE network stack teardown from top to bottom rather
than removing the network interfaces first. This change is rather larger
and convoluted as the ordering requirements cannot be separated.

Move the pfil(9) framework to SI_SUB_PROTO_PFIL, move Firewalls and
related modules to their own SI_SUB_PROTO_FIREWALL.
Move initialization of "physical" interfaces to SI_SUB_DRIVERS,
move virtual (cloned) interfaces to SI_SUB_PSEUDO.
Move Multicast to SI_SUB_PROTO_MC.

Re-work parts of multicast initialisation and teardown, not taking the
huge amount of memory into account if used as a module yet.

For interface teardown we try to do as many of them as we can on
SI_SUB_INIT_IF, but for some this makes no sense, e.g., when tunnelling
over a higher layer protocol such as IP. In that case the interface
has to go along (or before) the higher layer protocol is shutdown.

Kernel hhooks need to go last on teardown as they may be used at various
higher layers and we cannot remove them before we cleaned up the higher
layers.

For interface teardown there are multiple paths:
(a) a cloned interface is destroyed (inside a VIMAGE or in the base system),
(b) any interface is moved from a virtual network stack to a different
network stack ("vmove"), or (c) a virtual network stack is being shut down.
All code paths go through if_detach_internal() where we, depending on the
vmove flag or the vnet state, make a decision on how much to shut down;
in case we are destroying a VNET the individual protocol layers will
cleanup their own parts thus we cannot do so again for each interface as
we end up with, e.g., double-frees, destroying locks twice or acquiring
already destroyed locks.
When calling into protocol cleanups we equally have to tell them
whether they need to detach upper layer protocols ("ulp") or not
(e.g., in6_ifdetach()).

Provide or enahnce helper functions to do proper cleanup at a protocol
rather than at an interface level.

Approved by: re (hrs)
Obtained from: projects/vnet
Reviewed by: gnn, jhb
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D6747

7 years agoAdd two missing test files in r302037
mm [Tue, 21 Jun 2016 00:00:05 +0000 (00:00 +0000)]
Add two missing test files in r302037

7 years agoUpdate vendor/libarchive to git 139d0576b51a253732a5ab1f66805dffbf8b00af
mm [Mon, 20 Jun 2016 23:55:33 +0000 (23:55 +0000)]
Update vendor/libarchive to git 139d0576b51a253732a5ab1f66805dffbf8b00af
tag v3.2.1

Fixed vendor issues:
Issue 521: Properly check reading from lzss decompression buffer
Issue 717: Fix integer overflow when computing location of volume
           descriptor
Issue 718: Security fix TALOS-CAN-152
Issue 719: Security fix TALOS-CAN-154

Security: TALOS-CAN-152, TALOS-CAN-154

7 years agoSkip sys/acl tests on systems lacking perl
asomers [Mon, 20 Jun 2016 23:17:00 +0000 (23:17 +0000)]
Skip sys/acl tests on systems lacking perl

tests/sys/acl/Makefile
add perl to the required_programs for all tests in this directory

Reviewed by: ngie
Approved by: re (gjb)
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D6870

7 years agortwn: fix Tx processing, add some busdma synchronization.
avos [Mon, 20 Jun 2016 22:45:19 +0000 (22:45 +0000)]
rtwn: fix Tx processing, add some busdma synchronization.

1) Unload mbuf instead of descriptor in rtwn_tx_done().
2) Add more synchronization for device visible mappings before
touching the memory.
3) Improve watchdog timer logic.

Reported and tested by: mva

Approved by: re (gjb)

7 years agourtwn: fix panic on device detach.
avos [Mon, 20 Jun 2016 22:39:32 +0000 (22:39 +0000)]
urtwn: fix panic on device detach.

Remove frames from active/pending Tx queues and free related node
references when vap is destroyed to prevent various use-after-free
scenarios.

Reported and tested by: Aleksander Alekseev <afiskon@devzen.ru>
PR: 208632
Approved by: re (gjb)

7 years ago- No log bit in IOCStatus and endian-safe changes.
slm [Mon, 20 Jun 2016 18:14:51 +0000 (18:14 +0000)]
- No log bit in IOCStatus and endian-safe changes.

Use MPI2_IOCSTATUS_MASK when checking IOCStatus to mask off the log bit, and
make a few more things endian-safe.

- Fix possible use of invalid pointer.

It was possible to use an invalid pointer to get the target ID value. To fix
this, initialize a local Target ID variable to an invalid value and change that
variable to a valid value only if the pointer to the Target ID is not NULL.

- No need to set the MPSSAS_SHUTDOWN flag because it's never used.

- done_ccb pointer can be used if it is NULL.

To prevent this, move check for done_ccb == NULL to before done_ccb is used in
mpssas_stop_unit_done().

- Disks can go missing until a reboot is done in some cases.

This is due to the DevHandle not being released, which causes the Firmware to
not allow that disk to be re-added.

Reviewed by: ken
Approved by: re (gjb), ken, scottl, ambrisko (mentors)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D6872

7 years ago[ath] implement TX queue configuration extensions for the AR9380 HAL.
adrian [Mon, 20 Jun 2016 16:12:27 +0000 (16:12 +0000)]
[ath] implement TX queue configuration extensions for the AR9380 HAL.

Among other things, this introduces the idea of DBA-gated queues that
aren't the CABQ.  The TDMA support requires this.

Tested:

* AR9580 (hostap mode)
* AR9380 (sta mode)

Approved by: re (gjb)

7 years agoFix typo. Note that atomic is still required even for interlocked case.
kib [Mon, 20 Jun 2016 15:45:50 +0000 (15:45 +0000)]
Fix typo.  Note that atomic is still required even for interlocked case.

Sponsored by: The FreeBSD Foundation
Approved by: re (marius)

7 years agoFix generation of locales with multiple variants
bapt [Mon, 20 Jun 2016 06:45:42 +0000 (06:45 +0000)]
Fix generation of locales with multiple variants

Serbian locales have triple components to represent the 2 variations of the
locale: Latin and Cyrillic. Previously the tools generatic the locale were
appending both definitions instead of differentiating them.

Reported by: ache
Approved by: re (gjb)

7 years agoARM64: bsdinstall support for creating EFI partitions
wma [Mon, 20 Jun 2016 06:40:58 +0000 (06:40 +0000)]
ARM64: bsdinstall support for creating EFI partitions

    This patch enables bsdinstall to create EFI partition during installation and uploading it's contents,
    making the ARM64 FreeBSD installation bootable.

    Obtained from:         Semihalf
    Sponsored by:          Cavium
    Approved by:           re
    Reviewed by:           allanjude, emaste, nwhitehorn, wma
    Differential Revision: https://reviews.freebsd.org/D6853

7 years ago[ath] fix EDMA TX buffer flags for use when retransmitting frames.
adrian [Mon, 20 Jun 2016 02:04:40 +0000 (02:04 +0000)]
[ath] fix EDMA TX buffer flags for use when retransmitting frames.

This started showing up when doing lots of aggregate traffic. For TDMA it's
always no-ACK traffic and I didn't notice this, and I didn't notice it
when doing 11abg traffic as it didn't fail enough in a bad way to trigger
this.

This showed up as the fifo depth being < 0.

Eg:

Jun 19 09:23:07 gertrude kernel: ath0: ath_tx_edma_push_staging_list: queued 2 packets; depth=2, fifo depth=1
Jun 19 09:23:07 gertrude kernel: ath0: ath_edma_tx_processq: Q1, bf=0xfffffe000385f068, start=1, end=1
Jun 19 09:23:07 gertrude kernel: ath0: ath_edma_tx_processq: Q1: FIFO depth is now 0 (1)
Jun 19 09:23:07 gertrude kernel: ath0: ath_edma_tx_processq: Q1, bf=0xfffffe0003866fe8, start=0, end=1
Jun 19 09:23:07 gertrude kernel: ath0: ath_edma_tx_processq: Q1: FIFO depth is now -1 (0)

So, clear the flags before adding them to a TX queue, so if they're
re-added for the retransmit path it'll clear whatever they were and
not double-account the FIFOEND flag.  Oops.

Tested:

* AR9380, STA mode, 11n iperf testing (~130mbit)

Approved by: re (delphij)

7 years agoAdd Mike Karels as committer, with gnn as mentor.
karels [Sun, 19 Jun 2016 23:36:40 +0000 (23:36 +0000)]
Add Mike Karels as committer, with gnn as mentor.

Approved by: gnn (mentor)
Approved by: re

7 years agoRemote and local adv lock servers might de-synchronize (the added comment
kib [Sun, 19 Jun 2016 18:32:35 +0000 (18:32 +0000)]
Remote and local adv lock servers might de-synchronize (the added comment
explains the plausible scenario), resulting in EDEADLK returned on the
local registration attempt.  Handle this by re-trying the local op [1].

On unmount, local registration abort is indicated as EINTR, abort the nlm
call as well.

Reported and tested by: pho
Suggested and reviewed by: dfr (previous version, [1])
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (delphij)

7 years agoDo not access NFS data for reclaimed vnode.
kib [Sun, 19 Jun 2016 18:29:43 +0000 (18:29 +0000)]
Do not access NFS data for reclaimed vnode.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (delphij)

7 years ago[net80211] remove node scan lock / generation number + fix few LORs
adrian [Sun, 19 Jun 2016 07:31:02 +0000 (07:31 +0000)]
[net80211] remove node scan lock / generation number + fix few LORs

Drop scan generation number and node table scan lock - the only place
where ni_scangen is checked is in ieee80211_timeout_stations() (and it
is used to prevent duplicate checking of the same node); node scan lock
protects only this variable + node table scan generation number.

This will fix (at least) next LOR (hostap mode):

lock order reversal:
1st 0xc175f84c urtwm0_scan_loc (urtwm0_scan_loc) @ /usr/src/sys/modules/wlan/../../net80211/ieee80211_node.c:2019
2nd 0xc175e018 urtwm0_com_lock (urtwm0_com_lock) @ /usr/src/sys/modules/wlan/../../net80211/ieee80211_node.c:2693
stack backtrace:
#0 0xa070d1c5 at witness_debugger+0x75
#1 0xa070d0f6 at witness_checkorder+0xd46
#2 0xa0694cce at __mtx_lock_flags+0x9e
#3 0xb03ad9ef at ieee80211_node_leave+0x12f
#4 0xb03afd13 at ieee80211_timeout_stations+0x483
#5 0xb03aa1c2 at ieee80211_node_timeout+0x42
#6 0xa06c6fa1 at softclock_call_cc+0x1e1
#7 0xa06c7518 at softclock+0xc8
#8 0xa06789ae at intr_event_execute_handlers+0x8e
#9 0xa0678fa0 at ithread_loop+0x90
#10 0xa0675fbe at fork_exit+0x7e
#11 0xa08af910 at fork_trampoline+0x8

In addition to the above:

* switch to ieee80211_iterate_nodes();
* do not assert that node table lock is held, while calling node_age();
  that's not really needed (there are no resources, which can be protected
  by this lock) + this fixes LOR/deadlock between ieee80211_timeout_stations()
  and ieee80211_set_tim() (easy to reproduce in HOSTAP mode while
  sending something to an STA with enabled power management).

Tested:

* (avos) urtwn0, hostap mode
* (adrian) AR9380, STA mode
* (adrian) AR9380, AR9331, AR9580, hostap mode

Notes:

* This changes the net80211 internals, so you have to recompile all of it
  and the wifi drivers.

Submitted by: avos
Approved by: re (delphij)
Differential Revision: https://reviews.freebsd.org/D6833

7 years ago[ath] add support for batching frames to the general TX queues.
adrian [Sun, 19 Jun 2016 03:45:32 +0000 (03:45 +0000)]
[ath] add support for batching frames to the general TX queues.

It turns out the frame scheduling policies (eg DBA_GATED) operate on
a single TX FIFO entry.  ASAP scheduling is fine; those frames always
go out.

DBA-gated sets the TX queue ready when the DBA timer fires, which triggers
a beacon transmit.  Normally this is used for content-after-beacon queue
(CABQ) work, which needs to burst out immediately after a beacon.
(eg broadcast, multicast, etc frames.)  This is a general policy that you
can use for any queue, and Sam's TDMA code uses it.

When DBA_GATED is used and something like say, an 11e TX burst window,
it only operates on a single TX FIFO entry.  If you have a single frame
per TX FIFO entry and say, a 2.5ms long burst window (eg TDMA!) then it'll
only burst a single frame every 2.5ms.  If there's no gating (eg ASAP) then
the burst window is fine, and multiple TX FIFO slots get used.

The CABQ code does pack in a list of frames (ie, the whole cabq) but
up until this commit, the normal TX queues didn't.  It showed up when
I started to debug TDMA on the AR9380 and later.

This commit doesn't fix the TDMA case - that's still broken here, because
all I'm doing here is allowing 'some' frames to be bursting, but I'm
certainly not filling the whole TX FIFO slot entry with frames.
Doing that 'properly' kind of requires me to take into account how long
packets should take to transmit and say, doing 1.5 or something times that
per TX FIFO slot, as if you partially transmit a slot, when it's next
gated it'll just finish that TX FIFO slot, then not advance to the next
one.

Now, I /also/ think queuing a new packet restarts DMA, but you have to
push new frames into the TX FIFO.  I need to experiment some more with
this because if it's really the case, I will be able to do TDMA support
without the egregious hacks I have in my local tree.  Sam's TDMA code
for previous chips would just kick the TXE bit to push along DMA
again, but we can't do that for EDMA chips - we /have/ to push a new
frame into the TX FIFO to restart DMA.  Ugh.

Tested:

* AR9380, STA mode
* AR9380, hostap mode
* AR9580, hostap mode

Approved by: re (gjb)

7 years ago- Prefer to use %d over %e where the day of the month should be zero
ume [Sun, 19 Jun 2016 03:44:32 +0000 (03:44 +0000)]
- Prefer to use %d over %e where the day of the month should be zero
  filled.
- Since %e means the day of the month as well, regard %e as same as %d
  in md_order.

Reported by: vangyzen
Approved by: re (gjb)

7 years agoFix if_ntb interface setup to include IFF_MULTICAST.
vangyzen [Sat, 18 Jun 2016 23:18:04 +0000 (23:18 +0000)]
Fix if_ntb interface setup to include IFF_MULTICAST.

This allows IPv6 link local addresses (and other IPv6 functionality) to work.

PR: 210355
Submitted by: Steve Wahl and David Bright (both at Dell Inc.)
Reviewed by: cem, mav
Tested by: mav (on Intel hardware)
Approved by: re (kib)
MFC after: 5 days
Sponsored by: Dell Inc.
Differential Revision: https://reviews.freebsd.org/D6885

7 years agoAfter the vnode unlock, mount point might be destroyed immediately,
kib [Sat, 18 Jun 2016 20:22:53 +0000 (20:22 +0000)]
After the vnode unlock, mount point might be destroyed immediately,
dropping the reference on mnt_cred. Prevent this by referencing the
temporal credentials before unlock.

Tested by: pho
Reviewed by: dfr
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (gjb)

7 years agoFix gcc build.
kib [Sat, 18 Jun 2016 20:20:00 +0000 (20:20 +0000)]
Fix gcc build.

Reported andt tested by: swills
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)

7 years agoUpdate vendor/libarchive to git d85976e7ff4a062e1de6e04dab7bb78e3344768f
mm [Sat, 18 Jun 2016 08:25:31 +0000 (08:25 +0000)]
Update vendor/libarchive to git d85976e7ff4a062e1de6e04dab7bb78e3344768f

Fixed vendor issues:
Issue 553: Fix broken decryption for ZIP files
Issue 657: Allow up to 8k for the test root directory name
Issue 682: Correctly write gnutar filenames of exactly 512 bytes
Issue 708: tar should fail if a named input file is missing
PR 715: Fix libarchive/archive_read_support_format_mtree.c:1388:11:
        error: array subscript is above array bounds

7 years agovfs: ifdef out noop vop_* primitives on !DEBUG_VFS_LOCKS kernels
mjg [Fri, 17 Jun 2016 19:41:30 +0000 (19:41 +0000)]
vfs: ifdef out noop vop_* primitives on !DEBUG_VFS_LOCKS kernels

This removes calls to empty functions like vop_lock_{pre/post} from
common vfs routines.

Approved by: re (gjb)

7 years agomkimg: bump version to 20151211 after r292082
emaste [Fri, 17 Jun 2016 18:49:42 +0000 (18:49 +0000)]
mkimg: bump version to 20151211 after r292082

mkimg has had a number of functional additions after the last time the
version was incremented. Do so now, to r292082's commit date, so that
users can determine what is supported.

Reviewed by: marcel
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6882

7 years agopf: Filter on and set vlan PCP values
kp [Fri, 17 Jun 2016 18:21:55 +0000 (18:21 +0000)]
pf: Filter on and set vlan PCP values

Adopt the OpenBSD syntax for setting and filtering on VLAN PCP values. This
introduces two new keywords: 'set prio' to set the PCP value, and 'prio' to
filter on it.

Reviewed by:    allanjude, araujo
Approved by: re (gjb)
Obtained from:  OpenBSD (mostly)
Differential Revision:  https://reviews.freebsd.org/D6786

7 years agoUse vnlru_free(9) to implement dnlc_reduce_cache().
kib [Fri, 17 Jun 2016 17:34:28 +0000 (17:34 +0000)]
Use vnlru_free(9) to implement dnlc_reduce_cache().

This apparently puts ARC back under the limits after the vnode pressure
rework in r291244, in particular due to the kmem exhaustion.

Based on patch by: mckusick
Reviewed by: avg, mckusick
Tested by: allanjude, madpilot
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)

7 years agoAdd VFS interface to flush specified amount of free vnodes belonging
kib [Fri, 17 Jun 2016 17:33:25 +0000 (17:33 +0000)]
Add VFS interface to flush specified amount of free vnodes belonging
to mount points with the given filesystem type, specified by mount
vfs_ops pointer.

Based on patch by: mckusick
Reviewed by: avg, mckusick
Tested by: allanjude, madpilot
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)

7 years agoPrint a message when disks are found but no logical partition are
manu [Fri, 17 Jun 2016 17:09:22 +0000 (17:09 +0000)]
Print a message when disks are found but no logical partition are
reported by EFI implementation. This address comment on r301714.

Approved by: re (gjb), andrew (mentor)
Differential Revision: https://reviews.freebsd.org/D6787

7 years ago[ath] don't debug RX EDMA descriptors that are not yet complete.
adrian [Fri, 17 Jun 2016 17:01:32 +0000 (17:01 +0000)]
[ath] don't debug RX EDMA descriptors that are not yet complete.

Approved by: re@ (gjb)

7 years agoAdd clang-format under WITH_CLANG_EXTRAS.
bdrewery [Fri, 17 Jun 2016 16:46:58 +0000 (16:46 +0000)]
Add clang-format under WITH_CLANG_EXTRAS.

Reviewed by: dim
Approved by: re (gjb)
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6856

7 years agoImport ClangFormat.cpp from ^/vendor/clang/clang-release_380-r262564
bdrewery [Fri, 17 Jun 2016 16:44:31 +0000 (16:44 +0000)]
Import ClangFormat.cpp from ^/vendor/clang/clang-release_380-r262564

Discussed with: dim
Approved by: re (gjb)

7 years agoNote ipfilter support in blacklist-helper script in relnotes
lidl [Fri, 17 Jun 2016 16:34:25 +0000 (16:34 +0000)]
Note ipfilter support in blacklist-helper script in relnotes

Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

7 years agoUpdate 11.0 to -ALPHA4 in preparation of a new set of snapshot
gjb [Fri, 17 Jun 2016 00:00:45 +0000 (00:00 +0000)]
Update 11.0 to -ALPHA4 in preparation of a new set of snapshot
builds.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

7 years agoar: enable reproducible output by default when invoked as 'ar -s'
emaste [Thu, 16 Jun 2016 21:22:26 +0000 (21:22 +0000)]
ar: enable reproducible output by default when invoked as 'ar -s'

ar output is already deterministic by default for ar -q and ar -r, and
when invoked as ranlib. Make ar -s equivalent to ranlib and enable
deterministic output by default in that case too.

PR: 210330
Reviewed by: bdrewery
Approved by: re (gjb)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6871

7 years agoAdd bsdconfig `wifi' (aka `wireless' or `wlan') module
dteske [Thu, 16 Jun 2016 21:14:25 +0000 (21:14 +0000)]
Add bsdconfig `wifi' (aka `wireless' or `wlan') module

Approved by: re (gjb)
MFC after: 8 weeks
Relnotes: yes

7 years agosiba(4): Adopt bcma-compatible mapping of bhnd(4) port/region identifiers.
landonf [Thu, 16 Jun 2016 20:04:33 +0000 (20:04 +0000)]
siba(4): Adopt bcma-compatible mapping of bhnd(4) port/region identifiers.

Maps Sonics/OCP per-core address spaces to bcma(4)-compatible port/region
identifiers.

This permits the use of common address map identifiers in bhnd device
drivers, independent of the underlying interconnect type.

Approved by: re (gjb), adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D6850

7 years agobhnd(4): Fix resource allocation issues exposed by chipc PMU support.
landonf [Thu, 16 Jun 2016 19:57:24 +0000 (19:57 +0000)]
bhnd(4): Fix resource allocation issues exposed by chipc PMU support.

- Delete all chipc children on attachment failure.
- Added missing bhnd_nexus bhnd_bus_deactivate_resource implementation.
- Drop a CHIPC_UNLOCK() accidentally left behind after lifting
  synchronization into the chipc region refcounting API.
- Fix re-allocation of chipc resources. Previously, the resource ID was
  reset to -1 on release, preventing later re-allocation.

Approved by: re (gjb), adrian (mentor)
Differential Revision:  https://reviews.freebsd.org/D6849

7 years ago[iwm] free RX ring / NVM memory after they're used.
adrian [Thu, 16 Jun 2016 17:59:15 +0000 (17:59 +0000)]
[iwm] free RX ring / NVM memory after they're used.

* Free RX ring during detach
* Free NVM memory after parsing

Tested:

* 7260, STA mode

Submitted by: Imre Vadasz <imre@vdsz.com>
Approved by: re (gjb)
Obtained from: dragonflybsd
Differential Revision: https://reviews.freebsd.org/D6817

7 years agoAdd missing return statement.
hselasky [Thu, 16 Jun 2016 16:26:16 +0000 (16:26 +0000)]
Add missing return statement.

Approved by: re (gjb)
MFC after: 1 week

7 years agoAdd multiple missing descriptor parsing functions to the LibUSB v1.0 API.
hselasky [Thu, 16 Jun 2016 16:17:29 +0000 (16:17 +0000)]
Add multiple missing descriptor parsing functions to the LibUSB v1.0 API.

Approved by: re (kib)
Requested by: swills
MFC after: 1 week

7 years agoFix usr.sbin/rpcbind ATF tests on 32-bit platforms
asomers [Thu, 16 Jun 2016 15:25:37 +0000 (15:25 +0000)]
Fix usr.sbin/rpcbind ATF tests on 32-bit platforms

usr.sbin/rpcbind/tests/addrmerge_test.c
Fix some sizeof calculations that work only by luck on 64-bit
platforms.

PR: 210314
Reviewed by: ngie
Approved by: re (kib)
Reported by: Mark Millard
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D6855

7 years agoAdd support for libusb_set_auto_detach_kernel_driver() to the LibUSB v1.0 API.
hselasky [Thu, 16 Jun 2016 14:26:04 +0000 (14:26 +0000)]
Add support for libusb_set_auto_detach_kernel_driver() to the LibUSB v1.0 API.

Approved by: re (kostikbel)
Requested by: swills
MFC after: 1 week

7 years agoReimplement r301944 using the correct install(1) invocation, which again
gjb [Thu, 16 Jun 2016 13:34:20 +0000 (13:34 +0000)]
Reimplement r301944 using the correct install(1) invocation, which again
fixes packaging tzdata/zoneinfo.

Thank you to hrs for the pointer on what I did incorrectly.

Approved by: re (blanket, pkgbase)
Sponsored by: The FreeBSD Foundation

7 years agoAdd support for libusb_get_port_number() to the LibUSB v1.0 API.
hselasky [Thu, 16 Jun 2016 12:14:19 +0000 (12:14 +0000)]
Add support for libusb_get_port_number() to the LibUSB v1.0 API.

Approved by: re (kostikbel)
Requested by: swills
MFC after: 1 week

7 years agoReturn usual error indicator to shell.
kib [Thu, 16 Jun 2016 12:08:25 +0000 (12:08 +0000)]
Return usual error indicator to shell.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (hrs)

7 years agoAlways allow loading of cpuctl(4). When a CPU feature is not
kib [Thu, 16 Jun 2016 12:07:40 +0000 (12:07 +0000)]
Always allow loading of cpuctl(4).  When a CPU feature is not
supported, e.g. CPUID or MSR, return ENODEV from the ioctl which needs
that feature.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (hrs)

7 years agoUpdate comments for the MD functions managing contexts for new
kib [Thu, 16 Jun 2016 12:05:44 +0000 (12:05 +0000)]
Update comments for the MD functions managing contexts for new
threads, to make it less confusing and using modern kernel terms.

Rename the functions to reflect current use of the functions, instead
of the historic KSE conventions:
  cpu_set_fork_handler -> cpu_fork_kthread_handler (for kthreads)
  cpu_set_upcall -> cpu_copy_thread (for forks)
  cpu_set_upcall_kse -> cpu_set_upcall (for new threads creation)

Reviewed by: jhb (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (hrs)
Differential revision: https://reviews.freebsd.org/D6731

7 years agoRemove XXX comments from kern_thread.c. In one case, there is no
kib [Thu, 16 Jun 2016 12:01:11 +0000 (12:01 +0000)]
Remove XXX comments from kern_thread.c.  In one case, there is no
reason for it in modern times.  In the other case, expand the comment
stating instead of doubting.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (hrs)
X-Differential revision: https://reviews.freebsd.org/D6731

7 years agoRemove code duplication.
kib [Thu, 16 Jun 2016 11:58:46 +0000 (11:58 +0000)]
Remove code duplication.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (hrs)
X-Differential revision: https://reviews.freebsd.org/D6731

7 years agoRevert r301944, which apparently broke zoneinfo install during
gjb [Thu, 16 Jun 2016 11:55:24 +0000 (11:55 +0000)]
Revert r301944, which apparently broke zoneinfo install during
installworld (although I am not sure why).  I'll revisit this
change after I further understand the cause of the breakage.

Thanks to our secret canary (dhw) for the report.

Approved by: re (blanket, pkgbase)
Sponsored by: The FreeBSD Foundation

7 years agoDefine LIBUSB_API_VERSION.
hselasky [Thu, 16 Jun 2016 11:51:20 +0000 (11:51 +0000)]
Define LIBUSB_API_VERSION.

Approved by: re (kostikbel)
Requested by: swills
MFC after: 1 week

7 years agoImplement libusb_get_version() and update libusb manual page.
hselasky [Thu, 16 Jun 2016 07:48:21 +0000 (07:48 +0000)]
Implement libusb_get_version() and update libusb manual page.

Approved by: re (glebius)
Requested by: swills
MFC after: 1 week

7 years agofix a zfs boot regression introduced in r300117 by accident
avg [Thu, 16 Jun 2016 07:45:57 +0000 (07:45 +0000)]
fix a zfs boot regression introduced in r300117 by accident

There is no reason to return non-zero value from zfs_probe_partition()
as that causes following partitions to not be probed for ZFS vdevs.
A particular scenario that I encountered is a GPT partitioned disk
where several partitions have freebsd-zfs type.  A partition with a lower
index is used as a cache (l2arc) vdev and in that case case zfs_probe()
returned a non-zero status.  That status was returned to ptable_iterate()
and caused it to abort the iteration.  Because of that the subsequent
partitions were not probed and a root pool was not discovered resulting
in a boot failure.

While there fix the style for nearby return statements.

Approved by: re (kib)

7 years ago Bump /tmp from 30m to 50m for ARM release images.
manu [Thu, 16 Jun 2016 03:02:27 +0000 (03:02 +0000)]
 Bump /tmp from 30m to 50m for ARM release images.
 30m isn't enough for pkg anymore to extract packagesite.txz.
 40m is fine for now but let's take a safer way as we don't know when pkg will need more.

Reported by: many
Approved by: re (gjb), andrew (mentor)

7 years agoFix zoneinfo file packaging.
gjb [Thu, 16 Jun 2016 03:00:10 +0000 (03:00 +0000)]
Fix zoneinfo file packaging.

This change fixes 468 of 488 zoneinfo file packaging issues,
the rest still to be investigated.

Approved by: re (blanket, pkgbase)
Sponsored by: The FreeBSD Foundation

7 years agoMark targets with _SUBDIR as .PHONY.
bdrewery [Wed, 15 Jun 2016 23:58:09 +0000 (23:58 +0000)]
Mark targets with _SUBDIR as .PHONY.

This is mostly fixing META_MODE with realinstall wanting a .meta
file when it does not need one.  These targets really should
always run though since they have _SUBDIR on them.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoWITH_META_MODE: Whitelist 'make kernel' and 'make world'.
bdrewery [Wed, 15 Jun 2016 23:58:06 +0000 (23:58 +0000)]
WITH_META_MODE: Whitelist 'make kernel' and 'make world'.

installkernel is technically META_MODE safe but doesn't need an explicit
approval to use it since it's all disabled via .PHONY.

world uses 'make -B installworld' which already will disable META_MODE
via the -B (.MAKE.MODE=compat) usage.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoFix native powerpc64 build of lib32 with in-tree GCC.
bdrewery [Wed, 15 Jun 2016 23:58:03 +0000 (23:58 +0000)]
Fix native powerpc64 build of lib32 with in-tree GCC.

- This was broken by r300350 and r300885.
- Add some comments around the external GCC logic since it is spread out
  and in need of some cleanup.
- The problem was that X_COMPILER_TYPE is always defined from CC->XCC's
  default, so if /usr/bin/cc is GCC (as it is on native powerpc64) then
  X_COMPILER_TYPE was getting GCC and triggering the external logic in
  Makefile.libcompat.  It was intended to always provide -isystem with
  GCC since --sysroot is used into the lib32 sysroot which won't modify
  the header path without the -isystem.  The use of the libc++/std=c++11
  override was only intended to be used for external compilers though
  (more accurately GCC 4.8+ but that's a separate assumption to
  cleanup).  Apply the same logic from Makefile.inc1 to Makefile.libcompat
  to only add the libc++ override when needed for external compilers.

Pointyhat to: bdrewery
Tested with: native ppc64 (swills), universe, ppc64 xtoolchain,
amd64 xtoolchain, sparc64 cross-build of ppc64 (host GCC 4.2)
Reported by: andreast, swills
Approved by: re (gjb)
Sponsored by: EMC / Isilon Storage Division

7 years agotinderbox/universe: Only show arm64 warning if it was in the TARGETS list.
bdrewery [Wed, 15 Jun 2016 23:58:00 +0000 (23:58 +0000)]
tinderbox/universe: Only show arm64 warning if it was in the TARGETS list.

This was a flaw in my change in r287903 but also in the original change
in r282156 since it used empty(${TARGETS}) rather than empty(TARGETS).

Reported by: lidl
Approved by: re (gjb)
Sponsored by: EMC / Isilon Storage Division

7 years agoWITH_META_MODE: Keep .MAKE.MODE/META_MODE clean
bdrewery [Wed, 15 Jun 2016 23:57:57 +0000 (23:57 +0000)]
WITH_META_MODE: Keep .MAKE.MODE/META_MODE clean

Due to META_MODE being passed into the environment it tends
to keep growing with the defaults.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoWITH_META_MODE: Don't expect a .meta file for side-effect generated files.
bdrewery [Wed, 15 Jun 2016 23:57:53 +0000 (23:57 +0000)]
WITH_META_MODE: Don't expect a .meta file for side-effect generated files.

This is the same as r301285.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoWITH_META_MODE: Do include headers for specific guessed dependencies
bdrewery [Wed, 15 Jun 2016 23:57:50 +0000 (23:57 +0000)]
WITH_META_MODE: Do include headers for specific guessed dependencies

This is a follow-up to r300343.

This is important for the OBJS_DEPEND_GUESS usage in
gnu/usr.bin/cc/cc_tools.

See comments for more details.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoConvert to new FAST_DEPEND syntax for guessed dependencies.
bdrewery [Wed, 15 Jun 2016 23:57:46 +0000 (23:57 +0000)]
Convert to new FAST_DEPEND syntax for guessed dependencies.

This OBJS_DEPEND_GUESS is needed since each target gets its
own .depend.target.o file but also because it is spelled
.meta.target.o with WITH_META_MODE.  The OBJS_DEPEND_GUESS
will apply the dependency if the required file is missing.

Also remove redundant .c files while here to avoid prolems with
targets using .ALLSRC and getting multiple source files.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoDon't truncate OBJS_DEPEND_GUESS.target from Makefile
bdrewery [Wed, 15 Jun 2016 23:57:32 +0000 (23:57 +0000)]
Don't truncate OBJS_DEPEND_GUESS.target from Makefile

This is important to allow a Makefile to override OBJS_DEPEND_GUESS for
handling in META_MODE when its depend files are missing.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoUse sbused() instead of sbspace() to avoid signed issues.
jhb [Wed, 15 Jun 2016 21:08:51 +0000 (21:08 +0000)]
Use sbused() instead of sbspace() to avoid signed issues.

Inserting a full mbuf with an external cluster into the socket buffer
resulted in sbspace() returning -MLEN.  However, since sb_hiwat is
unsigned, the -MLEN value was converted to unsigned in comparisons.  As a
result, the socket buffer was never autosized.  Note that sb_lowat is signed
to permit direct comparisons with sbspace(), but sb_hiwat is unsigned.
Follow suit with what tcp_output() does and compare the value of sbused()
with sb_hiwat instead.

Approved by: re (gjb)
Sponsored by: Chelsio Communications

7 years agoAdd a tool to decode ioctl commands.
jhb [Wed, 15 Jun 2016 21:01:53 +0000 (21:01 +0000)]
Add a tool to decode ioctl commands.

One or more ioctl command values can be passed as arguments on the command
line.  For each value, the command is broken down into it's components
(direction, group, number, and length).  In addition, if a command has a
known name it is output via sysdecode_ioctlname().

Reviewed by: kib, emaste, avg
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D6851

7 years agoMove backend-specific fields of kaiocb into a union.
jhb [Wed, 15 Jun 2016 20:56:45 +0000 (20:56 +0000)]
Move backend-specific fields of kaiocb into a union.

This reduces the size of kaiocb slightly. I've also added some generic
fields that other backends can use in place of the BIO-specific fields.

Change the socket and Chelsio DDP backends to use 'backend3' instead of
abusing _aiocb_private.status directly. This confines the use of
_aiocb_private to the AIO internals in vfs_aio.c.

Reviewed by: kib (earlier version)
Approved by: re (gjb)
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D6547

7 years agoDo not assume that we own the use reference on the covered vnode until
kib [Wed, 15 Jun 2016 15:56:03 +0000 (15:56 +0000)]
Do not assume that we own the use reference on the covered vnode until
we set MNTK_UNMOUNT flag on the mp.  Otherwise parallel unmount which
wins race with us could dereference the covered vnode, and we are
left with the locked freed memory.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 1 week

7 years agoAnother follow-up to r291460. Only access vp->v_rdev for VCHR vnodes
kib [Wed, 15 Jun 2016 15:55:14 +0000 (15:55 +0000)]
Another follow-up to r291460. Only access vp->v_rdev for VCHR vnodes
in devfs_reclaim().

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 1 week

7 years agosdt: annotate the probe test as likely to fail
mjg [Wed, 15 Jun 2016 08:34:36 +0000 (08:34 +0000)]
sdt: annotate the probe test as likely to fail

This saves a jump in plenty of cases.

Approved by: re (kib)
MFC after: 1 week

7 years agometa_oodate: set needOODATE if oodate due to missing .meta file.
sjg [Tue, 14 Jun 2016 23:52:32 +0000 (23:52 +0000)]
meta_oodate: set needOODATE if oodate due to missing .meta file.

Reviewed by: bdrewery
Approved by: re

7 years agocxgbe/t4_tom: Fix inverted assertion in r300895. It is RDMA
np [Tue, 14 Jun 2016 21:09:00 +0000 (21:09 +0000)]
cxgbe/t4_tom:  Fix inverted assertion in r300895.  It is RDMA
connections and not others that are allowed to fail the receive window
check.

Approved by: re (gjb@)

7 years agoiw_cxgbe: Make sure that send_abort results in a TCP RST and not a FIN.
np [Tue, 14 Jun 2016 21:02:36 +0000 (21:02 +0000)]
iw_cxgbe: Make sure that send_abort results in a TCP RST and not a FIN.
Release the hold on ep->com immediately after sending the RST.  This
fixes a bug that sometimes leaves userspace iWARP tools hung when the
user presses ^C.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Approved by: re (gjb@)
Sponsored by: Chelsio Communications

7 years agoFix bug in iwcm that caused a panic in iw_cm_wq when krping is run
np [Tue, 14 Jun 2016 20:58:05 +0000 (20:58 +0000)]
Fix bug in iwcm that caused a panic in iw_cm_wq when krping is run
repeatedly in a tight loop.

Approved by: re (gjb@)
Obtained from: hselasky@ (part of larger changes in D5791)

7 years agoRenegerate for WITH_META_MODE updates.
bdrewery [Tue, 14 Jun 2016 18:41:18 +0000 (18:41 +0000)]
Renegerate for WITH_META_MODE updates.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoFix makeman showing dependency of DIRDEPS_BUILD->META_MODE.
bdrewery [Tue, 14 Jun 2016 18:37:33 +0000 (18:37 +0000)]
Fix makeman showing dependency of DIRDEPS_BUILD->META_MODE.

This broke in r301887 with the meta mode whitelist.  'make showconfig'
still needs WITH_META_MODE support.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoFix build from stable/10 with fmake.
bdrewery [Tue, 14 Jun 2016 17:23:22 +0000 (17:23 +0000)]
Fix build from stable/10 with fmake.

This was broken in r301888.

fmake does not look in share/mk by default and thus does not yet
have MK_META_MODE set with default.

Pointyhat to: bdrewery
Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoBump __FreeBSD_version for r301602.
bdrewery [Tue, 14 Jun 2016 17:15:36 +0000 (17:15 +0000)]
Bump __FreeBSD_version for r301602.

Reported by: ngie, Ben Lavery
PR: 210229
Approved by: re (gjb)

7 years agoDIRDEPS_BUILD: Update dependencies
bdrewery [Tue, 14 Jun 2016 16:55:05 +0000 (16:55 +0000)]
DIRDEPS_BUILD: Update dependencies

Approved by: re (gjb)
Sponsored by: EMC / Isilon Storage Division

7 years agoMove the arm call to intr_pic_init_secondary earlier in the secondary CPU
andrew [Tue, 14 Jun 2016 16:41:39 +0000 (16:41 +0000)]
Move the arm call to intr_pic_init_secondary earlier in the secondary CPU
initialisation. This ensures it will complete before signalling to the boot
CPU it has booted. This fixes a race with the GIC where the arm_gic_map may
not be populated before it is used to bind interrupts leading to some
interrupts becoming bound to no CPUs.

Approved by: re (kib)
Sponsored by: ABT Systems Ltd

7 years agoWITH_META_MODE: Enable printing of some of make's environment on error.
bdrewery [Tue, 14 Jun 2016 16:20:25 +0000 (16:20 +0000)]
WITH_META_MODE: Enable printing of some of make's environment on error.

This will print a set of variables from make on error using
MAKE_PRINT_VAR_ON_ERROR.  It is already enabled for the DIRDEPS_BUILD.
It may make sense to enable this in the non-meta mode as well once
people are more used to its more verbose error output.

This makes it much simpler to see which .meta file is used when a
command files so that it may be inspected for the build command.

Suggested by: sjg
Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoWITH_META_MODE: Lessen the filemon(4) requirement scope.
bdrewery [Tue, 14 Jun 2016 16:20:19 +0000 (16:20 +0000)]
WITH_META_MODE: Lessen the filemon(4) requirement scope.

- Move the sys.mk filemon requirement to bsd.init.mk as a warning.
  This is intended only to show when building directly in a subdirectory
  without filemon loaded.
- Move the error into Makefile and only apply it when building
  from the META_TGT_WHITELIST target list.

-DNO_FILEMON can be used to suppress both the warning and the error but
makes WITH_META_MODE less useful.  It will only compare build commands
in this mode rather than track all dependencies.

This fixes installing from a jail which doesn't need filemon in this
phase [1].

Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com> [1]
Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoWITH_META_MODE: Whitelist targets that are meta-mode-safe.
bdrewery [Tue, 14 Jun 2016 16:20:14 +0000 (16:20 +0000)]
WITH_META_MODE: Whitelist targets that are meta-mode-safe.

META_TGT_WHITELIST is added to define which build targets are safe for
meta mode.  See comments for more details.

This fixes 'make delete-old-libs' to properly show the interactive
prompt.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoWITH_META_MODE: Set MK_META_MODE=no with -B.
bdrewery [Tue, 14 Jun 2016 16:20:11 +0000 (16:20 +0000)]
WITH_META_MODE: Set MK_META_MODE=no with -B.

Using -B already sets .MAKE.MODE=compat but it was leaving
MK_META_MODE set which could still cause other MK_META_MODE==yes
checks to trigger.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoAdd more missing .PHONY
bdrewery [Tue, 14 Jun 2016 16:20:08 +0000 (16:20 +0000)]
Add more missing .PHONY

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoWITH_META_MODE: Fix rebuilding maketab outside of build-tools.
bdrewery [Tue, 14 Jun 2016 16:20:05 +0000 (16:20 +0000)]
WITH_META_MODE: Fix rebuilding maketab outside of build-tools.

The bsd.dep.mk yacc targets rely on only the .c file getting a .meta
file.  However the previous code here relying on only the .h file meant
that it would be generated with a .meta file.  r301285 made it so that
the .h file is never expected to get a .meta file.  To keep this
restriction in place add in an extra dependency on the .c file so that
it is generated at this time.  It's a hack but the best for the patterns
we have at the moment for handling build-tools and side-effect-generated
files.

Reported by: Mark Millard
Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoDefine targets in same order as .ORDER
bdrewery [Tue, 14 Jun 2016 16:19:59 +0000 (16:19 +0000)]
Define targets in same order as .ORDER

This is a NOP but is done for style and to reduce confusion.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoWITH_META_MODE: Fix rescue rebuilding build-tools.
bdrewery [Tue, 14 Jun 2016 16:19:54 +0000 (16:19 +0000)]
WITH_META_MODE: Fix rescue rebuilding build-tools.

This is the same issue as r297997.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoWITH_META_MODE: Fix bin/csh rebuilding tc.const.h
bdrewery [Tue, 14 Jun 2016 16:19:49 +0000 (16:19 +0000)]
WITH_META_MODE: Fix bin/csh rebuilding tc.const.h

This is the same issue as r297997, but was missed in it.

The WARNS value changes between 'build-tools' (MK_WARNS=no) and
'everything' resulting in a rebuild of this file.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division