Commit Graph

254809 Commits

Author SHA1 Message Date
Alexander V. Chernikov
f47fa26065 Add nhop_ref_any() to unify referencing nhop or nexthop group.
It allows code within routing subsystem to transparently reference nexthops
 and nexthop groups, similar to nhop_free_any(), abstracting ROUTE_MPATH
 details.

Differential Revision:	https://reviews.freebsd.org/D27410
2020-11-29 13:52:06 +00:00
Eugene Grosbein
1c86e81196 hastd(8) assumes it has no extra file descriptors opened
and aborts otherwise, so call closefrom() early.

PR:		227461
MFC after:	2 weeks
2020-11-29 13:45:53 +00:00
Alexander V. Chernikov
b712e3e343 Refactor fib4/fib6 functions.
No functional changes.

* Make lookup path of fib<4|6>_lookup_debugnet() separate functions
 (fib<46>_lookup_rt()). These will be used in the control plane code
 requiring unlocked radix operations and actual prefix pointer.
* Make lookup part of fib<4|6>_check_urpf() separate functions.
 This change simplifies the switch to alternative lookup implementations,
 which helps algorithmic lookups introduction.
* While here, use static initializers for IPv4/IPv6 keys

Differential Revision:	https://reviews.freebsd.org/D27405
2020-11-29 13:41:49 +00:00
Alexander V. Chernikov
98d5c4e5c8 Add tracking for rib/nhops/nhgrp objects and provide cumulative number accessors.
The resulting KPI can be used by routing table consumers to estimate the required
 scale for route table export.

* Add tracking for rib routes
* Add accessors for number of nexthops/nexthop objects
* Simplify rib_unsubscribe: store rnh we're attached to instead of requiring it up
 again on destruction. This helps in the cases when rnh is not linked yet/already unlinked.

Differential Revision:	https://reviews.freebsd.org/D27404
2020-11-29 13:27:24 +00:00
Konstantin Belousov
3c48106aaa bhyve: limit max GPA to VM_MAXUSER_ADDRESS_LA48.
We use 4-level EPT pages, correct the upper bound.

Reviewed by:	grehan
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D27402
2020-11-29 10:32:38 +00:00
Konstantin Belousov
a9d4fe977a bio aio: Destroy ephemeral mapping before unwiring page.
Apparently some architectures, like ppc in its hashed page tables
variants, account mappings by pmap_qenter() in the response from
pmap_is_page_mapped().

While there, eliminate useless userp variable.

Noted and reviewed by:	alc (previous version)
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D27409
2020-11-29 10:30:56 +00:00
Michal Meloun
5c2967f66f Remove the pre-ARMv6 and pre-INTRNG code.
ARM has required ARMV6+ and INTRNg for some time now, so remove
always false #ifdefs and unconditionally do always true #ifdefs.
2020-11-29 08:40:12 +00:00
Yuri Pankov
41062d6878 hwpstate_intel: don't unconditionally print the error message
Actually check the wrmsr_safe() return value when setting autonomous
HWP for package.

PR:		245582
Differential Revision:	https://reviews.freebsd.org/D24744
2020-11-29 01:43:04 +00:00
Alexander Motin
83f6b50123 Remove alignment requirements for KVA buffer mapping.
After r368124 pbuf_zone has extra page to handle this particular case.
2020-11-29 01:30:17 +00:00
Alexander Motin
1770bae5f8 Remove aligment requirements for passthrough buffer.
After r368124 vmapbuf() should happily map misaligned maxphys-sized buffers
thanks to extra page added to pbuf_zone.
2020-11-29 00:57:19 +00:00
Alexander Motin
9093e27cc1 Remove alignment requirements for KVA buffer mapping.
After r368124 vmapbuf() should happily map misaligned maxphys-sized buffers
thanks to extra page added to pbuf_zone.
2020-11-29 00:49:14 +00:00
Alexander Motin
a93d2db0e7 Mark inline functions static. 2020-11-29 00:35:13 +00:00
Alexander Motin
ac90f70d1e Increase nvme(4) maximum transfer size from 1MB to 2MB.
With 4KB page size the 2MB is the maximum we can address with one page PRP.
Going further would require chaining, that would add some more complexity.

On the other side, to reduce memory consumption, allocate the PRP memory
respecting maximum transfer size reported in the controller identify data.
Many of NVMe devices support much smaller values, starting from 128KB.
To do that we have to change the initialization sequence to pull the data
earlier, before setting up the I/O queue pairs.  The admin queue pair is
still allocated for full MIN(maxphys, 2MB) size, but it is not a big deal,
since there is only one such queue with only 16 trackers.

