215057 Commits

Author SHA1 Message Date
Emmanuel Vadot
9746573017 MFC r302785, r308300, r308441
r302785 (jmcneill):
H3/A83T: Use PLL_PERIPH/2 for AHB2 parent clock.

Reviewed by:	manu

r308300:
For AHB clock we need to set the assigned parents for cpufreq(4) to work.

r308441:
Do not fail to attach the clock if we cannot set the assigned parents as this
property isn't mandatory.
2016-12-09 21:17:40 +00:00
Ed Maste
a4b6968e78 MFC r305951: elfdump: adjust stdout/stderr capabilities
stdio uses fstat and the TIOCGETA ioctl. Also collapse the
cap_rights_limit and new cap_ioctls_limit calls into one if statement.
Errors here are not actionable by the user and distinguishing stdout
from stderr doesn't really have value.
2016-12-09 21:07:03 +00:00
Emmanuel Vadot
7f47c2053d MFC r308298, r308440
r308298:
Add clk_set_assigned

assigned-clock-parents are DT properties used to configure
some default parent clocks on one node.

Reviewed by:	mmel

r308440:
Do not warn if the 'assigned-clock-parents' property does not exists.
2016-12-09 21:00:16 +00:00
Emmanuel Vadot
2dd6565094 MFC r304796, r308233 (jmcneill)
r304796:
Switch parent clock when setting frequency if a new parent is a better
candidate for the target rate.

Reviewed by:	andrew, manu

r308233:
The DTS may report fewer than 4 parents for a module clock. Avoid setting
the module clock parent to an out-of-range index in these cases.
2016-12-09 20:52:48 +00:00
Emmanuel Vadot
9add8f3256 MFC r302587 (jmcneill):
Include sys/rman.h to fix build on arm64.
2016-12-09 20:48:47 +00:00
Emmanuel Vadot
6cc2e33360 MFC r302584 (jmcneill):
Remove unused bus_space prototypes.
2016-12-09 20:45:11 +00:00
Emmanuel Vadot
36ad82ff16 MFC r302586 (jmcneill):
Attach RSB early. Children of RSB may provide resources necessary for
other devices such as interrupts, GPIOs, and regulators.
2016-12-09 20:37:34 +00:00
Emmanuel Vadot
5c4e70ef26 MFC r304795, r307366 (jmcneill):
r304795:
Add support for Allwinner multi-parent bus gates.

Reviewed by:	andrew, manu

r307366:
Match "allwinner,sun8i-h3-apb0-gates-clk" compatible string.
2016-12-09 20:35:01 +00:00
Emmanuel Vadot
e1f8d4ecdd MFC r305058 (jmcneill):
Add support for Allwinner A64 watchdog timer.
2016-12-09 20:28:28 +00:00
Emmanuel Vadot
30fa73ff8d MFC r302585 (jmcneill):
Build fix for arm64. The phy interface uses intptr_t for the "phy"
parameter, not int.
2016-12-09 20:25:59 +00:00
Emmanuel Vadot
6e4ffbc333 MFC r308235 (jmcneill):
Register the device's xref handle at attach time.
2016-12-09 20:21:48 +00:00
Emmanuel Vadot
991c768b9b MFC r308309:
Add support for AXP221 Power Management Unit.

AXP221 is used on board with A31/A31S and is mostly compatible with AXP209.
Regulators, GPIO and Sensors are supported.
2016-12-09 20:17:07 +00:00
Emmanuel Vadot
a4687dce73 MFC r305349 (jmcneill):
Add support for reading root key on A83T/A64.
2016-12-09 20:13:31 +00:00
Emmanuel Vadot
f5789331bf MFC r308704-r308705 (jmcneill)
r308704:
Allow the MMC frequency to be set up to 52MHz for MMC high speed timings.

r308705:
On command error, reset only DMA and FIFO engines instead of the entire
controller. Fixes eMMC device detection on OrangePi Plus 2e (and likely
others).
2016-12-09 20:07:01 +00:00
Emmanuel Vadot
1ff777a552 MFC r309029:
Do not attempt to disable/release clock if it had not been enabled.
While here fix a style(9) issue.
2016-12-09 20:03:49 +00:00
Emmanuel Vadot
94f43b7b3e MFC r304793 (jmcneill):
Remove dependency on allwinner_soc_family() as it is not available on arm64.
2016-12-09 19:40:33 +00:00
Emmanuel Vadot
54951a2eab MFC r306479 (mmel):
ALLWINNER: ahci_devclass is local variable, don't export it.
2016-12-09 19:36:13 +00:00
Ed Maste
e1c46a4b79 MFC r306825: portsnap: use lam on the known good hash list
This change is equivalent to the approach committed in r306417, but if
sed has a bug it could be exploited by the untrusted tar file. Instead,
generate the expected tar content and compare that with find's output.

