Commit Graph

227412 Commits

Author SHA1 Message Date
Warner Losh
268e2d82c4 Powerpc is a 32-bit boot loader.
Stop building libsa32 on powerpc. Build everything on powerpc64
-m32. Transition to using LIBSA from LIBSA32. This elimiantes the
useless build of libsa on powerpc64 (nothing used to use it) and
should be a more direct way of saying this.

Sponsored by: Netflix
2017-11-06 15:21:39 +00:00
Mateusz Guzik
db520fdd46 rwlock: fix up compilation without KDTRACE_HOOKS after r324787 2017-11-06 05:14:05 +00:00
Justin Hibbits
37f275860c Set the PRD extension list base address in little endian
All data accesses with the SATA controller are little endian.  This was
missed when writing the extension code.
2017-11-06 05:09:18 +00:00
Mateusz Guzik
ce80021f4e namecache: bump numcache after dropping all locks
This makes no difference correctness-wise, but shortens total hold time.
2017-11-05 22:29:45 +00:00
Bryan Drewery
f7ef435bb6 Rework r325076: Just use the pre-existing OBJDIR.
Like was done in usr.sbin/mergemaster in r249906, we can just use
the already-built OBJDIR for install(1).

Sponsored by:	Dell EMC Isilon
2017-11-05 22:29:34 +00:00
Mateusz Guzik
119b826a62 namecache: wlock buckets in cache_lookup_nomakeentry
Since the case of an empty chain was already covered, it si very likely
that the existing entry is matching. Skipping readlocking saves on lock
upgrade.
2017-11-05 22:28:39 +00:00
Justin Hibbits
78220c7be8 Fix an off-by-one error missed in the initial commit of this driver
When the segment count is > 16 it spills into an 'indirect descriptor list',
which immediately follows the main table, but the indirect list is entry 15, so
needs to be skipped for the general list.
2017-11-05 22:09:59 +00:00
Konstantin Belousov
93b09f581a Remove badsect(8).
Failure modes of the modern (that is, produced in the last 25 years)
hard drives and SSDs made the utility outdated.  Since the kernel
interface to support it was removed in r324853, cut the userspace
remnants as well.

Discussed with:	bde (who does not like the removal)
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2017-11-05 22:00:54 +00:00
Mateusz Guzik
ba324b5946 namecache: skip locking in cache_lookup_nomakeentry if there is no entry 2017-11-05 21:59:39 +00:00
Enji Cooper
6f74a1c952 Fix cosmetic nit when printing out "override $mode" and "$owner/$group ..."
The wrong index was being checked for == ' ' in the resulting stringified
mode from strmode(3) -- it should have been the 11th value, not the 10th.

MFC after:	3 days
PR:		76711
Submitted by:	Vasil Dimov <vd@datamax.bg>
2017-11-05 21:43:26 +00:00
Enji Cooper
792bc22266 Choose a simpler, more philosophically correct version for CRTARCH with armv[67]
This is a rework of r325443.

PR:		222925
Tested with:	make buildenv with appropriate TARGET/TARGET_ARCH pairs
2017-11-05 20:38:40 +00:00
Konstantin Belousov
b535ed2898 Zero the structure instead of the pointer to it.
Reported by:	Don Morris <Don.Morris@dell.com>
MFC after:	4 days
2017-11-05 20:03:57 +00:00
Enji Cooper
c9c9774c70 Revert r325443
Despite the fact that it's a working solution, it doesn't follow the design
philosophy of only doing TARGET_* in Makefile.inc1 and special locations in
the source tree.

PR:		222925
Requested by:	imp
2017-11-05 20:01:00 +00:00
Ed Maste
80dc9f8888 ANSIfy sys/kern/md4c.c
PR:		223453
Submitted by:	ota@j.email.ne.jp
MFC After:	2 weeks
2017-11-05 19:49:44 +00:00
Enji Cooper
571e134eea Fix paths for cross-built versions of lib/libclang_rt and hardfloat arm variants
- Define TARGET_CPUARCH and use in libclang_rt as the basis for CRTARCH

  When cross-compiling, the wrong architecture was being embedded in the
  libclang_rt binary filenames. It should be based on TARGET_ARCH (target), not
  MACHINE_ARCH (host).

  If TARGET_ARCH isn't defined (host-builds), fallback to MACHINE_ARCH.

