]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC r305356:
ngie [Sun, 18 Sep 2016 02:56:16 +0000 (02:56 +0000)]
MFC r305356:

Add a missing "Bail out!" if zpool create fails

This will make the exit info more meaningful if/when zpool create fails,
and establishes parity with the other 2 zfs acl testcases (01, 03).

7 years agoMFC r305033,r305041,r305170:
ngie [Sun, 18 Sep 2016 02:45:35 +0000 (02:45 +0000)]
MFC r305033,r305041,r305170:

r305033:

Minor Makefile simplifications for lib/atf/...

- Replace uses of `${.CURDIR:H:H:H}` with ${SRCTOP}
- Use built-in :H operator instead of ".." when enumerating paths.

r305041:

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" [*].

Requested by: jmmv

r305170:

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

7 years agoMFC r305018,r305019,r305020:
ngie [Sun, 18 Sep 2016 02:41:50 +0000 (02:41 +0000)]
MFC r305018,r305019,r305020:

r305018:

Use SRCTOP instead of a homegrown definition for it (SRCDIR)

r305019:

Remove unnecessary variable (SRCDIR) replaced by SRCTOP in Makefile.common

r305020:

Remove redundant declarations and simplify ../ in pathing

- TESTSBASE and LOCALBASE are already defined in bsd.tests.mk
- TESTSDIR is automatically divined as ${TESTSBASE}${RELDIR:H} after
  r289158.
- Replace SRCDIR with SRCTOP

7 years agoMFC r305894:
jhibbits [Sat, 17 Sep 2016 16:45:57 +0000 (16:45 +0000)]
MFC r305894:

Increase the boot1 file size on the HFS boot image.

The boot1.elf is too fat for 30k, it's now 32k on powerpc64, and 34k on powerpc.
Without this, boot1 will fail with odd behaviors.

7 years agoMFC 305607:
andrew [Fri, 16 Sep 2016 13:00:55 +0000 (13:00 +0000)]
MFC 305607:
Trap msr/mrs instructions. These are privileged arm64 instructions and
shouldn't normally be used.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC 305128:
andrew [Fri, 16 Sep 2016 12:48:58 +0000 (12:48 +0000)]
MFC 305128:
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
Sponsored by: The FreeBSD Foundation

7 years agoMFC 305546:
andrew [Fri, 16 Sep 2016 12:42:36 +0000 (12:42 +0000)]
MFC 305546:
When synchronising the instruction and data caches we only need to clean
the data cache to the point of unification. This is the point where the
two caches are unified to a single unified cache so cleaning past here
is just extra unneeded work.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC 305545:
andrew [Fri, 16 Sep 2016 12:39:21 +0000 (12:39 +0000)]
MFC 305545:
Only call cpu_icache_sync_range when inserting an executable page. If the
page is non-executable the contents of the i-cache are unimportant so this
call is just adding unneeded overhead when inserting pages.

While doing research using gem5 with an O3 pipeline and 1k/32k/1M iTLB/L1
iCache/L2 Bjoern Zeeb (bz@) observed a fairly high rate of calls into
arm64_icache_sync_range() from pmap_enter() along with a high number of
instruction fetches and iTLB/iCache hits.

Limiting the calls to arm64_icache_sync_range() to only executable pages,
we observe the iTLB and iCache Hit going down by about 43%. These numbers
are quite misleading when looked at alone as at the same time instructions
retired were reduced by 19.2% and instruction fetches were reduced by 38.8%.
Overall this reduced the runtime of the test program by 22.4%.

On Juno hardware, in steady-state, running the same test, using the cycle
count to determine runtime, we do see a reduction of up to 28.9% in runtime.

While these numbers certainly depend on the program executed, we expect an
overall performance improvement.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC 304004, 304596, 304598, 304599, 304600, 304604, 304620, 304685, 304687,
andrew [Fri, 16 Sep 2016 12:36:11 +0000 (12:36 +0000)]
MFC 304004, 304596, 304598, 304599, 304600, 304604, 304620, 304685, 304687,
    304688, 304689, 304746, 304749, 304750, 304806, 305071, 305191:
Merge arm64 superpage support, however leave it disabled by default.

