Commit Graph

232988 Commits

Author SHA1 Message Date
Brooks Davis
c2decc35c8 Support -DNO_CLEAN builds across r334223+r334224. 2018-05-25 20:42:28 +00:00
Brooks Davis
659a2e9243 Regen after r334223: make vadvise compat freebsd11. 2018-05-25 20:41:26 +00:00
Brooks Davis
7351a8bdb5 Make vadvise compat freebsd11.
The vadvise syscall (aka ovadvise) is undocumented and has always been
implmented as returning EINVAL.  Put the syscall under COMPAT11 and
provide a userspace implementation.

Reviewed by:	kib
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D15557
2018-05-25 20:40:23 +00:00
Matt Macy
9379029a92 rtrequest1_fib: we need to always bump the ifaddr refcount when we take a reference from
an rtentry. r334118 introduced a case when this was not done.

While we're here make the intent more obvious by moving the refcount
bump down to when we know we'll actually need it.

Reported by:	markj
2018-05-25 19:48:26 +00:00
Mark Felder
75a315f6d2 rc.subr: Support loading environmental variables from a file
The current support for setting environment via foo_env="" in rc.conf is
not scalable and does not handle envs with spaces in the value. It seems
a common pattern for some newer software is to skip configuration files
altogether and rely on the env. This is well supported in systemd unit
files and may be the inspiration for this trend.

MFH:		1 week
Differential Revision:	https://reviews.freebsd.org/D14453
2018-05-25 19:36:26 +00:00
Marcelo Araujo
13ee81bed5 We don't need check if str is NULL as free(3) will handle NULL
argument.

Reported by:	kib@
2018-05-25 19:12:30 +00:00
Ilya Bakulin
d3a60796db Fix building GENERIC-MMCCAM on arm64
Since GENERIC includes quite a few drivers now, all MMC drivers should have
appropriate MMCCAM-related ifdefs and include opt_mmccam.h so that
those ifdefs are actually processed correctly.

Reviewed by:	manu
Approved by:	imp (mentor)
Differential Revision:	https://reviews.freebsd.org/D15569
2018-05-25 19:00:28 +00:00
Navdeep Parhar
c3fce948fb cxgbe(4): Suppress a warning about code that is used only with options
RATELIMIT.

Reported by:	mmacy@
2018-05-25 18:57:41 +00:00
Marcelo Araujo
635a2c892c After a long discussion about assert(3), we gonna use a HardenedBSD
approach to chek strdup(3) memory allocation.

Submitted by:	Shaw Webb <shawn.webb@hardenedbsd.org>
Reported by:	brooks
Obtained from:	HardenedBSD
2018-05-25 18:54:40 +00:00
Sean Bruno
e22ee9b247 pmcstat(8)
- Document per thread filtering.

Submitted by:	kbowling
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D15549
2018-05-25 18:11:13 +00:00
Ed Maste
097f721b80 if_muge: Use lock assertion instead of broken locking in lan78xx_chip_init
Previously lan78xx_chip_init locked the driver's mutex if not already
locked, but unlocked it only in the case of error.  This provided a
fairly clear indication that the function is already called with the
lock held, so just replace it with a lock assertion.

Sponsored by:	The FreeBSD Foundation
2018-05-25 17:31:43 +00:00
Ed Maste
c0134460fc if_muge: connect module to the build
Supported Microchip devices:
- LAN7515 USB 2 hub and gigabit Ethernet controller w/ PHY
- LAN7800 USB 3.0 gigabit Ethernet controller w/ PHY

The LAN7515 is the Ethernet controller on the Raspberry Pi 3 B+.

This driver has some TODO items outstanding, but basic functionality
works.

Sponsored by:	The FreeBSD Foundation
2018-05-25 17:29:29 +00:00
Konstantin Belousov
ded29bd9a5 Optimize i386 pmap_extract_and_hold().
In particular, stop using pmap_pte() to read non-promoted pte while
walking the page table.  pmap_pte() needs to shoot down the kernel
mapping globally which causes IPI broadcast.  Since
pmap_extract_and_hold() is used for slow copyin(9), it is very
significant hit for the 4/4 kernels.

Instead, create single purpose per-processor page frame and use it to
locally map page table page inside the critical section, to avoid
reuse of the frame by other thread if context switched.

