]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoFollow-up r320149: Enable GPL_DTC if we're using GCC as the cross-compiler.
bdrewery [Tue, 31 Oct 2017 00:03:32 +0000 (00:03 +0000)]
Follow-up r320149: Enable GPL_DTC if we're using GCC as the cross-compiler.

This fixes object files landing in the source tree in gnu/usr.bin/dtc
for GCC platforms.

We cannot reliably detect if an external compiler is used here, and the
default YES option does include GCC_BOOTSTRAP which implies that GCC may
be used for the build.

The problem manifests when not using an external compiler, and the host
compiler is clang.  When a fresh build is done (no OBJDIR yet) the
'make obj' treewalk is done before 'make cross-tools', so
COMPILER_FEATURES at this point contains 'c++11' since the host compiler
was used for COMPILER_FEATURES.  Once cross-tools builds the GCC
bootstrap compiler and then descends into 'make everything',
COMPILER_FEATURES no longer contains 'c++11' and MK_GPL_DTC defaults to
enabled.  Now it builds in gnu/usr.bin/dtc without an OBJDIR preset and
drops files into the source tree.

The COMPILER_FEATURES check here is useful for knowing if we can *bootstrap*
C++11 things.  Indeed we do bootstrap dtc as a build tool so it is
useful for enabling the BSD dtc for the build, but we end up needing the
GPL dtc for installation anyway.

Reviewed by: manu, emaste
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12817

6 years agoRun mm-mtree with whatever -j value the build is using.
bdrewery [Tue, 31 Oct 2017 00:03:29 +0000 (00:03 +0000)]
Run mm-mtree with whatever -j value the build is using.

Reviewed by: gjb
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12807

6 years agoThese values already set by src.libnames.mk.
bdrewery [Tue, 31 Oct 2017 00:03:25 +0000 (00:03 +0000)]
These values already set by src.libnames.mk.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoUse more clear SRCTOP here.
bdrewery [Tue, 31 Oct 2017 00:03:22 +0000 (00:03 +0000)]
Use more clear SRCTOP here.

Sponsored by: Dell EMC Isilon

6 years agoActually add zfs32/Makefile
imp [Mon, 30 Oct 2017 23:39:55 +0000 (23:39 +0000)]
Actually add zfs32/Makefile

6 years agoFor amd64, compile both zfs and zfs32 libraries.
imp [Mon, 30 Oct 2017 23:14:59 +0000 (23:14 +0000)]
For amd64, compile both zfs and zfs32 libraries.

We have a separate copy of zfs for userboot. However, we don't need it
if we compile both 32 and 64 bit ZFS libraries. Remove redunant copies
of zfs related .o files now that both versions are
available. Introduce ZFSSRC and use it everywhere.

Sponsored by: Netflix

6 years agoMinor cleanup
imp [Mon, 30 Oct 2017 23:14:53 +0000 (23:14 +0000)]
Minor cleanup

Remove ancient comment about words to maybe add to the builds as
softwords. We're not going to bring them in, so delete the noise.
Also, check to see if HAVE_PNP is defined rather than if its value is
true.

Sponsored by: Netflix

6 years agoWe don't need to build a special ficl for userboot.
imp [Mon, 30 Oct 2017 23:14:48 +0000 (23:14 +0000)]
We don't need to build a special ficl for userboot.

Prior to bringing efi into the system, amd64 systems were building
32-bit ficl only, while userboot required the 64-bit one. However,
with efi, we now build both. userboot can and should use the one we
build for the main tree (in fact, it has been for a while, though I
didn't check to see if that was an intentional change before, or an
accidental one in my cleanup). Eliminate the extra copy (and build
time) for userboot.

Sponsored by: Netflix

6 years agoRemove the -nostdlib stuff I added. Instead, fix LDFLAGS to be honored
imp [Mon, 30 Oct 2017 23:14:44 +0000 (23:14 +0000)]
Remove the -nostdlib stuff I added. Instead, fix LDFLAGS to be honored
correctly with the new Makefile.inc include order.

Sponsored by: Netflix

6 years agoUse defs.mk name and prefer bsd.init.mk
imp [Mon, 30 Oct 2017 23:14:37 +0000 (23:14 +0000)]
Use defs.mk name and prefer bsd.init.mk

Also need to make some small tweaks to the Makefiles to use += rather
than = due to small shift in include file order.

Sponsored by: Netflix

6 years agoUse defs.mk values for userboot
imp [Mon, 30 Oct 2017 23:14:22 +0000 (23:14 +0000)]
Use defs.mk values for userboot

Sponsored by: Netflix

6 years agobnxt: Add support for new phy_types and speeds
shurd [Mon, 30 Oct 2017 21:26:23 +0000 (21:26 +0000)]
bnxt: Add support for new phy_types and speeds

