]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoRPI-B: Add support for MULTIDELAY
Emmanuel Vadot [Thu, 29 Sep 2016 06:49:59 +0000 (06:49 +0000)]
RPI-B: Add support for MULTIDELAY

100 cycles per us seems accurate enough, at least it's better than the 200 value
that was used before.

Reviewed by: andrew, imp
Differential Revision: https://reviews.freebsd.org/D8062

7 years agocallsign isn't required anymore
Eitan Adler [Thu, 29 Sep 2016 06:19:45 +0000 (06:19 +0000)]
callsign isn't required anymore

7 years agoRemove the compatibility macro if_addrlist.
Kevin Lo [Thu, 29 Sep 2016 05:37:45 +0000 (05:37 +0000)]
Remove the compatibility macro if_addrlist.

Since if_addrlist is used only for ipfilter(4), add a macro if_addrlist
in ip_compat.h.

Reviewed by: cy
Differential Revision: https://reviews.freebsd.org/D8059

7 years agohyperv/hn: Don't set HASHVAL pktinfo for NDIS < 6.30
Sepherosa Ziehau [Thu, 29 Sep 2016 05:13:58 +0000 (05:13 +0000)]
hyperv/hn: Don't set HASHVAL pktinfo for NDIS < 6.30

This unbreaks packet sending on WS2008R2.

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

7 years agohyperv/hn: Consolidate hn_init() and hn_stop()
Sepherosa Ziehau [Thu, 29 Sep 2016 05:01:20 +0000 (05:01 +0000)]
hyperv/hn: Consolidate hn_init() and hn_stop()

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

7 years agohyperv/hn: Move TX tasks' draining into hn_suspend().
Sepherosa Ziehau [Thu, 29 Sep 2016 04:53:21 +0000 (04:53 +0000)]
hyperv/hn: Move TX tasks' draining into hn_suspend().

This prepares to consolidate hn_stop() and netvsc_detach().

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

7 years agoAdd touchscreen support for the official 7" RPi touch display
Oleksandr Tymoshenko [Thu, 29 Sep 2016 02:14:08 +0000 (02:14 +0000)]
Add touchscreen support for the official 7" RPi touch display

Technically touchscreen chip is FT5406 but all hardware
communication is performed by VideCore and only final results
are presented to ARM part through memory region shared between
VC and ARM.

evdev is used as userland interface. FT5406 supports up to
10 touchpoints, but for now driver emulates single touch device
because I do not have GUI bits to test this functionality.

Driver is not enabled in default config for RPI and RPI2

Tested with: evdev-dump, tslib

7 years agohyperv/storvsc: Fix the blkvsc disk attachment issues.
Sepherosa Ziehau [Thu, 29 Sep 2016 01:41:52 +0000 (01:41 +0000)]
hyperv/storvsc: Fix the blkvsc disk attachment issues.

- The original 'disengage' ATA controller model does not work properly
  for all possible disk configurations.  Use the newly added ATA disk
  veto eventhandler to fit into all possible disk configuration.
- If the 'invalid LUN' happens on blkvsc controllers, return
  CAM_DEV_NOT_THERE so that CAM will not destroy attached disks under
  the blkvsc controllers.

Submitted by: Hongjiang Zhang <honzhan microsoft com>
Discussed with: mav
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7693

7 years agoMFV r306423: 7402 Create tunable to ignore hole_birth feature
Alexander Motin [Thu, 29 Sep 2016 00:00:37 +0000 (00:00 +0000)]
MFV r306423: 7402 Create tunable to ignore hole_birth feature

Until we can resolve the numerous hole_birth bugs that have cropped up
recently, and come up with a way going forwards to protect users from
corruption, we should disable the hole_birth feature.  Using a tunable
allows those who are confident that their data is correct to continue to
take advantage of the feature.

Closes #188

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Author: Paul Dagnelie <pcd@delphix.com>

