]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoInitial import from vendor-sys branch of openzfs
Matt Macy [Mon, 24 Aug 2020 23:31:26 +0000 (23:31 +0000)]
Initial import from vendor-sys branch of openzfs

3 years agodrm2: Update deprecation message
Niclas Zeising [Mon, 24 Aug 2020 22:53:23 +0000 (22:53 +0000)]
drm2: Update deprecation message

Update the deprecation message in the drm2 (aka legacy drm) drivers to point
towards the graphics/drm-kmod ports for all architectures, not just amd64.
drm-kmod has support for more architectures these days, and the
graphics/drm-legacy-kmod port is being deprecated.

Approved by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26174

3 years agoVendor import of openzfs master @ 184df27eef0abdc7ab2105b21257f753834b936b
Matt Macy [Mon, 24 Aug 2020 22:48:19 +0000 (22:48 +0000)]
Vendor import of openzfs master @ 184df27eef0abdc7ab2105b21257f753834b936b

Sponsored by: iX Systems, Inc.

3 years agoRestore workaround for sysret fault on non-canonical address after LA57.
Konstantin Belousov [Mon, 24 Aug 2020 22:12:45 +0000 (22:12 +0000)]
Restore workaround for sysret fault on non-canonical address after LA57.

Sponsored by: The FreeBSD Foundation

3 years agoAfter r364732, we can now enable MK_OPENMP for aarch64 by default.
Dimitry Andric [Mon, 24 Aug 2020 20:40:26 +0000 (20:40 +0000)]
After r364732, we can now enable MK_OPENMP for aarch64 by default.

PR: 248864
MFC after: 2 weeks

3 years agoMerge commit cde8f4c16 from llvm git (by me):
Dimitry Andric [Mon, 24 Aug 2020 20:37:18 +0000 (20:37 +0000)]
Merge commit cde8f4c16 from llvm git (by me):

  Move special va_list handling to kmp_os.h

  Instead of copying and pasting the same #ifdef expressions in
  multiple places, define a type and a pair of macros in kmp_os.h, to
  handle whether va_list is pointer-like or not:

  * kmp_va_list is the type to use for __kmp_fork_call()
  * kmp_va_deref() dereferences a va_list, if necessary
  * kmp_va_addr_of() takes the address of a va_list, if necessary

  Also add FreeBSD to the list of OSes that has a non pointer-like
  va_list. This can now be easily extended to other OSes too.

  Reviewed By: AndreyChurbanov

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

This should enable building of LLVM's OpenMP on AArch64. Addition to
share/mk will follow in a subsequent commit.

PR: 248864
MFC after: 2 weeks

3 years agonetmap: use FreeBSD guards for epoch calls
Vincenzo Maffione [Mon, 24 Aug 2020 20:28:21 +0000 (20:28 +0000)]
netmap: use FreeBSD guards for epoch calls

EPOCH calls are FreeBSD specific. Use guards to protect these, so
that the code can compile under Linux.

MFC after: 1 week

3 years agoRemove RT_LOCK mutex from rte.
Alexander V. Chernikov [Mon, 24 Aug 2020 20:23:34 +0000 (20:23 +0000)]
Remove RT_LOCK mutex from rte.

rtentry lock traditionally served 2 purposed: first was protecting refcounts,
 the second was assuring consistent field access/changes.
Since route nexthop introduction, the need for the former disappeared and
 the need for the latter reduced.
To be more precise, the following rte field are mutable:

rt_nhop (nexthop pointer, updated with RIB_WLOCK, passed in rib_cmd_info)
rte_flags (only RTF_HOST and RTF_UP, where RTF_UP gets changed at rte removal)
rt_weight (relative weight, updated with RIB_WLOCK, passed in rib_cmd_info)
rt_expire (time when rte deletion is scheduled, updated with RIB_WLOCK)
rt_chain (deletion chain pointer, updated with RIB_WLOCK)
All of them are updated under RIB_WLOCK, so the only remaining concern is the reading.

rt_nhop and rt_weight (addressed in this review) are read under rib lock and
 stored in the rib_cmd_info, so the caller has no problem with consitency.
rte_flags is currently read unlocked in rtsock reporting (however the scope
 is only RTF_UP flag, which is pretty static).
rt_expire is currently read unlocked in rtsock reporting.
rt_chain accesses are safe, as this is only used at route deletion.

rt_expire and rte_flags reads will be dealt in a separate reviews soon.

Differential Revision: https://reviews.freebsd.org/D26162

3 years agoFix silly typo...
Warner Losh [Mon, 24 Aug 2020 20:02:13 +0000 (20:02 +0000)]
Fix silly typo...

3 years agoDocument devd event change from r364725
Warner Losh [Mon, 24 Aug 2020 19:49:22 +0000 (19:49 +0000)]
Document devd event change from r364725

3 years agoDocument the kern -> kernel name change for resume events.
Warner Losh [Mon, 24 Aug 2020 19:35:27 +0000 (19:35 +0000)]
Document the kern -> kernel name change for resume events.

MFC After: 3 days

3 years agoChange the resume notification event from 'kern' to 'kernel'
Warner Losh [Mon, 24 Aug 2020 19:35:15 +0000 (19:35 +0000)]
Change the resume notification event from 'kern' to 'kernel'

We have both a system of 'kern' and of 'kernel'. Prefer the latter and
convert this notification to use 'kernel' instead of 'kern'. As a
transition period, continue to also generate the 'kern' notification
until sometime after FreeBSD 13 is branched.

MFC After: 3 days

3 years agocache: remove leftover assert in vn_fullpath_any_smr
Mateusz Guzik [Mon, 24 Aug 2020 18:23:58 +0000 (18:23 +0000)]
cache: remove leftover assert in vn_fullpath_any_smr

It is only valid when !slash_prefixed. For slash_prefixed the length
is properly accounted for later.

Reported by: markj (syzkaller)

3 years agoUpdate unbound version number.
Cy Schubert [Mon, 24 Aug 2020 18:17:13 +0000 (18:17 +0000)]
Update unbound version number.

MFC after: 1 month
X-MFC with: r364721

3 years agoMFV 364468:
Cy Schubert [Mon, 24 Aug 2020 18:14:04 +0000 (18:14 +0000)]
MFV 364468:

Update unbound 1.10.1 --> 1.11.0.

MFH: 1 month

