Commit graph

239879 commits

Author SHA1 Message Date
Justin Hibbits f476f0add8 Revert r344675
It's an incorrect approach to solve the problem.  We already have a
fdt/fdt_slicer module, it just needs to be wired into the build.
2019-03-01 02:08:12 +00:00
Conrad Meyer 3948ad29e9 cxgb(4): Netdump: only reference allocated qsets
SGE_QSETS is an upper bound -- fewer qsets may be allocated depending on
the number of CPUs.

Reviewed by:	markj, np, vangyzen
X-MFC-With:	r333288
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D17274
2019-03-01 01:57:22 +00:00
Kyle Evans ef30b5a809 patch(1): Exit successfully if we're fed a 0-length patch
This change is made in the name of GNU patch compatibility. If GNU patch is
fed a zero-length patch, it will exit successfully with no output. This is
used in at least one port to date (comms/wsjtx), and we break on this usage.

It seems unlikely that anyone relies on patch(1) calling their completely
empty patch garbage and failing, and GNU compatibility is a plus if it helps
with porting, so make the switch.

Reported by:	db
MFC after:	2 weeks
2019-03-01 01:20:21 +00:00
Marcin Wojtas e3431664df Prevent detaching driver if the attach is not finished
When the device is in attaching state, detach should return
EBUSY instead of success. In other case, there could be race
between attach and detach during the driver unloading.

If driver goes sleep and releases GIANT lock during attaching,
unloading module could start. In such case when attach continues
after module unload, page fault "supervisor read instruction,
page not present" occurred.

This patch works around the real issue, which is a locking
deficiency of the busses.

Submitted by: Rafal Kozik <rk@semihalf.com>
Reviewed by: imp
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D19375
2019-03-01 01:18:39 +00:00
Justin Hibbits c8e720aaae GEOM: Add fdt_slicer to the GEOM flashmap module for fdt-based platforms
geom_flashmap depends on a slicer being available in order to do any
work.  On fdt platforms this is provided by fdt_slicer, but this needs
to be available.  Often it's compiled into the kernel for platforms that
boot from the relevant media, but this is not always the case.  Add the
file to the geom_flashmap module so that it can be used on platforms
which don't always need this functionality available.
2019-02-28 23:00:47 +00:00
John Baldwin d18e541983 Don't assume all children of a nexus are ports.
Specifically, ccr(4) devices are also children of cxgbe nexus devices.
Rather than making assumptions about the child device's softc, walk
the list of ports from the nexus' softc to determine if a child is a
port in t4_child_location_str().  This fixes a panic when detaching a
ccr device.

Reviewed by:	np
MFC after:	1 week
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D19399
2019-02-28 22:10:19 +00:00
Mark Johnston 2b64ab22e8 Allow FIONBIO and FIOASYNC ioctls on POSIX shm descriptors.
They have no effect, as with filesystem file descriptors.
This improves compatibility with some existing userspace code.

Submitted by:	Greg V <greg@unrelenting.technology>
Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D19330
2019-02-28 22:00:36 +00:00
Alexander Motin 1f8c4546a8 Limit 24xx adapters to only MSI interrupts by default.
This was actually the known good configuration we used before.
Single MSI-X configuration doesn't even work there on my tests, just due
to lack of documentation not sure whether by design or I am doing something
wrong.

PR:		233654
MFC after:	1 week
2019-02-28 21:07:16 +00:00
Bryan Drewery 2e881c1ae3 bsd.nls.mk isn't optional.
It is protected by MK_NLS.  If it should really be optional then
it needs to be documented as such in share/mk/bsd.README and
.sinclude used where needed.

This fixes a regression from r335011.

PR:		232527
Submitted by:	jarrod@downtools.com.au
Reported by:	ktullavik@gmail.com
MFC after:	3 days
2019-02-28 20:48:18 +00:00
Tom Rhodes bdf56516d2 Grammar tweaks in ipfw manual page. 2019-02-28 20:43:03 +00:00
Konstantin Belousov bced332adf Invalidate cache for the PDPTE page when using PAE paging but PAT is
not supported.

According to SDM rev. 69 vol. 3, for PDPTE registers loads:
- when PAT is not supported, access to the PDPTE page is performed as
  UC, see 4.9.1;
- when PAT is supported, the access is WB, see 4.9.2.

