]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoAvoid referencing private lib names directly.
bdrewery [Fri, 10 Nov 2017 07:53:02 +0000 (07:53 +0000)]
Avoid referencing private lib names directly.

Sponsored by: Dell EMC Isilon

6 years agorescue ipf: Remove hacks and link in libipf directly.
bdrewery [Fri, 10 Nov 2017 07:52:58 +0000 (07:52 +0000)]
rescue ipf: Remove hacks and link in libipf directly.

Sponsored by: Dell EMC Isilon

6 years agoAdd support for CRUNCH_LIBS_ for specifying a lib only for 1 prog.
bdrewery [Fri, 10 Nov 2017 07:52:46 +0000 (07:52 +0000)]
Add support for CRUNCH_LIBS_ for specifying a lib only for 1 prog.

Sponsored by: Dell EMC Isilon

6 years agoAdd new USB quirk.
hselasky [Fri, 10 Nov 2017 07:44:57 +0000 (07:44 +0000)]
Add new USB quirk.

Submitted by: Kris G <netsick@gmail.com>
Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoProperly initialize the full md_page structure
jhibbits [Fri, 10 Nov 2017 04:23:58 +0000 (04:23 +0000)]
Properly initialize the full md_page structure

6 years agoBook-E pmap_mapdev_attr() improvements
jhibbits [Fri, 10 Nov 2017 04:14:48 +0000 (04:14 +0000)]
Book-E pmap_mapdev_attr() improvements

* 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

6 years agoDeal with src.conf for top-level MAKEOBJDIRPREFIX guard.
bdrewery [Fri, 10 Nov 2017 02:09:37 +0000 (02:09 +0000)]
Deal with src.conf for top-level MAKEOBJDIRPREFIX guard.

- 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

6 years agoHandle some .OBJDIR == .CURDIR cases.
bdrewery [Fri, 10 Nov 2017 02:09:33 +0000 (02:09 +0000)]
Handle some .OBJDIR == .CURDIR cases.

- 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

6 years agosystm.h: Include cdefs.h first
cem [Fri, 10 Nov 2017 02:00:40 +0000 (02:00 +0000)]
systm.h: Include cdefs.h first

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

Universe compiles.

Sponsored by: Dell EMC Isilon

6 years agoSome fixups to the CFI directives for PLT stub entry points.
jhb [Fri, 10 Nov 2017 01:17:26 +0000 (01:17 +0000)]
Some fixups to the CFI directives for PLT stub entry points.

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

6 years agoUse NESTED() instead of LEAF() for rtld_start.
jhb [Fri, 10 Nov 2017 01:13:45 +0000 (01:13 +0000)]
Use NESTED() instead of LEAF() for rtld_start.

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

6 years agoCorrect mistake in manpage.
mjoras [Thu, 9 Nov 2017 23:36:10 +0000 (23:36 +0000)]
Correct mistake in manpage.

Reported by: pluknet
Approved by: rstone (mentor)
MFC with: r325621
Pointy hat to:  mjoras

6 years agoIntroduce EVENTHANDLER_LIST and some users.
mjoras [Thu, 9 Nov 2017 22:51:48 +0000 (22:51 +0000)]
Introduce EVENTHANDLER_LIST and some users.

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

6 years agoFix issue with VXLAN-ecapsulated rx h/w checksumming.
sbruno [Thu, 9 Nov 2017 22:26:49 +0000 (22:26 +0000)]
Fix issue with VXLAN-ecapsulated rx h/w checksumming.

Submitted by: grehan
Reviewed by: bhargava.marreddy@broadcom.com
Differential Revision: https://reviews.freebsd.org/D12976

6 years agoMark targets .PHONY.
bdrewery [Thu, 9 Nov 2017 22:08:07 +0000 (22:08 +0000)]
Mark targets .PHONY.

This avoids the obvious of not running the target when expected, but
also avoids META_MODE from showing 'Building'.  This is mostly only
a problem when directly including bsd.obj.mk as many of these targets
were already .PHONY via bsd.sys.mk.

Sponsored by: Dell EMC Isilon

6 years agoMake sure sin_zero is zero in ibcore. Else socket address maching using
hselasky [Thu, 9 Nov 2017 19:30:10 +0000 (19:30 +0000)]
Make sure sin_zero is zero in ibcore. Else socket address maching using
bcmp() might fail.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoMake sure the IPv6 scope ID gets zeroed when exchanging CMA messages in ibcore.
hselasky [Thu, 9 Nov 2017 19:27:29 +0000 (19:27 +0000)]
Make sure the IPv6 scope ID gets zeroed when exchanging CMA messages in ibcore.
Else the IPv6 address matching might fail. This change adds support for both
embedded and non-embedded IPv6 scope IDs when passing a IPv6 link-local socket
address to RDMA. Prior to this change only global IPv6 addresses would work
with RDMA.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoMultiple fixes for using IPv6 link-local addresses with RDMA in ibcore.
hselasky [Thu, 9 Nov 2017 19:22:43 +0000 (19:22 +0000)]
Multiple fixes for using IPv6 link-local addresses with RDMA in ibcore.

1) Fail to resolve RDMA address if rtalloc1() returns the loopback
device, lo0, as the gateway interface. Currently RDMA loopback is
not supported.

