Commit Graph

266116 Commits

Author SHA1 Message Date
Ed Maste
f530cce55c UPDATING: correct typo
Sponsored by:	The FreeBSD Foundation
2021-06-08 20:47:05 -04:00
Warner Losh
dbbf7cb21c libspl: fix NO_CLEAN build
atomic.S moved to atomic.c, update the cleaup script to remove stale
dependencies for this.

Sponsored by:		Netflix
2021-06-08 17:56:15 -06:00
Martin Matuska
f20893853e zfs: unbreak build broken in 160388166 2021-06-08 22:21:11 +02:00
Jessica Clarke
6d2648bcab tip: Fix pointer-vs-integer confusion
Currently IREMOTE assumes that every value is (initially) a pointer to a
long. This is true for NUMBERs, but false for STRINGs, which are instead
pointers to pointers, though on ILP32 and LP64 systems these happen to
have the same representation, but this is still a strict aliasing
violation, and of course breaks on systems where the representations are
not the same, such as CHERI. We do not currently have any BOOLs (short,
curiously) or CHARs used with IREMOTE, though the code should not be
relying on that.

This removes the unused setaddress macro, and the now-unused address
macro due to the above issue.

Reviewed by:	imp, kib
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D30697
2021-06-08 18:30:59 +01:00
Jessica Clarke
de295884c4 tip: Cast via intptr_t not long when casting between pointer and int
Whilst all FreeBSD architectures have the same representation for
intptr_t and long (even if the former is int on ILP32 architectures),
this is more general and correct, and on CHERI they are not the same so
warnings are generated by default for integer-to-pointer casts that
aren't via (u)intptr_t.

Reviewed by:	imp, kib
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D30696
2021-06-08 18:30:59 +01:00
Lutz Donnerhacke
9021c46603 tests/netgraph: Attribute errors to the caller
Errors raised in the common util functions should raise the location
of their caller to be useful and include the errno description.

Reviewed by:	kp
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30671
2021-06-08 19:23:50 +02:00
Marcin Wojtas
28c4e511c2 Add ofw interface support to PCI
Some arm64 SoCs have nodes in their fdts that describe devices
connected to the internal PCI bus. One such SoC is Freescale LS1028A.
In order to access information stored in them we need to add ofw bus
support to pci. Pass devinfo request up to our parent, which
is responsible for parsing all the information.
It allows to use ofw interface on PCI devices that support it.
This method is similar to sys/dev/acpica/acpi_pci.c.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: andrew
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D30181
2021-06-08 17:52:02 +02:00
Marcin Wojtas
ea52e81588 pci_host_generic_fdt.c: Add support for mapping dts nodes to PCI devices
Some arm64 SoCs have nodes in their fdts that describe devices
connected to the internal PCI bus. One such SoC is Freescale LS1028A.
It expects the nodes to be mapped to devices enumerated using the standard
PCI method. Mapping is done by reading device and function ids from "reg"
property. Information is dts is used to describe MDIO/PHY connected
to a given interface.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: andrew
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D30180
2021-06-08 17:51:40 +02:00
Marcin Wojtas
f0f7b0868a Remove ThunderX PCIe FDT quirks from pci_host_generic_fdt.c
ThunderX is the only board known to use them.
Move them to the ThunderX PCIe driver.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: andrew
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D30179
2021-06-08 17:51:11 +02:00
Warner Losh
b382394332 updating: add note about vendor/openzfs branch rename
Add a pointer to
https://lists.freebsd.org/archives/freebsd-current/2021-June/000153.html
to explain how to pull a new tree due to the vendor/openzfs branch
being renamed.

