| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Verbatim import of these files, with unix line endings.
Sponsored by: Netflix
|
| |
|
|
|
|
|
|
|
|
|
| |
All default jail parameter values are an empty or otherwise standard
value, or are copied the jail's parent. A notable exception is the
root directory, which is instead copied from the creating process's
jail. Fix that to be in line with everything else.
This change affects only the default when no path is specified; if
a path of "/" is explicitly given, that will still be the creating
process's root directory.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a daemon never responds to FUSE_INIT, but some process attempts to
access the mountpoint, and a different process (possibly the daemon
itself) attempts to unmount, a deadlock would result.
Fix this bug by blocking any thread that enters fuse_vfsop_root until
the daemon responds to FUSE_INIT or it times out. That will block any
thread attempting to lookup a path in the fuse mountpoint, before it
even gets to fuse VOPs. Remove less thorough initialization checks in
fuse_ticket_fetch and fuse_vnop_access that are no longer necessary.
And add a test case.
PR: 287431
MFC after: 2 weeks
Sponsored by: ConnectWise
Reviewed by: js
Differential Revision: https://reviews.freebsd.org/D59737
|
| |
|
|
| |
Fixes: 7a323f873662 ("sys: Retire le(4)")
|
| |
|
|
|
|
| |
This driver was removed several years ago.
Fixes: c1c9764296e5 ("Remove the si(4) driver and sicontrol(8) for Specialix serial cards.")
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was added in the initial import of dtrace and overrides the
normal load/unload targets with a custom target that loads a hardcoded
set of modules. Over time, the set of modules has not been updated
and is now incomplete. It's also not really useful compared to the
default implementation of these targets used for loading or unloading
an individual module being actively developed.
This functionality is also available via dtraceall.ko which is how
users commonly load the full suite of dtrace modules.
Reviewed by: imp, markj
Differential Revision: https://reviews.freebsd.org/D59821
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes a bug where a binary linked using max-page-size=0x200000
can result in a bogus relocation offset when running on a system
with a smaller page size. This causes samples to fall outside
the image mapping or be translated to the wrong address (resulting
in symbol resolution, or incorrect symbol resolution). We noticed
this at Netflix because we run a patchset enabling 16k pages on
amd64 and have been compiling userspace with a 2MB page size.
Since we started doing this profiling userspace binaries has been
wonky.
Reviewed by: ali_mashtizadeh.com
Differential Revision: https://reviews.freebsd.org/D59771
Sponsored by: Netflix
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
put_device() already triggers lkpi_pci_dev_release(), which removes
pdev from pci_devices, frees pdev->bus, destroys pcie_cap_lock, and
uninits the DMA private data.
Reported by: gallatin
Fixes: 66b25ddf9125 ("LinuxKPI: pci detach: implement a proper detach (release) path")
Reviewed by: kib, gallatin, bz
Sponsored by: NVidia networking
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D59913
|
| |
|
|
|
|
|
|
|
|
| |
The Get Log Page request for the error log is clamped to
NVME_MAX_AER_LOG_SIZE, but the byte-swap loop iterated ELPE + 1
entries. A controller reporting more than 63 entries makes the loop
overrun the 4 KiB log page buffer.
Reviewed by: ngie, imp, adrian
Differential Revision: https://reviews.freebsd.org/D59626
|
| |
|
|
|
|
|
|
|
|
|
| |
The single-vector MSI-X fallback installs the shared interrupt
handler, which masks interrupts through INTMS/INTMC around the
completion poll.
INTx and MSI are unaffected. Only MSI-X track the interrupt mode
and skip un/masking
Reviewed by: ngie, imp, adrian
Differential Revision: https://reviews.freebsd.org/D59637
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For some reason, shm_partial_page_invalidate() unlocks the object upon
an error, but its callers don't expect this. Don't do any special error
handling. Keep the subroutine anyway since the name is a bit clearer
than vm_page_grab_zero_partial().
While here, normalize the object pointer used for locking in
shm_deallocate().
Reviewed by: kib
Fixes: 454bc887f250 ("uipc_shm: Implements fspacectl(2) support")
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59877
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the entire plaintext is zero-filled, the backwards walk in
tls13_find_record_type() would return the offset of the last byte of the
TLS header. This causes an underflow when decrypting, resulting in a
null pointer dereference.
Fix the bug and add a regression test.
Reviewed by: gallatin, jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59767
|
| |
|
|
|
|
|
|
| |
Turns out that ever since introducing ELFv2 support, it was missing
ASLR, it was only used for ELFv1 processes.
Reviewed by: jhibbits (via IRC #powerpc64)
MFC after: 1 week
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
vfs_register hashes the filesystem name and uses it for sysctl oids.
A filesystem name which hashes to 0 crashes in sysctl_register_oid().
Map 0 to 1 to prevent the kernel crash.
This can be tested with "udf2" as the filesystem name.
MFC after: 1 month
MFC to: stable/15 stable/14
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D59839
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The Unicode closing single quotation mark is classified as a homoglyph
and can trip automated code quality checks in downstream CI pipelines or
cause code review UIs to refuse to display a file. If used as an
apostrophe, use the ASCII single quote instead. If used as a closing
single quote, replace with double quotes or no quotes at all.
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: ziaee, obiwac, olce
Differential Revision: https://reviews.freebsd.org/D59911
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
mmu_radix_sync_icache() adds the offset of va within its page to the
physical address it gets from mmu_radix_extract_locked(). That address
already includes the offset - the extract routines return the physical
address of the byte, not of the frame - so the offset is counted twice
and __syncicache() is handed frame + 2 * offset.
The hash MMU counterpart, moea64_sync_icache(), has to add the offset
because PVO_PADDR() yields only the frame. Here the addition is wrong.
Fixes: 6f0b2a235a13 ("powerpc/pmap: Add pmap_sync_icache() for radix pmap")
Reviewed by: jhibbits
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D59870
|
| |
|
|
|
| |
Fixes: dcb10e3add17
Reported by: Bruno Banelli <bruno.banelli@sartura.hr> (p_idx typo)
|
| |
|
|
|
|
|
|
|
| |
Now fd_ref_nhop() returns zero for cross family routes,
Do not schedule nhop references and try to rebuild it immediately
for connected and static routes.
PR: 298733
Fixes: 633438224304 ("route/fib_algo: Fix nexthop index ...")
|
| |
|
|
|
|
|
| |
fd is allocated with M_ZERO and fd_num_af never decreases.
Therefore, no need for zeroing nhaf_count and nhaf_base here.
Fixes: 633438224304 ("route/fib_algo: Fix nexthop index ...")
|
| |
|
|
|
|
|
|
|
|
|
| |
This matches upstream behaviour since Linux's demangle_poll()
silently discards POLLREMOVE from the requested events.
Reviewed by: emaste
Sponsored by: Sippy Software, Inc.
Differential Revision: https://reviews.freebsd.org/D59914
MFC after: 1 week
PR: 297467
|
| |
|
|
|
|
|
|
|
|
|
| |
They exist only to fill in MODULE_DEPEND() and MODULE_VERSION(), and
every consumer passed the same value for all three, so the version
range never did anything. Use 1, like the rest of the tree does.
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Reviewed by: kib, emaste
Differential Revision: https://reviews.freebsd.org/D59873
|
| |
|
|
|
|
|
| |
No functional change intended.
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
|
| |
|
|
|
|
|
| |
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D59815
|
| |
|
|
|
|
|
| |
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D59815
|
| |
|
|
|
|
|
|
|
|
| |
Thread can control it with sysarch(I386_SET_SPLITLOCK). The global
default is set with hw.splitlock_force.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D59815
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
If hw supports it, on atomic operation that requires exclusive ownership
of more than one cache line, #AC is generated.
The state is maintained as the arch-private TDF_MD_SPLITLOCK_AC flag.
The state is inherited on thread creation from the thread spawning the
new one. It is cleared on exec.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D59815
|
| |
|
|
|
|
|
| |
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D59815
|
| |
|
|
|
|
|
|
|
| |
Recover from it if PCB_ONFAULT handler is provided.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D59815
|
| |
|
|
|
|
|
|
|
| |
Use a hole in struct mdthread.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D59815
|
| |
|
|
|
|
|
| |
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D59815
|
| |
|
|
|
|
|
| |
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D59815
|
| |
|
|
|
|
|
| |
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D59815
|
| |
|
|
|
| |
Fixes: 6dca6e2aa89d ("arm64/smmu: Start handling errata")
Sponsored by: Arm Ltd
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
pmc_ibs_initialize() allocates the ibs_pcpu[] pointer array, and
pmc_ibs_finalize() exists to free it, but pmc_ibs_finalize() is
never called. Every hwpmc unload on a CPU with IBS therefore leaks
one pmc_cpu_max()-sized pointer array.
Call pmc_ibs_finalize() from pmc_amd_finalize(), alongside the RAPL,
TSC and perf classes. IBS is only initialized on CPUs that support
it, so make pmc_ibs_finalize() return early when ibs_pcpu is NULL,
making it safe to call when the class was skipped at initialize
time, as pmc_rapl_finalize() already is.
Tested on an AMD Ryzen 5 5600X (Zen 3, 12 threads) with INVARIANTS.
Before the change, each kldload/kldunload cycle leaked one 96-byte
M_PMC allocation, and DTrace showed the ibs_pcpu[] allocation from
pmc_ibs_initialize() as the only one never freed. After the change,
50 load/unload cycles leave M_PMC InUse and MemUse unchanged, and
every allocation made at load is freed at unload.
Reviewed by: mhorne
Fixes: e51ef8ae490f ("hwpmc: Initial support for AMD IBS")
Sponsored by: NLINK (https://nlink.com.br), Recife, Brazil
Differential Revision: https://reviews.freebsd.org/D59881
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds a driver for the CPU temperature sensor on the jh7110
SoC.
The calibration numbers come from the OpenBSD driver but are reworked to
produce a result in K rather than C.
The temperature is exposed as a sysctl, dev.jh7110_temp.0.temperature
but I have also exposed it as dev.cpu.0.temperature because that's where
you find it on a RaspberryPi and amdtemp(4), so it's a lot more obvious.
(mhorne: Added 'starfive,jh7100-temp' compatible.)
Reviewed by: mhorne, bnovkov
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D59478
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
s2_tlbi_range under VHE is supposed to clear HCR_EL2.TGE, but it erroneously
clears an unrelated bit 27 in TCR_EL2 (HWU61). Since HCR_TGE determines which
translation regime will be used by a tlbi, the instruction targets the
wrong regime when it is not cleared.
Fix the register accessed by the function to actually clear HCR_EL2.TGE.
Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
Reviewed by: andrew
Sponsored by: Arm Ltd
Differential Revision: https://github.com/freebsd/freebsd-src/pull/2435
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
AMD_NPMCS_MAX = 342 (16 core + 6 L3 + 64 DF + 256 UMC). On a Zen 4
EPYC 9654 with 6 core, 6 L3, 16 DF, and 4 UMC counters, only 32
descriptors are needed; the static arrays over-allocate by ~10x.
Replace both amd_pmcdesc[AMD_NPMCS_MAX] and per-CPU pc_amdpmcs[AMD_NPMCS_MAX]
with mallocarray() sized to the actual registered PMC count:
- amd_pmcdesc: allocated in pmc_amd_initialize()
- pc_amdpmcs: allocated per-CPU in amd_pcpu_init(), freed in fini()
Normalize amd_l3_npmcs and amd_df_npmcs against the AMDID2_PTSCEL2I
and AMDID2_PNXC feature bits before computing npmcs_total, so that
allocation, registration, and amd_get_msr() row offsets are all derived
from the same values. Previously the ternary in npmcs_total excluded
L3/DF from the allocation while the globals retained their defaults,
causing amd_get_msr() to miscompute DF row offsets when L3 is absent.
amd_umc_npmcs comes from CPUID Fn8000_0022h EBX[23:16] (NumUMCCounters)
and is zero when the leaf is absent, so no additional feature flag is
needed. See AMD64 APM Vol.3 Appendix E.
Fix three error-path memory leaks: amd_hwcheck() failure, goto error,
and finalize. Reset amd_npmcs = 0 on the error path.
Tested on AMD EPYC 9654 (Zen 4, Family 19h Model 11h, 192 threads).
Full PMC test suite (IBS/UMCDF/PMC/L3/DF/TSC): 0 failures.
Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com>
Reviewed by: mhorne
MFC after: 1 week
Sponsored by: AMD
Pull Request: https://github.com/freebsd/freebsd-src/pull/2415
|
| |
|
|
|
|
|
|
| |
It is functional, and there are some RISC-V platforms which can benefit
from it.
Requested by: Brian Scott <bscott@bunyatech.com.au>
Sponsored by: The FreeBSD Foundation
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reduce very common console messages:
Receive error rdes3=30208000
As observed on the VisionFive v2 hardware after some large transfers.
Differentiate between overflow errors and others. Report the errors when
the length is non-zero (overflow errors).
Also, count errors for netstat purposes.
Reviewed by: mhorne
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D59479
|
| |
|
|
|
|
|
|
|
|
| |
Also explicitly specify .cfi_sections to emit the cfi bytecode into the
loadable .eh_frame section.
Reviewed by: mchoo
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D59838
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The 8254's square wave mode (mode 3) is periodic, with the same
interrupt rate as the rate generator mode (mode 2), but
vatpit_callout_handler() only re-arms the channel 0 callout for
TIMER_RATEGEN. A guest that programs mode 3 therefore receives a
single IRQ0 and no further timer interrupts.
Re-arm the callout for TIMER_SQWAVE as well, matching illumos
change 13301.
Reviewed by: markj
Obtained from: illumos 93d78aba5b32996fc2ae893a6237a0d3972f86b2
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59816
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When emulating a MOVS from MMIO to guest RAM, the kernel's
vm_copy_setup() wires the destination pages. If the subsequent
MMIO read fails, emulate_movs() skips vm_copy_teardown(), leaking
the page wire references acquired during setup.
Run vm_copy_teardown() regardless of the MMIO read result, and
only copy the value to guest memory if the read succeeds.
Preserve the existing error return.
This matches illumos change 13309.
Reviewed by: markj
Obtained from: illumos 83cd75bb2949d26e6eb38ddefc60fdeed1909643
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59823
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
vmx_emulate_cr0_access() sets EFER.LMA and the IA-32e guest VM-entry
control when enabling paging with EFER.LME set, but does not clear them
when disabling paging. This can leave an inconsistent guest state that
fails VM entry.
Update both fields in either direction based on EFER.LME and the CR0
value written to the VMCS. Use the mask-adjusted CR0 value so the
resulting state remains consistent with the VMX fixed-bit requirements.
Reviewed by: markj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59756
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
pit_timer_start_cntr0() does not schedule a callout when the initial
count is zero. The counter write handler normalizes a programmed zero
count only after calling it, leaving an initially unarmed channel 0
without a scheduled timer event.
Move the existing normalization before the timer-start call. Retain the
historical 0xffff representation of a zero count.
Reviewed by: markj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59749
|
| |
|
|
|
|
|
|
|
|
|
|
| |
When one pfsync host clears states it informs its peers about this.
While processing such messages, in pfsync_in_clr() we failed to take the
interface name into account.
This meant that if one host cleared states on one interface the peers
would clear all states, not just those on the affected interface.
Actually check for the interface in pfsync_in_clr()
Sponsored by: Rubicon Communications, LLC ("Netgate")
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Only use the MSI polling method when we support MSIs and the SMMU is
cache-coherent.
The SMMU writes to a memory location. If it is not cache-coherent then
the CPU may read the existing value in its cache and miss the signal
the sync operation has completed.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D59489
|
| |
|
|
|
|
|
|
|
| |
When the hardware doesn't support MSIs we need to poll to wait for
sync operations to complete. Add support for this to support booting
on this hardware.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D59488
|
| |
|
|
|
|
|
|
|
|
|
| |
In preparation for adding a non-MSI method split out waiting for sync
completions from smmu_sync.
While here fix the loop to wait for sync timeout to the worst case
Linux uses.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D59487
|
| |
|
|
|
|
|
|
|
|
|
| |
Handle the Arm MMU-600 erratum 1076982 where when we poll for a sync
command completion we can't use the wait-for-event instruction.
This is in preparation for later adding support for polling for sync
command completion and is not an issue on stable branches.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D59486
|
| |
|
|
|
|
|
|
|
|
|
|
| |
We need to wait for the interrupt drivers to attach before the smmu
driver. As both of these happened at BUS_PASS_INTERRUPT +
BUS_PASS_ORDER_MIDDLE there was no guarantee this would happen in the
correct order.
Fix by moving the smmu driver to BUS_PASS_ORDER_LATE.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D59485
|