Commit Graph

270736 Commits

Author SHA1 Message Date
Mateusz Guzik
4dd23ae150 vfs: retire MNTK_NOKNOTE and VV_NOKNOTE
MNTK_NOKNOTE was introduced in 679985d03a
(dated 2005), VV_NOKNOTE in 34cc826ae8 few
months later.

Neither was ever used by anything in the tree.
2021-12-10 19:53:57 +00:00
Bora Özarslan
08055452cb libkvm: fix kvm_walk_pages
Correct bitmap operations in _kvm_bitmap_next.

Reviewed by:	jhb
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D19183
2021-12-10 14:15:15 -05:00
Warner Losh
4dbc7835cd mips: Turn off LLVM MIPS targets by default
Now that MIPS isn't a recognized target for buildworld, move llvm mips
to off by default.

Sponsored by:		Netflix
Reviewed by:		dim
Differential Revision:	https://reviews.freebsd.org/D33364
2021-12-10 11:31:07 -07:00
Warner Losh
20b23ae74b stand: remove mips support
As part of decommissioning mips support, remove the boot loader
support. Do this in advance of other boot loader work to limit the
amount of work that will be thrown away.

Sponsored by:		Netflix
Reviewed by:		jrtc27
Differential Revision:	https://reviews.freebsd.org/D33377
2021-12-10 11:05:31 -07:00
Warner Losh
2220b759d6 loader.mk: Simplify a little bit
The elf loader needs to know how to reach into the gfx_fb code, so
simplify how we include files to find that stuff.

Sponsored by:		Netflix
Reviewed by:		manu, tsoome
Differential Revision:	https://reviews.freebsd.org/D33376
2021-12-10 11:04:37 -07:00
Warner Losh
0adb238d20 hdda: Remove extra topo_unlock
Reported by:	Taku YAMAMOTO
Sponsored by:	Netflix
2021-12-10 10:01:21 -07:00
Hubert Mazur
3662b8f1cf pcf85063: Fix real time clock
Previosuly real time clock driver always set time format to 12-hour
mode. Fix this by choosing hour mode depending on HW register.
2021-12-10 17:09:29 +01:00
Mateusz Piotrowski
58d60030ff gmultipath.8: Fix a typo
It's Word Wide Port Name, not World Word Port Name.

MFC after:	3 days
2021-12-10 14:33:34 +01:00
Andrew Turner
36499dc789 Fix a set but not used warning in the arm GIC driver
Sponsored by:	Innovate UK
2021-12-10 13:29:11 +00:00
Andrew Turner
2b556942cc Fix set but not used warnings in arm64 rockchip
Reviewed by:	manu, mmel
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33372
2021-12-10 13:29:11 +00:00
Mateusz Guzik
8117f96f24 bxe: plug some of set-but-not-used vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-10 12:19:16 +00:00
Andrew Turner
5b616dafac Fix set but not used warnings in arm64 core code 2021-12-10 12:10:30 +00:00
Andrew Turner
1c643b721b Fix a set but not used warning in the arm64 pmap
In pmap_ts_referenced we read the virtual address from pv->pv_va,
but then continue to use the pv struct to get the same value later
in the function.

Use the virtual address value we initially read rather than loading
from the pv struct each time.
2021-12-10 12:10:30 +00:00
Mateusz Guzik
a0f49d6768 hn: plug set-but-not-unused vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-10 12:09:26 +00:00
Mateusz Guzik
a036d73e8f ctl: plug set-but-not-unused var
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-10 12:06:48 +00:00
Mateusz Guzik
8f3562e2ca bfe: plug a set-but-not-unused var
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-10 12:02:05 +00:00
Mateusz Guzik
ceed3949bc x86: plug a set-but-not-unused var in native_lapic_ipi_free
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-10 11:55:03 +00:00
Mateusz Guzik
bc02034cca nfe: plug set-but-not-unused vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-10 11:53:38 +00:00
Mateusz Guzik
7bc6619013 alc: plug set-but-not-unused vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-10 11:48:42 +00:00
Mateusz Guzik
e02d0cab7b asmc: plug set-but-not-unused vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-10 11:45:36 +00:00
Jessica Clarke
fa5af3219f xdma: Fix another -Wunused-but-set-variable warning previously missed
MFC after:	1 week
2021-12-10 05:06:54 +00:00
Jessica Clarke
434cb1c4a6 riscv: Fix PLIC -Wunused-but-set-variable warnings 2021-12-10 04:51:32 +00:00
Jessica Clarke
d90c3b51cc xdma: Fix -Wunused-but-set-variable warnings
MFC after:	1 week
2021-12-10 04:48:51 +00:00
Alexander Motin
8493918868 busdma: Remove outdated comments about Giant.
MFC after:	2 weeks
2021-12-09 22:18:53 -05:00
Florian Walpen
a9545eede4 Add idle priority scheduling privilege group to MAC/priority
Add an idletime user group that allows non-root users to run processes
with idle scheduling priority. Privileges are granted by a MAC policy in
the mac_priority module. For this purpose, the kernel privilege
PRIV_SCHED_IDPRIO was added to sys/priv.h (kernel module ABI change).

