]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoFix compilation of world with WITHOUT_{INET,INET6}_SUPPORT or both set.
bz [Sun, 3 Mar 2019 10:00:26 +0000 (10:00 +0000)]
Fix compilation of world with WITHOUT_{INET,INET6}_SUPPORT or both set.

Buildworld failed when both WITHOUT_INET6_SUPPORT and INET equivalent were set.
Fix netstat and syslogd by applying appropriate #ifdef INET/INET6 to make world
compile again.

Reviewed by: ngie, hrs, ume
Welcomed by: Michael Dexter (D17040)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D19418

5 years agoUse struct addrinfo instead of struct sockaddr_storage
hrs [Sun, 3 Mar 2019 05:30:15 +0000 (05:30 +0000)]
Use struct addrinfo instead of struct sockaddr_storage
to store peer addresses.

5 years agoAdd ABORTED_BY_REQUEST to the list of things we look at DNR bit and tell why to comme...
imp [Sun, 3 Mar 2019 03:36:33 +0000 (03:36 +0000)]
Add ABORTED_BY_REQUEST to the list of things we look at DNR bit and tell why to comment (code already does this)

5 years agoAllow the sector size of the disk device to be configured using hints or
ian [Sat, 2 Mar 2019 23:20:47 +0000 (23:20 +0000)]
Allow the sector size of the disk device to be configured using hints or
FDT data.  The sector size must be a multiple of the device's page size.
If not configured, use the historical default of the device page size.

Setting the disk sector size to 512 or 4096 allows a variety of standard
filesystems to be used on the device.  Of course you wouldn't want to be
writing frequently to a SPI flash chip like it was a disk drive, but for
data that gets written once (or rarely) and read often, using a standard
filesystem is a nice convenient thing.

5 years agoAdd some comments. Give #define'd names to some scattered numbers. Change
ian [Sat, 2 Mar 2019 22:28:43 +0000 (22:28 +0000)]
Add some comments.  Give #define'd names to some scattered numbers.  Change
some #define'd names to be more descriptive.  When reporting a post-write
compare failure, report the page number, not the byte address of the page.
The latter is the only functional change, it makes the number match the
words of the error message.

5 years agoProperly calculate the last used logical block of a file when checking
mckusick [Sat, 2 Mar 2019 21:30:01 +0000 (21:30 +0000)]
Properly calculate the last used logical block of a file when checking
inodes that reference directories. While here tighten the check for
comparing the last logical block with the end of the file.

Reported by:  Peter Holm
Tested by:    Peter Holm
Sponsored by: Netflix

5 years agoThe size of the UFS soft-updates journal must be a multiple of the
mckusick [Sat, 2 Mar 2019 21:22:56 +0000 (21:22 +0000)]
The size of the UFS soft-updates journal must be a multiple of the
filesystem block size. When a size is specified with the -S flag
to tunefs(8), round it up to the filesystem block size.

Reported by:  Peter Holm
Tested by:    Peter Holm
Sponsored by: Netflix

5 years agopowerpc: fix 'show spr' for ELFv1 powerpc64
jhibbits [Sat, 2 Mar 2019 21:11:46 +0000 (21:11 +0000)]
powerpc: fix 'show spr' for ELFv1 powerpc64

Update and flush the right cache range for the ELFv1 ABI.

MFC after: 1 week

5 years agopowerpc/booke: Depessimize MAS register updates even more
jhibbits [Sat, 2 Mar 2019 20:59:18 +0000 (20:59 +0000)]
powerpc/booke: Depessimize MAS register updates even more

Remove isyncs between MAS register updates in the TLB miss handler, since
it's only needed before the TLB update instructions.

5 years agoBugfix: use a dummy buffer for the inactive side of a transfer.
ian [Sat, 2 Mar 2019 20:58:51 +0000 (20:58 +0000)]
Bugfix: use a dummy buffer for the inactive side of a transfer.