2) Use ip_dev_find() and ip6_dev_find() to lookup network interfaces
with matching IPv4 and IPv6 addresses, respectivly.

3) In addr_resolve() make sure the "ifa" pointer is always set, also when
the "ifp" is NULL. Else a NULL pointer access might happen trying to
read from the "ifa" pointer later on.

4) In rdma_addr_find_dmac_by_grh() make sure the "bound_dev_if" field
gets set properly instead of passing the scope ID through the IPv6
socket address structure. This is more in line with upstream OFED
in Linux.

5) In rdma_addr_find_smac_by_sgid() there is no need to pass the
scope ID for IPv6. Either it is stored in the "bound_dev_if" field
or ip6_dev_find() will find the correct network device regardless
of the scope ID.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoMFV r325609: 7531 Assign correct flags to prefetched buffers
avg [Thu, 9 Nov 2017 18:22:42 +0000 (18:22 +0000)]
MFV r325609: 7531 Assign correct flags to prefetched buffers

illumos/illumos-gate@272952165423c254ad7708f1b3fe2ff0a6ce408b
https://github.com/illumos/illumos-gate/commit/272952165423c254ad7708f1b3fe2ff0a6ce408b

https://www.illumos.org/issues/7531
  I found that some buffers that could be L2ARC eligible are not flagged
  such, leading to some performance impact.  As a test I ran the same IO
  workload 10 times in a raw.  It is a metadata only workload (files
  listing).  l2arc_noprefetch=0.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: benrubson <ben.rubson@gmail.com>

MFC after: 8 days

6 years agoMFV r325607: 8607 zfs: variable set but not used
avg [Thu, 9 Nov 2017 18:14:42 +0000 (18:14 +0000)]
MFV r325607: 8607 zfs: variable set but not used

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

https://www.illumos.org/issues/8607

Reviewed by: Yuri Pankov <yuripv@gmx.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Toomas Soome <tsoome@me.com>

MFC after: 1 week

6 years agoMFV r325605: 8713 Buffer overflow in dsl_dataset_name()
avg [Thu, 9 Nov 2017 18:12:21 +0000 (18:12 +0000)]
MFV r325605: 8713 Buffer overflow in dsl_dataset_name()

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

https://www.illumos.org/issues/8713
  If we're creating a pool with version >= SPA_VERSION_DSL_SCRUB (v11) we need to
  account for additional space needed by the origin dataset which will also be
  snapshotted: "poolname"+"/"+"$ORIGIN"+"@"+"$ORIGIN".
  Enforce this limit in pool_namecheck().

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: loli10K <ezomori.nozomu@gmail.com>

MFC after: 1 week

6 years agocxgbe(4): Do not request settings not supported by the port.
np [Thu, 9 Nov 2017 15:35:51 +0000 (15:35 +0000)]
cxgbe(4): Do not request settings not supported by the port.

MFC after: 1 week
Sponsored by: Chelsio Communications

6 years agoRemove useless .if. The whole point of SUBDIR.yes was so that we
imp [Thu, 9 Nov 2017 14:31:25 +0000 (14:31 +0000)]
Remove useless .if. The whole point of SUBDIR.yes was so that we
didn't need this construct.

Sponsored by: Netflix

6 years agoPoint people towards our https web site for documentation, http accesses are
gavin [Thu, 9 Nov 2017 13:38:24 +0000 (13:38 +0000)]
Point people towards our https web site for documentation, http accesses are
just redirected anyway.

MFC after: 1 week

6 years agoFix setting AENQ group in ENA driver
mw [Thu, 9 Nov 2017 13:38:17 +0000 (13:38 +0000)]
Fix setting AENQ group in ENA driver

With the current state of the AENQ handlers in the ENA driver, only
implemented handlers should be indicated.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12872

6 years agoAllow usage of more RX descriptors than 1 in ENA driver
mw [Thu, 9 Nov 2017 13:36:42 +0000 (13:36 +0000)]
Allow usage of more RX descriptors than 1 in ENA driver

Using only 1 descriptor on RX could be an issue, if system would be low
on resources and could not provide driver with large chunks of
contiguous memory.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12871

6 years agoRead max MTU from the ENA device
mw [Thu, 9 Nov 2017 13:35:07 +0000 (13:35 +0000)]
Read max MTU from the ENA device

The device now provides driver with max available MTU value it
can handle.

The function setting MTU for the interface was simplified and reworked
to follow up this changes.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12870

6 years agoFix calculating io queues number in ENA driver
mw [Thu, 9 Nov 2017 13:33:02 +0000 (13:33 +0000)]
Fix calculating io queues number in ENA driver

The maximum number of io_cq was the same number as maximum io_sq
indicated by the device working in normal mode (without LLQ).
It is not always true, especially when LLQ is being enabled.
Fix it.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12869

6 years agoRework printouts and logging level in ENA driver
mw [Thu, 9 Nov 2017 13:30:39 +0000 (13:30 +0000)]
Rework printouts and logging level in ENA driver

The driver was printing out a lot of information upon failure, which
does not have to be interested for the user.
Changing logging level required to rebuild driver with proper flags. The
proper sysctl was added, so the level now can be changed dynamically
using bitmask.