1) Add new phy_types and speeds from the latest firmware header.
2) Introduced a macro to avoid code duplication and improve readability for
   the invocation of ifmedia_add().

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/D12423

6 years agobnxt: HW_LRO Rx Pkt with > 32 fragments caused Crash (iflib)
shurd [Mon, 30 Oct 2017 21:20:33 +0000 (21:20 +0000)]
bnxt: HW_LRO Rx Pkt with > 32 fragments caused Crash (iflib)

Broadcom NIC with HW_LRO setting max_agg_segs >= 6 can generate Rx pkt with
64 (2^6) fragments, modify IFLIB_MAX_RX_SEGS to 64 to avoid memory
corruption / Crash.

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/D12774

6 years agoFix PR222744 - netmap errors with iflib em driver
shurd [Mon, 30 Oct 2017 21:14:31 +0000 (21:14 +0000)]
Fix PR222744 - netmap errors with iflib em driver

Fix error when refilling netmap buffers that resulted in the first
buffer of the successive passes through ifl_bus_addrs[] leaving the
first value unset (tmp_pidx started at 1, not zero after the first time
through the loop).

Leave the one unused buffer required by some NICs visible in the netmap
ring rather than hidden. There will always be a buffer in use by the
kernel now when an iflib driver is used via netmap.

Always get the netmap slot index via netmap_idx_n2k() to account for
nkr_hwofs in a consistent way.

Split shared functionality into new functions.
iru_init(): shared by _iflib_fl_refill() and netmap_fl_refill()
netmap_fl_refill(): shared by iflib_netmap_rxsync() and
iflib_netmap_rxq_init()

PR: 222744
Reported by: Shirkdog <mshirk@daemon-security.com>
Reviewed by: sbruno
Approved by: sbruno (mentor)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D12769

6 years agoAvoid enabling MSI-X if MSI-X is disabled globally
shurd [Mon, 30 Oct 2017 21:08:12 +0000 (21:08 +0000)]
Avoid enabling MSI-X if MSI-X is disabled globally

It was reported on the community call that with
hw.pci.enable_msix=0, iflib would enable MSI-X on the device and attempt
to use it, which caused issues. Test the sysctl explicitly and do not
enable MSI-X if it's disabled globally.

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

6 years agobthidd(8): Generate button release event after virtual T-axis button press
wulf [Mon, 30 Oct 2017 20:58:57 +0000 (20:58 +0000)]
bthidd(8): Generate button release event after virtual T-axis button press

Apply PR/213957 (r308165, Make sure the virtual T-axis buttons generate button
release event(s) for continuous tilting) to bluetooth mouse support.

Reviewed by: emax, gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12672

6 years agoFix native-xtools installion after r325082 and r325000 to be to /nxb-bin.
bdrewery [Mon, 30 Oct 2017 18:54:27 +0000 (18:54 +0000)]
Fix native-xtools installion after r325082 and r325000 to be to /nxb-bin.

- r325082 split native-xtools-install out of native-xtools.
- r325000 incorrectly changed the installation path from /nxb-bin to /.

Discussed with: imp at D12782

6 years agoAdd myself to committers-src.dot
arichardson [Mon, 30 Oct 2017 18:17:02 +0000 (18:17 +0000)]
Add myself to committers-src.dot

Reviewed by: jhb (mentor)
Approved by: jhb (mentor)

6 years agoppp(8): style(9) fix after r325157
eugen [Mon, 30 Oct 2017 15:19:28 +0000 (15:19 +0000)]
ppp(8): style(9) fix after r325157

Approved by: mav (mentor)

6 years agoFix ppp(8) to add RTF_HOST flag to created host route.
eugen [Mon, 30 Oct 2017 15:02:42 +0000 (15:02 +0000)]
Fix ppp(8) to add RTF_HOST flag to created host route.

Reported by: Mike Tancsa <mike@sentex.net>
Approved by: avg (mentor)
MFC After: 1 week

6 years agoSet a default hostname for virtual machine images.
gjb [Mon, 30 Oct 2017 13:54:54 +0000 (13:54 +0000)]
Set a default hostname for virtual machine images.

A recent bug in security/sudo causes segmentation faults when
the system is not configured with a hostname, which causes issues
with some virtual machine setups, notably Vagrant.  Set the default
hostname to the output of 'uname -o'.

Submitted by: Nicholas Fiorentini
Sponsored by: The FreeBSD Foundation

6 years agortwn_usb(4): add few USB IDs.
avos [Mon, 30 Oct 2017 08:57:08 +0000 (08:57 +0000)]
rtwn_usb(4): add few USB IDs.

Submitted by: wfpower@yandex.ru (via github).

6 years agoUse MAP_PRIVATE instead of obsolete MAP_COPY. No functional changes.
trasz [Mon, 30 Oct 2017 08:56:04 +0000 (08:56 +0000)]
Use MAP_PRIVATE instead of obsolete MAP_COPY.  No functional changes.

