]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoIncrease WARNS for libutil tests
asomers [Sat, 11 Mar 2017 00:09:54 +0000 (00:09 +0000)]
Increase WARNS for libutil tests

ATF tests have a default WARNS of 0, unlike other usermode programs.

Reviewed by:  ngie, julian
MFC after:    3 weeks
Sponsored by: Spectra Logic Corporation
Differential Revision:        https://reviews.freebsd.org/D9933

7 years agoIncrease WARNS for libproc tests
asomers [Sat, 11 Mar 2017 00:09:30 +0000 (00:09 +0000)]
Increase WARNS for libproc tests

ATF tests have a default WARNS of 0, unlike other usermode programs.

Reviewed by:  ngie, julian
MFC after:    3 weeks
Sponsored by: Spectra Logic Corporation
Differential Revision:        https://reviews.freebsd.org/D9933

7 years agoIncrease WARNS for libpathconv tests
asomers [Sat, 11 Mar 2017 00:08:46 +0000 (00:08 +0000)]
Increase WARNS for libpathconv tests

ATF tests have a default WARNS of 0, unlike other usermode programs.

Reviewed by:  ngie, julian
MFC after:    3 weeks
Sponsored by: Spectra Logic Corporation
Differential Revision:        https://reviews.freebsd.org/D9933

7 years agoIncrease WARNS for libmp tests
asomers [Sat, 11 Mar 2017 00:08:11 +0000 (00:08 +0000)]
Increase WARNS for libmp tests

ATF tests have a default WARNS of 0, unlike other usermode programs.

Reviewed by:  ngie, julian
MFC after:    3 weeks
Sponsored by: Spectra Logic Corporation
Differential Revision:        https://reviews.freebsd.org/D9933

7 years agoIncrease WARNS for libcrypt tests
asomers [Sat, 11 Mar 2017 00:07:04 +0000 (00:07 +0000)]
Increase WARNS for libcrypt tests

ATF tests have a default WARNS of 0, unlike other usermode programs.

Reviewed by:  ngie, julian
MFC after:    3 weeks
Sponsored by: Spectra Logic Corporation
Differential Revision:        https://reviews.freebsd.org/D9933

7 years agoDocument that the msun tests require WARNS=0
asomers [Sat, 11 Mar 2017 00:04:59 +0000 (00:04 +0000)]
Document that the msun tests require WARNS=0

ATF tests have a default WARNS of 0, unlike other usermode programs.  This
change is technically a noop, but it documents that the msun tests don't
work with any warnings enabled, at least not on all architectures.

Reviewed by:  ngie
MFC after:    3 weeks
Sponsored by: Spectra Logic Corporation
Differential Revision:        https://reviews.freebsd.org/D9933

7 years agoIncrease WARNS for nss tests
asomers [Sat, 11 Mar 2017 00:03:41 +0000 (00:03 +0000)]
Increase WARNS for nss tests

ATF tests have a default WARNS of 0, unlike other usermode programs.

Reviewed by:  ngie
MFC after:    3 weeks
Sponsored by: Spectra Logic Corporation
Differential Revision:        https://reviews.freebsd.org/D9933

7 years agoIncrease WARNS for iconv tests
asomers [Sat, 11 Mar 2017 00:02:05 +0000 (00:02 +0000)]
Increase WARNS for iconv tests

ATF tests have a default WARNS of 0, unlike other usermode programs.

Reviewed by: ngie
MFC after: 3 weeks
Sponsored by: Spectra Logic Corporation
Differential Revision: https://reviews.freebsd.org/D9933

7 years ago[fdt] Make DTBs generated by make_dtb.sh overlay-ready
gonzo [Fri, 10 Mar 2017 22:45:07 +0000 (22:45 +0000)]
[fdt] Make DTBs generated by make_dtb.sh overlay-ready

Generate symbols node when compiling dts files so they can be modified
during boot-time by applying overlays.

7 years agoAbort all ATIOs and INOTs queued to SIM on LUN disable.
mav [Fri, 10 Mar 2017 21:09:33 +0000 (21:09 +0000)]
Abort all ATIOs and INOTs queued to SIM on LUN disable.

Some SIMs may not abort them implicitly, that either fail the LUN disable
request or just make us wait for those CCBs forever.  With this change
I can successfully disable LUNs on mpt(4).  For isp(4), which aborts them
implicitly, this change should be irrelevant.

MFC after: 2 weeks

7 years agoSwitch work_queue from TAILQ to STAILQ.
mav [Fri, 10 Mar 2017 20:20:00 +0000 (20:20 +0000)]
Switch work_queue from TAILQ to STAILQ.

It is mostly FIFO and we don't need random removal there.

MFC after: 2 weeks

7 years agoRequest change of SIM target role only when it is different.
mav [Fri, 10 Mar 2017 19:43:45 +0000 (19:43 +0000)]
Request change of SIM target role only when it is different.