Deprecate the system wide sysctl(8) knob
security.bsd.unprivileged_idprio which lets any user run idle priority
processes, regardless of context. While the knob is still working, it is
marked as deprecated in the description and in the man pages.

MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D33338
2021-12-10 04:54:48 +02:00
Florian Walpen
a20a2450cd Add PRIV_SCHED_IDPRIO
The privilege allows the holder to assign idle priority type to thread
or process.

MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D33338
2021-12-10 04:54:48 +02:00
Alexander Motin
35b2021a0a ahc: Mark sysctls with CTLFLAG_MPSAFE.
MFC after:	2 weeks
2021-12-09 21:36:21 -05:00
Alexander Motin
35efbedc98 fxp: Mark sysctls with CTLFLAG_MPSAFE.
MFC after:	2 weeks
2021-12-09 21:16:16 -05:00
Alexander Motin
fdec27ed82 wbwd: Mark sysctls with CTLFLAG_MPSAFE.
MFC after:	2 weeks
2021-12-09 21:13:10 -05:00
Alexander Motin
a69f810466 smist: Remove unneeded Giant from bus_dma_tag_create().
bus_dmamap_load() call uses BUS_DMA_NOWAIT.

MFC after:	2 weeks
2021-12-09 20:54:22 -05:00
Alexander Motin
e06c67eef8 hptiop: Remove Giant locking around ioctls.
The methods have their own locking and don't require Giant.

MFC after:	2 weeks
2021-12-09 20:35:21 -05:00
Alexander Motin
63e0f96ace hpt27xx: Remove FreeBSD 9.x support including Giant.
MFC after:	2 weeks
2021-12-09 20:24:29 -05:00
Alexander Motin
5ae7518b7b fxp: Remove unneeded Giant from bus_dma_tag_create().
All bus_dmamap_load() calls here use BUS_DMA_NOWAIT.

MFC after:	2 weeks
2021-12-09 20:09:48 -05:00
Alexander Motin
de291c5d10 acpi_cpu: Replace Giant with bus_topo_lock. 2021-12-09 20:08:25 -05:00
Warner Losh
21e22be91a ed: Remove options
ed(4) was removed some time ago, but these options relevant to only it
weren't GC'd at the time. Remove them.

Sponsored by:		Netflix
2021-12-09 17:41:39 -07:00
Warner Losh
96e500a3f9 hda: Push giant / newbus topo lock down a layer
Rather than picking up Giant at the start of these sysctl handlers, push
acquiring Giant down a layer to protect walking the children and also
to add/delete children for the reconfigure.

Sponsored by:		Netflix
Reviewed by:		mav, jhb
Differential Revision:	https://reviews.freebsd.org/D33057
2021-12-09 17:04:58 -07:00
Warner Losh
d14bc7230b newbus: add bus_topo_assert
Add bus_topo_assert() and implmement it as GIANT_REQUIRED for the
moment. This will allow us to change more easily to a newbus-specific
lock int he future.

Sponsored by:		Netflix
Reviewed by:		wulf, mav, jhb
Differential Revision:	https://reviews.freebsd.org/D31833
2021-12-09 17:04:57 -07:00
Warner Losh
815a0973b2 bus: mark sysctls MPSAFE
Mark the sysctls MPSAFE and pickup the bus topo lock while processing
them.

Sponsored by:		Netflix
Reviewed by:		mav, jhb
Differential Revision:	https://reviews.freebsd.org/D31832
2021-12-09 17:04:57 -07:00
Warner Losh
c6df6f5322 Create wrapper for Giant taken for newbus
Create a wrapper for newbus to take giant and for busses to take it too.
bus_topo_lock() should be called before interacting with newbus routines
and unlocked with bus_topo_unlock(). If you need the topology lock for
some reason, bus_topo_mtx() will provide that.

Sponsored by:		Netflix
Reviewed by:		mav
Differential Revision:	https://reviews.freebsd.org/D31831
2021-12-09 17:04:45 -07:00
Rick Macklem
ab639f2398 nfscl: Check for an error return from nfsrv_getattrbits()
There were two places where the client code did not check
for a parse error return from nfsrv_getattrbits().

This patch fixes both of these cases.

Reported by:	rtm@lcs.mit.edu
Tested by:	rtm@lcs.mit.edu
PR:	260272
MFC after:	2 weeks
2021-12-09 14:32:22 -08:00
Rick Macklem
d9931c2561 nfscl: Sanity check the callback tag length
The sanity check for tag length in a callback request
was broken in two ways:

It checked for a negative value, but not a large positive
value.

It did not set taglen to -1, to indicate to the code that
it should not be used.

