ddt: select traditional phys by block identity, not BP DVA count
The write path stores a traditional DDT entry in the phys slot chosen
by the zp_copies value the block was written with, but the free-path
lookup validation (ddt_entry_lookup_is_valid()) selected the slot to
compare by the BP's physical DVA count, and ddt_addref() bumped the
refcount of that same wrongly-selected slot.
The two indexes diverge whenever a deduplicated block's BP carries
more DVAs than its copies value, which is exactly what ganging does:
a gang header is stored in more copies than the data it gangs, so
copies=1 blocks get a two-DVA gang header BP (unconditionally
through 2.3.3, and under the default redundant_metadata=all since
a46ce73ca8 made it configurable in 2.3.4 and 9250403ba6 in 2.4.0),
and from 2.3.4 that default also gives unencrypted copies=2 blocks a
three-DVA header BP. Encryption does not avoid the mismatch at
copies=1: the header BP still carries two counted DVAs (the salt/IV
DVA is separate). For such a block the validation checked
the wrong slot, concluded the entry had been pruned, and
[56 lines not shown]
GCE: Switch to using kvmclock timecounter on GCE VMs
Currently, GCE VMs are configured to use the "ACPI-safe" timecounter,
which does not exist on modern VM hardware. The system then falls back
to TSC-low because it has a higher quality rating than kvmclock.
However, TSC-low may report incorrect time after a VM migrates to a
different host system.
Instruct GCE VMs to use the kvmclock timecounter so that timekeeping
remains accurate across live migrations.
Approved by: re (cperciva)
Reported by: delphij
Reviewed by: delphij
Approved by: delphij (mentor)
Approved by: re (cperciva)
Differential Revision: https://reviews.freebsd.org/D62121
(cherry picked from commit 141e74291075785c7898763d33288b7fd8b9f06d)
(cherry picked from commit a61ec24c11d052ecbe5cfb9d5bfd11e18d352139)
powerpc64: Fix disappearing low memory on radix MMU systems (POWER9)
The FreeBSD radix implementation piggybacks on the physical memory
allocation function from the HPT implementation, but did not share
the same state information for number of physical memory ranges.
This led to a situation where the HPT physical memory allocator
would attempt to shift the physical memory ranges in the shared
range table, but would use the wrong number of entries, thus
overwriting the large segment of low memory that should have been
available for e.g. 32-bit DMA.
Incorrect physical memory map:
real memory = 33997058048 (32422 MB)
available KVA = 34359619583 (32767 MB)
Physical memory chunk(s):
0x0000000000003000 - 0x0000000000002fff, 0 bytes (0 pages)
0x000000000000e000 - 0x000000000000ffff, 8192 bytes (2 pages)
0x0000000000094000 - 0x0000000000ffffff, 16171008 bytes (3948 pages)
[30 lines not shown]
acpi: OsdDebug.c: Include 'acdebug.h' on ACPI_DEBUGGER
On ACPI_DEBUGGER (defined by 'acfreebsd.h' on ACPI_DEBUG_OUTPUT and DDB
defined), OsdDebug.c defines acpi_EnterDebugger() which uses
AcpiDbUserCommands(). Include 'acdebug.h' to provide a declaration for
it.
Reported by: llm-postcr
Fixes: d6fd89254a91 ("acpi: acpivar.h: Include ACPICA's acpi.h, remove the latter in consumers")
Sponsored by: The FreeBSD Foundation
acpi: acpivar.h: Include 'accommon.h' on ACPI_DEBUG_OUTPUT
ACPICA's public interface ('acpi.h') exports debug macros like
ACPI_FUNCTION_TRACE(), return_VOID, return_*(), and a lot of our
implementation files use them. Unfortunately, on ACPI_DEBUG_OUTPUT,
they expand to calls to functions (such as AcpiUtTrace(), AcpiUtExit(),
etc.) that are declared only in 'acutils.h', which is to be included via
'accommon.h', the header to use for ACPICA internals, breaking the
compilation if not included.
Include 'accommon.h' from <dev/acpica/acpivar.h> on ACPI_DEBUG_OUTPUT.
Reported by: llm-postcr
Fixes: d6fd89254a91 ("acpi: acpivar.h: Include ACPICA's acpi.h, remove the latter in consumers")
Sponsored by: The FreeBSD Foundation
[MLIR][LLVM] Import nameless functions, aliases and ifuncs (#248261)
LLVM IR allows nameless functions, aliases and ifuncs (e.g.
`MergeFunctions` creates nameless functions when it merges linkonce_odr
functions), but the importer only generated symbols for nameless global
variables. A constant that references a nameless function fails an
invalid `cast<GlobalVariable>`, and a module with two nameless functions
fails with a symbol redefinition.
This patch extends the nameless global support from #101918 and #111797
to functions, aliases and ifuncs. It generates a symbol for every
nameless global value and uses it at each site that references a global.
Assisted-by: Claude Code