Measurement demostrated very significant improvements in any load that
utilizes copyin/copyout.

Found and benchmarked by:	bde
Sponsored by:	The FreeBSD Foundation
2018-05-25 16:29:22 +00:00
Konstantin Belousov
feac1d4808 Cleanup. Remove unused instruction and label.
Tested by:	bde
Sponsored by:	The FreeBSD Foundation
2018-05-25 16:24:20 +00:00
Bjoern A. Zeeb
e76bd38065 Extend show proc with reaper, sigparent, and vmspace information
I have regularly needed the last couple of months.

Sponsored by:	iXsystems, Inc.
2018-05-25 13:59:48 +00:00
Eitan Adler
bd67d6b2b1 rctl: correct use of "vmem" instead of "vmemoryuse"
Submitted by:	Jamie Landeg-Jones <jamie@catflap.org>
PR:		228482
MFC after:	1 month
2018-05-25 13:40:07 +00:00
Eitan Adler
fe9fbe221d Add time2posix and posix2time to time.h
These are documented in `time2posix.3` but the symbols are not actually
visible. Since these are not POSIX hide them behind _BSD_VISIBLE.

Reviewed by:		wollman
Differential Revision:	https://reviews.freebsd.org/D15530
2018-05-25 13:40:05 +00:00
Gleb Popov
13ab2c5370 Add myself (arrowd) to share/misc/committers-ports.dot
Approved by:	tcberner (mentor)
2018-05-25 11:49:21 +00:00
Roger Pau Monné
69ec6041d2 xen: remove dead code from gnttab.h
This code was left over when it was imported from Linux. The original
committer thought that those functions would be implemented, so the
prototypes where left in place. Delete them at once.

Submitted by:		pratyush
Reviewed by:		royger
Differential Review:	https://reviews.freebsd.org/D15553
2018-05-25 08:44:00 +00:00
Andriy Gapon
279be68bfd re-synchronize TSC-s on SMP systems after resume, if necessary
The TSC-s are checked and synchronized only if they were good
originally.  That is, invariant, synchronized, etc.

This is necessary on an AMD-based system where after a wakeup from STR I
see that BSP clock differs from AP clocks by a count that roughly
corresponds to one second.  The APs are in sync with each other.  Not
sure if this is a hardware quirk or a firmware bug.

This is what I see after a resume with this change:
    SMP: passed TSC synchronization test after adjustment
    acpi_timer0: restoring timecounter, ACPI-fast -> TSC-low

Reviewed by:	kib
MFC after:	3 weeks
Differential Revision: https://reviews.freebsd.org/D15551
2018-05-25 07:33:20 +00:00
Andriy Gapon
620b779158 fix zfs_getpages crash when called from sendfile, followup to r329363
It turns out that sendfile_swapin() has an optimization where it may
insert pointers to bogus_page into the page array that it passes to
VOP_GETPAGES.  That happens to work with buffer cache, because it
extensively uses bogus_page internally, so it has the necessary checks.
However, ZFS did not expect bogus_page as VOP_GETPAGES(9) does not
document such a (ab)use of bogus_page.

So, this commit adds checks and handling of bogus_page.

I expect that use of bogus_page with VOP_GETPAGES will get documented
sooner rather than later.

Reported by:	Andrew Reilly <areilly@bigpond.net.au>, delphij
Tested by:	Andrew Reilly <areilly@bigpond.net.au>
Requested by:	many
MFC after:	1 week
2018-05-25 07:29:52 +00:00
Alexander Motin
f439e3a4ff Refactor NVMe CAM integration.
- Remove layering violation, when NVMe SIM code accessed CAM internal
device structures to set pointers on controller and namespace data.
Instead make NVMe XPT probe fetch the data directly from hardware.
 - Cleanup NVMe SIM code, fixing support for multiple namespaces per
controller (reporting them as LUNs) and adding controller detach support
and run-time namespace change notifications.
 - Add initial support for namespace change async events.  So far only
in CAM mode, but it allows run-time namespace arrival and departure.
 - Add missing nvme_notify_fail_consumers() call on controller detach.
Together with previous changes this allows NVMe device detach/unplug.

Non-CAM mode still requires a lot of love to stay on par, but at least
CAM mode code should not stay in the way so much, becoming much more
self-sufficient.

