]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoRevert and redo r306083.
imp [Thu, 22 Sep 2016 15:17:36 +0000 (15:17 +0000)]
Revert and redo r306083.

Update the device tree source files to a Linux 4.7-RC.

The dts tree currently can't be merged w/o specific revisions.

Note: due to a stupid bug in the commit checking script, I couldn't
just remove the svn:keyword tag from the new files, I had to add
fbsd:nokeywords to all the files (including ones that didn't need it)

7 years agoWhitespace commit (literally): Add a missing space.
gavin [Thu, 22 Sep 2016 13:59:27 +0000 (13:59 +0000)]
Whitespace commit (literally): Add a missing space.

Sponsored by: EuroBSDCon 2016 Devsummit, Belgrade, Serbia.

7 years agoMerge OpenSSL 1.0.2i.
jkim [Thu, 22 Sep 2016 13:27:44 +0000 (13:27 +0000)]
Merge OpenSSL 1.0.2i.

7 years agoImport OpenSSL 1.0.2i.
jkim [Thu, 22 Sep 2016 13:04:03 +0000 (13:04 +0000)]
Import OpenSSL 1.0.2i.

7 years agoUse bsdlabel as we don't have hardlink disklabel -> bsdlabel
br [Thu, 22 Sep 2016 12:53:11 +0000 (12:53 +0000)]
Use bsdlabel as we don't have hardlink disklabel -> bsdlabel
on some platforms.

Reviewed by: ngie
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D7968

7 years agoSet the standard freebsd brand note for ELF binaries on MIPS,
br [Thu, 22 Sep 2016 12:48:01 +0000 (12:48 +0000)]
Set the standard freebsd brand note for ELF binaries on MIPS,
so binaries now get correct osreldate.

Reviewed by: jhb
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D7899

7 years agoAdjust the sopt_val pointer on bigendian systems (e.g. MIPS64EB).
br [Thu, 22 Sep 2016 12:41:53 +0000 (12:41 +0000)]
Adjust the sopt_val pointer on bigendian systems (e.g. MIPS64EB).

sooptcopyin() checks if size of data provided by user is <= than we can
accept, else it strips down the size. On bigendian platforms we have to
move pointer as well so we copy the actual data.

Reviewed by: gnn
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D7980

7 years agoMake the cloudabi32 kernel module available on ARMv6.
ed [Thu, 22 Sep 2016 12:08:26 +0000 (12:08 +0000)]
Make the cloudabi32 kernel module available on ARMv6.

Now that all of the necessary bits for ARMv6 support for CloudABI have
been checked in, let's hook the kernel module up to the build and
document its existence.

7 years agofd: simplify fgetvp_rights by using fget_cap_locked
oshogbo [Thu, 22 Sep 2016 11:54:20 +0000 (11:54 +0000)]
fd: simplify fgetvp_rights by using fget_cap_locked

Reviewed by: mjg

7 years agocapsicum: propagate rights on accept(2)
oshogbo [Thu, 22 Sep 2016 09:58:46 +0000 (09:58 +0000)]
capsicum: propagate rights on accept(2)

Descriptor returned by accept(2) should inherits capabilities rights from
the listening socket.

PR: 201052
Reviewed by: emaste, jonathan
Discussed with: many
Differential Revision: https://reviews.freebsd.org/D7724

7 years agoAdd TP-Link Archer T4U.
kevlo [Thu, 22 Sep 2016 09:33:22 +0000 (09:33 +0000)]
Add TP-Link Archer T4U.
It will be used by the updated rtwn(4) / urtwn(4) driver.

7 years agoMake it possible to safely use TPIDRURW from userspace.
ed [Thu, 22 Sep 2016 08:14:59 +0000 (08:14 +0000)]
Make it possible to safely use TPIDRURW from userspace.

On amd64, arm64 and i386, we have the possibility to switch between TLS
areas in userspace. The nice thing about this is that it makes it easier
to do light-weight threading, if we ever feel like doing that. On armv6,
let's go into the same direction by making it possible to safely use the
TPIDRURW register, which is intended for this purpose.

Clean up the ARMv6 code to remove md_tp entirely. Simply add a dedicated
field to the PCB to hold the value of TPIDRURW across context switches,
like we do for any other register. As userspace currently uses the
read-only TPIDRURO register, simply ensure that we keep both values in
sync where possible. The system calls for modifying the read-only
register will simply write the intended value into both registers, so
that it lazily ends up in the PCB during the next context switch.

Reviewed by: https://reviews.freebsd.org/D7951
Approved by: andrew
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D7951

7 years agoSmall tweaks to the diskinfo(8) manual page, to make it more consistent
trasz [Thu, 22 Sep 2016 07:55:07 +0000 (07:55 +0000)]
Small tweaks to the diskinfo(8) manual page, to make it more consistent
with others.

MFC after: 1 month

7 years agoAdd "diskinfo -i", a simple aio-based IOPS benchmark.
trasz [Thu, 22 Sep 2016 07:33:43 +0000 (07:33 +0000)]
Add "diskinfo -i", a simple aio-based IOPS benchmark.

MFC after: 1 month

7 years agoThe getsecs() function is implemented in platform- and bootfw-specific
stevek [Thu, 22 Sep 2016 06:24:40 +0000 (06:24 +0000)]
The getsecs() function is implemented in platform- and bootfw-specific
files and, in a number of these places, there were problems with how they
were declared.

Some used int return instead of time_t. On some architectures the bit
width of time_t did not naturally fit into an integer and could lead to
some unexpected behavior. (For example, 32-bit ARM builds uses a 64-bit
time_t.)

Make sure the function prototypes always specify void for the argument
list when they do not have any arguemnts, otherwise some compilers can
complain about the prototype.

Reported by: Kevin Zheng
Reviewed by: sjg
Approved by: sjg (mentor)
Obtained from: Juniper Networks, Inc.
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D7463

7 years agoRegenerate syscall provider argument strings.
markj [Thu, 22 Sep 2016 04:50:03 +0000 (04:50 +0000)]
Regenerate syscall provider argument strings.

7 years agoAnnotate syscall provider pointer arguments with the "userland" keyword.
markj [Thu, 22 Sep 2016 04:49:31 +0000 (04:49 +0000)]
Annotate syscall provider pointer arguments with the "userland" keyword.

This causes dtrace to automatically copyin arguments from userland, so
one no longer has to explicitly use the copyin() action to do so. Moreover,
copyin() on userland addresses is a no-op, so existing scripts should be
unaffected by this change.

Discussed with: rstone
MFC after: 2 weeks

7 years agoRevert r306148 to fix build
cem [Thu, 22 Sep 2016 00:25:23 +0000 (00:25 +0000)]
Revert r306148 to fix build

Requested by: jpaetzel
Reported by: Larry Rosenman <ler at lerctr.org>, Jenkins

7 years agoUpdate oce driver to 11.0.50.0
jpaetzel [Wed, 21 Sep 2016 22:53:16 +0000 (22:53 +0000)]
Update oce driver to 11.0.50.0

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

7 years agoRevert part of r306065
jhibbits [Wed, 21 Sep 2016 22:09:17 +0000 (22:09 +0000)]
Revert part of r306065

This is a separate change I was testing.

7 years agoRegenerate.
bdrewery [Wed, 21 Sep 2016 21:42:06 +0000 (21:42 +0000)]
Regenerate.

7 years agoSYSTEM_COMPILER is not forced off with META_MODE after r304682.
bdrewery [Wed, 21 Sep 2016 21:32:05 +0000 (21:32 +0000)]
SYSTEM_COMPILER is not forced off with META_MODE after r304682.

Sponsored by: Dell EMC Isilon

7 years ago[iwm] use rate control info from the node txrates; use mgmtrate for EAPOL frames
adrian [Wed, 21 Sep 2016 20:56:10 +0000 (20:56 +0000)]
[iwm] use rate control info from the node txrates; use mgmtrate for EAPOL frames

This changes the transmit rate control code to do a few things:

* use fixed rates (mcast, ucast, mgmt) where required.
* Don't use a hard-coded 11a or 11bg rate for non-data frames -
  use what net80211 says we should use.
* use mgmtrate for EAPOL frames.

Reviewed by: avos
Differential Revision: https://reviews.freebsd.org/D7994

7 years ago[net80211] don't add IBSS node table entries for neighbors from other SSIDs.
adrian [Wed, 21 Sep 2016 19:48:07 +0000 (19:48 +0000)]
[net80211] don't add IBSS node table entries for neighbors from other SSIDs.

The adhoc probe/beacon input path was creating nodes for all SSIDs.
This wasn't a problem when the NICs were configured to only process
frames for the current BSSID, but that didn't allow IBSS merges.
Once avos and I flipped on "beacons from all BSSIDs" to allow for
correct IBSS merging, we found this interesting behaviour.

This adds a check against the current SSID.

* If there's no VAP SSID, allow anything
* If there's a VAP SSID, check if the incoming frame has a suitable
  SSID and if so, allow it.

This prevents nodes being created for other SSIDs in probe and beacon
frames - ie, beacons overlapping IBSSes with different SSIDs, and
probe requests from arbitrary devices.

Tested:

* AR9380, IBSS mode, both local and other IBSSes.

Reviewed by: avos
Differential Revision: https://reviews.freebsd.org/D7959

7 years agoFix typo.
np [Wed, 21 Sep 2016 19:30:34 +0000 (19:30 +0000)]
Fix typo.

7 years agocxgbetool: Add T6 support to the SGE context decoder.
np [Wed, 21 Sep 2016 19:26:36 +0000 (19:26 +0000)]
cxgbetool: Add T6 support to the SGE context decoder.

Obtained from: Chelsio Communications
Sponsored by: Chelsio Communications

7 years agoAdd myself (jrm) to calendar.freebsd
jrm [Wed, 21 Sep 2016 18:52:49 +0000 (18:52 +0000)]
Add myself (jrm) to calendar.freebsd

Approved by:    swills (mentor)

7 years agoAdd evdev support to ums(4)
gonzo [Wed, 21 Sep 2016 18:52:03 +0000 (18:52 +0000)]
Add evdev support to ums(4)

event generation is disabled by default in favour of sysmouse. This
behavoiur is controlled by kern.evdev.rcpt_mask sysctl, bit 2 should
be set to give priority to hw over sysmouse

Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
Reviewed by: hans
Differential Revision: https://reviews.freebsd.org/D7863

7 years agoAdd myself (jrm) as a ports committer and update mentor/mentee relationships
jrm [Wed, 21 Sep 2016 18:50:11 +0000 (18:50 +0000)]
Add myself (jrm) as a ports committer and update mentor/mentee relationships

Approved by: swills (mentor)

7 years agoAdd evdev support to ukbd driver
gonzo [Wed, 21 Sep 2016 18:47:21 +0000 (18:47 +0000)]
Add evdev support to ukbd driver

event generation is disabled by default in favour of kbdmux. This
behavoiur is controlled by kern.evdev.rcpt_mask sysctl, bit 3 should
be set to give priority to hw over mux

Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
Reviewed by: hans
Differential Revision: https://reviews.freebsd.org/D7957

7 years agoUpdate mkimg(1) author's contact info
asomers [Wed, 21 Sep 2016 18:42:17 +0000 (18:42 +0000)]
Update mkimg(1) author's contact info

Reviewed by: marcel, imp
MFC after: 3 days
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D7991

7 years agoReduce code duplication by factoring out the delta_t() function.
trasz [Wed, 21 Sep 2016 18:07:25 +0000 (18:07 +0000)]
Reduce code duplication by factoring out the delta_t() function.
No functional changes.

MFC after: 1 month

7 years agoposix_openpt.2: Sort includes per style(9)
cem [Wed, 21 Sep 2016 17:51:27 +0000 (17:51 +0000)]
posix_openpt.2: Sort includes per style(9)

Sponsored by: Dell EMC Isilon

7 years agoFix invalid vendor ID constant (typo).
jhb [Wed, 21 Sep 2016 16:51:56 +0000 (16:51 +0000)]
Fix invalid vendor ID constant (typo).

During a bus rescan the check for an invalid vendor ID of a subfunction
used the wrong constant.

Submitted by: Dexuan Cui <decui@microsoft.com>
MFC after: 3 days

7 years ago1) For already non-standard %z extension implement GNU compatible formats:
ache [Wed, 21 Sep 2016 15:47:40 +0000 (15:47 +0000)]
1) For already non-standard %z extension implement GNU compatible formats:
+hh and -hh.
2) Check for incorrect values for %z.