Levels of printouts were adjusted to keep on mind end user instead of
debugging purposes.

More verbose messages were added to align the driver with the Linux.

Fix building error introduced by the r325506 by casting csum_flags to
uint64_t.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12868

6 years agoCorrect operators precedence.
kib [Thu, 9 Nov 2017 13:09:07 +0000 (13:09 +0000)]
Correct operators precedence.
Also keep the calculated vm_page_alloc_contig() flags in the variable
to not re-evaluate it on the loop iteration.

Noted by: alc
Sponsored by: The FreeBSD Foundation

6 years agoFix comparing L3 type with L4 enum on RX hash in ENA driver
mw [Thu, 9 Nov 2017 12:39:26 +0000 (12:39 +0000)]
Fix comparing L3 type with L4 enum on RX hash in ENA driver

This bug wasn't impacting anything, because both enums are indicating
the same value, but it could cause a problem on API change.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12867

6 years agoFix compilation warnings when building ENA driver with gcc compiler
mw [Thu, 9 Nov 2017 12:37:19 +0000 (12:37 +0000)]
Fix compilation warnings when building ENA driver with gcc compiler

The gcc compiler is more sensitive when variable is having an value
assigned, but it is not used anywhere further.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: rlibby
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12866

6 years agoFix checking if the DF flag was set in ENA driver
mw [Thu, 9 Nov 2017 12:32:10 +0000 (12:32 +0000)]
Fix checking if the DF flag was set in ENA driver

The previous way of checking for DF was not valid.
When DF is enabled, the DF bit should be 1.

The original way of checking it was wrong in 2 ways: first of all, it
was not checking for single bit, secondly, it was checking for 0.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12865

6 years agoCleanup of the ENA driver header file
mw [Thu, 9 Nov 2017 12:07:02 +0000 (12:07 +0000)]
Cleanup of the ENA driver header file

Remove unused macros and fields - some of them were only initialized,
without further usage.

Implement minor style fixes and add required comments.

On the occasion add missing TX completion counter, which was existing,
but mistakenly remained unused.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12864

6 years agoAllow partial MSI-x allocation in ENA driver
mw [Thu, 9 Nov 2017 12:03:06 +0000 (12:03 +0000)]
Allow partial MSI-x allocation in ENA driver

The situation, where part of the MSI-x was not configured properly, was
not properly handled. Now, the driver reduces number of queues to
reflect number of existing and properly configured MSI-x vectors.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12863

6 years agoRemove deprecated and unused counters in ENA driver
mw [Thu, 9 Nov 2017 12:01:46 +0000 (12:01 +0000)]
Remove deprecated and unused counters in ENA driver

Few counters were imported from the Linux driver and never used,
because of differences between the Linux and FreeBSD APIs.

Queue stops and resumes are no longer supported by the driver and
counters were incremented indicating false events.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: rlibby
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12862

6 years agoCover ENA driver code with branch predictioning statements
mw [Thu, 9 Nov 2017 11:59:21 +0000 (11:59 +0000)]
Cover ENA driver code with branch predictioning statements

The driver was using it in only few places, so the rest of the code
was covered with those statement.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: rlibby
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12861

6 years agoRefactor style of the ENA driver
mw [Thu, 9 Nov 2017 11:57:02 +0000 (11:57 +0000)]
Refactor style of the ENA driver

* Change all conditional checks in "if" statement to boolean expressions
* Initialize variables with too complex values outside the declaration
* Fix indentations
* Move code associated with sysctls to ena_sysctl.c file
* For consistency, remove unnecesary "return" from void functions
* Use if_getdrvflags() function instead of accesing variable directly

Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12860

6 years agoFix error handling in the ENA driver and lock drbr_free() call
mw [Thu, 9 Nov 2017 11:54:32 +0000 (11:54 +0000)]
Fix error handling in the ENA driver and lock drbr_free() call

Some goto tags were renamed for consistency, and few error handling
routines were reworked.

The drbr_free() must be locked just in case code will change in the
future - for now, it should never be an issue, because drbr is being
flushed in the ena_down() call, and the lock is required only when there
are some mbufs inside.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12859

6 years agoDestroy admin queue after freeing interrupts in ENA driver
mw [Thu, 9 Nov 2017 11:52:52 +0000 (11:52 +0000)]
Destroy admin queue after freeing interrupts in ENA driver

On heavy load, when interrupt handling routine was slowed down, there
could appear memory corruption, because resources were destroyed and
interrupt was still being handled.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12858

6 years agoSplit function checking for missing TX completion in ENA driver
mw [Thu, 9 Nov 2017 11:50:52 +0000 (11:50 +0000)]
Split function checking for missing TX completion in ENA driver

Pure cosmetic change for better readability of the driver.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12857

6 years agoCheck for Rx ring state to prevent from stall in the ENA driver
mw [Thu, 9 Nov 2017 11:48:22 +0000 (11:48 +0000)]
Check for Rx ring state to prevent from stall in the ENA driver

In case when Rx ring is full and driver will fail to allocate Rx mbufs,
the ring could be stalled.

Keep alive is checking every second for Rx ring state, and if it is full
for two cycles, then trigger rx_cleanup routine in another thread.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12856