7 years agoMFV r306422: 7254 ztest failed assertion in ztest_dataset_dirobj_verify: dirobjs...
Alexander Motin [Wed, 28 Sep 2016 23:54:47 +0000 (23:54 +0000)]
MFV r306422: 7254 ztest failed assertion in ztest_dataset_dirobj_verify: dirobjs + 1 == usedobjs

dsl_dataset_space is looking at the ds_bp's fill count while
dmu_objset_write_ready() is concurrently modifying it. This fix adds an
rrwlock to protect the ds_bp.

Closes #180

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Author: Paul Dagnelie <pcd@delphix.com>

7 years ago7402 Create tunable to ignore hole_birth feature
Alexander Motin [Wed, 28 Sep 2016 23:46:08 +0000 (23:46 +0000)]
7402 Create tunable to ignore hole_birth feature

Until we can resolve the numerous hole_birth bugs that have cropped up
recently, and come up with a way going forwards to protect users from
corruption, we should disable the hole_birth feature.  Using a tunable
allows those who are confident that their data is correct to continue to
take advantage of the feature.

Closes #188

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Author: Paul Dagnelie <pcd@delphix.com>

7 years ago7254 ztest failed assertion in ztest_dataset_dirobj_verify: dirobjs + 1 == usedobjs
Alexander Motin [Wed, 28 Sep 2016 23:44:13 +0000 (23:44 +0000)]
7254 ztest failed assertion in ztest_dataset_dirobj_verify: dirobjs + 1 == usedobjs

dsl_dataset_space is looking at the ds_bp's fill count while
dmu_objset_write_ready() is concurrently modifying it. This fix adds an
rrwlock to protect the ds_bp.

Closes #180

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Author: Paul Dagnelie <pcd@delphix.com>

7 years agoportsnap: only move expected snapshot contents from snap/ to files/
Ed Maste [Wed, 28 Sep 2016 21:22:51 +0000 (21:22 +0000)]
portsnap: only move expected snapshot contents from snap/ to files/

Previously it was possible to smuggle in addional files that would
be used by later portsnap runs. Now we only move those files expected
to be in the snapshot into files/ and require that there are no
unexpected files.

This was used by portsnap attacks 2, 3, and 4 in the "non-cryptanalytic
attacks against FreeBSD update components" anonymous gist.

Reported by: anonymous gist
Reviewed by: allanjude, delphij
MFC after: ASAP
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8052

7 years agolibm: simplify i387 subdir logic with make's :S substitution
Ed Maste [Wed, 28 Sep 2016 17:44:03 +0000 (17:44 +0000)]
libm: simplify i387 subdir logic with make's :S substitution

7 years agolibm: fix some unused variable (rcsid) and dangling else warnings
Ed Maste [Wed, 28 Sep 2016 14:48:34 +0000 (14:48 +0000)]
libm: fix some unused variable (rcsid) and dangling else warnings

s_{fabs,fmax,logb,scalb}{,f,l}.c may be built elsewhere with a higher
WARNS setting.

Reviewed by: ed
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8061

7 years agoUse SIGSEGV signal for memory protection failures from userspace on MIPS.
Ruslan Bukin [Wed, 28 Sep 2016 14:13:41 +0000 (14:13 +0000)]
Use SIGSEGV signal for memory protection failures from userspace on MIPS.
(same as ARMv8, RISC-V and other architectures do).
This makes mmap tests happy.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agoRemove ifa_list, use ifa_link (structure field) instead.
Kevin Lo [Wed, 28 Sep 2016 13:29:11 +0000 (13:29 +0000)]
Remove ifa_list, use ifa_link (structure field) instead.

While here, prefer if_addrhead (FreeBSD) to if_addrlist (BSD compat) naming
for the interface address list in sctp_bsd_addr.c

Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D8051

7 years agoFill all the siginfo so we have si_value set as well.
Ruslan Bukin [Wed, 28 Sep 2016 12:23:46 +0000 (12:23 +0000)]
Fill all the siginfo so we have si_value set as well.
This fixes timer_create(2) tests.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agoUse right piece of code for FreeBSD.
Ruslan Bukin [Wed, 28 Sep 2016 08:45:42 +0000 (08:45 +0000)]
Use right piece of code for FreeBSD.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agocam/ata: Allow drivers to veto ATA disk attachment.
Sepherosa Ziehau [Wed, 28 Sep 2016 08:35:05 +0000 (08:35 +0000)]
cam/ata: Allow drivers to veto ATA disk attachment.