MFC after: 2 weeks

6 years agoRemove unnecessary C in .fwo file I accidentally made consistent
ngie [Mon, 30 Oct 2017 06:51:03 +0000 (06:51 +0000)]
Remove unnecessary C in .fwo file I accidentally made consistent

MFC after: 1 month
MFC with: r325122, r325124

6 years agoFix a bad copy-paste (8000C -> 8265) done in r325122
ngie [Mon, 30 Oct 2017 06:48:38 +0000 (06:48 +0000)]
Fix a bad copy-paste (8000C -> 8265) done in r325122

This fixes the clean rule for "device iwm8265fw".

MFC after: 1 month
MFC with: r325122

6 years agoReference iwm8265fw support in iwm(4) as well
ngie [Mon, 30 Oct 2017 06:43:40 +0000 (06:43 +0000)]
Reference iwm8265fw support in iwm(4) as well

This documentation update is similar to what was done in iwmfw(4) in r325121.

MFC after: 1 month
MFC with: r325121

6 years agoFill in the blanks for iwm8265fw(4) rules, missed in r324434
ngie [Mon, 30 Oct 2017 06:35:09 +0000 (06:35 +0000)]
Fill in the blanks for iwm8265fw(4) rules, missed in r324434

Now using "device iwmfw" or "device iwm8265fw" in one's kernel configuration
will potentially result in a working IWM8265 series wireless SoC.

This is an alternative to the fix that was made in r324470 for
`sys/modules/iwmfw`.

MFC after: 1 month

6 years agoiwmfw(4): update support info
ngie [Mon, 30 Oct 2017 06:06:37 +0000 (06:06 +0000)]
iwmfw(4): update support info

- Document iwm8265fw firmware knobs.
- Note that 8000 series cards are also covered by the iwmfw(4) firmware module
  set.

6 years agoUnbreak install
eadler [Mon, 30 Oct 2017 04:30:34 +0000 (04:30 +0000)]
Unbreak install

Reported by: cy

6 years agoUpdate DPAA SDK to SDK 2.0
jhibbits [Mon, 30 Oct 2017 03:41:04 +0000 (03:41 +0000)]
Update DPAA SDK to SDK 2.0

This adds some support for ARM as well as 64-bit.  64-bit on PowerPC is
currently not working, and ARM support has not been completed or tested on the
FreeBSD side.

As this was imported from a Linux tree, it includes some Linux-isms
(ioread/iowrite), so compile with the LinuxKPI for now.  This may change in the
future.

6 years agoSend IDLE IMMEDIATE for warm boot.
imp [Mon, 30 Oct 2017 03:25:22 +0000 (03:25 +0000)]
Send IDLE IMMEDIATE for warm boot.

We must send either an IDLE IMMEDIATE or a STANDBY IMMEDIATE to drives
on warm boot so their SMART and other volatile data is
persisted. However, for a warm boot we don't want to send STANDBY
IMMEDIATE to some spinning drives because they will spin down. If
there's a lot of these drives on the system, that can cause a
thundering herd problem at startup time (that in extreme cases causes
timeout in device discovery).

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D12811

6 years agoReturn proper status from buildenv.
imp [Mon, 30 Oct 2017 03:12:38 +0000 (03:12 +0000)]
Return proper status from buildenv.

make buildenv BUILDENV_SHELL=<some command> more useful. Remove '||
true' from the command line so that errors are properly
returned. There appears to be no reason for it, and it dates back to
the original commit by ru@.

Sponsored by: Netflix

6 years agoFix parallel build issues and add MK_ZFS=no case
imp [Mon, 30 Oct 2017 03:12:34 +0000 (03:12 +0000)]
Fix parallel build issues and add MK_ZFS=no case

To ensure that I don't break the MK_ZFS=no case (currently working),
add that to the build, at least for i386 and amd64. Also, out of an
abundance of caution, clean single threaded, and then build in a
separate make. Otherwise, I hit a race where we build before objdir
has been created, which breaks at the moment.

Sponsored by: Netflix

6 years agoUse defs.mk defins in most MD code
imp [Mon, 30 Oct 2017 03:12:28 +0000 (03:12 +0000)]
Use defs.mk defins in most MD code

Use defines from defs.mk in most MD code (the biggest exception is
x86, which will be its own commit due to its size). Prefer including
bsd.init.mk over the variations (../Makefile.inc and src.opts.mk being
the two biggest ones).

Sponsored by: Netflix

6 years agoAdd Microchip 1-MBit SPI flash ID
jhibbits [Mon, 30 Oct 2017 02:31:08 +0000 (02:31 +0000)]
Add Microchip 1-MBit SPI flash ID

Used on the AmigaOne X5000.

6 years agoAdd P5010/P5010E for completeness
jhibbits [Mon, 30 Oct 2017 01:55:38 +0000 (01:55 +0000)]
Add P5010/P5010E for completeness

