]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFV r302642:
Alexander Motin [Thu, 1 Sep 2016 13:04:36 +0000 (13:04 +0000)]
MFV r302642:
6876 Stack corruption after importing a pool with a too-long name

illumos/illumos-gate@c971037baa5d64dfecf6d87ed602fc3116ebec41
https://github.com/illumos/illumos-gate/commit/c971037baa5d64dfecf6d87ed602fc3116ebec41

https://www.illumos.org/issues/6876
  Calling dsl_dataset_name on a dataset with a 256 byte buffer is asking for
  trouble. We should check every dataset on import, using a 1024 byte buffer and
  checking each time to see if the dataset's new name is longer than 256 bytes.

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Paul Dagnelie <pcd@delphix.com>

7 years agoFix arm64 superpages bugs in pmap_enter:
Andrew Turner [Thu, 1 Sep 2016 10:26:06 +0000 (10:26 +0000)]
Fix arm64 superpages bugs in pmap_enter:
 * Pass the correct virtual address when demoting a superpage
 * Use the correct l3 table after demoting a superpage
 * Remove an invalid KASSERT hit demoting then promoting a superpage [1]

With this it is believed that  superpages on arm64 is stable.

Reported by: [1] cognet
Obtained from: ABT Systems Ltd
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

7 years agonet/rndis: Define types for RNDIS pktinfo rm_type field.
Sepherosa Ziehau [Thu, 1 Sep 2016 07:17:06 +0000 (07:17 +0000)]
net/rndis: Define types for RNDIS pktinfo rm_type field.

They are defined by NDIS spec, so the NDIS prefix.

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

7 years agohyperv/hn: Fix VLAN tag construction.
Sepherosa Ziehau [Thu, 1 Sep 2016 07:04:47 +0000 (07:04 +0000)]
hyperv/hn: Fix VLAN tag construction.

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

7 years agobd_int13probe() should check extended info if sector info is bad
Toomas Soome [Thu, 1 Sep 2016 06:35:13 +0000 (06:35 +0000)]
bd_int13probe() should check extended info if sector info is bad

In some Dell systems and usb stick combinations, it is found that
int13 AH=08 is reporting back bad sector information, preventing the
boot.

This update is allowing bd_int13probe() to use extended info call to
build disk properties.

It also can happen the total sectors count from extended info may be
wrong, in such case, the CHS data is used to calculate total sectors.

Reviewed by: allanjude
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D7718

7 years agonet/vlan: Shift for pri is 13 (pri mask 0xe000) not 1.
Sepherosa Ziehau [Thu, 1 Sep 2016 06:32:35 +0000 (06:32 +0000)]
net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1.

Reviewed by: araujo, hps
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7710

7 years agohyperv/hn: Stringent per-packet-info verification.
Sepherosa Ziehau [Thu, 1 Sep 2016 06:05:08 +0000 (06:05 +0000)]
hyperv/hn: Stringent per-packet-info verification.

While I'm here, minor style changes.

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

7 years agonet/rndis: Define per-packet-info for RNDIS packet message
Sepherosa Ziehau [Thu, 1 Sep 2016 05:40:13 +0000 (05:40 +0000)]
net/rndis: Define per-packet-info for RNDIS packet message

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

7 years agohyperv/hn: Remove unused function
Sepherosa Ziehau [Thu, 1 Sep 2016 05:29:58 +0000 (05:29 +0000)]
hyperv/hn: Remove unused function

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

7 years agonet/rndis: Add comment for rndis_set_parameter
Sepherosa Ziehau [Thu, 1 Sep 2016 05:15:04 +0000 (05:15 +0000)]
net/rndis: Add comment for rndis_set_parameter

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

7 years agoallow kern.proc.nfds sysctl in capability mode
Ed Maste [Thu, 1 Sep 2016 02:51:50 +0000 (02:51 +0000)]
allow kern.proc.nfds sysctl in capability mode

Reviewed by: allanjude
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7733

7 years agoDon't bake all of CC/CPP/CXX into CFLAGS
Enji Cooper [Thu, 1 Sep 2016 02:42:11 +0000 (02:42 +0000)]
Don't bake all of CC/CPP/CXX into CFLAGS

Capture executable names for CC, CPP, CXX (assumed to be the
first non-CCACHE_BIN word).

This change strips out all of the cross-compiler arguments, (-target,
-B, etc), added to ${CC}, etc via ${CROSSENV} in Makefile.inc1, so it
doesn't infect the build and subsequently the test.

Add comments noting why this logic is being added, and why the logic in
r305041 was necessary/what it was trying to achieve.

This is required after recent changes made to the toolchain to always
specify --sysroot, -target, -B, etc with clang in buildworld (presumably
r304681).

Reviewed by: rodrigc (earlier version)
Reported by: Jenkins (FreeBSD_HEAD job from 559+)
MFC after: 12 days
X-MFC with: r304681, r305041
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7732

7 years ago_taskqueue_start_threads() now fails if it doesn't actually start any threads.
Patrick Kelsey [Thu, 1 Sep 2016 02:05:46 +0000 (02:05 +0000)]
_taskqueue_start_threads() now fails if it doesn't actually start any threads.

Reviewed by: jhb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D7701

7 years agoFix linker warnings (errors on gcc) that resulted from r304510.
Eric Joyner [Thu, 1 Sep 2016 01:08:18 +0000 (01:08 +0000)]
Fix linker warnings (errors on gcc) that resulted from r304510.