Submitted by:	cperciva (in review D8052)
2016-12-09 17:21:59 +00:00
Ed Maste
42cce7de38 MFC r309298: libm: remove duplicate version script entries
These symbols already appear in the common lib/msun/Symbol.map.
Duplicate entries produce an error with LLVM's LLD linker.

Sponsored by:	The FreeBSD Foundation
2016-12-09 17:20:24 +00:00
Justin Hibbits
d893b4061b MFC r309167:
Add an isync to after mtsrin, required by the MPC750 errata
2016-12-09 04:35:07 +00:00
John Baldwin
c5eda42328 MFC 309613: cxgbe(4): Update firmwares from version 1.16.12.0 to 1.16.22.0.
Sponsored by:	Chelsio Communications
2016-12-09 01:44:26 +00:00
Oleg Bulyzhin
7f2a228f1f MFC r309281:
Fix 'ipfw delete set N':
do not emit meaningless 'rule 0 not found' warning if set was already empty.
2016-12-08 12:42:36 +00:00
Martin Matuska
b8704dd46c Partial MFC r309300:
Apply fix for libarchive issue #821:
  "tar -P" cannot extract hardlinks through symlinks

PR:		213255
Reported by:	Tijl Coosemans <tilj@FreeBSD.org>
2016-12-08 01:06:09 +00:00
Gleb Smirnoff
65619a05c5 Merge rr309688: address regressions in SA-16:37.libc.
PR:		215105
Submitted by:	<jtd2004a sbcglobal.net>
2016-12-07 23:19:46 +00:00
Glen Barber
57a8592304 Document EN-16:19, EN-16:20, EN-16:21, SA-16:36, SA-16:37, SA-16:38.
Sponsored by:	The FreeBSD Foundation
2016-12-07 18:55:55 +00:00
Enji Cooper
274e90f02b MFC r306030,r306031,r306033,r306036,r306038,r307190,r307196,r307204,r307205,r307701,r307702:
r306030:

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

r306031:

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

r306033:

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

r306036:

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).

r306038:

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).

r307190:

Skip :uchg on FreeBSD

Unfortunately removing files with uchg set always succeeds with root on
FreeBSD. Unfortunately running the test as an unprivileged user isn't doable
because mounting tmpfs requires root

PR:		212861

r307196:

Port contrib/netbsd-tests/fs/tmpfs/h_tools.c to FreeBSD

- Add inttypes.h #include for PRId64 macro
- Use FreeBSD's copy of getfh(2), which doesn't include a `fh_size` parameter.
  Use sizeof(fhandle_t) instead as the size of fhp is always fixed as
  fhandle_t, unlike NetBSD's copy of fhp, which is void*.

r307204:

Expect :large to fail on FreeBSD

FreeBSD doesn't appear to validate large -o size values like
NetBSD does

PR:		212862

r307205:

Change atf_skip call to atf_expect_fail to make it clear that a failure is
expected

PR:		212861
Suggested by:	jmmv

r307701:

Expect tests/sys/fs/tmpfs/link_test:kqueue to fail

It fails with: "dir/b did not receive NOTE_LINK"

Also, add needed cleanup logic to cleanup the mountpoint after the fact

PR:		213662

r307702:

Integrate contrib/netbsd-tests/fs/tmpfs into the FreeBSD test suite
as tests/sys/fs

These testcases exercise tmpfs support
2016-12-07 06:57:08 +00:00
Enji Cooper
8b544dec56 MFC r306962:
r306962 (by br):

Ensure data in pipe is available to read.
Useful for latest (5th, direct mode) test only.
2016-12-07 00:55:36 +00:00
Gleb Smirnoff
186c15aa09 Merge r309640 from head:
Fix possible integer overflow in guest memory bounds checking, which could
  lead to access from the virtual machine to the heap of the bhyve(8) process.

Submitted by:	Felix Wilhelm <fwilhelm ernw.de>
Patch by:	grehan
Security:	FreeBSD-SA-16:38.bhyve
2016-12-06 18:54:43 +00:00
Gleb Smirnoff
e2069a8d2a Merge r309639 from head:
Fix possible buffer overflow(s) in link_ntoa(3).

  A specially crafted sockaddr_dl argument can trigger a static buffer overflow
  in the libc library, with possibility to rewrite with arbitrary data following
  static buffers that belong to other library functions.