Reviewed by:	imp
MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2020-11-29 00:20:31 +00:00
Alan Somers
fd26389be7 ping: allow building without INET support
Building without INET6 support was already possible. Now it's possible to
build ping with only INET6, or even with neither INET nor INET6.

Reported by:	bz
Reviewed by:	bz
MFC-With:	368045
Differential Revision:	https://reviews.freebsd.org/D27394
2020-11-28 23:24:19 +00:00
Poul-Henning Kamp
5667729fba Add watchdog(9) driver for the Fintek F81803 SuperIO chip 2020-11-28 22:34:33 +00:00
Alexander V. Chernikov
ef6ef7e5da Add nhgrp_get_idx() as a counterpart for nhop_get_idx().
It allows the routing-related code to reference nexthop groups by index
 instead of storing a pointer.
2020-11-28 15:46:40 +00:00
Alexander V. Chernikov
7a6dc73c98 Cleanup nexthops request flags:
* remove NHR_IFAIF as it was used by previous version of nexthop KPI
* update NHR_REF description
2020-11-28 15:11:59 +00:00
Michal Meloun
b88b275145 Remove now unused armv4 and not-INTRNG files. 2020-11-28 15:00:08 +00:00
Konstantin Belousov
412ef5da8a libc: Add pthread_attr_get_np(3) stub, reporting ESRCH.
This seems to be required by recent clang asan.
I do not see other way than put the symbol under FBSD_1.0 version.

PR:	251112
Reported by:	Andrew Stitcher <astitcher@apache.org>
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D27389
2020-11-28 12:19:20 +00:00
Konstantin Belousov
cd85379104 Make MAXPHYS tunable. Bump MAXPHYS to 1M.
Replace MAXPHYS by runtime variable maxphys. It is initialized from
MAXPHYS by default, but can be also adjusted with the tunable kern.maxphys.

Make b_pages[] array in struct buf flexible.  Size b_pages[] for buffer
cache buffers exactly to atop(maxbcachebuf) (currently it is sized to
atop(MAXPHYS)), and b_pages[] for pbufs is sized to atop(maxphys) + 1.
The +1 for pbufs allow several pbuf consumers, among them vmapbuf(),
to use unaligned buffers still sized to maxphys, esp. when such
buffers come from userspace (*).  Overall, we save significant amount
of otherwise wasted memory in b_pages[] for buffer cache buffers,
while bumping MAXPHYS to desired high value.

Eliminate all direct uses of the MAXPHYS constant in kernel and driver
sources, except a place which initialize maxphys.  Some random (and
arguably weird) uses of MAXPHYS, e.g. in linuxolator, are converted
straight.  Some drivers, which use MAXPHYS to size embeded structures,
get private MAXPHYS-like constant; their convertion is out of scope
for this work.

Changes to cam/, dev/ahci, dev/ata, dev/mpr, dev/mpt, dev/mvs,
dev/siis, where either submitted by, or based on changes by mav.

Suggested by: mav (*)
Reviewed by:	imp, mav, imp, mckusick, scottl (intermediate versions)
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D27225
2020-11-28 12:12:51 +00:00
John Baldwin
1b9c78611d Suspend I/O on ahci-cd devices during a snapshot.
Submitted by:	Vitaliy Gusev <gusev.vitaliy@gmail.com>
2020-11-28 04:21:22 +00:00
John Baldwin
bb481f6718 bhyve: Add snapshot support for virtio-rnd.
This uses the same snapshot routine as other VirtIO devices.

Submitted by:	Vitaliy Gusev <gusev.vitaliy@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D26265
2020-11-28 04:06:09 +00:00
John Baldwin
57b0a3aaca bhyve: 'xhci,tablet' snapshot fixes
Permit suspend/resume of a XHCI device model that has not been
attached to by a driver in a guest OS.

Submitted by:	Vitaliy Gusev <gusev.vitaliy@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D26264
2020-11-28 03:54:48 +00:00
Kyle Evans
e07e3fa3c9 kern: cpuset: drop the lock to allocate domainsets
Restructure the loop a little bit to make it a little more clear how it
really operates: we never allocate any domains at the beginning of the first
iteration, and it will run until we've satisfied the amount we need or we
encounter an error.

The lock is now taken outside of the loop to make stuff inside the loop
easier to evaluate w.r.t. locking.

This fixes it to not try and allocate any domains for the freelist under the
spinlock, which would have happened before if we needed any new domains.

