pci: use uint32_t for eecp
eecp holds the extended capability offset. If that offset is larger
than 0xff, storing it in uint8_t truncates it, which can make the
early EHCI/XHCI capability walk read the wrong location and loop during
boot.
Seen on AMD device 1022:151e, where HCCPARAMS1 = 0x0118ffc5 and the
first xHCI extended capability offset is 0x460. Widen eecp to uint32_t
in xhci_early_takeover(), matching xhci_pci_take_controller().
Signed-off-by: Gisle Nes <gisle at gisle.net>
Reviewed by: zlei, aokblast
MFC after: 3 days
Pull Request: https://github.com/freebsd/freebsd-src/pull/2127
Closes: https://github.com/freebsd/freebsd-src/pull/2127
BSD.root.dist: Correct tag for /etc/sysctl.kld.d
This is only used by rc.subr and belongs in rc, not runtime.
Fixes: fa6d67cd16b5 ("BSD.root.dist: Add package tag for all directories")
MFC after: 3 days
Reviewed by: ivy
Differential Revision: https://reviews.freebsd.org/D56900
fsck_msdosfs: fix FAT header correction not persisting in cache mode
When fsck_msdosfs runs with FAT32 cache mode (used for large
filesystems that cannot be mmap'd), a detected FAT header correction
was written into the in-memory buffer but the corresponding cache
entry (fat32_cache_allentries[0]) was never marked dirty. As a
result, fat_flush_fat32_cache_entry() skipped it, the corrected
bytes were never written to disk, and copyfat() propagated the
uncorrected on-disk data to all backup FAT copies. Every subsequent
fsck run would repeat the same "FAT starts with odd byte sequence /
FIXED" cycle indefinitely.
Fix by marking fat32_cache_allentries[0].dirty = true after applying
the in-memory correction, ensuring the chunk is flushed before
copyfat() runs.
Obtained from: https://android-review.googlesource.com/c/platform/external/fsck_msdos/+/4047981
MFC after: 3 days
Merge commit 871038759afb from llvm git (by Marco Elver):
Thread Safety Analysis: Fix pointer handling of variables with deprecated attributes (#148974)
de10e44b6fe7 ("Thread Safety Analysis: Support warning on
passing/returning pointers to guarded variables") added checks for
passing pointer to guarded variables. While new features do not
necessarily need to support the deprecated attributes (`guarded_var`,
and `pt_guarded_var`), we need to ensure that such features do not cause
the compiler to crash.
As such, code such as this:
struct {
int v __attribute__((guarded_var));
} p;
int *g() {
return &p.v; // handleNoMutexHeld() with POK_ReturnPointer
[24 lines not shown]
sys/time: appease gcc -Wtype-limits
In environments where time_t is 32 bits, including the 32-bit library
build on amd64, the overflow being tested for cannot happen, and gcc
complains with -Wtype-limits, causing the gcc build to fail. Work
around this by ifdef'ing out the saturation code on i386.
Reviewed by: imp, jfree
Discussed with: markj
Fixes: e3799530b3ba ("sys/time: Add saturating sbt conversions")
Differential Revision: https://reviews.freebsd.org/D56369
(cherry picked from commit 00dccc3164c6dff38350a1baeeea7238acf2efc3)
Make "make update-packages" idempotent
If the user runs "make update-packages" without bumping BRANCH, then it
isn't possible to copy packages from the old location to the new one
(because the two locations are the same). So just skip that step.
Sponsored by: ConnectWise
PR: 295085
MFC after: 1 week
Reviewed by: ivy, emaste
Differential Revision: https://reviews.freebsd.org/D56872
Define stdint.h macros unconditionally
Similar to glibc, define all the stdint.h macros such as `SIZE_MAX`,
`UINT64_C`, etc unconditionally. I.e. no longer check whether
`__STDC_CONSTANT_MACROS` or `__STDC_LIMIT_MACROS` are defined. See also
<https://sourceware.org/bugzilla/show_bug.cgi?id=15366>.
This is part of reverting base 00bee6fcd77f, which reverted an upstream
libc++ commit that eliminated libc++'s stdint.h wrapper header.
Submitted by: Nikolas Klauser <nikolasklauser at berlin.de>
MFC after: 1 week
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D56746
(cherry picked from commit 966fb94cb3575ccd39da211165d0858fd0eb0ef2)
Define stdint.h macros unconditionally
Similar to glibc, define all the stdint.h macros such as `SIZE_MAX`,
`UINT64_C`, etc unconditionally. I.e. no longer check whether
`__STDC_CONSTANT_MACROS` or `__STDC_LIMIT_MACROS` are defined. See also
<https://sourceware.org/bugzilla/show_bug.cgi?id=15366>.
This is part of reverting base 00bee6fcd77f, which reverted an upstream
libc++ commit that eliminated libc++'s stdint.h wrapper header.
Submitted by: Nikolas Klauser <nikolasklauser at berlin.de>
MFC after: 1 week
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D56746
(cherry picked from commit 966fb94cb3575ccd39da211165d0858fd0eb0ef2)
Define stdint.h macros unconditionally
Similar to glibc, define all the stdint.h macros such as `SIZE_MAX`,
`UINT64_C`, etc unconditionally. I.e. no longer check whether
`__STDC_CONSTANT_MACROS` or `__STDC_LIMIT_MACROS` are defined. See also
<https://sourceware.org/bugzilla/show_bug.cgi?id=15366>.
This is part of reverting base 00bee6fcd77f, which reverted an upstream
libc++ commit that eliminated libc++'s stdint.h wrapper header.
Submitted by: Nikolas Klauser <nikolasklauser at berlin.de>
MFC after: 1 week
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D56746
(cherry picked from commit 966fb94cb3575ccd39da211165d0858fd0eb0ef2)
bsdinstall: Improve auto-partition message
Manually tuning ZFS for systems with <8GB ram hasn't been necessary at
least since the switch to OpenZFS. We have users reporting using 1GB RAM
with no manual tuning/issues. Further, the page this links to is a stale
wiki page, which is causing complaints. Remove this misleading note and
replace it with a similar message for UFS. While here, reword that note
to be a bit clearer.
Approved by: re (cperciva)
PR: 287719
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D50971
(cherry picked from commit 5ed26c21e4ff1d478d4611abbf3dc14cc1b77244)
(cherry picked from commit 5702d242429f1f791e05a720a9a411b1e64212dc)
ports.7/FILES: Expand and refactor into 3 tables
Add make.conf, CHANGES, CONTRIBUTING.Md, UPDATING, and Tools/scripts.
Refactor the FILES section of the ports reference manual into a bigger
table with three sections separated by root directory. Remove preceeding
article from all but "the big Kahuna", and root dirs where reasonable.
Approved by: re (cperciva)
MFC after: 3 days
Relnotes: yes
Reported by: adamw, arrowd, linimon
Differential Revision: https://reviews.freebsd.org/D55441
(cherry picked from commit 28deec9b7e2b08b00160eb39de84ade6f27eb125)
(cherry picked from commit aa519edfe50a65db516e62752914cb6922b3227f)
man: Kill off MANSUBDIRs
Three architecture dependent manuals are installed to MANSUBDIRs,
creating at least two empty manual page directories on everyone's
boxxen. Move those manuals to their canonical area, enhancing clarity,
grepability, removing useless inodes, and increasing consistency with
the rest of the architecture dependent manuals which are unconditionally
installed, and noted at the top of the rendered manual.
Approved by: re (cperciva)
MFC after: 3 days
(cherry picked from commit 809504f331fd3588e36b54255196379bdb59890a)
(cherry picked from commit 55709c8a46a470af78c0c818b36ac90615728c44)
Fix LOCAL_PEERCRED in 32-bit compat mode
Previously the cr_pid field would be incorrectly copied to userland, due
to a size mismatch between the structure as defined in 32-bit vs 64-bit
builds. Fix it by converting the structure before copying it to
userland.
PR: 294833
Sponsored by: ConnectWise
MFC after: 1 week
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D56675