Reviewed by:	kib
Security:	FreeBSD-SA-16:37.libc
2016-12-06 18:53:21 +00:00
Gleb Smirnoff
35b582285d Merge r309638 from head:
When telnetd(8) composes argument list for login(1), an unexpected sequence
  of memory allocation failures combined with insufficient error checking
  could result in the construction and execution of an argument sequence that
  was not intended.

  Fix that treating malloc(3) failures as fatal condition.

Submitted by:	brooks
Security:	FreeBSD-SA-16:36.telnetd
2016-12-06 18:52:02 +00:00
Alexander Motin
3a5e512e17 MFC r309282: Explicitly initialize cdai.flags.
In SES driver uninitialized value caused unreliable physpath reporting.
2016-12-06 17:09:28 +00:00
Dimitry Andric
062eec9374 MFC r309332:
Cleanup old debug dirs in delete-old-dirs target

Any .debug or .symbols files under /usr/lib/debug which correspond to
OLD_FILES entries in ObsoleteFiles.inc are also automatically cleaned up
by the delete-old target.  Make this also apply to any OLD_DIRS entries.

Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D8683
2016-12-06 07:33:49 +00:00
Enji Cooper
7dc7dff635 MFC r307220:
r307220 (by br):

Fix typos: use correct string format and value to compare.
2016-12-06 04:35:24 +00:00
John Baldwin
8e753be213 MFC 308066: cxgbe(4): Accurate statistics for all chip settings.
There are 4 independent knobs in T5+ chips to include or exclude PAUSE
frames from the "total frames" and "multicast frames" counters in either
direction.  This change lets the driver deal with any combination of
these settings.
2016-12-05 23:55:53 +00:00
John Baldwin
3093af9d7a MFC 307876:
cxgbe(4): Fix bug in the calculation of the number of physically
contiguous regions in an mbuf chain.

If the payload of an mbuf ends at a page boundary count_mbuf_nsegs would
incorrectly consider the next mbuf's payload physically contiguous based
solely on a KVA comparison.
2016-12-05 23:46:21 +00:00
John Baldwin
8899f8c9a2 MFC 307759: cxgbe(4): Dump any mailbox command that times out. 2016-12-05 23:35:37 +00:00
John Baldwin
d4b37b5ff4 MFC 307233:
cxgbe(4): Allow the interface MTU to be set as high as the actual
hardware limit.
2016-12-05 23:25:49 +00:00
John Baldwin
f6c5ad922b MFC 306821,306823: Permit updating firmware config file in flash.
306821:
cxgbe(4): Add an ioctl to copy a firmware config file to the card's flash.

306823:
cxgbetool: Add a loadcfg subcommand to allow a user to upload a firmware
configuration file to the card.
2016-12-05 23:02:26 +00:00
John Baldwin
0eec568592 MFC 306277:
cxgbe(4): Make the location/length of all descriptor rings available in
the sysctl MIB.
2016-12-05 22:13:09 +00:00
John Baldwin
c1d7a41250 MFC 305695,305696,305699,305702,305703,305713,305715,305827,305852,305906,
305908,306062,306063,306137,306138,306206,306216,306273,306295,306301,
306465,309302:
Add support for adapters using the Terminator T6 ASIC.

305695:
cxgbe(4): Set up fl_starve_threshold2 accurately for T6.

305696:
cxgbe(4): Use correct macro for header length with T6 ASICs.  This
affects the transmit of the VF driver only.

305699:
cxgbe(4): Update the pad_boundary calculation for T6, which has a
different range of boundaries.

305702:
cxgbe(4): Use smaller min/max bursts for fl descriptors with a T6.

305703:
cxgbe(4): Deal with the slightly different SGE_STAT_CFG in T6.

305713:
cxgbe(4): Add support for additional port types and link speeds.

305715:
cxgbe(4): Catch up with the rename of tlscaps -> cryptocaps.  TLS is one
of the capabilities of the crypto engine in T6.

305827:
cxgbe(4): Use the interface's viid to calculate the PF/VF/VFValid fields
to use in tx work requests.

305852:
cxgbe(4): Attach to cards with the Terminator 6 ASIC.  T6 cards will
come up as 't6nex' nexus devices with 'cc' ports hanging off them.

The T6 firmware and configuration files will be added as soon as they
are released.  For now the driver will try to work with whatever
firmware and configuration is on the card's flash.

305906:
cxgbe/t4_tom: The SMAC entry for a VI is at a different location in the T6.

