aboutsummaryrefslogtreecommitdiff
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* linux(4): Factor out the futex_wait() op into linux_futex_wait().Dmitry Chagin2021-07-201-24/+12
| | | | MFC after: 2 weeks
* linux(4): Prevent an endless loop.Dmitry Chagin2021-07-201-0/+2
| | | | | | | | | In the futex_atomic_op() the encoded_op is a user-supplied parameter. If the user specifies an incorrect value for this parameter paired with a valid *uaddr parameter the caller will go into the endless loop. To prevent this check futex_atomic_op() result and break the loop in case of ENOSYS. MFC after: 2 weeks
* linux(4): Eliminate bogus comment.Dmitry Chagin2021-07-201-4/+0
| | | | | | | | For the caller is no need for access checking here, as the caller must take care of EFAULT handling. Moreover, this check would be superfluous, since EFAULT is extremily rare, and we prefer the fast path. MFC after: 2 weeks
* linux(4): Allow musl brand to use FUTEX_REQUEUE op.Dmitry Chagin2021-07-205-20/+43
| | | | | | | | | Initial patch from submitter was adapted by me to prevent unconditional FUTEX_REQUEUE use. PR: 255947 Submitted by: Philippe Michaud-Boudreault Differential Revision: https://reviews.freebsd.org/D30332
* linux(4): Factor out the FUTEX_WAKE_OP op into linux_futex_wakeop().Dmitry Chagin2021-07-201-64/+66
| | | | MFC after: 2 weeks
* linux(4): Factor out the FUTEX_CMP_REQUEUE op into linux_futex_requeue().Dmitry Chagin2021-07-201-68/+80
| | | | MFC after: 2 weeks
* linux(4): Factor out the FUTEX_WAKE op into linux_futex_wake().Dmitry Chagin2021-07-201-12/+22
| | | | MFC after: 2 weeks
* linux(4): Factor out the FUTEX_WAIT op into linux_futex_wait().Dmitry Chagin2021-07-201-43/+51
| | | | MFC after: 2 weeks
* linux(4): Refactor the struct linux_futex_args.Dmitry Chagin2021-07-201-13/+18
| | | | | | | Move flags and rtclock to the struct linux_futex_args. This will be used when I split linux_futex() into separate futex op functions. MFC after: 2 weeks
* Split out the arm64 ID field comparison functionAndrew Turner2021-07-191-16/+32
| | | | | | | This will be useful in an update for finding which HWCAPS to set. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31200
* Start to clean up arm64 address space selectionAndrew Turner2021-07-194-25/+76
| | | | | | | | | | | | | | On arm64 we should use bit 55 of the address to decide if aan address is a user or kernel address. Add a new macro with this check and a second to ensure the address is in teh canonical form, i.e. the top bits are all zero or all one. This will help with supporting future cpu features, including Top Byte Ignore, Pointer Authentication, and Memory Tagging. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31179
* Implement unprivileged chrootEdward Tomasz Napierala2021-07-201-2/+15
| | | | | | | | | | | | | | | This builds on recently introduced NO_NEW_PRIVS flag to implement unprivileged chroot, enabled by `security.bsd.unprivileged_chroot`. It allows non-root processes to chroot(2), provided they have the NO_NEW_PRIVS flag set. The chroot(8) utility gets a new flag, -n, which sets NO_NEW_PRIVS before chrooting. Reviewed By: kib Sponsored By: EPSRC Relnotes: yes Differential Revision: https://reviews.freebsd.org/D30130
* pf: syncookie ioctl interfaceKristof Provost2021-07-203-1/+103
| | | | | | | | | Kernel side implementation to allow switching between on and off modes, and allow this configuration to be retrieved. MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31139
* pf: syncookie supportKristof Provost2021-07-208-32/+492
| | | | | | | | | | | | | | | | Import OpenBSD's syncookie support for pf. This feature help pf resist TCP SYN floods by only creating states once the remote host completes the TCP handshake rather than when the initial SYN packet is received. This is accomplished by using the initial sequence numbers to encode a cookie (hence the name) in the SYN+ACK response and verifying this on receipt of the client ACK. Reviewed by: kbowling Obtained from: OpenBSD MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31138
* pf: factor out pf_synproxy()Kristof Provost2021-07-201-36/+49
| | | | | | MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31137
* cxgbe(4): Initialize abs_id for ctrl and ofld queues.Navdeep Parhar2021-07-201-0/+2
| | | | | MFC after: 1 week Sponsored by: Chelsio Communications
* e1000: Add missing branch predictionKevin Bowling2021-07-201-1/+1
| | | | | | | | I missed this edit from the ixgbe review (D30074) Reviewed by: gallatin MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30073
* e1000: Clean up igb_txrxKevin Bowling2021-07-201-59/+58
| | | | | | | | | | | The intention here is to reduce differences between em, igb, igc, ixgbe. The main functional change is logical simplification in igb_rx_checksum and getting interface caps from scctx instead of the ifp. Reviewed by: gallatin, markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30073
* Drop rdivacky@ "All rights reserved" from linux_event.Dmitry Chagin2021-07-202-2/+0
| | | | | | | | I got explicit permission from Roman. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D30913 MFC after: 2 weeks
* Drop "All rights reserved" from my copyright statements.Dmitry Chagin2021-07-2019-27/+19
| | | | | | | | Add email and fixup years while here. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D30912 MFC after: 2 weeks
* linux(4): Add arch name to the some printfs.Dmitry Chagin2021-07-203-8/+8
| | | | | | Reviewed by: emaste Differential revision: https://reviews.freebsd.org/D30904 MFC after: 2 weeks
* linprocfs: Fixup vDSO name in the procmaps after 9931033bbf.Dmitry Chagin2021-07-201-1/+7
| | | | | | | | | | | | | As the sv_shared_page_base now pointed out to the native sharedpage and the process VA layout has changed as follows: VDSOPAGE (2 * PAGE_SIZE) SHAREDPAGE (PAGE_SIZE) USRSTACK fixup the vDSO name by calculating the start of page relative to the native sharedpage. Differential revision: https://reviews.freebsd.org/D30903 MFC after: 2 weeks
* linux(4): Fixup the vDSO initialization order.Dmitry Chagin2021-07-204-8/+29
| | | | | | | | | | | | | | | | The vDSO initialisation order should be as follows: - native abi init via exec_sysvec_init(); - vDSO symbols queued to the linux_vdso_syms list; - linux_vdso_install(); - linux_exec_sysvec_init(); As the exec_sysvec_init() called with SI_ORDER_ANY (last) at SI_SUB_EXEC order, move linux_vdso_install() and linux_exec_sysvec_init() to the SI_SUB_EXEC+1 order. Reviewed by: trasz Differential Revision: https://reviews.freebsd.org/D30902 MFC after 2 weeks
* linux(4): Constify vdso install/deinstall.Dmitry Chagin2021-07-203-12/+12
| | | | | | | | | In order to reduce diff between arches constify vdso install/deinstall functions like arm64. Reviewed by: emaste Differential revision: https://reviews.freebsd.org/D30901 MFC after: 2 weeks
* linux(4); Almost complete the vDSO.Dmitry Chagin2021-07-2023-325/+1952
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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): Modify sv_onexec hook to return an error.Dmitry Chagin2021-07-206-9/+47
| | | | | | | | Temporary add stubs to the Linux emulation layer which calls the existing hook. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D30911 MFC after: 2 weeks
* Call sv_onexec hook after the process VA is created.Dmitry Chagin2021-07-201-2/+2
| | | | | | | | | | For future use in the Linux emulation layer call sv_onexec hook right after the new process address space is created. It's safe, as sv_onexec used only by Linux abi and linux_on_exec() does not depend on a state of process VA. Reviewed by: kib Differential revision: https://reviews.freebsd.org/D30899 MFC after: 2 weeks
* Remove bogus cast from exec_sysvec_init().Dmitry Chagin2021-07-201-1/+1
| | | | | | Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D30910 MFC after: 2 weeks
* Modify exec_sysvec_init() to allow non-native abi to setup their sysentvecs.Dmitry Chagin2021-07-201-13/+30
| | | | | | | | | For future use in the Linux emulation layer modify the exec_sysvec_init() to allow non-native abi to fill sv_timekeep_base and sv_shared_page_obj. Reviewed by: kib Differential revision: https://reviews.freebsd.org/D30898 MFC after: 2 weeks
* linux(4): Remove function prototypes from the vDSO.Dmitry Chagin2021-07-202-43/+0
| | | | | | | | | | In preparation for vDSO code revision get rid of incomplete vDSO methods from locore, but leave .note.Linux section commented out. .note.Linux section is used by glibc rtld to get the kernel version, that saves one system call call. I'll try to implement it later, if figure out how to use it with jails. MFC after: 2 weeks
* elf: Remove R_RISCV_[GT]PREL_[IS] relocation definesJessica Clarke2021-07-201-4/+0
| | | | | | | | | These were internal binutils relocations that have no way to be generated in assembly nor will ever be seen in the output, and so should never have been defined in the psABI in the first place. They have therefore been removed from the spec as of [1], so do so here too. [1] https://github.com/riscv/riscv-elf-psabi-doc/commit/44f98e0fd8104def00f2a5a8d94b23dd647d18fb
* nfscl: Send stateid.seqid of 0 for NFSv4.1/4.2 mountsRick Macklem2021-07-201-4/+13
| | | | | | | | | | | | | | | | | | | | For NFSv4.1/4.2, the client may set the "seqid" field of the stateid to 0 in RPC requests. This indicates to the server that it should not check the "seqid" or return NFSERR_OLDSTATEID if the "seqid" value is not up to date w.r.t. Open/Lock operations on the stateid. This "seqid" is incremented by the NFSv4 server for each Open/OpenDowngrade/Lock/Locku operation done on the stateid. Since a failure return of NFSERR_OLDSTATEID is of no use to the client for I/O operations, it makes sense to set "seqid" to 0 for the stateid argument for I/O operations. This avoids server failure replies of NFSERR_OLDSTATEID, although I am not aware of any case where this failure occurs. This makes the FreeBSD NFSv4.1/4.2 client compatible with the Linux NFSv4.1/4.2 client. MFC after: 2 weeks
* cxgbei: Don't assert F for data completion PDUs.John Baldwin2021-07-191-3/+0
| | | | | | | | If a data PDU encounters an error such as a digest error, the firmware will report that data PDU when completion moderation is active even if it is not the final data PDU in a burst. Sponsored by: Chelsio Communications
* cxgbei: Remove invalid assertion.John Baldwin2021-07-191-1/+0
| | | | | | | | | A non-placed PDU can be delivered by CPL_RX_ISCSI_CMP in the middle of a burst of placed PDUs (received via DDP) in which case the rcv_nxt will not match the start of the non-placed PDU. Reported by: Jithesh Arakkan @ Chelsio Sponsored by: Chelsio Communications
* tcp: fix RACK and BBR when using VIMAGE enabled kernelMichael Tuexen2021-07-191-2/+4
| | | | | | | | | Fix a bug in VNET handling, which occurs when using specific NICs. PR: 257195 Reviewed by: rrs MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D31212
* zfs: Remove zfs-images submoduleEd Maste2021-07-192-3/+0
| | | | | | | This can cause issues like 'No url found for submodule path' in downstream or derived projects making use of submodules. Reviewed by: imp
* acpi: Fix a repeated comment typoJessica Clarke2021-07-193-3/+3
|
* acpi: Fix a repeated vm_offset_t that should be a vm_size_tJessica Clarke2021-07-193-3/+3
| | | | | | The underlying types for both are the same so arguably this doesn't really matter, but using the wrong type is still confusing and technically incorrect.
* arm64: std.allwinner: Add aw_sysconEmmanuel Vadot2021-07-191-0/+3
| | | | | | This was missed during the conversion of kernel configs PR: 257278 Reported by: Manuel Stühn <freebsd@justmail.de>
* pf: shrink struct pf_kstateMateusz Guzik2021-07-191-7/+4
| | | | | | | Makes room for a pointer. Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate")
* pf: add a comment to pf_kstate concerning compat with pf_state_cmpMateusz Guzik2021-07-191-0/+6
| | | | | Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate")
* pf: add a branch prediction to expire state check in pf_find_stateMateusz Guzik2021-07-191-1/+1
| | | | | Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate")
* arm: dedup counter(9) address calculationMateusz Guzik2021-07-191-4/+2
| | | | Sponsored by: Rubicon Communications, LLC ("Netgate")
* arm: retire bcopyMateusz Guzik2021-07-191-8/+2
| | | | | | | | It is obsolete since ba96f37758412151 ("Use __builtin for various mem* and b* (e.g. bzero) routines.") Discussed with: cognet Sponsored by: Rubicon Communications, LLC ("Netgate")
* arm: bcmp -> memcmpMateusz Guzik2021-07-192-3/+2
| | | | | | | | | | | The bcmp symbol is not used, at the same time memcmp as pulled from libkern does byte-by-byte comparison. So happens bcmp as found in support.S is in fact renamed memcmp, rename it back. Discussed with: cognet Sponsored by: Rubicon Communications, LLC ("Netgate")
* kenv: allow listing of static kernel environmentsKyle Evans2021-07-192-47/+92
| | | | | | | | | | The early environment is typically cleared, so these new options need the PRESERVE_EARLY_KENV kernel config(8) option. These environments are reported as missing by kenv(1) if the option is not present in the running kernel. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D30835
* kern: add an option for preserving the early kenvKyle Evans2021-07-192-0/+12
| | | | | | | | | Some downstream configurations do not store secrets in the early (loader/static) environments and desire a way to preserve these for diagnostic reasons. Provide an option to do so. Reviewed by: imp, jhb (earlier version) Differential Revision: https://reviews.freebsd.org/D30834
* arm64: std.allwinner: Fix mismergeEmmanuel Vadot2021-07-181-1/+1
| | | | Re-add aw_r_intc and remove duplicate a10_codec
* arm64: Add per SoC family kernel configEmmanuel Vadot2021-07-1835-375/+1133
| | | | | | | | | | | | | | | | | | | There is multiple reason for this : - This makes it easier to see which driver is needed for each SoC - This makes it easier to create a custom config for one SoC - This really reduce boot time (which some people might want) Some explaination about the files : - std.arm64 contains all standard kernel option - std.dev contains all the standard kernel devices - std.<soc> contains all drivers needed to boot on this SoC family - <SOC> includes std.arm64, std.dev and std.<soc> - GENERIC includes std.arm64, std.dev and all std.<soc> Sponsored by: Diablotin Systems MFC After: 2 months Reviewed by: mmel, cognet, imp Differential Revision: https://reviews.freebsd.org/D30474
* arm: TI AM335x fix gpio_pin numbers in lookup table.Oskar Holmlund2021-07-181-13/+13
| | | | | | | | | | | gpio_pin are calculated as [GPIO_BANK]*32 + GPIO_PIN. gpio_pin are wrong for these pins. As a consequence wrong pins are acquired and used. Approved by: manu (mentor) Reported by: Martin Zakardissnehf (martin.zakardissnehf@se.abb.com) Differential revision: https://reviews.freebsd.org/D31164