]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoEnsure that spinlock sections are balanced even after a panic.
Mark Johnston [Tue, 5 Jul 2016 17:59:04 +0000 (17:59 +0000)]
Ensure that spinlock sections are balanced even after a panic.

vpanic() uses spinlock_enter() to disable interrupts before dumping core.
However, when the scheduler is stopped and INVARIANTS is not configured,
thread_lock() does not acquire a spinlock section, while thread_unlock()
releases one. This can result in interrupts staying enabled while the
kernel dumps core, complicating post-mortem analysis of the crash.

Approved by: re (gjb)
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoCall audit hooks to capture vnode attributes for three file-descriptor
Robert Watson [Tue, 5 Jul 2016 16:37:01 +0000 (16:37 +0000)]
Call audit hooks to capture vnode attributes for three file-descriptor
method implementations: fstat(2), close(2), and poll(2).  This change
synchronises auditing here with similar auditing for VFS-specific system
calls such as stat(2) that audit more complete vnode information.

Sponsored by: DARPA, AFRL
Approved by: re (kib)
MFC after: 1 week

8 years agoadd description for debug.elf{32,64}_legacy_coredump sysctl
Ed Maste [Tue, 5 Jul 2016 14:46:06 +0000 (14:46 +0000)]
add description for debug.elf{32,64}_legacy_coredump sysctl

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

8 years agoClarify the vnode_destroy_vobject() logic handling for already terminated
Konstantin Belousov [Tue, 5 Jul 2016 11:21:02 +0000 (11:21 +0000)]
Clarify the vnode_destroy_vobject() logic handling for already terminated
objects.

Assert that there is no new waiters for the already terminated objects.
Old waiters should have been notified by the termination calling
vnode_pager_dealloc() (old/new are with regard of the lock acquisition
interval).

Only clear the vp->v_object for the case of already terminated object,
since other branches call vnode_pager_dealloc(), which should clear
the pointer.  Assert this.

Tested by: pho
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Approved by: re (gjb)

8 years agoFix a regression introduced on revision r271909, when using argument -g
Marcelo Araujo [Tue, 5 Jul 2016 07:01:42 +0000 (07:01 +0000)]
Fix a regression introduced on revision r271909, when using argument -g
or several hops we have segmentation fault because we overwrite the same
structure to store information for host and gateway.

Submitted by: Maryse Levavasseur <maryse.levavasseur@stormshield.eu>
Reworked by: hrs
Approved by: re (hrs)
Differential Revision: https://reviews.freebsd.org/D6980

8 years agoRemove SoC-specific integrations from dTSEC, to make it SoC agnostic.
Justin Hibbits [Tue, 5 Jul 2016 06:16:42 +0000 (06:16 +0000)]
Remove SoC-specific integrations from dTSEC, to make it SoC agnostic.

This will allow a single kernel to run on all SoCs supported by the dTSEC driver.

Approved by: re@(gjb)

8 years agoUnbreak the LBC driver, broken with the large RMan and 36-bit physical address changes.
Justin Hibbits [Tue, 5 Jul 2016 06:14:23 +0000 (06:14 +0000)]
Unbreak the LBC driver, broken with the large RMan and 36-bit physical address changes.

Remove the use of fdt_data_to_res(), and instead construct the resources
manually.  Additionally, avoid the 32-bit size limitation of fdt_data_get(), by
building physical addresses manually from the lbc ranges property.

Approved by: re@(gjb)

8 years agocxgbe(4): Changes to the CPL-handler registration mechanism and code
Navdeep Parhar [Tue, 5 Jul 2016 01:29:24 +0000 (01:29 +0000)]
cxgbe(4): Changes to the CPL-handler registration mechanism and code
related to "shared" CPLs.

a) Combine t4_set_tcb_field and t4_set_tcb_field_rpl into a single
function.  Allow callers to direct the response to any iq.  Tidy up
set_ulp_mode_iscsi while there to use names from t4_tcb.h instead of
magic constants.

b) Remove all CPL handler tables from struct adapter.  This reduces its
size by around 2KB.  All handlers are now registered at MOD_LOAD instead
of attach or some kind of initialization/activation.  The registration
functions do not need an adapter parameter any more.

c) Add per-iq handlers to deal with CPLs whose destination cannot be
determined solely from the opcode.  There are 2 such CPLs in use right
now: SET_TCB_RPL and L2T_WRITE_RPL.  The base driver continues to send
filter and L2T_WRITEs over the mgmtq and solicits the reply on fwq.
t4_tom (including the DDP code) now uses the port's ctrlq to send
L2T_WRITEs and SET_TCB_FIELDs and solicits the reply on an ofld_rxq.
fwq and ofld_rxq have different handlers that know what kind of tid to
expect in the reply.  Update t4_write_l2e and callers to to support any
wrq/iq combination.

Approved by: re@ (kib@)
Sponsored by: Chelsio Communications

8 years agoFix a race condition between the main thread in aqm_pie_cleanup() and the
Don Lewis [Tue, 5 Jul 2016 00:53:01 +0000 (00:53 +0000)]
Fix a race condition between the main thread in aqm_pie_cleanup() and the
callout thread that can cause a kernel panic.  Always do the final cleanup
in the callout thread by passing a separate callout function for that task
to callout_reset_sbt().

Protect the ref_count decrement in the callout with DN_BH_WLOCK().  All
other ref_count manipulation is protected with this lock.

There is still a tiny window between ref_count reaching zero and the end
of the callout function where it is unsafe to unload the module.  Fixing
this would require the use of callout_drain(), but this can't be done
because dummynet holds a mutex and callout_drain() might sleep.

Remove the callout_pending(), callout_active(), and callout_deactivate()
calls from calculate_drop_prob().  They are not needed because this callout
uses callout_init_mtx().

Submitted by: Rasool Al-Saadi <ralsaadi@swin.edu.au>
Approved by: re (gjb)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D6928

8 years agoFix build of ppp when WITHOUT_PAM is set
Baptiste Daroussin [Mon, 4 Jul 2016 21:18:57 +0000 (21:18 +0000)]
Fix build of ppp when WITHOUT_PAM is set

PR: 210658
Reported by: madpilot
Tested by: madpilot
Approved by: re@ (kib)

8 years agoFix interrupt loop when switching from USB device to USB host mode by
Hans Petter Selasky [Mon, 4 Jul 2016 17:12:22 +0000 (17:12 +0000)]
Fix interrupt loop when switching from USB device to USB host mode by
clearing all endpoint interrupt bits.

PR: 210736
Approved by: re (glebius)
MFC after: 1 week

8 years agoboot1.efi: fix assignment / comparison expression
Ed Maste [Mon, 4 Jul 2016 16:50:21 +0000 (16:50 +0000)]
boot1.efi: fix assignment / comparison expression

