Commit Graph

256039 Commits

Author SHA1 Message Date
Kyle Evans
9af9e7c5cc pkgbase: default to installing all specified kernels
These only get staged off to the side, not installed into the system. Let's
change the default for packages/update-packages to be less surprising.

MFC after:	1 week
Reviewed by:	manu, meena <me igalic co>
Differential Revision:	https://reviews.freebsd.org/D28190
2021-01-17 14:05:33 -06:00
Conrad Meyer
ddf6115613 fstyp(8): fix exfat detection
In the presence of high-level errors (spec violations, bad boot blocks
checksum), report non-detection instead of detection.

PR:	252787 (related, but does not fully address)
2021-01-17 11:55:06 -08:00
Konstantin Belousov
f3ea417f96 x86 busdma_bounce: use malloc_domainset_aligned(9).
This stops busdma bounce making assumptions about alignment of malloc(9)
results, which are no longer true.

Also add assert that the result of malloc_aligned() fits into single
page, which is the assumption of the code.

Reported by:	dim
Reviewed by:	andrew, jah, markj
Tested by:	pho
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D28147
2021-01-17 19:29:05 +02:00
Konstantin Belousov
3b15beb30b Implement malloc_domainset_aligned(9).
Change the power-of-two malloc zones to require alignment equal to the
size [*].  Current uma allocator already provides such alignment, so in
fact this change does not change anything except providing future-proof
setup.

Suggested by:	markj [*]
Reviewed by:	andrew, jah, markj
Tested by:	pho
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D28147
2021-01-17 19:29:05 +02:00
Ed Maste
e83b514a95 cat: depend on Makefile to rebuild when WITH_CASPER changes
We try to ensure building WITHOUT_CLEAN (or -DNO_CLEAN) works on an
ongoing basis.  b7ab6832cd changed cat to build w/o -DWITH_CASPER
by default; add a cat.o dependency on the Makefile so that it gets
rebuilt.
2021-01-17 12:19:00 -05:00
Emmanuel Vadot
d002814d6b loader: Use TERM_EMU for arm and arm64
Even if it didn't behave well previously this is fixed.
Tested on: OrangePi One (armv7 u-boot) (serial only and serial + HDMI)
Tested on: Pine64-LTS (aarch64 u-boot) (serial only and serial + HDMI)
Tested on: Honeycomb (aarch64 EDK2) (serial only)

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D28153
2021-01-17 17:44:16 +01:00
Emmanuel Vadot
0f2434ea00 loader: Partial revert of 987eabdc2a
The arm relocation code doesn't not work and make loader not loading
dependancies.

Reported by:	Dr. Rolf Jansen <freebsd-rj@obsigna.com>
2021-01-17 17:41:25 +01:00
Lutz Donnerhacke
5c6c1b5421 Add myself (donner) as src committer.
Reviewed by:    kp
Approved by:    kp (mentor)
Differential Revision: https://reviews.freebsd.org/D27968
2021-01-17 17:19:45 +01:00
Toomas Soome
52ec89a93c loader.efi: commands gop, uga and autoresize should use cached data
We are setting up pointers for gop or uga protocol in
efi_find_framebuffer(), reuse those pointers.
2021-01-17 15:33:48 +02:00
Emmanuel Vadot
72c551930b Bump __FreeBSD_version after linuxkpi changes 2021-01-17 12:47:28 +01:00
Vladimir Kondratyev
ec25b6fa5f LinuxKPI: Reimplement irq_work queue on top of fast taskqueue
Summary:
Linux's irq_work queue was created for asynchronous execution of code from contexts where spin_lock's are not available like "hardware interrupt context". FreeBSD's fast taskqueues was created for the same purposes.

Drm-kmod 5.4 uses irq_work_queue() at least in one place to schedule execution of task/work from the critical section that triggers following INVARIANTS-induced panic:

```
panic: acquiring blockable sleep lock with spinlock or critical section held (sleep mutex) linuxkpi_short_wq @ /usr/src/sys/kern/subr_taskqueue.c:281
cpuid = 6
time = 1605048416
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe006b538c90
vpanic() at vpanic+0x182/frame 0xfffffe006b538ce0
panic() at panic+0x43/frame 0xfffffe006b538d40
witness_checkorder() at witness_checkorder+0xf3e/frame 0xfffffe006b538f00
__mtx_lock_flags() at __mtx_lock_flags+0x94/frame 0xfffffe006b538f50
taskqueue_enqueue() at taskqueue_enqueue+0x42/frame 0xfffffe006b538f70
linux_queue_work_on() at linux_queue_work_on+0xe9/frame 0xfffffe006b538fb0
irq_work_queue() at irq_work_queue+0x21/frame 0xfffffe006b538fd0
semaphore_notify() at semaphore_notify+0xb2/frame 0xfffffe006b539020
__i915_sw_fence_notify() at __i915_sw_fence_notify+0x2e/frame 0xfffffe006b539050
__i915_sw_fence_complete() at __i915_sw_fence_complete+0x63/frame 0xfffffe006b539080
i915_sw_fence_complete() at i915_sw_fence_complete+0x8e/frame 0xfffffe006b5390c0
dma_i915_sw_fence_wake() at dma_i915_sw_fence_wake+0x4f/frame 0xfffffe006b539100
dma_fence_signal_locked() at dma_fence_signal_locked+0x105/frame 0xfffffe006b539180
dma_fence_signal() at dma_fence_signal+0x72/frame 0xfffffe006b5391c0
dma_fence_is_signaled() at dma_fence_is_signaled+0x80/frame 0xfffffe006b539200
dma_resv_add_shared_fence() at dma_resv_add_shared_fence+0xb3/frame 0xfffffe006b539270
i915_vma_move_to_active() at i915_vma_move_to_active+0x18a/frame 0xfffffe006b5392b0
eb_move_to_gpu() at eb_move_to_gpu+0x3ad/frame 0xfffffe006b539320
eb_submit() at eb_submit+0x15/frame 0xfffffe006b539350
i915_gem_do_execbuffer() at i915_gem_do_execbuffer+0x7d4/frame 0xfffffe006b539570
i915_gem_execbuffer2_ioctl() at i915_gem_execbuffer2_ioctl+0x1c1/frame 0xfffffe006b539600
drm_ioctl_kernel() at drm_ioctl_kernel+0xd9/frame 0xfffffe006b539670
drm_ioctl() at drm_ioctl+0x5cd/frame 0xfffffe006b539820
linux_file_ioctl() at linux_file_ioctl+0x323/frame 0xfffffe006b539880
kern_ioctl() at kern_ioctl+0x1f4/frame 0xfffffe006b5398f0
sys_ioctl() at sys_ioctl+0x12a/frame 0xfffffe006b5399c0
amd64_syscall() at amd64_syscall+0x121/frame 0xfffffe006b539af0
fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe006b539af0
--- syscall (54, FreeBSD ELF64, sys_ioctl), rip = 0x800a6f09a, rsp = 0x7fffffffe588, rbp = 0x7fffffffe640 ---
KDB: enter: panic
```
Here, the  dma_resv_add_shared_fence() performs a critical_enter() and following call of schedule_work() from semaphore_notify() triggers 'acquiring blockable sleep lock with spinlock or critical section held' panic.

Switching irq_work implementation to fast taskqueue fixes the panic for me.

Other report with the similar bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247166

Reviewed By: hselasky
Differential Revision: https://reviews.freebsd.org/D27171
2021-01-17 12:47:28 +01:00
Toomas Soome
9adce1aedd loader.efi: variable 'hlist' is uninitialized
framebuffer.c:481:65: error: variable 'hlist' is uninitialized
2021-01-17 13:46:00 +02:00
Toomas Soome
fb3a792a88 loader.efi: unused variable 'mode'
framebuffer.c:707:8: error: unused variable 'mode' [-Wunused-variable]
        u_int mode;