Reviewed by:		lwhsu@
Sponsored by:		Netflix
2021-06-08 09:00:57 -06:00
Martin Matuska
1603881667 zfs: merge openzfs/zfs@75b4cbf62 (master) into main
Notable upstream pull request merges:
  #11710 Allow zfs to send replication streams with missing snapshots
  #11751 Avoid taking global lock to destroy zfsdev state
  #11786 Ratelimit deadman zevents as with delay zevents
  #11803 ZFS traverse_visitbp optimization to limit prefetch
  #11813 Allow pool names that look like Solaris disk names
  #11822 Atomically check and set dropped zevent count
  #11822 Don't scale zfs_zevent_len_max by CPU count
  #11833 Refactor zfsdev state init/destroy to share common code
  #11837 zfs get -p only outputs 3 columns if "clones" property is empty
  #11843 libzutil: zfs_isnumber(): return false if input empty
  #11849 Use dsl_scan_setup_check() to setup a scrub
  #11861 Improvements to the 'compatibility' property
  #11862 cmd/zfs receive: allow dry-run (-n) to check property args
  #11864 receive: don't fail inheriting (-x) properties on wrong dataset type
  #11877 Combine zio caches if possible
  #11881 FreeBSD: use vnlru_free_vfsops if available
  #11883 FreeBSD: add support for lockless symlink lookup
  #11884 FreeBSD: add missing seqc write begin/end around zfs_acl_chown_setattr
  #11896 Fix crash in zio_done error reporting
  #11905 zfs-send(8): Restore sorting of flags
  #11926 FreeBSD: damage control racing .. lookups in face of mkdir/rmdir
  #11930 vdev_mirror: don't scrub/resilver devices that can't be read
  #11938 Fix AVX512BW Fletcher code on AVX512-but-not-BW machines
  #11955 zfs get: don't lookup mount options when using "-s local"
  #11956 libzfs: add keylocation=https://, backed by fetch(3) or libcurl
  #11959 vdev_id: variable not getting expanded under map_slot()
  #11966 Scale worker threads and taskqs with number of CPUs
  #11994 Clean up use of zfs_log_create in zfs_dir
  #11997 FreeBSD: Don't force xattr mount option
  #11997 FreeBSD: Implement xattr=sa
  #11997 FreeBSD: Use SET_ERROR to trace xattr name errors
  #11998 Simplify/fix dnode_move() for dn_zfetch
  #12003 FreeBSD: Initialize/destroy zp->z_lock
  #12010 Fix dRAID self-healing short columns
  #12033 Revert "Fix raw sends on encrypted datasets when copying back snapshots"
  #12040 Reinstate the old zpool read label logic as a fallback
  #12046 Improve scrub maxinflight_bytes math
  #12049 FreeBSD: avoid memory allocation in arc_prune_async
  #12052 FreeBSD: incorporate changes to the VFS_QUOTACTL(9) KPI
  #12061 Fix dRAID sequential resilver silent damage handling
  #12072 Let zfs diff be more permissive
  #12077 FreeBSD: Retry OCF ENOMEM errors.
  #12088 Propagate vdev state due to invalid label corruption
  #12091 libzfs: On FreeBSD, use MNT_NOWAIT with getfsstat
  #12097 FreeBSD: Update dataset_kstats for zvols in dev mode
  #12104 FreeBSD boot code reminder after zpool upgrade
  #12114 Introduce write-mostly sums

Obtained from:	OpenZFS
OpenZFS commit:	75b4cbf625
2021-06-08 16:52:44 +02:00
Martin Matuska
ed9215c8e0 zfs: merge openzfs/zfs@3522f57b6 (master) to main
This changes branch tracking of sys/contrib/openzfs to a new
direct-import branch vendor/openzfs/master.

No functional changes.

OpenZFS tag:	2.1.0-rc1
2021-06-08 16:25:14 +02:00
Mark Johnston
97993d1ebf hyperv: Fix vmbus after the i386 4/4 split
The vmbus ISR needs to live in a trampoline.  Dynamically allocating a
trampoline at driver initialization time poses some difficulties due to
the fact that the KENTER macro assumes that the offset relative to
tramp_idleptd is fixed at static link time.  Another problem is that
native_lapic_ipi_alloc() uses setidt(), which assumes a fixed trampoline
offset.

Rather than fight this, move the Hyper-V ISR to i386/exception.s.  Add a
new HYPERV kernel option to make this optional, and configure it by
default on i386.  This is sufficient to make use of vmbus(4) after the
4/4 split.  Note that vmbus cannot be loaded dynamically and both the
HYPERV option and device must be configured together.  I think this is
not too onerous a requirement, since vmbus(4) was previously
non-functional.

Reported by:	Harry Schmalzbauer <freebsd@omnilan.de>
Tested by:	Harry Schmalzbauer <freebsd@omnilan.de>
Reviewed by:	whu, kib
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30577
2021-06-08 09:40:30 -04:00
Alan Somers
75b4cbf625
libzfs: On FreeBSD, use MNT_NOWAIT with getfsstat
`getfsstat(2)` is used to retrieve the list of mounted file systems,
which libzfs uses when fetching properties like mountpoint, atime,
setuid, etc.  The `mode` parameter may be `MNT_NOWAIT`, which uses
information in the VFS's cache, or `MNT_WAIT`, which effectively does a
`statfs` on every single mounted file system in order to fetch the most
up-to-date information.  As far as I can tell, the only fields that
libzfs cares about are the filesystem's name, mountpoint, fstypename,
and mount flags.  Those things are always updated on mount and unmount,
so they will always be accurate in the VFS's mount cache except in two
circumstances:

