Commit Graph

220393 Commits

Author SHA1 Message Date
Konstantin Belousov
8403b5a129 Fix regression in r313898 on i386.
Use large enough type for calculation of mtrr physmask.  Typical
cpu_maxphyaddr is 36 or larger.

Reported and tested by:	sbruno
Sponsored by:	The FreeBSD Foundation
MFC after:	13 days
2017-02-19 03:57:41 +00:00
Konstantin Belousov
d9440197b4 Microoptimize amd64/pmap.c pmap_protect_pde().
For the loop that dirties vm_pages in case superpage was written to,
check the complete condition before the loop.

Reviewed by:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-02-19 03:33:20 +00:00
Jason A. Harmening
e2a8d17887 Bring back r313037, with fixes for mips:
Implement get_pcpu() for amd64/sparc64/mips/powerpc, and use it to
replace pcpu_find(curcpu) in MI code.

Reviewed by:	andreast, kan, lidl
Tested by:	lidl(mips, sparc64), andreast(powerpc)
Differential Revision:	https://reviews.freebsd.org/D9587
2017-02-19 02:03:09 +00:00
Mateusz Guzik
5c5df0d99b locks: clean up trylock primitives
In particular thius reduces accesses of the lock itself.
2017-02-18 22:06:03 +00:00
Enji Cooper
74464d3ca4 Include ${LOCALBASE}/bin in $PATH when running "make checkworld"
Some of the tests in devel/atf // devel/kyua rely on the tools being in $PATH,
which means that the tests fail when run via "make checkworld" because $PATH
is restricted to exclude directory elements like "${LOCALBASE}/bin".

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-02-18 21:47:32 +00:00
Enji Cooper
66df1425ff Quote path to doxygen/kyua in test(1) -x check
This is a basic stopgap against ${LOCALBASE} containing spaces in it

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-02-18 21:41:50 +00:00
Mahdi Mokhtari
507c3d47af Add new catrigl.c (r313761) APIs to include/complex.h
Reviewed by:	bde, emaste
Approved by:	bde, emaste (src committers)
Differential Revision:	https://reviews.freebsd.org/D9615
2017-02-18 21:08:09 +00:00
Andrey V. Elsukov
fbed6d606a For translated packets do not adjust UDP checksum if it is zero.
In case when decrypted and decapsulated packet is an UDP datagram,
check that its checksum is not zero before doing incremental checksum
adjustment.

Reported by:	Eugene Grosbein
Tested by:	Eugene Grosbein
2017-02-18 19:53:37 +00:00
Gleb Smirnoff
dc3c93a954 Fix the last case when kldload(8) wasn't printing the name of the module
that failed to load.
2017-02-18 18:57:29 +00:00
Ian Lepore
da1b1e8eca Add dtb files for Boundary Devices Nitrogen 6 family boards. FreeBSD runs
on a nitrogen6x quad 2gb, and is expected to run on all the imx6 boards in
the nitrogen6 family.
2017-02-18 18:31:42 +00:00
Ian Lepore
2f45dab71f Add definitions for the IEEE-1588 registers. 2017-02-18 18:27:28 +00:00
Ian Lepore
5002d69f9b Change the naming of imx{5,6} gpio pins to exactly match the names used in
the chip reference manuals: GPIOn_IOnn.
2017-02-18 18:24:03 +00:00
Edward Tomasz Napierala
6a27a9f64e Make fsck(8) default to "ufs", like eg mount(8) does.
Approved by:	imp
Discussed with:	kib
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D9621
2017-02-18 11:43:13 +00:00
Dmitry Chagin
dddb7e7f25 Style(9), some XXX comments fix. No functional changes.
MFC after:	1 week
2017-02-18 10:01:17 +00:00
Dmitry Chagin
fa580e65c4 Initialize cap_rights before use.
MFC after:	1 week
2017-02-18 09:39:20 +00:00
Dmitry Chagin
56fba8e66b Finich r313684.
Convert linux_recv(), linux_send() and linux_accept() system call arguments
to the register_t type too.