6 years agoAdd RX OOO completion feature
mw [Thu, 9 Nov 2017 11:45:59 +0000 (11:45 +0000)]
Add RX OOO completion feature

The RX out of order completion feature, allows to complete RX
descriptors out of order, by keeping trace of all free descriptors in
the separate array.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12855

6 years agoAdd some PCI IDs found on AMD Epyc system.
mav [Thu, 9 Nov 2017 10:15:57 +0000 (10:15 +0000)]
Add some PCI IDs found on AMD Epyc system.

MFC after: 2 weeks

6 years agoAUTO_OBJ: Fix 'old style' kernel builds using wrong .OBJDIR.
bdrewery [Thu, 9 Nov 2017 02:37:49 +0000 (02:37 +0000)]
AUTO_OBJ: Fix 'old style' kernel builds using wrong .OBJDIR.

There's no way currently to automatically prevent the bad .OBJDIR from being
created but it can at least be prevented from being used.  Passing
WITHOUT_AUTO_OBJ=yes or MK_AUTO_OBJ=no or -DNO_OBJ in will prevent it.

Reported by: jeffr
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12989

6 years ago[bsdbox] fix compilation due to library work.
adrian [Thu, 9 Nov 2017 01:41:00 +0000 (01:41 +0000)]
[bsdbox] fix compilation due to library work.

6 years agouniverse: Fix creating LINT files with AUTO_OBJ.
bdrewery [Wed, 8 Nov 2017 23:41:27 +0000 (23:41 +0000)]
universe: Fix creating LINT files with AUTO_OBJ.

These are expected to be created in .CURDIR.

Reported by: kib
Sponsored by: Dell EMC Isilon

6 years agoZero whole struct ptrace_lwpinfo to not leak kernel stack data.
kib [Wed, 8 Nov 2017 23:32:56 +0000 (23:32 +0000)]
Zero whole struct ptrace_lwpinfo to not leak kernel stack data.

Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Discussed with: secteam
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D12796

6 years agoFix operator priority.
kib [Wed, 8 Nov 2017 23:25:05 +0000 (23:25 +0000)]
Fix operator priority.

Sponsored by: The FreeBSD Foundation

6 years agoDo not leak control in raw_usend
antoine [Wed, 8 Nov 2017 23:20:05 +0000 (23:20 +0000)]
Do not leak control in raw_usend

6 years agoRevert r325365
kevans [Wed, 8 Nov 2017 23:11:15 +0000 (23:11 +0000)]
Revert r325365

r325365 caused several ports to fail to patch correctly. Revert it for the
time being until an exp-run can be completed.

Requested by: antoine
Approved by: emaste (implicit)

6 years agoAllwinner A13: Add clkng support
manu [Wed, 8 Nov 2017 21:24:06 +0000 (21:24 +0000)]
Allwinner A13: Add clkng support

DTS files switch from clocks under /clocks to a ccu (Clock Controller Unit)
a while ago.
Restore A13 functionality by adding a clock driver for it.
Almost every clocks are handled, the missing ones are mostly video related
clocks.

Tested On: A13 Olinuxino

6 years agoAllwinner: clk: Unlock the clknode after locking it.
manu [Wed, 8 Nov 2017 21:12:59 +0000 (21:12 +0000)]
Allwinner: clk: Unlock the clknode after locking it.

Pointy Hat: manu

6 years agoAllow various page daemon parameters to be set from loader.conf.
markj [Wed, 8 Nov 2017 19:55:17 +0000 (19:55 +0000)]
Allow various page daemon parameters to be set from loader.conf.

MFC after: 1 week

6 years agoMETA_MODE: Bmake 20171028 in r325340 simplifies the meta filename.
bdrewery [Wed, 8 Nov 2017 18:02:01 +0000 (18:02 +0000)]
META_MODE: Bmake 20171028 in r325340 simplifies the meta filename.

Now if the meta file is in the objdir, the objdir is stripped away
from the meta filename.

Sponsored by: Dell EMC Isilon

6 years agoAdd suitable knob ifconfig_<interface>_descr for static interface description.
eugen [Wed, 8 Nov 2017 16:53:11 +0000 (16:53 +0000)]
Add suitable knob ifconfig_<interface>_descr for static interface description.
Document availability of interface descriptions within rc.conf(5).

Approved by: avg (mentor), mav (mentor)
MFC after: 3 days

6 years agoWhen parsing UDP messages skip optional hostname as described by
glebius [Wed, 8 Nov 2017 16:45:53 +0000 (16:45 +0000)]
When parsing UDP messages skip optional hostname as described by
RFC 3164.

PR: 200933
Submitted by: maxim
Reported by: Konstantin Pavlov <thresh nginx.com>
MFC after: 2 weeks

6 years agoAUTO_OBJ: Hide 'creating dirs' output with 'make -s'.
bdrewery [Wed, 8 Nov 2017 16:03:58 +0000 (16:03 +0000)]
AUTO_OBJ: Hide 'creating dirs' output with 'make -s'.

Reported by: garga
Sponsored by: Dell EMC Isilon

6 years agoloader: set options before including bsd.init.mk
royger [Wed, 8 Nov 2017 14:44:45 +0000 (14:44 +0000)]
loader: set options before including bsd.init.mk

