Commit Graph

258321 Commits

Author SHA1 Message Date
Alex Richardson
0b4ad01d91 libc/string/bcopy.c: Use intptr_t as the copy type
While most 64-bit architectures have an assembly implementation of this
file RISC-V does not. As we now copy 8 bytes instead of 4 it should speed
up RISC-V. Using intptr_t instead of int also allows using this file for
CHERI pure-capability code since trying to copy pointers using integer
loads/stores will invalidate pointers.

Reviewed By:	kib
Obtained from:	CheriBSD (partially)
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D29535
2021-04-20 01:46:42 +01:00
Alex Richardson
bbd421cdf6 contrib/flex: Drop local __dead2 patch
Upstream flex has added a yynoreturn, so this diff is no longer needed.
Partially reverts r181269. Also regenerate the pre-generated files that
are used for bootstrapping.

Reviewed By:	jkim

Differential Revision: https://reviews.freebsd.org/D29679
2021-04-20 01:46:42 +01:00
Alex Richardson
ba1182e263 bsd.compiler.mk: detect Apple Clang for cross-builds
Apple clang uses a different versioning scheme, so if we enable or
disable certain warnings for Clang 11+, those might not be supported
in Apple Clang 11+. This adds 'apple-clang' to COMPILER_FEATURES, so that
bootstrap tools Makefiles can avoid warnings on macOS.

Reviewed By:	imp
Differential Revision: https://reviews.freebsd.org/D29680
2021-04-20 01:46:36 +01:00
Gleb Smirnoff
faa9ad8a90 Fix off-by-one error in KASSERT from 02f26e98c7. 2021-04-19 17:20:19 -07:00
Warner Losh
2763a0928a config: style for '\0' and NULL
Use NULL for pointers instead of '0' (though hey are the same thing in
these cases). Ditto for using the zero character '\0' instead of a naked
0 (ditto).

Reviewed by:		markj@
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D29847
2021-04-19 16:10:12 -06:00
Kevin Bowling
59690eab57 e1000: Add support for [Tiger, Alder, Meteor] Lake
Add support for current and future client platform PCI IDs. These are
all I219 variants and have no known driver changes versus previous
generation client platform I219 variants.

Reviewed by:	markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D29801
2021-04-19 14:32:59 -07:00
Alexander V. Chernikov
758c9d54d4 Improve error reporting in rtsock.c
MFC after:	3 days
2021-04-19 20:36:41 +00:00
Alexander V. Chernikov
37c0f4a207 Fix typo in rtsock_common.h
MFC after:	3 days
2021-04-19 20:24:46 +00:00
Kevin Bowling
4b38eed76d e1000: Correct promisc multicast filter handling
There are a number of issues in the e1000 multicast filter handling
that have been present for a long time. Take the updated approach from
ixgbe(4) which does not have the issues.

The issues are outlined in the PR, in particular this solves crossing
over and under the hardware's filter limit, not programming the
hardware filter when we are above its limit, disabling SBP (show bad
packets) when the tunable is enabled and exiting promiscuous mode, and
an off-by-one error in the em_copy_maddr function.

PR:		140647
Reported by:	jtl
Reviewed by:	markj
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D29789
2021-04-19 12:49:55 -07:00
Kevin Bowling
deecaa1445 ixgbe: Clean up unneeded set in ixgbe_if_multi_set
We don't need to set the bits here since the if/else if/else statements
fully cover setting these bit pairs.

Reported by:	markj
Reviewed by:	markj, erj
Approved by:	#intel_networking
MFC aftter:	1 week
Differential Revision:	https://reviews.freebsd.org/D29827
2021-04-19 12:37:30 -07:00
Ed Maste
407abff2b9 Cirrus-CI: use FreeBSD 13.0 image for base system CI build
We generally want to build and test on the highest release version, and
FreeBSD 13.0 also brings some performance benefits.

Reviewed by:	lwhsu
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D29842
2021-04-19 15:23:14 -04:00
Yuri Pankov
d3f0c032fb bsdinstall: restore time selection screen
Apparently new dialog does not like the height of 2 for the
timebox widget, use 0 (minimum size) instead.