PR: 210706
Submitted by: David Binderman <dcb314@hotmail.com>
Approved by: re (kib)
MFC after: 1 week

8 years agoImport bhyve_graphics into CURRENT. Thanks to all who tested
Peter Grehan [Mon, 4 Jul 2016 03:19:06 +0000 (03:19 +0000)]
Import bhyve_graphics into CURRENT. Thanks to all who tested
this on the branch.

Original commit message:
  Initial bhyve native graphics support.

  This adds emulations for a raw framebuffer device, PS2 keyboard/mouse,
  XHCI USB controller and a USB tablet.

  A simple VNC server is provided for keyboard/mouse input, and graphics
  output.

  A VGA emulation is included, but is currently disconnected until an
  additional bhyve change to block out VGA memory is committed.

  Credits:
   - raw framebuffer, VNC server, XHCI controller, USB bus/device emulation
      and UEFI f/w support by Leon Dang
   - VGA, console/g, initial VNC server  by tychon@
   - PS2 keyboard/mouse jointly done by tychon@ and Leon Dang
   - hypervisor framebuffer mem support by neel@

  Tested by: Michael Dexter, in a number of revisions of this code.

  With the appropriate UEFI image, FreeBSD, Windows and Linux guests can
  installed and run in graphics mode using the UEFI/GOP framebuffer.

Approved by: re (gjb)

8 years agoAdd the forgotten "svn mv" from r302329
Baptiste Daroussin [Sun, 3 Jul 2016 19:31:21 +0000 (19:31 +0000)]
Add the forgotten "svn mv" from r302329

Reported by: Ivan Klymenko <fidaj@ukr.net>
Approved by: re (implicit)

8 years agoRemove ftp(1) related files when MK_FTP == no
Enji Cooper [Sun, 3 Jul 2016 18:27:00 +0000 (18:27 +0000)]
Remove ftp(1) related files when MK_FTP == no

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D6969
MFC after: 1 week
Reviewed by: ngie
Submitted by: rakuco
Sponsored by: EMC / Isilon Storage Division

8 years agoPosixify the locales name for variants
Baptiste Daroussin [Sun, 3 Jul 2016 18:21:11 +0000 (18:21 +0000)]
Posixify the locales name for variants

For all locales with variants:
- if no ambiguity on the locale (only one variant) just use the regular name
- if ambiguity, pick one as default and append @<variant> to the others
  respecting POSIX

As a result:
- All the 3 components locales added recently are renamed to the usual 2
  components version for all but sr_RS.UTF-8
- Set sr_RS.UTF-8 to the cyrillic variant
- Add sr_RS.UTF-8@latin
- Remove the symlinks aliases they were created to represent the 2 components
  version as aliasas and are now useless
- Update the OptionalObsoleteFiles.inc and ObsoleteFiles.inc to reflect those
  changes

Discussed with: ache@
Approved by: re@ (gjb)

8 years agoProvide helper macros to detect 'non-silent SBDRY' state and to
Konstantin Belousov [Sun, 3 Jul 2016 18:19:48 +0000 (18:19 +0000)]
Provide helper macros to detect 'non-silent SBDRY' state and to
calculate appropriate return value for stops.  Simplify the code by
using them.

Fix typo in sig_suspend_threads().  The thread which sleep must be
aborted is td2. (*)

In issignal(), when handling stopping signal for thread in
TD_SBDRY_INTR state, do not stop, this is wrong and fires assert.
This is yet another place where execution should be forced out of
SBDRY-protected region.  For such case, return -1 from issignal() and
translate it to corresponding error code in sleepq_catch_signals().
Assert that other consumers of cursig() are not affected by the new
return value. (*)

Micro-optimize, mostly VFS and VOP methods, by avoiding calling the
functions when SIGDEFERSTOP_NOP non-change is requested. (**)

Reported and tested by: pho (*)
Requested by: bde (**)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Approved by: re (gjb)

8 years agoFix .../usr.bin/lastcomm/legacy_test:main on i386
Enji Cooper [Sun, 3 Jul 2016 17:52:21 +0000 (17:52 +0000)]
Fix .../usr.bin/lastcomm/legacy_test:main on i386

The time in the output files was ahead by 3 hours on i386. Fix the incorrect
offset.

Differential Revision: https://reviews.freebsd.org/D7079 (as part of a larger diff)
MFC after: 1 week
PR: 210329
Reported by: asomers
Approved by: re (gjb)
Reviewed by: cem
Sponsored by: EMC / Isilon Storage Division

8 years agoOutput the diffs to standard error when comparing the expected vs the
Enji Cooper [Sun, 3 Jul 2016 17:51:24 +0000 (17:51 +0000)]
Output the diffs to standard error when comparing the expected vs the
obtained output from lastcomm instead of just printing out a summary, e.g.
"they differed".

This will make failures with results more apparent when running kyua debug,
kyua report-html, etc.

Differential Revision: https://reviews.freebsd.org/D7079 (as part of a larger diff)
MFC after: 1 week
Approved by: re (gjb)
Reviewed by: cem
Sponsored by: EMC / Isilon Storage Division

8 years agoFix race for incrementally rebuilding VERSION_MAP.
Bryan Drewery [Sun, 3 Jul 2016 17:28:39 +0000 (17:28 +0000)]
Fix race for incrementally rebuilding VERSION_MAP.

The dependency is needed in PROG_FULL since only the build of PROG_FULL
is using the LDFLAGS and depending on VERSION_MAP.  This was not a problem
with MK_DEBUG_FILES==no since it only builds PROG.

This should probably be using bsd.lib.mk instead [1]

Reported by: swills, gjb
Reviewed by: emaste
Noted by: rgrimes [1]
Sponsored by: EMC / Isilon Storage Division
Approved by: re (kib)

8 years agoFix a bad test resulting in a segfault with ISO-8859-5 locales
Baptiste Daroussin [Sun, 3 Jul 2016 15:00:12 +0000 (15:00 +0000)]
Fix a bad test resulting in a segfault with ISO-8859-5 locales

Reported by: Lauri Tirkkonen from Illumos
Approved by: re@ (gjb)

8 years agoRemove racy assert. The thread which changes vnode usecount from 0 to 1
Konstantin Belousov [Sun, 3 Jul 2016 01:56:48 +0000 (01:56 +0000)]
Remove racy assert. The thread which changes vnode usecount from 0 to 1
does it under the vnode interlock, but the interlock is not owned by the
asserting thread.  As result, we might read increased use counter but also
still see VI_OWEINACT.

In collaboration with: nwhitehorn
Hardware donated by: IBM LTC
Sponsored by: The FreeBSD Foundation (kib)
Approved by: re (gjb)