bsd.init.mk ends up including defs.mk so the per-arch options must be
set before including defs.mk, or else the global defaults will be
used and the per-arch ones will be ignored.

Although better, note that the usage of MK_FDT before the inclusion of
bsd.init.mk is incorrect but doesn't lead to build errors. This
circular dependency must be broken in order for this to work
correctly.

Reviewed by: imp
Sponsored by: Citrix Systems R&D

6 years agoUpgrade to CloudABI v0.17.
ed [Wed, 8 Nov 2017 14:21:52 +0000 (14:21 +0000)]
Upgrade to CloudABI v0.17.

Compared to the previous version, v0.16, there are a couple of minor
changes:

- CLOUDABI_AT_PID: Process identifiers for CloudABI processes.

  Initially, BSD process identifiers weren't exposed inside the runtime,
  due to them being pretty much useless inside of a cluster computing
  environment. When jobs are scheduled across systems, the BSD process
  number doesn't act as an identifier. Even on individual systems they
  may recycle relatively quickly.

  With this change, the kernel will now generate a UUIDv4 when executing
  a process. These UUIDs can be obtained within the process using
  program_getpid(). Right now, FreeBSD will not attempt to store this
  value. This should of course happen at some point in time, so that it
  may be printed by administration tools.

- Removal of some unused structure members for polling.

  With the polling framework being simplified/redesigned, it turns out
  some of the structure fields were not used by the C library. We can
  remove these to keep things nice and tidy.

Obtained from: https://github.com/NuxiNL/cloudabi

6 years agoctl(4): Insert a new line after a sentence-ending full stop.
manu [Wed, 8 Nov 2017 13:06:41 +0000 (13:06 +0000)]
ctl(4): Insert a new line after a sentence-ending full stop.

Reported by: bjk
MFC after: 2 weeks
Sponsored by: Gandi.net
X-MFC-With:  r325517

6 years agoRemove useless DEBUG printfs in i386 sendsig() implementations.
kib [Wed, 8 Nov 2017 13:05:14 +0000 (13:05 +0000)]
Remove useless DEBUG printfs in i386 sendsig() implementations.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agos/NgSendMsgReply/NgSendReplyMsg/ in man to match the code.
mav [Wed, 8 Nov 2017 12:34:47 +0000 (12:34 +0000)]
s/NgSendMsgReply/NgSendReplyMsg/ in man to match the code.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks

6 years agoMake the dma_alloc_coherent() function in the LinuxKPI NULL safe with regard
hselasky [Wed, 8 Nov 2017 08:37:05 +0000 (08:37 +0000)]
Make the dma_alloc_coherent() function in the LinuxKPI NULL safe with regard
to the "dev" argument.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Sponsored by: Chelsio Communications
MFC after: 1 week

6 years agoUpdate arcmsr(4) to 1.40.00.01:
delphij [Wed, 8 Nov 2017 08:21:17 +0000 (08:21 +0000)]
Update arcmsr(4) to 1.40.00.01:

 - Fix clear doorbell queue buffer for ADAPTER_TYPE_B
 - Fix release memory resource when detach device
 - Add support for ARC-1216, 1226 SAS 12Gb controllers
 - Declare some functions as static
 - Change checking dword read/write for IOP rqbuffer.

Many thanks to Areca for continuing to support FreeBSD.

Submitted by: 黃清隆 <ching2048 areca com tw>
MFC after: 2 weeks

6 years agoPropagate the same condition for obsolete files as we use to generate
imp [Wed, 8 Nov 2017 03:10:40 +0000 (03:10 +0000)]
Propagate the same condition for obsolete files as we use to generate
the new armhf binaries.

Sponsored by: Netflix

6 years agoReplace manyinstances of VM_WAIT with blocking page allocation flags
jeff [Wed, 8 Nov 2017 02:39:37 +0000 (02:39 +0000)]
Replace manyinstances of VM_WAIT with blocking page allocation flags
similar to the kernel memory allocator.

This simplifies NUMA allocation because the domain will be known at wait
time and races between failure and sleeping are eliminated.  This also
reduces boilerplate code and simplifies callers.

A wait primitive is supplied for uma zones for similar reasons.  This
eliminates some non-specific VM_WAIT calls in favor of more explicit
sleeps that may be satisfied without new pages.

Reviewed by: alc, kib, markj
Tested by: pho
Sponsored by: Netflix, Dell/EMC Isilon

6 years agoAUTO_OBJ: Don't create TARGET. directories during 'make universe'.
bdrewery [Wed, 8 Nov 2017 02:28:24 +0000 (02:28 +0000)]
AUTO_OBJ: Don't create TARGET. directories during 'make universe'.

Reported by: rpokala
Sponsored by: Dell EMC Isilon

6 years agoCorrect the type of foff.
markj [Wed, 8 Nov 2017 01:53:03 +0000 (01:53 +0000)]
Correct the type of foff.

No functional change intended.

Github PR: 124
Submitted by: Wuyang Chung <wuyang.m.chung@outlook.com>
MFC after: 1 week

6 years agoDS1307: Add the mcp7941x enable bit
jhibbits [Wed, 8 Nov 2017 01:28:20 +0000 (01:28 +0000)]
DS1307: Add the mcp7941x enable bit