Do the same for calendar widget as it does not change the
appearance and to prevent possible future surprises.

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D29720
2021-04-19 21:39:59 +03:00
Konstantin Belousov
fad437ba61 linuxkpi: reduce number of stray mm_struct allocations
Only allocate struct_mm after we checked that other threads do not carry
useful mm_struct.  If they don't, drop process lock, allocate, and recheck.

Note that for M_NOWAIT allocations we could avoid dropping process lock,
but I do not think that this increased complexity is useful.

Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies/NVidia Networking
MFC after:	1 week
2021-04-19 21:34:08 +03:00
Konstantin Belousov
165ba13fb8 linuxkpi: guarantee allocations of task and mm for interrupt threads
Create and use zones for task and mm.  Reserve items in zones based on the
estimation of the max number of interrupts in the system.  Use M_USE_RESERVE
to allow to take reserved items when allocation occurs from the interrupt
thread context.

Of course, this would only work first time we allocate the task for
interrupt thread. If interrupt is deallocated and allocated anew,
creating a new thread, it might be that zone is depleted. It still
should be good enough for practical uses.

Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies/NVidia Networking
MFC after:	1 week
2021-04-19 21:34:08 +03:00
Konstantin Belousov
4ce1f6162e linuxkpi: some style, wrap too long lines
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies/NVidia Networking
MFC after:	1 week
2021-04-19 21:34:07 +03:00
Konstantin Belousov
ecfbddf0cd sysctl vm.objects: report backing object and swap use
For anonymous objects, provide a handle kvo_me naming the object,
and report the handle of the backing object.  This allows userspace
to deconstruct the shadow chain.  Right now the handle is the address
of the object in KVA, but this is not guaranteed.

For the same anonymous objects, report the swap space used for actually
swapped out pages, in kvo_swapped field.  I do not believe that it is
useful to report full 64bit counter there, so only uint32_t value is
returned, clamped to the max.

For kinfo_vmentry, report anonymous object handle backing the entry,
so that the shadow chain for the specific mapping can be deconstructed.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D29771
2021-04-19 21:32:01 +03:00
Konstantin Belousov
4342ba184c sysctl_handle_string: do not malloc when SYSCTL_IN cannot fault
In particular, this avoids malloc(9) calls when from early tunable handling,
with no working malloc yet.

Reported and tested by:	mav
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-04-19 21:32:01 +03:00
Konstantin Belousov
578c26f31c linkat(2): check NIRES_EMPTYPATH on the first fd arg
Reported by:	arichardson
Reviewed by:	markj
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D29834
2021-04-19 21:32:01 +03:00
Jung-uk Kim
686cf5468c flex: Regen bootstrap files
This also partially reverts r326025 (8a16b7a18f).  I do not see any
point of adding SPDX tag in generated file.

MFC after:	3 days
Submitted by:	Dan McGregor <dan.mcgregor@usask.ca> (initial version)
Differential Revision:	https://reviews.freebsd.org/D28596
2021-04-19 14:20:51 -04:00
Mateusz Piotrowski
22b2ba4e22 Fix a typo in Gordon's login
It's gbe, not bge.

Fixes:	bffc3fb3c0 Add metor -> mentee information (docs)
2021-04-19 15:48:05 +02:00
Kristof Provost
e14d56f370 pf tests: Test set keepcounters
MFC after:	4 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D29781
2021-04-19 14:31:47 +02:00
Kristof Provost
42ec75f83a pf: Optionally attempt to preserve rule counter values across ruleset updates
Usually rule counters are reset to zero on every update of the ruleset.
With keepcounters set pf will attempt to find matching rules between old
and new rulesets and preserve the rule counters.

MFC after:	4 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D29780
2021-04-19 14:31:47 +02:00
Kristof Provost
8bb0f1b87b pf: Remove PFRULE_REFS from userspace
PFRULE_REFS should never be used by userspace, so hide it behind #ifdef
_KERNEL.

