]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agohyperv/hn: Reorganize the synthetic parts detach.
sephe [Wed, 28 Sep 2016 04:45:00 +0000 (04:45 +0000)]
hyperv/hn: Reorganize the synthetic parts detach.

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

7 years agohyperv/hn: Suspend and resume the backend properly upon MTU change.
sephe [Wed, 28 Sep 2016 04:34:21 +0000 (04:34 +0000)]
hyperv/hn: Suspend and resume the backend properly upon MTU change.

Suspend:
- Prevent the backend from being touched on TX path.
- Clear the RNDIS RX filter, and wait for RX to drain.
- Make sure that NVS see the chimney sending buffer and RXBUF
  disconnection, before unlink these buffers from the channel.

Resume:
- Reconfigure the RNDIS filter.
- Allow TX path to work on the backend.
- Kick start the TX eof task, in case the OACTIVE is set.

This fixes various panics, when the interface has traffic and MTU
is being changed.

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

7 years agohyperv/vmbus: Add function to drain channel interrupt task.
sephe [Wed, 28 Sep 2016 04:25:25 +0000 (04:25 +0000)]
hyperv/vmbus: Add function to drain channel interrupt task.

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

7 years agoFix a typo.
loos [Wed, 28 Sep 2016 04:22:06 +0000 (04:22 +0000)]
Fix a typo.

Pointy hat to: loos

7 years agohyperv/vmbus: Add functions to test RX/TX bufring emptiness
sephe [Wed, 28 Sep 2016 04:08:20 +0000 (04:08 +0000)]
hyperv/vmbus: Add functions to test RX/TX bufring emptiness

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

7 years agoloader command interpreter should reset command_errmsg
tsoome [Tue, 27 Sep 2016 20:40:44 +0000 (20:40 +0000)]
loader command interpreter should reset command_errmsg

The command interpreter does leave command_errmsg as is after printing its
content, assuming the next command will reset it in bf_command(). However,
in case the forth native word is defined as builtin, the bf_command is not
used and forth words will also end up the command_errmsg content printed.

Since command_errmsg is pointer to actual error message, which can be static
read only string, we can not just set *command_errmsg = '\0', instead we need
to reset the pointer itself.

Illumos issue: https://www.illumos.org/issues/7405

Reported by: Igor Kozhukhov.
Reviewed by: allanjude
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D8032

7 years agolibcompiler_rt: move file list to Makefile.inc for reuse elsewhere
emaste [Tue, 27 Sep 2016 18:55:45 +0000 (18:55 +0000)]
libcompiler_rt: move file list to Makefile.inc for reuse elsewhere

Also switch to the style used in the clang390-import branch to reduce
future conflicts.

Reviewed by: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8039

7 years agoAdd a sysctl to control the interrupt pacing on AM335x integrated switch.
loos [Tue, 27 Sep 2016 18:19:29 +0000 (18:19 +0000)]
Add a sysctl to control the interrupt pacing on AM335x integrated switch.

The hardware can be set to limit the number of interrupts from 2 to 63
interrupts per ms.

To keep the compatibility with the TI documentation the sysctl take the
interval between the interrupts pulses: 16~500 us.

Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoAdd a WITHOUT_DIALOG src.conf(5) knob
emaste [Tue, 27 Sep 2016 18:08:38 +0000 (18:08 +0000)]
Add a WITHOUT_DIALOG src.conf(5) knob

It also turns off dependencies (bsdinstall, bsdconfig, dpv, tzsetup).

Reviewed by: dteske
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7969

7 years agoIndicate that this is a locally administered MAC address.
araujo [Tue, 27 Sep 2016 17:37:23 +0000 (17:37 +0000)]
Indicate that this is a locally administered MAC address.

Submitted by: lidl
Differential Revision: https://reviews.freebsd.org/D7903

7 years agoAllow up to 6 arguments only on MIPS.
br [Tue, 27 Sep 2016 13:46:00 +0000 (13:46 +0000)]
Allow up to 6 arguments only on MIPS.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agoEditing fixes for r306257, documentation for trapcap.
kib [Tue, 27 Sep 2016 11:31:53 +0000 (11:31 +0000)]
Editing fixes for r306257, documentation for trapcap.