Summary:
Existing code recognizes the mcp7941x RTC, but this RTC has an
enable bit at the same location as the "Clock Halt" bit on the ds1307, with an
opposite assertion (set == on, whereas CH set == clock stopped).  Thus the
current code halts the clock, with no way to enable it.

Reviewed By: ian
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12961

6 years agoAdd the ISEL feature macro for those powerpc cores that have it
jhibbits [Wed, 8 Nov 2017 01:26:44 +0000 (01:26 +0000)]
Add the ISEL feature macro for those powerpc cores that have it

This is mostly for completeness, we don't currently use it for anything else.

6 years agoClear the WE bit in C code rather than the asm
jhibbits [Wed, 8 Nov 2017 01:23:37 +0000 (01:23 +0000)]
Clear the WE bit in C code rather than the asm

According to EREF rlwinm is supposed to clear the upper 32 bits of the
register of 64-bit cores.  However, from experience it seems there's a bug
in the e5500 which causes the result to be duplicated in the upper bits of
the register.  This causes problems when applied to stashed SRR1 accessed
to retrieve context, as the upper bits are not masked out, so a
set_mcontext() fails.  This causes sigreturn() to in turn return with
EINVAL, causing make(1) to exit with error.

This bit is unused in e500mc derivatives (including e5500), so could just be
conditional on non-powerpc64, but there may be other non-Freescale cores
which do use it.  This is also the same as the POW bit on Book-S, so could
be cleared unconditionally with the only penalty being a few clock cycles
for these two interrupts.

6 years agoFix the 'casper' package, following r325062.
gjb [Wed, 8 Nov 2017 01:00:59 +0000 (01:00 +0000)]
Fix the 'casper' package, following r325062.

Submitted by: woodsb02
Sponsored by: The FreeBSD Foundation

6 years agoReenable AUTO_OBJ by default.
bdrewery [Tue, 7 Nov 2017 18:20:08 +0000 (18:20 +0000)]
Reenable AUTO_OBJ by default.

