aboutsummaryrefslogtreecommitdiff
path: root/sys/modules/linux
Commit message (Collapse)AuthorAgeFilesLines
* linux: Add required symbol to EXPORT_SYMS listEd Maste2025-12-291-0/+1
| | | | PR: 291270
* Revert "modules: Add missing opt_*.h files for stand-alone compile"Warner Losh2024-10-171-2/+0
| | | | | | | | | | This reverts commit 1a37caeb076b9d31e13c54691d7f1eeb589798bb. I'd overlooked 06c07e1203324bfe8ab4526c82dbb750864272d5 when I updated a branch I'd previously committed but not updated. My search for this in my tree before the commit was to a stale file... Sponsored by: Netflix
* modules: Add missing opt_*.h files for stand-alone compileWarner Losh2024-10-121-0/+2
| | | | | | Standalone compile that we at least create these opt_*.h files. Sponsored by: Netflix
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* linux: Make module standalone-buildableWarner Losh2024-05-111-0/+2
| | | | | | Add opt_inet.h and opt_usb.h to make linux module buildable standalone. Sponsored by: Netflix
* sanitizers: Avoid building genassym.c and genoffset.c with sanitizersMark Johnston2024-01-121-1/+2
| | | | | | | | | | | | | | Some, particularly KASAN, may insert redzones around global symbols, resulting in incorrect offset definitions because genassym.sh (ab)uses symbol sizes to assign semantic meaning. (Ideally I would be able to define this pattern in one place, but I haven't found a way to define a GENSYM_CFLAGS that actually works for all of the consumers (kern.post.mk, kmod.mk, sys/conf/files*).) MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Juniper Networks, Inc.
* sys: ${CFLAGS:N-flto} -> ${CFLAGS:N-flto*}Alex Xu (Hello71)2023-12-261-1/+1
| | | | | | | | | | For the same reason as the original https://reviews.freebsd.org/D9659: -flto=<N>, -flto=full, and -flto=thin also produce the GIMPLE/bitcode which is not supported by genassym, so filter those out as well. Signed-off-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/898
* netlink: move NETLINK define to opt_global.hKristof Provost2023-10-131-2/+1
| | | | | | | | | | | | | Move the NETLINK define into opt_global.h so we can rely on it being set correctly, without having to remember to include opt_netlink.h. This ensures that the NETLINK define is correctly set. If not we may end up with unloadable modules, due to missing symbols (such as nlmsg_get_group_writer). PR: 274306 Reviewed by: imp, markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42179
* sys: Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* linux(4): Implement xattr syscallsDmitry Chagin2023-07-221-0/+1
| | | | | | Reviewed by: Differential revision: https://reviews.freebsd.org/D35544 MFC after: 1 month
* linux(4): Make linux_emul_path privateDmitry Chagin2023-05-291-1/+0
| | | | | | There is no need to refer to linux_emul_path from outside anymore. MFC after: 2 month
* linux(4): Fix opt_netlink.h inclusionDmitry Chagin2023-03-311-2/+2
| | | | | | | | Add opt_netlink.h to the linux_common module, on i386, where we don't uses linux_common module, move opt_netlink.h inclusion under i386 condition. MFC after: 2 weeks
* linux(4): Move inclusion of i386-specific files under common conditionDmitry Chagin2023-03-311-4/+3
|
* netlink: fix linux module build w/ netlink.Alexander V. Chernikov2023-03-271-0/+1
| | | | | Reported by: Marek Zarychta <zarychtam@plan-b.pwste.edu.pl> MFC after: 2 weeks
* linux(4): Trim unused opt_usb.h from modules MakefilesDmitry Chagin2023-02-141-1/+0
| | | | MFC after: 2 weeks
* linux(4): Get rid of the opt_compat.h include.Dmitry Chagin2023-02-121-1/+0
| | | | | | | Since e013e369 COMPAT_LINUX, COMPAT_LINUX32 build options are removed, so include of opt_compat.h is no more needed. MFC after: 2 weeks
* linux(4): Attach netlink on i386.Dmitry Chagin2023-02-061-0/+1
| | | | | Discussed with: melifaro MFC after: 3 days
* linux(4): Add coredump support to i386.Dmitry Chagin2023-02-021-1/+1
| | | | MFC after: 1 week
* linux64: improve linux_support.s make rulesEd Maste2022-11-021-2/+2
| | | | | | | | | | | Previously we relied on the .s.o rule in share/mk/bsd.suffixes.mk to tell make that linux_support.o is built from linux_support.s, even though we do not use the .s.o rule to assemble it. Reviewed by: sjg MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D35864
* sys: use .S for assembly language files that use the preprocessorElliott Mitchell2022-11-021-1/+1
| | | | | | Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/609 Differential Revision: https://reviews.freebsd.org/D35908
* modules: Add missing opt_*.h files for stand-alone compileWarner Losh2022-10-291-0/+1
| | | | | | Standalone compile that we at least create these opt_*.h files. Sponsored by: Netflix
* linux, linux64: fix module loadMitchell Horne2022-10-291-0/+1
| | | | | | | | | | The previous commit added references to to the syscallnames arrays, but failed to add the relevant source files to the module build. Thus, the modules failed to load due to missing symbols. Reported by: cy Fixes: 1da65dcb1c57 ("linux: populate sv_syscallnames in each sysentvec") Sponsored by: The FreeBSD Foundation
* linux, linux64: improve SRCS formattingMitchell Horne2022-10-291-12/+40
| | | | | | | | | Sort the entries alphabetically, and list them with one entry per line. This makes the diffs much cleaner when adding or removing a new entry, as I will do in the next commit. MFC after: 1 week Sponsored by: The FreeBSD Foundation
* linux(4); Move vdso_selector_x86.c to the linux_common moduleDmitry Chagin2022-05-231-2/+2
| | | | MFC after: 2 weeks
* linux(4): Deduplicate translate_traps()Dmitry Chagin2022-05-231-1/+2
| | | | | | | As translate_traps() is common for x86 Linuxulators, move it under x86/linux. MFC after: 2 weeks
* linux(4): Implement vdso getcpu for x86.Dmitry Chagin2022-05-081-1/+1
| | | | | | This is modeled after f2395455 (by kib@). MFC after: 2 weeks
* linux(4): Add a simple rseq syscall implementation.Dmitry Chagin2022-04-261-1/+1
| | | | | | | | | To avoid annoyng messages from glibc-2.35 test suite add the simple implementation of rseq syscall which is do nothing for now. I plan to implement it if and when the API stabilizes. MFC after: 2 weeks
* Fix some modules to export more used symbolsKonstantin Belousov2021-11-181-0/+2
| | | | | | | | | and remove non-present symbols that are now reported by kmod_syms.awk. Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32878
* linux: mv sys/i386/linux/linux_ptrace{,_machdep}.cEdward Tomasz Napierala2021-11-031-2/+2
| | | | | | | | | In preparation for machine-independent sys/compat/linux/linux_ptrace.c, rename the i386-specific Linux ptrace(2) implementation. No functional changes. Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D32757
* Revert "linux32: add a hack to avoid redefining the type of the savefpu tag"Konstantin Belousov2021-09-221-1/+1
| | | | | | | | | | | | | | | | This reverts commit 0f6829488ef32142b9ea1c0806fb5ecfe0872c02. Also it changes the type of md_usr_fpu_save struct mdthread member to void *, which is what uncovered this trouble. Now the save area is untyped, but since it is hidden behind accessors, it is not too significant. Since apparently there are consumers affected outside the tree, this hack is better than one from the reverted revision. PR: 258678 Reported by: cy Reviewed by: cy, kevans, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32060
* linux32: add a hack to avoid redefining the type of the savefpu tagKonstantin Belousov2021-09-211-1/+1
| | | | | | | | | | | when compiling in amd64 kernel environment with -m32. This is a temporal workaround for some future proper (but unclear) fix. Reviewed by: jhb, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31954
* linux(4): Fix amd64 gcc build.Dmitry Chagin2021-07-261-3/+5
| | | | | | | | Do not specify memory model and mregparm for amd64, it's only available on IA-32 architecture. Reported by: jhb, jrtc27 MFC after: 2 weeks
* linux(4): Fix i386 gcc build.Dmitry Chagin2021-07-261-3/+3
| | | | | | | | Do not specify memory model for i386. Seems that clang silencly ignores -mcmodel unlike gcc. Reported by: jhb MFC after: 2 weeks
* linux(4); Almost complete the vDSO.Dmitry Chagin2021-07-201-20/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vDSO (virtual dynamic shared object) is a small shared library that the kernel maps R/O into the address space of all Linux processes on image activation. The vDSO is a fully formed ELF image, shared by all processes with the same ABI, has no process private data. The primary purpose of the vDSO: - non-executable stack, signal trampolines not copied to the stack; - signal trampolines unwind, mandatory for the NPTL; - to avoid contex-switch overhead frequently used system calls can be implemented in the vDSO: for now gettimeofday, clock_gettime. The first two have been implemented, so add the implementation of system calls. System calls implemenation based on a native timekeeping code with some limitations: - ifunc can't be used, as vDSO r/o mapped to the process VA and rtld can't relocate symbols; - reading HPET memory is not implemented for now (TODO). In case on any error vDSO system calls fallback to the kernel system calls. For unimplemented vDSO system calls added prototypes which call corresponding kernel system call. Tested by: trasz (arm64) Differential revision: https://reviews.freebsd.org/D30900 MFC after: 2 weeks
* linux(4): implement coredump supportEdward Tomasz Napierala2021-06-301-0/+1
| | | | | | | | | | | Implement dumping core for Linux binaries on amd64, for both 32- and 64-bit executables. Some bits are still missing. This is based on a prototype by chuck@. Reviewed By: kib Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D30019
* Fix i386 linux module after r367395.Tijl Coosemans2020-12-051-2/+2
| | | | | | | | | | | | | In r367395 parts of machine dependent linux_dummy.c were moved to a new machine independent file sys/compat/linux/linux_dummy.c and the existing linux_dummy.c was renamed to linux_dummy_machdep.c. Add linux_dummy_machdep.c to the linux module for i386. Rename sys/amd64/linux32/linux_dummy.c for consistency. Add the new linux_dummy.c to the linux module for i386. Notes: svn path=/head/; revision=368372
* linux(4): Deduplicate unimpl/dummy syscall handlersConrad Meyer2020-11-051-0/+6
| | | | | | | | | | No functional change. Reviewed by: emaste, trasz Differential Revision: https://reviews.freebsd.org/D27099 Notes: svn path=/head/; revision=367395
* Pass -fuse-ld=/path/to/ld if ${LD} != "ld"Alex Richardson2020-08-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed so that setting LD/XLD is not ignored when linking with $CC instead of directly using $LD. Currently only clang accepts an absolute path for -fuse-ld= (Clang 12+ will add a new --ld-path flag), so we now warn when building with GCC and $LD != "ld" since that might result in the wrong linker being used. We have been setting XLD=/path/to/cheri/ld.lld in CheriBSD for a long time and used a similar version of this patch to avoid linking with /usr/bin/ld. This change is also required when building FreeBSD on an Ubuntu with Clang: In that case we set XCC=/usr/lib/llvm-10/bin/clang and since /usr/lib/llvm-10/bin/ does not contain a "ld" binary the build fails with `clang: error: unable to execute command: Executable "ld" doesn't exist!` unless we pass -fuse-ld=/usr/lib/llvm-10/bin/ld.lld. This change passes -fuse-ld instead of copying ${XLD} to WOLRDTMP/bin/ld since then we would have to ensure that this file does not exist while building the bootstrap tools. The cross-linker might not be compatible with the host linker (e.g. when building on macos: host-linker= Mach-O /usr/bin/ld, cross-linker=LLVM ld.lld). Reviewed By: brooks, emaste Differential Revision: https://reviews.freebsd.org/D26055 Notes: svn path=/head/; revision=364761
* Allow overriding the tool used for stripping binariesAlex Richardson2020-08-111-2/+2
| | | | | | | | | | | | | | | | | | | Since the make variable STRIP is already used for other purposes, this uses STRIPBIN (which is also used for the same purpose by install(1). This allows using LLVM objcopy to strip binaries instead of the in-tree elftoolchain objcopy. We make use of this in CheriBSD since passing binaries generated by our toolchain to elftoolchain strip sometimes results in assertion failures. This allows working around https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248516 by specifying STRIPBIN=/path/to/llvm-strip Obtained from: CheriBSD Reviewed By: emaste, brooks Differential Revision: https://reviews.freebsd.org/D25988 Notes: svn path=/head/; revision=364119
* More fixes to build the kernel with a compiler that defaults to -fno-commonAlex Richardson2020-04-181-1/+1
| | | | | | | | | Using the same approach as the last commit for the files used by genassym.sh. Obtained from: CheriBSD Notes: svn path=/head/; revision=360072
* Replace -Werror with ${WERROR} in module buildsWarner Losh2019-08-251-1/+1
| | | | Notes: svn path=/head/; revision=351497
* Add warning to the Linuxulator makefiles that building it outside of aDmitry Chagin2019-05-131-0/+4
| | | | | | | | | | | kernel does not make sence. PR: 222861 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20179 Notes: svn path=/head/; revision=347540
* Linuxulator depends on a fundamental kernel settings such as SMP. ManyDmitry Chagin2019-05-131-9/+0
| | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=347538
* The build process generates assym.inc from genassym.o, so don't forgetDmitry Chagin2019-05-061-1/+2
| | | | | | | | | to clean genassym.o MFC after: 2 weeks Notes: svn path=/head/; revision=347196
* All genassym.sh usage need offset.incBryan Drewery2018-07-031-1/+1
| | | | Notes: svn path=/head/; revision=335910
* Fix futexes on i386 after the 4/4G split.Konstantin Belousov2018-04-241-3/+7
| | | | | | | | | | | Use proper method to access userspace. For now, only the slow copyout path is implemented. Reported and tested by: tijl (previous version) Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=332930
* Move most of the contents of opt_compat.h to opt_global.h.Brooks Davis2018-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | opt_compat.h is mentioned in nearly 180 files. In-progress network driver compabibility improvements may add over 100 more so this is closer to "just about everywhere" than "only some files" per the guidance in sys/conf/options. Keep COMPAT_LINUX32 in opt_compat.h as it is confined to a subset of sys/compat/linux/*.c. A fake _COMPAT_LINUX option ensure opt_compat.h is created on all architectures. Move COMPAT_LINUXKPI to opt_dontuse.h as it is only used to control the set of compiled files. Reviewed by: kib, cem, jhb, jtl Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14941 Notes: svn path=/head/; revision=332122
* Rename assym.s to assym.incEd Maste2018-03-201-4/+4
| | | | | | | | | | | | assym is only to be included by other .s files, and should never actually be assembled by itself. Reviewed by: imp, bdrewery (earlier) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D14180 Notes: svn path=/head/; revision=331254
* Share a single bsd-linux errno table across MD consumersEd Maste2018-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | Three copies of the linuxulator linux_sysvec.c contained identical BSD to Linux errno translation tables, and future work to support other architectures will also use the same table. Move the table to a common file to be used by all. Make it 'const int' to place it in .rodata. (Some existing Linux architectures use MD errno values, but x86 and Arm share the generic set.) This change should introduce no functional change; a followup will add missing errno values. MFC after: 3 weeks Sponsored by: Turing Robotic Industries Inc. Differential Revision: https://reviews.freebsd.org/D14665 Notes: svn path=/head/; revision=331056
* Move assym.s to DPSRCS in linux modulesEd Maste2018-02-051-2/+2
| | | | | | | | | | assym.s exists only to be included by other .s files, and should not actually be assembled by itself. Sponsored by: Turing Robotic Industries Inc. Notes: svn path=/head/; revision=328883