8 years agoUpdate libxo to 0.6.3
Enji Cooper [Sun, 3 Jul 2016 01:35:27 +0000 (01:35 +0000)]
Update libxo to 0.6.3

This fixes the 02 testcases on i386 (at least), and may fix the testcases
in general on 32-bit platforms

Differential Revision: https://reviews.freebsd.org/D7052
Approved by: phil (maintainer)
Approved by: re (gjb)
Reported by: asomers
Reviewed by: phil
Submitted by: phil
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd more machines to the bsdinstall workaround blacklist
Allan Jude [Sun, 3 Jul 2016 01:23:38 +0000 (01:23 +0000)]
Add more machines to the bsdinstall workaround blacklist

Apply the LenovoFix (fake partition in pMBR is 2nd rather than 1st)
and GPT Active fix (mark the fake pMBR partition active) to respective
hardware that is confirmed to require such to boot correct.

Submitted by: Sam Fourman Jr. <sfourman@gmail.com> (ThinkPad W520)
Submitted by: Matthias Apitz <guru@unixarea.de> (Latitude E6330)
Approved by: re (gjb)
Sponsored by: ScaleEngine Inc.

8 years agoFix an error in bsdinstall when ZFS installation uses a bootpool
Allan Jude [Sun, 3 Jul 2016 01:22:59 +0000 (01:22 +0000)]
Fix an error in bsdinstall when ZFS installation uses a bootpool

A separate bootpool is used when the selected partition type is MBR
or when the disk is GELI encrypted and a UEFI loader is selected.

BIOS avoids the bootpool by using bootcode and loader that support GELI.

bsdinstall did not remount the bootpool after creating the main pool,
which caused an error when mkdir tried to create /boot/zfs

PR: 210717
Approved by: re (gjb)
Sponsored by: ScaleEngine Inc.

8 years agoChange type of the 'dead' variable to boolean.
Konstantin Belousov [Sun, 3 Jul 2016 00:08:17 +0000 (00:08 +0000)]
Change type of the 'dead' variable to boolean.

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

8 years agoHide warning about non-existent lookup tables and informational messages
Andrey V. Elsukov [Sat, 2 Jul 2016 11:54:20 +0000 (11:54 +0000)]
Hide warning about non-existent lookup tables and informational messages
about modified table entry when quied mode enabled.

Approved by: re (hrs)
Obtained from: Yandex LLC

8 years agoUpdate libxo to 0.6.3
Enji Cooper [Sat, 2 Jul 2016 05:30:27 +0000 (05:30 +0000)]
Update libxo to 0.6.3

Obtained from: https://github.com/Juniper/libxo/tree/0.6.3
Sponsored by: EMC / Isilon Storage Division

8 years agocxgbe(4): Avoid a NULL dereference while dumping the L2 table. Entries
Navdeep Parhar [Fri, 1 Jul 2016 23:18:49 +0000 (23:18 +0000)]
cxgbe(4): Avoid a NULL dereference while dumping the L2 table.  Entries
used by switching filters that rewrite L2 information do not have any
associated ifnet.

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

8 years agoClean up some FDT-related code in the PowerPC bootloader, improving error
Nathan Whitehorn [Fri, 1 Jul 2016 21:09:30 +0000 (21:09 +0000)]
Clean up some FDT-related code in the PowerPC bootloader, improving error
checking and robustness. Prevents errors and crashes in FDT commands on
PowerMac G5 systems.

Approved by: re (gjb)

8 years agoDocument 300777, Add support for GPIO, Sensors and interrupts on AXP209 PMIC
Steven Kreuzer [Fri, 1 Jul 2016 20:25:59 +0000 (20:25 +0000)]
Document 300777, Add support for GPIO, Sensors and interrupts on AXP209 PMIC

Approved by: re (gjb, implicit, relnotes)

8 years agoDocument r299688, Add support for H3 SoC
Steven Kreuzer [Fri, 1 Jul 2016 20:19:02 +0000 (20:19 +0000)]
Document r299688, Add support for H3 SoC

Approved by: re (gjb, implicit, relnotes)

8 years agoDocument r263698, Add code for enabling second CPU core for A20 SoC.
Steven Kreuzer [Fri, 1 Jul 2016 20:16:35 +0000 (20:16 +0000)]
Document r263698, Add code for enabling second CPU core for A20 SoC.

Approved by: re (gjb, implicit, relnotes)

8 years agoWhen a process knote was attached to the process which is already exiting,
Konstantin Belousov [Fri, 1 Jul 2016 20:11:28 +0000 (20:11 +0000)]
When a process knote was attached to the process which is already exiting,
the knote is activated immediately.  If the exit1() later activates
knotes, such knote is attempted to be activated second time.  Detect
the condition by zeroed kn_ptr.p_proc pointer, and avoid excessive
activation.

Before r302235, such knotes were removed from the knlist immediately
upon activation.

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

8 years ago[net80211] teach AMRR to log the initial MCS rate as "MCS X"
Adrian Chadd [Fri, 1 Jul 2016 19:58:13 +0000 (19:58 +0000)]
[net80211] teach AMRR to log the initial MCS rate as "MCS X"

Otheriwse it logs it as the rate value, which is 0x80 (MCS flag) + MCS,
which isn't that helpful.

Approved by: re (gjb)

8 years agoFix detection of USB device disconnects in USB host mode when the USB
Hans Petter Selasky [Fri, 1 Jul 2016 07:27:33 +0000 (07:27 +0000)]
Fix detection of USB device disconnects in USB host mode when the USB
device is connected directly to the USB port of the DWC OTG, in this
case a RPI-zero.

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

8 years agoMFV r302260: expat 2.2.0
Xin LI [Fri, 1 Jul 2016 05:48:45 +0000 (05:48 +0000)]
MFV r302260: expat 2.2.0

Approved by: re (kib)

8 years agoUpdate 11.0 to ALPHA6.
Glen Barber [Fri, 1 Jul 2016 00:00:35 +0000 (00:00 +0000)]
Update 11.0 to ALPHA6.

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

8 years agoIn case of the global eventhandler make sure the current VNET
Bjoern A. Zeeb [Thu, 30 Jun 2016 19:32:45 +0000 (19:32 +0000)]
In case of the global eventhandler make sure the current VNET
is still operational before doing any work;  otherwise we might
run into, e.g., destroyed locks.

PR: 210724
Reported by: olevole olevole.ru
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Obtained from: projects/vnet
Approved by: re (gjb)

8 years agoVirtualise ipfilter.
Bjoern A. Zeeb [Thu, 30 Jun 2016 15:01:07 +0000 (15:01 +0000)]
Virtualise ipfilter.
Split initializzation an teardown into module (global state) and VNET
(per virtual network stack) parts.  Virtualise global state, which is
not "const".