2021-01-17 13:39:44 +02:00
Mariusz Zaborski
b7ab6832cd cat: disable building it with Casper
We want to measure what are the actual cost of sandboxing cat(1).

Requested by:	mjg, cy, Mike Karels
Discussed with:	rwatson, markj
2021-01-17 01:21:46 +01:00
Alexander V. Chernikov
d28210b2c2 Remove remnants of classful behavior in route(8).
Curently route(8) treats some addresses as network addresses:

 RTA_DST: inet 10.0.0.0; RTA_NETMASK: inet 255.0.0.0; RTA_IFP: link ;
 RTM_GET: Report Metrics: len 240, pid: 0, seq 1, errno 0, flags:<UP,GATEWAY,STATIC>
 locks:  inits:
 sockaddrs: <DST,NETMASK,IFP>
   10.0.0.0 255.0.0.0 link#0

Note added `RTA_NETMASK` in the request.

Host address from the same network is ok:

route -nv get 10.0.0.1
 RTA_DST: inet 10.0.0.1
 RTA_IFP: link
 RTM_GET: Report Metrics: len 224, pid: 0, seq 1, errno 0, flags:<UP,GATEWAY,HOST,STATIC>
...
   route to: 10.0.0.1
destination: 10.0.0.0
       mask: 255.255.255.0

This change eliminates network auto-guessing part AND reading network from /etc/networks.

Reviewed By: rgrimes

Differential Revision: https://reviews.freebsd.org/D24401
2021-01-16 23:45:30 +00:00
Sebastian Oswald
0ec6c03c76 mpt.4: Warn about unexpected behaviour on older controllers
Older controllers have errata which causes the disk controller to wrap
data to other LBAs, causing data to be overwritten. [1]

While here, fix a small typo.

1: https://www.broadcom.com/support/knowledgebase/1211161496563/3-terabyte-3tb-capacity-drives-on-lsi-megaraid-and-3ware-control

PR: 220343
Submitted by:	Sebastian Oswald <sebastian at rostwald.de>
Reviewed by:	0mp
Event:		January 2021 Bugathon
Differential Revision:	<https://reviews.freebsd.org/D28201
2021-01-17 00:41:59 +01:00
Toomas Soome
ef698fabe4 loader.efi: handle multiple gop instances
Some systems may provide multiple GOP instances and not all are
bound to hardware. The current loader is picking up the first GOP,
which may not be usable. Instead we load the GOP handle array,
and test every handle to have registered ConOut protocol. If ConOut is
present, we can use this GOP handle to open GOP protocol.
2021-01-17 01:29:35 +02:00
Marius Strobl
944041f936 wl(4): remove obsolete header
It's unused since 09b9789b28 and r304506
respectively and should have gone along with these.
2021-01-17 00:03:17 +01:00
Marius Strobl
0cdfc33805 man4: bring back ofw_console.4 and openfirm.4
Back when I wrote openfirm.4, sparc64 was the only architecture to
include the corresponding device. However, nowadays all supported
architectures will provied this Open Firmware interface, even x86
when built with FDT support.
As for ofw_console(4), powerpc actually was the first architecture
to ship it but we'll probably not see another consumer in future.

