Commit Graph

131411 Commits

Author SHA1 Message Date
Warner Losh
713bd56728 Remove obsolete old-freebsd version compat shim. 2020-03-01 23:01:51 +00:00
Warner Losh
51447e4962 Remove pre-FreeBSD 11 compat code. 2020-03-01 23:01:47 +00:00
Warner Losh
18347b2e1e Remove stale FreeBSD_version checks. 2020-03-01 23:01:37 +00:00
Mark Johnston
1ed42f6fdd Avoid doubly wiring a newly allocated page in vm_page_grab_valid().
This fixes a regression from r358363.

Reported by:	manu, jbeich
Tested by:	jbeich
2020-03-01 22:09:11 +00:00
Mateusz Guzik
2f423bce54 vfs: stop taking additional refs on root vnode during lookup
They are spurious since introduction of struct pwd, which provides them
implicitly.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D23885
2020-03-01 21:54:28 +00:00
Mateusz Guzik
8d03b99b9d fd: move vnodes out of filedesc into a dedicated structure
The new structure is copy-on-write. With the assumption that path lookups are
significantly more frequent than chdirs and chrooting this is a win.

This provides stable root and jail root vnodes without the need to reference
them on lookup, which in turn means less work on globally shared structures.
Note this also happens to fix a bug where jail vnode was never referenced,
meaning subsequent access on lookup could run into use-after-free.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D23884
2020-03-01 21:53:46 +00:00
Mateusz Guzik
8243063f9b fd: make fgetvp_rights work without the filedesc lock
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D23883
2020-03-01 21:50:13 +00:00
Mateusz Guzik
7f746c9fcc vm: add debug to uma_zone_set_smr
Reviewed by:	markj, rlibby
Differential Revision:	https://reviews.freebsd.org/D23902
2020-03-01 21:49:16 +00:00
Warner Losh
daba5ace03 Finish removal of bktr
Remove the old ioctl .h files
Remove copying/linking ioctl .h files in instasllworld
Remove bktr from lint
Add now-removed files with ObsoleteFiles
2020-03-01 20:37:42 +00:00
Warner Losh
795140556c Remove bktr(4)
Remove the brooktree driver as discussed on arch@. Bump FreeBSD version to
1300082, though I doubt anything will care.

Relnote: yes
2020-03-01 19:15:03 +00:00
Xin LI
5082c36629 Fix build. 2020-03-01 18:55:59 +00:00
Warner Losh
a11c38d321 Remove noise that once upon a time allowed netback to build on FreeBSD 6. The
network layer has evolved since then, and this won't compile there.
2020-03-01 18:18:11 +00:00
Warner Losh
5f8395cce4 Remove FreeBSD 8 support from virtio.
The sbuf API has evolved since 8, as have many others. The other API sweeps
didn't make the changes conditional, so this is now noise.
2020-03-01 18:18:07 +00:00
Warner Losh
6773051162 Remove support for FreeBSD 4-7 from the iscsi initiator.
Also, inline/remove now empty or trivial macros. CAM has evolved enough this
code couldn't work there anyway, and the API sweeep commits made since then were
made unconditional.
2020-03-01 18:18:01 +00:00
Warner Losh
1a1b54589b Remove conditional code for FreeBSD 8 and earlier frmo cxgb. 2020-03-01 18:17:56 +00:00
Warner Losh
eab6ecc0ae Finish removing support from old versions
Eliminate code for old versions, inline pci_find_cap instead of relying on
compat ifdef.

This commit should have been combined with r358488 before pushing it in.
2020-03-01 18:17:51 +00:00
Warner Losh
e602f0c85d Remove FreeBSD 7-10 support from bxe driver.
Use new PCIER and PCIEM names in the driver rather than relying on old, compat
shims.
2020-03-01 17:46:28 +00:00
Warner Losh
fb2e3c49e1 Remove support for FreeBSD 8 systems. These workarounds and ways of rescanning
devices are no longer done.
2020-03-01 17:27:35 +00:00
Warner Losh
55e306cb12 Remove all the compatibility hacks for systems that predate FreeBSD 8. Some of
these look to be cut and pasted from other drivers since this driver was
committed to FreeBSD 7-current and MFC'd to FreeBSD 6. The ones for FreeBSD 4
and 5 likely never were working...
2020-03-01 17:27:30 +00:00
Warner Losh
246da17ee5 Remove compatibility code for changing sysctl definitions for pre FreeBSD 9
versions. These are just noise these days.
2020-03-01 17:27:25 +00:00
Warner Losh
27dc15d2f6 Remove FreeBSD 7 conditional code... We've had a lot of other changes since then
and al_eth appears only in the Annapurna ARM designs which arrived in the tree
after that.
2020-03-01 16:45:54 +00:00
Tijl Coosemans
f8b9b299a2 linuxulator: Map scheduler priorities to Linux priorities.
On Linux the valid range of priorities for the SCHED_FIFO and SCHED_RR
scheduling policies is [1,99].  For SCHED_OTHER the single valid priority is
0.  On FreeBSD it is [0,31] for all policies.  Programs are supposed to
query the valid range using sched_get_priority_(min|max), but of course some
programs assume the Linux values are valid.