1) When a file system is busy unmounting
2) When a ZFS file system changes the value of a mount-overridable
   property like atime or setuid, but doesn't remount the file system.
   Right now that only happens when the property is changed by an
   unprivileged user who has delegated authority to change the property
   but not to mount the dataset.  But perhaps libzfs could choose to do
   it for other reasons in the future.

Switching to `MNT_NOWAIT` will greatly improve speed with no downside,
as long as we explicitly update the mount cache whenever we change a
mount-overridable property.

For comparison, Illumos gets this information using the native
`getmntany` and `getmntent` functions, which also use cached
information.  The illumos function that would refresh the cache,
`resetmnttab`, is never called by libzfs.

And on GNU/Linux, `getmntany` and `getmntent` don't even communicate
with the kernel directly.  They simply parse the file they are given,
which is usually /etc/mtab or /proc/mounts.  Perhaps the implementation
of /proc/mounts is synchronous, ala MNT_WAIT; I don't know.

Sponsored-by:	Axcient
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Alan Somers <asomers@gmail.com>
Closes: #12091
2021-06-08 07:36:43 -06:00
Lutz Donnerhacke
6181470239 tests/netgraph: Tests for ng_bridge
Test functionality of ng_bridge(4):
 - replicating traffic to anything but the sending hook
 - persistence
 - detect loops
 - unicast to only one link of many
 - stretch to implementation limits on broadcast

Reviewed by:	kp
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30647
2021-06-08 13:27:23 +02:00
Corvin Köhne
054accac71 Add a virtio-input device emulation.
This will be used to inject keyboard/mouse input events into a guest.
The command line syntax is:
   -s <slot>,virtio-input,/dev/input/eventX

Reviewed by:	jhb (bhyve), grehan
Obtained from:	Corvin Köhne <C.Koehne@beckhoff.com>
MFC after:	3 weeks
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D30020
2021-06-08 19:05:09 +10:00
Lutz Donnerhacke
09307dbfb8 tests/netgraph: Allow receiving answers to messages
Add msg_handler in order to receive messages from netgraph nodes to be
tested.

Reviewed by:	kp
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30657
2021-06-08 12:49:04 +02:00
Edward Tomasz Napierala
f102b61d0e linux: make sure to zero the l_siginfo structure for ptrace(2)
Reported By:	dchagin
Sponsored By:	EPSRC
2021-06-08 10:18:29 +01:00
Philippe Michaud-Boudreault
2362ad457a linux: implement statx(2)
PR:		252106
Reviewed By:	dchagin
Differential Revision:	https://reviews.freebsd.org/D30466
2021-06-08 10:08:56 +01:00
Dmitry Chagin
f570a6723e Fix copyright, remove "all rights reserved".
The eventfd code was written by me, rdivacky@ copyrigth applicable only
to epoll part of the Linuxulator code. Roman is ok to retire his copyright
from sys/kern/sys_eventfd.c and 'All rights reserved.' lines from
sys/compat/linux/linux_event.[c|h] and sys/kern/sys_eventfd.c files.

Reviewed by:		kib, emaste
Approved by:		rdivacky
Differential Revision:	https://reviews.freebsd.org/D30677
MFC after:		2 weeks
2021-06-08 08:18:00 +03:00
наб
9685f363c3 tests/file_check: remove unused variable
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187
2021-06-07 20:59:01 -07:00
наб
f423411c44 module/zfs: vdev_removal: spa_vdev_remove_thread: remove unused variable
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187
2021-06-07 20:58:56 -07:00
наб
6bab6ee838 module/zfs: vdev_indirect: vdev_indirect_repair: remove unused variable
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187
2021-06-07 20:58:51 -07:00
наб
f70f3e2fbc module/zfs: dbuf: dbuf_read_impl: remove unused variable
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187
2021-06-07 20:58:47 -07:00
наб
f719d3b160 module/zfs: arc: arc_hdr_realloc_crypt: remove unused variables
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187
2021-06-07 20:58:42 -07:00
наб
4ff49c5a06 libzfs: zfs_send: remove unused variable
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187
2021-06-07 20:58:28 -07:00
наб
4f1009face zdb: zdb_decompress_block: don't needlessly set buf
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187
2021-06-07 20:58:23 -07:00
наб
77f3b67520 libzutil: zpool_find_config: remove unused variable
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187
2021-06-07 20:58:10 -07:00
Neel Chauhan
1b602f641a linuxkpi: Fix build from redefined pr_err_once() 2021-06-07 16:37:21 -07:00
Neel Chauhan
37d64dcdfa linuxkpi: Include pr_err_once() in printk.h
Approved by:		bz (src), hselasky (src)
Differential Reivison:	https://reviews.freebsd.org/D30687
2021-06-07 15:53:24 -07:00
Neel Chauhan
096104e790 linuxkpi: Add rom and romlen to struct pci_dev
Approved by:		bz (src), hselasky (src)
Differential Reivison:	https://reviews.freebsd.org/D30686
2021-06-07 15:53:24 -07:00
Fedor Korotkov
225605ec16 Cirrus-CI: Use the default Git history depth
Which is `50`.  I saw a few errors like
`Failed to force reset to SHA: object not found!` which seems is
happening because the SHA is not available because there were two
commits pushed almost simultaneously and the second from the top fails
with this error because the SHA is not in the history.

