aboutsummaryrefslogtreecommitdiff
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* riscv: improve KTR_TRAP trace entriesMitchell Horne2023-06-202-4/+7
| | | | | | | | | | | | | | For more informative records of exceptions, include key details such as the exception code and stval register contents. Remove the curthread argument as it is redundant (saved with every ktr entry), and the trapframe as it is somewhat meaningless. Add a new KTR_TRAP trace record for interrupts. Reviewed by: markj, jhb MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40584
* ossl: Don't try to initialize the cipher for Chacha20+Poly1305.John Baldwin2023-06-201-1/+2
| | | | | | | | | | | | Chacha20+Poly1305 doesn't use an ossl_cipher instance the way AES-GCM does, so ossl_lookup_cipher() failed causing ossl_newsession() to always fail for Chacha20+Poly1305 sessions. Reported by: gallatin (ktls_test fails with ossl.ko loaded) Fixes: 9a3444d91c70 ossl: Add a VAES-based AES-GCM implementation for amd64 Tested by: gallatin Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D40580
* pf: Add code to enable filtering for locally delivered packetsDoug Rabson2023-06-201-0/+20
| | | | | | | | | | | | | | This is disabled by default since it potentially changes the behavior of existing filter rule sets. To enable this extra filter for packets being delivered locally, use: sysctl net.pf.filter_local=1 service pf restart PR: 268717 Reviewed-by: kp MFC-after: 2 weeks Differential Revision: https://reviews.freebsd.org/D40373
* pf: fix build without VIMAGEKristof Provost2023-06-201-4/+4
| | | | | | | | | | | Remove the name conflict between the pfsync_defer_tmo variable and function. This worked fine in kernels with VIMAGE (the default), but not in those without. Reported by: des@ Sponsored by: Rubicon Communications, LLC ("Netgate")
* tarfs: Don't use IO_DIRECT when reading from tarball.Dag-Erling Smørgrav2023-06-201-4/+2
| | | | | | | Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D40612
* pf: allow defer timeout to be configuredKristof Provost2023-06-201-2/+8
| | | | | | | | | | | Add the net.pfsync.defer_delay sysctl to allow the defer timeout (i.e. how long pf holds onto packets waiting for the peer to ack the new state) to be changed. This is intended to make testing of the defer code more robust, by allowing longer timeouts to mitigate scheduling/measurement jitter. Sponsored by: Rubicon Communications, LLC ("Netgate")
* cam: Remove duplicate definition for READ_DEFECT_DATA_10Warner Losh2023-06-191-1/+0
| | | | | | | | | | This isn't needed by all devices and is only used by the da device (in camcontrol). All the other da specific da scsi opcodes are only in scsi_da.h. Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D40527
* x86: Add defines for a couple of thermal and PM bitsMark Johnston2023-06-191-0/+2
| | | | | MFC after: 1 week Sponsored by: The FreeBSD Foundation
* mpi3mr: fix GCC kernel buildEd Maste2023-06-192-1/+2
| | | | | | | | | | Previously every file that included mpi3mr_app.h but did not use mpi3mr_mgmt_info reported error: 'mpi3mr_mgmt_info' defined but not used. Fixes: 2d1d418e1e7b ("mpi3mr: 3rd Generation Tri-Mode NVMe/SAS/SATA...") Reported by: amd64-gcc12 Cirrus-CI job Sponsored by: The FreeBSD Foundation
* pcib: Allocate the memory BAR with the MSI-X table.John Baldwin2023-06-192-5/+19
| | | | | | | | | | This is required for pci_alloc_msix() to work and to thus use MSI-X interrupts for PCI-e hotplug. Reported by: cperciva Reviewed by: cperciva MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D40581
* pf: Fix usage of pf tags with syncookiesKajetan Staszkiewicz2023-06-196-62/+66
| | | | | | | | | | | | | | | | | | | | | The value stored in pf_mtag->tag comes from "tag" and "match tag" keywords in pf.conf and must not be abused for storing other information. A ruleset with enough tags could set or remove the bits responsible for PF_TAG_SYNCOOKIE_RECREATED. Move this syncookie status to pf_mtag->flags. Rename this and other related constants in a way that will prevent such mistakes in the future. Move PF_REASSEMBLED constant to mbuf.h and rename accordingly because it's not a flag stored in pf_mtag, but an identifier of a different m_tag. Change the value of the constant to avoid conflicts with other m_tags using MTAG_ABI_COMPAT. Rename the variables in pf_build_tcp() and pf_send_tcp() in to reduce confusion. Reviewed by: kp Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D40587
* pf: extend use of skip steps for Ethernet rulesKristof Provost2023-06-193-7/+15
| | | | | | | | | | | Use the already populated PFE_SKIP_DST_ADDR and extend the skip infrastructure to also skip on IP source/destination addresses. This should make evaluating the rules slightly faster. Reported by: R. Christian McDonald <rcm@rcm.sh> Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D40567
* mlx4en(4): add missing newline to debug messagesKevin Lo2023-06-181-2/+2
| | | | | | | | Add newline to debug messages after dumping uar_page_shift and reserved_uars. Reviewed by: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D40582
* amdtemp: Fix missing 49 degree offset on current EPYC CPUsVal Packett2023-06-171-1/+8
| | | | | | | | | | | | On an EPYC 7313P, the temperature reported by amdtemp was off, because the offset was not applied. Turns out it needs to be applied with one more condition: https://lkml.org/lkml/2023/4/13/1095 Reviewed by: mhorne Tested by: mike.jakubik@gmail.com MFC after: 1 week Sponsored by: https://www.patreon.com/valpackett Pull Request: https://github.com/freebsd/freebsd-src/pull/754
* arm64/disassem.c: Add shifted register definitions with rorMykola Hohsadze2023-06-171-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | Add disassembly support for the following shifted register instructions: * mvn * orn * orr * and * ands * bic * bics * eon * eor * tst According to Arm64 documenation, operational pseuducode of shifted register instruction must return `UNDEFINED` if shift type is `RESERVED` ('11'). Hence, removed "rsv" from `shift_2` array and add "ror". In case of shift type is 3 and this type is `RESERVED`, we will return `undefined`. Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D40386
* hifn(4): Fix a typo in a source code commentGordon Bergling2023-06-171-1/+1
| | | | | | - s/regesters/registers/ MFC after: 3 days
* zfs: merge openzfs/zfs@10e36e176Martin Matuska2023-06-1617-253/+154
| | | | | | | | | | | Notable upstream pull request merges: #14948 Remove ARC/ZIO physdone callbacks #14963 Store the L2ARC device ashift in the vdev label #14970 Switch refcount tracking from lists to AVL-trees #14981 Shorten arcstat_quiescence sleep time Obtained from: OpenZFS OpenZFS commit: 10e36e17612ba9c634b140ae76847bb62b5be68f
* hwpmc(4): document debugging optionsMitchell Horne2023-06-161-1/+5
| | | | | | | | | | | | The debug options for hwpmc are not documented in detail anywhere, and setting it up was error-prone the first time I had to figure it out (and each time I've had to remember it). Add some explanation of the required options and describe the kern.hwpmc.debugflags sysctl format. Reviewed by: emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40545
* hwpmc: add error for HWPMC_DEBUG without KTRMitchell Horne2023-06-161-0/+6
| | | | | | | | | | The option is a no-op otherwise, but this is not necessarily obvious. Failing the compile gives the user a hint. Reviewed by: jkoshy, emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40544
* netlink: convert to IfAPI.Alexander V. Chernikov2023-06-167-80/+154
| | | | | | | Convert to IfAPI everything except `IF_AFDATA_WLOCK` usage in neigh.c. Reviewed By: jhibbits Differential Revision: https://reviews.freebsd.org/D40577
* ifnet: fix if_strings.h build checkAlexander V. Chernikov2023-06-161-0/+3
|
* netlink: dump interface capabilities with other interface data.Alexander V. Chernikov2023-06-169-69/+361
| | | | | | | | | | | | | | | | This change exports interface capabilities using the standard Netlink attribute type, bitset, and switches `ifconfig(8)` to use it when displaying interface data. Bitset comes in two representations. The first one is "compact", where the bits are exported via two arrays - "mask" listing the "valid" bits and "values, providing the values for those bits. The second one is more verbose, listing each bit as a separate item, with its name, id and value. The latter option is handy when submitting update requests. The support for setting capabilities will be added in the upcoming diffs. Differential Revision: https://reviews.freebsd.org/D40331
* vm_phys: Fix typo in 9e8174289236Alan Cox2023-06-161-1/+1
|
* vm_phys: add binary segment searchDoug Moore2023-06-165-71/+84
| | | | | | | | | | | Replace several sequential searches for a segment that contains a phyiscal address with a call to a function that does it by binary search. In vm_page_reclaim_contig_domain_ext, find the first segment to reclaim from, and reclaim from each subsequent appropriate segment. Eliminate vm_phys_scan_contig. Reviewed by: alc, markj Differential Revision: https://reviews.freebsd.org/D40058
* arm64: Make a debug print conditional on bootverboseMark Johnston2023-06-151-1/+4
| | | | | | | | | It doesn't seem particularly useful to have it enabled by default, and it spits several dozen lines into the dmesg on a test system. Reviewed by: andrew MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D40499
* dtrace/arm64: Fix user memory access routinesMark Johnston2023-06-151-7/+9
| | | | | | | | | | Use unprivileged loads to access user memory. Without this, the accesses trap and various dtrace actions such as ustack() fail. Reviewed by: andrew MFC after: 1 week Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D40540
* dtrace/arm64: Store the fault address when suppressing a page faultMark Johnston2023-06-151-1/+1
| | | | | | Reviewed by: andrew Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D40539
* arm64: Remove struct arm64_frameMark Johnston2023-06-152-6/+1
| | | | | | | | | | | It was used in one place and was added specifically to support dtrace stack unwinding code. Write an equivalent expression using struct unwind_state instead. No functional change intended. Reviewed by: andrew MFC after: 1 week Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D40538
* armv8crypto: Avoid overriding -march when compiling some source filesMark Johnston2023-06-151-3/+3
| | | | | | | | | | | | | At least one downstream (CheriBSD) overrides -march here. Instead of hard-coding the target, simply append the crypto extension to whatever's already there. No functional change intended. Reviewed by: imp, andrew MFC after: 1 week Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D40537
* oce(4): deprecateBrooks Davis2023-06-151-0/+2
| | | | | | | | | | The Emulex OneConnect NIC driver hasn't seen any commits other than ioctl bug fixes (some severe) and sweeping commits since 2016. There is no indication of new parts since 2014 or earlier. As such, deprecate the driver with the aim of removing it prior to FreeBSD 15. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D40531
* oce(4): Don't directly access usespaceBrooks Davis2023-06-151-5/+12
| | | | | | | | | | Replace direct stores to userspace addresses (never safe and broken on modern CPUs) with a copyout. Use a static assert on the size to ensure we don't overflow the field. Reviewed by: markj, jhb Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D40519
* mpi3mr: 3rd Generation Tri-Mode NVMe/SAS/SATA MegaRaid / eHBASumit Saxena2023-06-1521-0/+20817
| | | | | | | | | | | | | | | | | | This is Broadcom's mpi3mr driver for FreeBSD version 8.6.0.2.0. The mpi3mr driver supports Broadcom SAS4116-based cards in the 9600 series: 9670W-16i, 9670-24i, 9660-16i, 9620-16i, 9600-24i, 9600-16i, 9600W-16e, 9600-16e, 9600-8i8e. Initially only available as a module and on amd64/arm64, since that's how it has been tested to date. Future commits will add it to the kernel build and may expand the architectures it is supported on. Co-authored-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com> Feedback-by: ken (prior versions) Reviewed-by: imp RelNotes: yes Differential-Revision: https://reviews.freebsd.org/D36771 Differential-Revision: https://reviews.freebsd.org/D36772
* tcp: add missing static keywordsGleb Smirnoff2023-06-142-3/+3
| | | | | Without them compilation with -O0 would produce kernel modules that depend on symbol that doesn't exist.
* hwpmc: flatten conditional in pmc_process_exit()Mitchell Horne2023-06-141-99/+88
| | | | | | | | | | | | Use a goto to clarify the control flow when there is no process descriptor. This wins back a level of indentation. No functional change intended. Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40518
* hwpmc: split out PMC_OP_PMCRWMitchell Horne2023-06-141-115/+114
| | | | | | | | | | | | Split out the functional logic from the syscall handler into a helper function. This keeps it separate from the syscall control-flow logic, resulting in better readability overall. It also wins back a level of indentation. Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40294
* hwpmc: split out PMC_OP_PMCRELEASEMitchell Horne2023-06-141-28/+38
| | | | | | | | | | | | Split out the functional logic from the syscall handler into a helper function. This keeps it separate from the syscall control-flow logic, resulting in better readability overall. It also wins back a level of indentation. Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40293
* hwpmc: split out PMC_OP_PMCALLOCATEMitchell Horne2023-06-141-265/+256
| | | | | | | | | | | | | | | | | | | | Split out the large chunk of functional logic from the syscall handler into a helper function. This keeps it separate from the syscall control-flow logic, resulting in better readability overall. It also wins back a level of indentation. Flip the return values of the pmc_can_allocate_row() and pmc_can_allocate_rowindex() functions to boolean types, like their naming implies. We weren't actually using the error codes they were returning. While here, make some small style cleanups. No functional change intended. Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40292
* hwpmc: split out PMC_OP_PMCATTACH/PMC_OP_PMCDETACHMitchell Horne2023-06-141-87/+103
| | | | | | | | | | | | | | | | Begin splitting out the large chunks of functional logic from the syscall handler into separate helper functions. This keeps it separate from the syscall control-flow logic, resulting in better readability overall. It also wins back a level of indentation. For this and the similar changes to follow, try to keep copyin() and copyout() calls outside of the helper functions. The changes are intended to have no functional impact, but do address style issues. Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40291
* hwpmc: split out PMC_FN_PROCESS_EXECMitchell Horne2023-06-141-112/+120
| | | | | | | | | | | | Move the functionality into a separate helper function. All other actions in pmc_hook_handler() already have this. While here make some small style improvements. Restructure one for loop. Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40333
* hwpmc_mod.c: misc style cleanupMitchell Horne2023-06-141-236/+212
| | | | | | | | | | | | | | | | | | | | Everything else I found worthy of adjustment. - Order local variable declarations per style(9) - Make use of __unused annotations rather than cast to void - Remove unnecessary casts - Add (void) casts to PMC class methods where the return value is ignored - A couple instances of reordering statements for clarity - Prefer bool type where applicable - unsigned int -> u_int - Use uintmax_t/%j in printf calls - Formatting of comments Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40517
* hwpmc_mod.c: prototype styleMitchell Horne2023-06-141-9/+9
| | | | | | | | | Improve alphabetical organization, grouping, and whitespace. Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40516
* hwpmc_mod.c: conditional and loop styleMitchell Horne2023-06-141-160/+187
| | | | | | | | | | | | | - Explicitly check the value in conditional statements, per style(9) - Add braces around more loops and conditionals, wherever it appears (to me) to aid legibility - Expand some assignments within if statements - Fix formatting around list-type FOREACH macros Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40515
* hwpmc_mod.c: whitespace style cleanupMitchell Horne2023-06-141-291/+169
| | | | | | | | | | | | | | | Handle a few things related to spacing: - Remove redundant/superfluous blank lines (and add a couple where helpful) - Add spacing around binary operators - Remove spacing after casts and before goto labels - Adjustments for line width of 80 chars - Tab/space character issues Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40514
* hwpmc_mod.c: return statement styleMitchell Horne2023-06-141-42/+38
| | | | | | | Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40513
* hpwmc: add __pmcdbg_used annotationMitchell Horne2023-06-141-0/+3
| | | | | | | | | For variables which are only used in PMCDBG* macros. Reviewed by: jkoshy, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40288
* dummynet: fix wf2q use-after-freeKristof Provost2023-06-133-16/+18
| | | | | | | | | | | | | | | | | | | | | | When we clean up a wf2q+ queue we need to ensure that we remove it from the correct heap. If we leave a queue pointer behind in an unexpected heap we'll later write to it, causing a use-after-free and unpredictable panics. Teach the dummynet heap code to verify that we're removing the correct object so we can safely attempt to remove objects not contained in the heap. Remove a to-be-removed queue from all heaps. Also don't continue the enqueue function if we're not finding the queue on the idle heap as we'd expect. While here also remove the empty heap warning, because this is now expected to happen. See also: https://redmine.pfsense.org/issues/14433 Sponsored by: Rubicon Communications, LLC ("Netgate")
* dummynet: remove unused field from dn_pkt_tagKristof Provost2023-06-131-1/+0
| | | | | | | ip6opt is never used, so remove it, slightly reducing memory use for each packet tag. Sponsored by: Rubicon Communications, LLC ("Netgate")
* kinst: rename t_kinst to t_kinst_trampChristos Margiolis2023-06-133-10/+11
| | | | | | | | | | | | | The forthcoming RISC-V and ARM64 ports of kinst introduce a new field named "t_kinst_curprobe", so "t_kinst" (which points to a trampoline) becomes a misleading name. No functional change intended. Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40507
* kinst: hide KINST_TRAMPCHUNK_SIZE from ISA-specific headersChristos Margiolis2023-06-132-1/+1
| | | | | | | Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40505
* proc.h: capitalize letter in TD_LOCKS_DECChristos Margiolis2023-06-131-1/+1
| | | | | | | | | | The other related macros capitalize "thread" as well, so use the same style. No functional change intended. Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40506