Cleanup eventhandlers, so that we can make use of the passed in argument
to get the vnet state from the ifp;  disable the "cloner" event as it is
too early, has no state, and can fire before initialisation (see comment
in the source).

Handle the dynamic sysctls specially.  The problem is that "ipmain"
is the virtualized struct, but the fields used for the sysctls are
hanging off memory allocated and attached to the virtualized "ipmain"
thus standard VNET macros and sysctl handling do not work.
We still say it is VNET sysctls to get the proper protection checks
in the VIMAGE case;  to solve the problem of accessing the right bit
of memory hanging of each per-VNET ipmain, we use a dedicated handler
function wrapping around sysctl_ipf_int() undoing the base calculation
from kern_sysctl.c and then adding the passed-in offset into the right
struct depending on handler.  A bit of a mess exposing VNET-internals
this way but the only way to keep the code without having to massively
restructure ipf internals.

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

8 years agoRevert r299454 and r299448.
Alexander Motin [Thu, 30 Jun 2016 14:55:49 +0000 (14:55 +0000)]
Revert r299454 and r299448.

Those changes were found confusing FreeBSD libc ACL code, that doesn't
differentiate ACL for directories and files, and report ACLs for all
directories created after those patches as non-trivial.  On the other
side these changes were considered wrong from POSIX and NFSv4 points of
view.  Until further investigation done upstream, revert those changes
locally in preparation for FreeBSD 11.0 release.

Approved by: re (hrs)

8 years agoRemove dead code.
Cy Schubert [Thu, 30 Jun 2016 14:53:46 +0000 (14:53 +0000)]
Remove dead code.

Approved by: re@ (hrs@)
MFC after: 1 week

8 years agoMFV r302264:
Martin Matuska [Thu, 30 Jun 2016 08:51:50 +0000 (08:51 +0000)]
MFV r302264:

Sync libarchive with vendor, bugfixes for tests:
- fix tests on filesystems without birthtime support, e.g. UFS1 (1)
- vendor issue #729: avoid use of C99 for-scope declarations in
  test_write_format_gnutar_filenames.c

MFC after: 1 week
PR: 204157 (1)
Approved by: re (hrs)

8 years agoThis patch fixes two bugs related to the setting of the I-Bit
Michael Tuexen [Thu, 30 Jun 2016 06:06:35 +0000 (06:06 +0000)]
This patch fixes two bugs related to the setting of the I-Bit
for SCTP DATA and I-DATA chunks.
* For fragmented user messages, set the I-Bit only on the last
  fragment.
* When using explicit EOR mode, set the I-Bit on the last
  fragment, whenever SCTP_SACK_IMMEDIATELY was set in snd_flags
  for any of the send() calls.

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

8 years agoARM, ARM64: Workaround for buf_ring reordering
Wojciech Macek [Thu, 30 Jun 2016 05:18:37 +0000 (05:18 +0000)]
ARM, ARM64: Workaround for buf_ring reordering

    This patch offers a workaround to buf_ring reordering
    visible on armv7 and armv8. This is supposed to be
    removed once new buf_ring implementation is integrated
    into the tree.

    Obtained from:         Semihalf
    Reviewed by:           alc,emaste
    Differential Revision: https://reviews.freebsd.org/D6986
    Approved by:           re (gjb)

8 years agoARM64: fix DMAP calculation
Wojciech Macek [Thu, 30 Jun 2016 04:58:19 +0000 (04:58 +0000)]
ARM64: fix DMAP calculation

    Use arithmetic operators instead of logical. This fixes
    DMAP ranges calculation for ThunderX Dual Socket.

    Obtained from:         Semihalf
    Sponsored by:          Cavium
    Reviewed by:           zbb
    Differential Revision: https://reviews.freebsd.org/D7023
    Approved by:           re (gjb)

8 years agoMove the ipfw_log_bpf() calls from global module initialisation to
Bjoern A. Zeeb [Thu, 30 Jun 2016 01:33:14 +0000 (01:33 +0000)]
Move the ipfw_log_bpf() calls from global module initialisation to
per-VNET initialisation and virtualise the interface cloning to
allow a dedicated ipfw log interface per VNET.

Approved by: re (gjb)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

8 years agoRemove unused global variables as well as unused memory
Bjoern A. Zeeb [Thu, 30 Jun 2016 01:32:12 +0000 (01:32 +0000)]
Remove unused global variables as well as unused memory
allocations from ipfilter in preparation for VNET support.

Suggested by: cy (see D7000)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Approved by: re (gjb)

8 years agoEnable indirect segment I/Os by default in the Xen blkfront driver when
Colin Percival [Wed, 29 Jun 2016 23:56:24 +0000 (23:56 +0000)]
Enable indirect segment I/Os by default in the Xen blkfront driver when
running on EC2.  Due to improvements in EC2, the performance penalty which
was present on some EC2 instances no longer exists, and enabling this
feature now consistently yields ~20% higher throughput with equal or lower
latency.

Reverts: r286063
Approved by: re (gjb)
MFC after: 2 weeks
Relnotes: Improved disk throughput on EC2

8 years agoFixed FreeBSD/mips MALTA support for QEMU
Oleksandr Tymoshenko [Wed, 29 Jun 2016 23:33:44 +0000 (23:33 +0000)]
Fixed FreeBSD/mips MALTA support for QEMU

Recource management functions in GT PCI controller driver
treated memory/IO resources as KSEG1 addresses, later during
activation these values would be increased by KSEG1 base again
rendering the address invalid and causing "bus error" trap.

Actual logic was converted to use real physical addresses,
so mapping takes place only during activation.

Submitted by: Aleksandr Rybalko <ray@FreeBSD.org>
Approved by: re (gjb)

8 years agoFlush every line when using meta mode and no -j or with -B.
Bryan Drewery [Wed, 29 Jun 2016 22:54:01 +0000 (22:54 +0000)]
Flush every line when using meta mode and no -j or with -B.

Otherwise the output is buffered and it appears that make is stuck on something
long-running.  This problem is not present with -j as it uses different
code that was already flushing.

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

8 years agoWITH_META_MODE: Avoid false-positive error due to missing .meta with build commands.
Bryan Drewery [Wed, 29 Jun 2016 22:39:22 +0000 (22:39 +0000)]
WITH_META_MODE: Avoid false-positive error due to missing .meta with build commands.

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