This is especially important for writes.  SPI is inherently a bidirectional
bus; you receive data (even if it's garbage) while writing.  We should not
receive that data into the same buffer we're writing to the device.

When reading it doesn't matter what we send to the device, but using the
dummy buffer for that as well is pleasingly symmetrical.

5 years agoRemove debug output.
tuexen [Sat, 2 Mar 2019 16:10:11 +0000 (16:10 +0000)]
Remove debug output.

MFC after: 3 days

5 years agoAllow SCTP stream reconfiguration operations only in ESTABLISHED
tuexen [Sat, 2 Mar 2019 14:30:27 +0000 (14:30 +0000)]
Allow SCTP stream reconfiguration operations only in ESTABLISHED
state.

This issue was found by running syzkaller.

MFC after: 3 days

5 years agoHandle the case when calling the IPPROTO_SCTP level socket option
tuexen [Sat, 2 Mar 2019 14:15:33 +0000 (14:15 +0000)]
Handle the case when calling the IPPROTO_SCTP level socket option
SCTP_STATUS on an association with no primary path (early state).

This issue was found by running syzkaller.

MFC after: 3 days

5 years agoUse correct buffer sizes in sctp_get[lp]addrs().
tuexen [Sat, 2 Mar 2019 13:16:01 +0000 (13:16 +0000)]
Use correct buffer sizes in sctp_get[lp]addrs().

MFC after: 3 days

5 years agoReport the correct length when using the IPPROTO_SCTP level
tuexen [Sat, 2 Mar 2019 13:12:37 +0000 (13:12 +0000)]
Report the correct length when using the IPPROTO_SCTP level
socket options SCTP_GET_PEER_ADDRESSES and SCTP_GET_LOCAL_ADDRESSES.

5 years agopf tests: Test for nested inline anchor issue
kp [Sat, 2 Mar 2019 12:30:59 +0000 (12:30 +0000)]
pf tests: Test for nested inline anchor issue

PR: 196314
MFC after: 1 week

5 years agocxgbev(4): Enable 32b port capabilities in the VF driver.
np [Sat, 2 Mar 2019 04:39:59 +0000 (04:39 +0000)]
cxgbev(4): Enable 32b port capabilities in the VF driver.

MFC after: 1 week
Sponsored by: Chelsio Communications

5 years agoEFI: don't call printf after ExitBootServices, since it uses Boot Services
bcran [Sat, 2 Mar 2019 04:02:11 +0000 (04:02 +0000)]
EFI: don't call printf after ExitBootServices, since it uses Boot Services

ExitBootServices terminates all boot services including console access.
Attempting to call printf afterwards can result in a crash, depending on the
implementation.

Move any printf statements to before we call bi_load, and remove any that
depend on calling bi_load first.

Reviewed by: imp, tsoome
Differential Revision: https://reviews.freebsd.org/D19374

5 years agopowerpc: Scale intrcnt by mp_ncpus
jhibbits [Sat, 2 Mar 2019 01:51:41 +0000 (01:51 +0000)]
powerpc: Scale intrcnt by mp_ncpus

On very large powerpc64 systems (2x22x4 power9) it's very easy to run out of
available IRQs and crash the system at boot.  Scale the count by mp_ncpus,
similar to x86, so this doesn't happen.  Further work can be done in the future
to scale the I/O IRQs as well, but that's left for the future.

Submitted by: mmacy
MFC after: 3 weeks

5 years agoEmbedded chacha: Add 0-bit iv + 128-bit counter mode
cem [Fri, 1 Mar 2019 23:30:23 +0000 (23:30 +0000)]
Embedded chacha: Add 0-bit iv + 128-bit counter mode

This mode might be suitable for a Fortuna keystream primitive.

Reviewed by: markm
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D19410

5 years agofortuna: Deduplicate kernel vs user includes
cem [Fri, 1 Mar 2019 22:51:45 +0000 (22:51 +0000)]
fortuna: Deduplicate kernel vs user includes

No functional change.

Reviewed by: markj, markm
Approved by: secteam (delphij), core (brooks)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D19409

5 years agoFix missed posted interrupts in VT-x in bhyve.
jhb [Fri, 1 Mar 2019 20:43:48 +0000 (20:43 +0000)]
Fix missed posted interrupts in VT-x in bhyve.

When a vCPU is HLTed, interrupts with a priority below the processor
priority (PPR) should not resume the vCPU while interrupts at or above
the PPR should.  With posted interrupts, bhyve maintains a bitmap of
pending interrupts in PIR descriptor along with a single 'pending'
bit.  This bit is checked by a CPU running in guest mode at various
places to determine if it should be checked.  In addition, another CPU
can force a CPU in guest mode to check for pending interrupts by
sending an IPI to a special IDT vector reserved for this purpose.

bhyve had a bug in that it would only notify a guest vCPU of an
interrupt (e.g. by sending the special IPI or by resuming it if it was
idle due to HLT) if an interrupt arrived that was higher priority than
PPR and no interrupts were currently pending.  This assumed that if
the 'pending' bit was set, any needed notification was already in
progress.  However, if the first interrupt sent to a HLTed vCPU was
lower priority than PPR and the second was higher than PPR, the first
interrupt would set 'pending' but not notify the vCPU, and the second
interrupt would not notify the vCPU because 'pending' was already set.
To fix this, track the priority of pending interrupts in a separate
per-vCPU bitmask and notify a vCPU anytime an interrupt arrives that
is above PPR and higher than any previously-received interrupt.

This was found and debugged in the bhyve port to SmartOS maintained by
Joyent.  Relevant SmartOS bugs with more background:

https://smartos.org/bugview/OS-6829
https://smartos.org/bugview/OS-6930
https://smartos.org/bugview/OS-7354

Submitted by: Patrick Mooney <pmooney@pfmooney.com>
Reviewed by: tychon, rgrimes
Obtained from: SmartOS / Joyent
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19299

5 years agoFortuna: push CTR-mode loop down into randomdev hash.h interface
cem [Fri, 1 Mar 2019 19:21:45 +0000 (19:21 +0000)]
Fortuna: push CTR-mode loop down into randomdev hash.h interface

As a step towards adding other potential streaming ciphers.  As well as just
pushing the loop down into the rijndael APIs (basically 128-bit wide AES-ICM
mode) to eliminate some excess explicit_bzero().

No functional change intended.

Reviewed by: delphij, markm
Approved by: secteam (delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D19411

5 years agoFix typos and caps for ipfw(8) man page.
ygy [Fri, 1 Mar 2019 19:06:13 +0000 (19:06 +0000)]
Fix typos and caps for ipfw(8) man page.

MFC after: 3 days
PR: 236030
Submitted by: olgeni

5 years agoHonor the memory limits provided when processing the IPPROTO_SCTP
tuexen [Fri, 1 Mar 2019 18:47:41 +0000 (18:47 +0000)]
Honor the memory limits provided when processing the IPPROTO_SCTP
level socket option SCTP_GET_LOCAL_ADDRESSES in a getsockopt() call.

Thanks to Thomas Barabosch for reporting the issue which was found by
running syzkaller.

MFC after: 3 days

5 years agoRemove sv_pagesize, originally introduced with r100384.
trasz [Fri, 1 Mar 2019 16:16:38 +0000 (16:16 +0000)]
Remove sv_pagesize, originally introduced with r100384.

In all of the architectures we have today, we always use PAGE_SIZE.
While in theory one could define different things, none of the
current architectures do, even the ones that have transitioned from
32-bit to 64-bit like i386 and arm. Some ancient mips binaries on
other systems used 8k instead of 4k, but we don't support running
those and likely never will due to their age and obscurity.

Reviewed by: imp (who also contributed the commit message)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D19280

5 years agoImprove consistency, not functional change.
tuexen [Fri, 1 Mar 2019 15:57:55 +0000 (15:57 +0000)]
Improve consistency, not functional change.

MFC after: 3 days

5 years agoThere is no `device atacard` but there is `device atapccard`.
mav [Fri, 1 Mar 2019 15:00:13 +0000 (15:00 +0000)]
There is no `device atacard` but there is `device atapccard`.

Reported by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 1 week

5 years agoFix incorrect / unused sector_count for identify requests
smh [Fri, 1 Mar 2019 14:39:15 +0000 (14:39 +0000)]
Fix incorrect / unused sector_count for identify requests

Fix incorrect / unused sector_count for identify requests from camcontrol.

Submitted by: Alexey Dokuchaev
Reported by: Alexey Dokuchaev
MFC after: 1 week
Sponsored by: Multiplay
Differential Revision: https://reviews.freebsd.org/D19408

5 years agoAdd ushort and ulong to linux/types.h.
bz [Fri, 1 Mar 2019 14:33:20 +0000 (14:33 +0000)]
Add ushort and ulong to linux/types.h.

When porting code once written for Linux we find not only uints but also ushort and ulong.
Provide central typedefs as part of the linuxkpi for those as well.

Reviewed by: hselasky, emaste
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19405

5 years agoarm64: rockchip: rk3399_pll: Fix the recalc function
manu [Fri, 1 Mar 2019 13:05:37 +0000 (13:05 +0000)]
arm64: rockchip: rk3399_pll: Fix the recalc function

The plls frequency are now correctly calculated in fractional mode
and integer mode.
While here add some debug printfs (disabled by default)
Tested with powerd on the little cluster on a RockPro64.

MFC after: 1 week

5 years agonetmap: pkt-gen: fix bug in send_packets()
vmaffione [Fri, 1 Mar 2019 09:10:16 +0000 (09:10 +0000)]
netmap: pkt-gen: fix bug in send_packets()

The send_packets() function was using ring->cur as index to scan
the transmit ring. This function may also set ring->cur ahead of
ring->head, in case no more slots are available. However, the function
also uses nm_ring_space() which looks at ring->head to check how many
slots are available. If ring->head and ring->cur are different, this
results in pkt-gen advancing ring->cur beyond ring->tail.

This patch fixes send_packets() (and similar source locations) to
use ring->head as a index, rather than using ring->cur.

MFC after: 1 week

5 years agopf tests: Test CVE-2019-5597
kp [Fri, 1 Mar 2019 07:39:55 +0000 (07:39 +0000)]
pf tests: Test CVE-2019-5597

Generate a fragmented packet with different header chains, to provoke
the incorrect behaviour of pf.
Without the fix this will trigger a panic.

Obtained from: Corentin Bayet, Nicolas Collignon, Luca Moro at Synacktiv

5 years agopf: IPv6 fragments with malformed extension headers could be erroneously passed by...
kp [Fri, 1 Mar 2019 07:37:45 +0000 (07:37 +0000)]
pf: IPv6 fragments with malformed extension headers could be erroneously passed by pf or cause a panic

We mistakenly used the extoff value from the last packet to patch the
next_header field. If a malicious host sends a chain of fragmented packets
where the first packet and the final packet have different lengths or number of
extension headers we'd patch the next_header at the wrong offset.
This can potentially lead to panics or rule bypasses.

Security:       CVE-2019-5597
Obtained from:  OpenBSD
Reported by:    Corentin Bayet, Nicolas Collignon, Luca Moro at Synacktiv

5 years agoImprove readability of the code by making it explicit where the 'c' variable
pjd [Fri, 1 Mar 2019 05:54:13 +0000 (05:54 +0000)]
Improve readability of the code by making it explicit where the 'c' variable
starts. It is also more consistent with similar code in this file.

5 years agopowerpc/powernv: Add OPAL flash device driver
jhibbits [Fri, 1 Mar 2019 04:36:55 +0000 (04:36 +0000)]
powerpc/powernv: Add OPAL flash device driver

Firmware needed by petitboot, for example, GPU firmware, can be installed to
a partition in the flash filesystem.  This driver exposes the full flash
given by the device tree, letting the user manage firmware, etc, from
FreeBSD.

To use the partitions provided by the flash module, the fdt_slicer module is
needed, but the module isn't needed for raw access, so there's no direct
dependency link in here.

MFC after: 2 weeks

5 years agoAdd another required header file.
ian [Fri, 1 Mar 2019 04:17:43 +0000 (04:17 +0000)]
Add another required header file.

For some reason this seems to be required on aarch64, but I can build armv7
from clean without needing this in the list.  (The file does get included,
so the mystery is why armv7 works.)

5 years agoAdd required header file to SRCS.
ian [Fri, 1 Mar 2019 03:09:43 +0000 (03:09 +0000)]
Add required header file to SRCS.

5 years agoUndo accidental part of r344681.
ian [Fri, 1 Mar 2019 02:53:54 +0000 (02:53 +0000)]
Undo accidental part of r344681.

I think I must have accidentally mouse-click pasted while scrolling and
didn't notice it.

Reported by: jhibbits@

5 years agopowerpc/powernv: Add asynchronous token management for powernv
jhibbits [Fri, 1 Mar 2019 02:49:47 +0000 (02:49 +0000)]
powerpc/powernv: Add asynchronous token management for powernv

The OPAL firmware only supports a finite number of in-flight asynchronous
operations.  Rather than have each subsystem try to manage its own, use a
central management service to hand out tokens.

More work can be done to improve asynchronous behavior, such as funneling
things through a future OPAL heartbeat handler, but capabilities will be
added as needed.

Augment the existing consumers (i2c and sensors) to use this new API.

MFC after: 4 weeks

5 years agocxgbe(4): Don't forget to report link state to the kernel if the link is
np [Fri, 1 Mar 2019 02:43:30 +0000 (02:43 +0000)]
cxgbe(4): Don't forget to report link state to the kernel if the link is
already up at attach.

Reported by: Fabrice Bruel @ Orange Business Service
MFC after: 1 week
Sponsored by: Chelsio Communications

5 years agoBuild fdt support modules on systems that use fdt data.
ian [Fri, 1 Mar 2019 02:31:43 +0000 (02:31 +0000)]
Build fdt support modules on systems that use fdt data.

kern.opts.mk sets make var OPT_FDT to a non-empty value if platform.h
contains OPT_FDT.

5 years agoRevert r344675
jhibbits [Fri, 1 Mar 2019 02:08:12 +0000 (02:08 +0000)]
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.

5 years agocxgb(4): Netdump: only reference allocated qsets
cem [Fri, 1 Mar 2019 01:57:22 +0000 (01:57 +0000)]
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

5 years agopatch(1): Exit successfully if we're fed a 0-length patch
kevans [Fri, 1 Mar 2019 01:20:21 +0000 (01:20 +0000)]
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

5 years agoPrevent detaching driver if the attach is not finished
mw [Fri, 1 Mar 2019 01:18:39 +0000 (01:18 +0000)]
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

5 years agoGEOM: Add fdt_slicer to the GEOM flashmap module for fdt-based platforms
jhibbits [Thu, 28 Feb 2019 23:00:47 +0000 (23:00 +0000)]
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.

5 years agoDon't assume all children of a nexus are ports.
jhb [Thu, 28 Feb 2019 22:10:19 +0000 (22:10 +0000)]
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

5 years agoAllow FIONBIO and FIOASYNC ioctls on POSIX shm descriptors.
markj [Thu, 28 Feb 2019 22:00:36 +0000 (22:00 +0000)]
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

5 years agoLimit 24xx adapters to only MSI interrupts by default.
mav [Thu, 28 Feb 2019 21:07:16 +0000 (21:07 +0000)]
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

5 years agobsd.nls.mk isn't optional.
bdrewery [Thu, 28 Feb 2019 20:48:18 +0000 (20:48 +0000)]
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

5 years agoGrammar tweaks in ipfw manual page.
trhodes [Thu, 28 Feb 2019 20:43:03 +0000 (20:43 +0000)]
Grammar tweaks in ipfw manual page.

5 years agoInvalidate cache for the PDPTE page when using PAE paging but PAT is
kib [Thu, 28 Feb 2019 19:19:02 +0000 (19:19 +0000)]
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

5 years agoRemove references to pdwait4(2) and `CAP_PDWAIT` from rights(4)
ngie [Thu, 28 Feb 2019 18:12:14 +0000 (18:12 +0000)]
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

5 years agoLimit 24xx adapters to only one MSI-X interrupt by default.
mav [Thu, 28 Feb 2019 15:36:03 +0000 (15:36 +0000)]
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.

5 years agoAdd to isp(4) tunables to limit MSI/MSI-X usage.
mav [Thu, 28 Feb 2019 15:24:00 +0000 (15:24 +0000)]
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.

5 years agoAdd the hw.ncpu tunable to arm64.
andrew [Thu, 28 Feb 2019 14:40:43 +0000 (14:40 +0000)]
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

5 years agotruss: Add support for fsync(2) and fdatasync(2).
tmunro [Thu, 28 Feb 2019 09:13:41 +0000 (09:13 +0000)]
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

5 years agocxgbe(4): Request high priority filter support explicitly, as required
np [Thu, 28 Feb 2019 05:45:14 +0000 (05:45 +0000)]
cxgbe(4): Request high priority filter support explicitly, as required
by recent firmwares.

MFC after: 1 week
Sponsored by: Chelsio Communications

5 years agoAdd SPDX tag.
imp [Thu, 28 Feb 2019 02:29:48 +0000 (02:29 +0000)]
Add SPDX tag.

5 years agoRename seq to seqc to avoid namespace clashes with Linux
mjg [Wed, 27 Feb 2019 22:56:55 +0000 (22:56 +0000)]
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

5 years agovm: remove seq.h inclusion made obsolete by NUMA rewrite
mjg [Wed, 27 Feb 2019 22:42:29 +0000 (22:42 +0000)]
vm: remove seq.h inclusion made obsolete by NUMA rewrite

Sponsored by: The FreeBSD Foundation

5 years agoixgbe(4): Fix panic triggered by assertion from interrupt
erj [Wed, 27 Feb 2019 22:26:18 +0000 (22:26 +0000)]
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

5 years agoUnconditionally support unmapped BIOs. This was another shim for
imp [Wed, 27 Feb 2019 22:16:59 +0000 (22:16 +0000)]
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.

5 years agoRemove #ifdef code to support FreeBSD versions that haven't been
imp [Wed, 27 Feb 2019 22:05:01 +0000 (22:05 +0000)]
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.

5 years agoFix armv6/armv7 build after the move from xhci_mv to generic_xhci
manu [Wed, 27 Feb 2019 22:01:39 +0000 (22:01 +0000)]
Fix armv6/armv7 build after the move from xhci_mv to generic_xhci

5 years agoRemove empty directories.
imp [Wed, 27 Feb 2019 21:52:08 +0000 (21:52 +0000)]
Remove empty directories.

5 years agoRefactor command ordering/blocking mechanism in CTL.
mav [Wed, 27 Feb 2019 21:29:21 +0000 (21:29 +0000)]
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.

5 years agodrm: Remove empty directories
manu [Wed, 27 Feb 2019 21:11:13 +0000 (21:11 +0000)]
drm: Remove empty directories

Discussed with:   imp

5 years agoxhci_mv: Move the driver to generic_xhci
manu [Wed, 27 Feb 2019 21:04:40 +0000 (21:04 +0000)]
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")
5 years agousb_nop_xceiv: Add support for this pseudo device
manu [Wed, 27 Feb 2019 20:52:35 +0000 (20:52 +0000)]
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")
5 years agoVarious cleanups to the management of multiple TCP stacks.
jhb [Wed, 27 Feb 2019 20:24:23 +0000 (20:24 +0000)]
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

5 years agoUpdate review requests for bhyve.
jhb [Wed, 27 Feb 2019 20:09:58 +0000 (20:09 +0000)]
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

5 years agoHave cryptocheck toggle kern.cryptodevallowsoft if necessary (this
sef [Wed, 27 Feb 2019 19:27:16 +0000 (19:27 +0000)]
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

5 years agortsol: Use vwarnx(3) to log messages to standard error.
markj [Wed, 27 Feb 2019 18:13:41 +0000 (18:13 +0000)]
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

5 years agopoll.2: POLLNVAL is returned also for insufficient rights
emaste [Wed, 27 Feb 2019 17:52:22 +0000 (17:52 +0000)]
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

5 years agommc: dwmmc: Match on "rockchip,rk3288-dw-mshc" compatible
manu [Wed, 27 Feb 2019 17:30:28 +0000 (17:30 +0000)]
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

5 years agoarm64: rockchip: rk3399_clk: Add sd clock definitions
manu [Wed, 27 Feb 2019 17:29:38 +0000 (17:29 +0000)]
arm64: rockchip: rk3399_clk: Add sd clock definitions

MFC after: 1 week

5 years agoarm64: rockchip: clk_pll: Multiple improvement
manu [Wed, 27 Feb 2019 14:20:28 +0000 (14:20 +0000)]
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

5 years agoFix a regression introduced in r344569
bapt [Wed, 27 Feb 2019 13:49:41 +0000 (13:49 +0000)]
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: https://github.com/illumos/illumos-gate/commit/247b7da039fd88350c50e3d7fef15bdab6bef215

Submitted by: jack@gandi.net
Reported by: cy
Reviewed by: tsoome, cy, bapt
Obtained from: Illumos

5 years agoFix kldxref on PowerPC64
luporl [Wed, 27 Feb 2019 13:24:42 +0000 (13:24 +0000)]
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

5 years agoFix regression introduced in r344569
bapt [Wed, 27 Feb 2019 07:55:53 +0000 (07:55 +0000)]
Fix regression introduced in r344569

Reported by: cy
Tested by: cy
Submitted by: Fatih Acar <fatih@gandi.net>

5 years agolibcxgb4: Don't spam stderr. Write combining is not enabled by default
np [Wed, 27 Feb 2019 06:50:24 +0000 (06:50 +0000)]
libcxgb4: Don't spam stderr.  Write combining is not enabled by default
by the FreeBSD driver.

5 years agoAdd support to fdt_slicer for the new style partition data documented in
ian [Wed, 27 Feb 2019 04:58:18 +0000 (04:58 +0000)]
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.

5 years agoChild nodes with a compatible property are not slices, according to the
ian [Wed, 27 Feb 2019 04:19:29 +0000 (04:19 +0000)]
Child nodes with a compatible property are not slices, according to the
devicetree/bindings/mtd/partitions.txt document, so just ignore them.

5 years agoRename some functions and variables to have shorter names, which allows
ian [Wed, 27 Feb 2019 04:16:32 +0000 (04:16 +0000)]
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.

5 years agopowerpc/mpc85xx: Synchronize timebase the platform correct way
jhibbits [Wed, 27 Feb 2019 03:30:49 +0000 (03:30 +0000)]
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

5 years agoAdd a module dependency on fdt_slicer. Also, move the PNP_INFO to its more
ian [Tue, 26 Feb 2019 22:52:41 +0000 (22:52 +0000)]
Add a module dependency on fdt_slicer.  Also, move the PNP_INFO to its more
usual location, down near the DRIVER_MODULE() stuff.

5 years agoAdd a module dependency on fdt_slicer.
ian [Tue, 26 Feb 2019 22:52:08 +0000 (22:52 +0000)]
Add a module dependency on fdt_slicer.

5 years agoAdd manpages for at45d(4) and mx25l(4).
ian [Tue, 26 Feb 2019 22:50:01 +0000 (22:50 +0000)]
Add manpages for at45d(4) and mx25l(4).

5 years agoMake it possible to load fdt_slicer as a module (unloading works too fwiw).
ian [Tue, 26 Feb 2019 22:34:29 +0000 (22:34 +0000)]
Make it possible to load fdt_slicer as a module (unloading works too fwiw).

5 years agoUpdate a comment to reflect reality; no functional changes.
ian [Tue, 26 Feb 2019 22:07:59 +0000 (22:07 +0000)]
Update a comment to reflect reality; no functional changes.

5 years agoCompile fdt_slicer and geom_flashmap when the at45d device is included.
ian [Tue, 26 Feb 2019 22:06:25 +0000 (22:06 +0000)]
Compile fdt_slicer and geom_flashmap when the at45d device is included.

5 years agoAdd support for geom_flashmap by providing a getattr() for "SPI:device".
ian [Tue, 26 Feb 2019 20:50:49 +0000 (20:50 +0000)]
Add support for geom_flashmap by providing a getattr() for "SPI:device".

5 years agoModularize xz.
kib [Tue, 26 Feb 2019 19:55:03 +0000 (19:55 +0000)]
Modularize xz.

Embedded lzma decompression library becomes a module usable by other
consumers, in addition to geom_uzip.

Most important code changes are
- removal of XZ_DEC_SINGLE define, we need the code to work
  with XZ_DEC_DYNALLOC;
- xz_crc32_init() call is removed from geom_uzip, xz module handles
  initialization on its own.

xz is no longer embedded into geom_uzip, instead the depend line for
the module is provided, and corresponding kernel option is added to
each MIPS kernel config file using geom_uzip.

The commit also carries unrelated cleanup by removing excess "device geom_uzip"
in places which were missed in r344479.

Reviewed by: cem, hselasky, ray, slavash (previous versions)
Sponsored by: Mellanox Technologies
Differential revision: https://reviews.freebsd.org/D19266
MFC after: 3 weeks

5 years agoMerge OpenSSL 1.1.1b.
jkim [Tue, 26 Feb 2019 19:31:33 +0000 (19:31 +0000)]
Merge OpenSSL 1.1.1b.

5 years agoSet process title during zfs send.
sef [Tue, 26 Feb 2019 19:23:22 +0000 (19:23 +0000)]
Set process title during zfs send.

This adds a '-V' option to 'zfs send', which sets the process title once a
second to the progress information.

This code has been in FreeNAS for a long time now; this is just upstreaming
it here.  It was originially written by delphij.

Reviewed by: mav
Obtained from: iXsystems, Inc
Sponsored by: iXsystems, Inc
Differential Revision: https://reviews.freebsd.org/D19184

5 years agoAdd a missing return statement to g_concat_kernel_dump().
markj [Tue, 26 Feb 2019 18:30:51 +0000 (18:30 +0000)]
Add a missing return statement to g_concat_kernel_dump().

The error occurs when upper layers attempt an out-of-bounds write.

Submitted by: Noah Bergbauer <noah.bergbauer@tum.de>
MFC after: 1 week

5 years agoFix fasttrap_sig{trap,segv}().
markj [Tue, 26 Feb 2019 18:20:41 +0000 (18:20 +0000)]
Fix fasttrap_sig{trap,segv}().

- Don't leak the ksiginfo structure.
- Hold the proc lock when sending a signal in fasttrap_sigsegv().

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

5 years agoproccontrol(1) man page.
kib [Tue, 26 Feb 2019 17:46:19 +0000 (17:46 +0000)]
proccontrol(1) man page.

Reviewed by: 0mp
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D19308