The variables that are extern in the netmap header file should be
defined in ixl_txrx.c (the file that is included in both ixl(4)/ixlv(4),
not in the main driver source files.

Reported by: ed@, dim@, ngie@

7 years agocxgbe/t4_tom: Two new routines to allocate and write page pods for a
Navdeep Parhar [Thu, 1 Sep 2016 00:51:59 +0000 (00:51 +0000)]
cxgbe/t4_tom: Two new routines to allocate and write page pods for a
buffer in the kernel's address space.

7 years agocxgbe/t4_tom: Add general purpose routines to deal with page pod regions
Navdeep Parhar [Wed, 31 Aug 2016 23:23:46 +0000 (23:23 +0000)]
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.

Sponsored by: Chelsio Communications

7 years agoRename unp_dispose_so() to unp_dispose().
Mark Johnston [Wed, 31 Aug 2016 21:48:22 +0000 (21:48 +0000)]
Rename unp_dispose_so() to unp_dispose().

It implements the dom_dispose method for local socket domain, so its name
should match the method name.

7 years agoSet UEFI boot loader PE/COFF timestamps to known value for reproducible builds
Ed Maste [Wed, 31 Aug 2016 21:35:38 +0000 (21:35 +0000)]
Set UEFI boot loader PE/COFF timestamps to known value for reproducible builds

Reviewed by: rpokala
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7633

7 years agousers: don't build when we don't have a C++ toolchain
Ed Maste [Wed, 31 Aug 2016 21:12:50 +0000 (21:12 +0000)]
users: don't build when we don't have a C++ toolchain

(On RISC-V MK_CXX is in BROKEN_OPTIONS, so users remains skipped there.)

Reviewed by: bdrewery
Differential Revision: https://reviews.freebsd.org/D7725

7 years agoreadelf: silence GCC 4.2.1 uninitialized variable warning
Ed Maste [Wed, 31 Aug 2016 21:04:58 +0000 (21:04 +0000)]
readelf: silence GCC 4.2.1 uninitialized variable warning

Sponsored by: The FreeBSD Foundation

7 years agodirectory(3): Deprecate readdir_r(). Clarify dirent buffers.
Jilles Tjoelker [Wed, 31 Aug 2016 20:38:40 +0000 (20:38 +0000)]
directory(3): Deprecate readdir_r(). Clarify dirent buffers.

In existing implementations including FreeBSD, there is no reason to use
readdir_r() in the common case where potentially multiple threads each list
their own directory. Code using readdir() is simpler.

What's more, lthough readdir_r() can safely be used on FreeBSD because
NAME_MAX is forced to 255, it cannot be used safely on systems where
{NAME_MAX} is not fixed. As a concrete example, FAT/NTFS filenames can be up
to 255 UTF-16 code units long, which can be up to 765 UTF-8 bytes.

Deprecating readdir_r() in POSIX has been proposed in
http://www.austingroupbugs.net/view.php?id=696
and glibc wants to deprecate it as well.

Reviewed by: ed, wblock
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D7678

7 years agoAll the TI platforms are FDT based and it is not necessary to enumerate
Luiz Otavio O Souza [Wed, 31 Aug 2016 19:37:10 +0000 (19:37 +0000)]
All the TI platforms are FDT based and it is not necessary to enumerate
the hinted children (there wont be any).

Spotted by: gonzo

7 years agoDIRDEPS_BUILD: Add some missing dirctories to the build.
Bryan Drewery [Wed, 31 Aug 2016 19:30:59 +0000 (19:30 +0000)]
DIRDEPS_BUILD: Add some missing dirctories to the build.

Sponsored by: EMC / Isilon Storage Division

7 years agoAdd a 'make print-dir' that simply traverses all directories and prints them.
Bryan Drewery [Wed, 31 Aug 2016 19:30:52 +0000 (19:30 +0000)]
Add a 'make print-dir' that simply traverses all directories and prints them.

This is useful for finding connected directories.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

7 years agoDIRDEPS_BUILD: Update dependencies.
Bryan Drewery [Wed, 31 Aug 2016 19:30:46 +0000 (19:30 +0000)]
DIRDEPS_BUILD: Update dependencies.

Sponsored by: EMC / Isilon Storage Division

7 years agoDIRDEPS_BUILD: Avoid cyclic dependency with libc++.
Bryan Drewery [Wed, 31 Aug 2016 19:30:00 +0000 (19:30 +0000)]
DIRDEPS_BUILD: Avoid cyclic dependency with libc++.

The DIRDEPS_BUILD does not have a 'make includes' phase, so it would
otherwise want libc++ to be fully built/staged before building
libgcc.  Using the header directly works.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

7 years ago'addrlen' does not matter when we need to find the first non-zero bit in
Andrey A. Chernov [Wed, 31 Aug 2016 18:49:50 +0000 (18:49 +0000)]
'addrlen' does not matter when we need to find the first non-zero bit in
the byte from the left and 'addrlen' already counted in 'lim'.

PR:     212121
Submitted by:   Herbie.Robinson@stratus.com
MFC after:      7 days

7 years agoRegnerate after r305140, getdtablesize in capability mode
Ed Maste [Wed, 31 Aug 2016 18:37:51 +0000 (18:37 +0000)]
Regnerate after r305140, getdtablesize in capability mode

Sponsored by: The FreeBSD Foundation

7 years agoFix the build.
Luiz Otavio O Souza [Wed, 31 Aug 2016 18:35:41 +0000 (18:35 +0000)]
Fix the build.

Works better when the file with the #define is actually included...

7 years agoAllow getdtablesize in capability mode
Ed Maste [Wed, 31 Aug 2016 18:33:15 +0000 (18:33 +0000)]
Allow getdtablesize in capability mode

getdtablesize is "trivial global state" and is similar to
getrlimit(RLIMIT_NOFILE), so should be permitted in capability mode.

Reviewed by: oshogbo
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7719

7 years agodf(1): Allow duplicate -l flags gracefully
Conrad Meyer [Wed, 31 Aug 2016 18:10:41 +0000 (18:10 +0000)]
df(1): Allow duplicate -l flags gracefully

Rather than producing a misleading error message when duplicate -l flags are
provided to df(1), simply ignore extra flags and proceed as if only one was
specified.  This seems most reasonable given the usage for -l:

     -l      Only display information about locally-mounted file systems.

l and t flags still conflict, as before.

PR: 208169
Reported by: by at reorigin.com
Reviewed by: allanjude

7 years agoEliminate unnecessary loop in _cap_check()
Allan Jude [Wed, 31 Aug 2016 17:52:11 +0000 (17:52 +0000)]
Eliminate unnecessary loop in _cap_check()

Calling cap_rights_contains() several times with the same inputs is not
going to produce a different output. The variable being iterated, i, is
never used inside the for loop.

The loop is actually done in cap_rights_contains()

Submitted by: Ryan Moeller <ryan@freqlabs.com>
Reviewed by: oshogbo, ed
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D7369

7 years agoAdd Allwinner A64 (sun50i) and Pine64 dts files.
Jared McNeill [Wed, 31 Aug 2016 16:56:54 +0000 (16:56 +0000)]
Add Allwinner A64 (sun50i) and Pine64 dts files.

Reviewed by: andrew, imp, manu, wca
Differential Revision: https://reviews.freebsd.org/D7169

7 years agoApply the same qsort() usage fix as in r304911 getaddrinfo.c
Andrey A. Chernov [Wed, 31 Aug 2016 15:47:58 +0000 (15:47 +0000)]
Apply the same qsort() usage fix as in r304911 getaddrinfo.c
qsort() can't be stabilized with just return(-1) alone.

MFC after:      3 days

7 years agoRemove accidentally committed stray comment.
Warner Losh [Wed, 31 Aug 2016 15:32:52 +0000 (15:32 +0000)]
Remove accidentally committed stray comment.

Noticed by: dteske@

7 years agoUpdate to ELF Tool Chain r3490
Ed Maste [Wed, 31 Aug 2016 15:05:04 +0000 (15:05 +0000)]
Update to ELF Tool Chain r3490

Improvements include:
 * readelf: report all relocation types in rel/rela for MIPS N64
 * readelf: add ELFOSABI_ARM_AEABI
 * elfdump: add ELFOSABI_ARM_AEABI and ELFOSABI_ARM
 * Add recent RISC-V relocations
 * elfcopy: use elftc_timestamp, to support SOURCE_DATE_EPOCH

Sponsored by: The FreeBSD Foundation

7 years agoMake swapoff reliable.
Konstantin Belousov [Wed, 31 Aug 2016 14:49:58 +0000 (14:49 +0000)]
Make swapoff reliable.

The swap_pager_swapoff() function uses trylock for the object lock
before pagein, which means that either i/o to md(4) over swap, or
intensive page faults over swap pager objects might prevent swapoff()
from making any progress. Then the retry < 100 check fails and machine
panics.

If trylock fails, acquire the object lock in the blockable way and
restart the hash bucket walk.  Keep retries logic for now.

Reported and tested by: pho
Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D7688

7 years agoAlso handle instruction traps. We might hit these when the page we are
Andrew Turner [Wed, 31 Aug 2016 13:58:32 +0000 (13:58 +0000)]
Also handle instruction traps. We might hit these when the page we are
executing is being promoted to a superpage.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years agoImport ELF Tool Chain snapshot at revision 3490
Ed Maste [Wed, 31 Aug 2016 13:50:23 +0000 (13:50 +0000)]
Import ELF Tool Chain snapshot at revision 3490

From http://svn.code.sf.net/p/elftoolchain/code/

7 years agoNetboot: allow both tftpfs and nfs in both pxeboot and loader.efi
Baptiste Daroussin [Wed, 31 Aug 2016 13:16:40 +0000 (13:16 +0000)]
Netboot: allow both tftpfs and nfs in both pxeboot and loader.efi

Add a new 'netproto' variable which can be set for now to
NET_TFTP or NET_NFS (default to NET_NONE)

From the dhcp options if one sets the root-path option to:
"ip:path", the loader will consider it is booting over NFS
(meaning same behaviour as the default current behaviour)

if the dhcp option "tftp server address" is set (option 150)
the loader will consider it is booting over tftpfs, it will then
consider the root-path options with 2 possible case
1. "path" then the IP of the tftp server will be the one passed by
the option 150, and the files will be retrieved under "path" on the tftp
server
2. "ip:path" then the IP of the tftp server will be the one passed in
the option "overwritting the IP from the option 150.

We could not "abuse" the rootpath option in the form or tftp://ip:path because
this is already used for other purpose by iPXE preventing any chainload from
iPXE to the FreeBSD loader.

Given at each open(), the loader loops over all available filesystems and keep
the "best" error, we needed to prevent tftpfs to fallback on nfs and vice versa.
the tftpfs and nfs implementation in libstand now return EINVAL early if
'netproto' for that purpose.

Reviewed by: tsoome
Relnotes: yes
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D7628

7 years agofd: effectively revert r305091
Mateusz Guzik [Wed, 31 Aug 2016 12:29:04 +0000 (12:29 +0000)]
fd: effectively revert r305091

Turns out fd_lastfile can survive being -1 for some processes, giving
incorrect results with the cast.

Noted by: cem

7 years agoFix kernel panic when inheriting properties without default.
Alexander Motin [Wed, 31 Aug 2016 11:55:31 +0000 (11:55 +0000)]
Fix kernel panic when inheriting properties without default.

There are two writable hidden properties "iscsioptions" and "stmf_sbd_lu",
that have no default string value.  Attempt to unset them or replicate
caused kernel panic.  This simple bandaid seems fixes the problem nicely.

MFC after: 2 weeks

7 years agoRemove redundant sanity checks from ipsec[46]_common_input_cb().
Andrey V. Elsukov [Wed, 31 Aug 2016 11:51:52 +0000 (11:51 +0000)]
Remove redundant sanity checks from ipsec[46]_common_input_cb().

This check already has been done in the each protocol callback.

7 years agoAdd some locking to sc_cngetc().
Bruce Evans [Wed, 31 Aug 2016 11:10:39 +0000 (11:10 +0000)]
Add some locking to sc_cngetc().

Keyboard input needs Giant locking, and that is not possible to do
correctly here.  Use mtx_trylock() and proceed unlocked as before if
we can't acquire Giant (non-recursively), except in kdb mode don't
even try to acquire Giant.  Everything here is a hack, but it often
works.  Even if mtx_trylock() succeeds, this might be a LOR.

Keyboard input also needs screen locking, to handle screen updates
and switches.  Add this, using the same simplistic screen locking
as for sc_cnputc().

Giant must be acquired before the screen lock, and the screen lock
must be dropped when calling the keyboard driver (else it would get a
harmless LOR if it tries to acquire Giant).  It was intended that sc
cn open/close hide the locking calls, and they do for i/o functions
functions except for this complication.

Non-console keyboard input is still only Giant-locked, with screen
locking in some called functions.  This is correct for the keyboard
parts only.

When Giant cannot be acquired properly, atkbd and kbdmux tend to race
and work (they assume that the caller acquired Giant properly and don't
try to acquire it again or check that it has been acquired, and the
races rarely matter), while ukbd tends to deadlock or panic (since it
does the opposite, and has other usb threads to deadlock with).

The keyboard (Giant) locking here does very little, but the screen
locking completes screen locking for console mode except for not
detecting or handling deadlock.

7 years agoAdd support for Allwinner A64 USB PHY.
Jared McNeill [Wed, 31 Aug 2016 10:45:53 +0000 (10:45 +0000)]
Add support for Allwinner A64 USB PHY.

Reviewed by: manu

7 years agoAfter r305113, try to properly replace the magic numbers with
Bjoern A. Zeeb [Wed, 31 Aug 2016 10:45:33 +0000 (10:45 +0000)]
After r305113, try to properly replace the magic numbers with
proper #defines for this driver (not using the wrong header).

7 years agorecvtftp() is broken for large files, report file size
Toomas Soome [Wed, 31 Aug 2016 09:23:09 +0000 (09:23 +0000)]
recvtftp() is broken for large files, report file size

The tftp download for large files will cause internal block id
to wrap to 0 as the data type is unsigned short.

Also provide file size information for stat.

PR: 200500
Reported by: tsoome
Reviewed by: allanjude
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D7660

7 years agoAdd a driver for the AM335x bandgap sensor, an on-die temperature sensor
Luiz Otavio O Souza [Wed, 31 Aug 2016 07:42:46 +0000 (07:42 +0000)]
Add a driver for the AM335x bandgap sensor, an on-die temperature sensor
as part of the AM335x control module extension.

TI says that the bandgap sensor is not very accurate on AM335x, but in our
tests it seems to be a good reference for the SoC temperature.

TI details:
http://processors.wiki.ti.com/index.php/AM335x_Thermal_Considerations#Measuring_Case_Temperature

Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoAllow the use of control module extensions to cope with specific platform
Luiz Otavio O Souza [Wed, 31 Aug 2016 07:22:14 +0000 (07:22 +0000)]
Allow the use of control module extensions to cope with specific platform
features.

Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoReplace more magic numbers with the proper register names.
Luiz Otavio O Souza [Wed, 31 Aug 2016 07:03:06 +0000 (07:03 +0000)]
Replace more magic numbers with the proper register names.

Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoReplace a magic number with the proper register name.
Luiz Otavio O Souza [Wed, 31 Aug 2016 06:46:47 +0000 (06:46 +0000)]
Replace a magic number with the proper register name.

Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agohyperv/timesync: Rework time adjustment policy
Sepherosa Ziehau [Wed, 31 Aug 2016 06:00:20 +0000 (06:00 +0000)]
hyperv/timesync: Rework time adjustment policy

- By default, adjust time upon SYNC request.  It can be disabled
  through hw.hvtimesync.ignore_sync_req.  SYNC request will be
  sent by hypervisor the host is resumed, rebooted, etc.
- By default, adjust time upon SAMPLE request, if there is 100ms
  difference between VM time and hypervisor time.  This can be
  disabled through hw.hvtimesync.sample_drift.

And nuke the unnecessary task, since channel callback is running
in a Hyper-V taskqueue nowadays.

Submitted by: YanZhe Chen <t-yachen microsoft com>
Discussed with: Dexuan Cui <decui microsoft com>, Hongjiang Zhang <honzhan microsoft com>, sephe
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7707

7 years agohyperv/hn: Consolidate NVS transaction execution.
Sepherosa Ziehau [Wed, 31 Aug 2016 05:27:30 +0000 (05:27 +0000)]
hyperv/hn: Consolidate NVS transaction execution.

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

7 years agoBack out misfired extra file in r305108.
Nathan Whitehorn [Wed, 31 Aug 2016 04:03:55 +0000 (04:03 +0000)]
Back out misfired extra file in r305108.

7 years agoRefix operation on sparse CPU mappings as in r302372, temporarily broken
Nathan Whitehorn [Wed, 31 Aug 2016 04:02:52 +0000 (04:02 +0000)]
Refix operation on sparse CPU mappings as in r302372, temporarily broken
by r304716.

PR: kern/210106
MFC after: 2 days

7 years agoCreate a hook 'post-initialize' for people that want to define
Warner Losh [Wed, 31 Aug 2016 03:55:50 +0000 (03:55 +0000)]
Create a hook 'post-initialize' for people that want to define
something (perhaps in loader.rc.local) that can read in .conf files
after all the other .conf files have been read and override settings
in them. This is quite handy if the .conf file name is determined
while the loader is running, but might be generically useful for other
things. If this hook exists, call it, otherwise don't do anything.

Doing it in these functions ensures that this file is reliably
read. It also works around a defect in forth where s" isn't allowed
outside a function (well, in a compile context) leading to gross
workarounds if one were to hack loader.rc like:

: maybe-some-func s" some-func" sfind if execute else drop then ;
maybe-some-func

which somehow seems worse. Though I'm sure there's some clever forthy
way of doing that with a macro.

Sponsored by: Netflix, Inc

7 years agoUpdate VCHIQ driver to upstream version 4eda74f2
Oleksandr Tymoshenko [Wed, 31 Aug 2016 01:04:57 +0000 (01:04 +0000)]
Update VCHIQ driver to upstream version 4eda74f2

PR: 211525
Submitted by: Sylvain Garrigues <sylvain@sylvaingarrigues.com>

7 years agoRevert 305098
Baptiste Daroussin [Wed, 31 Aug 2016 00:11:35 +0000 (00:11 +0000)]
Revert 305098

Was a wrong assumption from me badly look at the errors cross toolchain was
telling me

7 years agoMake libc++.so ldscript sysroot friendly
Baptiste Daroussin [Wed, 31 Aug 2016 00:04:09 +0000 (00:04 +0000)]
Make libc++.so ldscript sysroot friendly

7 years agoNuke obio_bs_tag, it was used before it was initialized, and
Olivier Houchard [Tue, 30 Aug 2016 23:32:38 +0000 (23:32 +0000)]
Nuke obio_bs_tag, it was used before it was initialized, and
arm_base_bs_tag is the same, anyway.

7 years agoSome old arm ports don't load the kernel at the beginning of the memory,
Olivier Houchard [Tue, 30 Aug 2016 23:30:26 +0000 (23:30 +0000)]
Some old arm ports don't load the kernel at the beginning of the memory,
because the bootloader, ie redboot, won't let them do so, and so used the
memory before the kernel for early memory allocation, such as pagetables,
stacks, etc...
Make a bit of an effort to try to get that memory mapped.

7 years agoAUTO_OBJ: Support SRCS/DPSRCS that contain '/' and require a nested OBJDIR.
Bryan Drewery [Tue, 30 Aug 2016 22:48:05 +0000 (22:48 +0000)]
AUTO_OBJ: Support SRCS/DPSRCS that contain '/' and require a nested OBJDIR.

This is to be used by the new clang3.9 build and extends functionality
added to 'make obj' in r279980.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

7 years agoGarbage collect bits forgotten in r295267.
Olivier Houchard [Tue, 30 Aug 2016 22:32:33 +0000 (22:32 +0000)]
Garbage collect bits forgotten in r295267.

7 years agofd: add fdeget_locked and use in kern_descrip
Mateusz Guzik [Tue, 30 Aug 2016 21:53:22 +0000 (21:53 +0000)]
fd: add fdeget_locked and use in kern_descrip

7 years agoMFV r302423:
Pedro F. Giffuni [Tue, 30 Aug 2016 21:51:53 +0000 (21:51 +0000)]
MFV r302423:
Bring older verbatim version of cpuid.h

This file is used regularly in FreeBSD builds but we usually use the
similar file provided by clang.

By providing the older file introduced in GCC 4.3, we hope to mimic
better what is provided by an external toolchain.

Obtained from: GCC-4_3-branch (SVN rev. 129548, pre GPLv3)

7 years agofd: simplify fd testing in fget_locked by casting to u_int
Mateusz Guzik [Tue, 30 Aug 2016 21:48:10 +0000 (21:48 +0000)]
fd: simplify fd testing in fget_locked by casting to u_int

7 years agogetvfsbyname(3): Remove [EFAULT] error.
Jilles Tjoelker [Tue, 30 Aug 2016 21:43:57 +0000 (21:43 +0000)]
getvfsbyname(3): Remove [EFAULT] error.

Since r101651 in 2002, getvfsbyname() has written *vfc using userland
memcpy(), so the [EFAULT] error no longer occurs.

MFC after: 1 week

7 years agoFix warnings in telnet about invalid constant conversions, e.g.:
Dimitry Andric [Tue, 30 Aug 2016 20:27:22 +0000 (20:27 +0000)]
Fix warnings in telnet about invalid constant conversions, e.g.:

contrib/telnet/telnet/commands.c:2914:13: error: implicit conversion
from 'int' to 'char' changes value from 137 to -119
[-Werror,-Wconstant-conversion]
                *lsrp++ = IPOPT_SSRR;
                        ~ ^~~~~~~~~~
/usr/include/netinet/ip.h:152:21: note: expanded from macro 'IPOPT_SSRR'
#define IPOPT_SSRR              137             /* strict source route */
                                ^~~
contrib/telnet/telnet/commands.c:2916:13: error: implicit conversion
from 'int' to 'char' changes value from 131 to -125
[-Werror,-Wconstant-conversion]
                *lsrp++ = IPOPT_LSRR;
                        ~ ^~~~~~~~~~
/usr/include/netinet/ip.h:148:21: note: expanded from macro 'IPOPT_LSRR'
#define IPOPT_LSRR              131             /* loose source route */
                                ^~~

Use unsigned char buffers instead.

MFC after: 1 week

7 years agoFix warnings in tnftp about invalid constant conversions, e.g.:
Dimitry Andric [Tue, 30 Aug 2016 20:24:50 +0000 (20:24 +0000)]
Fix warnings in tnftp about invalid constant conversions, e.g.:

contrib/tnftp/src/ftp.c:2067:11: error: implicit conversion from 'int'
to 'char' changes value from 255 to -1 [-Werror,-Wconstant-conversion]
        buf[0] = IAC;
               ~ ^~~
/usr/include/arpa/telnet.h:39:13: note: expanded from macro 'IAC'
#define IAC     255             /* interpret as command: */
                ^~~
contrib/tnftp/src/ftp.c:2068:11: error: implicit conversion from 'int'
to 'char' changes value from 244 to -12 [-Werror,-Wconstant-conversion]
        buf[1] = IP;
               ~ ^~
/usr/include/arpa/telnet.h:50:12: note: expanded from macro 'IP'
#define IP      244             /* interrupt process--permanently */
                ^~~

Use an unsigned char buffer instead.

MFC after: 1 week

7 years agoFix Capsicum syscalls test suite.
Mariusz Zaborski [Tue, 30 Aug 2016 19:58:41 +0000 (19:58 +0000)]
Fix Capsicum syscalls test suite.

7 years agolibcpp: Complete the __COUNTER__ support with upstream implementation.
Pedro F. Giffuni [Tue, 30 Aug 2016 19:39:33 +0000 (19:39 +0000)]
libcpp: Complete the __COUNTER__ support with upstream implementation.

We brought an original __COUNTER__ implementation in r228474, however, it
was missing documentation and it had a different behaviour for precompiled
headers with respect to the upstream version. Since the upstream version
is under the same license as GCC4.2, bring the missing pieces to reduce
differences against upstream.

Optained from: GCC pre-4.3 (rev. 125041 ; GPLv2)

7 years agoReduce duplicated logic for !SMP
Bryan Drewery [Tue, 30 Aug 2016 19:26:07 +0000 (19:26 +0000)]
Reduce duplicated logic for !SMP

Sponsored by: EMC / Isilon Storage Division

7 years agoiscsi_initiator: make logout_req::reason unsigned char
Ed Maste [Tue, 30 Aug 2016 19:20:26 +0000 (19:20 +0000)]
iscsi_initiator: make logout_req::reason unsigned char

Previously this reported an error from Clang 3.9.0: implict conversion
from 'int' to 'char' changes value from 128 to -128.

Discussed with: dim, trasz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7699

7 years agoSquelch clang 3.9.0 warnings about BASE (which is 32768) being converted
Dimitry Andric [Tue, 30 Aug 2016 19:02:15 +0000 (19:02 +0000)]
Squelch clang 3.9.0 warnings about BASE (which is 32768) being converted
to -32768 when it is used as an argument to mp_itom(), in both libtelnet
and newkey.  This code has been wrong since r26238 (!), so after almost
20 years it is rather useless to try to correct it.

MFC after: 1 week

7 years agoThe code only converts from bpbHugeSectors to bpbSectors if the sum of
Warner Losh [Tue, 30 Aug 2016 18:01:26 +0000 (18:01 +0000)]
The code only converts from bpbHugeSectors to bpbSectors if the sum of
the hidden and huge sectors is less than or equal MAXU16. When
formatting in Windows bpbSectors is still used for 63488 sectors and
2048 hidden (sum > MAXU16). The hidden sectors count is the number of
sectors before the FAT16 Boot Record so it shouldn't affect the sector
count. Attached patch (huge_sec_conversion.patch) to only check for
bpb.bpbHugeSectors <= MAXU16 when converting to bpbSectors.

Submitted by: Guy Yur
PR: 183234

7 years agoRemove CHS alignment. It's not needed and causes problems for the BBB
Warner Losh [Tue, 30 Aug 2016 18:01:19 +0000 (18:01 +0000)]
Remove CHS alignment. It's not needed and causes problems for the BBB
boot partition. NetBSD removed it in 1.10 in their repo some time ago.

Submitted by: Guy Yur
PR: 183234

7 years agoBecause we need to use a break-before-make sequence when promoting pages
Andrew Turner [Tue, 30 Aug 2016 16:45:15 +0000 (16:45 +0000)]
Because we need to use a break-before-make sequence when promoting pages
there is a short period where functions that walk the kernel page table
without locking them may see an invalid entry. One solution would be to add
locking to these functions, however some may be called from locations where
we are unable to sleep.

Until a better solution can be found stop promoting pages in the kernel
pmap so these functions work as expected.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years agoUpdate cryptotest for modern algorithms
George V. Neville-Neil [Tue, 30 Aug 2016 14:28:35 +0000 (14:28 +0000)]
Update cryptotest for modern algorithms

Reviewed by: cem
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D7598

7 years agoAdd refactored blacklist support to sshd
Kurt Lidl [Tue, 30 Aug 2016 14:09:24 +0000 (14:09 +0000)]
Add refactored blacklist support to sshd

Change the calls to of blacklist_init() and blacklist_notify to be
macros defined in the blacklist_client.h file.  This avoids
the need for #ifdef USE_BLACKLIST / #endif except in the
blacklist.c file.

Remove redundent initialization attempts from within
blacklist_notify - everything always goes through
blacklistd_init().

Added UseBlacklist option to sshd, which defaults to off.
To enable the functionality, use '-o UseBlacklist=yes' on
the command line, or uncomment in the sshd_config file.

Reviewed by: des
Approved by: des
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7051

7 years agoInvert calloc(3) argument order.
Marcelo Araujo [Tue, 30 Aug 2016 12:40:12 +0000 (12:40 +0000)]
Invert calloc(3) argument order.

Reviewed by: grehan, mav
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D7613

7 years agoFix keyboard polling "on/off" to support recursion. vt depends on
Bruce Evans [Tue, 30 Aug 2016 12:36:14 +0000 (12:36 +0000)]
Fix keyboard polling "on/off" to support recursion.  vt depends on
this, and sc will soon depend on it again.

The on/off request is passed without modification to lower layers,
so the bug was smaller in this layer than in in lower layers (the
sequence on;on;off left polling off when it should be on, but the
sequence on;on;off;on;off...  doesn't allow the interrupt handler
to eat the input after an "off" that should't turn off polled mode,
provided lower layers don't have the bug, since this layer is virtual.

The bug was small in lower layers too.  Normally everything is Giant
locked for keyboards, and this locks out the interrupt handler in
on;on;off;on;off... sequences.  However, PR 211884 says that fixing
this bug in ukbd in r303765 apparently causes the eating-by-interrupt
behaviour that the fix is to prevent.

Discussed with: emax

7 years agoStart adding locking to sc_cngetc().
Bruce Evans [Tue, 30 Aug 2016 10:57:19 +0000 (10:57 +0000)]
Start adding locking to sc_cngetc().

Restore an splx() lost in r228644.  We aren't nearly ready to remove
spl's.  They give hints about missing locking.  This lost one was
misplaced.  Dropping it early for convenience gave race windows for
accesses to the fkey buffer.  Giant locking accidentally fixed this
for non-console cases.

Put the spl's around the whole function.  Since there are many returns
that would need splx() just before them for a direct fix, split the
function into a wrapper that does the spl's and a "locked" function
that does the work.

Return earlier when no keyboard is attached to match the ordering in a
planned version.  This breaks the dubious feature of returning keys
from the fkey buffer after the keyboard has gone away.  Losing the keys
wouldn't matter, but we keep them too long now.

7 years agoAdd support for Allwinner A64 watchdog timer.
Jared McNeill [Tue, 30 Aug 2016 10:21:32 +0000 (10:21 +0000)]
Add support for Allwinner A64 watchdog timer.

7 years agoUpdate a comment to reflect r305051.
Kevin Lo [Tue, 30 Aug 2016 08:34:49 +0000 (08:34 +0000)]
Update a comment to reflect r305051.

7 years agoRestore swap pager readahead after r292373.
Mark Johnston [Tue, 30 Aug 2016 05:56:21 +0000 (05:56 +0000)]
Restore swap pager readahead after r292373.

The removal of vm_fault_additional_pages() meant that a hard fault on
a swap-backed page would result in only that page being read in. This
change implements readahead and readbehind for the swap pager in
swap_pager_getpages(). swap_pager_haspage() is modified to return the
largest contiguous non-resident range of pages containing the requested
range.

Reviewed by: alc, kib
Tested by: pho
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D7677

7 years agoRecursively enumerate anonymous structs and unions in ctf_member_info().
Mark Johnston [Tue, 30 Aug 2016 05:50:42 +0000 (05:50 +0000)]
Recursively enumerate anonymous structs and unions in ctf_member_info().

Previously, ctf_member_info() would ignore members belonging to an
anonymous struct or union. This made it impossible to, for example, trace
the m_next field of an mbuf using DTrace.

Reported and tested by: gallatin
MFC after: 2 weeks

7 years agohyperv/hn: Remove unnecessary NULL check.
Sepherosa Ziehau [Tue, 30 Aug 2016 05:47:58 +0000 (05:47 +0000)]
hyperv/hn: Remove unnecessary NULL check.

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

7 years agohyperv/hn: Log packet message alignment.
Sepherosa Ziehau [Tue, 30 Aug 2016 05:35:19 +0000 (05:35 +0000)]
hyperv/hn: Log packet message alignment.

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

7 years agohyperv/hn: Remove the useless rndis_device and related bits
Sepherosa Ziehau [Tue, 30 Aug 2016 05:21:34 +0000 (05:21 +0000)]
hyperv/hn: Remove the useless rndis_device and related bits

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

7 years agoZap M_IOVEC.
Kevin Lo [Tue, 30 Aug 2016 05:15:42 +0000 (05:15 +0000)]
Zap M_IOVEC.

Reviewed by: Matthew Macy

7 years agohyperv/hn: Switch to new RNDIS transaction execution for halt.
Sepherosa Ziehau [Tue, 30 Aug 2016 05:09:26 +0000 (05:09 +0000)]
hyperv/hn: Switch to new RNDIS transaction execution for halt.

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

7 years agohyperv/hn: Factor out func to exec RNDIS transaction w/o checking result
Sepherosa Ziehau [Tue, 30 Aug 2016 04:04:29 +0000 (04:04 +0000)]
hyperv/hn: Factor out func to exec RNDIS transaction w/o checking result

It will be used by RNDIS HALT and RESET.

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

7 years agohyperv/hn: Remove unused function
Sepherosa Ziehau [Tue, 30 Aug 2016 03:55:43 +0000 (03:55 +0000)]
hyperv/hn: Remove unused function

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

7 years agohyperv/hn: Switch to new RNDIS set for RX filters.
Sepherosa Ziehau [Tue, 30 Aug 2016 03:40:22 +0000 (03:40 +0000)]
hyperv/hn: Switch to new RNDIS set for RX filters.

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

7 years agonet/rndis: Packet types are defined by NDIS; not RNDIS specific.
Sepherosa Ziehau [Tue, 30 Aug 2016 03:11:07 +0000 (03:11 +0000)]
net/rndis: Packet types are defined by NDIS; not RNDIS specific.

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

7 years agohyperv/hn: Indentation and field comment fixup for ndis.h.
Sepherosa Ziehau [Tue, 30 Aug 2016 03:03:19 +0000 (03:03 +0000)]
hyperv/hn: Indentation and field comment fixup for ndis.h.

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

7 years agohyperv/hn: Move OIDs to net/rndis.h; they are standard NDIS OIDs.
Sepherosa Ziehau [Tue, 30 Aug 2016 02:55:07 +0000 (02:55 +0000)]
hyperv/hn: Move OIDs to net/rndis.h; they are standard NDIS OIDs.

Actually all OIDs defined in net/rndis.h are standard NDIS OIDs.
While I'm here, use the verbose macro name as in NDIS spec.

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

7 years agoAttach and LAW problems to fix
Justin Hibbits [Tue, 30 Aug 2016 02:09:40 +0000 (02:09 +0000)]
Attach and LAW problems to fix

Summary:
1) Attach problem - mpc85xx_probe() relies on fact that 0xfff0 mask matches all
QorIQ CPUs what is not true since e6500. This shall be reworked to match against
all supported CPUs.

2) There is no any reason for operating system to re-program or anyhow else
touch the LAWs programmed by firmware (u-boot). Right now mpc85xx_attach()
removes all LaW entries except for DRAM. This causes MCE to be generated when
later any of driver maps DTB-provided hardware addresses which do not exist
anymore because corresponding LaWs were removed.