6 years agoRemove now bogus README
eadler [Mon, 30 Oct 2017 00:36:08 +0000 (00:36 +0000)]
Remove now bogus README

The SGML referenced was removed in r4719 of the doc repo.

6 years agoRevert removal of 9.x references in UPDATING
eadler [Sun, 29 Oct 2017 21:25:58 +0000 (21:25 +0000)]
Revert removal of 9.x references in UPDATING

Requested by: imp

6 years agorescue: say gbye to 'boot floppies' and moderize
eadler [Sun, 29 Oct 2017 21:21:39 +0000 (21:21 +0000)]
rescue: say gbye to 'boot floppies' and moderize

6 years agoImprove the performance of the hpet timer in bhyve guests by making the
ian [Sun, 29 Oct 2017 20:50:03 +0000 (20:50 +0000)]
Improve the performance of the hpet timer in bhyve guests by making the
timer frequency a power of two.  This changes the frequency from 10 to
16.7 MHz (2 ^ 24 HZ).  Using a power of two avoids roundoff errors when
doing arithmetic in sbintime_t units.

Testing shows this can fix erratic ntpd behavior in guests using the
hpet timer (which is the default for multicore guests).

Reported by: bsam@

6 years agoUpdate the updating URL in UPDATING
eadler [Sun, 29 Oct 2017 20:40:56 +0000 (20:40 +0000)]
Update the updating URL in UPDATING

Also remove references to 9.x

6 years agoCorrect the URLs for both READMEs for tracking src
eadler [Sun, 29 Oct 2017 20:29:31 +0000 (20:29 +0000)]
Correct the URLs for both READMEs for tracking src

Previously there were two different URLs in two
different READMEs, neither of which went anywhere.

6 years agoThe !! trick does not apply to all shells
eadler [Sun, 29 Oct 2017 20:20:51 +0000 (20:20 +0000)]
The !! trick does not apply to all shells

Requested by: emaste

6 years agoFix misleading comment.
mmel [Sun, 29 Oct 2017 14:26:37 +0000 (14:26 +0000)]
Fix misleading comment.
Not a functional change.

MFC after: 3 days

6 years agoPlug memory leak on error case.
trasz [Sun, 29 Oct 2017 12:07:27 +0000 (12:07 +0000)]
Plug memory leak on error case.

Reported by: Coverity
CID: 1382112
MFC after: 2 weeks

6 years agoAdd back missing MTX_DEF, it still needs to be there.
trasz [Sun, 29 Oct 2017 12:03:06 +0000 (12:03 +0000)]
Add back missing MTX_DEF, it still needs to be there.

(Although it's defined to be 0, so there's no functional change.)

Reported by: glebius
MFC after: 2 weeks

6 years agoFix information about nv.h include.
oshogbo [Sun, 29 Oct 2017 09:50:20 +0000 (09:50 +0000)]
Fix information about nv.h include.

MFC after: 1 week

6 years agoUpdate UPDATING
eadler [Sun, 29 Oct 2017 08:25:31 +0000 (08:25 +0000)]
Update UPDATING

- Remove FreeBSD 4.x of building the kernel.
While it might technically work, it is better to
document the 'correct' way than how to shoot oneself
in the foot

- Remove reference to CVS -P for src.

6 years agoUpdate several more URLs
eadler [Sun, 29 Oct 2017 08:17:03 +0000 (08:17 +0000)]
Update several more URLs

- Primarily http -> https
- Primarily FreeBSD project URLs

6 years agoUpdate URLs in usr.bin
eadler [Sun, 29 Oct 2017 08:03:21 +0000 (08:03 +0000)]
Update URLs in usr.bin

- http -> https
- contents have moved locations
- removal of URL if I could not find new location

6 years agoCleanup non-arch Makefiles
imp [Sun, 29 Oct 2017 05:27:22 +0000 (05:27 +0000)]
Cleanup non-arch Makefiles

Use SYSDIR, BOOTSRC, LDRSRC and FDTSRC in preference to relative
paths. Also, use bsd.init.mk where needed.

Sponsored by: Netflix

6 years agoDefine new EFI variables
imp [Sun, 29 Oct 2017 05:26:59 +0000 (05:26 +0000)]
Define new EFI variables

Define EFISRC, EFIINC and EFIINCMD. Use them, as well as using other
symbols defined in defs.mk. Prefer <bsd.init.mk> to ../../Makefile.inc
or <src.opts.mk>.

Sponsored by: Netflix

6 years agoModernize freebsd-tips a bit
eadler [Sun, 29 Oct 2017 04:53:33 +0000 (04:53 +0000)]
Modernize freebsd-tips a bit

- Prefer UTF-8 over ISO-8859-1
- Remove some references to printing man pages
- Combine duplicate '!!' tips
- 'rehash' is no longer needed

