]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoRevert r362466
bapt [Mon, 22 Jun 2020 07:46:24 +0000 (07:46 +0000)]
Revert r362466

Such change should not have happen without prior discussion and review.

With hat: transitioning core

3 years agoSwitch cxgbe interface lookup to use fibX_lookup() from older
melifaro [Mon, 22 Jun 2020 07:35:23 +0000 (07:35 +0000)]
Switch cxgbe interface lookup to use fibX_lookup() from older
 fibX_lookup_nh_ext().

fibX_lookup_nh_ represents pre-epoch generation of fib kpi,
providing less guarantees over pointer validness and requiring
on-stack data copying.

Reviewed by: np
Differential Revision: https://reviews.freebsd.org/D24975

3 years agoSquash liblzma build race
kevans [Mon, 22 Jun 2020 03:44:01 +0000 (03:44 +0000)]
Squash liblzma build race

As of r362452, liblzma depends on libmd but the buildworld build order
hadn't been amended to document the new dependency.

Reported by: jenkins via freqlabs
X-MFC-With: r362452

3 years agoflua: add ucl library
freqlabs [Mon, 22 Jun 2020 03:14:43 +0000 (03:14 +0000)]
flua: add ucl library

libucl comes with a Lua library binding.  Build it into flua.

This lets us parse/generate config files in the various formats supported by
libucl with flua.  For example, the following script will detect the format of
an object written to stdin as one of UCL config, JSON, or YAML and write it to
stdout as pretty-printed JSON:

local ucl = require('ucl')
local parser = ucl.parser()
parser:parse_string(io.read('*a'))
local obj = parser:get_object()
print(ucl.to_format(obj, 'json'))

Reviewed by: kevans, pstef
Approved by: mmacy (mentor)
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D25009

3 years agoAdd include missing from my last commit.
tuexen [Sun, 21 Jun 2020 23:47:27 +0000 (23:47 +0000)]
Add include missing from my last commit.

3 years agoCleanup the defintion of struct sctp_getaddresses. This stucture
tuexen [Sun, 21 Jun 2020 23:12:56 +0000 (23:12 +0000)]
Cleanup the defintion of struct sctp_getaddresses. This stucture
is used by the IPPROTO_SCTP level socket options SCTP_GET_PEER_ADDRESSES
and SCTP_GET_LOCAL_ADDRESSES, which are used by libc to implement
sctp_getladdrs() and sctp_getpaddrs().
These changes allow an old libc to work on a newer kernel.