MFC after: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC 303904:
andrew [Fri, 16 Sep 2016 12:20:42 +0000 (12:20 +0000)]
MFC 303904:
Uncomment the vm.kvm_size and vm.kvm_free sysctls. These work as expected so
there is no reason to leave them commented out.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC 303903:
andrew [Fri, 16 Sep 2016 12:18:22 +0000 (12:18 +0000)]
MFC 303903:
Implement pmap_align_superpage on arm64 based on the amd64 implementation.
This will be needed when superpage support is added.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC 303744:
andrew [Fri, 16 Sep 2016 12:17:01 +0000 (12:17 +0000)]
MFC 303744:
Remove the pvh_global_lock lock from the arm64 pmap. It is unneeded on arm64
as invalidation will have completed before the pmap_invalidate_* functions
have complete.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC 305605:
andrew [Fri, 16 Sep 2016 12:12:00 +0000 (12:12 +0000)]
MFC 305605:
Don't panic when we don't handle a userland exception, not all we may see
are currently handled.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC r304285:
kib [Fri, 16 Sep 2016 10:04:28 +0000 (10:04 +0000)]
MFC r304285:
Implement userspace gettimeofday(2) with HPET timecounter.

7 years agoMFC r303677: Move/add ARM ELF PHDR types to elf_common.h
emaste [Thu, 15 Sep 2016 17:37:30 +0000 (17:37 +0000)]
MFC r303677: Move/add ARM ELF PHDR types to elf_common.h

7 years agoMFC r303670: Add ELFOSABI_ARM_AEABI ELF OSABI constant
emaste [Thu, 15 Sep 2016 17:36:43 +0000 (17:36 +0000)]
MFC r303670: Add ELFOSABI_ARM_AEABI ELF OSABI constant

7 years agoMFC r303335: apply some style(9) to kbd: make function name start in column 1
emaste [Thu, 15 Sep 2016 17:34:14 +0000 (17:34 +0000)]
MFC r303335: apply some style(9) to kbd: make function name start in column 1

7 years agoMFC r305160: Set UEFI boot loader PE/COFF timestamps to known value for reproducible...
emaste [Thu, 15 Sep 2016 17:30:01 +0000 (17:30 +0000)]
MFC r305160: Set UEFI boot loader PE/COFF timestamps to known value for reproducible builds

Sponsored by: The FreeBSD Foundation

7 years agoMFC r305130: Update to ELF Tool Chain r3490
emaste [Thu, 15 Sep 2016 17:28:03 +0000 (17:28 +0000)]
MFC r305130: 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

MFC r305155: readelf: silence GCC 4.2.1 uninitialized variable warning

Sponsored by: The FreeBSD Foundation

7 years agoMFC r304191: elfcopy: correct comment typo
emaste [Thu, 15 Sep 2016 17:25:11 +0000 (17:25 +0000)]
MFC r304191: elfcopy: correct comment typo

(Missed in r305838)

7 years agoMFC r304160: elfcopy: add elf64-littleaarch64 output target support
emaste [Thu, 15 Sep 2016 17:24:11 +0000 (17:24 +0000)]
MFC r304160: elfcopy: add elf64-littleaarch64 output target support

7 years agoMFC r304151: elfcopy: silence GCC 5.3 unitialized variable warning
emaste [Thu, 15 Sep 2016 17:23:14 +0000 (17:23 +0000)]
MFC r304151: elfcopy: silence GCC 5.3 unitialized variable warning

Although it's a false positive there is little cost to initializing it
always.

7 years agoMFC r303674: readelf: report ARM program and section header types
emaste [Thu, 15 Sep 2016 17:22:35 +0000 (17:22 +0000)]
MFC r303674: readelf: report ARM program and section header types

7 years agoMFC r305590:
hselasky [Thu, 15 Sep 2016 08:34:16 +0000 (08:34 +0000)]
MFC r305590:
Correctly map the USB mouse tilt delta values into buttons 5 and 6
instead of 3 and 4 which is used for the scroll wheel, according to
X.org.

PR: 170358

7 years agoMFC r305744:
kib [Thu, 15 Sep 2016 08:25:13 +0000 (08:25 +0000)]
MFC r305744:
Fix typo in comment.

7 years agoMFC r305129:
kib [Wed, 14 Sep 2016 10:36:44 +0000 (10:36 +0000)]
MFC r305129:
Make swapoff reliable.

7 years agoMFC r305123: Fix kernel panic when inheriting properties without default.
mav [Wed, 14 Sep 2016 09:12:49 +0000 (09:12 +0000)]
MFC r305123: 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.

7 years agoMFC r305536: Fix channel initialization in FBS mode.
mav [Wed, 14 Sep 2016 09:10:31 +0000 (09:10 +0000)]
MFC r305536: Fix channel initialization in FBS mode.

Due to reading initialized variable, FIS receive area was always allocated
as 256 bytes, suitable for command-based switching, instead of 4096 bytes,
required for FIS-based switching.  This caused memory corruption in case of
port multipliers used on FBS-capable HBAs (Marvell).