This eventhandler is mainly used by VMs, e.g. Hyper-V, whose disk
controllers share the disks with the simulated ATA controllers.

Submitted by: Hongjiang Zhang <honzhan microsoft com>
Discussed with: mav
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7693

7 years agoIncrease timeouts for geli tests. It takes 2-3x more time to proceed the
Ruslan Bukin [Wed, 28 Sep 2016 08:11:00 +0000 (08:11 +0000)]
Increase timeouts for geli tests. It takes 2-3x more time to proceed the
tests on MIPS64EB in QEMU.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agohyperv/hn: Flatten RX filter configuration.
Sepherosa Ziehau [Wed, 28 Sep 2016 05:12:09 +0000 (05:12 +0000)]
hyperv/hn: Flatten RX filter configuration.

This paves way for more fixes.

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

7 years agohyperv/hn: Reorder the comment a little bit.
Sepherosa Ziehau [Wed, 28 Sep 2016 05:01:53 +0000 (05:01 +0000)]
hyperv/hn: Reorder the comment a little bit.

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

7 years agohyperv/hn: Reorganize the synthetic parts detach.
Sepherosa Ziehau [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.
Sepherosa Ziehau [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.
Sepherosa Ziehau [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.
Luiz Otavio O Souza [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
Sepherosa Ziehau [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
Toomas Soome [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
Ed Maste [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.
Luiz Otavio O Souza [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
Ed Maste [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.
Marcelo 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.
Ruslan Bukin [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.
Konstantin Belousov [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.
Ruslan Bukin [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
Kevin Lo [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.
Kevin Lo [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
Sepherosa Ziehau [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
Sepherosa Ziehau [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
Justin Hibbits [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)
Oleksandr Tymoshenko [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
Oleksandr Tymoshenko [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
Oleksandr Tymoshenko [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.
Ruslan Bukin [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
Konstantin Belousov [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,
Konstantin Belousov [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.
Pedro F. Giffuni [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 Panchasara [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
Ruslan Bukin [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.
Eric van Gyzen [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.
Jung-uk Kim [Mon, 26 Sep 2016 14:22:17 +0000 (14:22 +0000)]
Merge OpenSSL 1.0.2j.

7 years agoImport OpenSSL 1.0.2j.
Jung-uk Kim [Mon, 26 Sep 2016 14:13:11 +0000 (14:13 +0000)]
Import OpenSSL 1.0.2j.

7 years agoUse bsdlabel as we don't have hardlink disklabel -> bsdlabel on MIPS.
Ruslan Bukin [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.
Ruslan Bukin [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 Panchasara [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).
Konstantin Belousov [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 Moolenaar [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.
Pedro F. Giffuni [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 Chadd [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 Moolenaar [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 Moolenaar [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
Oleksandr Tymoshenko [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
Oleksandr Tymoshenko [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 Moolenaar [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 Chadd [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 Chadd [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.
Andriy Voskoboinyk [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:
Bruce Evans [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 Coosemans [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 Moolenaar [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 Moolenaar [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
Bruce Evans [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
Bruce Evans [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 Turner [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 Elischer [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.
Mark Johnston [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.
Mark Johnston [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
Navdeep Parhar [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 Moolenaar [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 Moolenaar [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 Moolenaar [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
Navdeep Parhar [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
Andriy Gapon [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
Andriy Gapon [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
Andriy Gapon [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
Kristof Provost [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
Justin Hibbits [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
Landon J. Fuller [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 Chadd [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.
Mark Johnston [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
David C Somayajulu [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
Mateusz Guzik [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.
Bryan Drewery [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.
Alexander Motin [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
Navdeep Parhar [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.
Alan Somers [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
Oleksandr Tymoshenko [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
Oleksandr Tymoshenko [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
Navdeep Parhar [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