Closed
Conversation
rc_bbr_substate is a 3-bit unsigned int, so it can't be larger than or equal to 8. The wrap around already happens. No functional change intended. Reviewed by: rrs CID: 1523795 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48320
minslot is initialized to 0 and never changed. It is not clear to me under which condition minslot should be set to which value. Therefore, remove it and the code checking that it is not zero. No functional change intended. Reviewed by: rrs CID: 1523812 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48321
The distributekernel target expects DESTDIR and DISTDIR to be set. The stagekernel target invokes `make distributekernel`, and previously left DISTDIR unset, resulting in a path with a "//" component. Instead, set DISTDIR to . to make the way we're (ab)using the distributekernel target more explicit. Reviewed by: bapt Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48288
It uses the same audio codec as 12th gen (PCI ID 0x0002). Actually everything is the same, except the CPU. Signed-off-by: Daniel Schaefer <dhs@frame.work>
If the passed in rate is a VHT rate, use rtwn_ctl_vhtrate() to find a suitable rate for RTS/CTS. Differential Revision: https://reviews.freebsd.org/D48295 Reviewed by: bz, cy, emaste
Don't assume that this allocation will succeed. We may have been passed M_NOWAIT. The calling code already handles allocation failures, but the function itself did not. PR: 283807 MFC after: 1 week
Discovered trying to read a 360KB floppy disk :-)
Since we started to ship raw firmware for iwm(4), users who loads the driver from loader are having problems as loader don't know that the firmwares are now raw files and not kernel modules anymore. Start a list of default entry for iwm(4) firmwares name mapping so it will still works when loaded from loader. Differential Revision: https://reviews.freebsd.org/D48211 Reviewed by: bz, imp, kevans Sponsored by: Beckhoff Automation GmbH & Co. KG
A lot of drivers are shared between all rockchip SoCs, each time we add suppot for a new SoC we need to add the options in the files.arm64 lines. Add a new option SOC_ROCKCHIP that will help simplify this file. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D48286
This device will select the base driver for Rockchip PMIC. While here also add a new rk808 device which selects the PMIC used for RK3399 Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D48287
Doing some debugging I noticed that applications using rpc(3) would often make lseek(2) on a totally bogus file descriptor, that looks more like a pointer. So, what happens here is that xdrrec type xdr doesn't keep a track of how many bytes were sent/received on the stream and tries to obtain this number via lseek(2). Then it adds/subtracts the offset in the internal buffer from the obtained number. This code originates from the original Sun RPC import in 1994. However, it was not a working code even if Solaris would support lseek(2) on a socket, because it was passing not the file descriptor, but a pointer to opaque data from upper RPC layer. It could be that previously (before import to FreeBSD) code was correct, but the Solaris 8 documentation says that lseek(2) on socket isn't supported [1]. Maybe supported on older Solaris? Anyway, this lseek(2) never worked and xdr_getpos() would always fail on xdrrec object, until 8f55a56 in 2008 it was slightly fixed to tolerate failure of lseek(2) and return a correct value within the small internal buffer for XDR_ENCODE mode and a an incorrect (negative to unsigned) result for XDR_DECODE. It seems no consumer ever calls xdr_getpos()/xdr_setpos() on this kind of descriptor when in XDR_DECODE mode. So, remove this lseek(2) and preserve operation within the small buffer only. Supposedly fix the operation for XDR_DECODE mode. Note that there is no use and no test coverage for the XDR_DECODE. Note that xdr(3) manual page already documents limitations for xdr_getpos() and xdr_setpos() for the stream type objects. [1] https://docs.oracle.com/cd/E19109-01/tsolaris8/835-8003/6ruu1b0or/index.html Reviewed by: asomers, markj Differential Revision: https://reviews.freebsd.org/D48205
No functional change.
Delete some unused includes and member variables. MFC after: 2 weeks Sponsored by: ConnectWise
The metalog is produced by install -M, which is not inherently sorted. This results in non-deterministic file ordering in kernel.txz. Order the files in kernel.txz to support reproducible builds. PR: 283214 Reviewed by: emaste Signed-off-by: Pat Maddox <pat@patmaddox.com>
Always check the return value of open(). Reported by: Coverity Scan CID: 1471118 1471133 1471215 1471896 1471901 1472116 1473799 CID: 1473879 1473996 1555269 1558044 MFC after: 2 weeks Sponsored by: ConnectWise
Do not jump to a place in the code, which requires several variables to be set (segsize, minseg, idle, len, sb_offset), which is not true. To avoid using these variables, start the HPTS timer explicitly. This fix only applies to the client side using TCP fast open. Approved by: rrs CID: 1523766 CID: 1523770 CID: 1523786 CID: 1523801 CID: 1523809 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48322
bw is unsigned and not zero. So it cannot be smaller than 1. No functional change intended. Reviewed by: rrs, cc CID: 1523791 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48323
No functional change intended. Reviewed by: rrs CID: 1523808 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48338
Bring back the code, which was accidentally removed. While there, indent a comment correctly. Reviewed by: rrs CID: 1540026 Fixes: e18b97b ("Update to bring the rack stack with all its fixes in.") MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48340
MFC after: 1 week Sponsored by: Klara, Inc.
prison_deref() and prison_deref_kill() have to handle the case where destruction of a jail will release the final reference on the jail's parent, resulting in destruction of the parent jail. They thus maintain a list of jails whose references have gone away; the loop at the end of prison_deref() then goes through the list and deallocates resources associated with each jail. In particular, if a jail's VNET is not the same as that of its parent, this loop destroys the VNET. Suppose prison_deref() removes the last reference on a jail, releasing a reference to its parent and causing the jail to be placed in the "freeprison" list. Suppose then that the parent jail is destroyed before the "freeprison" list is processed. When destroying the now-orphaned child jail, prison_deref() derefences its parent to see whether the child jail's VNET needs to be freed, but if this race occurs, this is a use-after-free. Fix the problem by using PR_VNET to decide whether the jail's VNET is to be destroyed, rather than dereferencing the parent jail pointer. Set it earlier so that a subsequent failure in kern_jail_set() cleans up the nascent VNET. Reviewed by: zlei (previous version), jamie MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47992
SOCK_STREAM and SOCK_SEQPACKET sockets should get the same treatment here. PR: 176420 MFC after: 2 weeks
PR: 283507 MFC after: 1 week
PR: 283696 MFC after: 1 week
Note that key_spdacquire() is dead code, as the SADB_X_SPDACQUIRE message handler is not set. PR: 243057 MFC after: 2 weeks
A number of image processing packages assume that swab() can handle to and from being the same. However, POSIX.1 states that overlapping buffers produces undefined results. Our old implementation would produce coherent results, but the recent change to the musl-inspired code does not. Since there's complaints in the forums for these image processing packages for musl and now FreeBSD, update the algorithm to just read a word at a time and bswap16 the results. All FreeBSD's architecutres support unaligned access in userland, and swab is not used in the kernel (g_part_apm has its own copy), so opt for even simpler code that's easier to understand. This makes the overlapping behavior match i386 again, since its assembler routine for swab handles overlapping correctly. PR: 283698 Sponsored by: Netflix Reviewed by: nwhitehorn Differential Revision: https://reviews.freebsd.org/D48259
Only one programming environment at a time can be defined at a time. Posix states that when defining _POSIX_C_SOURCE, the system headers must define only the macros, variables, and functions that a given standard level defines. Selecting a different macro along with this is fundamentally incompatible with that. Sponsored by: Netflix
Undefined things happen if users define these macros, be more explicit about documenting that. Sponsored by: Netflix
…ation A straightforward port of the amd64 implementation. Approved by: security (cperciva) Reviewed by: getz, cperciva Event: EuroBSDcon 2024 Differential Revision: https://reviews.freebsd.org/D46757
A port of the amd64 implementation with some slight changes due to differences in instructions provided by aarch64. No ASIMD for the same reason as the amd64 code: it's just not particularly suitable for this application. Event: EuroBSDcon 2024 Approved by: security (cperciva) Reviewed by: getz, cperciva Differential Revision: https://reviews.freebsd.org/D46758
See also: D46758, D46757 Event: EuroBSDcon 2024 Relnotes: yes
For compatibility with Linux, it's useful to have a tick counter of width sizeof(long), but our tick counter is an int. Currently the linuxkpi tries paper over this difference, but this cannot really be done reliably, so it's desirable to have a wider tick counter. This change introduces ticksl, keeping the existing ticks variable. Follow a suggestion from kib to avoid having to maintain two separate counters and to avoid converting existing code to use ticksl: change hardclock() to update ticksl instead of ticks, and then use assembler directives to make ticks and ticksl overlap such that loading ticks gives the bottom 32 bits. This makes it possible to use ticksl in the linuxkpi without having to convert any native code, and without making hardclock() more complicated or expensive. Then, the linuxkpi can be modified to use ticksl instead of ticks. Reviewed by: olce, kib, emaste MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D48383
Add the generic USB drivers and FDT glue to the build. Make small tweaks to the aw_usbphy and aw_musb drivers for the Allwinner D1. Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48126
The canonical name is __riscv, not __riscv__. Newer compilers no longer emit the latter. This re-enables finding the nominal frequency from the CPU's clock. I checked, and there are no remaining mistakes like this in the tree. Reviewed by: jrtc27, imp, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48122
Mainly, to avoid repeating the list of architectures, #define HAS_CLK. Further, split the clk code into a helper function, which is a stub in the !HAS_CLK case. This aids in overall legibility. While here, add one separating whitespace, again for legibility. Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48149
Some RISC-V CPUs contain a "monitor core" with limited functionality (no MMU). These cores appear in some device trees, but we don't run the kernel on them; in early CPU start-up code we skip them, and they have no impact on mp_ncpu. It seems the new trend is to mark these monitor cores with a 'status' property of 'disabled'. However, we still instantiate an ofw_cpu pseudo device for the disabled core. This is generally harmless, but there is an impact when attempting to attach the cpufreq_dt driver. It counts more OFW CPU devices (unit number) than logical CPUs (mp_ncpus), and therefore fails to attach for the last logical CPU. The solution is to check the status property in ofw_cpu_probe(), and fail if the core is marked "disabled". This is subject to the same exception already in ofw_cpu_early_foreach(); that is, if a disabled CPU has an 'enable-method' property, it can be used by the kernel. Reviewed by: andrew, jrtc27 MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48123
Implement the small amount of MD code required; copied from arm/arm64. One tweak is made to cpufreq_dt itself: if the opp-shared property is missing, but there is only one CPU, then we can still attach. This is relevant for the single-core Allwinner D1. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48124
PR: 258570 Reported by: Robert Morris <rtm@lcs.mit.edu> Reviewed by: emaste, markj Differential Revision: https://reviews.freebsd.org/D48422
- We can use builtin constants for the size of int and long to simplify definitions. - The file should have a .S prefix since we want to run it through the preprocessor, though apparently this happens anyway with .s... - Move ticks and ticksl from .data to .bss. Reported by: jrtc27 Reviewed by: jrtc27, kib, emaste Fixes: 6b82130 ("clock: Add a long ticks variable, ticksl") Differential Revision: https://reviews.freebsd.org/D48420
If USE_GCC_TOOLCHAINS is set to a value matching the pattern 'gcc*', use that as the GCC version. For example, USE_GCC_TOOLCHAINS=gcc16 would use amd64-gcc16 for amd64, etc. If the variable is set to a value that doesn't match that pattern, use the default version. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D48418
This message would never have been omitted before since bus_generic_attach never fails. Reviewed by: ziaee, emaste Fixes: 18250ec Replace calls to bus_generic_attach with bus_attach_children Differential Revision: https://reviews.freebsd.org/D48402
Fixes: 18250ec Replace calls to bus_generic_attach with bus_attach_children Differential Revision: https://reviews.freebsd.org/D48404
The kshim code abused the devclass argument to DRIVER_MODULE in some odd ways. Instead, refactor the devclass handling to more closely mirror what new-bus does in the kernel by having a linked list of devclasses looked up by name and associate devices with a devclass. Devices are now only associated with a module while probing and attaching. Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D48409
While here, update bus_generic_detach to delete devices as in the kernel. Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D48410
Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D48411
Reviewed by: imp, markj, emaste Differential Revision: https://reviews.freebsd.org/D48412
This will allow to broadcast messages visible only to priveleged subscribers. Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D48307
using the family name and the group name as lookup arguments. Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D48308
We want to check the size of the header, not a pointer to it. Reviewed by: melifaro, markj Differential Revision: https://reviews.freebsd.org/D48309
Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D48310
- Statically initialize control family/group. This removes extra startup code and provides a strong guarantee that they reside at the 0 index of the respective arrays. Before a genl_register_family() with a higher SYSINIT order could try to hijack index 0. - Remove the family_id field completely. Now the family ID as well as group ID are array indices and there is basically no place for a mistake. Previous code had a bug where a KPI user could induce an ID mismatch. - Merge netlink_generic_kpi.c to netlink_generic.c. Both files are small and now there is more dependency between the control family and the family allocator. Ok'ed by melifaro@. Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D48316
…sword The removed check left snmptoolctx->passwd pointer to uninitialized memory. Always calling strlcpy(3) would guarantee that with empty password it will point to empty string. Submitted by: markj PR: 283909
Expose configuration variables if we're being sourced. This provides a convenient way to check them in the release scripts. Signed-off-by: Ahmad Khalifa <ahmadkhalifa570@gmail.com>
Check the MK_LOADER_IA32 variable instead of manually checking if the file exists. Signed-off-by: Ahmad Khalifa <ahmadkhalifa570@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.