3 years agoMFV 364467:
Cy Schubert [Mon, 24 Aug 2020 18:13:44 +0000 (18:13 +0000)]
MFV 364467:

Update sqlite to 3.33.0 (3330000).

Release announcement at https://www.sqlite.org/releaselog/3_33_0.html.

MFC after: 1 month

3 years agow(1): Add EXAMPLES to man page
Fernando Apesteguía [Mon, 24 Aug 2020 17:57:08 +0000 (17:57 +0000)]
w(1): Add EXAMPLES to man page

Add small example section showing general use and -d and -h flags

Approved by: manpages (bcr@)
Differential Revision: https://reviews.freebsd.org/D26172

3 years agoMerge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
Dimitry Andric [Mon, 24 Aug 2020 17:43:23 +0000 (17:43 +0000)]
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
release/11.x llvmorg-11.0.0-rc2-0-g414f32a9e86.

MFC after: 6 weeks
X-MFC-With: r364284

3 years agoVendor import of llvm-project branch release/11.x
Dimitry Andric [Mon, 24 Aug 2020 17:20:50 +0000 (17:20 +0000)]
Vendor import of llvm-project branch release/11.x
llvmorg-11.0.0-rc2-0-g414f32a9e86.

3 years agoIn the endless batch mode (-B), terminate if and when stdout is closed.
Maxim Sobolev [Mon, 24 Aug 2020 16:45:23 +0000 (16:45 +0000)]
In the endless batch mode (-B), terminate if and when stdout is closed.
That mode is useful to call gstat from other app, however kinda useless
since gstat won't exit and stay running forever when its parent process
has long gone.

MFC after: 2 weeks

3 years agoWhen copying over the binaries, use '-p' to preserve date/time
Warner Losh [Mon, 24 Aug 2020 16:06:11 +0000 (16:06 +0000)]
When copying over the binaries, use '-p' to preserve date/time

Although I can't reproduce it, others are seeing different lex/yacc
programs always regenerated after my change to copy rather than
symlink the files. The reported fix is to add '-p' to the copies.
Since it doesn't hurt, go head and add it, though the reasons for
this mattering remain at best obscure and poorly articulated.

3 years agos/redundacy/redundancy
Marc Fonvieille [Mon, 24 Aug 2020 14:04:59 +0000 (14:04 +0000)]
s/redundacy/redundancy

MFC after: 1 week

3 years agoAdd missing Korean doc package entry, remove non-existent Serbian doc
Marc Fonvieille [Mon, 24 Aug 2020 14:00:12 +0000 (14:00 +0000)]
Add missing Korean doc package entry, remove non-existent Serbian doc
package entry.

Approved by: re (gjb)
MFC after: 1 week

3 years ago[PowerPC] Make new auxv format default
Leandro Lupori [Mon, 24 Aug 2020 13:40:35 +0000 (13:40 +0000)]
[PowerPC] Make new auxv format default

Assume ELF images without OSREL use the new auxv format.

This is specially important for rtld, that is not tagged. Using
direct exec mode with new (ELFv2) binaries that expect the new auxv
format would result in crashes otherwise.

Unfortunately, this may break direct exec'ing old binaries,
but it seems better to correctly support new binaries by default,
considering the transition to ELFv2 happened quite some time
ago. If needed, a sysctl may be added to allow old auxv format to
be used when OSREL is not found.