6 years agoPrefer using https over http
eadler [Sun, 29 Oct 2017 04:41:01 +0000 (04:41 +0000)]
Prefer using https over http

6 years agoxdev: Consolidate duplicate cross-tools build/install list into XDEVDIRS.
bdrewery [Sun, 29 Oct 2017 01:21:52 +0000 (01:21 +0000)]
xdev: Consolidate duplicate cross-tools build/install list into XDEVDIRS.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoxdev: Remove excess '/' since XDTP is asserted to be an absolute path.
bdrewery [Sun, 29 Oct 2017 01:21:49 +0000 (01:21 +0000)]
xdev: Remove excess '/' since XDTP is asserted to be an absolute path.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoxdev: Fix build for platforms needing LLD.
bdrewery [Sun, 29 Oct 2017 01:21:46 +0000 (01:21 +0000)]
xdev: Fix build for platforms needing LLD.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoxdev: Add missing 'make obj' treewalk for 'make includes'.
bdrewery [Sun, 29 Oct 2017 01:21:42 +0000 (01:21 +0000)]
xdev: Add missing 'make obj' treewalk for 'make includes'.

It is possible that building headers requires an OBJDIR.
The other phases of xdev have their own 'make obj' calls
where needed, such as inside 'make libraries' itself.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agolib32/libsoft: Store object files in a more consistent structure.
bdrewery [Sun, 29 Oct 2017 01:21:39 +0000 (01:21 +0000)]
lib32/libsoft: Store object files in a more consistent structure.

Having objects in world32 and a sysroot in lib32 was confusing and
inconsistent with the normal build.  Now objects are stored in
obj-lib32 (or obj-libsoft) and the sysroot (analagous to WORLDTMP)
is stored in obj-lib32/tmp.

Sponsored by: Dell EMC Isilon

6 years agoAUTO_OBJ: auto.obj.mk mkdir -p simplification
bdrewery [Sun, 29 Oct 2017 01:21:36 +0000 (01:21 +0000)]
AUTO_OBJ: auto.obj.mk mkdir -p simplification

Sponsored by: Dell EMC Isilon

6 years agoSuggest TARGET/TARGET_ARCH, XDEV/XDEV_ARCH are depcrecated in r269031.
bdrewery [Sun, 29 Oct 2017 01:21:33 +0000 (01:21 +0000)]
Suggest TARGET/TARGET_ARCH, XDEV/XDEV_ARCH are depcrecated in r269031.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoChange native-xtools to not install by default; add a native-xtools-install.
bdrewery [Sun, 29 Oct 2017 01:21:29 +0000 (01:21 +0000)]
Change native-xtools to not install by default; add a native-xtools-install.

Without this the user has to mess with 'make -f Makefile.inc1 ...' to figure
out where the files are installed in the OBJDIR and then they need to copy them
to where they really wanted them. Using DESTDIR may be problematic after
r325001 as well.

The files will be installed to DESTDIR/NXTP where NXTP defaults to /nxb-bin.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agobuild(7): Document xdev targets.
bdrewery [Sun, 29 Oct 2017 01:21:26 +0000 (01:21 +0000)]
build(7): Document xdev targets.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agobuild(7): Document native-xtools.
bdrewery [Sun, 29 Oct 2017 01:21:22 +0000 (01:21 +0000)]
build(7): Document native-xtools.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoFix xdev TARGET/TARGET_ARCH assertion and expand to native-xtools.
bdrewery [Sun, 29 Oct 2017 01:21:19 +0000 (01:21 +0000)]
Fix xdev TARGET/TARGET_ARCH assertion and expand to native-xtools.

The top of Makefile.inc1 requires TARGET/TARGET_ARCH be defined.  Just
building 'make xdev' would already set them, so this error was never
triggered.  Moving it to Makefile fixes the problem.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoDisable AUTO_OBJ as a make argument to ensure it really is disabled.
bdrewery [Sun, 29 Oct 2017 01:21:15 +0000 (01:21 +0000)]
Disable AUTO_OBJ as a make argument to ensure it really is disabled.

If the user sets this to yes as a make argument too we still want
to ensure these do not get enabled.

Sponsored by: Dell EMC Isilon

6 years agoMAKEOBJDIR should be an absolute path, not any path with a slash.
bdrewery [Sun, 29 Oct 2017 01:21:12 +0000 (01:21 +0000)]
MAKEOBJDIR should be an absolute path, not any path with a slash.

Using MAKEOBJDIR=foo did not work but MAKEOBJDIR=foo/ did, but
really it needs to be absolute.

Sponsored by: Dell EMC Isilon

6 years agoRework r254951 to not reach into private OBJDIR areas.
bdrewery [Sun, 29 Oct 2017 01:21:09 +0000 (01:21 +0000)]
Rework r254951 to not reach into private OBJDIR areas.