3 years agoRather than zeroing MAXVIFS times size of pointer [r362289] (still better than
bz [Sun, 21 Jun 2020 22:09:30 +0000 (22:09 +0000)]
Rather than zeroing MAXVIFS times size of pointer [r362289] (still better than
sizeof pointer before [r354857]), we need to zero MAXVIFS times the size of
the struct.  All good things come in threes; I hope this is it on this one.

PR: 246629, 206583
Reported by: kib
MFC after: ASAP

3 years agoiflib: fix cloneattach fail and generalize pseudo device handling
mmacy [Sun, 21 Jun 2020 22:02:49 +0000 (22:02 +0000)]
iflib: fix cloneattach fail and generalize pseudo device handling

- a cloneattach failure will not currently be handled correctly,
  jump to the right target

- pseudo devices are all treat as if they're ethernet devices -
  this often doesn't make sense

MFC after: 1 week
Sponsored by: Netgate, Inc.
Differential Revision: https://reviews.freebsd.org/D25083

3 years agonet.link.generic.ifdata.<ifindex>.linkspecific: rework handler
kaktus [Sun, 21 Jun 2020 18:40:17 +0000 (18:40 +0000)]
net.link.generic.ifdata.<ifindex>.linkspecific: rework handler

This OID was added in r17352 but the write path of IFDATA_LINKSPECIFIC
seems unused as there are no in-base writers, and as far as I can tell
we had issues with this code before, see PR 219472.  Drop the write path
to make the handler read-only as described in comments and man-pages.
It can be marked as MPSAFE now.

Reviewed by: bdragon, kib, melifaro, wollman
Approved by: kib (mentor)
Sponsored by: Mysterious Code Ltd.
Differential Revision: https://reviews.freebsd.org/D25348

3 years agoImprove wording to be more precise and clear.
hselasky [Sun, 21 Jun 2020 13:34:08 +0000 (13:34 +0000)]
Improve wording to be more precise and clear.
No functional change intended.

s/Master Boot/Main Boot/ (also called MBR)

MFC after: 1 week
Sponsored by: Mellanox Technologies

3 years agow: use locale-based string format specifiers
yuripv [Sun, 21 Jun 2020 11:42:49 +0000 (11:42 +0000)]
w: use locale-based string format specifiers

Use locale-based string format specifiers when printing
the process names/arguments.

Reviewed by: pstef
Differential Revision: https://reviews.freebsd.org/D25174

3 years agoAdapt linuxulator syscalls.master files to the new layout.
trasz [Sun, 21 Jun 2020 10:09:34 +0000 (10:09 +0000)]
Adapt linuxulator syscalls.master files to the new layout.
No functional changes.

Reviewed by: brooks
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25381

3 years agoFix the build for an INET6 only configuration.
tuexen [Sun, 21 Jun 2020 09:56:09 +0000 (09:56 +0000)]
Fix the build for an INET6 only configuration.

The fix from the last commit is actually needed twice...

MFC after: 1 week

3 years agovfs: track sequential reads and writes separately
tmunro [Sun, 21 Jun 2020 08:51:24 +0000 (08:51 +0000)]
vfs: track sequential reads and writes separately

For software like PostgreSQL and SQLite that sometimes reads sequentially
while also writing sequentially some distance behind with interleaved
syscalls on the same fd, performance is better on UFS if we do
sequential access heuristics separately for reads and writes.

Patch originally by Andrew Gierth in 2008, updated and proposed by me with
his permission.

Reviewed by: mjg, kib, tmunro
Approved by: mjg (mentor)
Obtained from: Andrew Gierth <andrew@tao11.riddles.org.uk>
Differential Revision: https://reviews.freebsd.org/D25024

3 years agoUse zone nomenclature that is consistent with UMA.
jeff [Sun, 21 Jun 2020 04:59:02 +0000 (04:59 +0000)]
Use zone nomenclature that is consistent with UMA.

3 years ago[PowerPC] More relocation fixes
bdragon [Sun, 21 Jun 2020 03:39:26 +0000 (03:39 +0000)]
[PowerPC] More relocation fixes

It turns out relocating the symbol table itself can cause issues, like fbt
crashing because it applies the offsets to the kernel twice.

This had been previously brought up in rS333447 when the stoffs hack was
added, but I had been unaware of this and reimplemented symtab relocation.

Instead of relocating the symbol table, keep track of the relocation base
in ddb, so the ddb symbols behave like the kernel linker-provided symbols.

This is intended to be NFC on platforms other than PowerPC, which do not
use fully relocatable kernels. (The relbase will always be 0)

 * Remove the rest of the stoffs hack.
 * Remove my half-baked displace_symbol_table() function.
 * Extend ddb initialization to cope with having a relocation offset on the
   kernel symbol table.
 * Fix my kernel-as-initrd hack to work with booke64 by using a temporary
   mapping to access the data.
 * Fix another instance of __powerpc__ that is actually RELOCATABLE_KERNEL.
 * Change the behavior or X_db_symbol_values to apply the relocation base
   when updating valp, to match link_elf_symbol_values() behavior.

Reviewed by: jhibbits
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D25223

3 years agoFix up a comment added by r362455.
rmacklem [Sun, 21 Jun 2020 02:49:56 +0000 (02:49 +0000)]
Fix up a comment added by r362455.

3 years agoModify the way the client side krpc does soreceive() for TCP.
rmacklem [Sun, 21 Jun 2020 00:06:04 +0000 (00:06 +0000)]
Modify the way the client side krpc does soreceive() for TCP.

Without this patch, clnt_vc_soupcall() first does a soreceive() for
4 bytes (the Sun RPC over TCP record mark) and then soreceive(s) for
the RPC message.
This first soreceive() almost always results in an mbuf allocation,
since having the 4byte record mark in a separate mbuf in the socket
rcv queue is unlikely.
This is somewhat inefficient and rather odd. It also will not work
for the ktls rx, since the latter returns a TLS record for each
soreceive().

This patch replaces the above with code similar to what the server side
of the krpc does for TCP, where it does a soreceive() for as much data
as possible and then parses RPC messages out of the received data.
A new field of the TCP socket structure called ct_raw is the list of
received mbufs that the RPC message(s) are parsed from.
I think this results in cleaner code and is needed for support of
nfs-over-tls.
It also fixes the code for the case where a server sends an RPC message
in multiple RPC message fragments. Although this is allowed by RFC5531,
no extant NFS server does this. However, it is probably good to fix this
in case some future NFS server does do this.

3 years agoSet a variable also in the case of an INET6 only kernel
tuexen [Sat, 20 Jun 2020 23:48:57 +0000 (23:48 +0000)]
Set a variable also in the case of an INET6 only kernel

MFC after: 1 week

3 years agoBump __FreeBSD_version after making liblzma to use libmd implementation
delphij [Sat, 20 Jun 2020 21:32:14 +0000 (21:32 +0000)]
Bump __FreeBSD_version after making liblzma to use libmd implementation
of SHA256.

PR: 200142

3 years agoliblzma: Make liblzma use libmd implementation of SHA256.
delphij [Sat, 20 Jun 2020 21:32:07 +0000 (21:32 +0000)]
liblzma: Make liblzma use libmd implementation of SHA256.

MFC after: 2 weeks
PR: 200142

3 years agoUse a struct sockaddr_in pr struct sockaddr_in6 as the option value
tuexen [Sat, 20 Jun 2020 21:06:02 +0000 (21:06 +0000)]
Use a struct sockaddr_in pr struct sockaddr_in6 as the option value
for the IPPROTO_SCTP level socket options SCTP_BINDX_ADD_ADDR and
SCTP_BINDX_REM_ADDR. These socket option are intended for internal
use only to implement sctp_bindx().
This is one user of struct sctp_getaddresses less.
struct sctp_getaddresses is strange and will be changed shortly.

3 years agoIn concluding RB_REMOVE_COLOR, in the case when the sibling of the
dougm [Sat, 20 Jun 2020 20:25:39 +0000 (20:25 +0000)]
In concluding RB_REMOVE_COLOR, in the case when the sibling of the
root of the too-short tree is black and at least one of the children
of that sibling is red, either one or two rotations finish the
rebalancing. In the case when both of the children are red, the
current implementation uses two rotations where only one is
necessary. This change removes that extra rotation, and in that case
also removes a needless black-to-red-to-black recoloring.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D25335

3 years agoClarify some language. Favor primary where both master and primary were
jeff [Sat, 20 Jun 2020 20:21:04 +0000 (20:21 +0000)]
Clarify some language.  Favor primary where both master and primary were
used in conjunction with secondary.

3 years agoCleanup the adding and deleting of addresses via sctp_bindx().
tuexen [Sat, 20 Jun 2020 20:20:16 +0000 (20:20 +0000)]
Cleanup the adding and deleting of addresses via sctp_bindx().

There is no need to use the association identifier, so remove it.
While there, cleanup the code a bit.

MFC after: 1 week

3 years agodump(8): Reapply slightly modified r362422
cem [Sat, 20 Jun 2020 20:14:50 +0000 (20:14 +0000)]
dump(8): Reapply slightly modified r362422

Go ahead and replace the distasteful slave language for worker processes
with the straightforward description, "worker(s)."

3 years agoMerge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
dim [Sat, 20 Jun 2020 20:06:52 +0000 (20:06 +0000)]
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
llvmorg-10.0.0-97-g6f71678ecd2 (not quite 10.0.1 rc2, as more fixes are
still pending).

MFC after: 3 weeks

3 years agoRevert -r362422.
imp [Sat, 20 Jun 2020 20:06:14 +0000 (20:06 +0000)]
Revert -r362422.

While whimsical, there's too much negative energy around minion as well as the
positive.

3 years agoVendor import of llvm-project branch release/10.x
dim [Sat, 20 Jun 2020 18:49:12 +0000 (18:49 +0000)]
Vendor import of llvm-project branch release/10.x
llvmorg-10.0.0-97-g6f71678ecd2.

3 years agoRegen after r362440.
trasz [Sat, 20 Jun 2020 18:31:02 +0000 (18:31 +0000)]
Regen after r362440.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

3 years agoAdd linux_madvise(2) instead of having Linux apps call the native
trasz [Sat, 20 Jun 2020 18:29:22 +0000 (18:29 +0000)]
Add linux_madvise(2) instead of having Linux apps call the native
FreeBSD madvise(2) directly.  While some of the flag values match,
most don't.

PR: kern/230160
Reported by: markj
Reviewed by: markj
Discussed with: brooks, kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25272

3 years agooce(4): Account and trace mbufs before handing to hw
cem [Sat, 20 Jun 2020 17:22:46 +0000 (17:22 +0000)]
oce(4): Account and trace mbufs before handing to hw

Once tx mbufs have been handed to hardware, nothing serializes the tx
path against completion and potential use-after-free of the outbound
mbuf.  Perform accounting and BPF tap before queueing to hardware to
avoid this race.

Submitted by: Steve Wirtz <steve_wirtz AT dell.com>
Reviewed by: markj, rstone
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D25364

3 years agoImprove debug message to be more precise and clear.
hselasky [Sat, 20 Jun 2020 14:16:24 +0000 (14:16 +0000)]
Improve debug message to be more precise and clear.

For the sake of the record, this is the last use of the words master and slave
in the FreeBSD's USB stack, drivers and subsystems.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agojoin(1): Add EXAMPLES section
fernape [Sat, 20 Jun 2020 11:27:59 +0000 (11:27 +0000)]
join(1): Add EXAMPLES section

Add EXAMPLES covering options -e, -o, -t, -v, -1

Approved by: 0mp@
Differential Revision: https://reviews.freebsd.org/D25186

4 years agoseq(1): complete EXAMPLES section
fernape [Sat, 20 Jun 2020 11:24:29 +0000 (11:24 +0000)]
seq(1): complete EXAMPLES section

* Add a small description before the EXAMPLES that are already in the man page
  to explicitely state what we are trying to show instead of having the user
  guess what the example is doing.

* Add two more examples to show usage of -s, -t and -f

* mandoc -Tlint reports irrelevant use of .Tn so remove them since according to
  mdoc(7) it is there only for compatibility and should not be used in new
  manuals.

Approved by: 0mp@

4 years agocmp(1): Add EXAMPLES section
fernape [Sat, 20 Jun 2020 11:20:16 +0000 (11:20 +0000)]
cmp(1): Add EXAMPLES section

Add a small number of examples depicting the use of -l, -z and byte offsets

Approved by: 0mp@

4 years agoloader: libofw build is missing sys/list.h after r362431
tsoome [Sat, 20 Jun 2020 08:22:57 +0000 (08:22 +0000)]
loader: libofw build is missing sys/list.h after r362431

Add another include path

4 years agoloader: fix libofw build after r362431
tsoome [Sat, 20 Jun 2020 07:46:43 +0000 (07:46 +0000)]
loader: fix libofw build after r362431

4 years agoloader: create single zfs nextboot implementation
tsoome [Sat, 20 Jun 2020 06:23:31 +0000 (06:23 +0000)]
loader: create single zfs nextboot implementation

We should have nextboot feature implemented in libsa zfs code.
To get there, I have created zfs_nextboot() implementation based on
two sources, our current simple textual string based approach with added
structured boot label PAD structure from OpenZFS.

Secondly, all nvlist details are moved to separate source file and
restructured a bit. This is done to provide base support to add nvlist
add/update feature in followup updates.

And finally, the zfsboot/gptzfsboot disk access functions are swapped to use
libi386 and libsa.

Sponsored by: Netflix, Klara Inc.
Differential Revision: https://reviews.freebsd.org/D25324

4 years agoMake vipw error message less cryptic
pstef [Sat, 20 Jun 2020 06:20:00 +0000 (06:20 +0000)]
Make vipw error message less cryptic

Unable to find an editor, vipw would give this error:
# env EDITOR=fnord vipw
vipw: pw_edit(): No such file or directory

vigr or crontab do better:
# env EDITOR=fnord crontab -e
crontab: no crontab for root - using an empty one
crontab: fnord: No such file or directory
crontab: "fnord" exited with status 1

After this change, vipw behaves more like vigr or crontab:
# env EDITOR=fnord vipw
vipw: fnord: No such file or directory
vipw: "fnord" exited with status 1

Reviewed by: rpokala, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25369

4 years agolibutil: remove extraneous ": " from error messages
pstef [Sat, 20 Jun 2020 06:10:42 +0000 (06:10 +0000)]
libutil: remove extraneous ": " from error messages

Each of the err() family of functions already takes care of that.

4 years agoIncrease the whimsy in this file by famring dump's work out to minions. Adjust
imp [Sat, 20 Jun 2020 04:19:17 +0000 (04:19 +0000)]
Increase the whimsy in this file by famring dump's work out to minions. Adjust
variables accordingly. Thankfully, we are able to do this without additional
banana expenditures.

4 years agoraspberry pi 4: cpufreq support
kevans [Sat, 20 Jun 2020 04:07:58 +0000 (04:07 +0000)]
raspberry pi 4: cpufreq support

The submitter notes that the bcm2835_cpufreq driver really just needs the
rpi4 compat string added to it; powerd subsequently works and the dev.cpu.0
sysctl values look sane and can be successfully manipulated.

Submitted by: James Mintram <me@jamesrm.com>
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D25349

4 years agoCorrect 1BSD release date.
imp [Sat, 20 Jun 2020 04:07:44 +0000 (04:07 +0000)]
Correct 1BSD release date.

The Quarter Century of Unix book said that 1BSD was released March 1979.
However, the 1BSD tape image that's on Kirk's historical unix collection has an
earlier date.

It was common practice, at the time, to create a new copy of the tape from the
master system when a new tape was to go out, so several different versions of
1BSD, etc were shipped from Berkerely. The date on the 1BSD tape in the Berkeley
archives on Kirk's DVD is dated in January 16 1979 on the label, and has dates
as late as Jan 29 (there's an UPDATE file that says this includes updates
through this date). Note this date as well.

4 years agoUse the more descriptive src_ccb and dst_ccb for the two ccbs being merged.
imp [Sat, 20 Jun 2020 04:07:23 +0000 (04:07 +0000)]
Use the more descriptive src_ccb and dst_ccb for the two ccbs being merged.

MFC after: 1 week

4 years agoAllocate an fs_summary_info structure when creating a UFS filesystem
mckusick [Fri, 19 Jun 2020 23:32:40 +0000 (23:32 +0000)]
Allocate an fs_summary_info structure when creating a UFS filesystem
needed since introduced in -r362358.

PR:           247425
Sponsored by: Netflix

4 years agoAdd warnings for unsupported Linux clockids.
trasz [Fri, 19 Jun 2020 19:33:06 +0000 (19:33 +0000)]
Add warnings for unsupported Linux clockids.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25322

4 years agoImprove if_dwc:
mmel [Fri, 19 Jun 2020 19:26:55 +0000 (19:26 +0000)]
Improve if_dwc:
 - refactorize packet receive path. Make sure that we don't leak mbufs
   and/or that we don't create holes in RX descriptor ring
 - slightly simplify handling with TX descriptors

MFC after: 4 weeks

4 years agomd5(1): fix -c flag to work with input on stdin
allanjude [Fri, 19 Jun 2020 19:16:25 +0000 (19:16 +0000)]
md5(1): fix -c flag to work with input on stdin

Previously, the -p and -c flags were ignored when reading from stdin
Additionally, -s and -c can be used together now.

PR: 247295
Reviewed by: kevans
MFC after: 2 weeks
Relnotes: yes
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D25362

4 years ago[PowerPC] Add virtio to GENERIC
bdragon [Fri, 19 Jun 2020 18:43:13 +0000 (18:43 +0000)]
[PowerPC] Add virtio to GENERIC

Due to kldxref not being able to generate hints for nonnative platforms,
any cross built VM images do not have /boot/kernel/linker.hints.

This prevents the virtio modules from being loaded, as the fallback code
will always fail the version check when the hints are missing.

Since we want to be able to generate VM images for 32 bit powerpc, add the
virtio modules to GENERIC like we do on powerpc64.

Reviewed by: jhibbits
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D25271

4 years ago[PowerPC] Fix booke64 qemu infinite loop in L2 cache enable
bdragon [Fri, 19 Jun 2020 18:40:39 +0000 (18:40 +0000)]
[PowerPC] Fix booke64 qemu infinite loop in L2 cache enable

Since qemu does not implement the L2 cache, we get stuck forever waiting
for a bit to be set when trying to invalidate it.

To prevent that, we should bail out if the L2 cache is missing.
One easy way to check this is L2CFG0 == 0 (since L2CSIZE always has at
least one bit set in a valid implementation)

(tested on qemu, rb800, and x5000)

Reviewed by: jhibbits
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D25225

4 years ago[PowerPC] De-giant powermac_nvram, update documentation
bdragon [Fri, 19 Jun 2020 18:36:10 +0000 (18:36 +0000)]
[PowerPC] De-giant powermac_nvram, update documentation

* Remove the giant lock requirement from powermac_nvram.
* Update manual pages to reflect current state.

Reviewed by: bcr (manpages), jhibbits
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D24812

4 years agoFinish renaming in if_dwc.
mmel [Fri, 19 Jun 2020 18:34:27 +0000 (18:34 +0000)]
Finish renaming in if_dwc.
By using DWC TRM terminology, normal descriptor format should be named
extended and alternate descriptor format should be named normal.

Should not been functional change.

MFC after: 4 weeks

4 years agoUse naming nomenclature used in DesignWare TRM.
mmel [Fri, 19 Jun 2020 18:04:41 +0000 (18:04 +0000)]
Use naming nomenclature used in DesignWare TRM.
Use naming nomenclature used in DesignWare TRM.
This driver was written by using Altera (now Intel) documentation for Arria
FPGA manual. Unfortunately this manual used very different (and in some cases
opposite naming) for registers and descriptor fields. Unfortunately,
this makes future expansion extremely hard.

Should not been functional change.

MFC after: 4 weeks

4 years agoUse the correct address when creating pci resources
andrew [Fri, 19 Jun 2020 18:00:20 +0000 (18:00 +0000)]
Use the correct address when creating pci resources

When the PCI and CPU physical addresses are identical it doesn't matter
which is used to create the resources, however on some systems, e.g.
qemu armv7 virt, they are different. This leads to a panic as we try to
map the wrong physical address into the kernel address space.

Reported by: Jenkins via trasz
Sponsored by: Innovate UK

4 years agoZFS: Allow setting checksum=skein on boot pools
allanjude [Fri, 19 Jun 2020 17:59:55 +0000 (17:59 +0000)]
ZFS: Allow setting checksum=skein on boot pools

PR: 245889
Reported by: delphij
Sponsored by: Klara Inc.

4 years agoAdapt ARMADA8k PCIe driver to newly imported 5.7 DT.
mmel [Fri, 19 Jun 2020 17:33:54 +0000 (17:33 +0000)]
Adapt ARMADA8k PCIe driver to newly imported 5.7 DT.
- temporarily disable handling with phy, we don't have driver for it yet
- always clear cause for administartive interrupt.
While I'm in, fix style(9) (mainly whitespace).

MFC after: 4 weeks

4 years agoRevert r362389, it was committed with <patch>.diff instead of <patch>.txt as
mmel [Fri, 19 Jun 2020 17:32:50 +0000 (17:32 +0000)]
Revert r362389, it was committed with <patch>.diff instead of <patch>.txt as
commit log.

4 years agoSkip ufs related tests in fstyp(8) and makefs(8) temporarily
lwhsu [Fri, 19 Jun 2020 17:32:30 +0000 (17:32 +0000)]
Skip ufs related tests in fstyp(8) and makefs(8) temporarily

They are failing after r362358 and r362359.

PR: 247425
Sponsored by: The FreeBSD Foundation

4 years agodiff --git a/sys/dev/pci/pci_dw_mv.c b/sys/dev/pci/pci_dw_mv.c
mmel [Fri, 19 Jun 2020 17:25:54 +0000 (17:25 +0000)]
diff --git a/sys/dev/pci/pci_dw_mv.c b/sys/dev/pci/pci_dw_mv.c
index 06a29fefbdd..571fc00f6c1 100644
--- a/sys/dev/pci/pci_dw_mv.c
+++ b/sys/dev/pci/pci_dw_mv.c
@@ -64,15 +64,11 @@ __FBSDID("$FreeBSD$");

 #define MV_GLOBAL_CONTROL_REG 0x8000
 #define PCIE_APP_LTSSM_EN (1 << 2)
-//#define PCIE_DEVICE_TYPE_SHIFT 4
-//#define PCIE_DEVICE_TYPE_MASK 0xF
-//#define PCIE_DEVICE_TYPE_RC 0x4/

 #define MV_GLOBAL_STATUS_REG 0x8008
 #define  MV_STATUS_RDLH_LINK_UP (1 << 1)
 #define  MV_STATUS_PHY_LINK_UP (1 << 9)

-
 #define MV_INT_CAUSE1 0x801C
 #define MV_INT_MASK1 0x8020
 #define  INT_A_ASSERT_MASK (1 <<  9)
@@ -90,11 +86,7 @@ __FBSDID("$FreeBSD$");
 #define MV_ARUSER_REG 0x805C
 #define MV_AWUSER_REG 0x8060

-
-
 #define MV_MAX_LANES 8
-
-
 struct pci_mv_softc {
  struct pci_dw_softc dw_sc;
  device_t dev;
@@ -112,7 +104,6 @@ static struct ofw_compat_data compat_data[] = {
  {NULL,     0},
 };

-
 static int
 pci_mv_phy_init(struct pci_mv_softc *sc)
 {
@@ -121,18 +112,23 @@ pci_mv_phy_init(struct pci_mv_softc *sc)
  for (i = 0; i < MV_MAX_LANES; i++) {
  rv =  phy_get_by_ofw_idx(sc->dev, sc->node, i, &(sc->phy[i]));
  if (rv != 0 && rv != ENOENT) {
-    device_printf(sc->dev, "Cannot get phy[%d]\n", i);
-    goto fail;
-    }
-    if (sc->phy[i] == NULL)
-    continue;
-    rv = phy_enable(sc->phy[i]);
-    if (rv != 0) {
-    device_printf(sc->dev, "Cannot enable phy[%d]\n", i);
-    goto fail;
-    }
-   }
-   return (0);
+ device_printf(sc->dev, "Cannot get phy[%d]\n", i);
+/* XXX revert when phy driver will be implemented */
+#if 0
+ goto fail;
+#else
+ continue;
+#endif
+ }
+ if (sc->phy[i] == NULL)
+ continue;
+ rv = phy_enable(sc->phy[i]);
+ if (rv != 0) {
+ device_printf(sc->dev, "Cannot enable phy[%d]\n", i);
+ goto fail;
+ }
+ }
+ return (0);

 fail:
  for (i = 0; i < MV_MAX_LANES; i++) {
@@ -173,13 +169,14 @@ pci_mv_init(struct pci_mv_softc *sc)
  /* Enable local interrupts */
  pci_dw_dbi_wr4(sc->dev, DW_MSI_INTR0_MASK, 0xFFFFFFFF);
  pci_dw_dbi_wr4(sc->dev, MV_INT_MASK1, 0xFFFFFFFF);
- pci_dw_dbi_wr4(sc->dev, MV_INT_MASK2, 0xFFFFFFFF);
+ pci_dw_dbi_wr4(sc->dev, MV_INT_MASK2, 0xFFFFFFFD);
  pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE1, 0xFFFFFFFF);
  pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE2, 0xFFFFFFFF);

  /* Errors have own interrupt, not yet populated in DTt */
  pci_dw_dbi_wr4(sc->dev, MV_ERR_INT_MASK, 0);
 }