MFC after:      7 days

7 years agoHopefully, fix build of the module outside the kernel tree.
kib [Wed, 21 Sep 2016 14:42:23 +0000 (14:42 +0000)]
Hopefully, fix build of the module outside the kernel tree.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoAdd support for the TP-Link TG-3468 v2.
kevlo [Wed, 21 Sep 2016 14:15:15 +0000 (14:15 +0000)]
Add support for the TP-Link TG-3468 v2.

This is an RTL8168 chip, which we already support so all we have to do is add
the vendor ID.

PR: 212876
Submitted by: Tobias Kortkamp <t@tobik.me>
MFC after: 3 days

7 years agoRefine the dirname(3) compatibility workaround a bit more.
ed [Wed, 21 Sep 2016 13:03:55 +0000 (13:03 +0000)]
Refine the dirname(3) compatibility workaround a bit more.

Right now our workaround is so good that it doesn't throw any warnings
on misuse. This means that people will keep on using the old version
of dirname(3) silently without fixing their code.

Go ahead and change the prototype of __old_dirname() to also use a plain
char *, so that we still get a compiler warning. This won't have any
negative effect on building older versions of FreeBSD on HEAD, as those
are built with -Werror disabled.

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

7 years agoFix misuse of the basename() and dirname() functions.
ed [Wed, 21 Sep 2016 13:02:43 +0000 (13:02 +0000)]
Fix misuse of the basename() and dirname() functions.