So potentially CPU might load stale memory as PDPTEs if both PAT and
self-snoop are not implemented.  To be safe, add total local cache
flush to pmap_cold() before initial load of cr3, and flush PDPTE page
in pmap_pinit(), if PAT is not implemented.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D19365
2019-02-28 19:19:02 +00:00
Enji Cooper 1ece6232d2 Remove references to pdwait4(2) and CAP_PDWAIT from rights(4)
@cem removed references to pdwait4(2) (a nonexistent syscall) in
r320058.

This change removes references to pdwait4(2) and `CAP_PDWAIT` in
rights(4) to not mislead the user into thinking that pdwait4(2)/`CAP_PDWAIT` is
actually implemented in the stock FreeBSD kernel.

The goal of this functionality was to simplify monitoring/manipulating
processes started with `pdfork`, et al, and avoid races with waiting on pids.
The syscall was never completed though--just discussed on the capsicum mailing
list back in 2015:
https://lists.cam.ac.uk/pipermail/cl-capsicum-discuss/2015-May/msg00012.html
. That being said, there are members of the project (@rwatson, etc) who
have longterm goals to implement this syscall to better secure pdfork(2)
calls.

PR:		235871
Reviewed by:	emaste
Discussed with:	rwatson
Approved by:	emaste (mentor)
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D18950
2019-02-28 18:12:14 +00:00
Alexander Motin 8ebb14b1c6 Limit 24xx adapters to only one MSI-X interrupt by default.
These are 4Gb/s and pretty old and slow now, so I see no reason to fight
for their performance over stability.

PR:		233654
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
2019-02-28 15:36:03 +00:00
Alexander Motin 17ec774693 Add to isp(4) tunables to limit MSI/MSI-X usage.
There are some problem reports possibly related to the new driver use of
multiple interrupts on older cards.  Hopefully this allow to workaround
them.

MFC after:	1 week
Sponsored by:	iXsystems, Inc.
2019-02-28 15:24:00 +00:00
Andrew Turner 01a8235ea6 Add the hw.ncpu tunable to arm64.
This allows us to limit the number of CPUs to use, e.g. to debug problems
seen when enabling multiple clusters.

Reviewed by:	manu
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D19404
2019-02-28 14:40:43 +00:00
Thomas Munro b5eab9d461 truss: Add support for fsync(2) and fdatasync(2).
The default handling showed the argument as hex.  Add explicit handling so
we can show it as decimal, since that's how we show file descriptors
everywhere else.

Approved by:	mjg (mentor)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D19295
2019-02-28 09:13:41 +00:00
Navdeep Parhar a098959032 cxgbe(4): Request high priority filter support explicitly, as required
by recent firmwares.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2019-02-28 05:45:14 +00:00
Warner Losh e96f6eda1b Add SPDX tag. 2019-02-28 02:29:48 +00:00
Mateusz Guzik 55fda58146 Rename seq to seqc to avoid namespace clashes with Linux
Linux generates the content of procfs files using a mechanism prefixed with
seq_*. This in particular came up with recent gcov import.

Sponsored by:	The FreeBSD Foundation
2019-02-27 22:56:55 +00:00
Mateusz Guzik 75d6d57634 vm: remove seq.h inclusion made obsolete by NUMA rewrite
Sponsored by:	The FreeBSD Foundation
2019-02-27 22:42:29 +00:00
Eric Joyner 6c3510414b ixgbe(4): Fix panic triggered by assertion from interrupt
r344162 exposed a bug in one of ixgbe's interrupt filters; they are never
supposed to return 0. Fix the interrupt filter to return the proper nonzero
return value.

Reported by:	Oleg Ginzburg <olevole@olevole.ru>
MFC after:	1 week
Sponsored by:	Intel Corporation
2019-02-27 22:26:18 +00:00
Warner Losh 45d7e233a5 Unconditionally support unmapped BIOs. This was another shim for
supporting older kernels. However, all supported versions of FreeBSD
have unmapped I/Os (as do several that have gone EOL), remove it. It's
unlikely the driver would work on the older kernels anyway at this
point.
2019-02-27 22:16:59 +00:00
Warner Losh d706306d49 Remove #ifdef code to support FreeBSD versions that haven't been
supported in years. A number of changes have been made to the driver
that likely wouldn't work on those older versions that aren't properly
ifdef'd and it's project policy to GC such code once it is stale.
2019-02-27 22:05:01 +00:00
Emmanuel Vadot 709958c070 Fix armv6/armv7 build after the move from xhci_mv to generic_xhci 2019-02-27 22:01:39 +00:00
Warner Losh 43b5e40d3c Remove empty directories. 2019-02-27 21:52:08 +00:00
Alexander Motin 321f819ba5 Refactor command ordering/blocking mechanism in CTL.
Replace long per-LUN queue of blocked commands, scanned on each command
completion and sometimes even twice, causing up to O(n^^2) processing cost,
by much shorter per-command blocked queues, scanned only when respective
command completes, and check only commands before the previous blocker,
reducing cost to O(n).