+
 static int pci_mv_intr(void *arg)
 {
  struct pci_mv_softc *sc = arg;
@@ -188,8 +185,6 @@ static int pci_mv_intr(void *arg)
  /* Ack all interrups */
  cause1 = pci_dw_dbi_rd4(sc->dev, MV_INT_CAUSE1);
  cause2 = pci_dw_dbi_rd4(sc->dev, MV_INT_CAUSE2);
- if (cause1 == 0 || cause2 == 0)
- return(FILTER_STRAY);

  pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE1, cause1);
  pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE2, cause2);

4 years agoUse native-sized accesses when accessing memory from kdb.
mmel [Fri, 19 Jun 2020 16:26:42 +0000 (16:26 +0000)]
Use native-sized accesses when accessing memory from kdb.
Not all MMIO mapped devices supports byte access.

MFC after: 4 weeks

4 years agoImprove DesignWare PCIe driver:
mmel [Fri, 19 Jun 2020 16:15:06 +0000 (16:15 +0000)]
Improve DesignWare PCIe driver:
- only normal memory window is mandatory, prefetchable memory and
  I/O windows should be optional
- full PCIe configuration space is supported
- remove duplicated check from function for accessing configuration space.
  It is already contained in pci_dw_check_dev()

MFC after: 2 weeks

