Commit Graph

266760 Commits

Author SHA1 Message Date
Kornel Duleba
ddb928096b dts: fsl-ls1028a: Correct ECAM PCIE window ranges
Currently all PCIE windows point to bus address 0x0, which does not match
the values obtained from hardware during EA.
Replace those values with CPU addresses, since in reality we
have a 1:1 mapping between the two.

This patch is queued for Linux v5.14 in linux-next tree:
6bee93d93111 "arm64: dts: fsl-ls1028a: Correct ECAM PCIE window ranges"
2021-07-01 20:23:40 +02:00
Ferhat Gecdogan
8df71ea1aa tegra_pcie: use switch instead of if in tegra_pcib_pex_ctrl
Simplify obtaining per-port data in tegra_pcib_pex_ctrl() routine.

Reviewed by:    imp, mw
Pull Request:   https://github.com/freebsd/freebsd-src/pull/481
2021-07-01 20:09:46 +02:00
Emmanuel Vadot
2ca21223c5 dts: Bump the freebsd branding version to 5.13
Sponsored by:	Diablotin Systems
2021-07-01 18:48:56 +02:00
Emmanuel Vadot
993e8236c3 arm64: allwinner: Add r_intc driver
The r intc interrupt controller seems to do a lot of things :
- It can handle the NMI interrupt
- It have local interrupts for some device that also can be muxed with GIC
- It can serve as an forwarder for the GIC

It's mostly used for deepsleep/wakeup if I understood correctly and we do not
support this on arm64.

For now just forward everything to the GIC so interrupts works again for device
which now have this interrupts controller set since dts v5.12

Sponsored by:	Diablotin Systems
2021-07-01 18:46:38 +02:00
Ceri Davies
1f7d11e636 build.7: remove documentation of "make update"
update target was removed in e290182bcf
2021-07-01 16:52:32 +01:00
Emmanuel Vadot
2eb4d8dc72 Import device-tree files from Linux 5.13
Sponsored by:	Diablotin Systems
2021-07-01 17:51:01 +02:00
Emmanuel Vadot
71ca10f8bb Import device-tree files from Linux 5.13 2021-07-01 17:50:17 +02:00
Emmanuel Vadot
82ea1a07b4 Import device-tree files from Linux 5.12
Sponsored by:	Diablotin Systems
2021-07-01 17:41:57 +02:00
Emmanuel Vadot
c7a3c7298f Import device-tree files from Linux 5.12 2021-07-01 17:39:42 +02:00
Warner Losh
1426907f4d hz.9: update stathz for current usage
Update the stathz description to reflect reality. profhz is the only
thing we should deprecate. Add some implementation notes that describe
the optimizations made to date.

Discusssed with:	emaste
Reviewed by:		kib (prior), jhb (prior), gbe
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D30815
2021-07-01 09:33:03 -06:00
Alexander Motin
b192a2c0a1
Remove avl_size field from struct avl_tree
This field is used only by illumos mdb.  On other platforms it only
increases the struct size from 32 to 40 bytes.  For struct vdev_queue
including 13 instances of avl_tree_t size means active cache lines.

Keep the padding in user-space for now to not break the ABI.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #12290
2021-07-01 09:32:31 -06:00
Alexander Motin
490c845efe
Compact dbuf/buf hashes and lock arrays
With default dbuf cache size of 1/32 of ARC, it makes no sense to have
hash table of the same size (or even bigger on Linux).  Reduce it to
1/8 of ARC's one, still leaving some slack, assuming higher I/O rate
via dbuf cache than via ARC.

Remove padding from ARC hash locks array.  The idea behind padding
is to avoid false sharing between locks.  It would have sense if
there would be a limited number of very busy locks.  But since we
have no limit on the number, using the same memory for more locks we
can achieve even lower lock contention with the same false sharing,
or we can use less memory for the same contention level.

Reduce number of hash locks from 8192 to 2048.  The number is still
big enough to not cause contention, but reduced memory size improves
cache hit rate for mutex_tryenter() in ARC eviction thread, saving
about 1% of the thread time.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #12289
2021-07-01 09:30:31 -06:00
Jorgen Lundman
c6d1112bf4
Fix abd leak, kmem_free correct size of abd_t
Fix a leak of abd_t that manifested mostly when using
raidzN with at least as many columns as N (e.g. a
four-disk raidz2 but not a three-disk raidz2).
Sufficiently heavy raidz use would eventually run a system
out of memory.

Additionally:

* Switch abd_cache arena to FIRSTFIT, which empirically
improves perofrmance.

* Make abd_chunk_cache more performant and debuggable.

* Allocate the abd_zero_buf from abd_chunk_cache rather
than the heap.