These functions are allowed to overwrite their input. Pull a copy of the
input parameter and call dirname() and basename() on that instead. Do
ensure that we reload the pathname value between calls.

7 years agoUse kqueue(2) instead of select(2).
br [Wed, 21 Sep 2016 11:59:52 +0000 (11:59 +0000)]
Use kqueue(2) instead of select(2).
This helps to ensure we will not lose SIGINT sent by parent to child.

Reviewed by: sbruno, ngie
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D7892

7 years agoAdd kernel interfaces to call EFI Runtime Services.
kib [Wed, 21 Sep 2016 11:31:58 +0000 (11:31 +0000)]
Add kernel interfaces to call EFI Runtime Services.

Runtime services require special execution environment for the call.
Besides that, OS must inform firmware about runtime virtual memory map
which will be active during the calls, with the SetVirtualAddressMap()
runtime call, done while the 1:1 mapping is still used.  There are two
complication: the SetVirtualAddressMap() effectively must be done from
loader, which needs to know kernel address map in advance.  More,
despite not explicitely mentioned in the specification, both 1:1 and
the map passed to SetVirtualAddressMap() must be active during the
SetVirtualAddressMap() call.  Second, there are buggy BIOSes which
require both mappings active during runtime calls as well, most likely
because they fail to identify all relocations to perform.

