]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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)

7 years agoRevert svn:mergeinfo added inadvertantly in last commit r306197
imp [Thu, 22 Sep 2016 16:05:19 +0000 (16:05 +0000)]
Revert svn:mergeinfo added inadvertantly in last commit r306197

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