Reviewed by:	imp
MFC after:	1 month
Sponsored by:	iXsystems, Inc.
2018-05-25 03:34:33 +00:00
Marcelo Araujo
ea089f8c71 Fix a memory leak on topology_parse().
strdup(3) allocates memory for a copy of the string, does the copy and
returns a pointer to it. If there is no sufficient memory NULL is returned
and the global errno is set to ENOMEM.
We do a sanity check to see if it was possible to allocate enough memory.

Also as we allocate memory, we need to free this memory used. Or it will
going out of scope leaks the storage it points to.

Reviewed by:	rgrimes
MFC after:	3 weeks.
X-MFC:		r332298
Sponsored by:	iXsystems Inc.
Differential Revision:	https://reviews.freebsd.org/D15550
2018-05-25 02:07:05 +00:00
Rebecca Cran
13daedc0b7 Remove extra space before parenthesis in src.conf(5)
Reviewed by:	eadler
Differential Revision:	https://reviews.freebsd.org/D15528
2018-05-25 01:38:59 +00:00
Adrian Chadd
a861b06b97 [ath_hal] migrate the shared HAL_RESET_* pieces out into ath_hal.
I'm in the process of reworking how the reset path works with an eye
to better recovery when the chips hang and/or go RF/PHY deaf.
This is the first step in a lot of unification and API changes.
2018-05-25 01:27:39 +00:00
Matt Macy
fc16061f19 MALTA64EL: disable modules until objcopy is fixed 2018-05-24 23:58:57 +00:00
Matt Macy
c82dfce3ec netipsec/!VIMAGE: don't declare/define spdcache_destroy on non-VIMAGE builds
this breaks MIPS compiles in universe
2018-05-24 23:47:27 +00:00
Matt Macy
0f8d79d977 CK: update consumers to use CK macros across the board
r334189 changed the fields to have names distinct from those in queue.h
in order to expose the oversights as compile time errors
2018-05-24 23:21:23 +00:00
Warner Losh
c6f7141fc0 Protect bzero call against macro expansion
Shortly, we'll be moving to defining bzero and memset in terms of
__builting_memset. To do that, we can't have macro calls to bzero in
the fallback impelmentation of memset. Normal calls to bzero are fine.
All 4 architectures that use this have their own copies of bzero, so
there's no mutual recursion issue between memset and bcopy.
2018-05-24 23:20:10 +00:00
Bryan Drewery
920a817c78 Fix exit code for mismatches after r333013.
The -c flag still does the wrong thing versus the older version due to
lack of pipefail support.

Reported by:	antoine
2018-05-24 22:15:47 +00:00
Olivier Houchard
d1f3fb2cb4 Import CK as of commit 0f017230ccc86929f56bf44ef2dca93d7df8076b.
This brings us the renaming of fields in ck_queue, so that our own
LIST/SLIST/TAILQ/etc won't accidentally work with them.
2018-05-24 21:38:18 +00:00
Olivier Houchard
65d045ccf6 Import CK as of commit 0f017230ccc86929f56bf44ef2dca93d7df8076b.
This brings us the renaming of fields in ck_queue, so that our own
LIST/SLIST/TAILQ/etc won't accidentally work with them.
2018-05-24 21:35:52 +00:00
Matt Macy
773015538c libpmcstat: Don't build pmu tables on !amd64 until the corresponding
util routines have been written and tested. Currently building them
breaks the build on power64

Reported by:	emaste
2018-05-24 21:22:03 +00:00
Matt Macy
acf9fd05d8 AF_UNIX: It is possible for UNIX datagram sockets to be connected
to themselves. The updated code assumed that that could not happen
and would try to lock the unp mutex twice.

There may be a lingering issue here but this fixes it for the
reporter.

PR:	228458
Reported by:	marieheleneka at gmail.com
2018-05-24 21:13:46 +00:00
Warner Losh
509b94387a This is no unreferenced, so retire it.
Differential Revision: https://reviews.freebsd.org/D15374
2018-05-24 21:11:38 +00:00
Warner Losh
fb3bfdf186 Make memmove and bcopy share code
Make memmove the primary interface, but have bcopy be an alternative
entry point that jumps into memmove. This will slightly pessimize
bcopy calls, but those are about to get much rarer. Return dst always,
but it will be ignored by bcopy callers. We can remove just the alt
entry point if we ever remove bcopy entirely.