Suggested by: wblock
Discussed with: jilles
Reviewed by: cem (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D8023

7 years agoMark SSP broken on MIPS.
br [Tue, 27 Sep 2016 09:44:30 +0000 (09:44 +0000)]
Mark SSP broken on MIPS.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years ago- Prefer if_addrhead (FreeBSD) to if_addrlist (BSD compat) naming for the
kevlo [Tue, 27 Sep 2016 08:47:02 +0000 (08:47 +0000)]
- Prefer if_addrhead (FreeBSD) to if_addrlist (BSD compat) naming for the
  interface address list
- Update IFF_RENAMING macro descriptions

7 years agoRemove a comment about the size of the ifnet structure.
kevlo [Tue, 27 Sep 2016 08:11:09 +0000 (08:11 +0000)]
Remove a comment about the size of the ifnet structure.

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D8036

7 years agohyperv/vmbus: Add dynamic device add and remove support
sephe [Tue, 27 Sep 2016 06:30:24 +0000 (06:30 +0000)]
hyperv/vmbus: Add dynamic device add and remove support

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

7 years agopci: Clear the MEM/PORT_EN bit when updating PCI BAR
sephe [Tue, 27 Sep 2016 06:00:10 +0000 (06:00 +0000)]
pci: Clear the MEM/PORT_EN bit when updating PCI BAR

It's unsafe to update the BAR when the related EN bit is set.

Submitted by: Dexuan Cui <decui microsoft com>
Reviewed by: jhb
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7914

7 years agoAdd NXP/Freescale DIU driver for PowerPC SoCs
jhibbits [Tue, 27 Sep 2016 00:53:41 +0000 (00:53 +0000)]
Add NXP/Freescale DIU driver for PowerPC SoCs

Summary:
This enables some features of the DIU, using a static configuration,
specified either via a 'edid' property on the 'display' FDT node, or a
'video-mode' environment variable (bootarg).  'video-mode' was chosen because it
matches u-boot's naming, so it can be set with:

setenv bootargs video-mode=${video-mode}

at the u-boot CLI.

Mouse cursor is not supported currently, as a hardware cursor is not supported
by framebuffer VT yet.  Currently it only supports a 32bpp ARGB (actually BGRA)
format, and only a single composite plane, at up to 1280x1024.

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

7 years agoDocument hw.psm.elantech_support in psm(4)
gonzo [Mon, 26 Sep 2016 22:08:35 +0000 (22:08 +0000)]
Document hw.psm.elantech_support in psm(4)

PR:             205690
Submitted by:   Vladimir Kondratyev <wulf@cicgroup.ru>
MFC after:      1 week

7 years agoAdd Elantech trackpad to the list of known models
gonzo [Mon, 26 Sep 2016 22:07:45 +0000 (22:07 +0000)]
Add Elantech trackpad to the list of known models

PR:             205690
Submitted by:   Vladimir Kondratyev <wulf@cicgroup.ru>
MFC after:      1 week

7 years agoAdd Elantech trackpad support
gonzo [Mon, 26 Sep 2016 22:06:19 +0000 (22:06 +0000)]
Add Elantech trackpad support

Elantech trackpads are found in some laptops like the Asus UX31E. They
are "synaptics compatible" but use a slightly different protocol.

Elantech hardware support is not enabled by default and just like
Synaptic or TrackPoint devices it should be enabled by setting
tunable, in this case hw.psm.elantech_support, to non-zero value

PR: 205690
Submitted by: Vladimir Kondratyev <wulf@cicgroup.ru>
MFC after: 1 week

7 years agoIncrease timeout from 300 (default) to 600 seconds.
br [Mon, 26 Sep 2016 20:13:33 +0000 (20:13 +0000)]
Increase timeout from 300 (default) to 600 seconds.
It takes 6-7 minutes to proceed the test on MIPS64EB.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agoHandle TLB shootdown IPI during the EFI runtime calls, on SandyBridge
kib [Mon, 26 Sep 2016 17:25:25 +0000 (17:25 +0000)]
Handle TLB shootdown IPI during the EFI runtime calls, on SandyBridge
and IvyBridge machines, which support PCID but do not have INVPCID
instruction.

MFC after: 1 week

7 years agoFor machines which support PCID but not have INVPCID instruction,
kib [Mon, 26 Sep 2016 17:22:44 +0000 (17:22 +0000)]
For machines which support PCID but not have INVPCID instruction,
i.e. SandyBridge and IvyBridge, correct a race between pmap_activate()
and invltlb_pcid_handler().

Reported by and tested by: Slawa Olhovchenkov <slw@zxy.spb.ru>
MFC after: 1 week

7 years agohash(3): protect in-memory page when using cross-endianness.
pfg [Mon, 26 Sep 2016 16:06:50 +0000 (16:06 +0000)]
hash(3): protect in-memory page when using cross-endianness.

When writing out pages in the "other endian" format, make a copy
instead of trashing the in-memory one.

Obtained from: NetBSD (CVS rev. 1.29)

7 years agoRevert r306337. dhw@ reproted a panic which seems related to this and bde@ has
hiren [Mon, 26 Sep 2016 15:45:30 +0000 (15:45 +0000)]
Revert r306337. dhw@ reproted a panic which seems related to this and bde@ has
raised some issues.

7 years agoDon't build SSP tests on MIPS as we dont have stack-protector
br [Mon, 26 Sep 2016 15:38:02 +0000 (15:38 +0000)]
Don't build SSP tests on MIPS as we dont have stack-protector
supported on this platform.

Discussed with: brooks
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agoMake no assertions about mutex state when the scheduler is stopped.
vangyzen [Mon, 26 Sep 2016 15:30:30 +0000 (15:30 +0000)]
Make no assertions about mutex state when the scheduler is stopped.

This changes the assert path to match the lock and unlock paths.

MFC after: 1 week
Sponsored by: Dell EMC

7 years agoMerge OpenSSL 1.0.2j.
jkim [Mon, 26 Sep 2016 14:22:17 +0000 (14:22 +0000)]
Merge OpenSSL 1.0.2j.

7 years agoUse bsdlabel as we don't have hardlink disklabel -> bsdlabel on MIPS.
br [Mon, 26 Sep 2016 14:01:41 +0000 (14:01 +0000)]
Use bsdlabel as we don't have hardlink disklabel -> bsdlabel on MIPS.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agoIncrease timeout for legacy_test from 300 (default) to 600 seconds.
br [Mon, 26 Sep 2016 13:59:18 +0000 (13:59 +0000)]
Increase timeout for legacy_test from 300 (default) to 600 seconds.
It takes about 7 minutes to pass the test on MIPS64EB in QEMU.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agoIn sendit(), if mp->msg_control is present, then in sockargs() we are allocating
hiren [Mon, 26 Sep 2016 10:13:58 +0000 (10:13 +0000)]
In sendit(), if mp->msg_control is present, then in sockargs() we are allocating
mbuf to store mp->msg_control. Later in kern_sendit(), call to getsock_cap(),
will check validity of file pointer passed, if this fails EBADF is returned but
mbuf allocated in sockargs() is not freed. Fix this possible leak.

Submitted by: Lohith Bellad <lohith.bellad@me.com>
Reviewed by: adrian
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D7910

7 years agoDocument thr_suspend(2) and thr_wake(2).
kib [Mon, 26 Sep 2016 08:18:34 +0000 (08:18 +0000)]
Document thr_suspend(2) and thr_wake(2).

Reviewed by: bjk, jilles
Discussed with: emaste, wblock
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D8016

7 years agoPortability changes:
marcel [Mon, 26 Sep 2016 04:14:00 +0000 (04:14 +0000)]
Portability changes:
1.  macOS nor Linux have MAP_NOCORE nor MAP_NOSYNC. Define as 0.
2.  macOS doesn't have SEEK_DATA nor SEEK_HOLE. Define as -1
    so that lseek will return -1 (with errno set to EINVAL).
3.  gcc correctly warns that error is assigned but not used in
    image_copyout_region().  Fix by returning on the first error.

7 years agobtree(3): don't shortcut closing if the metadata is dirty.
pfg [Mon, 26 Sep 2016 02:29:28 +0000 (02:29 +0000)]
btree(3): don't shortcut closing if the metadata is dirty.

Obtained from: NetBSD (from krb5 tree)

MFC after: 3 weeks

7 years ago[ath_hal] add a new regdomain flag - I think this means "yes, you can use this
adrian [Mon, 26 Sep 2016 02:05:02 +0000 (02:05 +0000)]
[ath_hal] add a new regdomain flag - I think this means "yes, you can use this
NIC in channel 144 if you're in FCC6."

I have to go figure out more details about this before I enable it..

7 years agoAvoid depending on the <sys/endian.h> header for le*enc and be*enc.
marcel [Mon, 26 Sep 2016 01:06:32 +0000 (01:06 +0000)]
Avoid depending on the <sys/endian.h> header for le*enc and be*enc.
Not only is the header unportable, the encoding/decoding functions
are as well.  Instead, duplicate the handful of small inlines we
need into a private header called endian.h.

Aside: an alternative approach is to move the encoding/decoding
functions to a separate system header.  While the header is still
nonportable, such an approach would make it possible to re-use the
definitions by playing games with include paths. This may be the
preferred approach if more (build) utilities need this.  This
change does not preclude that.  In fact, it makes it easier.

7 years agoEliminate the use of EDOOFUS. The error code was used to signal
marcel [Mon, 26 Sep 2016 00:41:08 +0000 (00:41 +0000)]
Eliminate the use of EDOOFUS.  The error code was used to signal
programming errors, but is really a poor substitute for assert.
And less portable as well.

7 years agoUpdate PCI driver to match new dts tree
gonzo [Sun, 25 Sep 2016 23:48:15 +0000 (23:48 +0000)]
Update PCI driver to match new dts tree

In new dts tree phy is a property of port, not the controller node, also
the name was changed from "pcie" to "pcie-0"

7 years agoUpdate AHCI driver to match new dts tree
gonzo [Sun, 25 Sep 2016 23:45:49 +0000 (23:45 +0000)]
Update AHCI driver to match new dts tree

phy name parameter was changed from "sata-phy" to "sata-0" in new dts tree
introduced in r306197

7 years agoReplace the use of linker sets with constructors for both the
marcel [Sun, 25 Sep 2016 22:57:59 +0000 (22:57 +0000)]
Replace the use of linker sets with constructors for both the
formats and schemes.  Formats and schemes are registered at
runtime now, rather than collected at link time.

7 years ago[ath_hal] add a comment for the channel 144 regdomain flag.
adrian [Sun, 25 Sep 2016 22:17:46 +0000 (22:17 +0000)]
[ath_hal] add a comment for the channel 144 regdomain flag.

I'm .. still trying to figure out what's going on.

7 years ago[ath_hal] Add FCC6_FCCA regulatory domain (0x0014).
adrian [Sun, 25 Sep 2016 22:07:41 +0000 (22:07 +0000)]
[ath_hal] Add FCC6_FCCA regulatory domain (0x0014).

Tested:

* TP-Link N900, AR9380, regdomain 0x0014 (FCC6_FCCA).

7 years agorsu: do not restart calibration task when going out of RUN state.
avos [Sun, 25 Sep 2016 19:13:07 +0000 (19:13 +0000)]
rsu: do not restart calibration task when going out of RUN state.

Clear 'sc_calibrating' flag and stop calibration task when interface
is not associated; this fixes possible panic after detach.

Reported and tested by: hselasky
Reviewed by: adrian
MFC after: 6 days

7 years agoMinor fixes for 160-bit disassembly:
bde [Sun, 25 Sep 2016 18:39:24 +0000 (18:39 +0000)]
Minor fixes for 160-bit disassembly:

(1) Print the default segment %ss before adresses relative to %bp.
    This is too cluttered for me, but so is printing some other default
    prefixes, and this is a reasonable reminder that %ss is quite
    likely to be different from %ds in 16-bit mode.

    db_disasm still handles prefixes poorly, by trying to discard
    redundant ones.  This loses information, and sometimes the result
    is wrong or misleading.

    Clean up nearby initializations and dead code.

(2) Fix decoding of operand and address size prefixes in 16-bit mode.
    They reverse the default in all modes.

Obtained from:            (1) is partly from r1.4 (2003/11/08) in DFlyBSD (?)

7 years agoMFamd64: r266901
tijl [Sun, 25 Sep 2016 18:29:02 +0000 (18:29 +0000)]
MFamd64: r266901

Allocate a zeroed LDT.

Failing to do this might result in the LDT appearing to run out of free
descriptors because of random junk in the descriptor's 'sd_type' field.

http://lists.freebsd.org/pipermail/freebsd-amd64/2014-May/016088.html

PR: 212639
Submitted by: wheelcomplex@gmail.com
MFC after: 2 weeks

7 years agoDocument the ".pico" extension for object files.
marcel [Sun, 25 Sep 2016 16:50:31 +0000 (16:50 +0000)]
Document the ".pico" extension for object files.

Suggested by: emaste@

7 years agoRelocatable object files are renamed from *.So to *.pico
marcel [Sun, 25 Sep 2016 16:39:18 +0000 (16:39 +0000)]
Relocatable object files are renamed from *.So to *.pico

Reminder by: imp@

7 years agoDetermine the operand/address size of %cs in a new function
bde [Sun, 25 Sep 2016 16:30:29 +0000 (16:30 +0000)]
Determine the operand/address size of %cs in a new function
db_segsize().

Use db_segsize() to set the default operand/address size for
disassembling.  Allow overriding this with the "alternate" display
format /I.  The API of db_disasm() should be debooleanized to pass a
more general request (amd64 needs overrides to sizes of 16, 32, and
64, but this commit doesn't implement anything for amd64 since much
larger changes are needed to restore the amd64 disassmbler's support
for non-default sizes).

Fix db_print_loc_and_inst() to ask for the normal format and not the
alternate in normal operation.

This is most useful for vm86 mode, but also works for 16-bit protected
mode.

Use db_segsize() to avoid trying to print a garbage stack trace if %cs
is 16 bits.  Print something like the stack trace termination message
for a trap boundary instead.

Document that the alternate format is now useful on i386.

7 years agoFix vm86 initialization, part 3 of 2 and a half. (Actually, just fix
bde [Sun, 25 Sep 2016 14:56:24 +0000 (14:56 +0000)]
Fix vm86 initialization, part 3 of 2 and a half.  (Actually, just fix
early printfs and debugging of vm86 initialization and some other early
initialization in some cases.)  Add an option debug.late_console (with
default 1=off) to move console and kdb initialization back where it was.
Do the same for amd64 although there is no vm86 there.

On my test system, debug.late_console=0 works for the syscons, sio and
uart console drivers on amd64 and i386, and for vt on i386 but not on
amd64.

The early printfs fixed by debug.late_console=0 are:
- on i386, the message about lost memory above 4G
- with -v in otherwise normal use, about 20 printfs for SMAP
- other debugging messages for memory sizing.  Mostly under -v and
  not printed in normal use.

Document in a comment how much earlier the initialization and early
printf()s can be.  That is very early for the console.  Not much more
than curthread is needed.  kdb use obviously needs to be not so early,
since it needs IDT initialization and that is done relatively late
for convenience and historical reasons.

7 years agoAdd the start of a GENERIC armv6 kernel config. This supports the Allwinner
andrew [Sun, 25 Sep 2016 07:48:08 +0000 (07:48 +0000)]
Add the start of a GENERIC armv6 kernel config. This supports the Allwinner
SMP SoCs and qemu virt. Further SoCs can be supported if they support the
PLATFORM, PLATFORM_SMP, and MULTIDELAY options.

Tested by: manu
Sponsored by: ABT Systems Ltd

7 years agoGive the user a clue as to which process hit maxfiles.
julian [Sat, 24 Sep 2016 22:56:13 +0000 (22:56 +0000)]
Give the user a clue as to which process hit maxfiles.

MFC after: 1 week
Sponsored by: Panzura

7 years agoConvert checks in nd6_dad_start() and nd6_dad_timer() to assertions.
markj [Sat, 24 Sep 2016 21:40:24 +0000 (21:40 +0000)]
Convert checks in nd6_dad_start() and nd6_dad_timer() to assertions.

In particular, these functions can assume they are operating on tentative
addresses.

MFC after: 2 weeks

7 years agoMove implementations of uread() and uwrite() to the illumos compat layer.
markj [Sat, 24 Sep 2016 21:40:14 +0000 (21:40 +0000)]
Move implementations of uread() and uwrite() to the illumos compat layer.

MFC after: 1 week

7 years agocxgbe(4): Use the port's top speed to figure out whether it is "high
np [Sat, 24 Sep 2016 19:03:05 +0000 (19:03 +0000)]
cxgbe(4): Use the port's top speed to figure out whether it is "high
speed" or not (for the purpose of calculating the number of queues etc.)
This does the right thing for 25Gbps and 100Gbps ports.

7 years agoWhen MAKEOBJDIRPREFIX points to a case-insensitive file system, the
marcel [Sat, 24 Sep 2016 17:50:11 +0000 (17:50 +0000)]
When MAKEOBJDIRPREFIX points to a case-insensitive file system, the
build can break when different source files create the same target
files (case-insensitivity speaking).  This is the case for object
files compiled with -fpic and shared libraries. The former uses
an extension of ".So", and the latter an extension ".so".  Rename
shared object files from *.So to *.pico to match what NetBSD does.

Missed in r306297

MFC after: 1 month
Sponsored by: Bracket Computing
Differential Revision: https://reviews.freebsd.org/D7906

7 years agoUpdate local variable 'block' after calling capacity_resize(),
marcel [Sat, 24 Sep 2016 17:29:27 +0000 (17:29 +0000)]
Update local variable 'block' after calling capacity_resize(),
otherwise format_resize(), which is called right after, isn't
getting the current/actual image size. Rather than rounding up,
format_resize() could end up truncating the size and we don't
allow that by design.

MFC after: 1 week

7 years agoWhen MAKEOBJDIRPREFIX points to a case-insensitive file system, the
marcel [Sat, 24 Sep 2016 15:11:27 +0000 (15:11 +0000)]
When MAKEOBJDIRPREFIX points to a case-insensitive file system, the
build can break when different source files create the same target
files (case-insensitivity speaking).  This is the case for object
files compiled with -fpic and shared libraries. The former uses
an extension of ".So", and the latter an extension ".so".  Rename
shared object files from *.So to *.pico to match what NetBSD does.

See also r305855

MFC after: 1 month
Sponsored by: Bracket Computing
Differential Revision: https://reviews.freebsd.org/D7906

7 years agocxgbe(4): Support SIOGIFXMEDIA so that ifconfig displays correct media
np [Sat, 24 Sep 2016 13:23:47 +0000 (13:23 +0000)]
cxgbe(4): Support SIOGIFXMEDIA so that ifconfig displays correct media
for 25Gbps and 100Gbps ports.   This should have been part of r305713,
which is when the driver first started reporting extended media types.

7 years agofix vnode lock assertion for extended attributes directory
avg [Sat, 24 Sep 2016 08:13:15 +0000 (08:13 +0000)]
fix vnode lock assertion for extended attributes directory

Background.  In ZFS a file with extended attributes has a special
directory associated with it where each extended attribute is a file.
The attribute's name is a file name and its value is a file content.
When the ownership of a file with extended attributes is changed, ZFS
also changes ownership of the special directory.  This is where the bug
was hit.

The bug was introduced in r209158.

Nota bene.  ZFS vnode locks are typically acquired before
z_teardown_lock (i.e., before ZFS_ENTER).  But this is not the case for
the vnodes that represent the extended attribute directory and files.
Those are always locked after ZFS_ENTER.  This is confusing and fragile.

PR: 212702
Reported by: Christian Fuss to FreeNAS
Tested by: mav
MFC after: 1 week

7 years agothe rest of changes intended to be committed in r306290
avg [Sat, 24 Sep 2016 07:59:54 +0000 (07:59 +0000)]
the rest of changes intended to be committed in r306290

MFC after: 5 days
X-MFC with: r306218

7 years agoclarify description of the 0x790b1022 / "KERNCZ"/ "CZ" device
avg [Sat, 24 Sep 2016 07:55:49 +0000 (07:55 +0000)]
clarify description of the 0x790b1022 / "KERNCZ"/ "CZ" device

MFC after: 5 days
X-MFC with: r306218

7 years agobridge: Fix fragment handling and memory leak
kp [Sat, 24 Sep 2016 07:09:43 +0000 (07:09 +0000)]
bridge: Fix fragment handling and memory leak

Fragmented UDP and ICMP packets were corrupted if a firewall with reassembling
feature (like pf'scrub) is enabled on the bridge.  This patch fixes corrupted
packet problem and the panic (triggered easly with low RAM) as explain in PR
185633.

bridge_pfil and bridge_fragment relationship:

bridge_pfil() receive (IN direction) packets and sent it to the firewall The
firewall can be configured for reassembling fragmented packet (like pf'scrubing)
in one mbuf chain when bridge_pfil() need to send this reassembled packet to the
outgoing interface, it needs to re-fragment it by using bridge_fragment()
bridge_fragment() had to split this mbuf (using ip_fragment) first then
had to M_PREPEND each packet in the mbuf chain for adding Ethernet
header.

But M_PREPEND can sometime create a new mbuf on the begining of the mbuf chain,
then the "main" pointer of this mbuf chain should be updated and this case is
tottaly forgotten. The original bridge_fragment code (Revision 158140,
2006 April 29) came from OpenBSD, and the call to bridge_enqueue was
embedded.  But on FreeBSD, bridge_enqueue() is done after bridge_fragment(),
then the original OpenBSD code can't work as-it of FreeBSD.

PR: 185633
Submitted by: Olivier Cochard-LabbĂ©
Differential Revision: https://reviews.freebsd.org/D7780

7 years agoFix ds1307 probing
jhibbits [Sat, 24 Sep 2016 05:27:12 +0000 (05:27 +0000)]
Fix ds1307 probing

'compat' can never be NULL, because the compatible check loop ends when
compat->ocd_str is NULL.  This causes ds1307 to attach to any unclaimed i2c
device.

7 years agobhnd(4): Implement common API for IOST/IOCTL register access and core reset
landonf [Sat, 24 Sep 2016 04:08:16 +0000 (04:08 +0000)]
bhnd(4): Implement common API for IOST/IOCTL register access and core reset

- Added bhnd(4) bus APIs for per-core ioctl/iost register access.
- Updated reset/suspend bhnd(4) APIs for compatibility with ioctl/iost
  changes.
- Implemented core reset/suspend support for both bcma(4) and siba(4).
- Implemented explicit release of all outstanding PMU requests at the bus
  level when putting a core into reset.

Approved by:    adrian (mentor, implicit)
Differential Revision:  https://reviews.freebsd.org/D8009

7 years ago[iwm] fix default antenna selection a bit; fix 5GHz rate control handling.
adrian [Sat, 24 Sep 2016 01:21:42 +0000 (01:21 +0000)]
[iwm] fix default antenna selection a bit; fix 5GHz rate control handling.

* Don't do the antenna switching when setting up the rate table - we don't
  take into account whether it's an active antenna or not (eg shared with BT.)
  I'll look into this a bit more later.

* The default antenna is still 1, I'll look into that a bit more later.
  (So no, this doesn't fix it for Larry who needs ANT_B to be active, not
  ANT_A.)

* My changes to the rate control setup used the wrong method for finding
  a suitable rate, which led to 1M CCK frames being queued for 11a operation.
  This is .. sub-optimal.  Change the rate control lookup path to use
  the global table instead of the per-node table, which won't be setup
  until the node rate table is setup (which happens way too late in this
  game.)

Tested:

* Intel 7260, 2G and 5G operation.

7 years agoRename ndpr_refcnt to ndpr_addrcnt.
markj [Sat, 24 Sep 2016 01:14:25 +0000 (01:14 +0000)]
Rename ndpr_refcnt to ndpr_addrcnt.

This field counts derived addresses and is not a true refcount for prefix
objects, so the previous name was misleading.

MFC after: 1 week

7 years agoFixes for issues under high workloads
davidcs [Fri, 23 Sep 2016 23:18:54 +0000 (23:18 +0000)]
Fixes for issues under high workloads

MFC after:5 days

7 years agocloudabi: use fget_cap instead of hand-rolling capability read
mjg [Fri, 23 Sep 2016 23:08:23 +0000 (23:08 +0000)]
cloudabi: use fget_cap instead of hand-rolling capability read

This has a side effect of unbreaking the build after r306272.

Discussed with: ed

7 years agoDIRDEPS_BUILD: Connect new directories.
bdrewery [Fri, 23 Sep 2016 22:46:19 +0000 (22:46 +0000)]
DIRDEPS_BUILD: Connect new directories.

Sponsored by: Dell EMC Isilon

7 years agoUse g_wither_provider() where applicable.
mav [Fri, 23 Sep 2016 21:29:40 +0000 (21:29 +0000)]
Use g_wither_provider() where applicable.

It is just a helper function combining G_PF_WITHER setting with
g_orphan_provider().

7 years agocxgbe(4): Make the location/length of all descriptor rings available in
np [Fri, 23 Sep 2016 20:03:28 +0000 (20:03 +0000)]
cxgbe(4): Make the location/length of all descriptor rings available in
the sysctl MIB.

7 years agoMount msdosfs with longnames support by default.
asomers [Fri, 23 Sep 2016 19:05:07 +0000 (19:05 +0000)]
Mount msdosfs with longnames support by default.

The old behavior depended on the FAT version and on what files were in the
root directory. "mount_msdosfs -o shortnames" is still supported.

Reviewed by: wblock, cem
Discussed with: trasz, adrian, imp
MFC after: 4 weeks
X-MFC-Notes: Don't MFC the removal of findwin95
Differential Revision: https://reviews.freebsd.org/D8018

7 years agoDo not perform extra check for NULL, evdev_free can handle NULL value
gonzo [Fri, 23 Sep 2016 18:55:32 +0000 (18:55 +0000)]
Do not perform extra check for NULL, evdev_free can handle NULL value

Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>

7 years agoHandle NULL argument in evdev_free
gonzo [Fri, 23 Sep 2016 18:54:08 +0000 (18:54 +0000)]
Handle NULL argument in evdev_free

Add check for evdev argument of evdev_free being NULL. This is valid
value and should not cause crash. In this case evdev_free does nothing

Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>

7 years agocxgbe(4): Fix netmap with T6, which doesn't encapsulate SGE_EGR_UPDATE
np [Fri, 23 Sep 2016 17:24:06 +0000 (17:24 +0000)]
cxgbe(4): Fix netmap with T6, which doesn't encapsulate SGE_EGR_UPDATE
message inside a FW_MSG.  The base NIC already deals with updates in
either form.

Sponsored by: Chelsio Communications

7 years agofd: hide fd_modified under CAPABILITIES
mjg [Fri, 23 Sep 2016 16:47:12 +0000 (16:47 +0000)]
fd: hide fd_modified under CAPABILITIES

It has no use without it and is now less error prone.

7 years agoAlso implement platform_cpu_reset on bcm2836
andrew [Fri, 23 Sep 2016 15:28:15 +0000 (15:28 +0000)]
Also implement platform_cpu_reset on bcm2836

7 years agoRestrict where we need to define fdt_fixup_table to just PowerPC and
andrew [Fri, 23 Sep 2016 14:11:23 +0000 (14:11 +0000)]
Restrict where we need to define fdt_fixup_table to just PowerPC and
Marvell.

Sponsored by: ABT Systems Ltd

7 years agolibcompiler_rt: use ${SRCTOP} for the top of the FreeBSD tree
emaste [Fri, 23 Sep 2016 13:23:52 +0000 (13:23 +0000)]
libcompiler_rt: use ${SRCTOP} for the top of the FreeBSD tree

7 years agoForce LLVM_LIBUNWIND off if we don't have a C++11 compiler
emaste [Fri, 23 Sep 2016 13:21:29 +0000 (13:21 +0000)]
Force LLVM_LIBUNWIND off if we don't have a C++11 compiler

Tested by: bde
Differential Revision: https://reviews.freebsd.org/D7746

7 years agoUse 32-bit value for .text padding, for linker portability
emaste [Fri, 23 Sep 2016 13:18:59 +0000 (13:18 +0000)]
Use 32-bit value for .text padding, for linker portability

GNU ld interprets the padding value as a variable-length byte string,
while GNU gold and LLVM lld interpret it as a 32-bit value.

7 years agoMove cpu_reset to be a platform method to allow multiple implementations.
andrew [Fri, 23 Sep 2016 13:08:15 +0000 (13:08 +0000)]
Move cpu_reset to be a platform method to allow multiple implementations.

Reviewed by: mmel
Sponsored by: ABT Systems Ltd
Differential Revision: https://reviews.freebsd.org/D8010

7 years agoRemove bus_dma_get_range and bus_dma_get_range_nb on armv6. We only need
andrew [Fri, 23 Sep 2016 12:38:05 +0000 (12:38 +0000)]
Remove bus_dma_get_range and bus_dma_get_range_nb on armv6. We only need
this on a few earlier arm SoCs.

Reviewed by: manu (earlier version)
Sponsored by: ABT Systems Ltd

7 years agoProvide proccontrol(1), an utility to control processes behaviour, related
kib [Fri, 23 Sep 2016 12:34:54 +0000 (12:34 +0000)]
Provide proccontrol(1), an utility to control processes behaviour, related
to procctl(2).

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoAdd the foundation copyrights to procctl kernel sources.
kib [Fri, 23 Sep 2016 12:32:20 +0000 (12:32 +0000)]
Add the foundation copyrights to procctl kernel sources.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoDocument r306081, i.e. procctl(PROC_TRAPCAP) and sysctl kern.trap_enocap.
kib [Fri, 23 Sep 2016 09:26:40 +0000 (09:26 +0000)]
Document r306081, i.e. procctl(PROC_TRAPCAP) and sysctl kern.trap_enocap.

Reviewed by: cem
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D8003

7 years agofd: fix up fget_cap
oshogbo [Fri, 23 Sep 2016 08:13:46 +0000 (08:13 +0000)]
fd: fix up fget_cap

If the kernel is not compiled with the CAPABILITIES kernel options
fget_unlocked doesn't return the sequence number so fd_modify will
always report modification, in that case we got infinity loop.

Reported by: br
Reviewed by: mjg
Tested by: br, def

7 years agoCheck if IPv6 supported before running the test, skip otherwise.
br [Fri, 23 Sep 2016 07:51:01 +0000 (07:51 +0000)]
Check if IPv6 supported before running the test, skip otherwise.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agoPrevent cuse4bsd.ko and cuse.ko from loading at the same time by
hselasky [Fri, 23 Sep 2016 07:41:23 +0000 (07:41 +0000)]
Prevent cuse4bsd.ko and cuse.ko from loading at the same time by
declaring support for the cuse4bsd interface in cuse.ko.

Found by: Sergey V. Dyatko <sergey.dyatko@gmail.com>
MFC after: 1 week

7 years agofd: fix up fgetvp_rights after r306184
mjg [Fri, 23 Sep 2016 06:51:46 +0000 (06:51 +0000)]
fd: fix up fgetvp_rights after r306184

fget_cap_locked returns a referenced file, but the fgetvp_rights does
not need it. Instead, due to the filedesc lock being held, it can
ref the vnode after the file was looked up.

Fix up fget_cap_locked to be consistent with other _locked helpers and not
ref the file.

This plugs a leak introduced in r306184.

Pointy hat to: mjg, oshogbo

7 years agocache: get rid of the global lock
mjg [Fri, 23 Sep 2016 04:45:11 +0000 (04:45 +0000)]
cache: get rid of the global lock

Add a table of vnode locks and use them along with bucketlocks to provide
concurrent modification support. The approach taken is to preserve the
current behaviour of the namecache and just lock all relevant parts before
any changes are made.

Lookups still require the relevant bucket to be locked.

Discussed with: kib
Tested by: pho

7 years agoRe-check the systrace probe ID before calling dtrace_probe().
markj [Thu, 22 Sep 2016 23:22:53 +0000 (23:22 +0000)]
Re-check the systrace probe ID before calling dtrace_probe().

Otherwise there exists a narrow window during which a syscall probe can be
disabled and cause a concurrently-running thread to call dtrace_probe()
with an invalid probe ID.

Reported by: ngie
MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoUpdate oce to version 11.0.50.0
jpaetzel [Thu, 22 Sep 2016 22:51:11 +0000 (22:51 +0000)]
Update oce to version 11.0.50.0

Submitted by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>

7 years agoamdsbwd, intpm: unify bits specific to AMD chipsets (FCHs, southbridges)
avg [Thu, 22 Sep 2016 21:34:35 +0000 (21:34 +0000)]
amdsbwd, intpm: unify bits specific to AMD chipsets (FCHs, southbridges)

AMD chipsets have proprietary mechanisms for dicovering resources.
Those resources are not discoverable via plug-and-play mechanisms
like PCI configuration registers or ACPI.
For this reason a chipset-specific knowledge of proprietary registers
is required.

At present there are two FreeBSD drivers that require the proprietary
resource discovery.  One is amdsbwd which is a driver for the watchdog
timer in the AMD chipsets.  The other is intpm SMBus driver when it
attaches to the newer AMD chipsets where the resources of the SMBus HBA
are not described in the regular PCI way.

In both cases the resources are discovered by accessing AMD PMIO space.
Thus, many definitions are shared between the two drivers.
This change puts those defintions into a common header file.

As an added benefit, intpm driver now supports newest FCHs built into
AMD processors of Family 15h, models 70h-7Fh and Family 16h, models
30h-3Fh.

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

7 years agocxgbe(4): Fix the output of the "tids" sysctl on T6.
np [Thu, 22 Sep 2016 21:19:25 +0000 (21:19 +0000)]
cxgbe(4): Fix the output of the "tids" sysctl on T6.

7 years agoFix regression from r297400, which truncates headers in case of low socket
glebius [Thu, 22 Sep 2016 20:34:44 +0000 (20:34 +0000)]
Fix regression from r297400, which truncates headers in case of low socket
buffer and put a small optimization for low socket buffer case:

- Do not hack uio_resid, and let m_uiotombuf() properly take care of it. This
  fixes truncation of headers at low buffer.
- If headers ate all the space, jump right to the end of the cycle, to
  avoid doing single page I/O and allocating zero length mbuf.
- Clear hdr_uio only if space is positive, which indicates that all uio
  was copied in.

Reviewed by: pluknet, jtl, emax, rrs, lstewart, emax, gallatin, scottl

7 years agoChange the efi_get_table interface to a void ** so we can return the
imp [Thu, 22 Sep 2016 19:04:51 +0000 (19:04 +0000)]
Change the efi_get_table interface to a void ** so we can return the
pointer by dereferencing the pointer.

Reviewed by: kib@
MFC After: 2 weeks
Sponsored by: Netflix, Inc

7 years agocxgbe(4): Catch up with the different layout of WHOAMI in T6.
np [Thu, 22 Sep 2016 18:47:07 +0000 (18:47 +0000)]
cxgbe(4): Catch up with the different layout of WHOAMI in T6.

Note that the code moved below t4_prep_adapter() as part of this change
because now it needs a working chip_id().

7 years agoAdd the ID for the Huawei ME909S LTE modem.
loos [Thu, 22 Sep 2016 18:45:25 +0000 (18:45 +0000)]
Add the ID for the Huawei ME909S LTE modem.

Submitted by: svenauhagen at github
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC (Netgate)