Commit Graph

3789 Commits

Author SHA1 Message Date
Neel Chauhan
b47f461c8e linuxkpi: Add list_for_each_entry_lockless() macro
This is needed by the drm-kmod 5.7 update.

Approved by:		hselasky (src)
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D30708
2021-06-10 08:15:29 -07:00
Dmitry Chagin
ed61e0ce1d linux(4): Implement ppoll_time64 system call.
MFC after:	2 weeks
2021-06-10 15:18:46 +03:00
Dmitry Chagin
f6d075ecd7 linux(4): Implement pselect6_time64 system call.
MFC after:	2 weeks
2021-06-10 15:03:30 +03:00
Dmitry Chagin
db4a1f331b linux(4): Implement rt_sigtimedwait_time64 system call.
It still does not work as intended, awaits D30675.

MFC after:	2 weeks
2021-06-10 14:51:30 +03:00
Dmitry Chagin
2e46d0c3d9 linux(4): Implement futex_time64 system call.
MFC after:	2 weeks
2021-06-10 14:27:06 +03:00
Dmitry Chagin
25b09d6f39 linux(4): Prevent integer overflow in futex_requeue.
To prevent a signed integer overflow in futex_requeue add a sanity check
to catch negative values of nrwake or nrrequeue.

MFC after:	2 weeks
2021-06-10 14:23:11 +03:00
Greg V
597cc550e7 LinuxKPI: add fault_flag_allow_retry_first
Used by drm 5.7.

Reviewed by:	bz, hselasky, nc
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D30673
2021-06-09 19:11:41 -04:00
Neel Chauhan
8a1a42b2a7 linuxkpi: Add macros for might_lock_nested() and lockdep_(re/un/)pin_lock()
In Linux, these are macros to locks in the kernel for scheduling purposes.
But as with other macros in this header, we aren't doing anything with them
so we are doing `do {} while (0)` for now.

This is needed by the drm-kmod 5.7 update.

Approved by:		hselasky (src)
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D30710
2021-06-09 14:41:44 -07:00
Neel Chauhan
fee0d486ef linuxkpi: Add _RET_IP_ macro in kernel.h
This is needed by the drm-kmod 5.7 update.

Approved by:		hselasky (src)
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D30707
2021-06-09 14:41:44 -07:00
Philippe Michaud-Boudreault
2362ad457a linux: implement statx(2)
PR:		252106
Reviewed By:	dchagin
Differential Revision:	https://reviews.freebsd.org/D30466
2021-06-08 10:08:56 +01:00
Neel Chauhan
1b602f641a linuxkpi: Fix build from redefined pr_err_once() 2021-06-07 16:37:21 -07:00
Neel Chauhan
37d64dcdfa linuxkpi: Include pr_err_once() in printk.h
Approved by:		bz (src), hselasky (src)
Differential Reivison:	https://reviews.freebsd.org/D30687
2021-06-07 15:53:24 -07:00
Neel Chauhan
096104e790 linuxkpi: Add rom and romlen to struct pci_dev
Approved by:		bz (src), hselasky (src)
Differential Reivison:	https://reviews.freebsd.org/D30686
2021-06-07 15:53:24 -07:00
Greg V
05c2d94a08 LinuxKPI: add pr_err_once
Reviewed by:	hselasky, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D30672
2021-06-07 10:31:48 -04:00
Edward Tomasz Napierala
128a1db806 linux: improve FUSE support
This fixes a number of AppImages; tested with
scribus-1.5.6.1-linux-x86_64.AppImage.

Reported By:	@probonopd
Reviewed By:	asomers, emaste
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D30606
2021-06-07 10:43:28 +01:00
Konstantin Belousov
62b8258a7e Change the return type of sv__setid_allowed from bool to int
to please some userspace code using sys/sysent.h.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-06-06 23:38:48 +03:00
Konstantin Belousov
598f6fb49c linuxolator: Add compat.linux.setid_allowed knob
PR:	21463
Reported by:	kris
Reviewed by:	dchagin
Tested by:	trasz
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D28154
2021-06-06 21:43:00 +03:00
Dmitry Chagin
66e73ce737 linux(4): Fix clock_nanosleep return value for unsupported clockid.
The Linux clock_nanosleep() returns ENOTSUP for CLOCK_THREAD_CPUTIME_ID.
This silence one of the LTP clock_nanosleep tests.

MFC after:	2 weeks
2021-06-07 06:22:25 +03:00
Dmitry Chagin
f4e801085b linux(4): optimize ksiginfo to siginfo conversion.
Retire ksiginfo_to_lsiginfo function, use siginfo_to_lsiginfo instead.
Convert rt_sigtimedwait siginfo variables to well known names.