Pull Request:	https://github.com/freebsd/freebsd-src/pull/454

Comments on re-commit from emaste:

Originally committed as fcb4797c90 and reverted in 80a840b8ba due
to the clone operation taking significantly longer.  However, I have
seen many failures due to the "object not found" issue recently.
7 of 37 recent runs failed because of this, and intermittent failures
like this makes CI much less useful.

Prefer longer-running runs to intermittent failures.
2021-06-07 18:50:18 -04:00
Rick Macklem
03c81af249 nfscl: Fix generation of va_fsid for a tree of NFSv4 server file systems
Pre-r318997 the code looked like:
if (vp->v_mount->mnt_stat.f_fsid.val[0] != (uint32_t)np->n_vattr.na_filesid[0])
         vap->va_fsid = (uint32_t)np->n_vattr.na_filesid[0];
Doing this assignment got lost by r318997 and, as such, NFSv4 mounts
of servers with trees of file systems on the server is broken, due to duplicate
fileno values for the same st_dev/va_fsid.

Although I could have re-introduced the assignment, since the value of
na_filesid[0] is not guaranteed to be unique across the server file systems,
I felt it was better to always do the hash for na_filesid[0,1].
Since dev_t (st_dev/va_fsid) is now 64bits, I switched to a 64bit hash.

There is a slight chance of a hash conflict where 2 different na_filesid
values map to same va_fsid, which will be documented in the BUGS
section of the man page for mount_nfs(8).  Using a table to keep track
of mappings to catch conflicts would not easily scale to 10,000+ server file
systems and, when the conflict occurs, it only results in fts(3) reporting
a "directory cycle" under certain circumstances.

Reviewed by:	kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D30660
2021-06-07 13:48:25 -07:00
Mark Johnston
887c753c9f Fix handling of D_GIANTOK
It was meant to suppress only the printf(), not the subsequent injection
of Giant-protected thunks for various file operations.

Fixes:		fbeb4ccac9
Reported by:	pho
Tested by:	pho
MFC after:	6 days
Pointy hat:	markj
2021-06-07 16:45:50 -04:00
наб
2d815d955e
Modernise/fix/rewrite unlinted manpages
zpool-destroy.8: flatten, fix description
zfs-wait.8: flatten, fix description, use list for events
zpool-reguid.8: flatten, fix description
zpool-history.8: flatten, fix description
zpool-export.8: flatten, fix description, remove -f "unmount" reference
  AFAICT no such command exists even in Illumos (as of today, anyway),
  and we definitely don't call it
zpool-labelclear.8: flatten, fix description
zpool-features.5: modernise
spl-module-parameters.5: modernise
zfs-mount-generator.8: rewrite
zfs-module-parameters.5: modernise

Reviewed-by: Richard Laager <rlaager@wiktel.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12169
2021-06-07 13:41:54 -06:00
Rich Ercolani
afb96fa6ee
Force --enable-debug on FreeBSD if INVARIANTS is set
There's already logic to force INVARIANTS on for building if it's
present in the running kernel; however, not having DEBUG enabled
when DEBUG and INVARIANTS are can cause strange panics.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #12185
Closes #12163
2021-06-07 13:29:27 -06:00
Serapheim Dimitropoulos
86b5f4c121
Livelist logic should handle dedup blkptrs
Update the logic to handle the dedup-case of consecutive
FREEs in the livelist code. The logic still ensures that
all the FREE entries are matched up with a respective
ALLOC by keeping a refcount for each FREE blkptr that we
encounter and ensuring that this refcount gets to zero
by the time we are done processing the livelist.