This partially reverts 702547720c and
r357794 respectively, adjusting paths and content as appropriate.
2021-01-16 23:53:13 +01:00
Marius Strobl
daad26e5fc openpromio(4): remove obsolete pseudo device driver
It's unused since 58aa35d429 and r357455
respectively and should have gone along with these.
2021-01-16 23:53:13 +01:00
Marius Strobl
145f01a3df kerneldoc: remove Doxyfile for cmx(4)
The latter has been removed in 0d3a424a89.
2021-01-16 23:53:13 +01:00
Marius Strobl
ee7231c929 targets: no longer depend on bt3cfw(8)
The latter has been removed in 23e124c78b.
2021-01-16 23:53:13 +01:00
Marius Strobl
33b486472e bluetooth: remove support for bt3c(4)
The latter has been removed in 23e124c78b.
2021-01-16 23:53:13 +01:00
Marius Strobl
bb34c63905 bluetooth.device.conf.5/netgraph.4: remove reference to ng_bt3c(4)
The latter has been removed in 23e124c78b.
2021-01-16 23:53:12 +01:00
Marius Strobl
f83a5c2382 hier.7/wlan.4: remove reference to wi(4)
The latter has been removed in a21def4d56.
2021-01-16 23:53:12 +01:00
Marius Strobl
d65427ad58 sym(4): Remove remainder of SYM_SETUP_LP_PROBE_MAP support
Missed in 221ac8f4cd and r339575
respectively.
2021-01-16 23:53:12 +01:00
Alexander V. Chernikov
81728a538d Split rtinit() into multiple functions.
rtinit[1]() is a function used to add or remove interface address prefix routes,
  similar to ifa_maintain_loopback_route().
It was intended to be family-agnostic. There is a problem with this approach
 in reality.

1) IPv6 code does not use it for the ifa routes. There is a separate layer,
  nd6_prelist_(), providing interface for maintaining interface routes. Its part,
  responsible for the actual route table interaction, mimics rtenty() code.

2) rtinit tries to combine multiple actions in the same function: constructing
  proper route attributes and handling iterations over multiple fibs, for the
  non-zero net.add_addr_allfibs use case. It notably increases the code complexity.

3) dstaddr handling. flags parameter re-uses RTF_ flags. As there is no special flag
 for p2p connections, host routes and p2p routes are handled in the same way.
 Additionally, mapping IFA flags to RTF flags makes the interface pretty messy.
 It make rtinit() to clash with ifa_mainain_loopback_route() for IPV4 interface
 aliases.

4) rtinit() is the last customer passing non-masked prefixes to rib_action(),
 complicating rib_action() implementation.

5) rtinit() coupled ifa announce/withdrawal notifications, producing "false positive"
 ifa messages in certain corner cases.

To address all these points, the following has been done:

* rtinit() has been split into multiple functions:
- Route attribute construction were moved to the per-address-family functions,
 dealing with (2), (3) and (4).
- funnction providing net.add_addr_allfibs handling and route rtsock notificaions
 is the new routing table inteface.
- rtsock ifa notificaion has been moved out as well. resulting set of funcion are only
 responsible for the actual route notifications.

Side effects:
* /32 alias does not result in interface routes (/32 route and "host" route)
* RTF_PINNED is now set for IPv6 prefixes corresponding to the interface addresses

Differential revision:	https://reviews.freebsd.org/D28186
2021-01-16 22:42:41 +00:00
Daniel Ebdrup Jensen
bce5d6aa24 service.8: Use entire section of literally displayed text
.Dl indents literal display text for one line, but .Bd can do it for a
whole subsection.

Pointy hat to:	debdrup
Reported by:	0mp
Reviewed by:	0mp
Differential Revision:	https://reviews.freebsd.org/D28198
2021-01-16 23:21:05 +01:00
Daniel Ebdrup Jensen
c6a112cf84 service.8: Provide example for adding completions to (t)csh
service(8) has an example for bash completion, however bash is third
party and in /usr/share/examples/csh/dot.cshrc is a working example for
csh.

Since I use (t)csh, I've tested it, and it works for me.

PR:		179497
Submitted by:	ohauer@

Reviewed by:	kp (tentatively)
Differential Revision:	https://reviews.freebsd.org/D28197
2021-01-16 22:05:29 +01:00
Toomas Soome
3ddf7eade0 loader.efi: Use Blt with gop as default
System with FB address 0x4000000000 does not draw, Blt() is doing fine.
I think, we can assume the Blt will usually work.
2021-01-16 17:39:40 +02:00
Dimitry Andric
7593c13e18 Add libclang_rt.profile-powerpc64le.a to (Optional)?ObsoleteFiles.inc
On little-endian PowerPC64, this prevented /usr/lib/clang/11.0.0 being
cleaned up completely after upgrading to clang 11.0.1.

