aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* | powerpc64/pmap: No need to use r0 anymore in tlbieJustin Hibbits3 days1-14/+3
| | | | | | | | | | | | | | | | | | | | | | The only use of `tlbie %rN, 0` is now explicit and covered in the block above. Since there's no need for an explicit `tlbie %rN, 0` now, drop this convoluted piece and let the compiler decide. While here, a trivial optimization of the old-style tlbie block, by clearing tlbie_lock and returning, instead of going to the end which checks again if the lock is needed. Since it's already known to be needed, there's no need to check again.
* | builtin.1: Command list maintenanceAlexander Ziaee3 days2-1/+2
| | | | | | | | | | | | | | + link to return(1) like the other exclusive builtins + fix alphabetical sorting of list in rendered manual MFC after: 3 days
* | tpm20: fix suspend/resume and entropy harvestingKyle Evans3 days4-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were a few problem here: - TPM2_Shutdown results in a response that we need to either process or ignore, otherwise any tpm20_write or tpm20_harvest call will trivially hang on an `sc->pending_data_length != 0` - We should have a matching TPM2_Startup upon resume to restore any state that should have persisted - We must drain the harvest task before we suspend to avoid problems there This commit is sufficient to avoid breaking suspend/resume. PR: 291067 Fixes: a2d5ed9442bb ("Introduce driver for TPM 2.0 in CRB and [...]") Fixes: 4ee7d3b0118c ("Allow using TPM as entropy source.") Co-authored-by: markj (D53835) Tested by: garga Differential Revision: https://reviews.freebsd.org/D55074
* | OptionalObsoleteFiles: Add etc/zfs/compatibility.dArtem Bunichev3 days1-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | If the world is built and installed with WITHOUT_ZFS, then make -DBATCH_DELETE_OLD_FILES delete-old-dirs will give the error: > rmdir: /etc/zfs: Directory not empty because /etc/zfs/compatibility.d is still there. While we're here, clean out /usr/share/zfs as well. Co-authored-by: kevans Differential Revision: https://reviews.freebsd.org/D54758
* | Make message added for Darwin OSI quirk more terseEnji Cooper4 days1-8/+6
| | | | | | | | | | | | | | | | The verbose message was way too verbose. Make it terse. MFC after: 1 week MFC with: 052a791b00 ("acpi: add Darwin OSI quirk for Apple Mac hardware") Requested by: kib
* | ufshci: Remove UIC error during initializationJaeyoon Choi4 days2-35/+23
| | | | | | | | | | | | | | | | | | This patch removes the UIC error caused by QEMU not supporting certain UIC command. Additionally, it removes the unused unipro_version. Reviewed by: imp (mentor) Sponsored by: Samsung Electronics Differential Revision: https://reviews.freebsd.org/D54513
* | bpf: don't clear pointer from descriptor to the tap on descriptor closeGleb Smirnoff4 days1-1/+1
| | | | | | | | | | | | | | | | | | | | During packet processing the descriptor is looked up using epoch(9) and it can be accessed after bpf_detachd(). In scenario of descriptor close the tap point is alive (it actually produces packets) and thus the pointer can be legitimately dereferenced. This fixes a race on a bpf(4) device close that would otherwise result in panic. Differential Revision: https://reviews.freebsd.org/D55064
* | ipfilter: Fix possible overrunCy Schubert4 days1-1/+1
| | | | | | | | | | | | | | | | | | | | | | The destination buffer is FR_GROUPLEN (16 bytes) in length. When gname is created, the userspace utilities correctly use FR_GROUPLEN as the buffer length. The kernel should also limit its copy operation to FR_GROUPLEN bytes to avoid any user written code from exploiting this vulnerability. Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com> MFC after: 1 week
* | stand: Minor style tweaksWarner Losh4 days1-10/+6
| | | | | | | | | | | | | | | | re-wrap the function calls in a couple of ifs in get_zfs_root so they are more readable. They really didn't need to be wrapped like this in the first place. Sponsored by: Netflix
* | ifconfig: fix gre(4) statusPouria Mousavizadeh Tehrani4 days1-2/+2
| | | | | | | | | | | | | | | | | | | | Set `ifr->ifr_name` to display gre options for the interface. Reviewed by: glebius, zlei Approved by: glebius (mentor) MFC after: 1 day Differential Revision: https://reviews.freebsd.org/D55099
* | pmc: Import Intel Granite Rapids eventsBojan Novković4 days16-0/+12550
| | | | | | | | | | | | | | | | Reviewed by: mhorne Sponsored by: Klara, Inc. Obtained from: Intel perfmon (JSON event definitions) Differential Revision: https://reviews.freebsd.org/D55081 MFC after: 2 days
* | sdt: Enable on 32-bit powerpc and powerpc64leMark Johnston4 days3-6/+4
| | | | | | | | | | | | Reviewed by: jhibbits, adrian MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54814
* | Remove additional libtpool and libuutil-related filesEnji Cooper4 days5-11/+9
| | | | | | | | | | | | | | | | This change removes additional library files and tests orphaned in the commit referenced below. MFC with: 8b78d412a Fixes: 8b78d412a ("zfs: world changes after 89f729dcc merge")
* | if_rge: sync with up to date OpenBSD codeBrad Smith4 days5-24/+776
| | | | | | | | | | | | | | | | | | e574c2d36cbcacf2556088879be336775e80154b Add support for RTL8125D revision 0x6890000 Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D54922 MFC after: 2 weeks
* | pf: fix use of uninitialised variableKristof Provost5 days3-26/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In pf_match_rule() we attempt to append matching rules to the end of 'match_rules'. We want to preserve the order to make the multiple pflog entries easier to understand. So we keep track of the last added rule item in 'rt'. However, that assumed that 'match_rules' was only ever added to in that one call to pf_match_rules(). This isn't always the case, for example if we have match rules in different anchors. In that case we'd end up using the uninitialised 'rt' variable in the SLIST_INSERT_AFTER call. Instead track the match rules and the last matching rule (to enable easy appending) in the struct pf_test_ctx. This also allows us to reduce the number of arguments for some functions, because we passed a ctx to most functions that needed 'match_rules'. While here also make pf_match_rules() static, because it's only ever used in pf.c Add a test case to exercise the relevant code path. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate")
* | sysctl(9): Booleans: Fix old value length discoveryOlivier Certner5 days1-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calling sysctl(3) with a null 'oldp', i.e., length discovery mode, 'oldix' can be equal to 'oldlen', and we should not fail. More generally, let SYSCTL_OUT() and SYSCTL_IN() handle corner cases, simply removing the comparisons between 'oldidx' and 'oldlen' and 'newidx' and 'newlen' done by hand as the test just after is an equality that does not require to know if 'idx' is smaller than 'len'. PR: 292917 Reported by: cy Fixes: 406da392ef8d ("sysctl(9): Booleans: Accept integers to ease knob conversion") Sponsored by: The FreeBSD Foundation
* | LinuxKPI: string_choices.h: use ternary operatorBjoern A. Zeeb5 days1-20/+5
| | | | | | | | | | | | | | | | | | | | | | Switch from using if () else to a direct return (?:) code. No functional changes. Suggested by: kib (D55029) Sponosred by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste (before removing more () as suggested by him) Differential Revision: https://reviews.freebsd.org/D55088
* | vmm: Remove an unneeded NULL pointer checkMark Johnston5 days1-2/+1
| | | | | | | | | | | | | | | | | | sc->vm is unconditionally dereferenced earlier in this function. No functional change intended. Reviewed by: bnovkov MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D55069
* | vmm: Fix a resource leak in an error pathMark Johnston5 days1-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | vmmdev_create() increments the VM count as its last step and calls vmmdev_destroy() if it fails. However, vmmdev_destroy() unconditionally decrements the count. Correct this bug by reordering operations. Fixes: 1092ec8b3375 ("kern: Introduce RLIMIT_VMM") Reviewed by: bnovkov Differential Revision: https://reviews.freebsd.org/D55068
* | LinuxKPI: add str_read_write()Bjoern A. Zeeb5 days1-0/+9
| | | | | | | | | | | | | | | | | | Needed by a wireless driver. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: kib, emaste Differential Revision: https://reviews.freebsd.org/D55029
* | nvmecontrol: Pass 1 to uint8_t argWarner Losh5 days1-2/+2
| | | | | | | | | | | | | | | | | | | | | | The rae arg is uint8_t (which we then shift over to the right bit. Pass '1' instead of 'true' here to match the interface. While true is promoted to (uint8_t)1, we don't use it as a bool in read_logpage(). Fixes: 5322eec86ae4 ("nvmecontrol: Always set the RAE bit on telemetry-log requests") Sponsored by: Netflix Reviewed by: chs Differential Revision: https://reviews.freebsd.org/D55060
* | arm64/vmm: Set and use the fine-grained trapsAndrew Turner5 days3-0/+443
| | | | | | | | | | | | | | | | | | | | | | | | | | Set the Fine-grained trap registers to trap any features we don't support. These are expected to be more useful when we support nested virtualisation, so for now just the base features and GICv3 are not trapped. As nested virtualisation will require VHE we only set the fine-grained trap registers when VHE is used. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D54687
* | arm64/vmm: Add HYP_FEAT_FGT{,2}Andrew Turner5 days2-0/+14
| | | | | | | | | | | | | | | | Add the macros and detection for Fine-grained traps (FEAT_FGT and FEAT_FGT2). Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D54686
* | arm64: Add the Fine-Grained Trap registersAndrew Turner5 days1-0/+1744
| | | | | | | | | | Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D54685
* | virtio_p9fs: Use VIRTIO_SIMPLE_PNPINFOAndrew Turner5 days1-7/+3
| | | | | | | | | | | | | | | | This allows us to also use the common VIRTIO_SIMPLE_PROBE and to have devmatch load the driver when detected. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D54684
* | libc/aarch64: Add memset for a 64 byte dc zvaAndrew Turner5 days3-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On arm64 we can use the "dc zva" instruction to zero memory. The CPU tells software if the instruction is implemented, and if so the size and alignment it will use. When the size is 64-bytes the Arm Optimized Routines implementation of memset can use dc zva to zero memory, and has a build flag to skip checking. Use this flag to build a version of memset that will be used when this assumption is true. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D54776
* | libc/aarch64: Split out the MOPS functionsAndrew Turner5 days3-3/+14
| | | | | | | | | | | | | | | | | | This allows static binaries to only include the functions they reference. Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D54775
* | libc/aarch64: Add a Makefile.inc dependencyAndrew Turner5 days1-2/+2
| | | | | | | | | | | | | | | | | | If we update Makefile.inc it may be to change the contents of these files. Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D54774
* | acpi: 'hw.acpi.s4bios' sysctl: Change type to bool, expand descriptionOlivier Certner5 days2-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Another boolean, indicating hardware support, will be introduced in next commit. Thanks to the previous commit modifying sysctl_handle_bool(), this change is backwards-compatible with old programs using an integer in and out of sysctl(3). Reviewed by: obiwac MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54626
* | acpi: Move sysctl tree set up at end of initializationOlivier Certner5 days1-59/+61
| | | | | | | | | | | | | | | | | | | | | | Setting up the sysctl tree later: 1. Fixes not de-registering sysctl knobs on failure to attach. 2. Avoids having inconsistent knob values exposed during a brief moment. Reviewed by: imp, obiwac MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54926
* | sysctl(9): Booleans: Accept integers to ease knob conversionOlivier Certner5 days1-5/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In sysctl_handle_bool(), if the output buffer (for the old value) has room for exactly 4 bytes (sizeof(int)), then output the current boolean value as an integer rather than a 'uint8_t'. Conversely, if 4 bytes exactly remain in the input buffer (for the new value), treat them as an integer and derive the new boolean value from it. Doing so allows to convert existing integer syscstl knobs that are interpreted as a boolean into true boolean ones while staying backwards-compatible. That brings no drawback as no code currently uses sysctl_handle_bool() as part of a series of calls to sysctl_handle_*() functions for (de)serialization of some compound structure. If that case ever materializes, it can be easily solved, e.g., by creating a sysctl_handle_bool_strict() variant. In the future, we might want to go further and generally be more liberal in the external type of integers we accept and output, by tolerating any kind of supported integers (8-bit to 64-bit), enabling integer type changes of knob's internal representations without breaking the ABI for consumers hardcoding the passed integers (instead of relying on sysctl knob type information). Reviewed by: jhb MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54925
* | amd64: parse_memmap(): Move comment about size at proper placeOlivier Certner5 days1-10/+9
| | | | | | | | | | | | | | | | | | While here, declare 'size' only in the relevant block. No functional change (intended). MFC after: 1 week Sponsored by: The FreeBSD Foundation
* | sockets: let protocols be responsible for socket buffer mutexesGleb Smirnoff5 days4-51/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sockets that implement their own socket buffers (marked with PR_SOCKBUF) are now also responsible for initialization of socket buffer mutexes in pr_attach and for destruction in pr_detach (or pr_close). This removes a big bunch of reported LORs, as now WITNESS is able to see that tcp(4) socket buffer mutex and netlink(4) socket buffer mutex are two different things. Distinct names also improve diagnostics for blocked threads. This also removes a hack from unix(4), where we used to mtx_destroy(). Also removes an innocent bug from unix(4) where for accept(2)-ed socket soreserve() was called twice. This one was innocent since first call to soreserve() was asking for 0 bytes of space. This slightly increased amount of pasted code in TCP's syncache_socket(). The problem is that while for sockets created with socket(2) it is pr_attach responsible for call to soreserve() (including !PR_SOCKBUF protocols), but for the sockets created with accept(2) it was solisten_clone() doing soreserve(), combined with the fact that for accept(2) TCP completely bypasses pr_attach. This all should improve once TCP has its own socket buffers. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D54984
* | Makefile.inc1: Don't mark GCC broken for riscv64John Baldwin5 days1-3/+0
| | | | | | | | | | Reviewed by: mhorne Differential Revision: https://reviews.freebsd.org/D54969
* | sh.1: Fix rendering error due to redundant .ElArtem Bunichev5 days1-2/+1
| | | | | | | | | | | | | | | | | | | | Due to this all the rest of the items in the Built-in Commands section were not rendered at all. Fixes: 2711852bd9ac ("sh.1: Provide detailed job control documentation") MFC after: 3 days Reviewed by: emaste, ziaee Differential Revision: https://reviews.freebsd.org/D55080
* | libpmc: Fix the L3 counters for AMD Zen 1-4Ali Mashtizadeh5 days1-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On AMD processors libpmc was using the topic field (based on filename) to determine the counter's subclass. Unfortunately, the JSON definitions for AMD Zen 1-4 have the L3 counters in files shared with other counters. This change has libpmc to use the pmu field (which is derived from the Unit field in JSON) to determine the correct counter subclass. Reviewed by: mhorne MFC after: 2 weeks Sponsored by: Netflix Pull Request: https://github.com/freebsd/freebsd-src/pull/1984
* | powerpc/pmap: Use a constant for HPT superpage shiftJustin Hibbits5 days2-4/+5
| | | | | | | | | | | | | | | | There are no plans to allow multiple sizes of HPT superpages, so just use a constant for it. MFC after: 3 weeks Fixes: 1bc75d77e9 ("powerpc/pmap/oea64: Make PV_LOCK superpage sized")
* | EVENTHANDLER.9: EVENTHANDLER_REGISTER never failsAymeric Wibo5 days1-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Since ecdf4409f910 ("Rework the eventhandler locking [...]"), EVENTHANDLER_REGISTER() can never return NULL. Suggested by: olce Reviewed by: olce, ziaee, zlei Approved by: olce, zlei Fixes: ecdf4409f910 ("Rework the eventhandler locking [...]") Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D55014
* | vm_phys: Check `RB_FIND()` return value in case it is NULLJean-Sébastien Pédron5 days1-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When trying to unregister a fictitious range in `vm_phys_fictitious_unreg_range()`, the function checks the properties of the looked up segment, but it does not check if a segment was found in the first place. This can happen with the amdgpu DRM driver which could call `vm_phys_fictitious_unreg_range()` without a fictitious range registered if the initialisation of the driver failed (for example because firmwares are unavailable). The code in the DRM driver was improved to avoid that, but `vm_phys_fictitious_unreg_range()` should still check the return value of `RB_FIND()` before trying to dereference the segment pointer and panic with a page fault. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55076
* | libc/tests: Clean up *dir() testsDag-Erling Smørgrav5 days1-15/+13
| | | | | | | | | | | | | | | | | | Mainly, avoid reusing the name of one of the functions we should be testing (but aren't) for local variables. Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D55054
* | hwpstate_amd(4): Rename CPPC register macrosOlivier Certner5 days1-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | To be closer to AMD's official terminology, except for the "Lowest Non-Linear Performance" field which we label as 'EFFICIENT_PERF' closer to Intel's ("Most Efficient Performance"), and to clear possible confusion. No functional change (intended). Reviewed by: aokblast Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54998
* | hwpstate_amd(4): Fix BITS_WITH_VALUE()/SET_BITS_VALUE() to obey the maskOlivier Certner5 days1-3/+5
| | | | | | | | | | | | | | | | | | While here, rename an argument of BITS_VALUE() to be consistent with the other macros. Reviewed by: aokblast Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54997
* | x86: x86_msr_op(): MSR_OP_LOCAL: Disable interrupts on atomic opsOlivier Certner5 days2-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On MSR_OP_LOCAL and non-naturally-atomic operations (MSR_OP_ANDNOT and MSR_OP_OR), there is no guarantee that we are not interrupted between reading and writing the MSR, and that interruption could actually perform some operation on that MSR, which would be lost. Prevent that problem by temporarily disabling interrupts around MSR manipulation. Reviewed by: kib Discussed with: markj MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54996
* | x86: x86_msr_op(): Simplify assertionsOlivier Certner5 days1-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | Simplify them by moving them into more natural places, i.e., default cases of 'switch' statements. No functional change (intended). Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54996
* | x86: x86_msr_op(): Move setting mode up, delineate logical blocksOlivier Certner5 days1-3/+5
| | | | | | | | | | | | | | | | | | No functional changes (intended). Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54996
* | unmount(2): do not allow MNT_DEFERRED or MNT_RECURSE flags from userspaceKonstantin Belousov5 days1-0/+2
| | | | | | | | | | | | Repprted and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week
* | usr.bin/tftp: remove tests when MK_TFTP=noEnji Cooper5 days1-0/+3
| | | | | | | | | | | | | | These tests require the tftp client, which is not installed when `MK_TFTP=no`. Remove them when that's not true. MFC after: 1 week
* | usr.bin/factor: remove tests when MK_GAMES=noEnji Cooper5 days1-0/+4
| | | | | | | | | | | | | | factor(1) is only installed when MK_GAMES != no. Ergo, remove the tests when that's not true. MFC after: 1 week
* | tftpd: remove tests when MK_TFTP=noEnji Cooper5 days1-0/+3
| | | | | | | | MFC after: 1 week
* | tftpd tests: clean trailing whitespaceEnji Cooper5 days1-9/+9
| | | | | | | | | | | | No functional change intended. MFC after: 1 week