This commit adds a tunable compat.linux.map_sched_prio.  When enabled
sched_get_priority_(min|max) return the Linux values and sched_setscheduler
and sched_(get|set)param translate between FreeBSD and Linux values.

Because there are more Linux levels than FreeBSD levels, multiple Linux
levels map to a single FreeBSD level, which means pre-emption might not
happen as it does on Linux, so the tunable allows to disable this behaviour.
It is enabled by default because I think it is unlikely that anyone runs
real-time software under Linux emulation on FreeBSD that critically relies
on correct pre-emption.

This fixes FMOD, a commercial sound library used by several games.

PR:		240043
Tested by:	Alex S <iwtcex@gmail.com>
Reviewed by:	dchagin
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D23790
2020-03-01 13:12:04 +00:00
Michael Tuexen
7e1e491f60 Remove stale definitions. The removed definitions are not used right
now and are incompatible with the correct ones in RFC 3168.

Submitted by:		Richard Scheffenegger
Differential Revision:	https://reviews.freebsd.org/D23903
2020-03-01 12:34:27 +00:00
Warner Losh
9ea5bef27f Remove support for varios versions from FreeBSD 4 to 8.
There's no way arcmsr will still work on those versions. Cleanup really old code
that's no longer needed.
2020-02-29 22:16:27 +00:00
Warner Losh
94c1cb8c3d add deprecation notice for bktr driver.
We plan to remove bktr(4) in FreeBSD 13. Document that here.

Relnotes: yes
2020-02-29 21:50:08 +00:00
Christian S.J. Peron
1018b2ff00 Currently kernel audit events for jail_set(2), jail_get(2), jail_attach(2),
jail_remove(2) and finally setloginclass(2) are not being converted and
committed into userspace. Add the cases for these syscalls and make sure
they are being converted properly.

Reviewed by:	bz, kevans
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D23882
2020-02-29 19:17:24 +00:00
Mark Johnston
5aa5420ff2 Ensure that arm64 thread structures are allocated from the direct map.
Otherwise we can fail to handle translation faults on curthread, leading
to a panic.

Reviewed by:	alc, rlibby
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23895
2020-02-29 18:41:48 +00:00
Dimitry Andric
b95cee35d3 Fix the following -Werror warning from clang 10.0.0:
sys/arm64/arm64/identcpu.c:1170:5: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
                                break;
                                ^
sys/arm64/arm64/identcpu.c:1168:4: note: previous statement is here
                        if (fv[j].desc[0] != '\0')
                        ^

The break should be after the if statement, indented one level less.

MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D23871
2020-02-29 14:11:27 +00:00
Jeff Roberson
6be21eb778 Provide a lock free alternative to resolve bogus pages. This is not likely
to be much of a perf win, just a nice code simplification.

Reviewed by:	markj, kib
Differential Revision:	https://reviews.freebsd.org/D23866
2020-02-28 21:42:48 +00:00
Emmanuel Vadot
d5151ea87a mmc: dwmmc: Fix off by one error
The IVAR_MAX_DATA is supposed to have the number of descriptor X the mmc
block size and desc_count contain all this information + 1.

Reported by:	phk
MFC after:	1 week
2020-02-28 21:31:40 +00:00
Brooks Davis
4ec9d1370f Define SCTL_MASK32 when COMPAT_FREEBSD32 is defined.
Remove the list of architectures and depend on COMPAT_FREEBSD32 which is
defined (if relevent) in opt_global.h and thus defined everywhere in
the kernel.

This is a minor change in behavior in that 32-bit compat for sysctls now
depends on COMPAT_FREEBSD32 rather than on the potential for 32-bit
compat support. The prior arrangement may have been part of an attempt
to allow 32-bit compat to be loadable, but such attempts are doomed to
failure (due to the fact that ioctls have no meaning without the
associated file descriptor) without vastly more refactoring and some
sort of COMPAT_FREEBSD32_SUPPORT option.

Reviewed by:	jhb
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D23748
2020-02-28 21:13:15 +00:00
Jeff Roberson
7aaf252c96 Convert a few triviail consumers to the new unlocked grab API.
Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D23847
2020-02-28 20:34:30 +00:00
Jeff Roberson
f72eaaeb03 Use unlocked grab for uipc_shm/tmpfs.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D23865
2020-02-28 20:33:28 +00:00
Jeff Roberson
3f39f80ab3 Support the NOCREAT flag for grab_valid_unlocked.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D23865
2020-02-28 20:32:35 +00:00
Jeff Roberson
1a0c234eb2 Simplify vref() code in object_reference. The local temporary is no longer
necessary.  Fix formatting errors.