The original change was dealing with the build wanting to run a newer
install(1) that was not yet installed.  The solution to look into the private
legacy directory of the existing build conflicts with 2 upcoming features: a
changed OBJDIR format, and splitting the host tools into arch-dependent and
arch-independent directories.  Rather than hardcoding and changing the paths in
this script, just let kernel-toolchain do the work, while disabling much of the
meat.  With -j15 this finishes in 25 seconds for me and 117 seconds with -j1.
All that is really needed is bootstrap-tools, but the system is not currently
written in a way that all previous dependent steps will have ran.  The previous
steps, such as _worldtmp, are being reworked and renamed and so cannot be
relied upon to be right.

Sponsored by: Dell EMC Isilon

6 years agoRemove comment: debug files can be useful for build tools.
bdrewery [Sun, 29 Oct 2017 01:21:06 +0000 (01:21 +0000)]
Remove comment: debug files can be useful for build tools.

Sponsored by: Dell EMC Isilon

6 years agoMove some LIBCOMPAT tmpdir logic setup to its own build target.
bdrewery [Sun, 29 Oct 2017 01:21:02 +0000 (01:21 +0000)]
Move some LIBCOMPAT tmpdir logic setup to its own build target.

Its own build target was already handling mtree extractions
just as _worldtmp did, so the other cleaning of the
tmpdir makes sense here as well.

Sponsored by: Dell EMC Isilon

6 years agoMK_TESTS is disabled in early phases, no need for TESTBASE extraction here.
bdrewery [Sun, 29 Oct 2017 01:20:59 +0000 (01:20 +0000)]
MK_TESTS is disabled in early phases, no need for TESTBASE extraction here.

Sponsored by: Dell EMC Isilon

6 years agoFAST_DEPEND clean hack: Remove lib32/soft files properly.
bdrewery [Sun, 29 Oct 2017 01:20:56 +0000 (01:20 +0000)]
FAST_DEPEND clean hack: Remove lib32/soft files properly.

Only remove them if the option is enabled and also handle libsoft
by using the proper LIBCOMPAT_OBJTREE.  LIBCOMPAT:D will expand
the text after it as a proper glob to the command line if LIBCOMPAT
is defined.

Sponsored by: Dell EMC Isilon

6 years agoMove FAST_DEPEND cleanup hack into its own target and call from _cleanobj.
bdrewery [Sun, 29 Oct 2017 01:20:53 +0000 (01:20 +0000)]
Move FAST_DEPEND cleanup hack into its own target and call from _cleanobj.

The _worldtmp target is for setting up WORLDTMP.  Nothing between _worldtmp
and _cleanobj will read these files.  Move to its own target since it is
so large.

Sponsored by: Dell EMC Isilon

6 years agoWe don't need LIB32 directories extracted in early phase legacy/WORLDTMP dirs.
bdrewery [Sun, 29 Oct 2017 01:20:50 +0000 (01:20 +0000)]
We don't need LIB32 directories extracted in early phase legacy/WORLDTMP dirs.

This reverts some changes from r289662

Sponsored by: Dell EMC Isilon

6 years agoDisallow using a colon ':' in source checkout paths.
bdrewery [Sun, 29 Oct 2017 01:20:47 +0000 (01:20 +0000)]
Disallow using a colon ':' in source checkout paths.

This leaks into the PATH handling for WORLDTMP and breaks
finding cross-tools.  The PATH handling could be fixed to
properly quote but is not worth the effort.

Also allow this sanity check to always run even with 'make -n'.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoMove sendmail special check into a _sanity_check target.
bdrewery [Sun, 29 Oct 2017 01:20:43 +0000 (01:20 +0000)]
Move sendmail special check into a _sanity_check target.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agobsnmpd: Only refresh devtree if devd event is a new or removed device.
pfg [Sat, 28 Oct 2017 21:26:49 +0000 (21:26 +0000)]
bsnmpd: Only refresh devtree if devd event is a new or removed device.

It makes sense to refresh the tree only when a device is inserted or
removed, otherwise bsnmpd wastes lot of CPU.

PR: 209368
MFC after: 1 week

6 years agoFix out-of-bounds read in libc/regex.
pfg [Sat, 28 Oct 2017 20:09:34 +0000 (20:09 +0000)]
Fix out-of-bounds read in libc/regex.

The bug is an out-of-bounds read detected with address sanitizer that
happens when 'sp' in p_b_coll_elems() includes NUL byte[s], e.g. if it's
equal to "GS\x00". In that case len will be equal to 4, and the
strncmp(cp->name, sp, len) call will succeed when cp->name is "GS" but the
cp->name[len] == '\0' comparison will cause the read to go out-of-bounds.

Checking the length using strlen() instead eliminates the issue.

The bug was found in LLVM with oss-fuzz:
https://reviews.llvm.org/D39380

MFC after: 1 week
Obtained from: Vlad Tsyrklevich through posting on openbsd-tech