8 years ago1.Improve handling around last compressed block of the file, which is
Maxim Sobolev [Wed, 29 Jun 2016 18:19:05 +0000 (18:19 +0000)]
1.Improve handling around last compressed block of the file, which is
  necessary because CLOOP format lacks explicit EOF or length, so that
  in the presence of padding or when the CLOOP is put onto a larger
  partition upper level provider size may be larger. Bound amount
  of extra data that we might touch to the max length of the compressed
  block and detect zero-padding in the last cluster, which when
  sector is all-zero might cause us to emit bogus I/O error after
  decompression of that fails. To not make code any more complicated
  that it needs to be deal with it in lazy-manner, i.e. when we
  first access that specific cluster.

  This change also fixes stupid mistake in the LZMA code, inherited
  from geom_lzma, which does not share length of the output buffer
  buffer with the decompression routine, so that in the presence
  of corrupted or purposedly tailored data may easily cause heap
  overflow and kernel memory corruption.

  Beef up validation of the CLOOP TOC by checking that lengths of
  all but the last compressed clusters match upper limit set by
  the decompressor and improve some error diagnostic output while
  I am here.

2.Add kern.geom.uzip.attach_to tunable to artifically limit
  attaching uzip to certain devices in the dev tree only.

    For example the following only makes us attaching to the
    GPT labels:

    kern.geom.uzip.attach_to="gpt/*"

3.Add kern.geom.uzip.noattach_to, which does opposite to the (2)
  above, i.e. prevents geom_uzip from tasting / attaching to
  providers matching some pattern. By default we don't attach
  to our own kind, i.e. kern.geom.uzip.noattach_to="*.uzip".
  It saves us quite some CPU cycles, esp on low-end embedded
  systems.

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7013

8 years agonet80211: fix LOR/deadlock in ieee80211_ff_node_cleanup().
Andriy Voskoboinyk [Wed, 29 Jun 2016 17:25:46 +0000 (17:25 +0000)]
net80211: fix LOR/deadlock in ieee80211_ff_node_cleanup().

Add new lock for stageq (part of ieee80211_superg structure) and
ni_tx_superg (part of ieee80211_node structure);
drop com_lock protection where it is used to protect them.

While here, drop duplicate OPACKETS counter incrementation.

ni_tx_ampdu is not protected with it (however, it is also used without
locking in other places; probably, it requires some other solution
to be thread-safe).

Tested with RTL8188CUS (AP) and RTL8188EU (STA).

NOTE: Since this change breaks KBI, all wireless drivers need to be
recompiled.

Reviewed by: adrian
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D6958

8 years agoDon't warn about needing filemon for makeman.
Bryan Drewery [Wed, 29 Jun 2016 16:45:01 +0000 (16:45 +0000)]
Don't warn about needing filemon for makeman.

r287879 wasn't quite enough here since Makefile.inc1 is running
'make -C release -V VERSION' and hitting the warning.

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

8 years agoCorrect PERSISTENT RESERVE OUT command and populate scsi_cmd->length.
Sean Bruno [Wed, 29 Jun 2016 16:41:37 +0000 (16:41 +0000)]
Correct PERSISTENT RESERVE OUT command and populate scsi_cmd->length.

PR: 202625
Submitted by: niakrisn@gmail.com
Reviewed by: scottl kenm
Approved by: re (gjb)
MFC after: 2 weeks

8 years agoFix fat-fingering: #if AIM should have been #ifdef AIM to avoid failures on
Nathan Whitehorn [Wed, 29 Jun 2016 16:34:56 +0000 (16:34 +0000)]
Fix fat-fingering: #if AIM should have been #ifdef AIM to avoid failures on
Book-E kernels.

Approved by: re (gjb)
Pointy hat to: nwhitehorn

8 years agoDo not rely on firmware having pre-enabled the MMU in a reasonable way for
Nathan Whitehorn [Wed, 29 Jun 2016 14:40:43 +0000 (14:40 +0000)]
Do not rely on firmware having pre-enabled the MMU in a reasonable way for
late boot: enable it explicitly after installing the page tables. If booting
from an FDT, also make sure to escape the firmware's MMU context early
before overwriting firmware page tables.

Approved by: re (gjb)

8 years agolibcxxrt: correct mangled "typeinfo name" symbols in Version.map
Ed Maste [Wed, 29 Jun 2016 11:48:42 +0000 (11:48 +0000)]
libcxxrt: correct mangled "typeinfo name" symbols in Version.map

r260553 added missing C++ typinfos to libcxxrt's version script.
It appears that a number of duplicate mangled symbols were added due to
a cut and paste error. Switch the second instances to _ZTS*,
typeinfo name for *.

Found by lld, which produces an error or warning for duplicate symbols.

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

8 years agoAllow ZFS ARC min / max to be tuned at runtime
Steven Hartland [Wed, 29 Jun 2016 07:55:45 +0000 (07:55 +0000)]
Allow ZFS ARC min / max to be tuned at runtime

Prior to this change ZFS ARC min / max could only be changed using
boot time tunables, this allows the values to be tuned at runtime
using the sysctls:
* vfs.zfs.arc_max
* vfs.zfs.arc_min

When adjusting ZFS ARC minimum the memory used  will only reduce
to the new minimum given memory pressure.

Reviewed by: allanjude
Approved by: re (gjb)
MFC after: 2 weeks
Relnotes: yes
Sponsored by: Multiplay
Differential Revision: https://reviews.freebsd.org/D5907

8 years agoUpdate vendor/libarchive to git 084ef320b8fc62e3fd3acb762fe6175d48d7829c
Martin Matuska [Wed, 29 Jun 2016 07:00:15 +0000 (07:00 +0000)]
Update vendor/libarchive to git 084ef320b8fc62e3fd3acb762fe6175d48d7829c

Vendor issues fixed:
#686: Correctly grow buffer in archive_string_append_from_wcs_in_codepage()
FreeBSD PR #204157: Fix test on filesystems without birthtime support

PR: 204157

8 years agocxgbe(4): Do not bring up an interface when IFCAP_TOE is enabled on it.
Navdeep Parhar [Wed, 29 Jun 2016 06:55:30 +0000 (06:55 +0000)]
cxgbe(4):  Do not bring up an interface when IFCAP_TOE is enabled on it.
The interface's queues are functional after VI_INIT_DONE (which is short
of interface-up) and that's all that's needed for t4_tom to communicate
with the chip.

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

8 years agoUSB: Add Garmin FR230 device quirk (broken INQUIRY)
Conrad Meyer [Wed, 29 Jun 2016 06:42:20 +0000 (06:42 +0000)]
USB: Add Garmin FR230 device quirk (broken INQUIRY)

PR: 210544
Reviewed by: hps
Approved by: re

8 years agoVendor import of expat 2.2.0 (trimmed).
Xin LI [Wed, 29 Jun 2016 06:24:30 +0000 (06:24 +0000)]
Vendor import of expat 2.2.0 (trimmed).

