diff options
| author | Fuad Tabba <fuad.tabba@linux.dev> | 2026-07-17 14:03:17 +0100 |
|---|---|---|
| committer | Oliver Upton <oupton@kernel.org> | 2026-07-31 00:11:57 -0700 |
| commit | 979ae12a2d090a2a858c72779d222baad78697a6 (patch) | |
| tree | 252a223061804ee63d43e9755a6c1ddcbf20fd7a /include/linux | |
| parent | c6f308b4d341a239c1ef7423b82d62f50fd87745 (diff) | |
KVM: arm64: selftests: Add stage-2 block transition test
Add a test for the two stage-2 granularity changes dirty logging forces
at fault time, asserting the guest completes with no KVM_RUN error. The
first scenario collapses a page into a hugetlb-backed block: it writes
under logging, re-write-protects the page via GET_DIRTY_LOG, then writes
again with logging off. The second splits blocks: it faults in several
non-executable 2M blocks, enables logging, then executes in each block so
an execute permission fault splits it. It is skipped when CTR_EL0.DIC is
set, since mappings are then executable and no execute fault occurs.
Both paths make the fault handler allocate under mmu_lock, so a backend
that fails to stage that memory returns a KVM_RUN error or crashes the
host. The property holds on any host. On a pKVM host, where a
non-protected guest uses the pkvm_pgtable_*() backend, it also guards
that backend's fault-time staging.
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
Tested-by: Bradley Morgan <include@grrlz.net> # On QEMU arm64 host
Test: Bradley Morgan <include@grrlz.net> # On QEMU arm64 host
Link: https://patch.msgid.link/20260717130317.1953574-8-fuad.tabba@linux.dev
Signed-off-by: Oliver Upton <oupton@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