On amd64, we can get rid of both problems by providing 1:1 mapping for
the duration of runtime calls, by temprorary remapping user addresses.
As result, we avoid the need for loader to know about future kernel
address map, and avoid bugs in BIOSes.  Typically BIOS only maps
something in low 4G.  If not runtime bugs, we would take advantage of
the DMAP, as previous versions of this patch did.

Similar but more complicated trick can be used even for i386 and 32bit
runtime, if and when the EFI boot on i386 is supported.  We would need
a trampoline page, since potentially whole 4G of VA would be switched
on calls, instead of only userspace portion on amd64.

Context switches are disabled for the duration of the call, FPU access
is granted, and interrupts are not disabled.  The later is possible
because kernel is mapped during calls.

To test, the sysctl mib debug.efi_time is provided, setting it to 1
makes one call to EFI get_time() runtime service, on success the efitm
structure is printed to the control terminal.  Load efirt.ko, or add
EFIRT option to the kernel config, to enable code.

Discussed with: emaste, imp
Tested by: emaste (mac, qemu)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoCosmetics - add missing newline.
trasz [Wed, 21 Sep 2016 11:27:56 +0000 (11:27 +0000)]
Cosmetics - add missing newline.

MFC after: 1 month

7 years agoMake the "r/s" and "w/s" fields in "iostat -x" a little bit wider;
trasz [Wed, 21 Sep 2016 11:22:19 +0000 (11:22 +0000)]
Make the "r/s" and "w/s" fields in "iostat -x" a little bit wider;
five chars is way too narrow for todays disks.

MFC after: 1 month

7 years agoMake it possible for diskinfo(8) to operate on files. This is useful
trasz [Wed, 21 Sep 2016 11:17:58 +0000 (11:17 +0000)]
Make it possible for diskinfo(8) to operate on files.  This is useful
with -t and upcoming -i.

MFC after: 1 month

7 years agoDisable extattr test on UFS1.
br [Wed, 21 Sep 2016 10:58:58 +0000 (10:58 +0000)]
Disable extattr test on UFS1.

This test supports native extended attributes only (e.g. UFS2)

Reviewed by: asomers, ngie
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D7981

7 years agoRename efi_systbl to efi_systbl_phys, the variable contains the
kib [Wed, 21 Sep 2016 10:55:28 +0000 (10:55 +0000)]
Rename efi_systbl to efi_systbl_phys, the variable contains the
physical address of the EFI System Table.  Add _KERNEL guard around
its declaration in sys/efi.h.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoAdd a way for the architecture to specify the calling ABI for methods
kib [Wed, 21 Sep 2016 10:35:44 +0000 (10:35 +0000)]
Add a way for the architecture to specify the calling ABI for methods
in the EFI Runtime Services Table.  On amd64, the calling conventions
are MS.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoSimple post-mortem reporter for amd64 loader.efi.
kib [Wed, 21 Sep 2016 10:22:46 +0000 (10:22 +0000)]
Simple post-mortem reporter for amd64 loader.efi.

There is no way to see anything about the faults occuring in
loader.efi. Some intel BIOSes do output a line into serial port at
115200/8/1 regardless of the current port settings with the EFI error
number, but this is too little, and not always available, esp. if the
user does not know where to look.

The patch adds a simple facility to grab exceptions and at least dump
generic registers and some exception details.  Due to the relative
complexity of correctly taking over the BIOS IDT setup, only install
the facility on user request.

Two new commands, 'grab_faults' and 'ungrab_faults' are provided,
first one takes over, second undoes the first. It is supposed that
user would execute 'grab' by the developer direction of collecting the
debugging data.  The 'fault' command generates exception to test the
setup.

Fault handlers use dedicated stack to improve chances of catching
stack/TSS exceptions.  Due to this, BIOS IDT is duplicated into a
private copy, and debugger needs to find a free GDT slot for TSS. This
is done in somewhat complicated efi_redirect_exceptions().

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D7935

7 years agoMake resettodr_lock accessible outside subr_rtc.c. Protect
kib [Wed, 21 Sep 2016 10:15:08 +0000 (10:15 +0000)]
Make resettodr_lock accessible outside subr_rtc.c.  Protect
CLOCK_GETTIME() with the lock.

