linuxkpi: Move `struct kobject` code to `linux_kobject.c`
[Why]
`linux_compat.c` is already too long. I will need to add `struct kset`
in a follow-up commit, so let's move the existing `struct kobject` code
to its own file.
Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D43019
linuxkpi: Move `invalidate_mapping_pages()` to <linux/pagemap.h>
[Why]
This is consistent with Linux.
[How]
The definition is moved from <linux/shmem_fs.h> to <linux/pagemap.h> and
the latter is included from the former. This is how it is done on Linux.
Prototypes are also expanded with argument names. I got a build failure
in the DRM 5.18 drivers because the compiler considered that the
`pgoff_t` argument was there twice.
Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D43018
Jessica Clarke [Wed, 13 Dec 2023 18:02:45 +0000 (18:02 +0000)]
Makefile.inc1: Reinstate building sbin/md5 for BOOTSTRAP_ALL_TOOLS
The sha256 and sha512 binaries are used when building release images.
Bootstrapping them used to be gated on MK_BOOT, which wasn't quite right
but in practice worked, at least in our use cases downstream. Add back
bootstrapping sbin/md5 and its aliases for this purpose to fix building
release images on Linux and macOS.
Fixes: f213da893ca8 ("Makefile.inc1: Remove beri straggler")
Kyle Evans [Wed, 13 Dec 2023 16:52:14 +0000 (10:52 -0600)]
loader: lua: remove the default kernel if it doesn't exist
The `kernel` env var provides the default kernel, usually "kernel". It
may be the case that the user doesn't have a "kernel" kernel, just
"kernel.*" kernels, but have left `kernel` to the default because we
autodetect entries by default anyways.
If we're doing autodetection, take note of whether the default kernel
exists or not and remove it from the list if it doesn't and we had found
any other kernels. We avoid it in the #kernels == 1 case because
something fishy has likely happened and we should just trust the
configuration.
Reviewed by: imp, manu
Differential Revision: https://reviews.freebsd.org/D42967
Kyle Evans [Wed, 13 Dec 2023 16:49:03 +0000 (10:49 -0600)]
kdump: use print_mask_arg0 appropriately
Some callers are using print_mask_arg() when they should be using
print_mask_arg0(); the latter should be used when all flags are optional
and there's not a flag to be decoded with a 0-mask. This turns:
Michal Gulbicki [Mon, 20 Nov 2023 15:25:57 +0000 (16:25 +0100)]
qat: Update firmware for 4xxx devices to version 1.1.20
Key features:
- added zeropadding feature for compression
- added partial decompression support
- added DC rate limiting support
- added Admin ME capabilities reporting
- added Hash+Compress chaining support
John Baldwin [Tue, 12 Dec 2023 23:43:00 +0000 (15:43 -0800)]
kldxref: Make use of libelf to be a portable cross tool
This allows kldxref to operate on kernel objects from any
architecture, not just the native architecture. In particular, this
will permit generating linker.hints files as part of a cross-arch
release build.
- elf.c is a new file that includes various wrappers around libelf
including routines to read ELF data structures such as program and
section headers and ELF relocations into the "generic" forms
described in <gelf.h>. This file also provides routines for
converting a linker set into an array of addresses (GElf_Addr)
as well as reading architecture-specific mod_* structures and
converting them into "generic" Gmod_* forms where pointers are
replaced with addresses.
- The various architecture-specific reloc handlers now use GElf_*
types for most values (including GElf_Rel and GElf_Rela for
relocation structures) and use routines from <sys/endian.h> to read
and write target values. A new linker set matches reloc handlers
to specific ELF (class, encoding, machine) tuples.
- The bits of kldxref.c that write out linker.hints now use the
encoding (ELFDATA2[LM]SB) of the first file encountered in a
directory to set the endianness of the output file. Input files
with a different architecture in the same directory are skipped with
a warning. In addition, the initial version record for the file
must be deferred until the first record is finished since the
architecture of the output file is not known until then.
- Various places that used 'sizeof(void *)' throughout now use
'elf_pointer_size()' to determine the size of a pointer in the
target architecture.
Tested by: amd64 binary on both amd64 and i386 /boot/kernel
Reviewed by: imp
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D42966
John Baldwin [Tue, 12 Dec 2023 23:30:16 +0000 (15:30 -0800)]
kldxref: Refactor PNP entry parsing, no functional change
- Add a free_pnp_list to complement parse_pnp_list. Add freeing
of 'new_desc' which was previously leaked.
- Move body of loop that checked a single pnp list element against a
table entry into a parse_pnp_entry function to reduce indentation
and split parse_entry into a smaller function.
- Similarly, split out a record_pnp_info function from parse_entry
which builds the pnp_list and walks a table.
John Baldwin [Tue, 12 Dec 2023 23:30:00 +0000 (15:30 -0800)]
Stop #defining FREEBSD_ELF
This was originally used (along with FREEBSD_AOUT) to prefer the use
of ELF in various tools instead of a.out as part of the a.out to ELF
transition in the 3.x days. The last use of it was removed from
<link.h> in commit 66422f5b7a1a6055f0b2358268eb902aab6e2e3e back in
2002, but various files still #define it.
Igor Ostapenko [Tue, 12 Dec 2023 18:26:21 +0000 (19:26 +0100)]
netlink: fix snl_writer and linear_buffer re-allocation logic
- Use the correct base pointer after re-allocation to avoid buffer
overflows.
- Maintain correct snl_writer.size, which avoids redundant memory
allocation, e.g. a need for ~1k bytes may end up with ~32k
linear_buffer actually allocated.
This fixes a pfctl regression at least for armv7 after the addrule logic
migration to netlink: ffbf25951e7b ("pf: convert rule addition to netlink")
The add rule command creates a bigger than default size netlink requests
which triggers the re-allocation logic.
ocs_fc: IO timeout handling and error reporting fix.
Hardware timeout uses a 8-bit timeout value and expects the timeout to
be less than 255 seconds. Added software timer implemetation to timeout
and abort the IOs with timeout more than 255 seconds.
Fix the timeout problem by dividing CAM timeouts by 1000 as hardware
expects timeout value in seconds. Before this change, CAM timeouts in
milliseconds were getting truncated to 8 bits and converted to seconds.
So the actual timeout used when going down to the card would depend on
the bottom 8 bits of the timeout used.
Add the mapping of ocs_fc error status to CAM status.
Reported by: ken
Reviewed by: ken
Tested by: ken, ram
Approved by: ken
MFC after: 1 week
Alex Richardson [Tue, 12 Dec 2023 05:10:14 +0000 (21:10 -0800)]
jevents: fix bootstrapping on Linux with Clang 16
The glibc fts_open() callback type does not have the second const
qualifier and it appears that Clang 16 errors by default for mismatched
function pointer types. Add an ifdef to handle this case.
Alex Richardson [Tue, 12 Dec 2023 05:08:38 +0000 (21:08 -0800)]
mandoc: fix bootstrapping on Linux with Clang 16
It appears that Clang 16 errors by default for the mismatched function
pointer types that are triggered by the fts callback (since glibc has a
callback type without the second const qualifier).
Fortunately, there is already code to handle glibc inside mandoc, we
just have to edit the checked-in config.h.
Warner Losh [Tue, 12 Dec 2023 05:08:55 +0000 (22:08 -0700)]
cam.4: Modernize examples
Use mpr1 instead of ahd1 and ahci1 instead of ahc1. ahc and ahd haven't
been relevant for a while. Also update the transfer size HBAs can do
from from 64k to 1MB.
Mark Johnston [Mon, 11 Dec 2023 14:19:09 +0000 (09:19 -0500)]
tty: Avoid a kernel memory discloure via kern.ttys
Four pad bytes at the end of each xtty structure were not being cleared
before being copied out. Fix this by clearing the whole structure
before populating fields.
Mark Johnston [Mon, 11 Dec 2023 14:08:49 +0000 (09:08 -0500)]
arm: Disable the VFP during boot
The VFP code expects the kernel to boot with VFP disabled, but some
boards will boot with it enabled. Make sure that vfp_init() disables
the VFP on each CPU during boot.
PR: 273752
Reviewed by: andrew
Diagnosed by: Thomas Skibo <thomas-bsd@skibo.net>
MFC after: 1 week
Mark Johnston [Mon, 11 Dec 2023 14:08:34 +0000 (09:08 -0500)]
arm: Handle VFP exceptions from the kernel
vfp_bounce() is called when handling an undefined instruction exception,
to see if we need to enable the VFP. Previously it would
unconditionally panic if the exception came from the kernel, which was
simply wrong, and it did not permit lazy initialization of VFP state in
the kernel. However, this functionality can be useful and is supported
by arm's fpu_kern_enter() implementation. Thus, relax assertions and
consume the exception if the thread was in an FPU section.
Based on a patch from Stormshield.
Reviewed by: andrew
MFC after: 2 weeks
Sponsored by: Klara, Inc.
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D42971
Mark Johnston [Mon, 11 Dec 2023 14:07:55 +0000 (09:07 -0500)]
arm: Add fpu_kern_alloc_ctx()
This enables the use of some out-of-tree crypto libraries on arm.
No functional change intended, there are no callers of this function in
the tree currently.
Reviewed by: andrew
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D42969
Mariusz Zaborski [Mon, 11 Dec 2023 11:09:31 +0000 (12:09 +0100)]
capsicum: introduce cap_rights_is_empty Function
Before this commit, we only had the capability to check if a specific
capability was set (using cap_rights_is_set function). However, there
was no efficient method to determine if a cap_rights_t structure doesn't
contain any capability. The cap_rights_is_empty function addresses
this gap.
Mark Johnston [Sat, 9 Dec 2023 15:22:06 +0000 (10:22 -0500)]
kthread: Set *newtdp earlier in kthread_add1()
syzbot reported a single boot-time crash in g_event_procbody(), a page
fault when dereferencing g_event_td. g_event_td is initialized by the
kproc_kthread_add() call which creates the GEOM event thread:
I believe that the caller of kproc_kthread_add() was preempted after
adding the new thread to the scheduler, and before setting *newtdp,
which is equal to g_event_td. Thus, since the first action of the GEOM
event thread is to lock itself, it ended up dereferencing a NULL
pointer.
Fix the problem simply by initializing *newtdp earlier. I see no harm
in that, and it matches kproc_create1(). The scheduler provides
sufficient synchronization to ensure that the store is visible to the
new thread, wherever it happens to run.
Ed Maste [Sat, 9 Dec 2023 00:59:58 +0000 (19:59 -0500)]
pkgbase: pass --recurse-submodules to `git ls-files`
When generating source packages. Although submodules are not used by
FreeBSD itself they may be used by downstream projects. By default
for submodules `git ls-files` just emits the submodule directory name,
which resulted in:
pkg: pkg_checksum_hash_sha256_file(read failed): Is a directory
Passing --recurse-submodules lists all of the files in each submodule
(which is desired when submodules are in use), and has no effect when
submodules are not present.
Reviewed by: bapt, manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42983
Michael Tuexen [Sat, 9 Dec 2023 11:57:19 +0000 (12:57 +0100)]
tcp: tcp: allow SOL_SOCKET-level socket options via sysctl interface
When using the sysctl interface for setting a SOL_SOCKET-level socket
option, the TCP handler refers to the IP handler, which only handles
SO_SETFIB and SO_MAX_PACING_RATE.
So call sosetopt(), which handles all SOL_SOCKET-level options.
Then you can use tcpsso with SOL_SOCKET-level socket options as
expected.
Emmanuel Vadot [Mon, 27 Nov 2023 14:35:32 +0000 (15:35 +0100)]
pkgbase: Move tr(1) to runtime
Since f7d16a627efa ("certctl: Convert line endings before inspecting files.")
certctl is using tr(1). Add it to FreeBSD-runtime so we can have certctl working
without having the bloated FreeBSD-utilities.
Jose Luis Duran [Fri, 1 Dec 2023 06:50:24 +0000 (06:50 +0000)]
strfmon.3: Cleanup example code
- xlocale.h would have been required if using strfmon_l(). Here,
setlocale() just requires locale.h.
- ANSIfy function declaration.
- Add a final return().
Kyle Evans [Fri, 8 Dec 2023 21:36:06 +0000 (15:36 -0600)]
loader: lua: assume late ACPI detection if the feature isn't enabled
While we're here, enable the feature in the places we detect ACPI. This
lets us side-step the existing issues and provide a path forward for
folks upgrading from previous releases that haven't updated their ESP
yet.
Let's also fix core.setACPI: the hint already indicates that the
user's disabled it more consistently than loader.acpi_disabled_by_user.
Even more, the latter is wrong because we set it by default if we did
not detect ACPI. The ACPI hint remains even when we're setting defaults
because ACPI loaded into the kernel will make some noise if it's not
hinted off, even when we didn't detect it.
imp notes that this will result in some relatively harmless noise on
platforms that don't support ACPI but aren't using the UEFI loader, as
we would enable the ACPI module for loading on them and then loader
would not be able to find it. These are non-fatal, but should probably
be fixed by just declaring support for EARLY_ACPI in those loaders since
we know they won't have ACPI early on -- punting on this for the time
being, though, in favor of providing a safer upgrade path sooner.
Kyle Evans [Fri, 8 Dec 2023 21:36:06 +0000 (15:36 -0600)]
loader: provide a features table for binary compatibility advertisement
liblua now provides a loader.has_feature() function to probe the loader
binary for features advertised. name => desc mappings are provided in
loader.features to get a list of all of the features loader *can*
support. core.hasFeature is provided as a shim to loader.has_feature
so that individual consumers don't need to think about the logic of the
loader module not providing has_feature; we know that means the feature
isn't enabled.
The first consumer of this will be EARLY_ACPI to advertise that the
loader binary probes for ACPI presence before the interpreter has
started, so that we know whether we can trust the presence of acpi.rsdp
as relatively authoritative. In general, it's intended to be used to
avoid breaking new scripts on older loaders within reason.
This will be used in lua as `core.hasFeature("EARLY_ACPI")`, while the
C bits of loader will `feature_enable(FEATURE_EARLY_ACPI)`.
Dimitry Andric [Thu, 7 Dec 2023 12:47:54 +0000 (13:47 +0100)]
Merge commit 158f4f30adb4 from llvm git (by Corentin Jabot):
[Clang] Do not change the type of captured vars when checking lambda constraints
When checking the constraint of a lambda, we need to respect the constness
of the call operator when establishing the type of capture variables.
In D124351, this was done by adding const to the captured variable...
However, that would change the type of the variable outside of the scope
of the lambda, which is clearly not the desired outcome.
Instead, to ensure const-correctness, we need to populate
a LambdaScopeInfo with the capture variables before checking the
constraints of a generic lambda.
There is no changelog as I'd like to tentatively propose we backport
this change to RC3 as it is a regression introduced in the Clang 17
cycle.
Merge commit 3ed9e9e3ace6 from llvm git (by Corentin Jabot):
[Clang] Add captures to the instantiation scope of lambda call operators
Like concepts checking, a trailing return type of a lambda
in a dependent context may refer to captures in which case
they may need to be rebuilt, so the map of local decl
should include captures.
This patch reveal a pre-existing issue.
`this` is always recomputed by TreeTransform.
`*this` (like all captures) only become `const`
after the parameter list.
However, if try to recompute the value of `this` (in a parameter)
during template instantiation while determining the type of the call operator,
we will determine it to be const (unless the lambda is mutable).
There is no good way to know at that point that we are in a parameter
or not, the easiest/best solution is to transform the type of this.
Note that doing so break a handful of HLSL tests.
So this is a prototype at this point.
This fixes 'Assertion failed: (isa<LabelDecl>(D) && "declaration not
instantiated in this scope"), function findInstantiationOf' error when
building databases/mongodb44.
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-17-init-19304-gd0b54bb50e51, the
last commit before the upstream release/17.x branch was created.
Alan Somers [Tue, 5 Dec 2023 23:24:28 +0000 (16:24 -0700)]
libcasper: document that most libcasper functions are not thread-safe
And neither are most libcasper services' functions, because internally
they all use cap_xfer_nvlist. cap_xfer_nvlist sends and then receives
data over a unix domain socket and associated with the cap_channel_t
argument. So absent synchronization, two threads may not use the same
cap_channel_t argument or they risk receiving the other's reply.
Martin Matuska [Fri, 8 Dec 2023 08:32:30 +0000 (09:32 +0100)]
Notable upstream pull request merges:
#15539 687e4d7f9 Extend import_progress kstat with a notes field
#15544 c7b611926 Allow block cloning across encrypted datasets
#15553 adcea23cb ZIO: Add overflow checks for linear buffers
#15593 5f2700eee zpool: flush output before sleeping
#15609 3e4bef52b Only provide execvpe(3) when needed
#15610 735ba3a7b Use uint64_t instead of u_int64_t
#15612 bcd83ccd2 ZIL: Remove TX_CLONE_RANGE replay for ZVOLs
#15617 55b764e06 ZIL: Do not clone blocks from the future
#15623 727497ccd module/icp/asm-arm/sha2: enable non-SIMD asm kernels
on armv5/6
#15625 9743d0963 BRT: Limit brt_vdev_dump() to only one vdev
#15629 f9765b182 zdb: Dump encrypted write and clone ZIL records
#15634 2aa3a482a ZIL: Remove 128K into 2x68K LWB split optimization
#15639 11656234b FreeBSD: Ensure that zfs_getattr() initializes the
va_rdev field
#15647 4836d293c zfs_refcount_remove: explictly ignore returns
#15649 f0cb6482e setproctitle: fix ununitialised variable
#15650 450f2d0b0 import: ignore return on hostid lookups
Bojan Novković [Thu, 7 Dec 2023 23:08:58 +0000 (15:08 -0800)]
vmm: implement VM_CAP_MASK_HWINTR on AMD CPUs
This patch implements the interrupt blocking VM capability on AMD
CPUs. Implementing this capability allows the GDB stub to single-step
a virtual machine without landing inside interrupt handlers.
Bojan Novković [Thu, 7 Dec 2023 23:00:31 +0000 (15:00 -0800)]
vmm: implement single-stepping for AMD CPUs
This patch implements single-stepping for AMD CPUs using the RFLAGS.TF
single-stepping mechanism. The GDB stub requests single-stepping
using the VM_CAP_RFLAGS_TF capability. Setting this capability will
set the RFLAGS.TF bit on the selected vCPU, activate DB exception
intercepts, and activate POPF/PUSH instruction intercepts. The
resulting DB exception is then caught by the IDT_DB vmexit handler and
bounced to userland where it is processed by the GDB stub. This patch
also makes sure that the value of the TF bit is correctly updated and
that it is not erroneously propagated into memory. Stepping over PUSHF
will cause the vm_handle_db function to correct the pushed RFLAGS
value and stepping over POPF will update the shadowed TF bit copy.
Bojan Novković [Thu, 7 Dec 2023 22:46:31 +0000 (14:46 -0800)]
vmm: enable software breakpoints for AMD CPUs
This patch adds support for software breakpoint vmexits on AMD SVM.
It implements the VM_CAP_BPT_EXIT used to enable software breakpoints.
When enabled, breakpoint vmexits are passed to userspace where they
are handled by the GDB stub.
Gleb Smirnoff [Thu, 7 Dec 2023 22:41:43 +0000 (14:41 -0800)]
tcp_hpts: let tcp_hpts_init() set a random CPU only once
After d2ef52ef3dee the tcp_hpts_init() function can be called multiple
times on a tcpcb if it is switched there and back between two TCP stacks.
First, this makes existing assertion in tcp_hpts_init() incorrect. Second,
it creates possibility to change a randomly set t_hpts_cpu to a different
random value, while a tcpcb is already in the HPTS wheel, triggering other
assertions later in tcp_hptsi().
The best approach here would be to work on the stacks to really clear a
tcpcb out of HPTS wheel in tfb_tcp_fb_fini, draining the IHPTS_MOVING
state. But that's pretty intrusive change, so let's just get back to the
old logic (pre d2ef52ef3dee) where t_hpts_cpu was set to a random value
only once in a CPU lifetime and a newly switched stack inherits t_hpts_cpu
from the previous stack.
This change seems to break some drivers such as the mlx5*(4) drivers.
As kib@ says:
> According to the 'official' Linux kernel documentation, the GFP_KERNEL
> flag implies sleepable context.
It was introduced while working on the new vt(4)/DRM integration [1].
During this work, doing sleepable allocations broke vt(4) and the DRM
drivers. However, I made further improvements and some locking-related
fixed to the new integration without revisiting the need for it.
After more testing, the improvements to the integration mentionned above
seems to make the change to `GFP_KERNEL` unneeded now. I can thus
revert it to restore expectations of other drivers.
Warner Losh [Thu, 7 Dec 2023 20:27:27 +0000 (13:27 -0700)]
build: use bare (and portable) echo instead of echo -n
There's no need to use echo -n here. A single echo will do nicely.
This fixes the post-buildworld output on a macos build, where echo -n
is implemented like System V instead of BSD (so you get two lines
first one starting with -n).
Warner Losh [Thu, 7 Dec 2023 20:27:07 +0000 (13:27 -0700)]
sort: Only build FreeBSD-specific ALTMON_x stuff when ATLMON_1 is defined
On MacOS, we bootstrap sort. Since ALTMON_* are not defined there, the
build blows up. Since we don't need this feature for the FreeBSD build
process, and since we won't use it unless we actually install the NL
files that have this data in it, just #ifdef it out for now. In the
extremely unlikely event that the FreeBSD bootstrap/build process grows
this dependency, we can evaluate the best solution then (which most
likely is going to be not depend on the local's month names).
Warner Losh [Thu, 7 Dec 2023 19:32:30 +0000 (12:32 -0700)]
cp: Don't warn for chflags() failing with EOPNOTSUPP if flags == 0
From NetBSD's utils.c 1.5 importing importing BSDI change, with light
formatting changes:
Author: cgd <cgd@NetBSD.org>
Date: Wed Feb 26 14:40:51 1997 +0000
Patch from BSDI (via Keith Bostic):
>NFS doesn't support chflags; ignore errors unless there's reason
>to believe we're losing bits. (Note, this still won't be right
>if the server supports flags and we were trying to *remove* flags
>on a file that we copied, i.e., that we didn't create.)
Warner Losh [Thu, 7 Dec 2023 19:32:27 +0000 (12:32 -0700)]
cp: Add -N flag, inspired by NetBSD's similar flag
Add -N to supress copying of file flags when -p is specified (explicitly
or implicitly). Often times we don't care about the flags or wish to be
able to copy to NFS, and this comes in handy for that. FreeBSD's and
NetBSD's cp are somewhat different, so I had to reimplement all but one
of the patch hunks...
Ronald Klop [Thu, 7 Dec 2023 16:46:58 +0000 (17:46 +0100)]
if_smsc: fix build on armv6 & armv7
compile error was:
/usr/src/sys/dev/usb/net/if_smsc.c:1597:40: error: format specifies type 'unsigned long' but the argument has type 'ssize_t' (aka 'int') [-Werror,-Wformat]
"failed alloc for bootargs (%lu)", len);
~~~ ^~~
%zd
Mark Johnston [Thu, 7 Dec 2023 16:20:11 +0000 (11:20 -0500)]
FreeBSD: Ensure that zfs_getattr() initializes the va_rdev field
Otherwise the field is left uninitialized, leading to a possible kernel
memory disclosure to userspace or to the network. Use the same
initialization value we use in zfsctl_common_getattr().
Reported-by: KMSAN Sponsored-by: The FreeBSD Foundation Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ed Maste <emaste@FreeBSD.org> Signed-off-by: Mark Johnston <markj@FreeBSD.org>
Closes #15639
Don't let PRR pass up on the opportunity of clocking
out packets on arrival of ACKs - by pulling sends
forward by about half a packet. Prevents unexpectedly
long runs of incoming ACKs without eliciting a
packet transmission.
Refactoring to perform the batch processing of
log messaged in two phases. First cycling through a limited
number of collected packets, and only thereafter freeing
the processed packets. This prevents any chance of calling
free while in a critical / spinlocked section.
Reviewed By: tuexen
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D42949
Ronald Klop [Sat, 4 Nov 2023 14:14:00 +0000 (15:14 +0100)]
Teach if_smsc to get MAC from bootargs.
Some Raspberry Pi pass smsc95xx.macaddr=XX:XX:XX:XX:XX:XX as bootargs.
Use this if no ethernet address is found in an EEPROM.
As last resort fall back to ether_gen_addr() instead of random MAC.
PR: 274092
Reported by: Patrick M. Hausen (via ML)
Reviewed by: imp, karels, zlei
Tested by: Patrick M. Hausen
Approved by: karels
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D42463