Submitted by: Ivan Krivonos <int0dster_AT_gmail.com>
Differential Revision: https://reviews.freebsd.org/D7663

7 years agoFilter certain compile-time options into -DATF_BUILD_*
Enji Cooper [Tue, 30 Aug 2016 02:04:55 +0000 (02:04 +0000)]
Filter certain compile-time options into -DATF_BUILD_*

Items filtered through are:

- Constant defines (-D)
- Include flags (-I)
- Linker flags (-L)
- Optimization level (-O)
- Warnings / linker flags (-W)
- Preprocessor options (-f)

This fixes the scenario hit by the Jenkins job where it's infecting
the build with --sysroot, etc options from the Jenkins build in the
tests.

Prefix all intermediate variables (_CFLAGS, etc) with "ATF_BUILD" [*].

MFC after: 2 weeks
Reported by: Jenkins
Requested by: jmmv
Reviewed by: jmmv
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7702

7 years agoAdd support for NXP/Freescale etsec2 ethernet controller
Justin Hibbits [Tue, 30 Aug 2016 01:58:49 +0000 (01:58 +0000)]
Add support for NXP/Freescale etsec2 ethernet controller

Adding the compatible property check isn't enough.  Device trees for eTSEC2
devices are missing a 'reg' property on the eTSEC node itself, relegating it to
the queue group child nodes.

Still left to do: add Multigroup mode support (see QorIQ reference manuals s for
SoCs with eTSEC2).

MFC after: 2 weeks
Relnotes: Yes