PR:		217161
MFC after:	3 days
xMFC with:	r313284,r313285,r313684
2017-02-18 07:21:50 +00:00
Luiz Otavio O Souza
959bd29aa8 Spell VMXNET3_LEGACY_TX correctly.
Obtained from:	pfSense
MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC (Netgate)
2017-02-18 06:18:14 +00:00
Alexander Motin
46511441fb Change XCOPY memory allocations.
Before this change XCOPY code could allocate memory in chunks up to 16-32MB
(VMware does XCOPY in 4MB chunks by default), that could be difficult for
VM subsystem to do due to KVA fragmentation, that sometimes created huge
allocation delays, blocking any I/O for respective LU for that time.

This change limits allocations down to TPC_MAX_IO_SIZE, which is 1MB now.
1MB is also not a cookie, but ZFS also can do that for large blocks, so
it should be less dramatic.  As drawback this increases CPU overhead, but
it still look acceptable comparing to time consumed by ZFS read/write.

MFC after:	1 week
2017-02-18 06:03:16 +00:00
Bryan Drewery
8e31b510b0 Fix panic with unlocked vnode to vrecycle().
MFC after:	2 weeks
2017-02-18 05:07:53 +00:00
Mateusz Guzik
a24c8eb847 mtx: plug the 'opts' argument when not used 2017-02-18 01:52:10 +00:00
Bryan Drewery
68a558eca2 xdev: Fix after libc++ update in r300873.
The xdev build needed the same fixes as libcompat and external toolchain
support needed for handling of --sysroot, -L, -B, etc.

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-02-18 00:08:13 +00:00
Andriy Voskoboinyk
ce017db11c iwi, ral, zyd: fix possible use-after-free.
MFC after:	5 days
2017-02-17 23:20:22 +00:00
Bryan Drewery
e36b831f4b xdev: Build yacc which is needed for recent libpcap updates.
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-02-17 22:51:34 +00:00
Bryan Drewery
9e580940c1 META_MODE+xdev: Don't rebuild build-tools during normal build.
See r297997 for more information.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-02-17 22:51:21 +00:00
Konstantin Belousov
83ebde953c Rely on CPUID feature only to enable attaching. MTRR are architectural
and there is no reason to check cpu family or vendor.

Noted by:   royger
Reviewed by: jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D9657
2017-02-17 22:50:41 +00:00
Konstantin Belousov
befb38bf9a smp_rendezvous() works for UP case as well, reduce duplicated
code.  Also fix cast and remove unneeded XXX in comment.

Noted and reviewed by: jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D9657
2017-02-17 22:49:52 +00:00
Mateusz Guzik
936a2c763e sx: fix mips builld after r313855
The namespace in this file really needs cleaning up. In the meantime
let inline primitives be defined as long as LOCK_DEBUG is not enabled.

Reported by:	kib
2017-02-17 22:09:55 +00:00
Sean Bruno
9c030a21d0 Push max_frame_len back into iflib so that jumbo frame sizes work.
Reported by:	pho
2017-02-17 21:30:16 +00:00
Brooks Davis
621c56330d Enable capsicum on MALTA kernels.
This adds less that 10K to the kernel and should probably be done in the
other std.* configs.
2017-02-17 21:25:24 +00:00
Konstantin Belousov
b1fa987835 Merge i386 and amd64 mtrr drivers.
Reviewed by:	royger, jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D9648
2017-02-17 21:08:32 +00:00
Pedro F. Giffuni
b624457280 ext2fs: Remove unused assignment.
Value is re-assigned a few lines later without being read.

Found by:	Clang static analyzer
MFC after:	1 week
2017-02-17 20:56:43 +00:00
Kenneth D. Merry
e9200a6cc2 Make ctl(4) build with CTL_IO_DELAY defined.
sys/cam/ctl/ctl.c:
	In ctl_datamove(), inside CTL_IO_DELAY, add a lun variable and fill
	it in before trying to dereference it.

MFC after:	3 days
Sponsored by:	Spectra Logic
2017-02-17 20:15:27 +00:00
Kenneth D. Merry
492a2ef556 Add task attribute support to camcontrol(8).
Users can use the new generic argument, -Q task_attr, to specify a task
attribute (simple, ordered, head of queue, aca) for the commands issued.
The the default is simple, which works with all SCSI devices that support
tagged queueing.

This will mostly be useful for debugging target behavior in certain
situations.

