Turn off the tribute branding, now that we will soon be entering the
9.3-RELEASE cycle.

This is a direct commit to stable/9.

Sponsored by:	The FreeBSD Foundation
MFC r263471:
Initialize vm_map_entry member wiring_thread on the map entry creation.
MFC r263289: Update NetBSD Foundation copyrights to 2-clause BSD

  The NetBSD Foundation states "Third parties are encouraged to change the
  license on any files which have a 4-clause license contributed to the
  NetBSD Foundation to a 2-clause license."

  This change removes clauses 3 and 4 from copyright / license blocks that
  list The NetBSD Foundation as the only copyright holder.

Sponsored by:	The FreeBSD Foundation
MFC r257650:

Defer loading of kernel and modules if the beastie menu is enabled. Add a
kernel selection menu to the beastie menu. List of kernels is taken from
`kernels' in loader.conf(5) as a space (or comma) separated list of names
to display (up to 9). If not set, default value is "kernel kernel.old".
Does not validate that kernels exist because the next enhancement will be
to allow selection of the root device.

Discussed on:	-current
MFC r257821:

Extend loader_delay as-documented in beastie.4th(8) and delay.4th(8),
making it available to architectures that do not use or load the beastie
menu. This is reported to save headaches on some PPC systems where unload
followed by load does not produce the desired results wherein if-given
the opportunity to abort the initial loading sequence, you can customize
the first load.

Reviewed by:	nwhitehorn, kan
Discussed on:	-current
MFC r258269: Refactor draw-beastie function.

Discussed on:	-hackers
MFC r258270:

Add a try-include word (which acts the same as "include") and use it to
conditionally include (but ignore failures) /boot/loader.rc.local and
/boot/menu.rc.local -- to make customizing the menu easier.

Reviewed by:	alfred
Discussed on:	-hackers
MFC r257824,257826-257830,258411: Updates to sysrc(8)
257824: Fix a bug with `-d' form working as documented
257826: Add `--version' long option
257827: Add a `-c' option for `check only'
257828: Comments and whitespace
257829: Fix a bug with `-e' introduced by above 257828
257830: Document SYSRC_VERBOSE enviroment variable in the manual
258411: Revert the above 257830 (both merged to get .Dd bump in man-page)
MFH (r256768): don't report an error for no-op add / remove
MFC r243322 (by marcel):

Unbreak amd64 cross-build where amd64 is the target. While clang
may be installed as cc and we don't need to build gcc as a
cross-tools, we still build gcc and thus need cc_tools built
as a build tool. Not doing this results in building gengenrtl with
the target compiler while we need to run it on the build machine.
MFC r262613:

Merge the projects/clang-sparc64 branch back to head.  This brings in
several updates from the llvm and clang trunks to make the sparc64
backend fully functional.

Apart from one patch to sys/sparc64/include/pcpu.h which is still under
discussion, this makes it possible to let clang fully build world and
kernel for sparc64.

Any assistance with testing this on actual sparc64 hardware is greatly
appreciated, as there will unavoidably be bugs left.

Many thanks go to Roman Divacky for his upstream work on getting the
sparc64 backend into shape.

MFC r262985:

Repair a few minor mismerges from r262261 in the clang-sparc64 project
branch.  This is also to minimize differences with upstream.
MFC r263312:

Pull in r196939 from upstream llvm trunk (by Reid Kleckner):

  Reland "Fix miscompile of MS inline assembly with stack realignment"

  This re-lands commit r196876, which was reverted in r196879.

  The tests have been fixed to pass on platforms with a stack alignment
  larger than 4.

  Update to clang side tests will land shortly.

Pull in r196986 from upstream llvm trunk (by Reid Kleckner):

  Revert the backend fatal error from r196939

  The combination of inline asm, stack realignment, and dynamic allocas
  turns out to be too common to reject out of hand.

  ASan inserts empy inline asm fragments and uses aligned allocas.
  Compiling any trivial function containing a dynamic alloca with ASan is
  enough to trigger the check.

  XFAIL the test cases that would be miscompiled and add one that uses the
  relevant functionality.

Pull in r202930 from upstream llvm trunk (by Hans Wennborg):

  Check for dynamic allocas and inline asm that clobbers sp before building
  selection dag (PR19012)

  In X86SelectionDagInfo::EmitTargetCodeForMemcpy we check with MachineFrameInfo
  to make sure that ESI isn't used as a base pointer register before we choose to
  emit rep movs (which clobbers esi).

  The problem is that MachineFrameInfo wouldn't know about dynamic allocas or
  inline asm that clobbers the stack pointer until SelectionDAGBuilder has
  encountered them.

  This patch fixes the problem by checking for such things when building the
  FunctionLoweringInfo.

  Differential Revision: http://llvm-reviews.chandlerc.com/D2954

Together, these commits fix the problem encountered in the devel/emacs
port on the i386 architecture, where a combination of stack realignment,
alloca() and memcpy() could incidentally clobber the %esi register,
leading to segfaults in the temacs build-time utility.

See also: http://llvm.org/PR18171 and http://llvm.org/PR19012

Reported by:	ashish
PR:		ports/183064

MFC r263313:

Pull in r203311 from upstream llvm trunk (by Arnold Schwaighofer):

  ISel: Make VSELECT selection terminate in cases where the condition type has to
  be split and the result type widened.

  When the condition of a vselect has to be split it makes no sense widening the
  vselect and thereby widening the condition. We end up in an endless loop of
  widening (vselect result type) and splitting (condition mask type) doing this.
  Instead, split both the condition and the vselect and widen the result.

  I ran this over the test suite with i686 and mattr=+sse and saw no regressions.

  Fixes PR18036.

With this fix the original problem case from the graphics/rawtherapee
port (posted in http://llvm.org/PR18036 ) now compiles within ~97MB RSS.

Reported by:	mandree

MFC r263320:

Add separate patch files for all the customizations we have currently
applied to our copy of llvm/clang.  These can be applied in alphabetical
order to a pristine llvm/clang 3.4 release source tree, to result in the
same version used in FreeBSD.

This is intended to clearly document all the changes until now, which
mostly consist of cherry pickings from the respective upstream trunks,
plus a number of hand-written FreeBSD-specific ones.  Hopefully those
can eventually be cleaned up and sent upstream too.
MFC r263349:
Make the array pointed to by AT_PAGESIZES auxv properly aligned.
MFC r262991:

Correct a typo in nlm_find_host_by_addr(): the intention of the
code is to give "<unknown>" rather than comparing the buffer
against it.
MFC r262501:

Refresh our implementation of OpenBSD's Blowfish password format.

Notable changes:

 - Support of $2b$ password format to address a problem where very
   long passwords (more than 256 characters, when an integer
   overflow would happen and cause the length to wrap at 256).
 - Updated pseudo code in comments to reflect the reality.
 - Removed our local shortcut of processing magic string and rely
   on the centralized and tigntened validation.
 - Diff reduction from upstream.

For now we are still generating the older $2a$ format of password
but we will migrate to the new format once the format is formally
finalized.
MFC revisions 253333,256181,256321-256323,256325,256330,256333,256335,
256391,257755-257756,257780-257785,257787-257793,258029,258263,258266,
258355,258360,258400-258401,258406-258407,258418,258430,258439,258458,
258589-258590,258592,258727-258728,258785,259054,260894,260899,262895-
262902,262904,262908-262910,262982,262984,263133-263137,263139,263141,
263144-263150, and (partially) 263249 (76 revisions; summarized below)...
r253333: Re-implement $probe_only aspect of f_media_get_TYPE()
r256181: Centralized [X]dialog(1) exit codes added to `dialog.subr'
r256321: Add support for obtaining the capacity of disks.
r256322: Fix include statements in strings.subr
r256323: Add USE_DIALOG global
r256325: Add keymap.subr
r256330: Fix f_dialog_*_constrain() to support NULL variable arguments
r256333: Fixes and additions to `device.subr'
r256335: Add f_expand_number() (shadowing expand_number(3))
r256391: Fix signed integer overflow detection in f_expand_number()
r257755: Update f_host_lookup() to support SRV records
r257756: Fix spurious error message "f_media_shutdown_http: not found"
r257780: Whitespace
r257781: Make use of f_isset()
r257782: Add DEBUG_INITIALIZE_FILE global boolean
r257783: Add f_show_err() (like f_show_msg() but for errors)
r257784: Add f_eval_catch() for debug and displaying errors automatically
r257785: Fix dialog auto-sizing when running in a pipe-chain
r257787: Fix a silly bug
r257788: Add some helpful debugging
r257789: Comments
r257790: Fix a bug when using printf
r257791: Add f_sprintf() and f_vsprintf()
r257792: Comments
r257793: Fix an off-by-one error
r258029: Comments
r258263: Move function name declarations/usages
r258266: Always shutdown media and don't eject CDROM
r258355: "Tim trailing" -> "Trim Trailing"
r258360: Whitespace, style, sub-shells, and variable names
r258400: Add new `includes' module for exploring the API
r258401: Add `-d' flag [to includes module] for printing function descrs
r258406: Make `-d' flag [of include module] implicitly enable `-f'
r258407: Update function description for f_validate_hostname()
r258418: Quote the interface name for good measure [in device.subr]
r258430: Remove unused line [in device.subr] -- cruft from SVN r258360
r258439: Fix command-line only modules [dot, includes] to not use f_die()
r258458: Improve network device scanning
r258589: Add missing `$' before `pgm' in syscons_ttys module
r258590: Add missing newline [in includes module]
r258592: Sort messages
r258727: Fix display output issue with `includes' module
r258728: Fix [another] display output issue with `includes' module
r258785: Sort function output [from includes module] on name of function
r259054: Performance and debugging enhancements
r260894: Optimize f_expand_number() (submitted by Christoph Mallon)
r260899: Dummy commit
r262895: Allow dispatched reswords to carry arguments
r262896: Add missing local declaration [in common.subr]
r262897: Fix a type in a comment [in common.subr]
r262898: Fix incorrect return status [from f_getvar() in common.subr]
r262899: Make f_show_err() [of common.subr] non-fatal
r262900: Centralize function name [in f_script_load() of script.subr]
r262901: Prevent localization of __number in f_expand_number()
r262902: Add a comment above f_replaceall() [of strings.subr]
r262904: Rewrite groupmgmt -- hooking it into the scripting system
r262908: Change dispatch words from group* to *Group for backward compat
r262909: Fix copy/paste error in a comment [in goupadd module]
r262910: Take a group name on the command-line [of groupdel] if available
r262982: Whitespace [in group_input.subr]
r262984: Remove vestigial global [in group_input.subr]
r263133: Remove extraneous debug statement
r263134: Add debug statement just before attempting to exec a module
r263135: Comments [in device.subr]
r263136: Update copyright
r263137: Fix future namespace issues [in dialog.subr]
r263139: Remove useless NULL strings ('') in some compound strings
r263141: Fix broken f_isinteger() [of strings.subr]
r263144: Fix a code-type that prevented auto-sizing [in group_input.subr]
r263145: Fix comments and whitespace [in new group.subr]
r263146: Reduce dialog sleep cycle for confirmation dialogs [in group.subr]
r263147: Fix bug preventing pw(8) errors from appearing [in group.subr]
r263148: Check arguments when running non-interactive [in group.subr]
r263149: Add i18n input protection [to group.subr and group_input.subr]
r263150: Rewrite usermgmt -- hooking it into the scripting system
r263249: (partial) Add old group_input and user_input to ObsoleteFiles.inc
MFC r263291 and r263292:
Update USB template manual page.
MFC r263423:
Try to resolve a possible deadlock when detaching USB devices which
create character devices. The deadlock can happen if an application is
issuing IOCTLs which require USB refcounting, at the same time the USB
device is detaching.

There is already a counter in place in the USB device structure to
detect this situation, but it was not always checked ahead of invoking
functions that might destroy character devices, like detach, set
configuration, set alternate interface or detach active kernel driver.
MFC 219886, 226100, 226111, 226341, 242529, 259015, 259016, 259019, 259049,
 259071, 259102, 259110, 259129, 259130, 259178, 259179, 259203, 259221,
 259261, 259532, 259615, 259650, 259651, 259667, 259680, 259727, 259761,
 259772, 259776, 259777, 259830, 259882, 259915, 260160, 260449, 260450,
 260688, 260888, 260953, 261269, 261547, 261551, 261552, 261553, 261585
o Merge vt(4) virtual terminal (a.k.a. newcons) to stable/9.
o Merge teken updates.
o Add few more tty methods required by vt(4).
o Update syscons(4) to work with fresh teken.

Sponsored by:	The FreeBSD Foundation
Bump __FreeBSD_version to reflect presence ov vt(4).

Sponsored by:	The FreeBSD Foundation