Now all time-related accesses to the CMOS for RTC should be under the
lock.  This is needed to allow upcoming EFI Runtime Services support
to provide required execution environment for the firmware calls.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoAdd amd64 functions to load/store GDT register, store IDT and TR registers.
kib [Wed, 21 Sep 2016 10:10:36 +0000 (10:10 +0000)]
Add amd64 functions to load/store GDT register, store IDT and TR registers.

Note that lgdt() name is already used for function which, besides
loading GDT, also reloads segment descriptors cache, thus new function
is named bare_lgdt().

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoExport the pmap_cache_bits() and pmap_pinit_pml4() functions from the
kib [Wed, 21 Sep 2016 10:05:51 +0000 (10:05 +0000)]
Export the pmap_cache_bits() and pmap_pinit_pml4() functions from the
amd64 pmap.

The new pmap_pinit_pml4() function initializes the level 4 page table
with entries for the kernel mappings.  Both functions are needed for
upcoming EFI Runtime Services support.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoUpdate the device tree source files to a Linux 4.7-RC.
andrew [Wed, 21 Sep 2016 08:54:08 +0000 (08:54 +0000)]
Update the device tree source files to a Linux 4.7-RC.

MFC after: 2 weeks
Sponsored by: ABT Systems Ltd

7 years agoFix the handling of unordered fragmented user messages using DATA chunks.
tuexen [Wed, 21 Sep 2016 08:28:18 +0000 (08:28 +0000)]
Fix the handling of unordered fragmented user messages using DATA chunks.

There were two bugs:
* There was an accounting bug resulting in reporting a too small a_rwnd.
* There are a bug when abandoning messages in the reassembly queue.

MFC after: 4 weeks

7 years agoAdd PROC_TRAPCAP procctl(2) controls and global sysctl kern.trap_enocap.
kib [Wed, 21 Sep 2016 08:23:33 +0000 (08:23 +0000)]
Add PROC_TRAPCAP procctl(2) controls and global sysctl kern.trap_enocap.

Both can be used to cause processes in capability mode to receive
SIGTRAP when ENOTCAPABLE or ECAPMODE errors are returned from
syscalls.

Idea by: emaste
Reviewed by: oshogbo (previous version), emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D7965

7 years agoMFC r305939:
kib [Wed, 21 Sep 2016 08:14:55 +0000 (08:14 +0000)]
MFC r305939:
Remove trailing space.

7 years agoBump __FreeBSD_version after r305988, removal of bio_taskqueue().
trasz [Wed, 21 Sep 2016 07:25:05 +0000 (07:25 +0000)]
Bump __FreeBSD_version after r305988, removal of bio_taskqueue().

Suggested by: asomers@

7 years agohyperv/hn: Put debug messages under bootverbose
sephe [Wed, 21 Sep 2016 06:54:26 +0000 (06:54 +0000)]
hyperv/hn: Put debug messages under bootverbose

While I'm here, strip blank line.

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

7 years ago1) Microoptimize %p case.
ache [Wed, 21 Sep 2016 06:44:32 +0000 (06:44 +0000)]
1) Microoptimize %p case.
2) Implememt %u for GNU compatibility.
3) Don't forget to advance buf for %w/%u.
4) Fail with incomplete week (week 0) request and no such week in the
year.
5) Fix yday formula when Sunday requested and the week started from Monday.
6) Fail with impossible yday for incomplete week (week 0) and direct %w/%u
request.
7) Shift yday/wday to the first day of the year, if incomplete week
(week 0) requested and no %w/%u used.

MFC after:      7 days

7 years agohyperv/vmbus: Assert that the bufring address is page aligned.
sephe [Wed, 21 Sep 2016 06:43:52 +0000 (06:43 +0000)]
hyperv/vmbus: Assert that the bufring address is page aligned.

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

7 years agohyperv/hn: Allocate bufrings in attach DEVMETHOD.
sephe [Wed, 21 Sep 2016 06:27:42 +0000 (06:27 +0000)]
hyperv/hn: Allocate bufrings in attach DEVMETHOD.

So that reinitialization, e.g. MTU change, will not fail when the system
memory is excessively fragmented.

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

7 years agohyperv/vmbus: Allow bufrings preallocation.
sephe [Wed, 21 Sep 2016 05:56:47 +0000 (05:56 +0000)]
hyperv/vmbus: Allow bufrings preallocation.

The assumption that the channel is only opened upon synthetic device
attach time no longer holds, e.g. Hyper-V network device MTU changes.
We have to allow device drivers to preallocate bufrings, e.g. in
attach DEVMETHOD, to prevent bufring allocation failure once the
system memory is fragmented after running for a while.

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

7 years agoFix bug introduced with r302388, which could cause processes accessing
trasz [Wed, 21 Sep 2016 05:44:13 +0000 (05:44 +0000)]
Fix bug introduced with r302388, which could cause processes accessing
automounted shares to hang with "vfs_busy" wchan.