Reported by:	syzbot+6743fa07b9b7528dc561@syzkaller.appspotmail.com
Reviewed by:	markj
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D27371
2020-11-28 01:21:11 +00:00
Peter Grehan
15add60d37 Convert vmm_ops calls to IFUNC
There is no need for these to be function pointers since they are
never modified post-module load.

Rename AMD/Intel ops to be more consistent.

Submitted by:	adam_fenn.io
Reviewed by:	markj, grehan
Approved by:	grehan (bhyve)
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D27375
2020-11-28 01:16:59 +00:00
Ed Maste
a36179937e addr2line: add label checks when DW_AT_range and DW_AT_low_pc cannot be used
Check label's ranges for address we want to translate if a CU doesn't
have usable DW_AT_range or DW_AT_low_pc.

Use more appropriate names: "struct CU" -> "struct range"

Developed as part of upstream ELF Tool Chain bug report
https://sourceforge.net/p/elftoolchain/tickets/552/ although this does
not address the specific case reported there.

Submitted by:	Tiger Gao <tig@freebsdfoundation.org>
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23782
2020-11-27 21:38:03 +00:00
Ruslan Bukin
f120ad6ba0 o Move options IOMMU from Debugging section back to the Bus section
where it originally was. The bug introduced in r366267.
o Remove options IOMMU from i386/MINIMAL as we don't have it in
  i386/GENERIC.

Reported by:	Harry Schmalzbauer <freebsd@omnilan.de>
Reviewed by:	kib
Sponsored by:	Innovate DSbD
Differential Revision:	https://reviews.freebsd.org/D27399
2020-11-27 21:37:48 +00:00
Mark Johnston
0c56925bc2 callout(9): Remove some leftover APM BIOS support
This code is obsolete since r366546.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D27267
2020-11-27 20:46:02 +00:00
Hajimu UMEMOTO
1def0a6257 fix casper initialization for setting scripts.
MFC after:	1 week
2020-11-27 18:40:51 +00:00
Mark Johnston
a92526f3f1 arm: Correctly report the size of FPA registers to GDB
Modern ARM systems do not have an FPA unit but GDB reserves register
indices for FPA registers and expects the stub to know their sizes.

PR:		251022
Submitted by:	Dmitry Salychev <dsl@mcusim.org>
MFC after:	2 weeks
2020-11-27 16:35:43 +00:00
Alexander Motin
156c1ebe3b Some code reorganization.
- Remove code duplication by adding two new functions to execute prepared
queue entry via either mbox or request queue and wait for result.
 - Since the new function executing via request queue sleeps any way, make
it sleep also in case of overflows or handle shortages.  It should make it
more reliable and less affecting other less flexible request queue users.
 - Turn isp_target_put_entry() into not target-specific isp_send_entry().
 - Make handling of responses with control handles more universal.
 - Move RQSTYPE_RPT_ID_ACQ handling into new function.
 - Inline isp_handle_other_response(), becoming trivial after above.
 - Clean the list of IOCBs from pre-24xx ones.
2020-11-27 15:50:20 +00:00
Stefan Eßer
76810a9564 Make generated C files depend on this Makefile
The contents of lib.c, lib2.c, bc_help.c, and dc_help.c depends on the
parameters passed to strgen.sh in this Makefile. A change to the number
of parameters of strgen.sh has been applied to the invocation of this
command, but this did not cause a rebuild of the generated files.

Reported by:	Cy.Schubert@cschubert.com
2020-11-27 09:00:21 +00:00
Rebecca Cran
866db2fef0 Fix bhyve SMBIOS type 19 handling to avoid misreporting total RAM amount
This fixes the amount of memory displayed in the EDK2 UiApp to be the same
as passed on the bhyve command line. Otherwise, 8GB is displayed as 4GB,
32GB as 28GB etc.

Reviewed by:	jhb, kib, rgrimes
Differential Revision:	https://reviews.freebsd.org/D27348
2020-11-27 08:00:32 +00:00
Rebecca Cran
5285d5e8e1 bhyve: fix smbiostbl.c style issues and add comment about date format
Fix a couple of style issues introduced in my previous commit.
Add a comment explaining that the SMBIOS specification defines the date
format to be mm/dd/yyyy, which is why we don't use ISO 8601.
2020-11-27 07:53:15 +00:00
Alexander Motin
df9c69d239 Restore break statement lost in r367857. 2020-11-27 05:13:52 +00:00
Mateusz Piotrowski
16e1abe4e0 libprocstat.3: Correct two occurrences of kvm_getprocs to procstat_getprocs
Submitted by:	otis_sk.freebsd.org
Reviewed by:	markj
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D26151
2020-11-26 22:49:05 +00:00
Konstantin Belousov
1a1b8b1cb3 Remove stray column.
Sponsored by:	The FreeBSD Foundation
MFC after: 3 days
2020-11-26 20:27:23 +00:00
Konstantin Belousov
20b8e1a25c Style.
Sponsored by:	The FreeBSD Foundation
MFC after: 3 days
2020-11-26 20:23:17 +00:00
Emmanuel Vadot
df15910266 arm64: Do not rely on SPCR table to detect acpi
Since EDK2 commit d8e36289cef7bde628b023219cd65fa8e8d4562a, the Graphical console may
completely hide SPCR, causing panics later when locating timers.
As such simply rely on the ACPI Root pointer presence.