Noticed by:	pkubaj
MFC after:	4 weeks
X-MFC-With:	r364284
2021-01-16 17:25:56 +01:00
Mariusz Zaborski
de57c3d882 cat: style nits 2021-01-16 12:58:23 +01:00
Mariusz Zaborski
6e8062c855 cat: persistent errno
There is no guarantee that after close(2)/free the errno will remain
persistent. The caller of the udom_open function depends on the errno
for reporting errors.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D28185
2021-01-16 12:55:42 +01:00
Emmanuel Vadot
8ca9ff4f28 mips: Fix build by using the correct device-tree include path 2021-01-16 11:34:10 +01:00
Emmanuel Vadot
a0ee5920be mips: Add the device-tree path to the include paths 2021-01-16 11:33:37 +01:00
Emmanuel Vadot
fa67846c6f riscv: Fix build by using the correct device-tree include path 2021-01-16 11:31:39 +01:00
Emmanuel Vadot
384bd0b5b0 riscv: Add the device-tree path to the include path 2021-01-16 11:31:17 +01:00
Mateusz Guzik
fe258f23ef Save on getpid in setproctitle by supporting -1 as curproc. 2021-01-16 09:36:54 +01:00
Vincenzo Maffione
2968dde3de axgbe: driver changes for netmap support
AMD 10GbE hardware is designed to have two buffers per receive descriptor to
support split header feature. For this purpose, the driver was designed to use
2 iflib freelists per receive queue. So, that buffers from 2 freelists are used
to refill an entry in the receive descriptor. The current design holds good
with regular data traffic.

But, when netmap comes into play, the current design will not fit in. The
current netmap interfaces and netmap implementation in iflib doesn't seem
to accomodate the design of 2 freelists per receive queue. So, exercising
Netmap capability with inbuilt tools like bridge, pkt-gen doesn't work with
the 2 freelists driver design.

So, the driver design is changed to accomodate the current netmap interfaces
and netmap implementation in iflib by using single freelist per receive queue
approach when Netmap capability is exercised without disturbing the current
2 freelists approach.
The dev.ax.sph_enable tunable can be set to 0 to configure the single
free list mode.

Thanks to Stephan Dewt for his Initial set of code changes for the stated
problem.

Submitted by:	rajesh1.kumar_amd.com
Approved by:	vmaffione
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D27797
2021-01-16 08:29:33 +00:00
Toomas Soome
ad1ebbe5ce loader: create local copy of mode list provided by vbeinfoblock
Apparently some systems do corrupt mode list memory area, so we need
to use local copy instead.
2021-01-16 12:23:22 +02:00
Kyle Evans
0bc776f3da make check: suppress echo of kyua binary location
986deea5b5 inadvertently removed this; fix it.
2021-01-16 00:07:50 -06:00
Kyle Evans
6dd869c22b bectl: remove spurious aok variable
This rode in with the OpenZFS import. It may have been necessary at some
point, but it is no longer and it breaks the WITHOUT_DYNAMICROOT build as
it collides with the definition in libspl.

Reported-by:	Michael Dexter
2021-01-16 00:07:50 -06:00
Kyle Evans
de661c9f86 bectl: tests: use -R <mount> instead of specifying altroot
-R is currently shorthand for cachefile=none, altroot=<mount>.  This is
functionally the same, but perhaps more resilient to future changes that
could be necessary that may be added when -R is specified.

MFC after:	 1 week
2021-01-16 00:07:50 -06:00
Kirk McKusick
79a5c790bd Eliminate a locking panic when cleaning up UFS snapshots after a
disk failure.