8 years agoSeveral device drivers call if_alloc() and then do further checks and
Bjoern A. Zeeb [Wed, 29 Jun 2016 05:21:25 +0000 (05:21 +0000)]
Several device drivers call if_alloc() and then do further checks and
will cal if_free() in case of conflict, error, ..
if_free() however sets the VNET instance from the ifp->if_vnet which
was not yet initialized but would only in if_attach(). Fix this by
setting the curvnet from where we allocate the interface in if_alloc().
if_attach() will later overwrite this as needed. We do not set the home_vnet
early on as we only want to prevent the if_free() panic but not change any
of the other housekeeping, e.g., triggered through ifioctl()s.

Reviewed by: brooks
Approved by: re (gjb)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7010

8 years agoWITH_SYSTEM_COMPILER: Avoid using GCC4.8+ logic on native GCC4.2 platforms.
Bryan Drewery [Wed, 29 Jun 2016 01:50:30 +0000 (01:50 +0000)]
WITH_SYSTEM_COMPILER: Avoid using GCC4.8+ logic on native GCC4.2 platforms.

As the XXX notes, these should really be checking MK_GNUCXX since there is
already a version check in share/mk/src.opts.mk to disable it.  Fixing that
here is more complex though.  This could also be using X_COMPILER_FEATURES
but uses X_COMPILER_VERSION to keep in sync with the src.opts.mk logic.

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

