]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoRevert r314780
pfg [Sun, 12 Mar 2017 17:41:51 +0000 (17:41 +0000)]
Revert r314780
libpam: extra bounds checking through reallocarray(3).

It appears to be causing brokenness when reporting PAM_* environment
variables. This requires more investigation.

Reported by: lstewart

7 years agoRemove strange config_intrhook_establish() magic.
mav [Sun, 12 Mar 2017 16:55:18 +0000 (16:55 +0000)]
Remove strange config_intrhook_establish() magic.

Interrupts are enabled as part of chip reset just during driver attach.
Later "enabling" of already enabled interrupts is useless.

MFC after: 2 weeks

7 years agolibc: provide some bounds-checking through reallocarray(3).
pfg [Sun, 12 Mar 2017 16:03:34 +0000 (16:03 +0000)]
libc: provide some bounds-checking through reallocarray(3).

reallocarray(3) is a non portable extension that originated in OpenBSD.
Given that it is already in FreeBSD's libc it is useful for the cases
where reallocation involves a multiplication.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D9955

7 years agoTry to slight untangle I/O and loop status handling.
mav [Sun, 12 Mar 2017 15:36:07 +0000 (15:36 +0000)]
Try to slight untangle I/O and loop status handling.

MFC after: 2 weeks

7 years agoRemove code for unsupported FreeBSD versions.
mav [Sun, 12 Mar 2017 14:17:57 +0000 (14:17 +0000)]
Remove code for unsupported FreeBSD versions.

MFC after: 2 weeks

7 years agoAvoid reusing p_ksi while it is on queue.
kib [Sun, 12 Mar 2017 13:58:51 +0000 (13:58 +0000)]
Avoid reusing p_ksi while it is on queue.

When sending SIGCHLD informing reaper that a zombie was reparented to
it, we might race with the situation where the previous parent still
not finished delivering SIGCHLD and having its p_ksi structure on the
signal queue.  While on queue, the ksi should not be used for another
send.

Fix this by copying p_ksi into newly allocated ksi, which is directly
put onto reaper sigqueue.  The later ensures that siginfo for reaper
SIGCHLD is always present, similar to guarantees for siginfo of child.

Reported by: bdrewery
Discussed with: jilles
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoFollow-up to r313690.
kib [Sun, 12 Mar 2017 13:53:13 +0000 (13:53 +0000)]
Follow-up to r313690.

Fix two missed places where vm_object offset to index calculation
should use unsigned shift, to allow handling of full range of unsigned
offsets used to create device mappings.

