arm64: Use the common activate function in nexus
For non-memory and non-ioport spaces use the common
bus_generic_rman_activate_resource function in the arm64 nexus. We
can't currently use it for memory types as it doesn't support
non-posted memory.
Reviewed by: jhb
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D47283
bus: Activate INTRNG interrupts in common code
We need to call into INTRNG to activate all interrupts on platforms that
use it. Currently, interrupts are only activated in the nexus drivers for
INTRNG platforms, but this does not handle other bus devices such as
gpiobus that manage their own IRQ space.
Reported by: cperciva
Reviewed by: cperciva, jhb
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D47282
ixv: Dynamically size the receive packet size
If MTU of the if_ixv VF driver is configured between 1501 and 2030, and
if a peer box have bigger MTU and sends a packet bigger than MTU into
this guest, kernel could crash.
Dynamically calculate the receive packet size on rx_mbuf_sz as ix(4)
does.
PR: 268092
Reported by: Kumara Babu <nkumarababu at gmail.com>
Sponsored by: BBOX.io
(cherry picked from commit cdbe3de5383706da0f6d3c29f1ec2dcfed366bf1)
ixv: Dynamically size the receive packet size
If MTU of the if_ixv VF driver is configured between 1501 and 2030, and
if a peer box have bigger MTU and sends a packet bigger than MTU into
this guest, kernel could crash.
Dynamically calculate the receive packet size on rx_mbuf_sz as ix(4)
does.
PR: 268092
Reported by: Kumara Babu <nkumarababu at gmail.com>
Sponsored by: BBOX.io
(cherry picked from commit cdbe3de5383706da0f6d3c29f1ec2dcfed366bf1)
ice: Update to 1.43.2-k
- Add extra time while waiting for an EMPR to finish on E830 and E825C
devices
- Fix debug mask sysctl help message
- Handle EAGAIN error messages from the Get Link Status AQ command by
retrying them several times
- Handle the condition where E830 extended temperature SKUs can have the
chip initialize without the PHY subsystem being ready due to very low
temperatures; the driver will print out a message when this happens
- Fix inability to set link speed using the advertise_speed sysctl when
link is down and the link_active_on_if_down sysctl is set to 0
- Fix issue where VLANs would not properly be set back up after a
hardware reset (e.g. PF reset) (Thanks jacob.e.keller at intel.com)
Signed-off-by: Eric Joyner <erj at FreeBSD.org>
Tested by: Jeffrey Pieper <jeffrey.e.pieper at intel.com>
MFC after: 2 days
[3 lines not shown]
ice: Update to 1.42.5-k
- Removes duplicate E825C printout
- Fixes a package download issue with E830
- Updates mentions of E830-XXV to E830-L
- Fix FW logging on load issue by limiting the setting of FW log masks
and other global configuration to just the first PF of the controller
- Update ice_hw_autogen.h with timesync registers (unused in this
driver)
- Fix possible overflow condition in NVM access function
- Blocks RDMA load on E830 devices
Signed-off-by: Eric Joyner <erj at FreeBSD.org>
Tested by: Jeffrey Pieper <jeffrey.e.pieper at intel.com>
MFC after: 2 days
Relnotes: yes
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D46950
ice: Update to 1.42.1-k
Summary:
- Adds E830 device support
- Adds pre-release E825C support (for the Ethernet device included in
an upcoming Xeon D platform)
- Add sysctl for E810 devices to print out PHY debug statistics (mostly
for FEC debugging)
- Adds per-TX-queue tso counter sysctl to count how many times a TSO offload
was requested for a packet, matching other Intel drivers
- Various bug fixes
Signed-off-by: Eric Joyner <erj at FreeBSD.org>
Tested by: Jeffrey Pieper <jeffrey.e.pieper at intel.com>
MFC after: 2 days
Relnotes: yes
Sponsored by: Intel Corporation
Differential Revisison: https://reviews.freebsd.org/D46949
cxgb(4): Register ifmedia callbacks before ether_ifattach.
This prevents a panic that occurs if netlink tries to invoke the
driver's media callbacks during ifattach.
PR: 282374
Reported by: ScottD <biscuits.carry.0j at icloud.com>
MFC after: 3 days
acpi_ged: Handle events directly
Handle ged interrupts directly from the interrupt handler,
while the interrupt source is masked, so as to conform
with the acpi spec, and avoid spurious interrupts and
lockups on boot.
When an acpi ged interrupt is encountered, the spec requires
the os (as stated in 5.6.4: General Purpose Event Handling)
to leave the interrupt source masked until it runs the
EOI handler. This is not a good fit for our method of
queuing the work (including the EOI ack of the interrupt),
via the AcpiOsExecute() taskqueue mechanism.
Note this fixes a bug where an arm64 server could lock up if
it encountered a ged interrupt at boot. The lockup was
due to running on a single core (due to arm64 not using
EARLY_AP_STARTUP), and due to that core encountering a
new interrupt each time the interrupt handler unmasked
[27 lines not shown]
ice_ddp: Update to 1.3.41.0
Primarily adds support for E830 devices, unlocking all of their
functionality.
As well, update the README and remove the non-FreeBSD sections
from it.
Signed-off-by: Eric Joyner <erj at FreeBSD.org>
MFC after: 2 days
Sponsored by: Intel Corporation
camcontrol: Bump timeout to get size of drive
When the system is very busy, and the ATA hard disk drives are
overloaded due to reading dodgy sectors, it can take several seconds to
drain the NCQ set of commands to send this command to the drive. Up the
timeout from 5s to 10s out of an abundance of caution, but also to allow
monitioring software that uses camcontrol identify to not fail
needlessly.
Sponsored by: Netflix
pctrie: reduce code duplication in PCTRIE_INSERT_*
The four flavors of PCTRIE_INSERT inline functions share a few lines
of code. Extract that code into a new function and invoke it from the
others to reduce code duplication. No behavior change expected.
Reviewed by: bnovkov
Differential Revision: https://reviews.freebsd.org/D47288
rc: Remove rc_fast_and_loose
The rc_fast_and_loose variable allowed rc(8) to start services
by sourcing them into rc's own shell environment. Normally, each rc
service script is started by being sourced into its own subshell
instead. The feature was meant to speed up rc(8) by avoiding the extra
forking necessary to spawn subshells.
In practice, the feature has been broken for a long time now. One of the
reasons is that some rc service scripts call the exit builtin to return
non-zero error codes, which not only terminates the service subshell
but also rc(8) when rc_fast_and_loose is enabled. For example,
a system running any of the supported FreeBSD releases
with rc_fast_and_loose=yes would abort rc(8) as early as rc.d/hostid,
due to an "exit 0".
Fixing rc_fast_and_loose support would require rewriting some rc scripts
to support being sourced directly into rc(8) process. This would muddy
the code base and also would prove difficult to maintain long term
[13 lines not shown]
stand: Ugly hack due to default change
So this is a gross hack to fix the 'noclean' build since we changed to
text-only loader. We have to fix it in a better way, but for the moment,
this will fix non-meta no-clean builds. A better hack is to fix this so
we build either vidconsole.c or textvidc.c, but some minor refactoring
and variable renaming is needed.
Fixes: 23dee252daf2
Sponsored by: Netflix
mac_do(4): Enhance GID rule validation to check all groups in cr_groups
Previously, the rule validation only checked the primary GID (cr_gid).
This caused issues when applying GID-based rules, as users with matching
secondary groups were not considered valid. This patch modifies both
functions to iterate through all groups in cr_groups to ensure all group
memberships are considered when validating GID-based rules.
For example, a user's primary group is staff (20) and they are also in
the wheel (0) group, this change allows the rule gid=0:any to enable
them to run commands as any user.
Reviewed by: delphij (earlier version), bapt
Differential Revision: https://reviews.freebsd.org/D47304
Tentatively merge llvm fix for buildworld WITH_ASAN
Building world using WITH_ASAN results in an assertion when compiling
certain source files referencing ifuncs:
Assertion failed: (isa<Function>(Callee) || isa<GlobalAlias>(Callee)), function analyzeAllUses, file /root/freebsd/contrib/llvm-project/llvm/lib/Analysis/StackSafetyAnalysis.cpp, line 514.
This was already reported upstream a while ago, in
<https://github.com/llvm/llvm-project/issues/87923>, but now there is
finally a candidate fix, which seems trivial so I am importing it right
away.
Reported by: markj
PR: 280936
Pull Request: https://github.com/llvm/llvm-project/pull/113841
MFC after: 3 days
Fix gcc unused value warnings in FreeBSD zfs_prop.c
With gcc we are seeing the following -Werror warnings:
/workspace/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd.h:53:33: error: statement with no effect [-Werror=unused-value]
53 | #define simd_stat_init() 0
| ^
/workspace/src/sys/contrib/openzfs/module/zcommon/zfs_prop.c:1092:9: note: in expansion of macro 'simd_stat_init'
1092 | simd_stat_init();
| ^~~~~~~~~~~~~~
/workspace/src/sys/contrib/openzfs/module/zcommon/zfs_prop.c: In function 'zcommon_fini':
/workspace/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd.h:54:33: error: statement with no effect [-Werror=unused-value]
54 | #define simd_stat_fini() 0
| ^
/workspace/src/sys/contrib/openzfs/module/zcommon/zfs_prop.c:1100:9: note: in expansion of macro 'simd_stat_fini'
1100 | simd_stat_fini();
| ^~~~~~~~~~~~~~
Both `simd_stat_init()` and `simd_stat_fini()` are defined in the
[12 lines not shown]
cdefs: Use __has_feature to gate the definition of __nosanitize*
clang 12 does not implement the coverage sanitizer, and the build fails
when __attribute__((no_sanitize("coverage"))) is used.
Try to work around the problem by giving __nosanitize* a non-trivial
definition only when the corresponding sanitizer is actually enabled in
the build.
Tested by reading disassembly of pmap_update_strided() and pmap_enter()
in a kernel compiled with "options COVERAGE", and similar sanity checks
for the other sanitizers. I also test-booted KASAN and KMSAN kernels in
amd64 bhyve.
Suggested by: jrtc27
Reviewed by: imp
Fixes: a78bacf3b0ec ("cdefs: Add __nosanitizecoverage")
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D47193
[2 lines not shown]
netmap: Make memory pools NUMA-aware
Each netmap adapter associated with a physical adapter is attached to a
netmap memory pool. contigmalloc() is used to allocate physically
contiguous memory for the pool, but ideally we would ensure that all
such memory is allocated from the NUMA domain local to the adapter.
Augment netmap's memory pools with a NUMA domain ID, similar to how
IOMMU groups are handled in the Linux port. That is, when attaching to
a physical adapter, ensure that the associated memory pools are local to
the adapter's associated memory domain, creating new pools as needed.
Some types of ifnets do not have any defined NUMA affinity; in this case
the domain ID in question is the sentinel value -1.
Add a sysctl, dev.netmap.port_numa_affinity, which can be used to enable
the new behaviour. Keep it disabled by now to avoid surprises in case
netmap applications are relying on zero-copy optimizations to forward
packets between ports belonging to different NUMA domains.
[7 lines not shown]
makefs: Record a larger TXG number in the uberblock
By default, OpenZFS will perform metadata verification of the most
recent TXGs, but this can be very slow since all data in a pool
generated by makefs was logically written in a single transaction.
Avoid triggering this verification by default, but add an option to
restore the previous behaviour and enable it in regression test cases.
Reported by: cperciva
Tested by: cperciva (previous version)
MFC after: 2 weeks
(cherry picked from commit 4e15366c6a6907bcd0e2c28885ba5878ed4280d2)
alc(4): disable MSI-X by default on Killer cards
Several users with alc(4)-based "Killer" Ethernet cards have reported
issues with this driver not passing traffic, which are solved by
disabling MSI-X using the provided tunable.
To work around this issue, disable MSI-X by default on this card.
This is done by having msix_disable default to 2, which means
"auto-detect". The user can still override this to either 0 or 1 as
desired.
Since these are slow (1Gbps) Ethernet ICs used in low-end systems, it's
unlikely this will cause any practical performance issues; on the other
hand, the card not working by default likely causes issues for many new
FreeBSD users who find their network port doesn't work and have no idea
why.
PR: 230807
[6 lines not shown]
flua: lposix: add fnmatch function
The fnmatch function matches a string against a shell-style filename
pattern. It is a complex function and cannot easily be implenented
using regular expressions. Adding fnmatch to flua increases the amd64
binary by less than 1 KB.
Approved by: markj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D46849
manuals: Misc syntax fixes
These were reported by `mandoc -T lint ...` as errors.
Signed-off-by: Graham Percival <gperciva at tarsnap.com>
Reviewed by: mhorne, Alexander Ziaee <concussious.bugzilla at runbox.com>
Sponsored by: Tarsnap Backup Inc.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1472
manuals: Fix dates
These were reported by `mandoc -T lint ...` as warnings.
Signed-off-by: Graham Percival <gperciva at tarsnap.com>
Reviewed by: mhorne
MFC after: 3 days
Sponsored by: Tarsnap Backup Inc.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1475