(As a workaround one can run 'automount -u' from cron.)

Reviewed by: kib@
MFC after: 1 month

7 years agoAdd support for SPI-mapped MSI interrupts outside of GICv2m.
wma [Wed, 21 Sep 2016 05:33:18 +0000 (05:33 +0000)]
Add support for SPI-mapped MSI interrupts outside of GICv2m.

SPI-mapped MSI interrupts coming from a controller other
than GICv2m need to have their trigger and polarity
properly configured. This patch fixes MSI/MSI-X
on Annapurna Alpine platform with GICv2.

Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           skra, wma
Differential Revision: https://reviews.freebsd.org/D7698

7 years agoAdd support for SPI-mapped MSI interrupts in GICv3.
wma [Wed, 21 Sep 2016 05:22:49 +0000 (05:22 +0000)]
Add support for SPI-mapped MSI interrupts in GICv3.

PIC_SETUP_INTR implementation in GICv3 did not allow
for setting up interrupts without included FDT
description. GICv2m-like MSI interrupts, which map
MSI messages to SPI interrupt lines, may not have
a description in FDT. Add support for such interrupts
by setting the trigger and polarity to the appropriate
values for MSI (edge, high) and get the hardware
IRQ number from the corresponding ISRC.

Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           wma
Differential Revision: https://reviews.freebsd.org/D7662

7 years agoRegister GICv3 xref.
wma [Wed, 21 Sep 2016 05:15:50 +0000 (05:15 +0000)]
Register GICv3 xref.

This allows other drivers to retrieve interrupt parent node.

Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           wma, zbb
Differential Revision: https://reviews.freebsd.org/D7568

7 years agoMove ofw_parse_bootargs to the correct place.
jhibbits [Wed, 21 Sep 2016 03:10:41 +0000 (03:10 +0000)]
Move ofw_parse_bootargs to the correct place.

Also, create a static initial environment, so bootargs can be set from uboot.

7 years agoMove ofw_cpu file to the main files conf file.
jhibbits [Wed, 21 Sep 2016 02:56:57 +0000 (02:56 +0000)]
Move ofw_cpu file to the main files conf file.

There is nothing CPU specific here, and it's usable by both fdt and Open
Firmware based systems.  Rather than keeping the same file in every one, just
add it to the ofw/fdt block in the main file.

7 years agoAdd a ofw_parse_bootargs function, and use it for powerpc
jhibbits [Wed, 21 Sep 2016 02:28:39 +0000 (02:28 +0000)]
Add a ofw_parse_bootargs function, and use it for powerpc

Summary:
If the environment variable is set, U-boot adds a 'bootargs' property to
/chosen.  This is already handled by ARM and MIPS, but should be handled in a
central location.  For now, ofw_subr.c is a good place until we determine if it
should be moved to init_main.c, or somewhere more central to all architectures.

Eventually arm and mips should be modified to use ofw_parse_bootargs() as well,
rather than using the duplicate code already.

Reviewed By: adrian
Differential Revision: https://reviews.freebsd.org/D7846

7 years agoAdd yet another QorIQ GPIO compat string.
jhibbits [Wed, 21 Sep 2016 02:27:23 +0000 (02:27 +0000)]
Add yet another QorIQ GPIO compat string.

P1022 boards use the string "fsl,pq3-gpio", which seems to be common in Linux
dts files.

7 years agocxgbe(4): Setup congestion response for T6 rx queues.
np [Wed, 21 Sep 2016 00:50:22 +0000 (00:50 +0000)]
cxgbe(4): Setup congestion response for T6 rx queues.

7 years agocxgbe(4): Show wcwr_stats for T6 cards.
np [Wed, 21 Sep 2016 00:46:08 +0000 (00:46 +0000)]
cxgbe(4): Show wcwr_stats for T6 cards.

7 years agoProtect ccbq access with devq->send_mtx in the XPT_ABORT handler.
markj [Wed, 21 Sep 2016 00:08:42 +0000 (00:08 +0000)]
Protect ccbq access with devq->send_mtx in the XPT_ABORT handler.

Submitted by: Ryan Libby <rlibby@gmail.com>
Reviewed by: mav
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D7985

7 years agoelfdump: limit STDIN to no rights rather than closing it
emaste [Tue, 20 Sep 2016 21:38:12 +0000 (21:38 +0000)]
elfdump: limit STDIN to no rights rather than closing it

Closing stdin/stdout/stderr is often a bad idea as a future open()
can end up with its fd. Leave it open and limit it to no rights
instead.

Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D7984

7 years agodhclient(8): Enable numbered user class ID option
cem [Tue, 20 Sep 2016 19:21:41 +0000 (19:21 +0000)]
dhclient(8): Enable numbered user class ID option

By adding it to the option priorities table.

PR: 184117
Submitted by: Lowell Gilbert <freebsd-bugs-local at be-well.ilk.org>
Reported by: Tomek CEDRO <cederom at tlen.pl>
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D7911