MFC after:	never
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D29779
2021-04-19 14:31:47 +02:00
Kristof Provost
4f1f67e888 pf: PFRULE_REFS should not be user-visible
Split the PFRULE_REFS flag from the rule_flag field. PFRULE_REFS is a
kernel-internal flag and should not be exposed to or read from
userspace.

MFC after:	4 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D29778
2021-04-19 14:31:47 +02:00
Kristof Provost
4ae3a97e12 bridge tests: Test STP config BPDU validation
PR:		254924
Reviewed by:	donner
Differential Revision:	https://reviews.freebsd.org/D29783
2021-04-19 12:09:35 +02:00
Jonah Caplan
0e4025bffa bridgestp: validate timer values in config BPDU
IEEE Std 802.1D-2004 Section 17.14 defines permitted ranges for timers.
Incoming BPDU messages should be checked against the permitted ranges.
The rest of 17.14 appears to be enforced already.

PR:		254924
Reviewed by:	kp, donner
Differential Revision:	https://reviews.freebsd.org/D29782
2021-04-19 12:09:18 +02:00
Edward Tomasz Napierala
156da725d3 linux(4): bump osrelease to 4.4.0.
This is required for the current Arch Linux binaries to work.

PR:		254112
Reviewed By:	emaste
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D29218
2021-04-19 11:37:58 +01:00
Alex Richardson
738314e445 Revert "lib/libc/net/nsdispatch.c: Fix missing unlock and add locking annotations"
This commit should not have introduced any functional changes, but
apparently it did. This appears to have broken LDAP setups.
Reverting for now. Will reland once I have fixed the breakage.

This reverts commit 5245bf7b92.
Reported By:	Александр Недоцуков, brd
MFC after:	immediately
2021-04-19 09:36:47 +01:00
Ka Ho Ng
6fe60f1d5c AMD-vi: Fortify IVHD device_identify process
- Use malloc(9) to allocate ivhd_hdrs list. The previous assumption
  that there are at most 10 IVHDs in a system is not true. A counter
  example would be a system with 4 IOMMUs, and each IOMMU is related
  to IVHDs type 10h, 11h and 40h in the ACPI IVRS table.
- Always scan through the whole ivhd_hdrs list to find IVHDs that has
  the same DeviceId but less prioritized IVHD type.

Sponsored by:	The FreeBSD Foundation
MFC with:	74ada297e8
Reviewed by:	grehan
Approved by:	lwhsu (mentor)
Differential Revision:	https://reviews.freebsd.org/D29525
2021-04-19 16:08:13 +08:00
Adrian Chadd
61c83c4e8b [ath] Add ath_hal_getnav and ath_hal_setnav so the driver layer
can check the NAV as appropriate.
2021-04-18 22:59:28 -07:00
Adrian Chadd
bed90bf8ed [ath_hal] Add get/set NAV functions
The NAV (network allocation vector) register reflects the current MAC
tracking of NAV - when it will stay quiet before transmitting.

Other devices transmit their frame durations in their 802.11 PHY headers
and all devices that hear a frame - even if it's one in an encoding
they don't understand - will understand the low bitrate PHY header that
includes the frame duration.  So, they'll set NAV to this value so
they'll stay quiet until the transmit completes.

Anyway, sometimes the PHY NAV header is garbled and sometimes, notably
older broadcom devices, will fake a long NAV so they can get "cleaner" air
for local calibration.  When this happens, the hardware will stay quiet
for quite some time and this can lead to missed/stuck beacons, or
(for Very Large Values) a MAC hang.

This code just adds the ability to get/set the NAV; the driver will
need to take care of using it during transmit hangs and beacon misses
to see if it's due to a trash looking NAV.
2021-04-18 22:52:31 -07:00
Adrian Chadd
dead34f822 [ath_hal] ar9300: save TSF across full chip reset
This saves the TSF across a a full reset.  The TSF is otherwise cleared
and subsequent beaconing stops until the TSF catches up to nexttbtt.
2021-04-18 22:49:54 -07:00
Xin LI
2235c7feac less: upgrade to v581.
MFC after:	2 weeks
2021-04-18 19:46:19 -07:00
Xin LI
1737d9dd58 Vendor import of less v581. 2021-04-18 18:15:19 -07:00
Mateusz Piotrowski
8d9fefe643 bhyve.8: Fix mandoc -Tlint issues
While here, keep network backends section consistent with other
sections.