7 years agoMFC r305363:
markj [Tue, 13 Sep 2016 19:59:29 +0000 (19:59 +0000)]
MFC r305363:
Remove redefinitions of some kernel types from mbuf.d.

7 years agoMFC r305425:
markj [Tue, 13 Sep 2016 19:56:34 +0000 (19:56 +0000)]
MFC r305425:
Remove an unreachable return statement from ARM's minidumpsys().

7 years agoMFC r305484:
will [Tue, 13 Sep 2016 19:01:58 +0000 (19:01 +0000)]
MFC r305484:

loader.efi: Bump the staging size to 64M.

This is required on my system, which loads nvidia, vmm, and zfs, and 48M is
no longer enough for that.  nvidia-driver's recent update increased its size
by several megabytes.

7 years agoMFC 305624:
jhb [Tue, 13 Sep 2016 17:21:32 +0000 (17:21 +0000)]
MFC 305624:
Document PCI_HP and PCI_IOV kernel options and various tunables in pci(4).

Describe PCI-related kernel options for HotPlug and SR-IOV support in the
pci(4) manual page.  While here, add a section describing the various
tunables supported by the PCI bus driver as well.

7 years agoMFC 305771, 305772:
andrew [Tue, 13 Sep 2016 16:22:50 +0000 (16:22 +0000)]
MFC 305771, 305772:
Fix the arm64 kernel build when DDB is disabled, debug_monitor.c depends on
DDB, and is unused when it's disabled.

7 years agoMFC 305767:
andrew [Tue, 13 Sep 2016 14:14:39 +0000 (14:14 +0000)]
MFC 305767:
Add a warning about a known erratum we have observed on ThunderX pass 1.1.
As this is evaluation hardware with only a few users, and there is a lack
of information add a warning when booting on this hardware.

7 years agoMFC r305679: Switch random_get_pseudo_bytes() shim to arc4rand().
mav [Tue, 13 Sep 2016 07:15:39 +0000 (07:15 +0000)]
MFC r305679: Switch random_get_pseudo_bytes() shim to arc4rand().

Our shim for Solaris random_get_bytes() uses read_random(), that looks
reasonable, since it guaranties reliably seeded random data.  On the other
side Solaris random_get_pseudo_bytes() does not provide this guarantie,
and its original Solaris implementation is equivalent to our arc4rand(),
using software crypto without stressing slower hardware RNG.

7 years agoMFC r305470:
avos [Tue, 13 Sep 2016 05:47:59 +0000 (05:47 +0000)]
MFC r305470:

iwm: fix scanning for hidden SSIDs.

Setup SSIDs in scan command so firmware will send direct probe request(s)
while scanning.

Tested by: dbkirk@gmail.com

PR: 211519

7 years agoMFC r305422:
mm [Mon, 12 Sep 2016 22:07:00 +0000 (22:07 +0000)]
MFC r305422:
Sync libarchive with vendor

Vendor issues fixed:
PR #777: Multiple bugfixes for setup_acls()

This includes a bugfix for a bug that caused ACLs not to be read properly
for files and directories inside subdirectories and as a result not being
stored or being incorrectly stored in tar archives.

7 years agoMFC: 304825
gnn [Mon, 12 Sep 2016 17:02:22 +0000 (17:02 +0000)]
MFC: 304825
Unlike Solaris, in FreeBSD p_args can be 0 so check for that
instead of walking down to ar_args blindly.

Reported by: Amanda Strnad
Reviewed by: markj, jhb
Sponsored by: DARPA, AFRL

7 years agoMFC r304162
asomers [Mon, 12 Sep 2016 16:36:44 +0000 (16:36 +0000)]
MFC r304162

Decrease the anti-congestion sleep in 480.leapfile-ntpd to 1 hour

24 hours is too long. Periodic scripts are executed serially, so when
combined with the sleep in 410.pkg-audit periodic could actually take more
than 24 hours and block the next invocation.

7 years agoMFC r302778
asomers [Mon, 12 Sep 2016 16:28:32 +0000 (16:28 +0000)]
MFC r302778

pw should sanitize the argument of -w.

Otherwise, it will silently disable the login for the selected account if
the argument is unrecognizable.

usr.sbin/pw/pw.h
usr.sbin/pw/pw_conf.c
usr.sbin/pw/pw_user.c
        Use separate rules to validate boolean parameters and passwd
        parameters.  Error out if a password parameter cannot be parsed.

usr.sbin/pw/tests/Makefile
usr.sbin/pw/tests/crypt.c
usr.sbin/pw/tests/pw_useradd.sh
usr.sbin/pw/tests/pw_usermod.sh
        Add tests for the validation.  Also, enhance existing
        password-related tests to actually validate that the correct hash is
        written to master.passwd.