6 years agoSplit the hardware type enum and the hw feature flags bits into separate
ian [Sat, 28 Oct 2017 20:03:29 +0000 (20:03 +0000)]
Split the hardware type enum and the hw feature flags bits into separate
fields in the softc; they're ORed together in the ofw_compat_data.

I already caught myself doing 'sc->fectype == <enum val>' without masking
out the feature bits in one place, and that's sure to happen again.
Glomming them together is convenient for storing them in the ofw_compat_data
array, but there's no reason to keep them together in the softc.

6 years agoSimplify ping sandbox.
oshogbo [Sat, 28 Oct 2017 19:39:22 +0000 (19:39 +0000)]
Simplify ping sandbox.

We don't need to check if casper is present, this is done in the library itself.

Reviewed by: emaste, cem, ed
Differential Revision: https://reviews.freebsd.org/D8754

6 years agoUse the 16-bit receive shift feature in ffec hardware that supports it.
ian [Sat, 28 Oct 2017 19:34:08 +0000 (19:34 +0000)]
Use the 16-bit receive shift feature in ffec hardware that supports it.

When available, enabling this feature causes the hardware to write data
to the receive buffer starting at a 16-bit offset from the start address.
This eliminates the need to copy the data after receiving to re-align
the protocol headers to a 32-bit boundary.

PR: 222634
Submitted by: sebastian.huber@embedded-brains.de

6 years agoIntroduce caspermocks.
oshogbo [Sat, 28 Oct 2017 19:23:57 +0000 (19:23 +0000)]
Introduce caspermocks.

The idea behinds mocks is that we don't need to ifdef a lot of code in
tools itself but those defines are hidden in the casper library.
Right now the mocks are implemented as define/inlines functions.
There was a very long discussion how this should be implemented.
This approach has some advantages like we don't need to link to any additional
libraries. Unfortunately there are also some disadvantages for example it is
easy to get library out of sync between two versions of functions or that we
need extra define to compile program with casper support.
This isn't an ideal solution but it's good enough for now and should simplify
capsicumizing programs. This also doesn't close us any other ways to do those
mocks and this should evolve in time.

Discussed with: pjd, emaste, ed, rwatson, bapt, cem, bdrewery
Differential Revision:    https://reviews.freebsd.org/D8753

6 years agoSupport up to 3 IRQs in the ffec driver.
ian [Sat, 28 Oct 2017 19:08:06 +0000 (19:08 +0000)]
Support up to 3 IRQs in the ffec driver.

Newer hardware splits the interrupts onto 3 different irq lines, but the
docs barely mention that there are multiple interrupts, and do not detail
how they're split up.  The code now supports 1-3 irqs, and uses the same
interrupt service routine to handle all of them.