MFC after:	2 weeks
2021-04-19 02:16:14 +02:00
Mateusz Piotrowski
061f37d280 bhyve: Document the format for HD audio backends
- This change is done for consistency with other backend definitions.

MFC after:	2 weeks
2021-04-19 02:16:14 +02:00
Mateusz Piotrowski
d5fcc4b606 bhyve.8: Improve AHCI backends documentation
- Document the backend format.

MFC after:	2 weeks
2021-04-19 02:16:13 +02:00
Mateusz Piotrowski
6eff58acc7 bhyve.8: Improve documentation of NVME backend
- Document the configuration format.
- Document two additional configuration options: eui64 and dsm.

MFC after:	2 weeks
2021-04-19 02:16:13 +02:00
Mateusz Piotrowski
8b97e97548 bhyve.8: Improve framebuffer backends description
- Use appropriate mdoc macros
- Document that tcp= is a synonym to rfb= (tcp is used in the examples,
  but never mentioned)
- Clarify the IP address specification

MFC after:	2 weeks
2021-04-19 02:16:13 +02:00
Mateusz Piotrowski
3f4c771f64 bhyve.8: Clean up virtio console device backends description
MFC after:	2 weeks
2021-04-19 02:16:13 +02:00
Mateusz Piotrowski
2fda01a1b7 bhyve.8: Clean up TTY, boot ROM, and pass-through descriptions
MFC after:	2 weeks
2021-04-19 02:16:12 +02:00
Mateusz Piotrowski
2d00b57022 bhyve.8: Clean up 9P device backends section
MFC after:	2 weeks
2021-04-19 02:16:12 +02:00
Mateusz Piotrowski
7c5829c942 bhyve.8: Clean up SCSI device backends section
MFC after:	2 weeks
2021-04-19 02:16:12 +02:00
Mateusz Piotrowski
5232a35f1e bhyve.8: Clean up block storage device backends description
MFC after:	2 weeks
2021-04-19 02:16:12 +02:00
Mateusz Piotrowski
7fb2272981 bhyve.8: Clean up network backends section
- Reformat the format lists, use appropriate mdoc macros for
  readability.
- Add a missing Oxford comma.

MFC after:	2 weeks
2021-04-18 23:33:24 +02:00
Mateusz Piotrowski
7014cb2393 bhyve.8: Improve emulation description of the -s flag
- Set width of the list to the longest key word for readability.
- Separate descriptions of amd_hostbridge and hostbridge emulations.
  Also, wordsmith their descriptions for consistency with other entries.
- Use Cm instead of Li for command modifiers.
- Do not stylize AMD with Li, there's no need to do it.
- Mention COM3 and COM4 in the definition of lpc.
- Fix a typo in the definition of ahci-hd ("hard drive" instead of
  "hard-drive").

MFC after:	2 weeks
2021-04-18 23:33:23 +02:00
Mateusz Piotrowski
234d8c470b bhyve.8: Clean up the slot description of -s
Also, remove the macros of the nested list which contained slot,
emulation and conf. This decreases the indention of the -s description.
It was necessary to clean up the slot description.

MFC after:	2 weeks
2021-04-18 23:33:23 +02:00
Mateusz Piotrowski
449f0e48e9 bhyve.8: Clean-up synopsis of -s
- Document "-s help" separately for readability.
- Use appropriate mdoc macros.

MFC after:	2 weeks
2021-04-18 23:33:23 +02:00
Richard Scheffenegger
b87cf2bc84 tcp: keep SACK scoreboard sorted when doing rescue retransmission
Reviewed By: tuexen, kbowling, #transport
MFC after: 3 days
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29825
2021-04-18 23:11:10 +02:00
Mateusz Piotrowski
3357e9482f bhyve.8: Fix indention in the signals table
MFC after:	2 weeks
2021-04-18 22:09:39 +02:00