7 years agoIf present, honor the USB port mode (host or peripheral) set on DTS, if not,
loos [Tue, 20 Sep 2016 19:06:58 +0000 (19:06 +0000)]
If present, honor the USB port mode (host or peripheral) set on DTS, if not,
keep the beaglebone defaults: USB0 -> peripheral/gadget, USB1 -> host.

This is only a workaround as in fact fact this hardware is capable of detect
the USB port mode based on type of cable and act according with the detected
mode.  Unfortunately the driver does not handle that at moment.

MFC after: 3 days
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agonet80211: remove IEEE80211_RADIOTAP_TSFT field from transmit definitions.
avos [Tue, 20 Sep 2016 18:53:42 +0000 (18:53 +0000)]
net80211: remove IEEE80211_RADIOTAP_TSFT field from transmit definitions.

This field may be used for received frames only.

Differential Revision: https://reviews.freebsd.org/D3826
Differential Revision: https://reviews.freebsd.org/D3827

7 years agoFix periodic scripts when an NFS mount covers a local mount
asomers [Tue, 20 Sep 2016 18:47:33 +0000 (18:47 +0000)]
Fix periodic scripts when an NFS mount covers a local mount

100.chksetuid and 110.neggrpperm try to search through all UFS and ZFS
filesystems. But their logic contains an error. They also search through
remote filesystems that are mounted on top of the root of a local
filesystem. For example, if a user installs a FreeBSD system with the
default ZFS layout, he'll get a zroot/usr/home filesystem. If he then mounts
/usr/home over NFS, these scripts would search through /usr/home.

MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D7482

7 years agoReduce code duplication around NDP message handlers in icmp6_input().
markj [Tue, 20 Sep 2016 18:08:17 +0000 (18:08 +0000)]
Reduce code duplication around NDP message handlers in icmp6_input().

No functional change intended.

MFC after: 2 weeks

7 years agoAlways pass -m to ld for converting binary files to kernel ELF objects
emaste [Tue, 20 Sep 2016 17:07:14 +0000 (17:07 +0000)]
Always pass -m to ld for converting binary files to kernel ELF objects

This is in preparation for linking with LLVM's lld, which does not have
a compiled-in default output emulation. lld requires that it is
specified via the -m option, or obtained from the object file(s) being
linked.

This will also allow all build targets to share a common linker binary.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7837

7 years agoPort vnd_test to FreeBSD
ngie [Tue, 20 Sep 2016 16:40:15 +0000 (16:40 +0000)]
Port vnd_test to FreeBSD

Use mdmfs/mdconfig instead of vndconfig/newfs. vndconfig doesn't exist on FreeBSD.

TODO: need to parameterize out the md(4) device as it's currently hardcoded to "3"
(in both the FreeBSD and NetBSD cases).

MFC after: 1 month
Sponsored by: Dell EMC Isilon

7 years agoPort to mknod_test and readdir_test to FreeBSD
ngie [Tue, 20 Sep 2016 16:37:02 +0000 (16:37 +0000)]
Port to mknod_test and readdir_test to FreeBSD

The `mknod <file> p` command doesn't exist on FreeBSD, like on NetBSD. Use
mkfifo instead to create named pipes (FIFOs).

MFC after: 1 month
Sponsored by: Dell EMC Isilon

7 years agoPort sizes_test and statvfs_test to FreeBSD
ngie [Tue, 20 Sep 2016 16:31:57 +0000 (16:31 +0000)]
Port sizes_test and statvfs_test to FreeBSD

Similar to r306030, use a simpler method for getting the value of
`hw.pagesize`, i.e. `sysctl -n hw.pagesize`. The awk filtering method doesn't
work on FreeBSD

MFC after: 1 month
Sponsored by: Dell EMC Isilon

7 years agoPort contrib/netbsd-tests/fs/h_funcs.subr to FreeBSD
ngie [Tue, 20 Sep 2016 16:28:57 +0000 (16:28 +0000)]
Port contrib/netbsd-tests/fs/h_funcs.subr to FreeBSD

Use kldstat -m to determine whether or not a filesystem is loaded. This works
well with tmpfs, ufs, and zfs

MFC after: 1 month
Sponsored by: Dell EMC Isilon

7 years agoPort vnode_leak_test:main to FreeBSD
ngie [Tue, 20 Sep 2016 16:27:34 +0000 (16:27 +0000)]
Port vnode_leak_test:main to FreeBSD

Use a simpler way of dumping kern.maxvnodes, i.e. `sysctl -n kern.maxvnodes`

The awk filtering method employed in NetBSD doesn't work on FreeBSD

MFC after: 1 month
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP instead of the longhand version for defining the path to contrib/atf
ngie [Tue, 20 Sep 2016 16:24:22 +0000 (16:24 +0000)]
Use SRCTOP instead of the longhand version for defining the path to contrib/atf

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoSpell alphabetically correctly both in the commit message AND in the
imp [Tue, 20 Sep 2016 15:14:33 +0000 (15:14 +0000)]
Spell alphabetically correctly both in the commit message AND in the
actual man page. Sigh.

