r325634 bdrewery Nov. 10, 2017, 8 a.m.
Sponsored by:	Dell EMC Isilon
r325633 bdrewery Nov. 10, 2017, 7:53 a.m.
Sponsored by:	Dell EMC Isilon
r325632 bdrewery Nov. 10, 2017, 7:52 a.m.
Sponsored by:	Dell EMC Isilon
r325631 bdrewery Nov. 10, 2017, 7:52 a.m.
Sponsored by:	Dell EMC Isilon
r325630 hselasky Nov. 10, 2017, 7:44 a.m.
Submitted by:	Kris G <netsick@gmail.com>
Sponsored by:	Mellanox Technologies
MFC after:	1 week
r325629 jhibbits Nov. 10, 2017, 4:23 a.m.
r325628 jhibbits Nov. 10, 2017, 4:14 a.m.
* Check TLB1 in all mapdev cases, in case the memattr matches an existing
  mapping (doesn't need to be MAP_DEFAULT).
* Fix mapping where the starting address is not a multiple of the widest size
  base.  For instance, it will now properly map 0xffffef000, size 0x11000 using
  2 TLB entries, basing it at 0x****f000, instead of 0x***00000.

MFC after:	2 weeks
r325627 bdrewery Nov. 10, 2017, 2:09 a.m.
- Don't discard SRCCONF value since it may incorrectly have MAKEOBJDIRPREFIX
  in it.
- Add note about src.conf not being a suitable place for MAKEOBJDIRPREFIX.

Sponsored by:	Dell EMC Isilon
r325626 bdrewery Nov. 10, 2017, 2:09 a.m.
- If OBJROOT is SRCTOP then don't add on TARGET.TARGET_ARCH.  This
  only happens at the top-level, and for sub-directories when the
  user is clever with MAKEOBJDIRPREFIX=/.
- Don't bother checking 'test -w' on .CURDIR.
- Properly set OBJTOP/OBJROOT to SRCTOP in various needed cases.
- Check if the OBJDIR is writable even for *clean* targets since it
  determines which .OBJDIR the user gets;  If they cannot write to an
  existing eligible .OBJDIR then it needs to clean in .CURDIR instead.
- Add guard to cleanworld/cleanuniverse from removing SRCTOP.
- Ensure OBJTOP is proper for .OBJDIR=.CURDIR which fixes finding
  libraries since src.libnames.mk is based on OBJTOP.
- Avoid some chdir(2) for modifying .OBJDIR

Sponsored by:	Dell EMC Isilon
r325625 cem Nov. 10, 2017, 2 a.m.
Ever since r143063, machine/atomic.h requires cdefs.h.  So, include it
first.  Weak support: style(9) tells us to include cdefs.h first.

Argument against: since code that includes systm.h still compiles,
compilation units that include systm.h must already include cdefs.h.  So, an
argument could be made that the cdefs.h include could just be removed
entirely.  That is maybe a bigger change and not one I am interested in

Universe compiles.

Sponsored by:	Dell EMC Isilon
r325624 jhb Nov. 10, 2017, 1:17 a.m.
The directives I added in r323466 and r323501 did not define a valid
CFA until several instructions into the associated functions.  This
triggers an assertion in GDB when generating a stack trace while
stopped at the first instruction of PLT stub entry point since there
is no valid CFA rule for the first instruction.

This is probably just wrong on my part as the non-simple .cfi_startproc
would have defined a valid CFA.  Instead, define a valid CFA as sp + 0
at the start of the functions and then use .cfa_def_offset to change the
offset when sp is adjusted later in the function.

Sponsored by:	DARPA / AFRL
r325623 jhb Nov. 10, 2017, 1:13 a.m.
This is only cosmetic, but the entry point for rtld is not a leaf function,
and this avoids two .frame directives for rtld_start.

Sponsored by:	DARPA / AFRL
r325622 mjoras Nov. 9, 2017, 11:36 p.m.
Reported by:	pluknet
Approved by:	rstone (mentor)
MFC with:	r325621
Pointy hat to:  mjoras
r325621 mjoras Nov. 9, 2017, 10:51 p.m.
This introduces a facility to EVENTHANDLER(9) for explicitly defining a
reference to an event handler list. This is useful since previously all
invokers of events had to do a locked traversal of the global list of
event handler lists in order to find the appropriate event handler list.
By keeping a pointer to the appropriate list an invoker can avoid this
traversal completely. The pointer is initialized with SYSINIT(9) during
the eventhandler stage. Users registering interest in events do not need
to know if the event is backed by such a list, since the list is added
to the global list of lists. As with lists that are not pre-defined it
is safe to register for the events before the list has been created.

This converts the process_* and thread_* events to using the new
facility, as these are events whose locked traversals end up showing up
significantly in ports build workflows (and presumably other workflows
with many short lived threads/procs). It may be advantageous to convert
other events to using the new facility.

The el_flags field is now unused, but leave it be so that this revision
can be MFC'd.

Reviewed by:	bdrewery, markj, mjg
Approved by:	rstone (mentor)
In collaboration with:  ian
MFC after:      4 weeks
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D12814
r325620 sbruno Nov. 9, 2017, 10:26 p.m.
Submitted by:	grehan
Reviewed by:	bhargava.marreddy@broadcom.com
Differential Revision:	https://reviews.freebsd.org/D12976