- Define CRTARCH to armhf when TARGET/TARGET_ARCH are set to arm/armv[67]

  TARGET_ABI/TARGET_CPU in Makefile.inc1 sets the ABI to gnueabihf, which
  affects the clang lookup path per `getArchNameForCompilerRTLib(..)` in
  contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp, so chase clang and
  Linux's assumed naming convention for hard-float arm architectures.

  CROSSENV (in Makefile.inc1) sets CPUTYPE/MACHINE(_ARCH)? to the
  TARGET*-relevant values when building the `libraries` target, so test
  those variables instead.

- Add OLD_FILES/OLD_LIBS entries for TARGET/TARGET_ARCH == arm/armv[67]. This
  impacts only arm/armv6 and arm/armv7.

PR:	222925
2017-11-05 19:38:51 +00:00
Enji Cooper
a060f1416a Support compiling lib/libclang_rt/profile a bit more with recent versions of gcc
Several of the flags were being treated as CFLAGS, when they were actually
technically CXXFLAGS. Move them there.

Only apply -fno-sanitize=safe-stack with clang.

PR:             223179
2017-11-05 19:25:06 +00:00
Benedict Reuschling
70cccb5ce0 Extend the synopsis section of md(4) to look more like other manpages
of this kind.  Describe how to compile the driver into the kernel
and how to load it as a module.
This is useful for people using the MINIMAL kernel configuration file.

PR:			218610
Submitted by:		Harald Schmalzbauer (bugzilla.freebsd@omnilan.de)
Reviewed by:		noone (1 month inactivity)
MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D12271
2017-11-05 18:45:43 +00:00
Benedict Reuschling
18b80db55f The last example used LOG_INFO, but the message itself said error.
Change to LOG_ERR to be less confusing.

PR:			216756
Submitted by:		Thomas Cort (linuxgeek@gmail.com)
Reviewed by:		noone (after 2 months)
Differential Revision:	https://reviews.freebsd.org/D11824
2017-11-05 18:24:31 +00:00
Michal Meloun
6adbcd6bd8 Remove support for ARMv6/v7 platform from elf_trampoline.
The elf_trampoline.c is not connected to build for ARMv6/v7 for long time and
it uses outdated low level cpu functions.
This blocks forthcoming cleanup of ARM code.

MFC after:	3 weeks
2017-11-05 17:14:44 +00:00
Michal Meloun
8a1d2cd3c1 All CP15 registers are bit fields or counters, don't use signed type
when accessing them.

MFC after:	3 weeks
2017-11-05 16:52:54 +00:00
Bryan Drewery
c6d98d62e2 Follow-up r325405: Fix assertion still for kernel module builds.
Apparently they have SRCTOP set, but won't have RELDIR set since they are
not in-tree.

Pointyhat to:	bdrewery
Reported by:	O. Hartmann <ohartmann@walstatt.org>, dhw
Tested by:	dhw
Sponsored by:	Dell EMC Isilon
2017-11-05 16:28:05 +00:00
Eugene Grosbein
9f23a54e52 Allow a process to assign an IP address to local ppp interface
even if kernel routing table already has a route to the address in question
installed by some routing daemon (PR 223129).

Also, allow loopback route deletion when stopping a VIMAGE jail (PR 222647).

PR:			222647, 223129
Reviewed by:		gnn
Approved by:		avg (mentor), mav (mentor)
MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D12747
2017-11-05 14:41:48 +00:00
Konstantin Belousov
4e13cca54e Improve the message printed when the cylinder group checksum is wrong.
Mention the device path and mount point path, handle snapshots.

Tested by:	imp
Sponsored by:	The FreeBSD Foundation
2017-11-05 13:28:48 +00:00
Michael Tuexen
253a63b817 Fix an accounting bug where data was counted twice if on the read
queue and on the ordered or unordered queue.
While there, improve the checking in INVARIANTs when computing the
a_rwnd.

MFC after:	3 days
2017-11-05 11:59:33 +00:00
Mateusz Guzik
a52058f013 namecache: skip locking in cache_purge_negative if there are no entries 2017-11-05 08:31:25 +00:00
Enji Cooper
d32c209fdf Add OLD_FILES/OLD_LIBS entries for TARGET/TARGET_ARCH == arm/armv[67] 2017-11-05 07:56:32 +00:00
Enji Cooper
600da319ad Simplify r325427
CROSSENV (in Makefile.inc1) sets CPUTYPE/MACHINE(_ARCH)? to the
TARGET*-relevant values when building the `libraries` target.

PR:	222925
2017-11-05 07:48:40 +00:00
Enji Cooper
7efeac5c18 Define CRTARCH to armhf when TARGET/TARGET_ARCH are set to arm/armv[67]
TARGET_ABI/TARGET_CPU in Makefile.inc1 sets the ABI to gnueabihf, which affects
the clang lookup path per getArchNameForCompilerRTLib(..) in
contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp .

