History log of /freebsd-13.1/sys/compat/linux/linux_ioctl.c (Results 1 – 25 of 228)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: release/12.4.0, release/13.1.0
# 9b42da2b 08-Jan-2022 Alexander V. Chernikov <[email protected]>

linux: add sysctl to pass untranslated interface names

Reviewed by: kib
Approved by: re(gjb)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D33792

(cherry picked from comm

linux: add sysctl to pass untranslated interface names

Reviewed by: kib
Approved by: re(gjb)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D33792

(cherry picked from commit 1f70a85b4cbc3ad19cec4a390e8754e54815be85)
(cherry picked from commit c7655e1f3671a9ce7d963cb577b4548173469053)

show more ...


Revision tags: release/12.3.0
# 89847f7e 29-Apr-2021 Edward Tomasz Napierala <[email protected]>

linux: Improve debugging by recognizing TIOCGPTPEER

Sponsored By: EPSRC

(cherry picked from commit 1866c766d2c520faaedbfe98d2e34a95f54053a5)


# 1f86d04d 17-Oct-2021 Edward Tomasz Napierala <[email protected]>

linux: Partially implement TCSBRK

This fixes tcflush(3), unbreaking cheribuild.py under arm64 Focal.

Reviewed By: imp
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D32291

linux: Partially implement TCSBRK

This fixes tcflush(3), unbreaking cheribuild.py under arm64 Focal.

Reviewed By: imp
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D32291

(cherry picked from commit 7e7859e7c2b900fd1b1af6e90ed31d51b9b5514d)

show more ...


Revision tags: release/13.0.0
# cd853791 28-Nov-2020 Konstantin Belousov <[email protected]>

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_pag

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

show more ...


# 77311940 02-Nov-2020 Conrad Meyer <[email protected]>

linux(4): Quiesce unrecognized ioctl warning for F2FS query

On Linux, sqlite probes for underlying F2FS filesystems that support
certain kinds of atomic update with this ioctl. The expected result

linux(4): Quiesce unrecognized ioctl warning for F2FS query

On Linux, sqlite probes for underlying F2FS filesystems that support
certain kinds of atomic update with this ioctl. The expected result on
non-F2FS filesystem (i.e., all FreeBSD filesystems) is any error value.

Minimally implement the ioctl and avoid the warning message.

(This shows up in Linux Chrome, which embeds sqlite.)

Reviewed by: emaste, trasz
Differential Revision: https://reviews.freebsd.org/D27050

show more ...


# 53efdb55 02-Nov-2020 Conrad Meyer <[email protected]>

linux(4): Deduplicate ioctl range construction with a helper macro

No functional change.

Reviewed by: emaste, trasz
Differential Revision: https://reviews.freebsd.org/D27049


# 63ed2e36 02-Nov-2020 Conrad Meyer <[email protected]>

linux(4): Disambiguate identical ioctl errors in distinct paths

And stop truncating the full ioctl number in the error message.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.or

linux(4): Disambiguate identical ioctl errors in distinct paths

And stop truncating the full ioctl number in the error message.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D27048

show more ...


Revision tags: release/12.2.0
# 79e3da06 17-Sep-2020 Edward Tomasz Napierala <[email protected]>

Add support for SOUND_MIXER_WRITE_MONITOR ioctl. Fixes alsamixer(1)
on my x220.

Reviewed by: emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.fr

Add support for SOUND_MIXER_WRITE_MONITOR ioctl. Fixes alsamixer(1)
on my x220.

Reviewed by: emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25806

show more ...


# 46888ded 04-Sep-2020 Mark Johnston <[email protected]>

Add emulation support for the Linux kcov(4) ioctl API.

This makes it possible to run an unmodified Linux syzkaller executor
against the Linuxulator, and have it gather code coverage information.

Sp

Add emulation support for the Linux kcov(4) ioctl API.

This makes it possible to run an unmodified Linux syzkaller executor
against the Linuxulator, and have it gather code coverage information.

Sponsored by: The FreeBSD Foundation

show more ...


# 1a180032 01-Sep-2020 Mateusz Guzik <[email protected]>

compat: clean up empty lines in .c and .h files


# aa754121 19-Jul-2020 Edward Tomasz Napierala <[email protected]>

Make linux(4) support the BLKPBSZGET ioctl. Oracle uses it.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25694


# d6d9ddd4 04-Jul-2020 Mateusz Guzik <[email protected]>

linux: fix ioctl performance for termios

TCGETS et al are frequently issued by Linux binaries while the previous code
avoidably ping-pongs a global sx lock and serializes on Giant.

Note that even w

linux: fix ioctl performance for termios

TCGETS et al are frequently issued by Linux binaries while the previous code
avoidably ping-pongs a global sx lock and serializes on Giant.

Note that even with the fix the common case will serialize on a per-tty lock.

show more ...


Revision tags: release/11.4.0
# 562894f0 14-Apr-2020 Brooks Davis <[email protected]>

Centralize compatability translation macros.

Copy the CP, PTRIN, etc macros from freebsd32.h into a sys/abi_compat.h
and replace existing definitation with includes where required. This
eliminates d

Centralize compatability translation macros.

Copy the CP, PTRIN, etc macros from freebsd32.h into a sys/abi_compat.h
and replace existing definitation with includes where required. This
eliminates duplicate code and allows Linux and FreeBSD compatability
headers to be included in the same files.

Input from: cem, jhb
Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24275

show more ...


# d845d3dc 10-Mar-2020 Hans Petter Selasky <[email protected]>

Add support for the device statistics IOCTL, needed by the coming
linux_libusb upgrade.

MFC after: 3 days
Sponsored by: Mellanox Technologies


# b9594cd9 29-Dec-2019 Edward Tomasz Napierala <[email protected]>

Implement Linux BLKGETSIZE64 ioctl.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation


# 2cf9eb6c 16-Dec-2019 Edward Tomasz Napierala <[email protected]>

Add a hack to make ^T work for Linux binaries, enabled with
'compat.linux.preserve_vstatus=1' sysctl.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.f

Add a hack to make ^T work for Linux binaries, enabled with
'compat.linux.preserve_vstatus=1' sysctl.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21967

show more ...


Revision tags: release/12.1.0, release/11.3.0
# 0fabd7b5 04-Jul-2019 Edward Tomasz Napierala <[email protected]>

Return ENOTSUP for Linux FS_IOC_FIEMAP ioctl.

Linux man(1) calls it for no good reason; this avoids the console spam
(eg '(man): ioctl fd=4, cmd=0x660b ('f',11) is not implemented').

Reviewed by: e

Return ENOTSUP for Linux FS_IOC_FIEMAP ioctl.

Linux man(1) calls it for no good reason; this avoids the console spam
(eg '(man): ioctl fd=4, cmd=0x660b ('f',11) is not implemented').

Reviewed by: emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20690

show more ...


# fc795c25 03-Jul-2019 Mark Johnston <[email protected]>

Remove the CDIOCREADSUBCHANNEL_SYSSPACE ioctl.

This was added for emulation of Linux's CDROMSUBCHNL, but allows
users with read access to a cd(4) device to overwrite kernel memory
provided that the

Remove the CDIOCREADSUBCHANNEL_SYSSPACE ioctl.

This was added for emulation of Linux's CDROMSUBCHNL, but allows
users with read access to a cd(4) device to overwrite kernel memory
provided that the driver detects some media present.

Reimplement CDROMSUBCHNL by bouncing the data from CDIOCREADSUBCHANNEL
through the linux_cdrom_subchnl structure passed from userspace.

admbugs: 768
Reported by: Alex Fortune
Security: CVE-2019-5602
Security: FreeBSD-SA-19:11.cd_ioctl

show more ...


# c5156c77 13-May-2019 Dmitry Chagin <[email protected]>

Linuxulator depends on a fundamental kernel settings such as SMP. Many
of them listed in opt_global.h which is not generated while building
modules outside of a kernel and such modules never match re

Linuxulator depends on a fundamental kernel settings such as SMP. Many
of them listed in opt_global.h which is not generated while building
modules outside of a kernel and such modules never match real cofigured
kernel.

So, we should prevent our users from building obviously defective modules.

Therefore, remove the root cause of the building of modules outside of a
kernel - the possibility of building modules with DEBUG or KTR flags.
And remove all of DEBUG printfs as it is incomplete and in threaded
programms not informative, also a half of system call does not have DEBUG
printf. For debuging Linux programms we have dtrace, ktr and ktrace ability.

PR: 222861
Reviewed by: trasz
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20178

show more ...


# d151344d 03-May-2019 Dmitry Chagin <[email protected]>

In order to reduce duplication between MD parts of the Linuxulator
move bits that are MI out into the headers in compat/linux.
For that remove bogus _packed attribute from struct l_sockaddr
and use M

In order to reduce duplication between MD parts of the Linuxulator
move bits that are MI out into the headers in compat/linux.
For that remove bogus _packed attribute from struct l_sockaddr
and use MI types for struct members.

And continue to move into the linux_common module a code that is
intended for both Linuxulator modules (both instruction set - 32 & 64 bit)
or for external modules like linsysfs or linprocfs.

To avoid header pollution introduce new sys/compat/linux_common.h header.

Reviewed by: emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20137

show more ...


# 9866e7bb 21-Jan-2019 Ed Maste <[email protected]>

linuxulator: fix stack memory disclosure in linux_ioctl_termio

admbugs: 765
Reported by: Vlad Tsyrklevich <[email protected]>
Reviewed by: andrew
MFC after: 1 day
Security: Kernel stack memory di

linuxulator: fix stack memory disclosure in linux_ioctl_termio

admbugs: 765
Reported by: Vlad Tsyrklevich <[email protected]>
Reviewed by: andrew
MFC after: 1 day
Security: Kernel stack memory disclosure
Sponsored by: The FreeBSD Foundation

show more ...


# 4308a374 21-Jan-2019 Ed Maste <[email protected]>

linuxulator: fix stack memory disclosure in linux_ioctl_v4l

admbugs: 765
Reported by: Vlad Tsyrklevich <[email protected]>
Reviewed by: andrew
MFC after: 1 day
Security: Kernel stack memory discl

linuxulator: fix stack memory disclosure in linux_ioctl_v4l

admbugs: 765
Reported by: Vlad Tsyrklevich <[email protected]>
Reviewed by: andrew
MFC after: 1 day
Security: Kernel stack memory disclosure
Sponsored by: The FreeBSD Foundation

show more ...


Revision tags: release/12.0.0
# 8fc08087 06-Nov-2018 Tijl Coosemans <[email protected]>

On amd64 both Linux compat modules, linux.ko and linux64.ko, provide
linux_ioctl_(un)register_handler that allows other driver modules to
register ioctl handlers. The ioctl syscall implementation in

On amd64 both Linux compat modules, linux.ko and linux64.ko, provide
linux_ioctl_(un)register_handler that allows other driver modules to
register ioctl handlers. The ioctl syscall implementation in each Linux
compat module iterates over the list of handlers and forwards the call to
the appropriate driver. Because the registration functions have the same
name in each module it is not possible for a driver to support both 32 and
64 bit linux compatibility.

Move the list of ioctl handlers to linux_common.ko so it is shared by
both Linux modules and all drivers receive both 32 and 64 bit ioctl calls
with one registration. These ioctl handlers normally forward the call
to the FreeBSD ioctl handler which can handle both 32 and 64 bit.

Keep the special COMPAT_LINUX32 ioctl handlers in linux.ko in a separate
list for now and let the ioctl syscall iterate over that list first.
Later, COMPAT_LINUX32 support can be added to the 64 bit ioctl handlers
via a runtime check for ILP32 like is done for COMPAT_FREEBSD32 and then
this separate list would disappear again. That is a much bigger effort
however and this commit is meant to be MFCable.

This enables linux64 support in x11/nvidia-driver*.

PR: 206711
Reviewed by: kib
MFC after: 3 days

show more ...


Revision tags: release/11.2.0
# 4f6c66cc 23-May-2018 Matt Macy <[email protected]>

UDP: further performance improvements on tx

Cumulative throughput while running 64
netperf -H $DUT -t UDP_STREAM -- -m 1
on a 2x8x2 SKL went from 1.1Mpps to 2.5Mpps

Single stream throughput incre

UDP: further performance improvements on tx

Cumulative throughput while running 64
netperf -H $DUT -t UDP_STREAM -- -m 1
on a 2x8x2 SKL went from 1.1Mpps to 2.5Mpps

Single stream throughput increases from 910kpps to 1.18Mpps

Baseline:
https://people.freebsd.org/~mmacy/2018.05.11/udpsender2.svg

- Protect read access to global ifnet list with epoch
https://people.freebsd.org/~mmacy/2018.05.11/udpsender3.svg

- Protect short lived ifaddr references with epoch
https://people.freebsd.org/~mmacy/2018.05.11/udpsender4.svg

- Convert if_afdata read lock path to epoch
https://people.freebsd.org/~mmacy/2018.05.11/udpsender5.svg

A fix for the inpcbhash contention is pending sufficient time
on a canary at LLNW.

Reviewed by: gallatin
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15409

show more ...


# d7c5a620 18-May-2018 Matt Macy <[email protected]>

ifnet: Replace if_addr_lock rwlock with epoch + mutex

Run on LLNW canaries and tested by pho@

gallatin:
Using a 14-core, 28-HTT single socket E5-2697 v3 with a 40GbE MLX5
based ConnectX 4-LX NIC, I

ifnet: Replace if_addr_lock rwlock with epoch + mutex

Run on LLNW canaries and tested by pho@

gallatin:
Using a 14-core, 28-HTT single socket E5-2697 v3 with a 40GbE MLX5
based ConnectX 4-LX NIC, I see an almost 12% improvement in received
packet rate, and a larger improvement in bytes delivered all the way
to userspace.

When the host receiving 64 streams of netperf -H $DUT -t UDP_STREAM -- -m 1,
I see, using nstat -I mce0 1 before the patch:

InMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree
4.98 0.00 4.42 0.00 4235592 33 83.80 4720653 2149771 1235 247.32
4.73 0.00 4.20 0.00 4025260 33 82.99 4724900 2139833 1204 247.32
4.72 0.00 4.20 0.00 4035252 33 82.14 4719162 2132023 1264 247.32
4.71 0.00 4.21 0.00 4073206 33 83.68 4744973 2123317 1347 247.32
4.72 0.00 4.21 0.00 4061118 33 80.82 4713615 2188091 1490 247.32
4.72 0.00 4.21 0.00 4051675 33 85.29 4727399 2109011 1205 247.32
4.73 0.00 4.21 0.00 4039056 33 84.65 4724735 2102603 1053 247.32

After the patch

InMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree
5.43 0.00 4.20 0.00 3313143 33 84.96 5434214 1900162 2656 245.51
5.43 0.00 4.20 0.00 3308527 33 85.24 5439695 1809382 2521 245.51
5.42 0.00 4.19 0.00 3316778 33 87.54 5416028 1805835 2256 245.51
5.42 0.00 4.19 0.00 3317673 33 90.44 5426044 1763056 2332 245.51
5.42 0.00 4.19 0.00 3314839 33 88.11 5435732 1792218 2499 245.52
5.44 0.00 4.19 0.00 3293228 33 91.84 5426301 1668597 2121 245.52

Similarly, netperf reports 230Mb/s before the patch, and 270Mb/s after the patch

Reviewed by: gallatin
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15366

show more ...


12345678910