MFC after:	2 weeks
2021-06-07 06:06:17 +03:00
Dmitry Chagin
9c1045ff00 linux(4): Properly convert linux siginfo to native siginfo
add input validation.

MFC after:	2 weeks
2021-06-07 05:55:34 +03:00
Dmitry Chagin
0f8dab4540 linux(4): Fix timeout parameter of rt_sigtimedwait syscall, which is
timespec not a timeval.

MFC after:	2 weeks
2021-06-07 05:35:35 +03:00
Dmitry Chagin
6501370a7d linux(4): Implement clock_nanosleep_time64 system call.
MFC after:	2 weeks
2021-06-07 05:26:48 +03:00
Dmitry Chagin
187715a420 linux(4): Implement clock_getres_time64 system call.
MFC after:	2 weeks
2021-06-07 05:21:32 +03:00
Dmitry Chagin
19f9a0e4df linux(4): Implement clock_settime64 system call.
MFC after:	2 weeks
2021-06-07 05:11:25 +03:00
Dmitry Chagin
99b6f43069 linux(4): Implement clock_gettime64 system call.
MFC after:	2 weeks
2021-06-07 05:04:42 +03:00
Dmitry Chagin
e4bffb80bb linux(4): Implement utimensat_time64 system call.
MFC after:	2 weeks
2021-06-07 04:54:30 +03:00
Dmitry Chagin
bfcce1a9f6 linux(4): add struct timespec64 definition and conversion routine for
future use.

MFC after:		2 weeks
2021-06-07 04:47:12 +03:00
Bjoern A. Zeeb
b5d37e5a20 net80211/LinuxKPI: add more radiotap definitions
Add more raditap definitions based on "names" found in actual drivers
and based on documentation from radiotap.org (where avail).

Leave one specific "duplicate" in the LinuxKPI implementation but
otherwise manage it all in net80211.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
Reviewed by:	hselasky, adrian, sam
Differential Revision: https://reviews.freebsd.org/D30641
2021-06-05 16:21:49 +00:00
Dmitry Chagin
2a0fa277f6 linux(4): Microoptimize futimesat, utimes, utime.
While here wrap long line.

Differential Revision:	https://reviews.freebsd.org/D30488
MFC after:		2 weeks
2021-05-31 22:54:18 +03:00
Dmitry Chagin
b4f9b6eef2 linux(4): Handle AT_EMPTY_PATH in the utimensat syscall.
Differential Revision:	https://reviews.freebsd.org/D30518
MFC after:		2 weeks
2021-05-31 22:37:06 +03:00
Dmitry Chagin
8505eb5dd8 linux(4): Convert flags before use in utimensat.
Differential Revision:	https://reviews.freebsd.org/D30487
MFC after:		2 weeks
2021-05-31 22:30:37 +03:00
Dmitry Chagin
a06c12464b linux(4): Add F_GETPIPE_SZ fcntl operation which returns the capacity
of the pipe referred by fd.

Differential Revision:	https://reviews.freebsd.org/D30517
MFC after:		2 weeks
2021-05-31 22:15:02 +03:00
Edward Tomasz Napierala
83043a741d linux: deduplicate DUMMY() entries
No functional changes.

Reviewed By:	emaste
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D30524
2021-05-29 17:51:36 +00:00
Edward Tomasz Napierala
6d926e850d linux: add new syscall numbers
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D30193
2021-05-28 09:02:16 +01:00
Bjoern A. Zeeb
4cc8a9da49 LinuxKPI: add HWEIGHT32()
Add HWEIGHT32() macro needed by iwlwifi and while here add the 8/16/64
variants likewise.

Sponsored by:	The FreeBSD Foundation
MFC after:	12 days
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D30501
2021-05-27 13:38:30 +00:00
Bjoern A. Zeeb
9b6835f3ab LinuxKPI: netdevice.h remove more ifnet operating macros
Now that mlx4 and ofed either are operating on ifnet functions
directly or have a private copy of these macros, we can remove them
from linux/netdevice.h.
With this only the #define for net_device to ifnet is left.

Sponsored by:	The FreeBSD Foundation
MFC after:	12 days
Reviewed by:	kib
Differential Revision: https://reviews.freebsd.org/D30478
2021-05-27 12:26:01 +00:00
Bjoern A. Zeeb
c35034b338 LinuxKPI/OFED/mlx4: cleanup netdevice.h some more
This removes all unused bits from linux/netdevice.h and migrates two
inline functions into the mlx4 and ofed code respectively.