The problem with it was a bogus .OBJDIR in some cases where creation of
object directories were purposely not attempted, such as for 'make cleandir'
and in etc/ sub-directories.  In these cases bmake would start with a
bogus .OBJDIR like etc/ due to MAKEOBJDIR being a dynamic value based on
.CURDIR, SRCTOP, and OBJTOP.  OBJTOP would not yet be defined but is
during early src.sys.obj.mk.  That file and auto.obj.mk both were not
modifying .OBJDIR unless they expected to create the objdir.  Thus in
these cases the .OBJDIR was left as etc/* rather than fixed to the
proper .CURDIR.

The issues were fixed in r325404 and r325416.  An assertion to avoid the
bad .OBJDIR was added in r325405.

Sponsored by: Dell EMC Isilon

6 years agoWrap to 80 columns. No functional change.
jhb [Tue, 7 Nov 2017 17:45:39 +0000 (17:45 +0000)]
Wrap to 80 columns.  No functional change.

6 years agoctl: Make max_luns and max_ports tunable variables instead of hardcoded
manu [Tue, 7 Nov 2017 16:59:52 +0000 (16:59 +0000)]
ctl: Make max_luns and max_ports tunable variables instead of hardcoded
defines.

Reviewed by: trasz (earlier version), bapt (earlier version), bcr (manpages)
MFC after: 2 Weeks
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D12836

6 years agoMake sysctl_kern_proc_umask execute fast path when requested pid in
robak [Tue, 7 Nov 2017 15:13:32 +0000 (15:13 +0000)]
Make sysctl_kern_proc_umask execute fast path when requested pid in
curproc->p_pid or 0, avoiding unnecessary locking. Update libc consumer
to skip calling getpid().

Submitted by: Pawel Biernacki <pawel.biernacki@gmail.com>
Reviewed by: mjg, robak
Approved by: mjg
Sponsored by: Mysterious Code Ltd.
Differential Revision: D12972

6 years agoNote interactive shell errors for make buildenv and add a warning for
imp [Tue, 7 Nov 2017 15:01:38 +0000 (15:01 +0000)]
Note interactive shell errors for make buildenv and add a warning for
people tempted to add back the || true to get rid of them.

Sponsored by: Netflix

6 years agoChange function validate_tx_req_id() to inline in ENA driver
mw [Tue, 7 Nov 2017 13:26:11 +0000 (13:26 +0000)]
Change function validate_tx_req_id() to inline in ENA driver

The function is in hot path of the driver (TX) and asking compiler for
making this function inline was changed for consistency and higher
readability.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: rlibby, byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12854

6 years agoFix ENA driver error handling in attach and basic style fixes
mw [Tue, 7 Nov 2017 13:20:41 +0000 (13:20 +0000)]
Fix ENA driver error handling in attach and basic style fixes

The patch contains following changes:

* In conditional checks, always check for NULL or 0 instead of negating values
* Use malloc and free explicitely, instead of ENA_MEM_FREE and ENA_MEM_FREE (the
  dmadev passed to macro is never used, and could be a little misleading)
* Always check for NULL after calling malloc (few checks were missing)
* Rework naming of the goto tags in ena_attach() for consistency
* Fix error handling in ena_attach() - few goto instructions were leading to the
  wrong tag
* Destroy MMIO req read request if attach failed
* Remove checking for NULL after calling malloc with M_WAITOK flag

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon.com, Inc.
Differential Revision: https://reviews.freebsd.org/D12853

6 years agoUse MACHINE_CPUARCH in preference MACHINE for userland.
imp [Tue, 7 Nov 2017 09:57:26 +0000 (09:57 +0000)]
Use MACHINE_CPUARCH in preference MACHINE for userland.

Sponsored by: Netflix

6 years agoBump __FreeBSD_version after struct mbuf KBI breakage in r325506.
kib [Tue, 7 Nov 2017 09:47:54 +0000 (09:47 +0000)]
Bump __FreeBSD_version after struct mbuf KBI breakage in r325506.

Sponsored by: Mellanox Technologies

6 years agoCorrect the detection of hard float arm
imp [Tue, 7 Nov 2017 09:47:05 +0000 (09:47 +0000)]
Correct the detection of hard float arm

* Don't test MACHINE, it's irrelevant to userland and should never be
  used in userland Makefiles.
* If we match armv[67] and CPUTYPE is undefined OR it doesn't have
  'soft' in it, choose armhf.
* Add a note that the soft float on armv[67] may be broken.

Sponsored by: Netflix

6 years agoUse hardware timestamps to report packet timestamps for SO_TIMESTAMP
kib [Tue, 7 Nov 2017 09:46:26 +0000 (09:46 +0000)]
Use hardware timestamps to report packet timestamps for SO_TIMESTAMP
and other similar socket options.

Provide new control message SCM_TIME_INFO to supply information about
timestamp.  Currently it indicates that the timestamp was
hardware-assisted and high-precision, for software timestamps the
message is not returned.  Reserved fields are added to ABI to report
additional info about it, it is expected that raw hardware clock value
might be useful for some applications.

Reviewed by: gallatin (previous version), hselasky
Sponsored by: Mellanox Technologies
MFC after: 2 weeks
X-Differential revision: https://reviews.freebsd.org/D12638

6 years agoAdd a place for a driver to report rx timestamps in nanoseconds from
kib [Tue, 7 Nov 2017 09:29:14 +0000 (09:29 +0000)]
Add a place for a driver to report rx timestamps in nanoseconds from
boot for the received packets.

The rcv_tstmp field overlaps the place of Ln header length indicators,
not used by received packets.  The basic pkthdr rearrangement change
in sys/mbuf.h was provided by gallatin.

There are two accompanying M_ flags: M_TSTMP means that there is the
timestamp (and it was generated by hardware).

Another flag M_TSTMP_HPREC indicates that the timestamp is
high-precision.  Practically M_TSTMP_HPREC means that hardware
provided additional precision comparing with the stamps when the flag
is not set.  E.g., for ConnectX all packets are stamped by hardware
when PCIe transaction to write out the completion descriptor is
performed, but PTP packet are stamped on port.  For Intel cards, when
PTP assist is enabled, only PTP packets are stamped in the limited
number of registers, so if Intel cards ever start support this
mechanism, they would always set M_TSTMP | M_TSTMP_HPREC if hardware
timestamp is present for the given packet.

Add IFCAP_HWRXTSTMP interface capability to indicate the support for
hardware rx timestamping, and ifconfig(8) command to toggle it.

Based on the patch by: gallatin
Reviewed by: gallatin (previous version), hselasky
Sponsored by: Mellanox Technologies
MFC after: 2 weeks (? mbuf KBI issue)
X-Differential revision: https://reviews.freebsd.org/D12638

6 years agoRedo r325502
ngie [Tue, 7 Nov 2017 06:26:48 +0000 (06:26 +0000)]
Redo r325502

:U:Mfoo expands to :Mfoo, apparently. Explicit check for CPUTYPE being
defined, and test for it's value not containing *soft* before calling CRTARCH
armhf.

Tested, somewhat. Unfortunately recent changes appear to have affected
cross-builds where it no longer works, per my tests after universe12a being
upgraded from 07/2017 to 11/2017 sources (DESTDIR isn't being used in WORLDTMP;
MK_SYSTEM_COMPILER might be causing issues right now).

MFC after: 1 week
MFC with: r325502
Reported by: imp

6 years agoHandle arm/armv[67] hosted/targeted builds gracefully
ngie [Tue, 7 Nov 2017 05:02:36 +0000 (05:02 +0000)]
Handle arm/armv[67] hosted/targeted builds gracefully

CPUTYPE (apparently) isn't defined in non-cross-builds, which caused
arm/armv[67] hosted/targeted builds to fail when evaluating CPUTYPE.

Add the :U modifier to CPUTYPE so it evaluates to "". This allows armv[67] to
get past the conditional successfully.

MFC after: 1 week
Reported by: bob prohaska <fbsd@www.zefox.net>

6 years agoRemove unnecessary src.opts.mk .include
ngie [Tue, 7 Nov 2017 04:56:53 +0000 (04:56 +0000)]
Remove unnecessary src.opts.mk .include

MK_<FOO> isn't used in lib/libcompiler_rt/Makefile at all. Remove it to reduce
namespace pollution.

MFC after: 1 week

6 years agoUse bsd.compiler.mk instead of src.opts.mk
ngie [Tue, 7 Nov 2017 04:55:23 +0000 (04:55 +0000)]
Use bsd.compiler.mk instead of src.opts.mk

- MK_PROFILE is controlled in bsd.opts.mk, which is pulled in via bsd.own.mk,
  which is pulled in via bsd.init.mk . All upstream Makefiles which build off
  of this one use bsd.init.mk.
- COMPILER_{TYPE,VERSION} is set via bsd.compiler.mk .

This reduces the namespace pollution/complexity somewhat.

MFC after: 1 week

6 years agoFix NOINET/NOINET6 build during compilation of iflib.
sbruno [Mon, 6 Nov 2017 19:54:25 +0000 (19:54 +0000)]
Fix NOINET/NOINET6 build during compilation of iflib.

Reported by: kib

6 years agoReapply r295227: Stop hiding link install commands.
bdrewery [Mon, 6 Nov 2017 19:33:50 +0000 (19:33 +0000)]
Reapply r295227: Stop hiding link install commands.

This was lost in the release-pkg merge in r298107.

Sponsored by: Dell EMC Isilon

6 years agoFix ixgbe(4) support for ifconfig's vlanhwtag flag. Disabling this flag
sbruno [Mon, 6 Nov 2017 18:08:59 +0000 (18:08 +0000)]
Fix ixgbe(4) support for ifconfig's vlanhwtag flag.  Disabling this flag
will now prevent the driver from stripping vlan tags from packets.

PR: 219390
Submitted by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Reported by: Charles Goncalves <halfling@halfling.com.br>
Obtained from: 1 week
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D12795

6 years agoSpecify WITH_UNIFIED_OBJDIR in chroot_arm_build_release() to
gjb [Mon, 6 Nov 2017 17:59:04 +0000 (17:59 +0000)]
Specify WITH_UNIFIED_OBJDIR in chroot_arm_build_release() to
ensure the output image is created in the correct .OBJDIR.

Sponsored by: The FreeBSD Foundation

6 years agobnxt: Add support for new phy_types and speeds - Part #2
shurd [Mon, 6 Nov 2017 16:41:29 +0000 (16:41 +0000)]
bnxt: Add support for new phy_types and speeds - Part #2

Use our ifm_list of supported media types rather than nested switch
statements to find the current media type.  Find a supported type that
matches the current speed.

Remove all workarounds while updating ifmr->ifm_active.

For BNXT_IFMEDIA_ADD, added Three more speeds IFM_10G_T, IFM_2500_T & IFM_2500_KX.

Submitted by: Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Reviewed by: shurd, sbruno
Approved by: sbruno (mentor)
Sponsored by: Broadcom Limited
Differential Revision: https://reviews.freebsd.org/D12896

6 years agoOnly chain non-LRO mbufs when LRO is not possible
shurd [Mon, 6 Nov 2017 16:23:21 +0000 (16:23 +0000)]
Only chain non-LRO mbufs when LRO is not possible

Preserve packet order between tcp_lro_rx() and if_input() to avoid
creating extra corner cases. If no packets can be LROed, combine them
into one chain for submission via if_input(). If any packet can
potentially be LROed however, retain old behaviour and call if_input()
for each packet.

This should keep the 12% improvement for small packet forwarding intact,
but mostly avoids impacting the LRO case.

Reviewed by: cem, sbruno
Approved by: sbruno (mentor)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D12876

6 years agoAdd an UPDATING entry for the posix_fallocate/ZFS change, r325320
avg [Mon, 6 Nov 2017 15:29:33 +0000 (15:29 +0000)]
Add an UPDATING entry for the posix_fallocate/ZFS change, r325320

6 years agoCentralize all 32-bit builds on 64-bit platform stuff.
imp [Mon, 6 Nov 2017 15:22:24 +0000 (15:22 +0000)]
Centralize all 32-bit builds on 64-bit platform stuff.

Move the addition of the -m32 and other flags to defs.mk. Remove
redunant copies of -m32 that come from multiple locations.

Sponsored by: Netflix

6 years agoPrefer bsd.init.mk to src.opts.mk
imp [Mon, 6 Nov 2017 15:22:17 +0000 (15:22 +0000)]
Prefer bsd.init.mk to src.opts.mk

Final sweep to prefer bsd.init.mk to src.opts.mk everywhere as a
design pattern.  The rule is that all Makefiles in this subtree should
start with .include <bsd.init.mk> so that we properly include
../Makefile.inc and defs.mk before anything else.

Sponsored by: Netflix

6 years agoMACHINE can never be powerpc64, so cleanup code that thinks it can.
imp [Mon, 6 Nov 2017 15:22:11 +0000 (15:22 +0000)]
MACHINE can never be powerpc64, so cleanup code that thinks it can.

Sponsored by: Netflix

6 years agoMove machine and other link creation to defs.mk
imp [Mon, 6 Nov 2017 15:22:04 +0000 (15:22 +0000)]
Move machine and other link creation to defs.mk

Steal the code from kmod.mk and use it to automatically create
links. Modify it a little for the needs of the loader (no need to
guess the OBJS dependency, and we have 32-on-64 cases to contend
with). Remove 15 redundant implementations (which were mostly
different, but kinda the same).

A future commit should factor out this code and that of kmod.mk so we
have only one copy of it in the tree.

Sposnored by: Netflix