You can try it out by compiling CTL with CTL_IO_DELAY turned on (in
sys/cam/ctl/ctl_io.h) and then do something like this with one of the CTL
LUNs:

ctladm delay 0:0 -l done -t 10
camcontrol tur da34 -v

And at then before the 10 second timer is up, in another terminal:

camcontrol inquiry da34 -Q ordered -v

The Inquiry should complete just after the TUR completes.  Ordinarily
it would complete first because of the delay injection, but because the
task attribute is set to ordered in this case, CTL holds it up until the
previous command has completed.

sbin/camcontrol/camcontrol.c:
	Add the new generic argument, -Q, which allows the user to specify
	a SCSI task attribute.  The user can specify task attributes by
	name or numerically.

	Add a new task_attr arguments to SCSI sub-functions.

sbin/camcontrol/attrib.c,
sbin/camcontrol/camcontrol.h,
sbin/camcontrol/fwdownload.c,
sbin/camcontrol/modeedit.c,
sbin/camcontrol/persist.c,
sbin/camcontrol/timestamp.c,
sbin/camcontrol/zone.c:
	Add the new task_attr argument to SCSI sub-functions.

sbin/camcontrol/camcontrol.8:
	Document the new -Q option, and add an example.

Sponsored by:	Spectra Logic
MFC after:	1 week
2017-02-17 20:04:22 +00:00
Sean Bruno
9264dd40b6 Update OLD_DIRS for various targets so that some of the branches of
directories are pruned when the appropriate knobs are turned.

Specifically, turning off bsdconfig, locales, examples, i18n, man,
ntp, syscons.  It may not seem like a lot, but it helps when trying
to keep an x86 image under 96MB for MFSRoot netbooting.

Reviewed by:	ngie
Differential Revision:	https://reviews.freebsd.org/D9558
2017-02-17 20:02:40 +00:00
Pedro F. Giffuni
759a9a9d24 sort(1): Remove unneeded initializations.
Found by:	Clang static analyzer
2017-02-17 19:53:20 +00:00
Adrian Chadd
109e2d29cc [asmc] Add support for MacBook Pro 11,2
This patch will add support for MacBookPro 11.2.
For the macros, the MBP11_* macros (for the existing MacBookPro11.3) did not
match so they have been renamed to MBP113_* and a new MBP112_* has been
added (modified copy of MBP11_*).

Some trailing whitespaces may have been removed automatically.

PR:		kern/214836
Obtained from:	Johannes Lundberg <johannes@brilliantservice.co.jp
2017-02-17 18:49:18 +00:00
Josh Paetzel
aedc925301 MVF: 313876
7504 kmem_reap hangs spa_sync and administrative tasks

illumos/illumos-gate@405a5a0f5c
https://github.com/illumos/illumos-gate/commit/405a5a0f5c3ab36cb76559467d1a62ba648bd80

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

  We see long spa_sync(). We are waiting to hold dp_config_rwlock for writer. Some
  other thread holds dp_config_rwlock for reader, then calls arc_get_data_buf(),
  which finds that arc_is_overflowing()==B_TRUE. So it waits (while holding
  dp_config_rwlock for reader) for arc_reclaim_thread to signal arc_reclaim_waiters_cv.
  Before signaling, arc_reclaim_thread does arc_kmem_reap_now(), which takes ~seconds.

Author: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
2017-02-17 17:52:12 +00:00
Mateusz Guzik
cbebea4e67 mtx: get rid of file/line args from slow paths if they are unused
This denotes changes which went in by accident in r313877.

On most production kernels both said parameters are zeroed and have nothing
reading them in either __mtx_lock_sleep or __mtx_unlock_sleep. Thus this change
stops passing them by internal consumers which this is the case.

Kernel modules use _flags variants which are not affected kbi-wise.
2017-02-17 15:40:24 +00:00
Mateusz Guzik
09f1319acd mtx: restrict r313875 to kernels without LOCK_PROFILING 2017-02-17 15:34:40 +00:00
Josh Paetzel
91c038e77a 7504 kmem_reap hangs spa_sync and administrative tasks
illumos/illumos-gate@405a5a0f5c
https://github.com/illumos/illumos-gate/commit/405a5a0f5c3ab36cb76559467d1a62ba648bd80

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

  We see long spa_sync(). We are waiting to hold dp_config_rwlock for writer. Some
  other thread holds dp_config_rwlock for reader, then calls arc_get_data_buf(),
  which finds that arc_is_overflowing()==B_TRUE. So it waits (while holding
  dp_config_rwlock for reader) for arc_reclaim_thread to signal arc_reclaim_waiters_cv.
  Before signaling, arc_reclaim_thread does arc_kmem_reap_now(), which takes ~seconds.