This gets the mlx4/ofed (struct ifnet) specific bits down to 7 lines
in netdevice.h.

Sponsored by:	The FreeBSD Foundation
MFC after:	13 days
Reviewed by:	hselasky, kib
Differential Revision: https://reviews.freebsd.org/D30461
2021-05-26 12:30:02 +00:00
Dmitry Chagin
5184e2da41 linux_common: retire extra module version.
The second 'linuxcommon' line was added by c66f5b079d
but Linuxulator's modules dependend on 'linux_common'.
To avoid such mistakes in the future rename moduledata name and module
name to  'linux_common' and retire 'linuxcommon' line.

Reviewed by:		emaste
Differential Revision:	https://reviews.freebsd.org/D30409
MFC after:		2 weeks
2021-05-26 08:34:32 +03:00
Bjoern A. Zeeb
095f018e49 LinuxKPI: add addrconf_addr_solict_mult()
Introduce net/addrconf.h with an implementation to
addrconf_addr_solict_mult() used by WiFi drivers.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D30416
2021-05-25 18:01:49 +00:00
Bjoern A. Zeeb
32f753f270 LinuxKPI: add Exponentially Weighted Moving Average implementation
Add DECLARE_EWMA() which expands to a per-name EWMA implementation
as used by multiple wireless drivers.

Sposnored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	hselasky, cperciva, dwmalone
Differential Revision: https://reviews.freebsd.org/D30415
2021-05-25 18:01:48 +00:00
Bjoern A. Zeeb
f4a145b136 LinuxKPI: add linux/bsearch.h for sort(9)
Add linux/bsearch.h which only includes libkern.h as the sort(9)
functions seem to be compatible.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D30417
2021-05-25 18:01:48 +00:00
Bjoern A. Zeeb
5aeeab54b0 LinuxKPI: byteorder.h
Add a few more le<n>_{tp,add}_cpu*() #defines/functions found in
wireless drivers.  While here fill most of the combinatorics gaps
and also add the remaining combinations [1].

Suggested by:	emaste [1] (for one part)
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D30418
2021-05-25 18:01:48 +00:00
Bjoern A. Zeeb
e21652c13c LinuxKPI: cache.h add SMP_CACHE_BYTES
Add a definition for SMP_CACHE_BYTES and while here include sys/param.h
for CACHE_LINE_SIZE as otherwise code might not compile standalone.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D30419
2021-05-25 18:01:48 +00:00
Bjoern A. Zeeb
da717031c9 LinuxKPI: compiler.h add three more defines
Add fallthrough, ____cacheline_aligned_in_smp, and smp_mb() to
linux/compiler.h.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D30420
2021-05-25 18:01:48 +00:00
Bjoern A. Zeeb
5fce802722 LinuxKPI: add cpu.h for cpumask_*()
Add linux/cpu.h for cpumask_*() functions found in wireless drivers
and make sure cpu_online_mask is always initialised.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D30421
2021-05-25 18:01:48 +00:00
Bjoern A. Zeeb
29923fea03 LinuxKPI: add devcoredump.h
Add linux/devcoredump.h with stub implementation of dev_coredumpv()
and dev_coredumpsg() which only free the passed in SG table as needed
for iwlwifi.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D30423
2021-05-25 18:01:48 +00:00
Bjoern A. Zeeb
e7a0b68540 LinuxKPI: add dev_crit() to linux/device.h
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	emaste, hselasky
Differential Revision: https://reviews.freebsd.org/D30424
2021-05-25 18:01:48 +00:00
Bjoern A. Zeeb
834227ba6e LinuxKPI: add ether_addr_equal_unaligned()
Replace the implementation for ether_addr_equal() with
ether_addr_equal_unaligned() and add a define for ether_addr_equal()
pointing to the now ether_addr_equal_unaligned() implementation.
This way ether_addr_equal_unaligned() cannot be broken by accident [1].

Suggested by:	emaste [1]
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D30425
2021-05-25 18:01:47 +00:00
Bjoern A. Zeeb
ff09f9133f LinuxKPI: net/if_inet6.h add struct inet6_dev { }
Add a dummy struct inet6_dev {}; to net/if_inet6.h.  This is currently
not used for anything but in a declaration.  Just needs to be there.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D30426
2021-05-25 18:01:47 +00:00
Bjoern A. Zeeb
602e4e433d LinuxKPI: add irq_set_affinity_hint()
Add an implementation for irq_set_affinity_hint() to linux/interrupt.h
and include linux/hardirq.h for synchronize_irq() as needed by
wireless drivers.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D30427
2021-05-25 18:01:47 +00:00