I modified the submitted changes to use bus_alloc_resources() instead of
using loops to allocate each irq separately.  Thus, blame any bugs on me (I
can't actually test on imx7 hardware).

PR: 222634
Submitted by: sebastian.huber@embedded-brains.de

6 years agoAdd a #define RESOURCE_SPEC_END. Similar to DEVMETHOD_END and
ian [Sat, 28 Oct 2017 18:56:27 +0000 (18:56 +0000)]
Add a #define RESOURCE_SPEC_END.  Similar to DEVMETHOD_END and
KOBJMETHOD_END, this is to serve as the end marker in an array of
resource_spec structures.

6 years agoImport tzdata 2017c
philip [Sat, 28 Oct 2017 18:54:45 +0000 (18:54 +0000)]
Import tzdata 2017c

Changes: https://mm.icann.org/pipermail/tz-announce/2017-October/000047.html

MFC after: 2 days

6 years agoImport tzdata 2017c
philip [Sat, 28 Oct 2017 17:43:05 +0000 (17:43 +0000)]
Import tzdata 2017c

6 years agoAvoid AXI bus issues due to a MAC reset on imx6sx and imx7.
ian [Sat, 28 Oct 2017 17:30:49 +0000 (17:30 +0000)]
Avoid AXI bus issues due to a MAC reset on imx6sx and imx7.

When the FEC is connected to the AXI bus (indicated by AVB flag), a
MAC reset while a bus transaction is pending can hang the bus.
Instead of resetting, turn off the ENABLE bit, which allows the
hardware to complete any in-progress transfers (appending a bad CRC
to any partial packet) and release the AXI bus.  This could probably
be done unconditionally for all hardware variants, but that hasn't
been tested.

PR: 222634
Submitted by: sebastian.huber@embedded-brains.de

6 years agoAdd FECFLAG_AVB variant flag to support new features on imx7.
ian [Sat, 28 Oct 2017 17:06:13 +0000 (17:06 +0000)]
Add FECFLAG_AVB variant flag to support new features on imx7.

This flag is analogous to the Linux driver FEC_QUIRK_HAS_AVB.  It
indicates an FEC with support for Audio Video Bridging (AVB).  This
indicator is used for various other parts in the Linux driver
(drivers/net/ethernet/freescale/fec_main.c).

Use it to customize the receive/transmit buffer alignment.  The receive
buffer alignment increased to 64-bytes on the i.MX 6SoloX and i.MX
7Dual.  There are no hard alignment restrictions for transmit buffers on
these chips.

Fix the ffec_softc::fectype type to provide enough storage for the
feature flags.

PR: 222634
Submitted by: sebastian.huber@embedded-brains.de

6 years agoIncrease the alignment of the rx/tx descriptor ring buffers to 64 bytes.
ian [Sat, 28 Oct 2017 16:50:23 +0000 (16:50 +0000)]
Increase the alignment of the rx/tx descriptor ring buffers to 64 bytes.

16 was the correct alignment for older hardware, but the imx7 requires
64-byte alignment, which is a fine value to use on all systems.

PR: 222634
Submitted by: sebastian.huber@embedded-brains.de

6 years agoRemove a stale and incorrect comment.
markj [Sat, 28 Oct 2017 02:51:27 +0000 (02:51 +0000)]
Remove a stale and incorrect comment.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

6 years agoRemove workqueue items after updating the workqueue tail pointer.
markj [Sat, 28 Oct 2017 02:48:37 +0000 (02:48 +0000)]
Remove workqueue items after updating the workqueue tail pointer.

When QUEUE_MACRO_DEBUG_TRASH is configured, the queue linkage fields
are trashed upon removal of the item, so be sure to only read them before
removing the item.

No functional change intended.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

6 years agoUpdate manpage date to when the deprecation notice was removed.
jlh [Fri, 27 Oct 2017 21:48:02 +0000 (21:48 +0000)]
Update manpage date to when the deprecation notice was removed.

Reported by: bcr

6 years agoFix MAC address detection regression introduced by r324184
gonzo [Fri, 27 Oct 2017 21:22:38 +0000 (21:22 +0000)]
Fix MAC address detection regression introduced by r324184

To accomodate all variaties of Pi DTS files floating around
we look for MAC address property either in DTS node for
USB ethernet (if it exists) or at predefined path
".../usb/hub/ethernet".

After r324184 smsc_fdt_find_eth_node started to return node
with compatibility string "usb424,ec00" as an eth node.
In imported GNU dts files this node still does not have
MAC address related property, and therefor following check for
"mac-address" and "local-mac-address" fails.

To make this logic more robust do not just search for the node
but also make sure it has required property, so if node with
accepted compatibility string exists but doesn't have the
property we fall back to looking for hardoded path mentioned above.

6 years agodma: fix use-after-free
emaste [Fri, 27 Oct 2017 20:21:09 +0000 (20:21 +0000)]
dma: fix use-after-free

Sponsored by: The FreeBSD Foundation

6 years agoFix parsing error when processing cmsg in SCTP send calls. Thei bug is
tuexen [Fri, 27 Oct 2017 19:27:05 +0000 (19:27 +0000)]
Fix parsing error when processing cmsg in SCTP send calls. Thei bug is
related to a signed/unsigned mismatch.
This should most likely fix the issue in sctp_sosend reported by
Dmitry Vyukov on the freebsd-hackers mailing list and found by
running syzkaller.

6 years agoActually release resources in detach() rather than just returning EBUSY.
ian [Fri, 27 Oct 2017 17:21:43 +0000 (17:21 +0000)]
Actually release resources in detach() rather than just returning EBUSY.
This will enable use of 'devctl disable', allow creation of a module, etc.

6 years agoFix a lock leak in g_mirror_destroy().
markj [Fri, 27 Oct 2017 17:05:14 +0000 (17:05 +0000)]
Fix a lock leak in g_mirror_destroy().

g_mirror_destroy() is supposed to unlock the softc before indicating
success, but it wasn't doing so if the caller raced with another
thread destroying the mirror.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

6 years agoUpdate comment to match r177997 & r178036 changes.
obrien [Fri, 27 Oct 2017 16:36:05 +0000 (16:36 +0000)]
Update comment to match r177997 & r178036 changes.

6 years agolibdtrace: replace "DOODAD" with more descriptive string
emaste [Fri, 27 Oct 2017 16:23:45 +0000 (16:23 +0000)]
libdtrace: replace "DOODAD" with more descriptive string

Previously some unimplemented libdtrace routines printed the function,
file and line number, followed by "DOODAD." That is not particularly
informative, so replace it with a message reporting the actual issue.

Sponsored by: The FreeBSD Foundation

6 years agonvd alias has caused some problems, revert it for the moment.
imp [Fri, 27 Oct 2017 14:57:38 +0000 (14:57 +0000)]
nvd alias has caused some problems, revert it for the moment.

Sponsored by: Netflix