305908:
cxgbe/t4_tom: Update the active/passive open code to support T6.  Data
path works as-is.

306062:
cxgbe(4): Show wcwr_stats for T6 cards.

306063:
cxgbe(4): Setup congestion response for T6 rx queues.

306137:
cxgbetool: Add T6 support to the SGE context decoder.

306138:
Fix typo.

306206:
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().

306216:
cxgbe(4): Fix the output of the "tids" sysctl on T6.

306273:
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.

306295:
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.

306301:
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.

306465:
cxgbe(4): Claim the T6 -DBG card.

309302:
cxgbe(4): Include firmware for T6 cards in the driver.  Update all
firmwares to 1.16.12.0.

Sponsored by:	Chelsio Communications
2016-12-05 20:43:25 +00:00
John Baldwin
630f89c6db MFC 305667:
cxgbe(4): Avoid a NULL dereference in the clearstats ioctl handler.
Port softc's are not initialized when the adapter is in recovery mode.
2016-12-05 19:37:15 +00:00
John Baldwin
2e743a28b7 MFC 305652: cxgbe(4): Do not prescreen frames before attempting LRO. 2016-12-05 19:34:52 +00:00
John Baldwin
c02adbd052 MFC 305433:
cxgbe/t4_tom: toepcb should be all-zero on allocation because the code
that cleans up on failure assumes that non-NULL values indicate
initialized items.
2016-12-05 19:32:06 +00:00
John Baldwin
43335e699f MFC 303688,303750,305166,305167: Centralize and rework page pod handling.
303688:
cxgbe/t4_tom: Read the chip's DDP page sizes and save them in a
per-adapter data structure.  This replaces a global array with hardcoded
page sizes.

303750:
cxgbe/t4_tom: The page pod arena allocates from pod address space and
not index space.  The minimum valid allocation out of this arena is the
size of a single page pod.

305166:
cxgbe/t4_tom: Add general purpose routines to deal with page pod regions
and allocations within them.  Switch to these routines to manage the TOE
DDP region.

305167:
cxgbe/t4_tom: Two new routines to allocate and write page pods for a
buffer in the kernel's address space.

Sponsored by:	Chelsio Communications
2016-12-05 19:15:33 +00:00
Hiren Panchasara
3911634e00 MFC r308943
For RTT calculations mid-session, we explicitly ignore ACKs with tsecr of 0 as
many borken middle-boxes tend to do that. But during 3whs, in syncache_expand(),
we don't do that which causes us to send a RST to such a client. Relax this
constraint by only using tsecr to compare against timestamp that we sent when it
is not 0. As a result, we'd now accept the final ACK of 3whs with tsecr of 0.

Sponsored by:	Limelight Networks
2016-12-05 06:20:27 +00:00
Jilles Tjoelker
f3cacbdd31 MFC r309026: open(2): Clarify non-POSIX error when opening a symlink with
O_NOFOLLOW.

We return [EMLINK] instead of [ELOOP] when trying to open a symlink with
O_NOFOLLOW, so that the original case of [ELOOP] can be distinguished. Code
like cmp -h and xz takes advantage of this.

PR:		214633
2016-12-04 15:55:59 +00:00
Konstantin Belousov
739de9e99c MFC r309209:
Do not enable nullfs vnode caching over nfs v4 mounts.
2016-12-04 00:33:07 +00:00
Rick Macklem
63e50df846 MFC: r308871
Modify umount so that it does not do an Unmount RPC for NFSv4 mounts
and uses TCP for the Unmount RPC if the mount is over TCP.
Without this patch, umount does an Unmount RPC over UDP for all NFS mounts.
2016-12-03 21:49:26 +00:00
Edward Tomasz Napierala
7b25a0f7c9 MFC r308250:
Check for lengths being <= 0.  Note that this interface can only
be accessed by root.  It uses unsigned ints instead of size_t
to preserve the ABI.

PR:		207627
2016-12-03 21:27:19 +00:00
Edward Tomasz Napierala
164bd75286 MFC r308209:
Fix getfsstat(2) with MNT_WAIT to not skip filesystems that are in the
process of being unmounted.  Previously it would skip them, even if the
unmount eventually failed eg due to the filesystem being busy.

This behaviour broke autounmountd(8) - if you tried to manually unmount
a mounted filesystem, using 'automount -u', and the autounmountd attempted
to refresh the filesystem list in that very moment, it would conclude that
the filesystem got unmounted and not try to unmount it afterwards.
2016-12-03 21:23:43 +00:00