7 years agoMFC r305421:
hselasky [Mon, 12 Sep 2016 10:14:30 +0000 (10:14 +0000)]
MFC r305421:
Resolve deadlock between device_detach() and usbd_do_request_flags()
by reviving the SX control request lock and refining which lock
protects the common scratch area in "struct usb_device".

The SX control request lock was removed by r246759 because it caused a
lock order reversal with the USB enumeration lock inside
usbd_transfer_setup() as a function of r246616. It was thought that
reducing the number of locks would resolve the LOR, but because some
USB device drivers use usbd_do_request_flags() inside callback
functions, like in taskqueues, a deadlock may occur when these are
drained from device_detach(). By restoring the SX control request
lock usbd_do_request_flags() is allowed to complete its execution
when a USB device driver is detaching. By using the SX control request
lock to protect the scratch area, the LOR introduced by r246616 is
also resolved.

Bump the FreeBSD version while at it to force recompilation of all USB
kernel modules.

Found by: avos@

7 years agoMFC 305177
sephe [Mon, 12 Sep 2016 08:14:11 +0000 (08:14 +0000)]
MFC 305177
    net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1.

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

7 years agoMFC r305061
grehan [Mon, 12 Sep 2016 00:24:56 +0000 (00:24 +0000)]
MFC r305061
    Invert calloc(3) argument order

7 years agoMFC r303352
grehan [Mon, 12 Sep 2016 00:21:55 +0000 (00:21 +0000)]
MFC r303352
    - Change the fbuf "vga" parameter to "vga=on|io|off".
       "io" is the default, and allows VGA i/o registers to be
       accessed. This is required by Win7/2k8 graphics guests that
       use a combination of BIOS int10 and UEFI.
       "off" disables all VGA i/o and mem accesses.
       "on" is not yet hooked up, but will enable full VGA rendering.

       OpenBSD/UEFI >= 5.9 graphics guests can be booted using "vga=off"

    - Allow "rfb" to be used instead of "tcp" for the fbuf VNC
      description. "tcp" will be removed at a future point and is
      kept as an alias.

7 years agoMFC r302972,r303349
grehan [Mon, 12 Sep 2016 00:16:26 +0000 (00:16 +0000)]
MFC r302972,r303349

r302972
    Disallow interrupt requests on disabled endpoints.

r303349
    Catch another case where an XHCI interrupt was being
    injected without state being set up.

7 years agoMFC r302546
grehan [Mon, 12 Sep 2016 00:03:14 +0000 (00:03 +0000)]
MFC r302546
    Implement right shift/ctl, and convert the VNC/xorg scancode
    of 0xff03 into right-alt.

7 years agoMFC r305430:
dim [Sun, 11 Sep 2016 14:19:06 +0000 (14:19 +0000)]
MFC r305430:

Define libcpp's HAVE_DESIGNATED_INITIALIZERS in a defined and portable
way.

7 years agoMFC r305575:
kevlo [Sun, 11 Sep 2016 07:24:12 +0000 (07:24 +0000)]
MFC r305575:

In m_devget(), if the data fits in a packet header mbuf, check the amount
of data is less than or equal to MHLEN instead of MLEN when placing initial
small packet header at end of mbuf.

Reviewed by: glebius

7 years agoMFC 303720: Apply the fix from r232612 to fixed function counters.
jhb [Fri, 9 Sep 2016 21:19:31 +0000 (21:19 +0000)]
MFC 303720: Apply the fix from r232612 to fixed function counters.

7 years agoMFC 303713: Correct assertion on vcpuid argument to vm_gpa_hold().
jhb [Fri, 9 Sep 2016 20:30:36 +0000 (20:30 +0000)]
MFC 303713: Correct assertion on vcpuid argument to vm_gpa_hold().

PR: 208168

7 years agoMFC 304637: Fix build for !SMP kernels after the Xen MSIX workaround.
jhb [Fri, 9 Sep 2016 19:57:32 +0000 (19:57 +0000)]
MFC 304637: Fix build for !SMP kernels after the Xen MSIX workaround.

Move msix_disable_migration under #ifdef SMP since it doesn't make sense
for !SMP kernels.

PR: 212014

7 years agoMFC r305469:
delphij [Fri, 9 Sep 2016 06:59:01 +0000 (06:59 +0000)]
MFC r305469:

Ensure that we always open only files that is named by explicitly
using shell redirections instead of having gzip(1) to decide what
file to open.