zdb -y no longer panics when encountering double frees

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Don Brady <don.brady@delphix.com>
Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Closes #11480
Closes #12177
2021-06-07 13:09:07 -06:00
Alexander Motin
ea400129c3
More aggsum optimizations
- Avoid atomic_add() when updating as_lower_bound/as_upper_bound.
Previous code was excessively strong on 64bit systems while not
strong enough on 32bit ones.  Instead introduce and use real
atomic_load() and atomic_store() operations, just an assignments
on 64bit machines, but using proper atomics on 32bit ones to avoid
torn reads/writes.

 - Reduce number of buckets on large systems.  Extra buckets not as
much improve add speed, as hurt reads.  Unlike wmsum for aggsum
reads are still important.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #12145
2021-06-07 09:02:47 -07:00
Greg V
05c2d94a08 LinuxKPI: add pr_err_once
Reviewed by:	hselasky, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D30672
2021-06-07 10:31:48 -04:00
Stefan Eßer
35b8fd0b69 usr.bin/calendar: do not treat // in text as comment
The C++-style comment marker "//" has been added with the rewrite of
the preprocessor features. Since this character sequence occurs	in
ULRS, the reminder of the URL was considered a comment and stripped
from the calendar line.

Change parsing of "//" to only start a comment at the begin of a line
or when	preceeded by a white-space character.

PR:		256455
Reported by:	Philippe Michel (philippe.michel7 at free.fr)
MFC after:	3 days
2021-06-07 15:55:23 +02:00
Edward Tomasz Napierala
dd869341b1 Install the linux(4) man page also for aarch64
Previously it was only installed on i386 and amd64.

Reviewed By:	emaste, gbe (manpages)
Sponsored By:	EPSRC
Differential Revision: https://reviews.freebsd.org/D30546
2021-06-07 11:50:50 +01:00
Edward Tomasz Napierala
128a1db806 linux: improve FUSE support
This fixes a number of AppImages; tested with
scribus-1.5.6.1-linux-x86_64.AppImage.

Reported By:	@probonopd
Reviewed By:	asomers, emaste
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D30606
2021-06-07 10:43:28 +01:00
Poul-Henning Kamp
aaa28628a3 fifolog: Rename yyparse() to getdate_yyparse().
Remove config file for obsolete static analyzer FlexeLint
2021-06-07 06:31:50 +00:00
Peter Holm
201434ecac stress2: Added two test scenarios based on Bug 256205 2021-06-07 07:35:10 +02:00
Peter Holm
b3b695604d stress2: Added a few syzkaller reproducers 2021-06-07 07:33:32 +02:00
Mark Johnston
e755e2776d ngatm: Handle errors from uni_msg_extend()
uni_msg_extend() may fail due to a memory allocation failure.  In this
case, though, the message is freed, so callers shouldn't touch it.

PR:		255861
Reviewed by:	harti
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30611
2021-06-06 16:44:47 -04:00
Mark Johnston
62ba0def55 arm: Remove last_fault_code
It is unused since the removal of pmap-v4.c in commit b88b275145.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-06-06 16:44:47 -04:00
Radosław Chmielarz
03d4b58fee iwn: adjust EEPROM read timeout for Intel 4965AGN M2
Reading EEPROM from Intel 4965AGN M2 takes 60 us which was causing panic
on system startup.

PR:		255465
Reviewed by:	markj
MFC after:	1 week
2021-06-06 16:44:47 -04:00
Mark Johnston
317113bb12 riscv: Rename pmap_fault_fixup() to pmap_fault()
This is consistent with other platforms, specifically arm and arm64.  No
functional change intended.

Reviewed by:	jrtc27
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30645
2021-06-06 16:44:46 -04:00
Mark Johnston
c05748e028 riscv: Handle hardware-managed dirty bit updates in pmap_promote_l2()
pmap_promote_l2() failed to handle implementations which set the
accessed and dirty flags.  In particular, when comparing the attributes
of a run of 512 PTEs, we must handle the possibility that the hardware
will set PTE_D on a clean, writable mapping.

Following the example of amd64 and arm64, change riscv's
pmap_promote_l2() to downgrade clean, writable mappings to read-only, so
that updates are synchronized by the pmap lock.

Fixes:		f6893f09d
Reported by:	Nathaniel Filardo <nwf20@cl.cam.ac.uk>
Tested by:	Nathaniel Filardo <nwf20@cl.cam.ac.uk>
Reviewed by:	jrtc27, alc, Nathaniel Filardo
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30644
2021-06-06 16:44:46 -04:00