This is a follow up to r324873.

PR:		222925
2017-11-05 07:36:11 +00:00
Enji Cooper
cc5f0ba05b .S.ppico should omit ${_COV_FLAG}, not .S.pico 2017-11-05 05:08:16 +00:00
Peter Wemm
9ee3ea71b3 As a follow-on to r325378, make the shutdown timer default to 0 as well.
Otherwise an orderly shutdown will initiate a watchdog that will cause
a 7 minute delayed reboot *by default*,  In the freebsd.org cluster's case
this often worked out be a surprise reboot a minute or two after the
machine came back up.
2017-11-05 05:05:18 +00:00
Enji Cooper
8e7d6bc8e3 Omit _COV_FLAG from PO_C(XX)FLAGS and from .S.ppico static targets 2017-11-05 04:28:05 +00:00
Enji Cooper
254d2760ce MFhead@r325422 2017-11-05 04:08:00 +00:00
Ed Maste
8ca8d252bb posix_fallocate.2: add an EINVAL errno case
As of r325320 posix_fallocate returns EINVAL on ZFS to indicate that
the underlying filesystem does not support this operation, per
POSIX.1-2008. Document this case in the man page.

MFC after:	20 days
MFC with:	r325320
Sponsored by:	The FreeBSD Foundation
2017-11-05 03:02:19 +00:00
Justin Hibbits
809cd50ff5 Add Freescale QorIQ SATA controller support.
The Freescale SATA controller has many similarities to AHCI controllers, so
this driver is a heavily modified AHCI driver.  Currently it seems to only
do SATA 1.0 speeds (~100-150MB/s), so there is still room for improvement.

Still to be done:
* Address erratum SATA-A-006187 -- Spread Spectrum Support (intermittent
  non-recoverable transient data integrity error seen when SSC enabled).
* Linux doesn't read the log page as it hangs on the P1022.  See if that's
  applicable to this, and address accordingly.
* Try to determine what's holding back performance, and address it.

MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D6071
2017-11-05 02:47:46 +00:00
Ed Maste
cdf46f9946 lld: accept EINVAL to indicate posix_fallocate is unsupported
As of r325320 posix_fallocate on a ZFS filesystem returns EINVAL to
indicate that the operation is not supported. (I think this is a strange
choice of errno on the part of POSIX.)

PR:		223383, 223440
Reported by:	Mark Millard
Tested by:	Mark Millard
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2017-11-05 00:51:53 +00:00
Bryan Drewery
b91ed584d4 Avoid trying to remove a fullpath directory in CLEANDIRS.
Let CLEANDIRS work relative since make is already in .OBJDIR.

MFC after:	2 weeks
X-MFC-With:	r322511
Sponsored by:	Dell EMC Isilon
2017-11-05 00:26:28 +00:00
Bryan Drewery
b284f32266 AUTO_OBJ: Allow 'make cleandir obj all' combinations.
The cleanobj target will not really remove the OBJDIR in this case,
it will only remove the OBJDIR if only clean targets are ran.

Sponsored by:	Dell EMC Isilon
2017-11-05 00:12:12 +00:00
Bryan Drewery
3407406588 Set the expected __objdir for auto.obj.mk to try.
This avoids some future discrepency that might cause auto.obj.mk to use the
wrong OBJDIR.

Sponsored by:	Dell EMC Isilon
2017-11-05 00:12:09 +00:00
Bryan Drewery
00428a515c Always try to set .OBJDIR, even if AUTO_OBJ is enabled, and fallback to .CURDIR.
When AUTO_OBJ is enabled this change becomes redundant with the auto.obj.mk
check added in r325404.  However, it is possible that new code is added
at some point between src.sys.obj.mk and auto.obj.mk that disables AUTO_OBJ.
That could leave make with a bogus and unsafe .OBJDIR in some cases.

Sponsored by:	Dell EMC Isilon
2017-11-05 00:12:05 +00:00
Bryan Drewery
dea21cf465 Validate MAKEOBJDIR after the MAKEOBJDIRPREFIX override.
Sponsored by:	Dell EMC Isilon
2017-11-05 00:12:02 +00:00
Bryan Drewery
aba77ddd8a AUTO_OBJ: Set .OBJDIR=.CURDIR earlier for NO_OBJ Makefiles.
auto.obj.mk is loaded before the Makefile which may have NO_OBJ set inside of
it.  In that case we can't avoid creating the OBJDIR but we do need to avoid
using it.  Fixing .OBJDIR in bsd.init.mk at least fixes all of the build .mk
files to have a proper .OBJDIR.  It does not fix the Makefile itself but
usually if they have NO_OBJ set they are not inspecting ${.OBJDIR} anyhow.

