For now we are using mixed names to access struct ifreq members, some
of Linux (ifr_name, ifr_ifindex), others of FreeBSD. To avoid conflicts
switch to use FreeBSD names.
Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D38792
Enter the net epoch when traversing a list of interfaces. For that
split the ifname_linux_to_bsd() function on two counterparts, where
the ifname_linux_to_ifp() intended to use in epoch, while the
ifname_linux_to_bsd() intended to be a self-contained.
Until the linux_ioctl_coket() function is refactored, the
ifname_linux_to_bsd() temporarily returns interface outside
of the net epoch.
Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D38790
Migrate linux and linprocfs to use the IfAPI interfaces instead of
direct ifnet accesses.
The code initially writed by jhibbits@, and adapted by me to 3ab3c9c2.
Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D38735
If there is no source filter entry => block if that's SSM ("exclude"
mode per RFC 3678 clause 3). If there is an entry => check its action &
block if the action is "exclude".
It would be nice if the test case in this PR were converted into an ATF
test case, but not blocking on that.
Reviewed by: imp, melifaro
Pull Request: https://github.com/freebsd/freebsd-src/pull/601
On some hardware, we can't clear HCR_EL2.E2H so accesses to the physical
timer hopelessly trap to EL2. Stash off the value of HCR_EL2 and use it
in has_hyp() to avoid this.
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D38884
With the deprecation of NgATM, ng_atmllc is the last vestage of ATM
support so deprecate it too.
MFC after: 3 days
Relnotes: yes
Reviewed by: manu, emaste
Differential Revision: https://reviews.freebsd.org/D38878
Support for ATM NICs was removed prior to FreeBSD 12. At the time it
was unclear if this code was still useful without it. Now the time has
come to finish removing support.
Add DREPRECATION NOTICEs to the manpages and gone_in(14, ...) warnings
in the constructors (or module init for ngatmbase).
MFC after: 3 days
Relnotes: yes
Reviewed by: manu, emaste
Differential Revision: https://reviews.freebsd.org/D38877
This makes the detection of VMs common between platforms that
have SMBios.
Reviewed by: imp, kib
Differential Revision: https://reviews.freebsd.org/D38800
This code was removed as part of the NATM removal in 2017 and somehow
this option was missed.
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D38874
The consensus was that VNET_NFSD was not needed.
This patch removes it from kern_jail.c.
With this patch, support for the "allow.nfsd"
jail parameter is enabled in the kernel for
kernels built with "options VIMAGE".
Reviewed by: markj
MFC after: 3 months
Differential Revision: https://reviews.freebsd.org/D38808
To run mountd in a vnet prison, three checks in vfs_domount()
and vfs_domount_update() related to doing exports needed
to be changed, so that a file system visible within the
prison but mounted outside the prison can be exported.
I did all three in a minimal way, only changing the checks for
the specific case of a process (typically mountd) doing exports
within a vnet prison and not updating the mount point in other
ways. The changes are:
- Ignore the error return from vfs_suser(), since the file
system being mounted outside the prison will cause it to fail.
- Use the priv_check(PRIV_NFS_DAEMON) for this specific case
within a prison.
- Skip the call to VFS_MOUNT(), since it will return an error,
due to the "from" argument not being set correctly. VFS_MOUNT()
does not appear to do anything for the case of doing exports only.
Reviewed by: markj
MFC after: 3 months
Differential Revision: https://reviews.freebsd.org/D37741
In every mpr and mps ioctl that copies kernel data to userland, validate
that the requested length does not exceed the size of the kernel's
buffer.
Note that all of these ioctls already required root access.
MFC after: 2 weeks
Sponsored by: Axcient
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D38842
All drivers are already either in GENERIC or in the other arches LINT
so no need to build this one too.
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D38851
All drivers are already either in GENERIC or in the other arches LINT
so no need to build this one too.
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D38850
All drivers are already either in GENERIC or in the IMX51 kernel config
so no need to build this one too.
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D38849
Specific devices are in LINT so no need to build this one as part
of make universe.
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D38848
Reviewed by: imp
Use ftgpio_group_get_status instead of inlining an imperfect
version of it to get correct register and avoid
panic: ftgpio_group_get_ioreg: invalid register 0 for group 0
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/677
Without this patch, a single initialization function was
used to initialize both the vnet'd and non-vnet'd data.
This patch separates out the non-vnet'd initializations
into a separate function invoked by SYSINIT().
This avoids use of IS_DEFAULT_VNET() in the initialization
functions and also configures the non-vnet'd initialization
function to be called first, although ordering is not
currently needed.
Reviewed by: glebius
MFC after: 3 months
Differential Revision: https://reviews.freebsd.org/D38749
The sysctls were in "struct fha_params", making it impractical
to vnet them. This patch moves the sysctls out of "struct fha_params"
and vnet's them, so that they are available in vnet prisons
running nfsd(8). It also avoids the IS_DEFAULT_VNET() macros
in the VNET_SYSINIT() function.
Reviewed by: glebius
MFC after: 3 months
Differential Revision: https://reviews.freebsd.org/D38748
The "canonical" EBR partition names like `ada0s4+00002081` are not
particularly meaningful. The "compat" aliases share the same namespace
as the parent MBR, resulting in user-friendly names like `ada0s6`.
These names are consistent with the way Linux names EBR partitions.
We previously provided a sysctl kern.features.geom_part_ebr_compat
(enabled by default) to control the "compat" names. Remove the sysctl
and always create the aliases.
Relnotes: yes
Reviewed by: cem, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38812
kmod.mk appends the value of SRCS.${KERN_OPT} for each defined kernel
option to SRCS. This helper is shorter than appending to SRCS under
explicit checks on KERN_OPTS.
Reviewed by: imp
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D38738
ACPI is not handled specially by sys/conf/kern.opts.mk (unlike a few
options), so we should fall back on the generic behavior of
sys/conf/config.mk, which pulls from all the generated opt*.h files,
including opt_acpi.h, which will cause DEV_ACPI to be included in
KERN_OPTS. Then the generic machinery in sys/conf/kmod.mk will cause
SRCS.DEV_ACPI to be included in SRCS when appropriate.
Reviewed by: jhb, imp
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D38737
A subsequent commit will instead use existing infrastructure to
exclude the files from hwpmc.ko for non-ACPI builds. Note that the
original commit left the files as optional in sys/conf/files.arm64.
This reverts commit 751d88119f.
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D38736
Coverity reported a sign extension issue on rq->caching << 26 in the
Linux ThunderX driver. (It appears Coverity Scan doesn't build arm64
objects in FreeBSD.)
As done in Linux, add a cast.
Fixes: 3c0086b813 ("Raw import of ThunderX VNIC networking driver...")
Sponsored by: The FreeBSD Foundation
This patch shaves off up to two three instructions in
save_registers_head in exception.S for arm64, which would make more
space for instructions that could be added in CheriBSD.
This is done by:
1. Combining pointer arithmetic with pre-incrementing STP instructions
2. Removing the instruction that sets the frame pointer (x29) as its
content is unused
Differential Revision: https://reviews.freebsd.org/D34631
Also add the EM160R to the man page, noting the work-around
required to make it function properly in PPP mode.
MFC-After: 1 week
Sponsored by: Metify Inc.
Sponsored by: Klara Inc.
Mapping the framebuffer with WC (Write Combined) memory type can, in
practice, cause some memory transactions to be rate-limited at a
fraction of the fb write rate. WC allows one core to queue up many
globally visible write transactions, and in the process some unrelated
transactions may end up having to wait for all of the queued up PCI
writes to be flushed.
Add an hw.efifb.cache_attr tunable to allow mapping the framebuffer as
uncacheable instead. We should likely be taking a more careful approach
of checking the memory map to determine which cacheability attributes
are feasible, but the knob lets us use our historically functional
behavior while offering a convenient way to switch on a stock kernel.
The only valid values for hw.efifb.cache_attr at this time are "uc" and
"wc".
Original patch by Marc De La Gueronniere <mdelagueronniere@verisign.com>
along with previous testing.
Reviewed by: imp
MFC after: 1 week
Sponsored by: Verisign, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D17884
Polling is currently only implemented in the xhci pci attachment.
Adding it to dwc3 doesn't make it much uglier, and supporting it can be
useful for confirming that hardware's otherwise functional when
interrupts are apparently not firing.
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D38816
On Apple Silicon systems, E2H can't actually be cleared; we're stuck
with it. Check it again when we're setting up CPTR_EL2 and set FPEN
appropriately to avoid later trapping to EL2 on writes to SIMD
registers.
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D38819
It has no effect, and an exp-run revealed that it is not in use.
PR: 261398 (exp-run)
Reviewed by: mjg, glebius
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38822