Reviewed by: bdragon
Sponsored by: Eldorado Research Institute (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D25651

3 years agonet80211: enhance getflags*() and ieee80211_add_channel*()
Bjoern A. Zeeb [Mon, 24 Aug 2020 13:15:08 +0000 (13:15 +0000)]
net80211: enhance getflags*() and ieee80211_add_channel*()

For ieee80211_add_channel+*() we are passing in an int flag for
ht40 and in some cases another int flag for vht80 where we'd only
need two bits really.
Convert these variables to a bitflag and fold them together into one.
This also allows for VHT160 and VHT80P80 and whatever may come to
be considered. Define the various options currently needed.

Change the drivers (rtwn and rsu) which actually set this bit to non-0.
For convenience the "1" currently used for HT40 is preserved.

Enahnce getflags_5ghz() to handle the full set of VHT flags based
on the input flags from the the driver.

Update the regdomain implementation as well to make use of the new
flags and deal with higher [V]HT bandwidths.

ieee80211_add_channel() specifically did not take flags so it will
not support naything beyond 20Mhz channels.

Note: I am not entirely happy with the "cbw_flag[s]" name, but we
do use chan_flags elsewhere already.

MFC after: 2 weeks
Reviewed by: adrian, gnn
Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate")
Differential revision: https://reviews.freebsd.org/D26091

3 years agocpu_auxmsr: assert caller is preventing CPU migration.
Peter Grehan [Mon, 24 Aug 2020 11:49:49 +0000 (11:49 +0000)]
cpu_auxmsr: assert caller is preventing CPU migration.

Submitted by: Adam Fenn (adam at fenn dot io)
Requested by: kib
Reviewed by: kib, grehan
Approved by: kib
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D26166

3 years agoiflib: fix isc_rxd_flush call in netmap_fl_refill()
Vincenzo Maffione [Mon, 24 Aug 2020 11:44:20 +0000 (11:44 +0000)]
iflib: fix isc_rxd_flush call in netmap_fl_refill()

The semantic of the pidx argument of isc_rxd_flush() is the
last valid index of in the free list, rather than the next
index to be published. However, netmap was still using the
old convention. While there, also refactor the netmap_fl_refill()
to simplify a little bit and add an assertion.

MFC after: 2 weeks

3 years agoAlso print number of available CPUs on Linux
Alex Richardson [Mon, 24 Aug 2020 09:20:38 +0000 (09:20 +0000)]
Also print number of available CPUs on Linux

Without this change the buildworld/buildkernel epilogue looks like this:
>>> World built in 249 seconds, sysctl: cannot stat /proc/sys/hw/ncpu: No such file or directory
ncpu: , make -j72.

Reviewed By: emaste, bdrewery
Differential Revision: https://reviews.freebsd.org/D26056

3 years agoAvoid adding duplicates to SRCS/OBJS/SOBJS/POBJS
Alex Richardson [Mon, 24 Aug 2020 09:20:33 +0000 (09:20 +0000)]
Avoid adding duplicates to SRCS/OBJS/SOBJS/POBJS

This is a change in preparation for stopping to use lorder.sh (D26044) and
instead assume that we have a linker newer than ~1990. Without lorder.sh
duplicates end up being passed to the linker when building .so files and this
can result in duplicate symbol definition errors.

There is one minor change: libcompiler_rt.a will no longer provide
gcc_personality_v0 and instead we now only have it in libgcc_eh.a/libgcc_s.so.
This matches GCC's behaviour.

Reviewed By: emaste, cem
Differential Revision: https://reviews.freebsd.org/D26042

3 years agomakefs (msdosfs): Use fprintf instead of debug print for errors
Alex Richardson [Mon, 24 Aug 2020 09:20:27 +0000 (09:20 +0000)]
makefs (msdosfs): Use fprintf instead of debug print for errors

The added print was very helpful for debugging failed disk image creation.

Reviewed By: emaste
Differential Revision: https://reviews.freebsd.org/D23200

3 years agoCorrectly determine the real executable in crunched binaries
Alex Richardson [Mon, 24 Aug 2020 09:20:23 +0000 (09:20 +0000)]
Correctly determine the real executable in crunched binaries

This should fix cases like su setting argv[0] to _su for /bin/sh.
Previously cheribsdbox (a crunched tool we use in CheriBSD to reduce the
size of our minimal disk images to allow loading them onto FPGAs without
waiting forever for the transfer) would complain about _su not being
compiled in, but now that we also look at AT_EXECPATH it correctly
invokes the sh tool.

Note: we use use AT_EXECPATH instead of the KERN_PROC_PATHNAME sysctl to get
the crunchgen binary name since it seems like KERN_PROC_PATHNAME just
returns the last cached path for a given hardlink.
When using `su`, instead of invoking /bin/csh this would invoke the last
used hardlink to cheribsdbox. This caused weird test failures when running
tests due to `id` being executed instead of `echo`:

$ id  # id is a hardlink to /bin/cheribsdbox
$ su postgres -c 'echo 1' # su is also a hardlink
uid=1001(postgres) gid=1001(postgres) groups=1001(postgres)

Obtained from: CheriBSD

Reviewed By: emaste, brooks
Differential Revision: https://reviews.freebsd.org/D25998

3 years agoRe-indent crunched_main.c in preparation for D25998
Alex Richardson [Mon, 24 Aug 2020 09:20:18 +0000 (09:20 +0000)]
Re-indent crunched_main.c in preparation for D25998

3 years agoPass the installworld install(1) flags to make buildenv
Alex Richardson [Mon, 24 Aug 2020 09:20:13 +0000 (09:20 +0000)]
Pass the installworld install(1) flags to make buildenv

This ensure that running make install inside buildenv correctly includes
the METALOG flags when building with -DNO_ROOT.

Reviewed By: brooks
Differential Revision: https://reviews.freebsd.org/D26038

3 years agocache: lockless reverse lookup
Mateusz Guzik [Mon, 24 Aug 2020 09:00:57 +0000 (09:00 +0000)]
cache: lockless reverse lookup

This enables fully scalable operation for getcwd and significantly improves
realpath.

For example:
PATH_CUSTOM=/usr/src ./getcwd_processes -t 104
before:  1550851
after: 380135380

Tested by: pho

3 years agocache: drop the always curthread argument from reverse lookup routines
Mateusz Guzik [Mon, 24 Aug 2020 08:57:02 +0000 (08:57 +0000)]
cache: drop the always curthread argument from reverse lookup routines

Note VOP_VPTOCNP keeps getting it as temporary compatibility for zfs.

Tested by: pho

3 years agocache: perform reverse lookup using v_cache_dd if possible
Mateusz Guzik [Mon, 24 Aug 2020 08:55:55 +0000 (08:55 +0000)]
cache: perform reverse lookup using v_cache_dd if possible

Tested by: pho

3 years agocache: populate v_cache_dd for non-VDIR entries
Mateusz Guzik [Mon, 24 Aug 2020 08:55:04 +0000 (08:55 +0000)]
cache: populate v_cache_dd for non-VDIR entries

It makes v_cache_dd into a little bit of a misnomer and it may be addressed later.

Tested by: pho

3 years agobhyve: NVMe queue create must init head/tail
Chuck Tuffli [Mon, 24 Aug 2020 01:51:21 +0000 (01:51 +0000)]
bhyve: NVMe queue create must init head/tail

The NVMe emulation code did not explicitly initialize queue head and
tail pointers on queue creation. As these pointers are part of
calloc()'ed memory, this only becomes a problem if the queues are
deleted and then recreated.

This error can manifest with messages about completions not matching a
command.

3 years agobhyve: NVMe set nominal health values
Chuck Tuffli [Mon, 24 Aug 2020 01:51:17 +0000 (01:51 +0000)]
bhyve: NVMe set nominal health values

Some operating systems believe bhyve's emulated NVMe drive is failing
based on certain values in the SMART / Health Information log page being
zero. Fix is to set the reported temperature and available spare values
to reasonable defaults.

Submitted by: wanpengqian@gmail.com
Reviewed by:    grehan
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D24202

3 years agocaroot: switch to using echo+shell glob to enumerate certs
Kyle Evans [Sun, 23 Aug 2020 23:56:57 +0000 (23:56 +0000)]
caroot: switch to using echo+shell glob to enumerate certs

This solves an issue on stable/12 that causes certs to not get installed.
ls is apparently not in PATH during installworld, so TRUSTED_CERTS ends up
blank and nothing gets installed. We don't really require anything
ls-specific, though, so let's just simplify it.

MFC after: 3 days

3 years agonet80211: improve media information for VHT5GHZ
Bjoern A. Zeeb [Sun, 23 Aug 2020 21:42:23 +0000 (21:42 +0000)]
net80211: improve media information for VHT5GHZ

Improve ieee80211_media_setup(), media2mode(), and
ieee80211_rate2media() for VHT5GHZ at least.

Reviewed by: adrian, gnn
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate")
Differential Revision: https://reviews.freebsd.org/D26089

3 years agonet80211: set_vht_extchan() reverse order to always return best
Bjoern A. Zeeb [Sun, 23 Aug 2020 21:37:20 +0000 (21:37 +0000)]
net80211: set_vht_extchan() reverse order to always return best

In set_vht_extchan() the checks are performed in the order of VHT20/40/80.
That means if a channel has a lower and higheer VHT flag set we would
return the lower first.
We normally do not set more than one VHT flag so this change is supposed
to be a NOP but follows the logical thinking order of returning the best
first. Also we nowhere assert a single VHT flag so make sure we'll not
be stuck with VHT20 when we could do more.

While here add the debugging printfs for VHT160 and VHT80P80 which still
need doing once we deal with a driver at that level.

Reviewed by: adrian, gnn
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate")
Differential Revision: https://reviews.freebsd.org/D26088

3 years agovfs: validate ndp state after the lookup
Mateusz Guzik [Sun, 23 Aug 2020 21:06:41 +0000 (21:06 +0000)]
vfs: validate ndp state after the lookup

The intent is to remove known-to-be-nops NDFREE calls after many lookups.

3 years agovfs: convert nameiop into an enum
Mateusz Guzik [Sun, 23 Aug 2020 21:05:39 +0000 (21:05 +0000)]
vfs: convert nameiop into an enum

While here change the field size from long to int and move it into the
gap next to cn_flags.

Shrinks struct componentname from 64 to 56 bytes on amd64.

3 years agovfs: support denying access in vaccess_vexec_smr
Mateusz Guzik [Sun, 23 Aug 2020 21:05:06 +0000 (21:05 +0000)]
vfs: support denying access in vaccess_vexec_smr

3 years agovfs: factor away doomed vnode handling into vdropl_final
Mateusz Guzik [Sun, 23 Aug 2020 21:04:35 +0000 (21:04 +0000)]
vfs: factor away doomed vnode handling into vdropl_final

3 years agoprocctl(8): usermode bits to force LA58/LA57 on exec.
Konstantin Belousov [Sun, 23 Aug 2020 20:44:15 +0000 (20:44 +0000)]
procctl(8): usermode bits to force LA58/LA57 on exec.

Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D25273

3 years agoamd64: Handle 5-level paging on wakeup.
Konstantin Belousov [Sun, 23 Aug 2020 20:43:23 +0000 (20:43 +0000)]
amd64: Handle 5-level paging on wakeup.

We can switch into long mode directly with LA57 enabled.

Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D25273

3 years agoamd64: Handle 5-level paging for efirt calls.
Konstantin Belousov [Sun, 23 Aug 2020 20:40:35 +0000 (20:40 +0000)]
amd64: Handle 5-level paging for efirt calls.

Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D25273

3 years agoFix another minor style glitch.
Warner Losh [Sun, 23 Aug 2020 20:38:10 +0000 (20:38 +0000)]
Fix another minor style glitch.

Pull { to the end of the struct line rather than having them on their
own line.

3 years agoAdd bhyve support for LA57 guest mode.
Konstantin Belousov [Sun, 23 Aug 2020 20:37:21 +0000 (20:37 +0000)]
Add bhyve support for LA57 guest mode.

Noted and reviewed by: grehan
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D25273

3 years agoAdd amd64 procctl(2) ops to manage forced LA48/LA57 VA after exec.
Konstantin Belousov [Sun, 23 Aug 2020 20:32:13 +0000 (20:32 +0000)]
Add amd64 procctl(2) ops to manage forced LA48/LA57 VA after exec.

Tested by: pho (LA48 hardware)
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D25273

3 years agoamd64 pmap: LA57 AKA 5-level paging
Konstantin Belousov [Sun, 23 Aug 2020 20:19:04 +0000 (20:19 +0000)]
amd64 pmap: LA57 AKA 5-level paging

Since LA57 was moved to the main SDM document with revision 072, it
seems that we should have a support for it, and silicons are coming.

This patch makes pmap support both LA48 and LA57 hardware.  The
selection of page table level is done at startup, kernel always
receives control from loader with 4-level paging.  It is not clear how
UEFI spec would adapt LA57, for instance it could hand out control in
LA57 mode sometimes.

To switch from LA48 to LA57 requires turning off long mode, requesting
LA57 in CR4, then re-entering long mode.  This is somewhat delicate
and done in pmap_bootstrap_la57().  AP startup in LA57 mode is much
easier, we only need to toggle a bit in CR4 and load right value in CR3.

I decided to not change kernel map for now.  Single PML5 entry is
created that points to the existing kernel_pml4 (KML4Phys) page, and a
pml5 entry to create our recursive mapping for vtopte()/vtopde().
This decision is motivated by the fact that we cannot overcommit for
KVA, so large space there is unusable until machines start providing
wider physical memory addressing.  Another reason is that I do not
want to break our fragile autotuning, so the KVA expansion is not
included into this first step.  Nice side effect is that minidumps are
compatible.

On the other hand, (very) large address space is definitely
immediately useful for some userspace applications.

For userspace, numbering of pte entries (or page table pages) is
always done for 5-level structures even if we operate in 4-level mode.
The pmap_is_la57() function is added to report the mode of the
specified pmap, this is done not to allow simultaneous 4-/5-levels
(which is not allowed by hw), but to accomodate for EPT which has
separate level control and in principle might not allow 5-leve EPT
despite x86 paging supports it. Anyway, it does not seems critical to
have 5-level EPT support now.

Tested by: pho (LA48 hardware)
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D25273

3 years agoAdd definition for CR4.LA57 bit.
Konstantin Belousov [Sun, 23 Aug 2020 20:08:05 +0000 (20:08 +0000)]
Add definition for CR4.LA57 bit.

Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D25273

3 years agoPass pointers to info parsed from notes, to brandinfo->header_supported filter.
Konstantin Belousov [Sun, 23 Aug 2020 20:06:55 +0000 (20:06 +0000)]
Pass pointers to info parsed from notes, to brandinfo->header_supported filter.

Currently, we parse notes for the values of ELF FreeBSD feature flags
and osrel.  Knowing these values, or knowing that image does not carry
the note if pointers are NULL, is useful to decide which ABI variant
(brand) we want to activate for the image.

Right now this is only a plumbing change

Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D25273

3 years agoStyle.
Konstantin Belousov [Sun, 23 Aug 2020 20:05:35 +0000 (20:05 +0000)]
Style.

3 years agoReserve FreeBSD ELF feature control bit LA48 to control VA layout on amd64.
Konstantin Belousov [Sun, 23 Aug 2020 19:47:27 +0000 (19:47 +0000)]
Reserve FreeBSD ELF feature control bit LA48 to control VA layout on amd64.

Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D25273

3 years agokern_sharedpage.c: Add exec_sysvec_init_secondary() helper.
Konstantin Belousov [Sun, 23 Aug 2020 19:43:47 +0000 (19:43 +0000)]
kern_sharedpage.c: Add exec_sysvec_init_secondary() helper.

It allows a sysent to share existing usermode data in shared page with
other sysent, assuming ABI differences are not in the layout of the
page.

Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D25273

3 years agong_ubt: Add a device ID.
Mark Johnston [Sun, 23 Aug 2020 19:30:06 +0000 (19:30 +0000)]
ng_ubt: Add a device ID.

PR: 248838
Submitted by: Andrey Zholos <aaz@q-fu.com>
MFC after: 1 week

3 years agolibc: hide alphasort_thunk behind I_AM_SCANDIR_B
Mateusz Guzik [Sun, 23 Aug 2020 11:06:59 +0000 (11:06 +0000)]
libc: hide alphasort_thunk behind I_AM_SCANDIR_B

Should unbreak gcc build as reported by tinderbox:
lib/libc/gen/scandir.c:59:12: warning: 'alphasort_thunk' declared 'static' but never defined [-Wunused-function]

3 years agovfs: mark freevnode as noinline
Mateusz Guzik [Sun, 23 Aug 2020 11:05:26 +0000 (11:05 +0000)]
vfs: mark freevnode as noinline

3 years agocxgbe(4): Use large clusters for TOE rx queues when TOE+TLS is enabled.
Navdeep Parhar [Sun, 23 Aug 2020 04:16:20 +0000 (04:16 +0000)]
cxgbe(4): Use large clusters for TOE rx queues when TOE+TLS is enabled.

Rx is more efficient within the chip when the receive buffer size
matches the TLS PDU size.

MFC after: 3 days
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D26127

3 years agoFix several issues with process group orphanage.
Konstantin Belousov [Sat, 22 Aug 2020 21:32:11 +0000 (21:32 +0000)]
Fix several issues with process group orphanage.

Attempt of adding assertions that pgrp->pg_jobc counters do not
underflow in r361967, reverted in r362910, points out bugs in the
handling of job control.  Peter Holm was able to narrow down the
problem to very easy reproduction with timeout(1) which uses reaping.

The following list of problems with calculation of pg_jobs which
directs SIGHUP/SIGCONT delivery for orphaned process group was
identified:
- Re-calculation of the orphaned status for children of exiting parent
  was wrong, but mostly unnoticed when all children were reparented to
  init(8).  When child can be reparented to a different process which
  could affect the child' job control state, it was not properly
  accounted for in pg_jobc.
- Lockless check for exiting process' parent process group is racy
  because nothing prevents the parent from changing its group
  membership.
- Exited process is left in the process group, until waited. This
  affects other calculations of pg_jobc.

Split handling of job control status on process changing its process
group, and process exiting.  Calculate increments and decrements for
pg_jobs by exact checking the orphanage instead of assuming process
group membership for children and parent.  Move the call to killjobc()
later under the proctree_lock.  Mark exiting process in killjobc()
with a new flag P_TREE_GRPEXITED and skip it for all pg_jobc
calculations after the flag is set.

Add checker that independently recalculates pg_jobc value and compares
it with the memoized process group state. This is enabled under INVARIANTS.

Reviewed by: jilles
Discussed with: kevans
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D26116

3 years agomtree(8): add xref to mtree(5)
Ed Maste [Sat, 22 Aug 2020 20:52:02 +0000 (20:52 +0000)]
mtree(8): add xref to mtree(5)

mtree(5) and mtree(8) come from different contrib sources. The former
already had an xref to the latter, but not the other way around.

MFC after: 1 week

3 years agoFinish r364492 by renaming rt_flags to rte_flags for multipath code.
Alexander V. Chernikov [Sat, 22 Aug 2020 20:02:40 +0000 (20:02 +0000)]
Finish r364492 by renaming rt_flags to rte_flags for multipath code.

3 years agoRename rt_flags to rte_flags && reduce number of rt_nhop accesses.
Alexander V. Chernikov [Sat, 22 Aug 2020 19:30:56 +0000 (19:30 +0000)]
Rename rt_flags to rte_flags && reduce number of rt_nhop accesses.

No functional changes.

Most of the routing flags are stored in the netxtop instead of rtentry.
Rename rt->rt_flags to rt->rte_flags to simplify reading/modifying code
 checking routing flags.

In the new multipath code, rt->rt_nhop may actually point to nexthop group
 instead of nhop. To ease transition, reduce the amount of rt->rt_nhop->...
 accesses.

Differential Revision: https://reviews.freebsd.org/D26156

3 years agoWhitespace change to line up dev_sotfc definition.
Warner Losh [Sat, 22 Aug 2020 19:18:31 +0000 (19:18 +0000)]
Whitespace change to line up dev_sotfc definition.

3 years agoRetire obsolete sysctl hw.bus.devctl_disable
Warner Losh [Sat, 22 Aug 2020 19:02:15 +0000 (19:02 +0000)]
Retire obsolete sysctl hw.bus.devctl_disable

hw.bus.devctl_disable has tagged been obsolete for a decade. Remove it. Also
remove some long obsolete comments. This was done and backed out once in 2014,
but we've had enough releases with the 'new' method of setting queue length that
we can just remove this sysctl now (stable/11, stable/12 and current all don't
reference it).

3 years agoAdd test for checking RTF_HOST and RTAX_NETMASK inconsistency.
Alexander V. Chernikov [Sat, 22 Aug 2020 18:14:05 +0000 (18:14 +0000)]
Add test for checking RTF_HOST and RTAX_NETMASK inconsistency.

RTF_HOST indicates whether route is a host route
 (netmask is empty or /{32,128}).
Check that if netmask is empty and host route is not specified, kernel
 returns an error.

Differential Revision: https://reviews.freebsd.org/D26155

3 years agovfs: assert that HASBUF is only set with SAVENAME or SAVESTART
Mateusz Guzik [Sat, 22 Aug 2020 16:58:59 +0000 (16:58 +0000)]
vfs: assert that HASBUF is only set with SAVENAME or SAVESTART

as requested by the caller. The intent is to eradicate the mostly
spurious NDFREE_PNBUF calls.

3 years agocache: stronger vnode asserts in cache_enter_time
Mateusz Guzik [Sat, 22 Aug 2020 16:58:34 +0000 (16:58 +0000)]
cache: stronger vnode asserts in cache_enter_time

3 years agofd: pwd_drop after releasing filedesc lock
Mateusz Guzik [Sat, 22 Aug 2020 16:57:45 +0000 (16:57 +0000)]
fd: pwd_drop after releasing filedesc lock

Fixes a potential LOR against vnode lock.

3 years agoAdd a missed source file for LLVM's BPF target. This target is not
Dimitry Andric [Sat, 22 Aug 2020 15:31:56 +0000 (15:31 +0000)]
Add a missed source file for LLVM's BPF target. This target is not
enabled by default, so I forgot about it, apologies for the breakage.

Reported by: hrs
MFC after: 6 weeks
X-MFC-With: r364284

3 years agoacpi_iort: fix mapping end calculation
Ed Maste [Sat, 22 Aug 2020 14:39:14 +0000 (14:39 +0000)]
acpi_iort: fix mapping end calculation

According to the ARM Design Document "IO Remapping Table Platform"
(DEN 0049D), the "Number of IDs" field of the ID mapping format means
"The number of IDs in the range minus one".

Submitted by: Greg V <greg@unrelenting.technology>
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D25179

3 years agoFix a typo in r364438 affecting 32-bit platforms.
Mark Johnston [Sat, 22 Aug 2020 14:24:17 +0000 (14:24 +0000)]
Fix a typo in r364438 affecting 32-bit platforms.

Reported by: antoine
MFC with: r364438

3 years agoAdd a few new source files to libc++, in particular the implementation
Dimitry Andric [Sat, 22 Aug 2020 12:05:11 +0000 (12:05 +0000)]
Add a few new source files to libc++, in particular the implementation
part of std::random_shuffle. These were split off at some point by
upstream, but I forgot to add them to our Makefile.

This should allow some ports which use std::random_shuffle to correctly
link again.

Reported by: thierry
PR: 248795
MFC after: 6 weeks
X-MFX-With: r364284

3 years agosysctl(8): clarify -n flag
Fernando Apesteguía [Sat, 22 Aug 2020 11:59:14 +0000 (11:59 +0000)]
sysctl(8): clarify -n flag

-n omits the name of the variable regardless of the type of information that is
requested. Rephrase to clarify this point.

PR: 242191
Submitted by: stilezy@gmail.com
Approved by: emaste@
Differential Revision: https://reviews.freebsd.org/D26149

3 years agoMerge commit 1ce07cd614be from llvm git (by me):
Dimitry Andric [Sat, 22 Aug 2020 10:55:55 +0000 (10:55 +0000)]
Merge commit 1ce07cd614be from llvm git (by me):

  Instantiate Error in Target::GetEntryPointAddress() only when
  necessary

  When Target::GetEntryPointAddress() calls
  exe_module->GetObjectFile()->GetEntryPointAddress(), and the returned
  entry_addr is valid, it can immediately be returned.

  However, just before that, an llvm::Error value has been setup, but
  in this case it is not consumed before returning, like is done
  further below in the function.

  In https://bugs.freebsd.org/248745 we got a bug report for this,
  where a very simple test case aborts and dumps core:

  * thread #1, name = 'testcase', stop reason = breakpoint 1.1
      frame #0: 0x00000000002018d4 testcase`main(argc=1, argv=0x00007fffffffea18) at testcase.c:3:5
     1    int main(int argc, char *argv[])
     2    {
  -> 3        return 0;
     4    }
  (lldb) p argc
  Program aborted due to an unhandled Error:
  Error value was Success. (Note: Success values must still be checked prior to being destroyed).

  Thread 1 received signal SIGABRT, Aborted.
  thr_kill () at thr_kill.S:3
  3       thr_kill.S: No such file or directory.
  (gdb) bt
  #0  thr_kill () at thr_kill.S:3
  #1  0x00000008049a0004 in __raise (s=6) at /usr/src/lib/libc/gen/raise.c:52
  #2  0x0000000804916229 in abort () at /usr/src/lib/libc/stdlib/abort.c:67
  #3  0x000000000451b5f5 in fatalUncheckedError () at /usr/src/contrib/llvm-project/llvm/lib/Support/Error.cpp:112
  #4  0x00000000019cf008 in GetEntryPointAddress () at /usr/src/contrib/llvm-project/llvm/include/llvm/Support/Error.h:267
  #5  0x0000000001bccbd8 in ConstructorSetup () at /usr/src/contrib/llvm-project/lldb/source/Target/ThreadPlanCallFunction.cpp:67
  #6  0x0000000001bcd2c0 in ThreadPlanCallFunction () at /usr/src/contrib/llvm-project/lldb/source/Target/ThreadPlanCallFunction.cpp:114
  #7  0x00000000020076d4 in InferiorCallMmap () at /usr/src/contrib/llvm-project/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp:97
  #8  0x0000000001f4be33 in DoAllocateMemory () at /usr/src/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp:604
  #9  0x0000000001fe51b9 in AllocatePage () at /usr/src/contrib/llvm-project/lldb/source/Target/Memory.cpp:347
  #10 0x0000000001fe5385 in AllocateMemory () at /usr/src/contrib/llvm-project/lldb/source/Target/Memory.cpp:383
  #11 0x0000000001974da2 in AllocateMemory () at /usr/src/contrib/llvm-project/lldb/source/Target/Process.cpp:2301
  #12 CanJIT () at /usr/src/contrib/llvm-project/lldb/source/Target/Process.cpp:2331
  #13 0x0000000001a1bf3d in Evaluate () at /usr/src/contrib/llvm-project/lldb/source/Expression/UserExpression.cpp:190
  #14 0x00000000019ce7a2 in EvaluateExpression () at /usr/src/contrib/llvm-project/lldb/source/Target/Target.cpp:2372
  #15 0x0000000001ad784c in EvaluateExpression () at /usr/src/contrib/llvm-project/lldb/source/Commands/CommandObjectExpression.cpp:414
  #16 0x0000000001ad86ae in DoExecute () at /usr/src/contrib/llvm-project/lldb/source/Commands/CommandObjectExpression.cpp:646
  #17 0x0000000001a5e3ed in Execute () at /usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandObject.cpp:1003
  #18 0x0000000001a6c4a3 in HandleCommand () at /usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:1762
  #19 0x0000000001a6f98c in IOHandlerInputComplete () at /usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:2760
  #20 0x0000000001a90b08 in Run () at /usr/src/contrib/llvm-project/lldb/source/Core/IOHandler.cpp:548
  #21 0x00000000019a6c6a in ExecuteIOHandlers () at /usr/src/contrib/llvm-project/lldb/source/Core/Debugger.cpp:903
  #22 0x0000000001a70337 in RunCommandInterpreter () at /usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:2946
  #23 0x0000000001d9d812 in RunCommandInterpreter () at /usr/src/contrib/llvm-project/lldb/source/API/SBDebugger.cpp:1169
  #24 0x0000000001918be8 in MainLoop () at /usr/src/contrib/llvm-project/lldb/tools/driver/Driver.cpp:675
  #25 0x000000000191a114 in main () at /usr/src/contrib/llvm-project/lldb/tools/driver/Driver.cpp:890

  Fix the incorrect error catch by only instantiating an Error object
  if it is necessary.

  Reviewed By: JDevlieghere

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

This should fix lldb aborting as described in the scenario above.

Reported by: dmgk
PR: 248745

3 years agoFix tinderbox build after r364465
Mateusz Guzik [Sat, 22 Aug 2020 07:43:38 +0000 (07:43 +0000)]
Fix tinderbox build after r364465

3 years agovfs: add a work around for vp_crossmp bug to realpath
Mateusz Guzik [Sat, 22 Aug 2020 06:56:04 +0000 (06:56 +0000)]
vfs: add a work around for vp_crossmp bug to realpath

The actual bug is not yet addressed as it will get much easier after other
problems are addressed (most notably rename contract).

The only affected in-tree consumer is realpath. Everyone else happens to be
performing lookups within a mount point, having a side effect of ni_dvp being
set to mount point's root vnode in the worst case.

Reported by: pho

3 years agoAdd an entry for r364475.
Rick Macklem [Sat, 22 Aug 2020 04:07:44 +0000 (04:07 +0000)]
Add an entry for r364475.

3 years agor364475 changed the internal API between the kernel RPC and NFS, so bump version.
Rick Macklem [Sat, 22 Aug 2020 04:01:05 +0000 (04:01 +0000)]
r364475 changed the internal API between the kernel RPC and NFS, so bump version.

3 years agoAdd TLS support to the kernel RPC.
Rick Macklem [Sat, 22 Aug 2020 03:57:55 +0000 (03:57 +0000)]
Add TLS support to the kernel RPC.

An internet draft titled "Towards Remote Procedure Call Encryption By Default"
describes how TLS is to be used for Sun RPC, with NFS as an intended use case.
This patch adds client and server support for this to the kernel RPC,
using KERN_TLS and upcalls to daemons for the handshake, peer reset and
other non-application data record cases.

The upcalls to the daemons use three fields to uniquely identify the
TCP connection. They are the time.tv_sec, time.tv_usec of the connection
establshment, plus a 64bit sequence number. The time fields avoid problems
with re-use of the sequence number after a daemon restart.
For the server side, once a Null RPC with AUTH_TLS is received, kernel
reception on the socket is blocked and an upcall to the rpctlssd(8) daemon
is done to perform the TLS handshake.  Upon completion, the completion
status of the handshake is stored in xp_tls as flag bits and the reply to
the Null RPC is sent.
For the client, if CLSET_TLS has been set, a new TCP connection will
send the Null RPC with AUTH_TLS to initiate the handshake.  The client
kernel RPC code will then block kernel I/O on the socket and do an upcall
to the rpctlscd(8) daemon to perform the handshake.
If the upcall is successful, ct_rcvstate will be maintained to indicate
if/when an upcall is being done.

If non-application data records are received, the code does an upcall to
the appropriate daemon, which will do a SSL_read() of 0 length to handle
the record(s).

When the socket is being shut down, upcalls are done to the daemons, so
that they can perform SSL_shutdown() calls to perform the "peer reset".

The rpctlssd(8) and rpctlscd(8) daemons require a patched version of the
openssl library and, as such, will not be committed to head at this time.

Although the changes done by this patch are fairly numerous, there should
be no semantics change to the kernel RPC at this time.
A future commit to the NFS code will optionally enable use of TLS for NFS.

3 years agoVendor import of Unbound 1.11.0.
Cy Schubert [Fri, 21 Aug 2020 22:56:05 +0000 (22:56 +0000)]
Vendor import of Unbound 1.11.0.

3 years agoImport sqlite 3.32.3 (3330000).
Cy Schubert [Fri, 21 Aug 2020 22:54:38 +0000 (22:54 +0000)]
Import sqlite 3.32.3 (3330000).

3 years agoAfter the clang/llvm version 11 import LLD_VERSION is no longer used
Bjoern A. Zeeb [Fri, 21 Aug 2020 22:31:45 +0000 (22:31 +0000)]
After the clang/llvm version 11 import LLD_VERSION is no longer used
upstream so Version.inc now only defines LLD_VERSION_STRING.

This breaks the WANT_LINKER_VERSION magic and might lead to us building
more than needed (e.g., for croos-tools).

Change the awk script to parse LLD_VERSION_STRING instead of LLD_VERSION,
which not only unbreaks the current situation but should also be backwards
compatible as dim points out.

PR: 248818
Reviewed by: emaste, dim (seems right and the way to go)
MFC after: 4 weeks
X-MFC before: 364284

3 years agoMake net.fibs growable.
Alexander V. Chernikov [Fri, 21 Aug 2020 21:34:52 +0000 (21:34 +0000)]
Make net.fibs growable.

Allow to dynamically grow the amount of fibs in each vnet.

This change alters current behavior. Currently, if one defines
 ROUTETABLES > 1 in the kernel config, each vnet will be created
 with the number of fibs defined in the kernel config.
 After this commit vnets will be created with fibs=1.

Dynamic net.fibs is not compatible with net.add_addr_allfibs.
 The plan is to deprecate the latter and make
 net.add_addr_allfibs=0 default behaviour.

Reviewed by: glebius
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D26062

3 years agovfs: fix freevnode accounting
Mateusz Guzik [Fri, 21 Aug 2020 21:24:14 +0000 (21:24 +0000)]
vfs: fix freevnode accounting

Most notably add the missing decrement to vhold_smr.

    .-'---`-.
  ,'          `.
  |             \
  |              \
  \           _  \
  ,\  _    ,'-,/-)\
  ( * \ \,' ,' ,'-)
   `._,)     -',-')
     \/         ''/
      )        / /
     /       ,'-'

Reported by: Dan Nelson <dnelson_1901@yahoo.com>
Fixes: r362827 ("vfs: protect vnodes with smr")

3 years agoFix CTL ioctl port creation error handling.
Alexander Motin [Fri, 21 Aug 2020 20:10:29 +0000 (20:10 +0000)]
Fix CTL ioctl port creation error handling.

Submitted by: Bret Ketchum
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D26143

3 years agoixgbe: fix impossible condition
Eric van Gyzen [Fri, 21 Aug 2020 19:34:41 +0000 (19:34 +0000)]
ixgbe: fix impossible condition

Coverity flagged this condition: The condition
    offset == 0 && offset == 65535
can never be true because offset cannot be equal
to two different values at the same time.

Submitted by: bret_ketchum@dell.com
Reported by: Coverity
Reviewed by: tsoome, cem
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D26144

3 years agouma: record allocation failures due to zone limits
Andrew Gallatin [Fri, 21 Aug 2020 18:31:57 +0000 (18:31 +0000)]
uma: record allocation failures due to zone limits

The zone limit mechanism was recently reworked, and
allocation failures due to limits being exceeded
were inadvertently no longer being recorded. This
would lead to, for example, mbuf allocation failures
not being indicated in netstat -m or vmstat -z

Reviewed by: markj
Sponsored by: Netflix

3 years agoipfw(8): Fix typo in man page
Fernando Apesteguía [Fri, 21 Aug 2020 17:45:17 +0000 (17:45 +0000)]
ipfw(8): Fix typo in man page

s/exmaple/example

Approved by: manpages (gbe@)
Differential Revision: https://reviews.freebsd.org/D26147

3 years agoamd64 pmap: potential integer overflowing expression
Eric van Gyzen [Fri, 21 Aug 2020 14:22:32 +0000 (14:22 +0000)]
amd64 pmap: potential integer overflowing expression

Coverity has identified the line in this change as "Potential integer
overflowing expression" due to the variable i declared as an int
and used in an expression with vm_paddr_t, a 64bit variable.

This change has very little effect as when this line is execute
nkpt is small and phys_addr is a the beginning of physical memory.
But there is no explicit protection that the above is true.

Submitted by: bret_ketchum@dell.com
Reported by: Coverity
Reviewed by: markj
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D26141

3 years agoMerge commit 95e18b2d9d5f from llvm git (by Kang Zhang):
Dimitry Andric [Fri, 21 Aug 2020 10:06:01 +0000 (10:06 +0000)]
Merge commit 95e18b2d9d5f from llvm git (by Kang Zhang):

  [PowerPC] Fix a typo for InstAlias of mfsprg

  D77531 has a type for mfsprg, it should be mtsprg. This patch is to
  fix this typo.

This should fix booting powerpc64 kernels, after LLVM 11 was imported.

PR: 248763

3 years agoReference spi(8) from spigen.4
Mateusz Piotrowski [Fri, 21 Aug 2020 09:50:03 +0000 (09:50 +0000)]
Reference spi(8) from spigen.4

MFC after: 2 weeks

3 years agoClean up spi.8
Mateusz Piotrowski [Fri, 21 Aug 2020 09:48:00 +0000 (09:48 +0000)]
Clean up spi.8

- Remove trailing whitespace
- Address igor and mandoc warnings
- Sort options
- Use macros consistently (e.g., Fl for flags, Dq for quoting, Bd for code
  blocks)
- Add a history section
- Fix incorrect use of macros in various places

MFC after: 2 weeks

3 years agogre(4): Mention sysctl for nesting gre tunnels
Gordon Bergling [Fri, 21 Aug 2020 07:03:54 +0000 (07:03 +0000)]
gre(4): Mention sysctl for nesting gre tunnels

PR: 228465
Submitted by: Sergey Akhmatov <sergey at akhmatov dot ru>
Reviewed by: bcr
Approved by: bcr
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26097

3 years agols(1): Update POSIX conformance from 2001 to 2008
Gordon Bergling [Fri, 21 Aug 2020 06:20:11 +0000 (06:20 +0000)]
ls(1): Update POSIX conformance from 2001 to 2008

- Update the options that are non-existing in POSIX from 2001 to 2008
- Update POSIX conformance in the STANDARDS section from 2001 to 2008

Verified by checking [1].

[1] https://pubs.opengroup.org/onlinepubs/9699919799.2016edition/toc.htm

PR: 140435
Submitted by: Dan Lukes <dan at obluda dot cz>
Reviewed by: bcr
Approved by: bcr
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26096

3 years ago[PowerPC] Fix translation-related crashes during startup
Brandon Bergren [Fri, 21 Aug 2020 03:31:01 +0000 (03:31 +0000)]
[PowerPC] Fix translation-related crashes during startup

After spending a lot of time trying to track down what was going on, I have
isolated the "black screen" failures when using boot1 to boot a G4 machine.

It turns out we were replacing the traps before installing the temporary
BAT entry for the bottom of physical memory. That meant that until the MMU
was bootstrapped, the cached translations were the only thing keeping us
from losing.

Throwing boot1 into the mix was affecting execution flow enough to cause us
to hit an uncached page and crash.

Fix this by properly setting up the initial BAT entry at the same time we
are replacing the OpenFirmware traps, so we can continue executing in
segment 0 until the rest of the DMAP has been set up.

A second thing discovered while researching this is that we were entering a
BAT region for segment 16. It turns out this range was a) considered part
of KVA, and b) has firmware mappings with varying attributes.

If we ever accessed an unmapped page in segment 16, it would cause a BAT
entry to be installed for the whole segment, which would bypass the
existing mappings until it was flushed out again.

Instead, translate the OFW memory attributes into VM memory attributes and
install the ranges into the kernel address space properly.

Reviewed by: adalava
MFC after: 3 weeks
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D25547

3 years ago[PowerPC64] Fix invalid OPAL call in xive_bind().
Brandon Bergren [Fri, 21 Aug 2020 03:23:10 +0000 (03:23 +0000)]
[PowerPC64] Fix invalid OPAL call in xive_bind().

This fixes spurious "XIVE[ IC 00  ] ISN 1 lead to invalid IVE !" messages
generated by OPAL when running with the debug level cranked up.

Discussed with jhibbits.

Sponsored by: Tag1 Consulting, Inc.