It is ideal to only have this in bsd.init.mk and to remove it from bsd.obj.mk,
but then bsd.obj.mk would need to include bsd.init.mk.  Doing something like
that would require more testing.  It has been proposed that bsd.obj.mk not be
included directly but it has been possible for too long to do so to change it
at this point.

Note too that it may make sense to fix .OBJDIR even when AUTO_OBJ is not
enabled but the historical behavior has always been that NO_OBJ just avoids
running 'make obj', so .OBJDIR should already be .CURDIR.

Also while NO_OBJ seems like it should be removed at this point, it is not
always possible to fix Makefiles to properly use an .OBJDIR.  The cost of
keeping NO_OBJ support is minimal.

Sponsored by:	Dell EMC Isilon
2017-11-05 00:11:58 +00:00
Bryan Drewery
2f4c7d14c8 Simplify location of bootstrap make.
Sponsored by:	Dell EMC Isilon
2017-11-05 00:11:55 +00:00
Bryan Drewery
996e475962 Fix nested MAKEOBJDIRPREFIX breaking various release/buildworld/toolchain targets.
This problem was caused by r325329 and r325350.

For the release(7) targets, some will run mm-mtree.sh which itself runs make
with a MAKEOBJDIRPREFIX.  The execution of that script leaks OBJROOT,
MAKEOBJDIR, and MAKELEVEL=1 in the environment.  This causes the mm-mtree makes
to not do some basic setup of OBJROOT and only use this special
MAKEOBJDIRPREFIX case which fails to empty out MAKEOBJDIRPREFIX for further
nested makes, such as a tree walk.  If that tree walk sets OBJROOT/OBJTOP such
as r325329 is doing, then the wrong OBJDIRs end up being used due to the
unemptied MAKEOBJDIRPREFIX being preferred over the proper MAKEOBJDIR.

Pointyhat to:	bdrewery
Sponsored by:	Dell EMC Isilon
2017-11-05 00:11:51 +00:00
Bryan Drewery
1031b94fc4 Set OBJROOT/OBJTOP as make arguments. Missed in r325329.
Sponsored by:	Dell EMC Isilon
2017-11-05 00:11:47 +00:00
Oleksandr Tymoshenko
031d577716 Increase TX_MAX_SEGS from 10 to 20 for the if_awg.c driver
Under certain traffic pattern awg driver does not recover from TX queue
full condition. The actual source of the problem is not identified yet
but jmcneill@ agreed that bumping TX_MAX_SEGS to 20 is OK as a workaround
for the problem (NetBSD has it set to 128).

Also add some diagnostic printfs to prevent silent failure of bus_dma
functions in the future

PR will be kept open until root cause of the issue is identified and fixed

PR:		219927
Submitted by:	Tom Vijlbrief <tvijlbrief@gmail.com>
Approved by:	jmcneill
MFC after:	2 weeks
2017-11-04 23:28:02 +00:00
Bryan Drewery
d949e92a9c Follow-up r325405: Only enable assertion for in-tree src builds.
Pointyhat to:	bdrewery
Reported by:	O. Hartmann <ohartmann@walstatt.org>
Sponsored by:	Dell EMC Isilon
2017-11-04 21:59:54 +00:00
Bryan Drewery
914a5ffcbd AUTO_OBJ: Revert r325351 now that the fix is in auto.obj.mk in r325404.
Forcing MK_AUTO_OBJ to no is not really needed since bsd.obj.mk is protected
against 'rm -rf ${.CURDIR}' already.  It was also flawed as if MK_AUTO_OBJ=yes
was in the .MAKEOVERRIDES already then it just remained on.

Sponsored by:	Dell EMC Isilon
2017-11-04 21:06:39 +00:00
Bryan Drewery
968be8a7a0 Add an assertion to avoid the 'rm -rf /etc' case from cleanobj fixed in r325404.
Sponsored by:	Dell EMC Isilon
2017-11-04 21:05:03 +00:00
Simon J. Gerraty
5abdb50e57 Ensure .OBJDIR has known value
If for any reason we cannot set .OBJDIR==_objdir as desired
use .CURDIR so that at least the classic
.if ${.OBJDIR} != ${.CURDIR}
works and dangerous misstakes can be avoided.

Reviewed by: bdrewery
2017-11-04 21:02:26 +00:00
Edward Tomasz Napierala
1f66baa5eb Add missing MLINKS for disk_add_alias(9).
MFC after:	2 weeks
2017-11-04 16:23:34 +00:00