This patch fixes both of these issues.

Reported by:	rtm@lcs.mit.edu
Tested by:	rtm@lcs.mit.edu
PR:	260266
MFC after:	2 weeks
2021-12-09 14:15:48 -08:00
Dmitry Chagin
0f74021fb6 pseudofs: Destroy vncache hashtbl on pseudofs module unload.
Reviewed by:		mjg, kib
Differential Revision:	https://reviews.freebsd.org/D31605
MFC after:		2 weeks
2021-12-09 21:41:08 +00:00
John Baldwin
ae67737a4c libc: Remove _get_tp() and _set_tp().
Their uses have been replaced by _tcb_get() and _tcb_set() from
<machine/tls.h>.

Reviewed by:	kib, jrtc27
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D33354
2021-12-09 13:23:26 -08:00
John Baldwin
8bcdb144eb TLS: Use <machine/tls.h> for libc and rtld.
- Include <machine/tls.h> in MD rtld_machdep.h headers.

- Remove local definitions of TLS_* constants from rtld_machdep.h
  headers and libc using the values from <machine/tls.h> instead.

- Use _tcb_set() instead of inlined versions in MD
  allocate_initial_tls() routines in rtld.  The one exception is amd64
  whose _tcb_set() invokes the amd64_set_fsbase ifunc.  rtld cannot
  use ifuncs, so amd64 inlines the logic to optionally write to fsbase
  directly.

- Use _tcb_set() instead of _set_tp() in libc.

- Use '&_tcb_get()->tcb_dtv' instead of _get_tp() in both rtld and libc.
  This permits removing _get_tp.c from rtld.

- Use TLS_TCB_SIZE and TLS_TCB_ALIGN with allocate_tls() in MD
  allocate_initial_tls() routines in rtld.

Reviewed by:	kib, jrtc27 (earlier version)
Differential Revision:	https://reviews.freebsd.org/D33353
2021-12-09 13:23:05 -08:00
John Baldwin
75395023ff libthr: Use <machine/tls.h> for most MD TLS details.
Note that on amd64 this effectively removes the unused tcb_spare field
from the end of struct tcb since the definition of struct tcb in
<x86/tls.h> does not include that field.

Reviewed by:	kib, jrtc27
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D33352
2021-12-09 13:17:41 -08:00
John Baldwin
1a62e9bc00 Add <machine/tls.h> header to hold MD constants and helpers for TLS.
The header exports the following:

- Definition of struct tcb.
- Helpers to get/set the tcb for the current thread.
- TLS_TCB_SIZE (size of TCB)
- TLS_TCB_ALIGN (alignment of TCB)
- TLS_VARIANT_I or TLS_VARIANT_II
- TLS_DTV_OFFSET (bias of pointers in dtv[])
- TLS_TP_OFFSET (bias of "thread pointer" relative to TCB)

Note that TLS_TP_OFFSET does not account for if the unbiased thread
pointer points to the start of the TCB (arm and x86) or the end of the
TCB (MIPS, PowerPC, and RISC-V).

Note also that for amd64, the struct tcb does not include the unused
tcb_spare field included in the current structure in libthr.  libthr
does not use this field, and the existing calls in libc and rtld that
allocate a TCB for amd64 assume it is the size of 3 Elf_Addr's (and
thus do not allocate room for tcb_spare).

A <sys/_tls_variant_i.h> header is used by architectures using
Variant I TLS which uses a common struct tcb.

Reviewed by:	kib (older version of x86/tls.h), jrtc27
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D33351
2021-12-09 13:17:13 -08:00
John Baldwin
4c2f5bfbfa libc: Fix the alignment of the TCB to match rtld for several architectures.
- Use 16 byte alignment rather than 8 for aarch64, powerpc64, and RISC-V.

- Use 8 byte alignment rather than 4 for 32-bit arm, mips, and powerpc.

I suspect that mips64 should be using 16 byte alignment, but both libc
and rtld currently use 8 byte alignment.

Reviewed by:	kib, jrtc27
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D33350
2021-12-09 13:16:57 -08:00
John Baldwin
299617496c amd64: Allocate TCB with alignment of 16 rather than 8.
This matches the TLS_TCB_ALIGN definition in libc.

Reviewed by:	kib, jrtc27
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D33349
2021-12-09 13:16:45 -08:00
John Baldwin
9952b82b39 mips _libc_get_static_tls_base: Narrow scope of #ifdef.
Reviewed by:	kib, emaste, jrtc27
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D33348
2021-12-09 13:16:34 -08:00
John Baldwin
23e0c0e9a3 mips: Add TLS_DTV_OFFSET to the result of tls_get_addr_common.
Previously TLS_DTV_OFFSET was added to the offset passed to
tls_get_addr_common; however, this approach matches powerpc and RISC-V
and better matches the intention.

Reviewed by:	kib, jrtc27
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D33347
2021-12-09 13:16:19 -08:00