Submitted by:	dan.kotowski@a9development.com
Reviewed by:	andrew, mw
Differential Revision:	https://reviews.freebsd.org/D27306
2020-11-26 20:22:34 +00:00
Stefan Eßer
891bc22d39 Update Makefile for new version 3.2.0 2020-11-26 19:38:02 +00:00
Alexander Motin
b760d2eca9 More cleanup in response queue and reset code. 2020-11-26 18:47:23 +00:00
Alan Somers
d262451715 ping: add a ping6 hard link for backwards compatibility
When invoked as "ping6", ping will now attempt to use ICMPv6 for hostnames
that resolve both IPv4 and IPv6 addresses.

Reviewed by:	bz, manu
MFC-With:	r368045
Differential Revision:	https://reviews.freebsd.org/D27384
2020-11-26 18:33:04 +00:00
Konstantin Belousov
f7af6e5e54 nullfs: provide custom bypass for VOP_READ_PGCACHE().
Normal bypass expects locked vnode, which is not true for
VOP_READ_PGCACHE().  Ensure liveness of the lower vnode by taking the
upper vnode interlock, which is also taked by null_reclaim() when
setting v_data to NULL.

Reported and tested by:	pho
Reviewed by:	markj, mjg
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D27327
2020-11-26 18:16:32 +00:00
Konstantin Belousov
99c66d3acf vn_read_from_obj(): fix handling of doomed vnodes.
There is no reason why vp->v_object cannot be NULL. If it is, it's
fine, handle it by delegating to VOP_READ().

Tested by:	pho
Reviewed by:	markj, mjg
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D27327
2020-11-26 18:13:33 +00:00
Konstantin Belousov
164438a7b9 More careful handling of the mount failure.
- VFS_UNMOUNT() requires vn_start_write() around it [*].
- call VFS_PURGE() before unmount.
- do not destroy mp if cleanup unmount did not succeed.
- set MNTK_UNMOUNT, and indicate forced unmount with MNTK_UNMOUNTF
  for VFS_UNMOUNT() in cleanup.

PR:	251320 [*]
Reported by:	Tong Zhang <ztong0001@gmail.com>
Reviewed by:	markj, mjg
Discussed with:	rmacklem
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D27327
2020-11-26 18:08:42 +00:00
Konstantin Belousov
92bcefd1d2 clear_inodedeps: handle ERELOOKUP from ffs_syncvnode().
Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
2020-11-26 18:03:24 +00:00
Konstantin Belousov
3b1f974bfb Make max ticks for pause in vn_lock_pair() adjustable at runtime.
Reduce default value from hz / 10 to hz / 100.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
2020-11-26 18:00:26 +00:00
Stefan Eßer
50696a6e8c Update to version 3.2.0 2020-11-26 17:39:51 +00:00
Alex Richardson
dabbf11f97 bsd.lib.mk: Work around build system raciness
We are seeing regular build failures due to libc.so being installed again and
another parallel make job tries to read the partially written libc.so at the
same time. When building with -j32 or higher this almost always happens on
the first clean build (subsequent incremental builds always work fine).
Using -S should "fix" the "section header table goes past the end of the
file: e_shoff = 0x..." errors that have started to plague our builds.

We originally thought this only affected CheriBSD, but I just got the same
error while building the latest upstream FreeBSD.

The real fix should be to not install libraries twice, but until then this
workaround is needed.

Original patch by jrtc27@, I only made some minor changes to the comment.

Obtained from: CheriBSD (49837edd3e)
Reviewed By:	markj, bdrewery
Differential Revision: https://reviews.freebsd.org/D27102
2020-11-26 17:37:27 +00:00
Alex Richardson
acf8792067 Add .cfi_{start,end}proc for RISC-V assembly functions
This allows GDB to print more useful backtraces when setting a breakpoint
on an assembly function.

Reviewed By:	jhb
Differential Revision: https://reviews.freebsd.org/D27177
2020-11-26 17:37:22 +00:00