Each vnode has an embedded lock that controls access to its contents.
However vnodes describing a UFS snapshot all share a single snapshot
lock to coordinate their access and update. As part of mounting a
UFS filesystem with snapshots, each of the vnodes describing a
snapshot has its individual lock replaced with the snapshot lock.
When the filesystem is unmounted the vnode's original lock is
returned replacing the snapshot lock.

When a disk fails while the UFS filesystem it contains is still
mounted (for example when a thumb drive is removed) UFS forcibly
unmounts the filesystem. The loss of the drive causes the GEOM
subsystem to orphan the provider, but the consumer remains until
the filesystem has finished with the unmount. Information describing
the snapshot locks was being prematurely cleared during the orphaning
causing the return of the snapshot vnode's original locks to fail.
The fix is to not clear the needed information prematurely.

Sponsored by: Netflix
2021-01-15 16:36:42 -08:00
Kirk McKusick
173779b98f Eliminate lock order reversal in UFS when unmounting filesystems
with snapshots.

Each vnode has an embedded lock that controls access to its contents.
However vnodes describing a UFS snapshot all share a single snapshot
lock to coordinate their access and update.  As part of mounting a
UFS filesystem with snapshots, each of the vnodes describing a
snapshot has its individual lock replaced with the snapshot lock.
When the filesystem is unmounted the vnode's original lock is
returned replacing the snapshot lock.

The lock order reversal happens because vnode locks must be acquired
before snapshot locks. When unmounting we must lock both the snapshot
lock and the vnode lock before swapping them so that the vnode will
be continuously locked during the swap. For each vnode representing
a snapshot, we must first acquire the snapshot lock to ensure
exclusive access to it and its original lock.  We then face a lock
order reversal when we try to acquire the original vnode lock. The
problem is eliminated by doing a non-blocking exclusive lock on the
original lock which will always succeed since there are no users
of that lock.

Sponsored by: Netflix
2021-01-15 16:03:01 -08:00
Kyle Evans
994e1f40f6 lualoader: use floor division to get correct type
This fixes the positioning of the "Welcome to FreeBSD" heading, which was
misplaced after the recent update to Lua 5.4. The issue was previously
masked by a compatibility knob in Lua 5.3 that would cause float-tagged
numbers to render faithfully without the decimal component. Lua 5.4 dropped
that and ensures that it always prints a decimal component, even if it has
to append a ".0" to the value.

Standard division produces a "float", floor division (//) can be used to
guarantee an integer. Floating point operations have been completely ripped
out of the liblua compiled for the bootloader, so this is a nop. This is
decidedly better than trying to hack out the float tag entirely.

Reported-by:	mjg, probably others
MFC-after:	3 days
2021-01-15 15:02:38 -06:00
Mariusz Zaborski
c664d8dfc3 cat: Fix potential memory leak
This was introduced in aefe30c543.
2021-01-15 21:49:52 +01:00
Gleb Smirnoff
4f48fd7c56 Add 'tmp' to the list of FILESYSTEMS dependencies. Some scripts that
depend on FILESYSTEMS run mktemp(1).  For systems that have read-only
root this is broken until memory disk based /tmp is instantiated.  At
least 'os-release' and 'motd' are subject to this problem.

Reviewed by:		ngie
Differential Revision:	https://reviews.freebsd.org/D28097
2021-01-15 12:44:06 -08:00
Gleb Smirnoff
7e4eca7136 Revert 97ec6eba65. There shouldn't be a dependency of 'tmp' on
remote filesystems.  Discussed this with Brooks and he can't find
evidence that provoked the change in 2005.  If anything gets broken
I will fix it in a different way, not via rc sequence change.

Discussed with:		brooks
Reviewed by:		ngie
Differential Revision:	https://reviews.freebsd.org/D28097
2021-01-15 12:44:06 -08:00
Mariusz Zaborski
aefe30c543 cat: capsicumize it
Reviewed by:	markj, arichardson
Differential Revision:	https://reviews.freebsd.org/D28083
2021-01-15 21:23:42 +01:00