While there, unblock aborted commands to make them "complete" ASAP to be
removed from the OOA queue and so not waste time ordering other commands
against them.  Aborted commands that were not sent to execution yet should
have no visible side effects, so this is safe and easy optimization now,
comparing to commands already in processing, which are a still pain.

Together those two optimizations should fix quite pathological case, when
due to backend slowness CTL accumulated many thousands of blocked requests,
partially aborted by initiator and so supposedly not even existing, but
still wasting CTL CPU time.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2019-02-27 21:29:21 +00:00
Emmanuel Vadot dec9dcabf8 drm: Remove empty directories
Discussed with:	  imp
2019-02-27 21:11:13 +00:00
Emmanuel Vadot 7032095101 xhci_mv: Move the driver to generic_xhci
Marvell XHCI is in fact generic-xhci, so move the driver and
add the compatible string.
While here, get and enable the phy if the dtb provide one.
The xhci bindings state that phys should be in a 'phys' property but
Marvell DTS uses 'usb-phy', only add support for 'usb-phy' for now.

Sponsored-by:      Rubicon Communications, LCC ("Netgate")
2019-02-27 21:04:40 +00:00
Emmanuel Vadot aa7c3aa6fa usb_nop_xceiv: Add support for this pseudo device
This is a "fake" phy that handle regulator, clocks and reset gpio.
Only clock and regulator is supported for now.

Sponsored-by:      Rubicon Communications, LCC ("Netgate")
2019-02-27 20:52:35 +00:00
John Baldwin dbcc200058 Various cleanups to the management of multiple TCP stacks.
- Use strlcpy() with sizeof() instead of strncpy().

- Simplify initialization of TCP functions structures.

  init_tcp_functions() was already called before the first call to
  register a stack.  Just inline the work in the SYSINIT and remove
  the racy helper variable.  Instead, KASSERT that the rw lock is
  initialized when registering a stack.

- Protect the default stack via a direct pointer comparison.

  The default stack uses the name "freebsd" instead of "default" so
  this protection wasn't working for the default stack anyway.

Reviewed by:	rrs
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D19152
2019-02-27 20:24:23 +00:00
John Baldwin 62c47c7f6c Update review requests for bhyve.
- Explicitly mention the #bhyve group on Phabricator.
- Request reviews of the userland components (libvmmapi, bhyve,
  bhyvectl, and bhyveload).

Reviewed by:	imp, rgrimes
Differential Revision:	https://reviews.freebsd.org/D17848
2019-02-27 20:09:58 +00:00
Sean Eric Fagan 247f5bd056 Have cryptocheck toggle kern.cryptodevallowsoft if necessary (this
requires root access).

Reviewed by:	cem, jhb
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D19372
2019-02-27 19:27:16 +00:00
Mark Johnston ee74c3327a rtsol: Use vwarnx(3) to log messages to standard error.
This ensures that the program name is included in the output, which
makes it easy to identify the source of error messages printed
during boot.

MFC after:	1 week
2019-02-27 18:13:41 +00:00
Ed Maste d95826c43d poll.2: POLLNVAL is returned also for insufficient rights
Reported by:	"Bora Özarslan" <borako.ozarslan@gmail.com>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2019-02-27 17:52:22 +00:00
Emmanuel Vadot ca28db3cd8 mmc: dwmmc: Match on "rockchip,rk3288-dw-mshc" compatible
This is the common denominator for rockchip compatible from RK3288 to RK3399.
The other compatible are generally present in the DTS but the controllers
are the same.