Submitted by: David A Bright and Pedro Giffuni

7 years agobspatch: Remove backwards-compatibility sys/capability.h support
emaste [Tue, 20 Sep 2016 15:13:15 +0000 (15:13 +0000)]
bspatch: Remove backwards-compatibility sys/capability.h support

bspatch previously included sys/capability.h or sys/capsicum.h based
on __FreeBSD_version, as FreeBSD is the upstream for bsdiff and we may
see this file incorporated into other third-party software.

The Capsicum header is now installed as sys/capsicum.h in stable/10 and
FreeBSD 10.3, so we can just use sys/capsicum.h and simplify the logic.

Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D7954

7 years agomrsas: update for sys/capability.h rename in r263232
emaste [Tue, 20 Sep 2016 12:59:30 +0000 (12:59 +0000)]
mrsas: update for sys/capability.h rename in r263232

7 years agoauditdistd: update for sys/capability.h rename in r263232
emaste [Tue, 20 Sep 2016 12:58:28 +0000 (12:58 +0000)]
auditdistd: update for sys/capability.h rename in r263232

7 years agohwpmc: remove sys/capability.h backwards compatibility
emaste [Tue, 20 Sep 2016 12:56:03 +0000 (12:56 +0000)]
hwpmc: remove sys/capability.h backwards compatibility

The Capsicum header is installed as sys/capsicum.h in stable/10 as well.

7 years agoAdd driver for PCIe root complex on Annapurna Alpine platform.
wma [Tue, 20 Sep 2016 11:11:06 +0000 (11:11 +0000)]
Add driver for PCIe root complex on Annapurna Alpine platform.

The driver subclasses pci-host-generic and additionally
performs configuration of vendor-specific PCIe registers.

Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           wma
Differential Revision: https://reviews.freebsd.org/D7571

7 years agoMove pmap_p*e_index() inline functions from pmap.c to pmap.h.
kib [Tue, 20 Sep 2016 09:38:07 +0000 (09:38 +0000)]
Move pmap_p*e_index() inline functions from pmap.c to pmap.h.
They are already used in minidump code.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoUpdate Annapurna Alpine HAL
wma [Tue, 20 Sep 2016 09:19:22 +0000 (09:19 +0000)]
Update Annapurna Alpine HAL

alpine-hal SerDes file was omitted in the previous commit.
Files added here.
All unnecessary (old) files were also removed.
Merge from vendor-sys, r306017

7 years agoFollow up r305988 by removing g_bio_run_task and related code.
trasz [Tue, 20 Sep 2016 09:18:33 +0000 (09:18 +0000)]
Follow up r305988 by removing g_bio_run_task and related code.
The g_io_schedule_up() gets its "if" condition swapped to make
it more similar to g_io_schedule_down().

Suggested by: mav@
Reviewed by: mav@
MFC after: 1 month

7 years agohyperv/storvsc: Fix SRB length setting.
sephe [Tue, 20 Sep 2016 08:52:45 +0000 (08:52 +0000)]
hyperv/storvsc: Fix SRB length setting.

This fixes disk discovery issue on WS2008R2 Hyper-V, which plagued
us since 10.2-release.

Reported by: many
MFC after: 3 days
Sponsored by: Microsoft

7 years agohyperv/hn: Let the caller of hn_nvs_doinit() do the error logging.
sephe [Tue, 20 Sep 2016 05:45:18 +0000 (05:45 +0000)]
hyperv/hn: Let the caller of hn_nvs_doinit() do the error logging.

So that NVS version probing failure does not look too scary.

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

7 years agohyperv/hn: Fix ifnet hwassist setup.
sephe [Tue, 20 Sep 2016 05:26:40 +0000 (05:26 +0000)]
hyperv/hn: Fix ifnet hwassist setup.

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

7 years agoFix -media to not mount ufs with "async"; it doesn't make sense when
trasz [Tue, 20 Sep 2016 04:54:00 +0000 (04:54 +0000)]
Fix -media to not mount ufs with "async"; it doesn't make sense when
there is softupdates.

Suggested by: imp@
MFC after: 1 month

7 years agoStop appending "noatime" in the autofs -media map, and instead add it
trasz [Tue, 20 Sep 2016 04:52:01 +0000 (04:52 +0000)]
Stop appending "noatime" in the autofs -media map, and instead add it
to auto_master, since all filesystems seem to support it.  It's cleaner
this way, and easier to customize.

MFC after: 1 month

7 years agoDocument existing practice and be more clear about sys/foo.h files
imp [Tue, 20 Sep 2016 04:50:53 +0000 (04:50 +0000)]
Document existing practice and be more clear about sys/foo.h files
being alphabetical with sys/param.h or sys/types.h being first. Expand
the example to hopefully make this (slightly) clearer.

Noticed by: cem@