Issue reported in the "non-cryptanalytic attacks against freebsd
update components" anonymous gist.

Reviewed by: allanjude, emaste

7 years agoMFC r304571:
hselasky [Fri, 9 Sep 2016 06:36:43 +0000 (06:36 +0000)]
MFC r304571:
Make the UKBD USB transfers double buffered and set them up one by one,
so they are memory independent which allows for handling panics
triggered by the keyboard driver itself, typically via CTRL+ALT+ESC
sequences. Or if the USB keyboard driver was processing a key at the
moment of panic. Allow UKBD to be attached while keyboard polling is active.

7 years agoMFC r305284:
hselasky [Fri, 9 Sep 2016 06:25:40 +0000 (06:25 +0000)]
MFC r305284:
Fix array size issue when using the pre-scaling feature for
ISOCHRONOUS USB transfers. Make sure enough length and buffer pointers
are allocated when setting up the libusb transfer structure to support
the maximum number of frames the kernel can handle.

7 years agoMFC r303893, r303894:
pfg [Thu, 8 Sep 2016 15:25:41 +0000 (15:25 +0000)]
MFC r303893, r303894:
misc replacements of comma with semicolon when pertinent.

Uses of commas instead of a semicolons can easily go undetected. The comma
can serve as a statement separator but this shouldn't be abused when
statements are meant to be standalone.

7 years agoMFC r303889:
pfg [Thu, 8 Sep 2016 15:12:20 +0000 (15:12 +0000)]
MFC r303889:
libc/rpc: replace comma with semicolon when pertinent.

Uses of commas instead of a semicolons can easily go undetected. The comma
can serve as a statement separator but this shouldn't be abused when
statements are meant to be standalone.

7 years agoMFC r303891, r303892:
pfg [Thu, 8 Sep 2016 15:05:25 +0000 (15:05 +0000)]
MFC r303891, r303892:
sys: replace comma with semicolon when pertinent.

Uses of commas instead of a semicolons can easily go undetected. The comma
can serve as a statement separator but this shouldn't be abused when
statements are meant to be standalone.

7 years agoMFC r305413
ache [Thu, 8 Sep 2016 07:16:15 +0000 (07:16 +0000)]
MFC r305413

Fix error handling.

7 years agoMFC r305406,r305409,r305412
ache [Thu, 8 Sep 2016 06:53:18 +0000 (06:53 +0000)]
MFC r305406,r305409,r305412

1) Fix errors handling.

2) Prevent out of bounds access to ws[-1] (passed buffer) which happens
when the first mb sequence is incomplete and there are not enougn chars in
the read buffer. ws[-1] may lead to memory faults or false results, in
case the memory here contains '\n'.

3) Fix n == 1 case. Here should be no physical read (fill buffer) attempt
(we read n - 1 chars with the room for NUL, see fgets()),
and no NULL return.

7 years agoMFC r305492: Let knlist_add do the locking part
gonzo [Wed, 7 Sep 2016 23:36:46 +0000 (23:36 +0000)]
MFC r305492: Let knlist_add do the locking part

Remove explicit mtx_lock/mtx_unlock around knlist_add and pass 0 as
locked parameter so knlist_add does the locking itself

Suggested by:   kib@

7 years agoMFC r305154: directory(3): Deprecate readdir_r(). Clarify dirent buffers.
jilles [Wed, 7 Sep 2016 21:03:11 +0000 (21:03 +0000)]
MFC r305154: 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, although 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.

7 years agoMFC r305090: getvfsbyname(3): Remove [EFAULT] error.
jilles [Wed, 7 Sep 2016 21:01:32 +0000 (21:01 +0000)]
MFC r305090: getvfsbyname(3): Remove [EFAULT] error.

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

7 years agoMFC r305396:
dim [Wed, 7 Sep 2016 19:29:15 +0000 (19:29 +0000)]
MFC r305396:

Add _US_ACTION_MASK to libcxxrt's arm-specific unwind header.  This
value is used in newer versions of compiler-rt.

7 years agoMFC r305389:
dim [Wed, 7 Sep 2016 19:25:08 +0000 (19:25 +0000)]
MFC r305389:

With clang 3.9.0, compiling sys/netinet/igmp.c results in the following
warning:

sys/netinet/igmp.c:546:21: error: implicit conversion from 'int' to 'char' changes value from 148 to -108 [-Werror,-Wconstant-conversion]
        p->ipopt_list[0] = IPOPT_RA;    /* Router Alert Option */
                         ~ ^~~~~~~~
sys/netinet/ip.h:153:19: note: expanded from macro 'IPOPT_RA'
#define IPOPT_RA                148             /* router alert */
                                ^~~