Differential Revision: https://reviews.freebsd.org/D15374
2018-05-24 21:11:33 +00:00
Warner Losh
78a76e3628 Define memmove and make bcopy alt entry point
Make a memmove entry point just before bcopy and have it swap its args
before continuing into the body of bcopy. Adjust the returns to return
dst (original %o0 swapped to %o1) from both entry points. bcopy users
will ignore them. Since these are in the branch delay slot, it should
take no additional time. I use %o6 for this rather than just move %o1
back to %o2 at the end since my sparc64 assembler knowledge is weak.
Also eliminate wrapper call from memmove to bcopy.

Differential Revision: https://reviews.freebsd.org/D15374
2018-05-24 21:11:28 +00:00
Warner Losh
49ab568eff Make memmove an alias for memcpy
memcpy was an alias for bcopy with arg swap. This code handles
overlapping copies, so making memmove an alias is safe. We can
eliminate the call from libkern's memmove to this bcopy as a result.

Differential Revision: https://reviews.freebsd.org/D15374
2018-05-24 21:11:24 +00:00
Alan Cox
d3f8534e99 Eliminate an unused parameter from vm_fault_populate().
Reviewed by:	kib
MFC after:	10 days
2018-05-24 20:43:41 +00:00
Mark Johnston
7bb4634e18 Update r334154 with review feedback from D15490.
An old revision was committed by accident.

Differential Revision:	https://reviews.freebsd.org/D15490
2018-05-24 20:26:37 +00:00
Bryan Drewery
bbec13875a rescue: Restore 'make depend' call to fix WITH_META_MODE after r334008.
The rescue/crunchgen build avoids linking binaries for the objects it is
building by doing 'make foo.o bar.o' rather than 'make all'.  This breaks the
implicit 'beforebuild: depend' dependency which ensured that all source files
were generated and up-to-date before building the object files.  This
manifested as a WITH_META_MODE build problem for bin/sh in the rescue build
with syntax.{c,h} not properly being regenerated or recognized as changed in
the dependency graph.

Sponsored by:	Dell EMC
MFC after:	1 week
Reported by:	many
2018-05-24 18:49:19 +00:00
Brooks Davis
2357535254 Indicate the brk/sbrk are deprecated and not portable.
More firmly suggest mmap(2) instead.

Include the history of arm64 and riscv shipping without brk/sbrk.

Mention that sbrk(0) produces unreliable results.

Reviewed by:	emaste, Marcin Cieślak
MFC after:	3 days
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D15535
2018-05-24 18:32:54 +00:00
Matt Macy
c684c14ce3 AF_UNIX: evidently Samba likes to connect a unix socket to itself, fix locking 2018-05-24 18:22:13 +00:00
Matt Macy
a3a734908b AF_UNIX in connectat unp and unp2 can be the same 2018-05-24 18:22:05 +00:00
Edward Tomasz Napierala
6ad033c2f1 Clarify that USB bus power consumption is measured in mA at 5V.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-05-24 18:02:02 +00:00
Matt Macy
5328b11c95 if_delgroups: add missed unlock introduced by r334118 2018-05-24 17:54:08 +00:00
Ed Maste
0b979e7e8e UPDATING: remove EOL whitespace in 20180523 entry 2018-05-24 17:08:55 +00:00
Conrad Meyer
a0638b33f7 Yank crufty INTR_FILTER option
It was introduced to the tree in r169320 and r169321 in May 2007.

It never got much use and never became a kernel default.  The code
duplicates the default path quite a bit, with slight modifications.  Just
yank out the cruft.  Whatever goals were being aimed for can probably be met
within the existing framework, without a flag day option.

Mostly mechanical change: 'unifdef -m -UINTR_FILTER'.

Reviewed by:	mmacy
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D15546
2018-05-24 17:06:00 +00:00
Brooks Davis
810c4dcddf exect() was removed in 2018, not 2017. 2018-05-24 17:05:41 +00:00
Brooks Davis
758d46cfb0 Don't implement break(2) at all on aarch64 and riscv.
This should have been done when they were removed from libc, but was
overlooked in the runup to 11.0.  No users should exist.

Approved by:	andrew
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D15539
2018-05-24 17:04:27 +00:00