4 years agoAdd specific stub for ARMADA 8k SoC to Marvell RTC driver.
mmel [Fri, 19 Jun 2020 15:32:55 +0000 (15:32 +0000)]
Add specific stub for ARMADA 8k SoC to Marvell RTC driver.
The AXI bridge is different between ARMADA 38x and 8K, and both platforms
needs specific setup to mitigate HW issues with accessing RTC registers.

MFC after: 2 weeks

4 years agoAdd specialized gpio driver for ARMADA 8k SoC.
mmel [Fri, 19 Jun 2020 15:21:33 +0000 (15:21 +0000)]
Add specialized gpio driver for ARMADA 8k SoC.
Older marvell gpio blocks are to different for reusing/enhancing
existing frivers.

MFC after: 2 weeks

4 years agoAdd DTB files for ARMADA 8040 based boards.
mmel [Fri, 19 Jun 2020 14:28:56 +0000 (14:28 +0000)]
Add DTB files for ARMADA 8040 based boards.

MFC after: 2 weeks

4 years agoFix typo in apic.4
thj [Fri, 19 Jun 2020 13:09:00 +0000 (13:09 +0000)]
Fix typo in apic.4

Reviewed by: bcr (manpages)
Approved by: jtl (co-mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D25357

4 years agoRemove last argument of sctp_addr_mgmt_ep_sa(), since it is not used.
tuexen [Fri, 19 Jun 2020 12:35:29 +0000 (12:35 +0000)]
Remove last argument of sctp_addr_mgmt_ep_sa(), since it is not used.

MFC after: 1 week

4 years agoRevert r362360.
markj [Fri, 19 Jun 2020 11:04:49 +0000 (11:04 +0000)]
Revert r362360.

This commit was simply wrong since two different objects are locked.

Reported by: lwhsu, pho
Pointy hat: markj

4 years agobin/ps: Make the rtprio option actually show realtime priorities
salvadore [Fri, 19 Jun 2020 09:27:58 +0000 (09:27 +0000)]
bin/ps: Make the rtprio option actually show realtime priorities

Fix the rtprio option that for some reason was progessively becoming an
option showing the priority class of threads. In particular:

- use the constants defined in sys/sys/rtprio.h instead of those defined in
  sys/sys/priority.h: this helps making clearer that the code actually is
  about realtime priorities and not standard scheduler priorities;
- remove the PRI_ITHD case that has nothing to do with realtime priorities;
- convert the priority levels to realtime priority levels using the same
  formulas used for pri_to_rtp function in sys/kern/kern_resource.c.
- remove outdated note "101 = not a realtime process" in the man page and
  replace it with a more useful reference to man 1 rtprio.

Approved by: src (mckusick), manpages (bcr), gerald (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25266

4 years agodiff(1): Add EXAMPLES section
fernape [Fri, 19 Jun 2020 06:48:16 +0000 (06:48 +0000)]
diff(1): Add EXAMPLES section

Add examples for -r, -u, -N, -x, -q and -I

Approved by: 0mp@
Differential Revision: https://reviews.freebsd.org/D25345

4 years agomd5(1): Add EXAMPLES section
fernape [Fri, 19 Jun 2020 06:23:55 +0000 (06:23 +0000)]
md5(1): Add EXAMPLES section

Add EXAMLES covering -c, -s and -r

Approved by: bcr@, 0mp@
Differential Revision: https://reviews.freebsd.org/D25278

4 years agoRestore a check unintentionally dropped in r362361.
markj [Fri, 19 Jun 2020 04:18:20 +0000 (04:18 +0000)]
Restore a check unintentionally dropped in r362361.

MFC with: r362361

4 years agoThe actual name for MMCCAM sd block devices is sdda.
imp [Fri, 19 Jun 2020 04:09:35 +0000 (04:09 +0000)]
The actual name for MMCCAM sd block devices is sdda.

Pointed out by: kibab@

4 years agoAdd a helper function for validating VA ranges.
markj [Fri, 19 Jun 2020 03:32:04 +0000 (03:32 +0000)]
Add a helper function for validating VA ranges.

Functions which take untrusted user ranges must validate against the
bounds of the map, and also check for wraparound.  Instead of having the
same logic duplicated in a number of places, add a function to check.

Reviewed by: dougm, kib
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25328

4 years agoFix a double object unlock in vm_object_backing_collapse_wait().
markj [Fri, 19 Jun 2020 03:31:46 +0000 (03:31 +0000)]
Fix a double object unlock in vm_object_backing_collapse_wait().

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25327

4 years agoThe binary representation of the superblock (the fs structure) is written
mckusick [Fri, 19 Jun 2020 01:04:25 +0000 (01:04 +0000)]
The binary representation of the superblock (the fs structure) is written
out verbatim to the disk: see ffs_sbput() in sys/ufs/ffs/ffs_subr.c.
It contains a pointer to the fs_summary_info structure. This pointer
value inadvertently causes garbage to be stored. It is garbage because
the pointer to the fs_summary_info structure is the address the then
current stack or heap. Although a mere pointer does not reveal anything
useful (like a part of a private key) to an attacker, garbage output
deteriorates reproducibility.

This commit zeros out the pointer to the fs_summary_info structure
before writing the out the superblock.

Reviewed by:  kib
Tested by:    Peter Holm
PR:           246983
Sponsored by: Netflix

4 years agoMove the pointers stored in the superblock into a separate
mckusick [Fri, 19 Jun 2020 01:02:53 +0000 (01:02 +0000)]
Move the pointers stored in the superblock into a separate
fs_summary_info structure. This change was originally done
by the CheriBSD project as they need larger pointers that
do not fit in the existing superblock.

This cleanup of the superblock eases the task of the commit
that immediately follows this one.

Suggested by: brooks
Reviewed by:  kib
PR:           246983
Sponsored by: Netflix

4 years agoAdd support for bcm54213PE in brgphy.
karels [Thu, 18 Jun 2020 23:57:10 +0000 (23:57 +0000)]
Add support for bcm54213PE in brgphy.

This chip is used in the Rasperry Pi 4, and is supported by the if_genet
driver. Currently we use the ukphy mii driver, this patch switches over
to the brgphy mii driver instead. To support the rgmii-rxid phy mode,
which is now the default in the Linux dtb, we add support for clock
skewing.

These changes are taken from OpenBSD and NetBSD, except for the bailout
in brgphy_bcm54xx_clock_delay() in rgmii mode, which was found necessary
after testing.

Submitted by: Robert Crowston, crowston at protomail.com
Differential Revision: https://reviews.freebsd.org/D25251

4 years agoDocument that umount -A does not unmount /dev
0mp [Thu, 18 Jun 2020 23:12:55 +0000 (23:12 +0000)]
Document that umount -A does not unmount /dev

Reported by: kaktus
Reviewed by: kaktus
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25351

4 years agortld: Apply relro to itself.
kib [Thu, 18 Jun 2020 23:07:58 +0000 (23:07 +0000)]
rtld: Apply relro to itself.

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D25319

4 years agortld: Parse own phdr and notes.
kib [Thu, 18 Jun 2020 23:06:05 +0000 (23:06 +0000)]
rtld: Parse own phdr and notes.

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D25319

4 years agohw.bus.info: rework handler
kaktus [Thu, 18 Jun 2020 21:42:54 +0000 (21:42 +0000)]
hw.bus.info: rework handler

hw.bus.info was added in r68522 as a node, but there was never anything
connected "behind" it.  Its only purpose is to return a struct u_businfo.
The only in-base consumer are devinfo(3)/devinfo(8).
Rewrite the handler as SYSCTL_PROC and mark it as MPSAFE and read-only
as there never was a writable path.

Reviewed by: kib
Approved by: kib (mentor)
Sponsored by: Mysterious Code Ltd.
Differential Revision: https://reviews.freebsd.org/D25321

4 years agoFix execution of linux binary from multithreaded non-Linux process.
kib [Thu, 18 Jun 2020 20:49:56 +0000 (20:49 +0000)]
Fix execution of linux binary from multithreaded non-Linux process.

If multithreaded non-Linux process execs Linux binary, then non-Linux
threads different from the one that execing are cleared by
single-threading at boundary, and then terminating them in
post_execve(). Since at that time the process is already switched to
linux ABI, linuxolator is involved in the thread clearing on boundary,
but cannot find the emul data.

Handle it by pre-creating emuldata for all threads in the execing process.

Also remove a code in linux_proc_exec() handler that cleared emul data
for other threads when execing from multithreaded Linux process. It is
excessive.

PR: 247020
Reported by: Martin FIlla <freebsd@sysctl.cz>
Reported by: Henrique L. Amorim, Independent Security Researcher
Reported by: Rodrigo Rubira Branco (BSDaemon), Amazon Web Services
Reviewed by: markj
Tested by: trasz
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D25293

4 years agoMerge commit 0cecafd647cc from llvm git (by Alina Sbirlea):
dim [Thu, 18 Jun 2020 20:41:43 +0000 (20:41 +0000)]
Merge commit 0cecafd647cc from llvm git (by Alina Sbirlea):

  [BasicAA] Make BasicAA a cfg pass.

  Summary:
  Part of the changes in D44564 made BasicAA not CFG only due to it
  using PhiAnalysisValues which may have values invalidated. Subsequent
  patches (rL340613) appear to have addressed this limitation.

  BasicAA should not be invalidated by non-CFG-altering passes. A
  concrete example is MemCpyOpt which preserves CFG, but we are testing
  it invalidates BasicAA.

  llvm-dev RFC:
  https://groups.google.com/forum/#!topic/llvm-dev/eSPXuWnNfzM

  Reviewers: john.brawn, sebpop, hfinkel, brzycki

  Subscribers: hiraditya, llvm-commits

  Tags: #llvm

  Differential Revision: https://reviews.llvm.org/D74353

This fixes an issue with clang's -fintegrated-cc1 feature, which could
make it output slightly different assembly code, depending on the way it
was invoked.

In r361755 we attempted to work around it by disabling the integrated
cc1 stage, but it did not solve the root cause for all situations.

Extensive testing and bisecting showed that the above change finally
makes the output deterministic, even if -fintegrated-cc1 is on.

Reported by: Fabian Keil <fk@fabiankeil.de>
PR: 246630
MFC after: 3 days

4 years agoAdd the SCTP_SUPPORT kernel option.
markj [Thu, 18 Jun 2020 19:32:34 +0000 (19:32 +0000)]
Add the SCTP_SUPPORT kernel option.

This is in preparation for enabling a loadable SCTP stack.  Analogous to
IPSEC/IPSEC_SUPPORT, the SCTP_SUPPORT kernel option must be configured
in order to support a loadable SCTP implementation.

Discussed with: tuexen
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

4 years agoMake polled request timeout less invasive.
mav [Thu, 18 Jun 2020 19:16:03 +0000 (19:16 +0000)]
Make polled request timeout less invasive.

Instead of panic after one second of polling, make the normal timeout
handler to activate, reset the controller and abort the outstanding
requests.  If all of it won't happen within 10 seconds then something
in the driver is likely stuck bad and panic is the only way out.

In particular this fixed device hot unplug during execution of those
polled commands, allowing clean device detach instead of panic.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

4 years agoFix a typo in cpuset_getdomain.2
0mp [Thu, 18 Jun 2020 19:03:20 +0000 (19:03 +0000)]
Fix a typo in cpuset_getdomain.2

PR: 247385
Reported by: Paul Floyd <paulf free.fr>
MFC after: 1 week

4 years agoRemove the unnecessary configure.ac.
jkim [Thu, 18 Jun 2020 18:16:13 +0000 (18:16 +0000)]
Remove the unnecessary configure.ac.

4 years agoMFV: r362286
jkim [Thu, 18 Jun 2020 18:09:16 +0000 (18:09 +0000)]
MFV: r362286

Merge flex 2.6.4.

4 years agoWhitespace changes, not functional change intended.
tuexen [Thu, 18 Jun 2020 16:22:09 +0000 (16:22 +0000)]
Whitespace changes, not functional change intended.

MFC after: 1 week

4 years agoMake audit tests depend on /dev/auditpipe. This should fix
trasz [Thu, 18 Jun 2020 15:41:16 +0000 (15:41 +0000)]
Make audit tests depend on /dev/auditpipe. This should fix
some 416 failing tests on armv7:

https://ci.freebsd.org/job/FreeBSD-head-armv7-test/lastCompletedBuild/testReport/

Reviewed by: asomers
MFC after: 2 weeks
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D25144

4 years agosplit(1): Add EXAMPLES section
fernape [Thu, 18 Jun 2020 15:14:10 +0000 (15:14 +0000)]
split(1): Add EXAMPLES section

Add EXAMPLES covering -d, -n and -p
Include small explanation about the size of the chunks for the -n option

Approved by: 0mp
Differential Revision: https://reviews.freebsd.org/D25198

4 years agoAdd HISTORY sections to banner(6), basename(1), limits(1) and vmstat(8)
gbe [Thu, 18 Jun 2020 13:19:56 +0000 (13:19 +0000)]
Add HISTORY sections to banner(6), basename(1), limits(1) and vmstat(8)

Reviewed by: bcr (mentor)
Approved by: bcr (mentor)
MFC after: 7 days
Differential Revision: https://reviews.freebsd.org/D25019

4 years agofgetln(3): Add a Caveats Section
gbe [Thu, 18 Jun 2020 13:13:04 +0000 (13:13 +0000)]
fgetln(3): Add a Caveats Section

Reviewed by: yuripv, bcr (mentor)
Approved by: bcr (mentror)
Obtained from: OpenBSD
MFC after: 7 days
Differential Revision: https://reviews.freebsd.org/D24916

4 years agoFix the --guid flag description
0mp [Thu, 18 Jun 2020 12:29:24 +0000 (12:29 +0000)]
Fix the --guid flag description

MFC after: 2 weeks

4 years agoClean up and improve manual page for fuser(1)
0mp [Thu, 18 Jun 2020 11:18:26 +0000 (11:18 +0000)]
Clean up and improve manual page for fuser(1)

- Mention option's arguments in the list of options (so that now we mention
  "-N system" instead of just "-N").
- Stylize signals and other constants like O_APPEND with Dv.
- Sort options.
- Change indentation width for readability.
- Fix a couple of typos.
- Sort symbols list.
- Use Sy instead of Cm for symbols. They are not command modifiers.
- Use Ex -std in the EXIT STATUS section for consistency with other manual
  pages.
- Use Ql instead of Dq Li for inline code examples as Li has recently been
  deprecated by mdoc.

Reviewed by: bcr
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25332

4 years agoImprove periodic(8) manual page presentation
0mp [Thu, 18 Jun 2020 10:52:51 +0000 (10:52 +0000)]
Improve periodic(8) manual page presentation

- Update synopsis to present all available arguments.
- Consistently call the argument specifying an arbitrary directory a
  "directory".
- Do not put macros into -width argument to Bl. They do not expand there.
- Stylize command modifiers like "daily" with Cm instead of Pa. While
  technically periodic(8) operates on directories with such names, it is
  confusing from the perspective of the manual page reader as Pa and Ar are
  stylized the same way. Also, I cannot recall a single manual page where
  Pa would be used to describe the syntax of command-line arguments.

MFC after: 2 weeks

4 years agotee(1): Add EXAMPLES section
fernape [Thu, 18 Jun 2020 10:48:37 +0000 (10:48 +0000)]
tee(1): Add EXAMPLES section

Probably the simplest one ever.

Approved by: gbe@, 0mp@
Differential Revision: https://reviews.freebsd.org/D25206

4 years agolockf(1): Add EXAMPLES section
fernape [Thu, 18 Jun 2020 08:31:04 +0000 (08:31 +0000)]
lockf(1): Add EXAMPLES section

 * Add pretty small EXAMPLES section
 * While here, fix a warning in line 98 (new sentence in new line)

Approved by: bcr@
Differential Revision: https://reviews.freebsd.org/D25205

4 years agonl(1): Add EXAMPLES section
fernape [Thu, 18 Jun 2020 08:26:26 +0000 (08:26 +0000)]
nl(1): Add EXAMPLES section

Add EXAMPLES section covering flags -b[ap] -n -i -s -v

Approved by: bcr@
Differential Revision: Add EXAMPLES section covering flags -b[ap] -n -i -s -v