This is because ipopt_list is an array of char, so IPOPT_RA is wrapped
to a negative value.  It would be nice to change ipopt_list to an array
of u_char, but it changes the signature of the public struct ipoption,
so add an explicit cast to suppress the warning.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D7777

7 years agoMFC r305388:
dim [Wed, 7 Sep 2016 19:21:52 +0000 (19:21 +0000)]
MFC r305388:

With clang 3.9.0, compiling uplcom results in the following warnings:

sys/dev/usb/serial/uplcom.c:543:29: error: implicit conversion from 'int' to 'int8_t' (aka 'signed char') changes value from 192 to -64 [-Werror,-Wconstant-conversion]
        if (uplcom_pl2303_do(udev, UT_READ_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 0x8484, 0, 1)
            ~~~~~~~~~~~~~~~~       ^~~~~~~~~~~~~~~~~~~~~
sys/dev/usb/usb.h:179:53: note: expanded from macro 'UT_READ_VENDOR_DEVICE'
#define UT_READ_VENDOR_DEVICE   (UT_READ  | UT_VENDOR | UT_DEVICE)
                                 ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~

This is because UT_READ is 0x80, so the int8_t argument is wrapped to a
negative value.  Fix this by using uint8_t instead.

Reviewed by: imp, hselasky
Differential Revision: https://reviews.freebsd.org/D7776

7 years agoMFC r305360:
dim [Wed, 7 Sep 2016 19:17:03 +0000 (19:17 +0000)]
MFC r305360:

With clang 3.9.0, compiling cxgb results in the following warning:

sys/dev/cxgb/cxgb_sge.c:2873:44: error: implicit conversion from 'int'
to 'char' changes value from 128 to -128 [-Werror,-Wconstant-conversion]
                        *mtod(m, char *) = CPL_ASYNC_NOTIF;
                                         ~ ^~~~~~~~~~~~~~~

This is because CPL_ASYNC_NOTIF is 0x80, so the plain char argument is
wrapped to a negative value.  Fix this by using uint8_t instead.

Reviewed by: np
Differential Revision: https://reviews.freebsd.org/D7772

7 years agoMFC r305345:
dim [Wed, 7 Sep 2016 19:02:47 +0000 (19:02 +0000)]
MFC r305345:

With clang 3.9.0, compiling ppbus(4) results in the following warnings:

sys/dev/ppbus/ppb_1284.c:296:46: error: implicit conversion from 'int'
to 'char' changes value from 144 to -112 [-Werror,-Wconstant-conversion]
if ((error = do_peripheral_wait(bus, SELECT | nBUSY, 0))) {
     ~~~~~~~~~~~~~~~~~~      ~~~~~~~^~~~~~~
sys/dev/ppbus/ppb_1284.c:785:48: error: implicit conversion from 'int'
to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion]
if (do_1284_wait(bus, nACK | SELECT | PERROR | nBUSY,
    ~~~~~~~~~~~~      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
sys/dev/ppbus/ppb_1284.c:786:29: error: implicit conversion from 'int'
to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion]
nACK | SELECT | PERROR | nBUSY)) {
~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~

This is because nBUSY is 0x80, so the plain char argument is wrapped to
a negative value.  Fix this in a minimal fashion, by using uint8_t in a
few places.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D7771

7 years agoMFC r305344:
dim [Wed, 7 Sep 2016 18:53:46 +0000 (18:53 +0000)]
MFC r305344:

Define drmP.h's __OS_HAS_AGP and __OS_HAS_MTRR macros in a defined and
portable way.

Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D7770

7 years agoMFC r305085:
dim [Wed, 7 Sep 2016 18:33:18 +0000 (18:33 +0000)]
MFC r305085:

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.

7 years agoMFC r305077:
dim [Wed, 7 Sep 2016 18:22:08 +0000 (18:22 +0000)]
MFC r305077:

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 r305086:

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.

7 years agoMFC r305218:
dim [Wed, 7 Sep 2016 18:16:06 +0000 (18:16 +0000)]
MFC r305218:

Pull in r277331 from upstream llvm trunk (by Diana Picus):

  [AArch64] Return the correct size for TLSDESC_CALLSEQ

  The branch relaxation pass is computing the wrong offsets because it assumes
  TLSDESC_CALLSEQ eats up 4 bytes, when in fact it is lowered to an instruction
  sequence taking up 16 bytes. This can become a problem in huge files with lots
  of TLS accesses, as it may slowly move branch targets out of the range computed
  by the branch relaxation pass.

  Fixes PR24234 https://llvm.org/bugs/show_bug.cgi?id=24234

  Differential Revision: https://reviews.llvm.org/D22870

This fixes "error in backend: fixup value out of range" when compiling
the misc/talkfilters port for AArch64.

Reported by: sbruno
PR: 201762

7 years agoMFC r304920:
dim [Wed, 7 Sep 2016 18:06:34 +0000 (18:06 +0000)]
MFC r304920:

In ncurses baudrate definitions, avoid warnings about implicit
conversions from int to short changing the values.  This applies to
B38400 and higher, since their values do not fit into a short.

However, since the wrapped values are still unique, and they only serve
as keys, there is no problem in adding a cast to silence the warnings.
This also avoids changing the ABI, which would happen if we changed
NCURSES_OSPEED to int.

Discussed with: Thomas Dickey

7 years agoMFC 303299, 303475:
andrew [Wed, 7 Sep 2016 16:08:36 +0000 (16:08 +0000)]
MFC 303299, 303475:
 - Enable the generic OHCI driver on arm64
 - Add a generic EHCI USB driver based on the Allwinner A10 driver

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC 303592:
andrew [Wed, 7 Sep 2016 16:00:37 +0000 (16:00 +0000)]
MFC 303592:
Extract the common parts of pmap_kenter_device to a new function

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC 303585, 303587:
andrew [Wed, 7 Sep 2016 15:37:39 +0000 (15:37 +0000)]
MFC 303585, 303587:
 - Relax the barriers around a TLB invalidation
 - Fix the comment above pmap_invalidate_page

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC r304279:
kib [Wed, 7 Sep 2016 14:01:58 +0000 (14:01 +0000)]
MFC r304279:
By default, allow all to read the HPET registers pages.  At the same
time, by, by default disallow writes to the mmaped HPET pages.

7 years agoMFC 304801:
andrew [Wed, 7 Sep 2016 13:57:06 +0000 (13:57 +0000)]
MFC 304801:
  Don't set *dev in the zfs root case, it may be NULL and will correctly be
  set later in the function. This fixes a potential NULL pointer dereference
  found on arm64.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC 303594, 303610:
andrew [Wed, 7 Sep 2016 13:16:21 +0000 (13:16 +0000)]
MFC 303594, 303610:
 Add more AArch64 special register macros

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC 304625:
andrew [Wed, 7 Sep 2016 13:10:02 +0000 (13:10 +0000)]
MFC 304625:
 Fix the arm64 non-SMP build.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC 303307, 303308, 303309 clean up the arm64 MP code:
andrew [Wed, 7 Sep 2016 12:59:08 +0000 (12:59 +0000)]
MFC 303307, 303308, 303309 clean up the arm64 MP code:
 - Rework how we number CPUs on arm64 to try and keep clusters together.
 - Fix a typo in a string in a KASSERT to sanity check the CPU IDs.
 - Remove an unused variable.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC 303661:
andrew [Wed, 7 Sep 2016 12:33:04 +0000 (12:33 +0000)]
MFC 303661:
 Remove trailing whitespace from the arm64 pmap

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC 304140:
andrew [Wed, 7 Sep 2016 12:28:30 +0000 (12:28 +0000)]
MFC 304140:
 Add the ARMv8.1 identification registers to the list we print when booting.

Sponsored by: ABT Systems Ltd

7 years agoMFC 302849, 302851, 302896 GICv3 improvements:
andrew [Wed, 7 Sep 2016 12:10:30 +0000 (12:10 +0000)]
MFC 302849, 302851, 302896 GICv3 improvements:
 - Move internal data structures out of the common header file
 - Remove unused data structures and macros
 - Add us_print_child to the GICv3 driver

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC r305171: allow kern.proc.nfds sysctl in capability mode
emaste [Wed, 7 Sep 2016 03:15:26 +0000 (03:15 +0000)]
MFC r305171: allow kern.proc.nfds sysctl in capability mode

7 years agoRegen after r305514, allow getdtablesize in capability mode
emaste [Wed, 7 Sep 2016 02:54:40 +0000 (02:54 +0000)]
Regen after r305514, allow getdtablesize in capability mode

7 years agoMFC r305140: Allow getdtablesize in capability mode
emaste [Wed, 7 Sep 2016 02:53:38 +0000 (02:53 +0000)]
MFC r305140: Allow getdtablesize in capability mode

7 years agoMFC r303799, r303800:
pfg [Tue, 6 Sep 2016 19:51:24 +0000 (19:51 +0000)]
MFC r303799, r303800:
ext2fs: Add defines for some missing ext4 features and inode flags.

These are currently unused in our implementation and some even appear to
have not been implemented yet on linux but it is good to keep them for
reference.

Obtained from: NetBSD

7 years agoMFC 304249
davidcs [Tue, 6 Sep 2016 19:18:50 +0000 (19:18 +0000)]
MFC 304249
  Add support for set/get cam search mode

7 years agoMFC r394247
davidcs [Tue, 6 Sep 2016 19:15:44 +0000 (19:15 +0000)]
MFC r394247
  Upgrade fw, bootloader and minidump template to version 5.4.58
  Add minidump retrieval code

MFC r394248
  Add ql_minidump.h

7 years agoMFC r305065: Add refactored blacklist support to sshd
lidl [Tue, 6 Sep 2016 14:52:14 +0000 (14:52 +0000)]
MFC r305065: 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.

Approved by: des
Sponsored by: The FreeBSD Foundation

7 years agoMFC r304674: intpm: add support for SB800
avg [Tue, 6 Sep 2016 06:22:27 +0000 (06:22 +0000)]
MFC r304674: intpm: add support for SB800

7 years agoMFC r304520: fix bug introduced in r297521, set canmount=on doesn't
avg [Tue, 6 Sep 2016 06:17:34 +0000 (06:17 +0000)]
MFC r304520: fix bug introduced in r297521, set canmount=on doesn't
mount filesystem

7 years agoMFC r303738: report sector size and number of sectors in lsdev output
avg [Tue, 6 Sep 2016 06:13:36 +0000 (06:13 +0000)]
MFC r303738: report sector size and number of sectors in lsdev output
for bios disks

7 years agoMFC r305265:
kevlo [Tue, 6 Sep 2016 01:10:51 +0000 (01:10 +0000)]
MFC r305265:

Revert r304192 to fix short month names and replace %b with %_m in date_fmt
for Chinese locales.

As mentioned in the commit message of r289041, nl_langinfo(ABMON_*) only
returned numbers when using a Chinese locale, this causes problems in
applications that put the short month name and the day of the month together.

Spotted by: Ting-Wei Lan <lantw44 gmail com>

7 years agoMFC r305365
ache [Tue, 6 Sep 2016 00:33:54 +0000 (00:33 +0000)]
MFC r305365

The bug:
$ echo x | awk '/[[:cntrl:]]/'
x

The NUL character in cntrl class truncates the pattern, and an empty
pattern matches anything. The patch skips NUL as a quick fix.

PR:     195792
Submitted by:   kdrakehp@zoho.com
Approved by:    bwk@cs.princeton.edu (the author)

7 years agoMFC r304102
alc [Mon, 5 Sep 2016 23:56:27 +0000 (23:56 +0000)]
MFC r304102
  Eliminate unneeded vm_page_xbusy() and vm_page_xunbusy() operations when
  neither vm_pager_has_page() nor vm_pager_get_pages() is called.

7 years agoMFC r304509
manu [Mon, 5 Sep 2016 21:25:45 +0000 (21:25 +0000)]
MFC r304509

if_emac: Before generating a random MAC address, try using the SID rootkey
to generate one. This is was U-Boot does to generate a random MAC so we end
up with the same MAC address as if U-Boot did generate it.

7 years agoMFC r303087
manu [Mon, 5 Sep 2016 21:11:27 +0000 (21:11 +0000)]
MFC r303087

Add support for the SID (Security ID Module) on Allwinner A10 and A20.
The rootkey is burnt at production and can't be changed, thus is can be used
as a device unique ID or to generate a MAC address (This is was u-boot does).
The rootkey is exposed as a sysctl (dev.aw_sid.<unit>.rootkey).

Reviewed by: jmcneill
Differential Revision: https://reviews.freebsd.org/D6383

7 years agoMFC r304290,r304649
manu [Mon, 5 Sep 2016 20:46:45 +0000 (20:46 +0000)]
MFC r304290,r304649

r304290:
Only set pud settings if this is a pullup or pulldown configuration.
This removes the need to set the MMC pins with pullups in our DTS.
Thanks to jmcneill@ for spotting this.

r304649:
Do not include file from dt-bindings and simply use the already present defines.

7 years agoMFC r304289
manu [Mon, 5 Sep 2016 20:34:15 +0000 (20:34 +0000)]
MFC r304289

a10_gpio_get_function now returns the whole function not only
GPIO_INPUT/GPIO_OUTPUT.
a10_gpio_get_pud now returns the whole pud not only PULLDOWN/PULLUP.
Add a10_gpio_get_drv to get the current drive strenght.
During fdt pin configure, avoid setting function/drive/pud if it's already in
the correct value.

Tested on Allwinner H3 and A20