Separate WWNs change into separate request to know what actually failed.

MFC after: 2 weeks

7 years ago[loader][fdt] Fix applying overlays without __local_fixups__ node
gonzo [Fri, 10 Mar 2017 19:15:57 +0000 (19:15 +0000)]
[loader][fdt] Fix applying overlays without __local_fixups__ node

Do not return error if __local_fixups__ node is missing in DTB overlay
because local fixup data is optional.

Reported by: Manuel Stuhn
MFC after: 1 week

7 years agoTypo.
markj [Fri, 10 Mar 2017 19:13:38 +0000 (19:13 +0000)]
Typo.

MFC after: 3 days

7 years agoTypo.
glebius [Fri, 10 Mar 2017 19:08:31 +0000 (19:08 +0000)]
Typo.

7 years agoUpdate clang, llvm, lld, lldb, compiler-rt and libc++ to 4.0.0 release.
dim [Fri, 10 Mar 2017 19:02:41 +0000 (19:02 +0000)]
Update clang, llvm, lld, lldb, compiler-rt and libc++ to 4.0.0 release.
We were already very close to the last release candidate, so this is a
pretty minor update.

Relnotes: yes
MFC after: 1 month
X-MFC-With: r314564

7 years ago[dtc] regenerate version file if upstream Makefile has been changed
gonzo [Fri, 10 Mar 2017 17:37:55 +0000 (17:37 +0000)]
[dtc] regenerate version file if upstream Makefile has been changed

Keep version file in sync by adding dependency to upstream Makefile

7 years agoMerge from vendor branch importing dtc 1.4.3
gonzo [Fri, 10 Mar 2017 17:36:05 +0000 (17:36 +0000)]
Merge from vendor branch importing dtc 1.4.3

Major new feature in this import is FDT overlay support

7 years agor314948 seems to be missing a variable or two that will break
sbruno [Fri, 10 Mar 2017 17:14:08 +0000 (17:14 +0000)]
r314948 seems to be missing a variable or two that will break
TFTP/MFSRoot booting via PXE.  For the TFTP_LOADER case, go ahead and
fire off the old bootp() request to ensure that whatever is missing is
populated.

Sponsored by: Limelight Networks

7 years agolocaledef(1): Add comment markings for license.
pfg [Fri, 10 Mar 2017 16:12:16 +0000 (16:12 +0000)]
localedef(1): Add comment markings for license.

7 years agolocaledef(1): Fix mismatch.
pfg [Fri, 10 Mar 2017 16:06:14 +0000 (16:06 +0000)]
localedef(1): Fix mismatch.

Obtained from: illumos
X-MFC with: r314974