* Don't try to reap non-existent qcaches in abd_cache arena.

* KM_PUSHPAGE->KM_SLEEP when allocating chunks from their
own arena

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Jorgen Lundman <lundman@lundman.net>
Co-authored-by: Sean Doran <smd@use.net>
Closes #12295
2021-07-01 09:28:15 -06:00
Jorgen Lundman
eca174527e
Upstream: dmu_zfetch_stream_fini leaks refcount
dmu_zfetch_stream_fini() is missing calls to destroy the refcounts,
leaking them and the mutex inside.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Jorgen Lundman <lundman@lundman.net>
Closes #12294
2021-07-01 09:22:16 -06:00
Emmanuel Vadot
5def4c47d4 Import device-tree files from Linux 5.11
Sponsored by:	Diablotin Systems
2021-07-01 17:21:47 +02:00
Kevin Jin
50e09eddd0
Optimize txg_kick() process (#12274)
Use dp_dirty_pertxg[] for txg_kick(), instead of dp_dirty_total in
original code. Extra parameter "txg" is added for txg_kick(), thus it
knows which txg to kick. Also txg_kick() call is moved from
dsl_pool_need_dirty_delay() to dsl_pool_dirty_space() so that we can
know the txg number assigned for txg_kick().

Some unnecessary code regarding dp_dirty_total in txg_sync_thread() is
also cleaned up.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: jxdking <lostking2008@hotmail.com>
Closes #12274
2021-07-01 09:20:27 -06:00
Alexander Motin
42afb12da7
Remove refcount from spa_config_*()
The only reason for spa_config_*() to use refcount instead of simple
non-atomic (thanks to scl_lock) variable for scl_count is tracking,
hard disabled for the last 8 years.  Switch to simple int scl_count
reduces the lock hold time by avoiding atomic, plus makes structure
fit into single cache line, reducing the locks contention.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Mark Maybee <mark.maybee@delphix.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #12287
2021-07-01 09:16:54 -06:00
Andrew Turner
244002b482 Switch the order of the ID_AA64PFR1_EL1 fields
This makes them consistent with the fields in other registers.

Sponsored by:	The FreeBSD Foundation
2021-07-01 00:48:56 +00:00
Ceri Davies
d93a2f5d67 fortune: correct documentation of default FORTUNE_PATH.
While here, fix a typo in a comment relating to FORTUNE_PATH
2021-07-01 14:02:00 +01:00
Edward Tomasz Napierala
db8d680ebe procctl(2): add PROC_NO_NEW_PRIVS_CTL, PROC_NO_NEW_PRIVS_STATUS
This introduces a new, per-process flag, "NO_NEW_PRIVS", which
is inherited, preserved on exec, and cannot be cleared.  The flag,
when set, makes subsequent execs ignore any SUID and SGID bits,
instead executing those binaries as if they not set.

The main purpose of the flag is implementation of Linux
PROC_SET_NO_NEW_PRIVS prctl(2), and possibly also unpriviledged
chroot.

Reviewed By:	kib
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D30939
2021-07-01 09:42:07 +01:00
Edward Tomasz Napierala
93c3453f11 linux(4): revert arm64 part of 447636e43c
The arm64 part of the patch was incomplete and prevented
linux64.ko from loading due to missing symbol.

Sponsored By:	EPSRC
2021-07-01 08:29:23 +00:00
Rick Macklem
c5f4772c66 nfscl: Improve "Consider increasing kern.ipc.maxsockbuf" message
When the setting of kern.ipc.maxsockbuf is less than what is
desired for I/O based on vfs.maxbcachebuf and vfs.nfs.bufpackets,
a console message of "Consider increasing kern.ipc.maxsockbuf".
is printed.

This patch modifies the message to provide a suggested value
for kern.ipc.maxsockbuf.
Note that the setting is only needed when the NFS rsize/wsize
is set to vfs.maxbcachebuf.

While here, make nfs_bufpackets global, so that it can be used
by a future patch that adds a sysctl to set the NFS server's
maximum I/O size.  Also, remove "sizeof(u_int32_t)" from the maximum
packet length, since NFS_MAXXDR is already an "overestimate"
of the actual length.

MFC after:	2 weeks
2021-06-30 15:15:41 -07:00
Edward Tomasz Napierala
447636e43c linux(4): implement coredump support
Implement dumping core for Linux binaries on amd64, for both
32- and 64-bit executables.  Some bits are still missing.

This is based on a prototype by chuck@.

Reviewed By:	kib
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D30019
2021-06-30 22:45:06 +01:00
Greg V
8c2dd68caa libpmc: Import AMD Zen 3 PMU events
Reviewed by:	mav, mhorne
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D30965
2021-06-30 18:21:23 -03:00
Mitchell Horne
13f5a3076b hwpmc_arm64: add a PMCDBG to the interrupt handler
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2021-06-30 18:21:23 -03:00
Olivier Houchard
8c3bd133dd arm: Make sure we can handle a thumb entry point.
Similarly to what's been done on arm64 with commit
712c060c94, when executing a binary, if the
entry point is a thumb symbol, then make sure we set the PSL_T flag, otherwise
the CPU will interpret it in ARM mode, and that will likely leads to an
undefined instruction.

PR:	256899
MFC after: 	1 week
2021-06-30 22:56:50 +02:00
Antoine Brodin
d75d33870d ObsoleteFiles.inc: add a few missed files 2021-06-30 20:34:36 +00:00
Allan Jude
781c3b5119 Add Thomas Munro to the committers graph
Reported by:	gnn
2021-06-30 20:09:18 +00:00
Mitchell Horne
28dd6730a5 libpmc: enable pmu_utils on arm64
This allows supported libpmc to query/select from the pmu-events table,
which may have a more complete set of events than what we define
manually. A future update to these definitions should greatly improve
this support. The alias table is empty for now, until this future import
is complete.

Add the Foundation's copyright for recent work on this file.

Reviewed by:	ray (slightly earlier version)
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30603
2021-06-30 16:47:18 -03:00
Mitchell Horne
8cc3815f02 hwpmc_arm64: accept raw event codes for PMC_OP_PMCALLOCATE
Make it possible to specify event codes without an offset of
PMC_EV_ARMV8_FIRST, by setting a machine-dependent flag. This is
required to make use of event definitions from pmu-events.

Reviewed by:	ray (slightly earlier version)
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30602
2021-06-30 16:47:09 -03:00
Mitchell Horne
5867cccdc4 hwpmc_arm64: fill kern.hwpmc.cpuid
This will be used to detect supported pmu events. The expected format is
the MIDR register with the revision and variant fields masked. See also:
lib/libpmc/pmu-events/arch/arm64/mapfile.csv.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30601
2021-06-30 16:26:07 -03:00
Mitchell Horne
2129c8f677 hwpmc_arm64.c: fix return style
In accordance to style(9).

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2021-06-30 16:26:07 -03:00
Alan Cox
1a8bcf30f9 amd64: a simplication to pmap_remove_{all,write}
Eliminate some unnecessary unlocking and relocking when we have to retry
the operation to avoid deadlock.  (All of the other pmap functions that
iterate over a PV list already implemented retries without these same
unlocking and relocking operations.)

Reviewed by:	kib, markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D30951
2021-06-30 13:12:25 -05:00
Jose Luis Duran
3f197b101f release: Remove C-like string comparison operator
Per [(1), i.e. test(1), the string comparison operator should be `=`,
not `==` in sh(1) scripts.

No functional change. FreeBSD's test accepts `==` as an alias for `=`
for compatibility with gnu test's `==` extension.

Reviewed by:	imp@, gjb@
Pull Request:	https://github.com/freebsd/freebsd-src/pull/485
2021-06-30 11:13:51 -06:00
Jose Luis Duran
6ce785c50b bsdinstall: Also copy /var/db/zoneinfo
Per tzsetup(8), /etc/localtime and /var/db/zoneinfo go hand in hand.

Reviewed by:	imp@
Pull Request:	https://github.com/freebsd/freebsd-src/pull/486
2021-06-30 11:08:26 -06:00
Jose Luis Duran
91604330e6 sysbuild: Also copy /var/db/zoneinfo
Per tzsetup(8), /etc/localtime and /var/db/zoneinfo go hand in hand.
Remove extra white spaces as well.

Reviewed by:	imp@, phk@ (informal no objection email)
Pull Request:	https://github.com/freebsd/freebsd-src/pull/486
2021-06-30 11:08:26 -06:00
Ryan Moeller
cfc564f9b1
ZED: Match added disk by pool/vdev GUID if found (#12217)
This enables ZED to auto-online vdevs that are not wholedisk managed by
ZFS.

Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Don Brady <don.brady@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
2021-06-30 07:37:20 -07:00
Olivier Houchard
712c060c94 arm64: Make sure COMPAT_FREEBSD32 handles thumb entry point.
If the entry point for the binary executed is a thumb 2 entry point, make
sure we set the PSR_T bit, or the CPU will interpret it as arm32 code and
bad things will happen.

PR: 256899
MFC after: 1 week
2021-06-30 14:55:18 +02:00
Olivier Houchard
c1da17a86c arm: Garbage collect _arm_memcpy/_arm_bzero.
Remove any attempt to use _arm_memcpy and _arm_bzero. It was used by some
xscale platforms to provide functions to use the DMA engine for big
zeroing/copying work, but those platforms are long gone, and it's unlikely
anything else will use those.
2021-06-30 14:53:57 +02:00
Fernando Apesteguía
0a0f748641 man: Build manpages for all architectures
Building and installing architecture-specific man pages only raises a number of
problems:

 * The https://www.freebsd.org/cgi/man.cgi is incomplete. As an
   example, it does not show results for pae(4). The reason for this is
   that the cgi interface runs on FreeBSD amd64.

 * In FreeBSD amd64 some manual pages have broken X-refs. See hptrr(4)
   for an example.

 * Also, we have broken links in our Release Notes. This is a
   consequence of the first point. See
   https://www.freebsd.org/releases/13.0R/hardware/#proc-i386.

Make MAN_ARCH default to 'all' so we build all the man pages for all the
architectures. The difference in disk space is negligible. Also link
architecture-specific man pages to their own section while keeping their own
namespace.

PR: 212290
Reported by:	mj@bsdops.com
Approved by:	ceri@, wosch@
MFC after:	4 weeks
2021-06-30 09:57:51 +02:00
Martin Matuska
c0149d0300 zfs: update zfs_config.h (missing in 2617128a2) 2021-06-30 08:34:36 +02:00
Martin Matuska
2617128a21 zfs: merge openzfs/zfs@4694131a0 (master) into main
Notable upstream pull request merges:
  #12253 module/zfs: simplify ddt_stat_add() loop
  #12288 Avoid 64bit division in multilist index functions

Obtained from:	OpenZFS
OpenZFS commit:	4694131a0a
2021-06-30 08:02:44 +02:00
John Grafton
a00d703f2f top(1): support command name and argument grepping
Obtained from:  OpenBSD
Reviewed by:	imp@
Pull Request:	https://github.com/freebsd/freebsd-src/pull/479
2021-06-29 17:51:18 -06:00
Alfonso Gregory
0d9e8c286d Change strmode argument type to mode_t for crossbuild
To match the libc changes.

Reviewed by:	imp@
Pull Request:	https://github.com/freebsd/freebsd-src/pull/493
2021-06-29 17:39:55 -06:00
Alfonso Gregory
849dcdb1c0 Change strmode argument type to mode_t
Finally, we have the correct function definition for strmode.  NetBSD/OpenBSD
did this many years ago. This code is weird sign extension safe.

Reviewed by:	imp@
Pull Request:	https://github.com/freebsd/freebsd-src/pull/493
2021-06-29 17:38:45 -06:00
Chuck Silvers
ed1a156b03 fsck_ffs: don't try to write in read-only mode
Skip trying to change fs_mtime for SU+J if we are running read-only.

Reviewed by:    mckusick
Sponsored by:	Netflix
2021-06-29 14:29:15 -07:00
Brian Behlendorf
4694131a0a Linux 5.13 compat: META
Increase the Linux-Maximum version in the META file to 5.13.
All of the required compatibility patches have been merged
and the 5.13 kernel has been officially released.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2021-06-29 13:16:38 -07:00
Laurențiu Nicola
3482c2b79a
zed: fix sending emails (#12292)
Commit 6fc3099 broke the quoting when invoking the mail program, revert
that change.

Signed-off-by: Laurențiu Nicola <lnicola@dend.ro>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
2021-06-29 12:33:49 -07:00
Colin Percival
2ef5995f49 portsnap: Remove superfluous semicolons
Submitted by:	des
2021-06-29 11:00:54 -07:00
Colin Percival
a9f5512f07 portsnap: Shorten 'Skipping' output lines
Portsnap uses patches opportunistically to reduce download bandwidth: It
attempts to fetch patches which could be useful, and then makes use of
whichever patches it actually gets.  (This solves the otherwise O(n^2)
issue for the server to build patches between every pair of versions.)

During the process of applying patches, portsnap prints lines of the
form "Skipping XXX-YYY (123 of 4567).\r", where the \r serves to allow
each of these (potentially many) lines to overwrite the previous one
on the console.  Unfortunately, XXX and YYY here are SHA256 hashes,
resulting in these lines wrapping on reasonable-width consoles.

Replace the hashes with abbreviations of the form "0123...cdef"
(cutting 64 characters down to 11) in order to keep lines to a
reasonable length.

The rather ugly shell code here is used to avoid forking additional
processes; it would be much cleaner using sed(1), but in my testing
the sed-based alternative increases CPU time consumption by 50%.

Requested by:	des
2021-06-29 11:00:54 -07:00