MFC after:	1 week
2019-02-27 17:30:28 +00:00
Emmanuel Vadot 722b978677 arm64: rockchip: rk3399_clk: Add sd clock definitions
MFC after:	1 week
2019-02-27 17:29:38 +00:00
Emmanuel Vadot 3a17f3007e arm64: rockchip: clk_pll: Multiple improvement
Remove the mode_val from the clock definition as it's a bit unreadable.
Use mode_shift to represent which bit control the mode in the register.
Simplify some case where we can avoid a register read before changing it.
Set the PLL back to normal mode after the PLL have stabilized.

Discussed with:	 mmel
MFC after:	1 week
2019-02-27 14:20:28 +00:00
Baptiste Daroussin e7be6f4ed4 Fix a regression introduced in r344569
Import a fix from illumos (thanks Toomas Soomas for pointing at it)

See https://www.illumos.org/issues/10205 for more details
Illumos commit: 247b7da039

Submitted by:	jack@gandi.net
Reported by:	cy
Reviewed by:	tsoome, cy, bapt
Obtained from:	Illumos
2019-02-27 13:49:41 +00:00
Leandro Lupori 7e4520854c Fix kldxref on PowerPC64
When using kldxref on kernel modules built with clang8 + lld8,
kldxref would be unable to find the modules metadata information,
because PowerPC64 was using the ef_nop.c implementation of
ef_reloc().

When GNU LD was used, it was also relocating the metadata section of
the .ko file. LLD does not do this, but only generate dynamic
relocations for it. With minor changes, ef_powerpc.c can now work
for PowerPC64 too.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D19370
2019-02-27 13:24:42 +00:00
Baptiste Daroussin c7851c5b7c Fix regression introduced in r344569
Reported by:	cy
Tested by:	cy
Submitted by:	Fatih Acar <fatih@gandi.net>
2019-02-27 07:55:53 +00:00
Navdeep Parhar 01869797b7 libcxgb4: Don't spam stderr. Write combining is not enabled by default
by the FreeBSD driver.
2019-02-27 06:50:24 +00:00
Ian Lepore a6bcabcd06 Add support to fdt_slicer for the new style partition data documented in
devicetree/bindings/mtd/partition.txt.

In the old style, all the children of the device node which did not have a
compatible property were the partitions.  In the new style, there is a child
node of the device which has a compatible string of "fixed-partitions", and
its children are the individual partitions.

Also, support the read-only property by setting the corresponding slice flag.
2019-02-27 04:58:18 +00:00
Ian Lepore 85f55a2a97 Child nodes with a compatible property are not slices, according to the
devicetree/bindings/mtd/partitions.txt document, so just ignore them.
2019-02-27 04:19:29 +00:00
Ian Lepore db58d718e9 Rename some functions and variables to have shorter names, which allows
unwrapping multiple lines of code.  Also, convert some short multiline
comments into single-line comments.  Change old-school FALSE to false.

All in all, no functional changes, it's just more compact and readable.
2019-02-27 04:16:32 +00:00
Justin Hibbits 0d69f00b4d powerpc/mpc85xx: Synchronize timebase the platform correct way
Summary:
To safely synchronize timebase we need to disable the timebase on all
cores, set timebase, and resynchronize.  This adds two new devices, mutually
exclusive, which attach on the SoC simplebus, to freeze and unfreeze the
timebase.  The devices are singletons, and platform-specific, so no reason
to make them optional and in separate files.

This was found to be necessary for top(1) to work correctly on an AmigaOne
X5000 (P5020 SoC).  It also fixes bufdaemon and bufspacedaemon hangs at
shutdown.

Test Plan: Regression test on various Book-E hardware.

Reviewed by:	nwhitehorn
Tested by:	Brandon Bergren (git_bdragon.rtk0.net)
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D19208
2019-02-27 03:30:49 +00:00
Ian Lepore 33ec975b20 Add a module dependency on fdt_slicer. Also, move the PNP_INFO to its more
usual location, down near the DRIVER_MODULE() stuff.
2019-02-26 22:52:41 +00:00
Ian Lepore fb4f7d70c1 Add a module dependency on fdt_slicer. 2019-02-26 22:52:08 +00:00
Ian Lepore 5a978eadf7 Add manpages for at45d(4) and mx25l(4). 2019-02-26 22:50:01 +00:00
Ian Lepore 4e46217874 Make it possible to load fdt_slicer as a module (unloading works too fwiw). 2019-02-26 22:34:29 +00:00
Ian Lepore f2f497c6fe Update a comment to reflect reality; no functional changes. 2019-02-26 22:07:59 +00:00