Author: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
2017-02-17 15:00:13 +00:00
Mateusz Guzik
7640beb920 mtx: microoptimize lockstat handling in __mtx_lock_sleep
This saves a function call and multiple branches after the lock is acquired.
2017-02-17 14:55:59 +00:00
Mateusz Guzik
57abbcd5ad Make inline lockstat checks just inspect lockstat_enabled
There is no correctness issue and this lets the kernel just test one typically
false variable.
2017-02-17 14:05:57 +00:00
Michal Meloun
d98d230378 Publish fp[get][set]sticky() for ARMv6.
Although fp[get][set]sticky() functions are obsolete, they are still
required for GNU fortran49 library.

MFC after: 2 months
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D9634
2017-02-17 13:49:46 +00:00
Hans Petter Selasky
269d8c86e9 Implement GFP_DMA32 flag in the LinuxKPI.
Define all FreeBSD native GFP bits as GFP_NATIVE_MASK.

Obtained from:		kmacy @
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-02-17 13:31:11 +00:00
Roger Pau Monné
43b00aeb88 x86: fix MTRR initialization if EARLY_AP_STARTUP is used
MTRR handlers are set in {amd64/i686}_mem_drvinit, which is called at
SI_SUB_DRIVERS, and that's too late when EARLY_AP_STARTUP is set because APs
have already started at this point. {amd64/i686}_mrinit is also called too late
for the BSP, since that happens when the memory device is attached, also after
APs have already started.

Move the position to SI_SUB_CPU, and also initialize the state for the BSP, so
that the APs can correctly get to the same state as the BSP.

Sponsored by:		Citrix Systems R&D
MFC after:		1 week
Reviewed by:		jhb, kib
Differential Revision:	https://reviews.freebsd.org/D9630
2017-02-17 12:47:51 +00:00
Baptiste Daroussin
02db5d1d66 Use full name for the month
Reported by:	brueffer
2017-02-17 11:31:27 +00:00
Baptiste Daroussin
0150ca6914 Also add vsevolod@ in the authors 2017-02-17 11:26:03 +00:00
Baptiste Daroussin
9a00b6c855 Add history and Authors section in the manpage
Submitted by:	dteske
MFC after:	2 days
Differential Revision:	https://reviews.freebsd.org/D9419
2017-02-17 11:17:56 +00:00
Michal Meloun
cd9bdb7362 Publish __aeabi_uidiv and __aeabi_idiv as compatible symbols from libc.
Due to bug[1] in libcompiler_rt, all symbols declared by
DEFINE_AEABI_FUNCTION_ALIAS() are not hidden. All these but two
are explicitly exported from libc and don't causes problems.

Remaining two, __aeabi_uidiv and __aeabi_idiv, infecting all
non-versioned shared libraries. And these symbols are consumed
by many (if not all) packages[2].

As workaround, export these from libc as compatible symbols,
in global namespace. With this, these are still visible for
rtld, but static linker doesn't use then.

[1]
DEFINE_AEABI_FUNCTION_ALIAS() macro uses '.set' directive for
declaration of aliased symbol. Unfortunately, '.set' doesn't
inherit visibility of base symbol, and macro don't explicitly
sets visibility for aliased one.

[2]
Given symbols are exported from non-versioned libraries only if
library itself uses them. So, if world is built for CPU with
HW divide, these function are not used and given symbols are
not exported. By this, contents of these libraries is not stable,
and all packages fails to run.

Note: Due to r313823 I'm forced to commit this too early, without
leave enough time for proper review.

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D9632
2017-02-17 11:16:19 +00:00
Mateusz Guzik
0108a98012 sx: fix compilation on UP kernels after r313855
sx primitives use inlines as opposed to macros. Change the tested condition
to LOCK_DEBUG which covers the case, but is slightly overzelaous.

Reported by:	kib
2017-02-17 10:58:12 +00:00