Reported by:	mjg
Discussed with:	kib
2020-02-28 20:30:53 +00:00
Jeff Roberson
9defe1c076 Eliminate object locking in zfs where possible with the new lockless grab
APIs.

Reviewed by:	kib, markj, mmacy
Differential Revision:	https://reviews.freebsd.org/D23848
2020-02-28 20:29:53 +00:00
Ryan Libby
cd1da6ff8b amd64 pmap.c: minor codegen optimization in flag access
Following previous revision, apply the same minor optimization to
hand-rolled atomic_fcmpset_128 in pmap.c.

Reviewed by:	kib, markj
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D23870
2020-02-28 18:32:40 +00:00
Ryan Libby
6d1a70dd0a amd64 atomic.h: minor codegen optimization in flag access
Previously the pattern to extract status flags from inline assembly
blocks was to use setcc in the block to write the flag to a register.
This was suboptimal in a few ways:
 - It would lead to code like: sete %cl; test %cl; jne, i.e. a flag
   would just be loaded into a register and then reloaded to a flag.
 - The setcc would force the block to use an additional register.
 - If the client code didn't care for the flag value then the setcc
   would be entirely pointless but could not be eliminated by the
   optimizer.

A more modern inline asm construct (since gcc 6 and clang 9) allows for
"flag output operands", where a C variable can be written directly from
a flag.  The optimizer can then use this to produce direct code where
the flag does not take a trip through a register.

In practice this makes each affected operation sequence shorter by five
bytes of instructions.  It's unlikely this has a measurable performance
impact.

Reviewed by:	kib, markj, mjg
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D23869
2020-02-28 18:32:36 +00:00
Mark Johnston
e8049590f0 Fix r358436 to not declare kernel symbols when _KERNEL is not defined.
Reported by:	Jenkins, Michael Butler
Pointy hat:	markj
2020-02-28 17:38:31 +00:00
Mark Johnston
b4ffc02b14 sy_call_t and systrace_args_func_t need to be visible to userspace.
Reported by:	Jenkins
2020-02-28 17:23:53 +00:00
Mark Johnston
46994ec2b1 Fix standalone builds of systrace.ko after r357912.
Sponsored by:	The FreeBSD Foundation
2020-02-28 17:05:04 +00:00
Mark Johnston
a7261520ba Clear systrace_args_func when systrace probes are disabled.
This function pointer is invalidated when systrace.ko is unloaded.

Reported by:	pho
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-02-28 17:04:36 +00:00
Mark Johnston
c99d0c5801 Add a blocking counter KPI.
refcount(9) was recently extended to support waiting on a refcount to
drop to zero, as this was needed for a lockless VM object
paging-in-progress counter.  However, this adds overhead to all uses of
refcount(9) and doesn't really match traditional refcounting semantics:
once a counter has dropped to zero, the protected object may be freed at
any point and it is not safe to dereference the counter.

This change removes that extension and instead adds a new set of KPIs,
blockcount_*, for use by VM object PIP and busy.

Reviewed by:	jeff, kib, mjg
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23723
2020-02-28 16:05:18 +00:00
Justin Hibbits
f37cc7137d Add Denverton UART PCI ID
MFC after:	3 days
Sponsored by:	Juniper Networks, Inc
2020-02-28 15:59:35 +00:00
Emmanuel Vadot
67da57b1f2 dts: Update our copy for arm, arm64 and riscv dts to Linux 5.5
MFC after:	2 months
2020-02-28 15:42:51 +00:00
Bjoern A. Zeeb
f1db666a61 mld6: initialize oifp to avoid bogus results/panics in edge cases
In certain cases (probably not during normal operation but observed in
the lab during development) ip6_ouput() could return without error
and ifpp (&oifp) not updated.
Given oifp was never initialized we would take the later branch
as oifp was not NULL, and when calling icmp6_ifstat_inc() we would
panic dereferencing a garbage pointer.
For code stability initialize oifp to NULL before first use to always
have a deterministic value and not rely on a called function to behave
and always and for ever do the work for us as we hope for.

MFC after:	3 days
Sponsored by:	Netflix
2020-02-28 11:16:41 +00:00
Emmanuel Vadot
3f9309e571 arm: zynq: An SPI driver for Zynq platforms
Submitted by:	Thomas Skibo
Differential Revision:	https://reviews.freebsd.org/D23319
2020-02-28 10:57:23 +00:00
Warner Losh
a248d7c2f5 This is a FALLTHROUGH for sure. no need for xxx comment. 2020-02-28 01:18:11 +00:00
Warner Losh
80f7b25b81 Remove duplicated ATA_CHECK_POWER_MODE 2020-02-28 01:02:01 +00:00
John Baldwin
6d44e8e6b5 Rename TOE TLS stats from [rt]x_tls_* to [rt]x_toe_tls_*.
This more clearly differentiates TLS records encrypted and decrypted
in TOE connections from those encrypted via NIC TLS.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2020-02-28 00:42:27 +00:00