7 years agosh: Fix executing wrong command with ${unsetvar#$(cmdsubst)}$(cmdsubst).
jilles [Fri, 10 Mar 2017 16:04:00 +0000 (16:04 +0000)]
sh: Fix executing wrong command with ${unsetvar#$(cmdsubst)}$(cmdsubst).

The parsed internal representation of words consists of a byte string with a
list of nodes (commands in command substitution). Each unescaped CTLBACKQ or
CTLBACKQ | CTLQUOTE byte corresponds to an entry in the list.

If param in ${param#%##%%word} is not set, the word is not expanded (in a
deviation of POSIX shared with other ash variants and ksh93). Erroneously,
the pointer in the list of commands (argbackq) was not advanced. This caused
the wrong command to be executed later if the outer word contained another
command substitution.

Example:
  echo "${unsetvar#$(echo a)}$(echo b)"
wrote "a" but should write "b".

MFC after: 1 week

7 years agoAdd PIM_EXTLUNS support to mpt(4).
mav [Fri, 10 Mar 2017 14:44:59 +0000 (14:44 +0000)]
Add PIM_EXTLUNS support to mpt(4).

Target mode is still limited to 256 LUNs due to the way driver is written,
but initiator can now use full 8 byte LUN space.

MFC after: 2 weeks

7 years agoRename scteken_revattr() to scteken_sc_to_te_attr(). scteken_revattr()
bde [Fri, 10 Mar 2017 14:25:38 +0000 (14:25 +0000)]
Rename scteken_revattr() to scteken_sc_to_te_attr().  scteken_revattr()
looked like it might handle reverse attributes, but it actually handles
conversion of attributes in the direction indicated by the new name.
Reverse attributes are just broken.

Rename scteken_attr() to scteken_te_to_sc_attr().  scteken_attr() looked
like it might give teken attributes, but it actually gives sc attributes.

Change scteken_te_to_sc_attr() to return int instead of unsigned int.
u_char would be enough, and it promotes to int, and syscons uses int
or u_short for its attributes everywhere else (u_short holds a shifted
form and it promotes to int too).

7 years agoImprove residuals reporting in target mode.
mav [Fri, 10 Mar 2017 13:39:16 +0000 (13:39 +0000)]
Improve residuals reporting in target mode.

MFC after: 2 weeks

7 years agoFix panic on wildcard target LUN disable.
mav [Fri, 10 Mar 2017 13:14:06 +0000 (13:14 +0000)]
Fix panic on wildcard target LUN disable.

MFC after: 2 weeks

7 years agoStart fixing some bugs in attribute handling.
bde [Fri, 10 Mar 2017 11:44:09 +0000 (11:44 +0000)]
Start fixing some bugs in attribute handling.

This change just does cleanups missed in r56043 17 years ago.  The
default attributes were still stored in structs for the purpose of
changing them and passing around pointers to the defaults, but r56043
added another layer that made the defaults invariant and only used for
initialization and reset.  Just use the defaults directly.  This was
already done for the kernel defaults.  The defaults for reverse
attributes aren't actually used, but are ignored in layers that no
longer support them.

7 years agoFix FC target mode in mpt(4), broken in multiple ways.
mav [Fri, 10 Mar 2017 10:35:52 +0000 (10:35 +0000)]
Fix FC target mode in mpt(4), broken in multiple ways.

 - Not set BufferLength caused receive of empty ATIOs.
 - CDB length guessing was broken at least for RC16.
 - mpt_req_untimeout() was called with wrong req parameter.
 - Sense data reporting was broken in several ways.

With this change my LSI7204EP-LC can pass at least basic tests as target.
The code is still far from perfect, but finally I found second hw/driver
after isp(4) that really can work in CAM target mode.

MFC after: 2 weeks

7 years agoFix compilation on sparc64. The frame buffer address is in a field that
bde [Fri, 10 Mar 2017 10:25:48 +0000 (10:25 +0000)]
Fix compilation on sparc64.  The frame buffer address is in a field that
is unavailable on sparc64 only.  This makes the new ec_putc() a non-op
on sparc64 but still calls it.  On other non-x86 arches, it should
compile but might not work.

Reported by: gjb

7 years agoFix NULL pointer dereference and panic with shm file pread/pwrite.
mmokhi [Fri, 10 Mar 2017 10:09:44 +0000 (10:09 +0000)]
Fix NULL pointer dereference and panic with shm file pread/pwrite.

PR: 217429
Reported by: Tim Newsham <tim.newsham@nccgroup.trust>
Reviewed by: kib
Approved by: dchagin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D9844

7 years agoAdd a very natural, binary version of the ASCII table.
jlh [Fri, 10 Mar 2017 09:58:10 +0000 (09:58 +0000)]
Add a very natural, binary version of the ASCII table.

Reviewed by: bcr, eadler
Obtained from: https://garbagecollected.org/2017/01/31/four-column-ascii/
MFC after: 1 day
Differential Revision: https://reviews.freebsd.org/D9902

7 years agoUse nitems() from sys/param.h.
araujo [Fri, 10 Mar 2017 06:25:54 +0000 (06:25 +0000)]
Use nitems() from sys/param.h.

Reviewed by: ngie
MFC after: 3 weeks.
Differential Revision: https://reviews.freebsd.org/D9940

7 years agoUse nitems() from sys/param.h.
araujo [Fri, 10 Mar 2017 06:23:15 +0000 (06:23 +0000)]
Use nitems() from sys/param.h.

Reviewed by: ngie
MFC after: 3 weeks.
Differential Revision: https://reviews.freebsd.org/D9936

7 years agoUse nitems() from sys/param.h and also remove the cast.
araujo [Fri, 10 Mar 2017 04:49:40 +0000 (04:49 +0000)]
Use nitems() from sys/param.h and also remove the cast.

Reviewed by: markj
MFC after: 3 weeks.
Differential Revision: https://reviews.freebsd.org/D9937

7 years agoUse nitems() from sys/param.h.
araujo [Fri, 10 Mar 2017 04:30:31 +0000 (04:30 +0000)]
Use nitems() from sys/param.h.

Reviewed by: ume
MFC after: 3 weeks.
Differential Revision: https://reviews.freebsd.org/D9938

7 years agoUse nitems() from sys/param.h.
araujo [Fri, 10 Mar 2017 04:24:21 +0000 (04:24 +0000)]
Use nitems() from sys/param.h.

Reviewed by: asomers
MFC after: 3 weeks.
Differential Revision: https://reviews.freebsd.org/D9944

7 years agoImport dtc 1.4.3
gonzo [Fri, 10 Mar 2017 03:28:43 +0000 (03:28 +0000)]
Import dtc 1.4.3

Obtained from:  https://www.kernel.org/pub/software/utils/dtc/dtc-1.4.3.tar.gz

7 years agolocaledef(1): Fix small coverity issues.
pfg [Thu, 9 Mar 2017 21:49:11 +0000 (21:49 +0000)]
localedef(1): Fix small coverity issues.

- Operands don't affect result (CONSTANT_EXPRESSION_RESULT)
- Buffer not null terminated (BUFFER_SIZE_WARNING)

CID: 13385571338565

Obtained from: illumos
MFC after: 5 days

7 years agoAvoid bind lock recursion.
kib [Thu, 9 Mar 2017 21:05:47 +0000 (21:05 +0000)]
Avoid bind lock recursion.

When dlclose(3) unloads an object with filtees, it recursively calls
dlclose(3) on each filtee in free_needed_filtees().  Introduce
dlclose_locked() helper, called from free_needed_filtees() instead of
dlclose(), and pass the bind lockstate down to avoid recursing.

Reported and tested by: jhibbits
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoRevert r314969, r314961:
pfg [Thu, 9 Mar 2017 19:02:36 +0000 (19:02 +0000)]
Revert r314969, r314961:

The localdef(1) changes are breaking world:

00:18:40.750 /usr/src/share/colldef/af_ZA.UTF-8.src: 2421: error: Bad file
descriptor

I will fix them offline.

Reported by: lwshu and many others

7 years agoFix implementation of the DECLARE_WORK() macro in the LinuxKPI to fully
hselasky [Thu, 9 Mar 2017 18:37:17 +0000 (18:37 +0000)]
Fix implementation of the DECLARE_WORK() macro in the LinuxKPI to fully
initialize the declared work structure and not only the function callback
pointer.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoImplement support for mutexes with deadlock avoidance in the LinuxKPI.
hselasky [Thu, 9 Mar 2017 18:33:40 +0000 (18:33 +0000)]
Implement support for mutexes with deadlock avoidance in the LinuxKPI.

When locking a mutex and deadlock is detected the first mutex lock
call that sees the deadlock will return -EDEADLK .

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agolocaledef(1): Fix mismatch in previous commit.
pfg [Thu, 9 Mar 2017 18:06:48 +0000 (18:06 +0000)]
localedef(1): Fix mismatch in previous commit.

delete_category is meant to replace fclose() and unlink().
This broke world.

Found by: kib
Pointedhat: pfg

7 years agoReport some more data in XPT_PATH_INQ.
mav [Thu, 9 Mar 2017 17:53:37 +0000 (17:53 +0000)]
Report some more data in XPT_PATH_INQ.

I am not sure they are used anywhere, but why not.

MFC after: 2 weeks

7 years agoAdd support for XPT_GET_SIM_KNOB in FC mode.
mav [Thu, 9 Mar 2017 17:35:35 +0000 (17:35 +0000)]
Add support for XPT_GET_SIM_KNOB in FC mode.

MFC after: 2 weeks

7 years agoReport FC link speed.
mav [Thu, 9 Mar 2017 17:06:34 +0000 (17:06 +0000)]
Report FC link speed.

MFC after: 2 weeks

7 years agoCleanup the LinuxKPI mutex wrappers.
hselasky [Thu, 9 Mar 2017 17:01:00 +0000 (17:01 +0000)]
Cleanup the LinuxKPI mutex wrappers.

Add support for using mutexes during KDB and shutdown. This is also
required for doing mode-switching during panic for drm-next.

Add new mutex functions mutex_init_witness() and mutex_destroy()
allowing LinuxKPI mutexes to be tracked by witness.

Declare mutex_is_locked() and mutex_is_owned() like inline functions
to get cleaner warnings. These functions are used inside WARN_ON()
statements which might look a bit odd if these functions get fully
expanded.

Give mutexes better debug names through the mutex_name() macro when
WITNESS_ALL is defined. The mutex_name() macro can prefix parts of the
filename and line number before the mutex name.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoDecode modern PIM flags.
mav [Thu, 9 Mar 2017 16:34:55 +0000 (16:34 +0000)]
Decode modern PIM flags.

MFC after: 2 weeks

7 years agoFix harmless mismerge from r286964
asomers [Thu, 9 Mar 2017 16:22:21 +0000 (16:22 +0000)]
Fix harmless mismerge from r286964

MFC after: 3 days
Sponsored by: Spectra Logic Corp

7 years agoloader.efi: only include the machine/ header files on x86
dexuan [Thu, 9 Mar 2017 15:44:25 +0000 (15:44 +0000)]
loader.efi: only include the machine/ header files on x86

The 2 files may not exist on other archs like aarch64 and hence we
can have a build failure there.

Reported by: lwhsu
MFC after: 2 weeks
Sponsored by: Microsoft

7 years agolocaledef(1): Fix for memory leaks reported by coverity.
pfg [Thu, 9 Mar 2017 15:21:03 +0000 (15:21 +0000)]
localedef(1): Fix for memory leaks reported by coverity.

Also some small cleanups to match better current illumos.

CID: 1338540133854113385571338566

Obtained from: illumos
Discussed with: Yuri Pankov (@Nexenta)
MFC after: 5 days

7 years agoFix typo in comment.
kib [Thu, 9 Mar 2017 13:41:57 +0000 (13:41 +0000)]
Fix typo in comment.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

7 years agoloader.efi: only reduce the size of the staging area on Hyper-V
dexuan [Thu, 9 Mar 2017 12:09:07 +0000 (12:09 +0000)]
loader.efi: only reduce the size of the staging area on Hyper-V

Doing this on physical hosts turns out to be problematic, e.g. see comment
24 and 28 in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211746.

To fix the real underlying issue correctly & thoroughly, IMO we need
a relocatable kernel, but that would require a lot of complicated long
term work:  https://reviews.freebsd.org/D9686?id=25414#inline-56969

For now, let's only apply efi_verify_staging_size() to VMs running on
Hyper-V, and restore the old behavior on physical machines since that
has been working for people for a long period of time, though that's
potentially unsafe...

MFC after: 2 weeks
Sponsored by: Microsoft

7 years agoo Typo in the comment fixed.
maxim [Thu, 9 Mar 2017 09:54:23 +0000 (09:54 +0000)]
o Typo in the comment fixed.

PR: 217617
Submitted by: lutz

7 years agostyle(9): sort the #includes
ngie [Thu, 9 Mar 2017 09:25:11 +0000 (09:25 +0000)]
style(9): sort the #includes

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoDon't create any threads before SI_SUB_INIT_IF in the LinuxKPI. Else
hselasky [Thu, 9 Mar 2017 09:17:43 +0000 (09:17 +0000)]
Don't create any threads before SI_SUB_INIT_IF in the LinuxKPI. Else
kthread_add() will assert it is called too soon. This fixes a startup
issue when COMPAT_LINUXKPI is in enabled the kernel configuration
file.

Reported by: Michael Butler <imb@protected-networks.net>
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoFix unused variable when built without INVARIANT_SUPPORT.
mav [Thu, 9 Mar 2017 07:55:58 +0000 (07:55 +0000)]
Fix unused variable when built without INVARIANT_SUPPORT.

MFC after: 2 weeks

7 years agoExpect :test_zero_input to fail on amd64
ngie [Thu, 9 Mar 2017 06:58:47 +0000 (06:58 +0000)]
Expect :test_zero_input to fail on amd64

The clang 4.x+ upgrade now causes this testcase to fail, but
only on amd64.

More investigation will be done to determine the cause.

MFC after: 1 week
Reported by: Jenkins
PR: 217528
Sponsored by: Dell EMC Isilon

7 years agoDon't expect :test_large_inputs to fail with i386 anymore
ngie [Thu, 9 Mar 2017 06:56:44 +0000 (06:56 +0000)]
Don't expect :test_large_inputs to fail with i386 anymore

Recent changes (maybe a side-effect of the ATF-ification in r314649)
invalidate the failure expectation.

PR: 205446
MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoCache NLS data for strerror(3).
oshogbo [Thu, 9 Mar 2017 06:41:00 +0000 (06:41 +0000)]
Cache NLS data for strerror(3).

7 years agoTry to extract the RFC1048 data from PXE. If we get enough info we can skip
oshogbo [Thu, 9 Mar 2017 06:01:24 +0000 (06:01 +0000)]
Try to extract the RFC1048 data from PXE. If we get enough info we can skip
the bootp(). It removes unnecessary DHCP request from pxeloader.

Submitted by: kczekirda
Sponsored by: Oktawave
Initiated by: Matthew Dillon
Reviewed by: smh, gnn, bapt, oshogbo
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D9847

7 years agoSlight rewording in nvme(4)
asomers [Thu, 9 Mar 2017 05:30:05 +0000 (05:30 +0000)]
Slight rewording in nvme(4)

Reviewed by: jimharris, imp
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D9927

7 years agoConfigure leap-second smearing (always).
cy [Thu, 9 Mar 2017 05:29:24 +0000 (05:29 +0000)]
Configure leap-second smearing (always).

Leap-second smearing is an experimental option that may be specified in
ntp.conf(5) and the -x option on the command line to spread the effect
of a leap-second over an interval as specified by the leapsmearinterval
config file statement. Recommended values are between 7200 (2 hours) and
86400 (24 hours).

It is advised that leap-second smearing not be used for public NTP
servers (https://www.meinbergglobal.com/download/burnicki/Leap\
%20Second%20Smearing%20With%20NTP.pdf). It is also advised that NTP
clients not use a mix of NTP servers using leap-second smearing with
NTP servers not using leap-second smearing as that could cause
undefined client behaviour.

Leap-second smearing was committed to ports net/ntp and net/ntp-devel
by r426825 on 2016-11-22.

Suggested by: des
MFC after: 4 weeks

7 years agoSome style(9) fixes. No functional changes.
oshogbo [Thu, 9 Mar 2017 05:13:07 +0000 (05:13 +0000)]
Some style(9) fixes. No functional changes.

Submitted by: kczekirda
Sponsored by: Oktawave
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D9395

7 years agoRename some tests to end in _test.
bdrewery [Thu, 9 Mar 2017 04:20:00 +0000 (04:20 +0000)]
Rename some tests to end in _test.

Requested by: ngie
MFC after: 2 weeks
X-MFC-With: r314886

7 years agoRemove unneeded -x from tests.
bdrewery [Thu, 9 Mar 2017 04:19:52 +0000 (04:19 +0000)]
Remove unneeded -x from tests.

Reported by: ngie
MFC after: 2 weeks
X-MFC-With: r314886

7 years agoImport the awk(1) manpage from OpenBSD
bapt [Thu, 9 Mar 2017 03:27:53 +0000 (03:27 +0000)]
Import the awk(1) manpage from OpenBSD

As discussed during AsiaBSDcon devsummit, import the manpage from OpenBSD which
is has been rewritten in mdoc(7) format making it readable by default with
mandoc, it also has been extended by OpenBSD to cover all awk(1) options

Obtained from: OpenBSD
MFH: 1 week

7 years agoValidate values read from the RTC before trying BCD decoding
vangyzen [Thu, 9 Mar 2017 02:19:30 +0000 (02:19 +0000)]
Validate values read from the RTC before trying BCD decoding

Submitted by: cem
Reported by: Michael Gmelin <freebsd@grem.de>
Tested by: Oleksandr Tymoshenko <gonzo@bluezbox.com>
Sponsored by: Dell EMC

7 years agoec2.conf and vmimage.subr can be used from the installation livecd after
thompsa [Thu, 9 Mar 2017 01:26:10 +0000 (01:26 +0000)]
ec2.conf and vmimage.subr can be used from the installation livecd after
install to prepare an AMI image. This can be used to create a ZFS AMI disk
image using a virtual machine.

Change ec2.conf to use the pkg tool from a chroot rather than trying to
bootstrap it and fail from the livecd readonly filesystem.

Reviewed by: gjb

7 years ago[spigen] Add spigen module
gonzo [Thu, 9 Mar 2017 01:21:28 +0000 (01:21 +0000)]
[spigen] Add spigen module

spigen provides userland API to SPI bus. Make it available as a loadable
module so people using official ARM images can enabled it on devices like
BBB or RPi without re-building kernel

MFC after: 1 week

7 years ago[spigen] make spigen device ready to be compiled as a module
gonzo [Thu, 9 Mar 2017 01:00:27 +0000 (01:00 +0000)]
[spigen] make spigen device ready to be compiled as a module

- Add flag to indicate that device is opened by userland
- Replace "always fail" detach method with proper detach implementation

MFC after: 1 week

7 years agoDo not turn LOCK_DEBUG for INVARIANT_SUPPORT. This allows to add
glebius [Thu, 9 Mar 2017 00:58:21 +0000 (00:58 +0000)]
Do not turn LOCK_DEBUG for INVARIANT_SUPPORT.  This allows to add
INVARIANT_SUPPORT into a kernel without performance penalties.

Discussed with: jhb, mjg

7 years agoIn linker_load_file() print name of a file that failed to load.
glebius [Thu, 9 Mar 2017 00:56:07 +0000 (00:56 +0000)]
In linker_load_file() print name of a file that failed to load.

Discussed with: kib

7 years agoMake inp_lock_assert() depend on INVARIANT_SUPPORT, not INVARIANTS.
glebius [Thu, 9 Mar 2017 00:55:19 +0000 (00:55 +0000)]
Make inp_lock_assert() depend on INVARIANT_SUPPORT, not INVARIANTS.
This will make INVARIANT-enabled modules, that use this function to load
successfully on a kernel that has INVARIANT_SUPPORT only.

7 years agoReduce stack usage in link_elf_load_file(), allocating struct nameidata.
glebius [Thu, 9 Mar 2017 00:45:15 +0000 (00:45 +0000)]
Reduce stack usage in link_elf_load_file(), allocating struct nameidata.
This function may be called recursively, when a module pulls its dependencies.
Under certain circumstances, e.g. quad chain of dependencies and presence
of dtrace we may run out of stack.

7 years agoefidp manipulates UEFI Device Paths in various ways. At the moment, it
imp [Thu, 9 Mar 2017 00:33:38 +0000 (00:33 +0000)]
efidp manipulates UEFI Device Paths in various ways. At the moment, it
formats and parses UEFI standard Device Paths. In the future it will
also translate between FreeBSD driver names and UEFI Device Paths.

Sponsored by: Netflix

7 years agoFinish implementing -d/--device/--device-path flag to print variable
imp [Thu, 9 Mar 2017 00:31:36 +0000 (00:31 +0000)]
Finish implementing -d/--device/--device-path flag to print variable
as if it were a device path.

Remove language about a=b syntax on the command line. This will not be
implemented due to its limited usefulness. UEFI variables are binary
blobs, on the whole, and a simple work around exists for
strings. Clarify that the new value of the variable is taken from
stdin. Update manual with history.

Sponsored by: Netflix

7 years agoBring in EDK2 routines for printing and parsing device paths.
imp [Thu, 9 Mar 2017 00:31:31 +0000 (00:31 +0000)]
Bring in EDK2 routines for printing and parsing device paths.

This commit implements the (mostly?) Linux compatible
efidp_format_device_path and efidp_parse_device_path APIs. These are
the only APIs exposed through this library. However, they are built on
code from Tianocore's EDK2 MdePkg. They are brought in as new files
here for reasons described in FreeBSD-update.

Symbol versioning will be introduced to control what's exported from
the EDK2 code.

Some structural changes may be necessary when we move to sharing with
sys/boot/efi.

Sponsored by: Netflix

7 years agoShare UCS2/UTF8 routines between boot loader and userland.
imp [Thu, 9 Mar 2017 00:24:01 +0000 (00:24 +0000)]
Share UCS2/UTF8 routines between boot loader and userland.

Move the UCS2 to UTF8 routines over into sys/boot/efi and have
libefivar grab them from there.

Sponsored by: Netflix

7 years agosbin/devfs: clarify usage
ngie [Wed, 8 Mar 2017 23:58:10 +0000 (23:58 +0000)]
sbin/devfs: clarify usage

- Note existence of -m option.
- Note that -s applies to rule keyword, only, by adding usage text
  specifically for the `rule` and `ruleset` keywords.

Don't go into any further detail in usage(..) -- it's best that one
reads the manpage to get a better idea of how things work as there are
a number of different option-specific keywords and arguments, as well
as some rule grammar.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoiwn: add promiscuous mode support.
avos [Wed, 8 Mar 2017 22:49:22 +0000 (22:49 +0000)]
iwn: add promiscuous mode support.

Tested with Intel 6205, STA / MONITOR modes.

7 years agoFix compilation warning for powerpc64 by not using const keyword in
hselasky [Wed, 8 Mar 2017 21:28:53 +0000 (21:28 +0000)]
Fix compilation warning for powerpc64 by not using const keyword in
return types:

Type qualifiers ignored on function return type [-Wreturn-type]

Reported by: andreast @
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoUpdate the comment for the Wacom WACF00e to make it clear it's not an
ian [Wed, 8 Mar 2017 20:58:56 +0000 (20:58 +0000)]
Update the comment for the Wacom WACF00e to make it clear it's not an
accidental duplicate of WACF004.

PR: 217306

7 years agoAdd the pnp id for a Wacom 'WACF00e' tablet.
ian [Wed, 8 Mar 2017 20:41:27 +0000 (20:41 +0000)]
Add the pnp id for a Wacom 'WACF00e' tablet.

PR: 217306
Submitted by: large.hadron.collider@gmx.com

7 years agoHandle fifo size differences between older and newer revs of pl011 hardware.
ian [Wed, 8 Mar 2017 18:53:32 +0000 (18:53 +0000)]
Handle fifo size differences between older and newer revs of pl011 hardware.

Starting with rev 5 (which is inexplicably indicated by a version number
of '3' in the Peripheral ID register), the pl011 doubled the size of the
rx and tx fifos, to 32 bytes, so read the ID register and set the size
variables in the softc accordingly.

An interesting wrinkle in this otherwise-simple concept is that the
bcm2835 SoC, used in Raspberry Pi systems among others, has the rev 5
pl011 hardware, but somehow also has the older 16-byte fifos.  We check
the FDT data to see if the hardware is part of a bcm283x system and use
the smaller size if so.

Thanks to jchandra@ for pointing out that newer hardware has bigger fifos.

7 years agoFix permissions on /tmp when installing the runtime package.
gjb [Wed, 8 Mar 2017 18:52:40 +0000 (18:52 +0000)]
Fix permissions on /tmp when installing the runtime package.

Reported by: many
Patch by: Kyle Evans
PR: 217574
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoUse the buildworld includes and defaults when building pkt-gen. This will
sbruno [Wed, 8 Mar 2017 17:29:40 +0000 (17:29 +0000)]
Use the buildworld includes and defaults when building pkt-gen.  This will
mean that you need a world built to reliably build pkg-gen but this keeps
the build from failing when your source doesn't match your host running
version, e.g. building 12 on 11.

Submitted by: Matt Macy <mmacy@nextbsd.org>
MFC after: 2 weeks
Sponsored by: Limelight Networks

7 years agoRelease all previously allocated resources.
mmel [Wed, 8 Mar 2017 14:52:03 +0000 (14:52 +0000)]
Release all previously allocated resources.

7 years agoMFV r314911: 7867 ARC space accounting leak
avg [Wed, 8 Mar 2017 13:52:45 +0000 (13:52 +0000)]
MFV r314911: 7867 ARC space accounting leak

illumos/illumos-gate@6de76ce2a90f54fecb0dba46dca08c99cef7aa08
https://github.com/illumos/illumos-gate/commit/6de76ce2a90f54fecb0dba46dca08c99cef7aa08

https://www.illumos.org/issues/7867
  It seems that in the case where arc_hdr_free_pdata() sees HDR_L2_WRITING() we
  would fail to update the ARC space statistics.
  In the normal case those statistics are updated in arc_free_data_buf(). But in
  the arc_hdr_free_on_write() path we don't do that.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Andriy Gapon <avg@FreeBSD.org>

MFC after: 10 days

7 years agoMFV r314910: 7843 get_clones_stat() is suboptimal for lots of clones
avg [Wed, 8 Mar 2017 13:48:26 +0000 (13:48 +0000)]
MFV r314910: 7843 get_clones_stat() is suboptimal for lots of clones

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

https://www.illumos.org/issues/7843
  get_clones_stat() could be very slow if a snapshot has many (thousands) clones.
  Clone names are added to an nvlist that's created with NV_UNIQUE_NAME.
  So, each time a new name is appended to the list, the whole list is searched
  linearly to see if that name is not already in the list. That results in the
  quadratic complexity.
  That should be easy to fix as we know in advance that we should not get any
  duplicate names, so we can drop NV_UNIQUE_NAME when creating the list.

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Andriy Gapon <avg@FreeBSD.org>

MFC after: 1 week
Sponsored by: ClusterHQ

7 years agoWhen chunking large DIOCGDELETE, do it on stripe edge.
mav [Wed, 8 Mar 2017 12:18:58 +0000 (12:18 +0000)]
When chunking large DIOCGDELETE, do it on stripe edge.

MFC after: 2 weeks

7 years agoUnbreak ARMv6 world.
mmel [Wed, 8 Mar 2017 11:40:27 +0000 (11:40 +0000)]
Unbreak ARMv6 world.

The new compiler_rt library imported with clang 4.0.0 have several fatal
issues (non-functional __udivsi3 for example) with ARM specific instrict
functions. As temporary workaround, until upstream solve these problems,
disable all thumb[1][2] related feature.

7 years agoAdd initial support for UNMAP granularity.
mav [Wed, 8 Mar 2017 11:24:33 +0000 (11:24 +0000)]
Add initial support for UNMAP granularity.

Report UNMAP granularity as stripesize/-offset if we have no other values
to report there.

Add new quirk DA_Q_STRICT_UNMAP for cases when target is too critical to
misaligned UNMAP request, reporting errors instead of being suboptimal.
Setting this quirk makes da periph to forcefully align all UNMAP requests
to avoid those errors by the cost of some odd ranges not being UNMAP'ed.
This makes UNMAP usable within VMware 6.x VMs, just now 100% efficient.

MFC after: 2 weeks

7 years agoCleanup the LinuxKPI slab implementation.
hselasky [Wed, 8 Mar 2017 11:09:27 +0000 (11:09 +0000)]
Cleanup the LinuxKPI slab implementation.

Put large functions into linux_slab.c instead of declaring them static
inline.

Add support for more memory allocation wrappers like kmalloc_array()
and __vmalloc().

Make sure either the M_WAITOK or the M_NOWAIT flag is set and mask
away unused memory allocation flags before calling FreeBSD's malloc()
routine.

Move kmalloc_node() definition to slab.h where it belongs.

Implement support for the SLAB_DESTROY_BY_RCU feature when creating a
kmem_cache which basically means kmem_cache memory is freed using
call_rcu().

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoImplement eth_zero_addr() in the LinuxKPI.
hselasky [Wed, 8 Mar 2017 09:53:20 +0000 (09:53 +0000)]
Implement eth_zero_addr() in the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoRemove reference to GNU info hier(7)
bapt [Wed, 8 Mar 2017 08:57:35 +0000 (08:57 +0000)]
Remove reference to GNU info hier(7)
we have removed texinfo in FreeBSD 11.0

7 years agotexinfo is gone in r276551 remove the related directories
bapt [Wed, 8 Mar 2017 08:52:15 +0000 (08:52 +0000)]
texinfo is gone in r276551 remove the related directories

Reported by: jbeich

7 years agoUse LDFLAGS rather than CFLAGS when linking.
brooks [Wed, 8 Mar 2017 08:25:26 +0000 (08:25 +0000)]
Use LDFLAGS rather than CFLAGS when linking.

Reviewed by: kan
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D9882

7 years agoRemove now unneded cast.
ae [Wed, 8 Mar 2017 08:09:41 +0000 (08:09 +0000)]
Remove now unneded cast.

7 years agoMatch JETSON-TK1 FreeBSD specific DTS stub with r314854.
mmel [Wed, 8 Mar 2017 07:23:15 +0000 (07:23 +0000)]
Match JETSON-TK1 FreeBSD specific DTS stub with r314854.