8 years agoDo not coredump if the packet is too long in the global (non-interface
Poul-Henning Kamp [Tue, 28 Jun 2016 20:10:30 +0000 (20:10 +0000)]
Do not coredump if the packet is too long in the global (non-interface
associated) instance.

The result is that the packet is dropped without an indication
that smaller MTU is advisable, which is not optimal, but better
than a NULL pointer deref.

Approved by: re (glebius)

8 years agoUse on crypto.x and rpc.x from the source tree.
Bryan Drewery [Tue, 28 Jun 2016 19:53:16 +0000 (19:53 +0000)]
Use on crypto.x and rpc.x from the source tree.

This fixes the build when DESTDIR may be blank or not yet populated.
It also fixes reproducibility.

Submitted by: brooks
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D6455

8 years agoRevert svn r302253 at the request/review of Ken M. This commit is
Sean Bruno [Tue, 28 Jun 2016 18:32:15 +0000 (18:32 +0000)]
Revert svn r302253 at the request/review of Ken M.  This commit is
incorrect.

PR: 202625
Approved by: re (implicit)

8 years agoCorrect PERSISTENT RESERVE OUT command and populate scsi_cmd->length.
Sean Bruno [Tue, 28 Jun 2016 18:08:47 +0000 (18:08 +0000)]
Correct PERSISTENT RESERVE OUT command and populate scsi_cmd->length.

PR: 202625
Submitted by: niakrisn@gmail.com
Reviewed by: scottl
Approved by: re (hrs)
MFC after: 2 weeks

8 years agoCurrently the ntptime code and resettodr() are Giant-locked. In
Konstantin Belousov [Tue, 28 Jun 2016 16:43:23 +0000 (16:43 +0000)]
Currently the ntptime code and resettodr() are Giant-locked. In
particular, the Giant is supposed to protect against parallel
ntp_adjtime(2) invocations.  But, for instance, sys_ntp_adjtime() does
copyout(9) under Giant and then examines time_status to return syscall
result.  Since copyout(9) could sleep, the syscall result might be
inconsistent.

Another and more important issue is that if PPS is configured,
hardpps(9) is executed without any protection against the parallel
top-level code invocation. Potentially, this may result in the
inconsistent state of the ntptime state variables, but I cannot say
how serious such distortion is. The non-functional splclock() call in
sys_ntp_adjtime() protected against clock interrupts calling hardpps()
in the pre-SMP era.

Modernize the locking. A mutex protects ntptime data.  Due to the
hardpps() KPI legitimately serving from the interrupt filters (and
e.g. uart(4) does call it from filter), the lock cannot be sleepable
mutex if PPS_SYNC is defined.  Otherwise, use normal sleepable mutex
to reduce interrupt latency.

Reviewed by:   imp, jhb
Sponsored by:   The FreeBSD Foundation
Approved by:   re (gjb)
Differential revision: https://reviews.freebsd.org/D6825

8 years agoDo not use Giant to prevent parallel calls to CLOCK_SETTIME(). Use
Konstantin Belousov [Tue, 28 Jun 2016 16:42:40 +0000 (16:42 +0000)]
Do not use Giant to prevent parallel calls to CLOCK_SETTIME().  Use
private mtx in resettodr(), no implementation of CLOCK_SETTIME() is
allowed to sleep.

Reviewed by:   imp, jhb
Sponsored by:   The FreeBSD Foundation
Approved by:   re (gjb)
X-Differential revision: https://reviews.freebsd.org/D6825

8 years agoComplete r302215. TDF_SBDRY | TDF_SERESTART and TDF_SBDRY |
Konstantin Belousov [Tue, 28 Jun 2016 16:41:50 +0000 (16:41 +0000)]
Complete r302215.  TDF_SBDRY | TDF_SERESTART and TDF_SBDRY |
TDF_SEINTR flags values, unlike TDF_SBDRY, must be treated almost as
if TDF_SBDRY is not set for STOP signal delivery.  The only difference
is that sig_suspend_threads() should abort the sleep instead of doing
immediate suspension.

Reported by: ngie
Sponsored by: The FreeBSD Foundation
MFC after: 12 days
Approved by: re (gjb)

8 years agoRegenerate for WITH_EXTRA_TCP_STACKS updates.
Jonathan T. Looney [Tue, 28 Jun 2016 13:42:50 +0000 (13:42 +0000)]
Regenerate for WITH_EXTRA_TCP_STACKS updates.

Approved by: re (gjb)
Sponsored by: Juniper Networks

8 years agoDocument support for alternate TCP stacks.
Jonathan T. Looney [Tue, 28 Jun 2016 13:37:01 +0000 (13:37 +0000)]
Document support for alternate TCP stacks.

Differential Revision: https://reviews.freebsd.org/D6940
Reviewed by: hiren
Approved by: re (gjb)
Sponsored by: Juniper Networks

8 years agoThis commit addresses regression introduceded in r302177
Cy Schubert [Tue, 28 Jun 2016 07:47:42 +0000 (07:47 +0000)]
This commit addresses regression introduceded in r302177
(WITH_SYSTEM_COMPILER: Enable by default) and it's prerequisite: r300354,
caused i386 builds to fail when cross-built on an amd64 host.

Reviewed by: bdrewery, delphij, gjb
Approved by: re (gjb)

8 years agoFix userspace build after r302235: do not expose bool field of the
Konstantin Belousov [Mon, 27 Jun 2016 23:34:53 +0000 (23:34 +0000)]
Fix userspace build after r302235: do not expose bool field of the
structure, change it to int.

The real fix is to sanitize user-visible definitions in sys/event.h,
e.g. the affected struct knlist is of no use for userspace programs.

Reported and tested by: jkim
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Approved by: re (gjb)

8 years agoIf the vm_fault() handler raced with the vm_object_collapse()
Konstantin Belousov [Mon, 27 Jun 2016 21:54:19 +0000 (21:54 +0000)]
If the vm_fault() handler raced with the vm_object_collapse()
sleepable scan, iteration over the shadow chain looking for a page
could find an OBJ_DEAD object.  Such state of the mapping is only
transient, the dead object will be terminated and removed from the
chain shortly.  We must not return KERN_PROTECTION_FAILURE unless the
object type is changed to OBJT_DEAD in the chain, indicating that
paging on this address is really impossible.  Returning
KERN_PROTECTION_FAILURE prematurely causes spurious SIGSEGV delivered
to processes, or kernel accesses to UVA spuriously failing with
EFAULT.

If the object with OBJ_DEAD flag is found, only return
KERN_PROTECTION_FAILURE when object type is already OBJT_DEAD.
Otherwise, sleep a tick and retry the fault handling.

Ideally, we would wait until the OBJ_DEAD flag is resolved, e.g. by
waiting until the paging on this object is finished.  But to do so, we
need to reference the dead object, while vm_object_collapse() insists
on owning the final reference on the collapsed object.  This could be
fixed by e.g. changing the assert to shared reference release between
vm_fault() and vm_object_collapse(), but it seems to be too much
complications for rare boundary condition.

PR: 204426
Tested by:    pho
Reviewed by:  alc
Sponsored by: The FreeBSD Foundation
X-Differential revision: https://reviews.freebsd.org/D6085
MFC after: 2 weeks
Approved by: re (gjb)

8 years agoWhen filt_proc() removes event from the knlist due to the process
Konstantin Belousov [Mon, 27 Jun 2016 21:52:17 +0000 (21:52 +0000)]
When filt_proc() removes event from the knlist due to the process
exiting (NOTE_EXIT->knlist_remove_inevent()), two things happen:
- knote kn_knlist pointer is reset
- INFLUX knote is removed from the process knlist.
And, there are two consequences:
- KN_LIST_UNLOCK() on such knote is nop
- there is nothing which would block exit1() from processing past the
  knlist_destroy() (and knlist_destroy() resets knlist lock pointers).
Both consequences result either in leaked process lock, or
dereferencing NULL function pointers for locking.

Handle this by stopping embedding the process knlist into struct proc.
Instead, the knlist is allocated together with struct proc, but marked
as autodestroy on the zombie reap, by knlist_detach() function.  The
knlist is freed when last kevent is removed from the list, in
particular, at the zombie reap time if the list is empty.  As result,
the knlist_remove_inevent() is no longer needed and removed.

Other changes:

In filt_procattach(), clear NOTE_EXEC and NOTE_FORK desired events
from kn_sfflags for knote registered by kernel to only get NOTE_CHILD
notifications.  The flags leak resulted in excessive
NOTE_EXEC/NOTE_FORK reports.

Fix immediate note activation in filt_procattach().  Condition should
be either the immediate CHILD_NOTE activation, or immediate NOTE_EXIT
report for the exiting process.

In knote_fork(), do not perform racy check for KN_INFLUX before kq
lock is taken.  Besides being racy, it did not accounted for notes
just added by scan (KN_SCAN).

Some minor and incomplete style fixes.

Analyzed and tested by: Eric Badger <eric@badgerio.us>
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Approved by: re (gjb)
Differential revision: https://reviews.freebsd.org/D6859

8 years agoFix build: explicitly reference the generated magic.h as dependency
Xin LI [Mon, 27 Jun 2016 06:41:11 +0000 (06:41 +0000)]
Fix build: explicitly reference the generated magic.h as dependency
of mkmagic and point its location.

Reported by: jenkins
Pointy hat to: delphij
MFC after: 2 weeks
X-MFC-With: 302221
Approved by: re (kib)

8 years agoMFV r302218: file 5.28.
Xin LI [Mon, 27 Jun 2016 01:29:17 +0000 (01:29 +0000)]
MFV r302218: file 5.28.

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

8 years agoVendor import of file 5.28.
Xin LI [Sun, 26 Jun 2016 20:59:11 +0000 (20:59 +0000)]
Vendor import of file 5.28.

8 years agoWhen sleeping waiting for either local or remote advisory lock,
Konstantin Belousov [Sun, 26 Jun 2016 20:08:42 +0000 (20:08 +0000)]
When sleeping waiting for either local or remote advisory lock,
interrupt sleeps with the ERESTART on the suspension attempts.
Otherwise, single-threading requests are deferred until the locks are
granted for NFS files, which causes hangs.

When retrying local registration of the remotely-granted adv lock,
allow full suspension and check for suspension, for usual reasons.

Reported by: markj, pho
Reviewed by: jilles
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Approved by: re (gjb)

8 years agoRewrite sigdeferstop(9) and sigallowstop(9) into more flexible
Konstantin Belousov [Sun, 26 Jun 2016 20:07:24 +0000 (20:07 +0000)]
Rewrite sigdeferstop(9) and sigallowstop(9) into more flexible
framework allowing to set the suspension policy for the dynamic block.
Extend the currently possible policies of stopping on interruptible
sleeps and ignoring such sleeps by two more: do not suspend at
interruptible sleeps, but interrupt them with either EINTR or ERESTART.

Reviewed by: jilles
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Approved by: re (gjb)

8 years agoEnter 64-bit mode as early as possible in the 64-bit PowerPC boot sequence.
Nathan Whitehorn [Sun, 26 Jun 2016 18:43:42 +0000 (18:43 +0000)]
Enter 64-bit mode as early as possible in the 64-bit PowerPC boot sequence.
Most of the effect of setting MSR[SF] is that the CPU will stop ignoring
the high 32 bits of registers containing addresses in load/store
instructions. As such, the kernel was setting it only when it began to
need access to high memory. MSR[SF] also affects the operation of some
conditional instructions, however, and so setting it at late times could
subtly break code at very early times. This fixes use of the FDT mode in
loader, and FDT boot more generally, on 64-bit PowerPC systems.

Hardware provided by: IBM LTC
Approved by: re (kib)

8 years agoFix a bug introduced in r283433.
Dmitry Chagin [Sun, 26 Jun 2016 16:59:59 +0000 (16:59 +0000)]
Fix a bug introduced in r283433.

[1] Remove unneeded sockaddr conversion before kern_recvit() call as the from
argument is used to record result (the source address of the received message) only.

[2] In Linux the type of msg_namelen member of struct msghdr is signed but native
msg_namelen has a unsigned type (socklen_t). So use the proper storage to fetch fromlen
from userspace and than check the user supplied value and return EINVAL if it is less
than 0 as a Linux do.

Reported by: Thomas Mueller <tmueller at sysgo dot com> [1]
Reviewed by: kib@
Approved by: re (gjb, kib)
MFC after: 3 days

8 years agoThis patch fixes two bugs related to the SCTP message recovery
Michael Tuexen [Sun, 26 Jun 2016 16:38:42 +0000 (16:38 +0000)]
This patch fixes two bugs related to the SCTP message recovery
for messages which have been put on the send queue:
* Do not report any DATA or I-DATA chunk padding.
* Correctly deal with the I-DATA chunk header instead of the DATA
  chunk header when the I-DATA extension is used.

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

8 years agobhyve: improve memory size documentation
Roman Bogorodskiy [Sun, 26 Jun 2016 14:44:01 +0000 (14:44 +0000)]
bhyve: improve memory size documentation

A couple of minor memory size option related nits:

 - use common name 'memsize' (instead of 'max-size' or just 'size')
 - bhyve: update usage with memsize unit suffix, drop legacy "MB"
   unit
 - bhyveload: update usage with memsize unit suffix
 - bhyve(8): document default size
 - bhyveload(8): use memsize formatting like it's done
   in bhyve(8)

Reviewed by:            wblock, grehan
Approved by:            re (kib), wblock, grehan
Differential Revision:  https://reviews.freebsd.org/D6952

8 years agoClean other flags in ncl_inactive, only. Add comment explaining why other
Konstantin Belousov [Sun, 26 Jun 2016 14:18:28 +0000 (14:18 +0000)]
Clean other flags in ncl_inactive, only.  Add comment explaining why other
flags should be unset.

Suggested and reviewed by: rmacklem
Sponsored by: The FreeBSD Foundation
MFC after: 12 days
Approved by: re (gjb)

8 years agoThis patch fixes a locking bug when a send() call blocks
Michael Tuexen [Sun, 26 Jun 2016 12:41:02 +0000 (12:41 +0000)]
This patch fixes a locking bug when a send() call blocks
on an SCTP socket and the association is aborted by the
peer.

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

8 years agoSkip lastcomm and sa tests on unsupported architectures
Alan Somers [Sun, 26 Jun 2016 00:53:31 +0000 (00:53 +0000)]
Skip lastcomm and sa tests on unsupported architectures

usr.bin/lastcom/tests/Makefile
usr.sbin/sa/tests/Makefile
Set allow_architectures appropriately.  These tests depend on golden
files that must be generated for each architecture, and haven't yet
been generated for all of them.

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

8 years agoUnbreak building of LINT kernels after r302163.
Bjoern A. Zeeb [Sat, 25 Jun 2016 22:24:16 +0000 (22:24 +0000)]
Unbreak building of LINT kernels after r302163.

Approved by: re (gjb)

8 years ago[net80211] re-revert the ibss "is this local to the bss" patch.
Adrian Chadd [Sat, 25 Jun 2016 20:31:20 +0000 (20:31 +0000)]
[net80211] re-revert the ibss "is this local to the bss" patch.

avos@ pointed out to me that this broke IBSS merging because the rest of
the input path no longer was called for non-IBSS frames.

I committed a change to not input non-IBSS frames, which stopped
nodes being created for BSSes that weren't ours.  Unfortunately
thta stopped the input path for non-IBSS frames in general,
so the management input path didn't work.

So, I'll revert this until I come up with a better solution.
(Hopefully before 11.)

Reviewed by: avos
Approved by: re (gjb)

8 years agoRevert r302194, there are issues with some applications after changing
Konstantin Belousov [Sat, 25 Jun 2016 20:20:24 +0000 (20:20 +0000)]
Revert r302194, there are issues with some applications after changing
the return value, in particular console-kit-daemon.

Reported by: Ivan Klymenko <fidaj@ukr.net>
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Approved by: re (gjb)

8 years agoRemove reference to mroute6d in /etc/netstart.
Baptiste Daroussin [Sat, 25 Jun 2016 12:54:27 +0000 (12:54 +0000)]
Remove reference to mroute6d in /etc/netstart.

mroute6d has been removed in r298512.

PR: 209405
Submitted by: Trond.Endrestol@ximalas.info
Approved by: re (gjb)

8 years agoThis patch fixes two bugs:
Michael Tuexen [Sat, 25 Jun 2016 12:46:18 +0000 (12:46 +0000)]
This patch fixes two bugs:
* sctp46, tcp46, and udp46 sockets are displayed as such and not as
  sctp4 6, tcp4 6, udp4 6. This bug was introduced in
  http://svnweb.freebsd.org/base?view=revision&revision=187915
* For SCTP sockets, the the -4 and -6 flags are honoured as much as
  possible. This means IPv4 sockets are handled correctly,  IPv6
  sockets are displayed as sctp46, since it is currently not possible
  to distinguish between sctp6 and sctp46.

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

8 years agoSince VOP_INACTIVE() is not guaranteed to be called, all cleanups
Konstantin Belousov [Sat, 25 Jun 2016 11:34:06 +0000 (11:34 +0000)]
Since VOP_INACTIVE() is not guaranteed to be called, all cleanups
executed by inactive methods, must be repeated on reclaim.  In
particular, unlink and free sillyrenamed vnode both on inactivation
and reclaim.

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

8 years agoDo not clear robust lists pointers on fork. The forked child thread
Konstantin Belousov [Sat, 25 Jun 2016 11:31:25 +0000 (11:31 +0000)]
Do not clear robust lists pointers on fork.  The forked child thread
lists must be functional.

Reported by: Daniel Engberg <daniel.engberg.lists@pyret.net>,
Guy Yur <guyyur@gmail.com>
Tested by: Guy Yur <guyyur@gmail.com>
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb), including the KBI change

8 years agoFor pthread_mutex_trylock() call on owned error-check or non-portable
Konstantin Belousov [Sat, 25 Jun 2016 11:30:40 +0000 (11:30 +0000)]
For pthread_mutex_trylock() call on owned error-check or non-portable
adaptive mutex, return EDEADLK as required by POSIX.  The
pthread_mutex_lock() is already compliant.

Tested by: Guy Yur <guyyur@gmail.com>
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Approved by: re (gjb)

8 years agobhnd(4): Add devinfo allocation and child addition methods, modeled on
Landon J. Fuller [Sat, 25 Jun 2016 04:36:30 +0000 (04:36 +0000)]
bhnd(4): Add devinfo allocation and child addition methods, modeled on
pci_if.

This allows bhnd(4) to manage per-device state (such as per-core
pmu/clock refcounting) on behalf of subclass driver instances.

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