Reported and tested by: royger (previous version)
Reviewed by: alc (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoAccept linkers representation for ELF segments with zero on-disk length.
kib [Sun, 12 Mar 2017 13:51:13 +0000 (13:51 +0000)]
Accept linkers representation for ELF segments with zero on-disk length.

For such segments, GNU bfd linker writes knowingly incorrect value
into the the file offset field of the program header entry, with the
motivation that file should not be mapped for creation of this segment
at all.

Relax checks for the ELF structure validity when on-disk segment
length is zero, and explicitely set mapping length to zero for such
segments to avoid validating rounding arithmetic.

PR: 217610
Reported by: Robert Clausecker <fuz@fuz.su>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoStyle.
kib [Sun, 12 Mar 2017 13:49:42 +0000 (13:49 +0000)]
Style.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoKtracing kevent(2) calls with unusual arguments might leads to an
kib [Sun, 12 Mar 2017 13:48:24 +0000 (13:48 +0000)]
Ktracing kevent(2) calls with unusual arguments might leads to an
overly large allocation requests.

When ktrace-ing io, sys_kevent() allocates memory to copy the
requested changes and reported events.  Allocations are sized by the
incoming syscall lengths arguments, which are user-controlled, and
might cause overflow in calculations or too large allocations.

Since io trace chunks are limited by ktr_geniosize, there is no sense
it even trying to satisfy unbounded allocations.  Export ktr_geniosize
and clamp the buffers sizes in advance.

PR: 217435
Reported by: Tim Newsham <tim.newsham@nccgroup.trust>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoSome more polishing.
mav [Sun, 12 Mar 2017 12:38:16 +0000 (12:38 +0000)]
Some more polishing.

MFC after: 13 days

7 years agoAdd a __printflike() that would have caught the bug fixed in r314396.
des [Sun, 12 Mar 2017 11:54:35 +0000 (11:54 +0000)]
Add a __printflike() that would have caught the bug fixed in r314396.

7 years ago- Remove separate handling of /bin and /usr/bin in manpath. They are no
tijl [Sun, 12 Mar 2017 10:56:19 +0000 (10:56 +0000)]
- Remove separate handling of /bin and /usr/bin in manpath.  They are no
  longer a special case.
- Prefer PREFIX/share/man over PREFIX/man.
- Add /usr/local/share/man to man_default_path.
- Update manpath man page.

Reviewed by: bapt

7 years agoUse 'options EXT_RESOURCES' instead of 'device ext_resources' for FDT enabled
manu [Sun, 12 Mar 2017 07:09:50 +0000 (07:09 +0000)]
Use 'options EXT_RESOURCES' instead of 'device ext_resources' for FDT enabled
MIPS kernel config.

7 years agopf: Fix incorrect rw_sleep() in pf_unload()
kp [Sun, 12 Mar 2017 05:42:57 +0000 (05:42 +0000)]
pf: Fix incorrect rw_sleep() in pf_unload()

When we unload we don't hold the pf_rules_lock, so we cannot call rw_sleep()
with it, because it would release a lock we do not hold. There's no need for the
lock either, so we can just tsleep().

While here also make the same change in pf_purge_thread(), because it explicitly
takes the lock before rw_sleep() and then immediately releases it afterwards.

7 years agolib/libcam/cam.3: fix manpage warnings
ngie [Sun, 12 Mar 2017 05:20:49 +0000 (05:20 +0000)]
lib/libcam/cam.3: fix manpage warnings

- spelling: "mis-named" should be "misnamed".
- delete spaces interspersed in literal representation of
  `struct cam_device` as hard-tabs separate the types and fields.
- Add commas after `e.g.`.

Reported by: igor
MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoUse .Dv when referencing NULL
ngie [Sun, 12 Mar 2017 05:07:33 +0000 (05:07 +0000)]
Use .Dv when referencing NULL

This is the correct markup macro, as opposed to .Va (variable names)

While here, annotate several bare references to `NULL` with .Dv.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agopf: Do not lose the VNET lock when ending the purge thread
kp [Sun, 12 Mar 2017 05:00:04 +0000 (05:00 +0000)]
pf: Do not lose the VNET lock when ending the purge thread

When the pf_purge_thread() exits it must make sure to release the
VNET_LIST_RLOCK it still holds.
kproc_exit() does not return.

7 years agoRemove /rescue/zdb if MK_ZFS == no
ngie [Sun, 12 Mar 2017 04:28:45 +0000 (04:28 +0000)]
Remove /rescue/zdb if MK_ZFS == no

Missed in r202452.

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoConditionally compile [additional] programs into rescue(8) if requested
ngie [Sun, 12 Mar 2017 04:24:29 +0000 (04:24 +0000)]
Conditionally compile [additional] programs into rescue(8) if requested

Trivial oversight missed in r314240 cleanup because I enable these knobs on
my test machines.

MK_INET6_SUPPORT - rtsol
MK_NETCAT - nc

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoAdd the capability to refresh the gpart(8) label without need a reboot.
araujo [Sun, 12 Mar 2017 04:15:56 +0000 (04:15 +0000)]
Add the capability to refresh the gpart(8) label without need a reboot.

gpart(8) has functionality to change the label of an GPT partition.
This functionality works like it should, however, after a label change
the /dev/gpt/ entries remain unchanged. glabel(8) status output remains
unchanged. The change only takes effect after a reboot.

PR: 162690
Submitted by: sub.mesa@gmail, Ben RUBSON <ben.rubson@gmail.com>, ae
Reviewed by: allanjude, bapt, bcr
MFC after: 6 weeks.
Differential Revision: https://reviews.freebsd.org/D9935

7 years agoRemove /rescue/iscsictl and /rescue/iscsid if MK_ISCSI == no
ngie [Sun, 12 Mar 2017 04:14:21 +0000 (04:14 +0000)]
Remove /rescue/iscsictl and /rescue/iscsid if MK_ISCSI == no

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoRestore some of the error message text accidentally removed in r315098
ngie [Sun, 12 Mar 2017 04:08:36 +0000 (04:08 +0000)]
Restore some of the error message text accidentally removed in r315098

"unexpected symlink contents" is more pedantically correct than
"unexpected symlink".

MFC after: 1 week
X-MFC with: r315098
Sponsored by: Dell EMC Isilon

7 years agoFix building with recent gcc
bapt [Sun, 12 Mar 2017 04:04:16 +0000 (04:04 +0000)]
Fix building with recent gcc

Reported by: lwhsu, ngie

7 years agoAdd 3 more testcases demonstrating how install -l sr works
ngie [Sun, 12 Mar 2017 03:58:54 +0000 (03:58 +0000)]
Add 3 more testcases demonstrating how install -l sr works

The additional testcases use absolute paths for sources and targets,
as the other testcase which tested `-l sr` used flat relative paths in
the same directory.

Please note that these testcases do not test `-l a` -- that's already
addressed in the battery of tests.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoFix bad latest entry
bapt [Sun, 12 Mar 2017 03:53:41 +0000 (03:53 +0000)]
Fix bad latest entry

Reported by: ngie

7 years agolibc: small cleanup.
pfg [Sun, 12 Mar 2017 03:50:13 +0000 (03:50 +0000)]
libc: small cleanup.

Initialize newsize in the code section so we avoids asigning the
value if we exit early.

7 years agoImplement a stub --horizon-lines=NUM for compatibility with GNU diff3
bapt [Sun, 12 Mar 2017 03:49:05 +0000 (03:49 +0000)]
Implement a stub --horizon-lines=NUM for compatibility with GNU diff3

some options of GNU diff3 would call diff with --horizon-lines, rcs is depending
on that.

Reported by: antoine

7 years agoUse nitems() from sys/param.h.
araujo [Sun, 12 Mar 2017 03:43:28 +0000 (03:43 +0000)]
Use nitems() from sys/param.h.

Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D9943

7 years agoFix wrong date in diff(1)
bapt [Sun, 12 Mar 2017 03:36:33 +0000 (03:36 +0000)]
Fix wrong date in diff(1)

Reported by: rgrimes

7 years agoFinish removal of WITHOUT_MANDOCDB
bapt [Sun, 12 Mar 2017 03:35:01 +0000 (03:35 +0000)]
Finish removal of WITHOUT_MANDOCDB

7 years agoFix native-xtools after replacement of GNU diff
bapt [Sun, 12 Mar 2017 03:33:20 +0000 (03:33 +0000)]
Fix native-xtools after replacement of GNU diff

7 years agoClarify src vs dest path mismatch in :symbolic_link_{absolute,relative}_body
ngie [Sun, 12 Mar 2017 03:29:49 +0000 (03:29 +0000)]
Clarify src vs dest path mismatch in :symbolic_link_{absolute,relative}_body

Unfortunately kyua does not omit the path mismatch on failure, so it must be coded
into the error message.

Cache the values, run the test(1) call, then print out the values in an atf_fail
call to emit the required diagnostics to debug why things are failing.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agolibc: small cleanups.
pfg [Sun, 12 Mar 2017 03:29:23 +0000 (03:29 +0000)]
libc: small cleanups.

Remove unused initialization: "num" is properly defined before use.

Reviewed by: ngie
MFC after: 3 days

7 years agolibc: small cleanups.
pfg [Sun, 12 Mar 2017 03:26:25 +0000 (03:26 +0000)]
libc: small cleanups.

Unsign setlen: it is local and will never be negative. Having one more bit
for growth is beneficial and it avoids a cast when it's going to be used
for allocation.

Reviewed by: ngie
MFC after: 3 days

7 years agolibc: small cleanups.
pfg [Sun, 12 Mar 2017 03:22:18 +0000 (03:22 +0000)]
libc: small cleanups.

Rename nitems to numitems: it shares the anme with an existing macro in
sys/params.h. Also initialize the value later which avoids asigning the
value if we exit early.

Reviewed by: ngie
MFC after: 3 days

7 years agoDelete duplicate -I <SRCTOP>/lib/libipsec added in r171135
ngie [Sun, 12 Mar 2017 02:21:16 +0000 (02:21 +0000)]
Delete duplicate -I <SRCTOP>/lib/libipsec added in r171135

It's already handled earlier on in the Makefile, per the change made
in r80029.

MFC after: 1 month
Sponsored by: Dell EMC Isilon

7 years agoRemove i915drm and radeondrm from NOTES and conf.
manu [Sun, 12 Mar 2017 00:52:16 +0000 (00:52 +0000)]
Remove i915drm and radeondrm from NOTES and conf.
This unbreak LINT kernel.

Reported by: lwhsu

7 years agoRevert r314833 until the problem with INSTALL_RSYMLINKS can be found
rgrimes [Sun, 12 Mar 2017 00:37:45 +0000 (00:37 +0000)]
Revert r314833 until the problem with INSTALL_RSYMLINKS can be found
as it appears to break arm release builds.

PR: 217705
Reported by: cyclaero@gmail.com
Approved by: grehan (mentor) implict as reverting

7 years agoExtend the pl011 small-fifos fix to other SoCs that indicate rev 5
ian [Sat, 11 Mar 2017 22:34:02 +0000 (22:34 +0000)]
Extend the pl011 small-fifos fix to other SoCs that indicate rev 5
hardware but lack the larger fifos rev 5 hardware should have.

The linux world (where our FDT data comes from) solved this by adding
a new property to pl011 nodes, "arm,primecell-periphid".  When this
property is present, its values override the values in the hardware
periphid registers.  For pl011 rev 5 hardware with small fifos, they
override the id so that it appears to be rev 4 hardware.

The driver now uses the new property when present.  It also continues
to check the device compat string, to handle older fdt data that may
still be in use on existing systems (on RPi systems it is common to
update system software without updating fdt data which is part of the
boot firmware).

Reviewed by: imp

7 years agoDocument uiomove_frombuf(9).
ian [Sat, 11 Mar 2017 22:22:51 +0000 (22:22 +0000)]
Document uiomove_frombuf(9).

7 years agoDo not consider using -C arg "as is" for .CURDIR unless it starts with /.
sjg [Sat, 11 Mar 2017 20:28:31 +0000 (20:28 +0000)]
Do not consider using -C arg "as is" for .CURDIR unless it starts with /.

Reported by:    bdrewery

7 years agoImprove ctl(4) description, including frontends and backends.
mav [Sat, 11 Mar 2017 20:23:05 +0000 (20:23 +0000)]
Improve ctl(4) description, including frontends and backends.

MFC after: 2 weeks

7 years agoFix removal of /usr/share/info.
jhb [Sat, 11 Mar 2017 19:59:31 +0000 (19:59 +0000)]
Fix removal of /usr/share/info.

- The GNU as manual is named as.info.gz.
- Remove the generated /usr/share/info/dir file.

7 years agoSimplify the control flow and tidy up a comment in map_insert.
alc [Sat, 11 Mar 2017 18:57:13 +0000 (18:57 +0000)]
Simplify the control flow and tidy up a comment in map_insert.

In collaboration with: kib
MFC after: 1 week

7 years agoIncrease device openings to tagged maximum.
mav [Sat, 11 Mar 2017 18:46:46 +0000 (18:46 +0000)]
Increase device openings to tagged maximum.

Some SIMs report much less untagged device openings then tagged ones.
Target mode devices are not handled by regular probing routines, and so
there is nothing to increase queue size for them to the SIM's maximum.
To fix that resize the queue explicitly on ctl periph registration.
This radically improves performance of mpt(4) in target mode.

Also fetch and report device queue statistics in `ctladm dumpstructs`,
since regular way of `camcontrol tags` is not usable in target mode.

MFC after: 2 weeks

7 years agoaacraid: fix build with AACRAID_DEBUG=2
avg [Sat, 11 Mar 2017 18:40:39 +0000 (18:40 +0000)]
aacraid: fix build with AACRAID_DEBUG=2

MFC after: 10 days

7 years agoAllow XPT_GDEV_STATS for UNCONFIGURED devices.
mav [Sat, 11 Mar 2017 18:23:05 +0000 (18:23 +0000)]
Allow XPT_GDEV_STATS for UNCONFIGURED devices.

Queue statistics has nothing to do with presence or absence of INQUIRY
data, etc.  Target mode devices are never configured, but have queues.

MFC after: 2 weeks

7 years agouma: fix pages <-> items conversions at several places
avg [Sat, 11 Mar 2017 16:43:38 +0000 (16:43 +0000)]
uma: fix pages <-> items conversions at several places

Those places were not taking into account uk_ppera.
At present one allocation is always used by one slab, so uk_ppera must
be used to convert between pages and slabs.
uk_ipers is used to convert between slabs and items.

MFC after: 1 month (if ever)

7 years agouma: eliminate uk_slabsize field
avg [Sat, 11 Mar 2017 16:35:36 +0000 (16:35 +0000)]
uma: eliminate uk_slabsize field

The field was not used beyond the initial keg setup stage anyway.

MFC after: 1 month (if ever)

7 years agozfs: provide a special vptocnp method for the .zfs vnode
avg [Sat, 11 Mar 2017 16:00:49 +0000 (16:00 +0000)]
zfs: provide a special vptocnp method for the .zfs vnode

vop_stdvptocnp() doesn't work properly if .zfs directory is hidden.

Reported by: swills, des
Tested by: des
MFC after: 1 week
MFC with: r314048

7 years agotrace thread running state when a thread is run for the first time
avg [Sat, 11 Mar 2017 15:57:41 +0000 (15:57 +0000)]
trace thread running state when a thread is run for the first time

This applies to both KTR_SCHED and DTrace sched:::on-cpu tracing.

MFC after: 10 days

7 years agoactually implement proc:::lwp-exit probe
avg [Sat, 11 Mar 2017 15:47:27 +0000 (15:47 +0000)]
actually implement proc:::lwp-exit probe

MFC after: 4 days

7 years agorevert r314862, use of GCC_MS_EXTENSIONS in qlxgbe
avg [Sat, 11 Mar 2017 15:16:55 +0000 (15:16 +0000)]
revert r314862, use of GCC_MS_EXTENSIONS in qlxgbe

Commit r278913 made explicit use of GCC_MS_EXTENSIONS  unnecessary.

Requested by: glebius

7 years agoPartially fix target task management requests handling.
mav [Sat, 11 Mar 2017 14:25:14 +0000 (14:25 +0000)]
Partially fix target task management requests handling.

 - XPT_NOTIFY_ACKNOWLEDGE was not handled, causing stuck requests.
 - XPT_ABORT was not even trying to abort active ATIOs/INOTs.
 - Initiator's tag was not stored and not used where needed.
 - List of TM request types needed update.
 - mpt_scsi_tgt_status() missed some useful debugging.

After this change global TM requests, such as reset, should work properly.
ABORT TASK (ABTS) requests are still not passes to CTL, that is not good
and should be fixed.

MFC after: 2 weeks

7 years agoFix the attribute for scteken_clear() (change it back from the user
bde [Sat, 11 Mar 2017 13:56:06 +0000 (13:56 +0000)]
Fix the attribute for scteken_clear() (change it back from the user
user default normal attribute to the current attribute).

This change only fixes a logic error.  scterm_clear() used to be
used for terminal reset, but teken uses a general fill function for
that, leaving scterm_clear() only used for initialization and mode
change, when using the user default attribute is correct.  It is not
really a terminal function, but needs to sync its changes with the
terminal layer.  Syncing of the attribute is currently broken for
terminal reset, but works for initialization and mode change.

7 years agoAdd a scteken_set_cursor() (sc to teken) method and use it to fix
bde [Sat, 11 Mar 2017 11:31:06 +0000 (11:31 +0000)]
Add a scteken_set_cursor() (sc to teken) method and use it to fix
some cases of initialization and resetting of the teken cursor position.
(This bad name is consistent with others, but it is too easy to confuse
with scteken_cursor() which goes in the opposite direction.)

The following cases were broken:
- for booting without a syscons console, the teken and sc positions for
  ttyv0 were (0, 0), but are supposed to be somewhere in the middle of
  the screen (after carefully preserved BIOS and loader messages) (at
  least if there is no mode switch that loses the messages).
- after mode switches, the screen is cleared and the cursor is supposed to
  be moved to (0, 0), but it was only moved there for sc.

The following case was hacked to work:
- for booting with a syscons console, it was arranged that scteken_init()
  for the console could see a nonzero cursor position and adjust, although
  this broke the sc seeing it in the non-console case above.

7 years agoSplit overbloated machep.c to multiple files and do basic cleanup
mmel [Sat, 11 Mar 2017 07:07:41 +0000 (07:07 +0000)]
Split overbloated machep.c to multiple files and do basic cleanup
of these fragments.

7 years agoRegenerate after r315057
bapt [Sat, 11 Mar 2017 06:58:28 +0000 (06:58 +0000)]
Regenerate after r315057

7 years agoRemove the WITHOUT_MANDOCDB option
bapt [Sat, 11 Mar 2017 06:51:21 +0000 (06:51 +0000)]
Remove the WITHOUT_MANDOCDB option

mandoc database is activated since FreeBSD 11.0, let's remove the previous
database format for FreeBSD 12.0

7 years agoRemove the warning when MANPATH is set in the environment
bapt [Sat, 11 Mar 2017 06:31:16 +0000 (06:31 +0000)]
Remove the warning when MANPATH is set in the environment

The MANPATH environment variable behaviour is documented properly in the manpage
and it now has extended to new feature that allows to make MANPATH env variable
extending the default search path rather than overwriting it making the warning
painful

Reported by: kargl
MFC after: 1 week

7 years agoAdd the diff to the tests mtree
bapt [Sat, 11 Mar 2017 06:27:06 +0000 (06:27 +0000)]
Add the diff to the tests mtree

Reported by: lwhsu

7 years agoExtend functionality MANPATH in man(1) to followup with apropos(1) from
bapt [Sat, 11 Mar 2017 06:24:49 +0000 (06:24 +0000)]
Extend functionality MANPATH in man(1) to followup with apropos(1) from
mandoc.

If MANPATH begins with a colon, it is appended to the default list; if it ends
with a colon, it is prepended to the default list; or if it contains two
adjacent colons, the standard search path is inserted between the colons.  If
none of these conditions are met, it overrides the standard search path.

Import the MANPATH description from mandoc into the man(1) man page

Reported by: kargl
MFC after: 1 week

7 years agoAdd share/man if it exists to the MANPATH
bapt [Sat, 11 Mar 2017 05:56:50 +0000 (05:56 +0000)]
Add share/man if it exists to the MANPATH

localbase is not consistent with base for manpages:
/usr/local/man vs /usr/share/man adding share/man allows to fix that
inconsistency and would permit to remove tons of patches/modifications in the
ports tree

7 years agoDocument the removal of radeon and i915 old drm driver done in r315045.
manu [Sat, 11 Mar 2017 05:12:39 +0000 (05:12 +0000)]
Document the removal of radeon and i915 old drm driver done in r315045.

Reported by: linimon

7 years agoImport diff from OpenBSD and remove GNU diff
bapt [Sat, 11 Mar 2017 05:01:29 +0000 (05:01 +0000)]
Import diff from OpenBSD and remove GNU diff

Some of the modifications from the previous summer of code has been integrated
Modification for compatibility with GNU diff output has been added

Main difference with OpenBSD:
Implement multiple GNU diff options:
* --ignore-file-name-case
* --no-ignore-file-name-case
* --normal
* --tabsize
* --strip-trailing-cr
Make diff -p compatible with GNU diff
Implement diff -l
Make diff -r compatible with GNU diff

Capsicumize diffing 2 regular files
Add a simple test suite

Approved by: AsiaBSDcon devsummit
Obtained from: OpenBSD, GSoC
Relnotes: yes

7 years agoFix the L2 address printed in the "arp: %s moved from %*D" message.
ae [Sat, 11 Mar 2017 04:57:52 +0000 (04:57 +0000)]
Fix the L2 address printed in the "arp: %s moved from %*D" message.

In the r292978 struct llentry was changed and the ll_addr field become
the pointer.

PR: 217667
MFC after: 1 week

7 years agoBring back the cast removed in my previous commit to allow us build vmstat
araujo [Sat, 11 Mar 2017 04:36:15 +0000 (04:36 +0000)]
Bring back the cast removed in my previous commit to allow us build vmstat
with WARNS 2. This cast was first introduced at r87690.

Reported by: bde, pfg and ngie
MFC after: 3 weeks.

7 years agoUse nitems() from sys/param.h.
araujo [Sat, 11 Mar 2017 04:03:13 +0000 (04:03 +0000)]
Use nitems() from sys/param.h.

MFC after: 3 weeks.

7 years agoUse nitems() from sys/param.h.
araujo [Sat, 11 Mar 2017 04:01:35 +0000 (04:01 +0000)]
Use nitems() from sys/param.h.

Reviewed by: np
MFC after: 3 weeks.
Differential Revision: https://reviews.freebsd.org/D9945

7 years agoUse nitems() from sys/param.h
araujo [Sat, 11 Mar 2017 04:00:27 +0000 (04:00 +0000)]
Use nitems() from sys/param.h

Reviewed by: jhb
MFC after: 3 weeks.
Differential Revision: https://reviews.freebsd.org/D9941

7 years agodrm(old): Remove i915 and radeon drivers
manu [Sat, 11 Mar 2017 03:01:18 +0000 (03:01 +0000)]
drm(old): Remove i915 and radeon drivers

They cannot be used anymore with the userland bits we provide.
Furthermore, their KMS versions support the same hardware.

Submitted by: dumbbell
Reviewed by: emaste, manu
Sponsored by: AsiaBSDCon
Differential Revision: https://reviews.freebsd.org/D5614

7 years agoIncrease WARNS for pw tests
asomers [Sat, 11 Mar 2017 00:11:20 +0000 (00:11 +0000)]
Increase WARNS for pw 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 rtld-elf tests
asomers [Sat, 11 Mar 2017 00:10:40 +0000 (00:10 +0000)]
Increase WARNS for rtld-elf 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 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