linux: handle mmap read beyond file size
When performing a mmap read past the end of a file there is no data to
read, so simply zero-fill the page and return success. zfs_getpage()
limits the range lock appropriately to cover the offset being read.
Reported-by: Iliya Polihronov (@vnsavage) (Automattic)
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #18715
Convert usage plugin to the typesafe port pattern
## Context
The `usage` service is `private = True` with no over-the-wire API surface, so it is converted to the typesafe port pattern rather than being Pydantic-ified: a lean `Service` shim delegating to fully type-annotated module functions, keeping the existing dict return shapes. The namespace was previously a legacy compound service split across `usage.py` and `usage_/firstboot.py` and registered by auto-discovery.
## Solution
- **Consolidated into a `usage/` package.** `usage.py` and `usage_/` collapse into one package whose `UsageService` exposes the middleware entry points (`start`, `firstboot`) plus a private `gather` method that returns the full compiled stats payload for debugging what is and isn't being collected; the gather/submit logic lives in typed module functions (`gather.py`, `submit.py`, `run.py`, `firstboot.py`). Registered explicitly in `main.py`'s `ServiceContainer` and added to `mypy.yml`.
- **Replaced the dynamic dispatch with a decorator registry.** The old `dir(self)` + `usage.{func}` string dispatch becomes a `@gather_stat` registry — adding a stat is still just writing a decorated function, but it is fully typed and removes the magic-string call, so every same-process `usage.*` call (including `lifecycle.py`'s `usage.firstboot`) is now `call2`. `gather` stays synchronous and runs via `run_in_thread`, with async stat functions driven on the loop through `run_coroutine`, preserving the original threading.
- **Module functions take the owning `service`** so `service.call2(service.s.app.query)` resolves through `CallMixin` (bare `middleware.call2` mistypes the overloaded pass_app `query`); the VM display-device branch is narrowed with `isinstance(VMDisplayDevice)`.
Revert "[VPlan] Replace first-lane uses of BuildVector." (#206774)
Reverts llvm/llvm-project#206566
Causes miscompiles, see discussion on the original PR.
[flang] Enumeration Type: (PR 2/5) Name Resolution + Expression + Relational + SELECT CASE (#193028)
This PR completes the addition of enumeration types to the symbol table.
It adds core semantic analysis for ENUMERATION TYPE, name resolution,
expression analysis for constructors and relational operators, and
SELECT CASE support. Also includes a bug fix for non-constant
enumeration comparisons in Relate() (scope() → GetScope()).
It is the 2nd of 5 stacked PRs.
AI Usage Disclosure: AI tools (Claude Opus 4.6) were used to assist with
implementation of this feature and test code generation. I have
reviewed, modified, and tested all AI-generated code.
---------
Co-authored-by: Kevin Wyatt <kwyatt at hpe.com>
Revert "[z/OS][Clang] Add wrapper headers to avoid macro name conflicts" (#206778)
Reverts llvm/llvm-project#204472
Test is failing in multiple configurations in multiple ways.
[lldb][Windows] Synchronize on LOAD_DLL_DEBUG_EVENT in lldb-server (#203334)
On Windows, deferred breakpoints in dlopen'd DLLs never fire when using
lldb-server.exe. The debuggee runs past the loader and executes code in
the DLL before the client receives the load notification.
This patch surfaces `LOAD_DLL_DEBUG_EVENT` / `UNLOAD_DLL_DEBUG_EVENT` as
a synchronous stop, which mirrors the existing exception-event
mechanism. The debug loop parks on a predicate after sending the
notification.
lldb skips the handshake for `C:\Windows\*` (no user breakpoints can
resolve here) which drastically improves performances, and for clients
that didn't advertise `qXfer:libraries:read+`.
Fixes `TestBreakInLoadedDylib` and `TestLoadUnload` when running the
tests with `LLDB_USE_LLDB_SERVER=1`.
rdar://180500207
[2 lines not shown]
Clamp PMAP_DIRECT_MAPPED_LEN below USER_SR/KERNEL_SR
Derive it from MIN(USER_SR, KERNEL_SR) so the direct-mapped region never
overlaps the kernel HTAB window on ports where KERNEL_SR < USER_SR,
like ofppc. This made pmap_pvo_find_va() panic on legit lookup misses.
[PGO][NFC] Make CFGMST debug dump order deterministic (#200835)
The PGO instrumentation pass can print a per-function CFG-MST dump under
-debug-only=pgo-instrumentation. The basic blocks were listed in the
iteration order of a DenseMap keyed by the block pointer, so the same
function could print its blocks in a different order from one run or
machine to the next, even when nothing about the MST actually changed.
That makes the dump hard to diff. For example, two runs of the same
build
could print the same blocks in different orders:
```
run 1: run 2:
BB: entry ... BB: if.else ...
BB: if.then ... BB: entry ...
BB: if.else ... BB: if.then ...
```
and a plain `diff` would flag every line, hiding any real difference.
[3 lines not shown]
[SystemZ][z/OS] Reapply "Add support of stack guard on z/OS (#206045)" (#206622)
This PR reapplies changes in PR Add support of stack guard on z/OS
(#206045) and then
- Fixes a bug when emitting instruction `llgt`. The dest reg should be
def.
- Adds `--verify-machineinstr` to lit test.
[Dexter] Switch to using script-mode by default
This patch changes the default mode of Dexter from heuristic-mode to
script-mode. The --use-script argument is replaced with --use-heuristic,
some comments/docs/error messages are updated accordingly, and tests have
their flags switched accordingly.
[Dexter] Update lldb-based dexter-tests to use script-mode
This patch replaces uses of heuristic-mode Dexter in the dexter-tests suite
with uses of the script-mode, for tests that use DAP (via lldb-dap). The
updates are largely straightforward but occasionally non-trivial, and in
some cases some slight modifications have been made to keep the "spirit" of
the test intact.
[Dexter] Document the structured script model
This patch adds documentation for the script model to the Dexter README,
shunting heuristic-mode information into a separate doc, creating a new
doc for script-mode, and linking to both (with a brief summary of the
differences) from the base README.