Re: [PATCH 0/2] KVM: arm64: Fix stage-2 THP mapping on hosts with 2-level page tables

From: Marc Zyngier

Date: Sat Dec 05 2026 - 12:45:05 EST


On Mon, 23 Nov 2026 10:35:03 +0000, Fuad Tabba wrote:
> A fix for how KVM maps a THP at stage-2 on a host with 2-level page
> tables (64K pages with a 42-bit VA, or 16K pages with a 36-bit VA).
> There, KVM also maps the host memory that follows a THP into the guest
> if the guest's first access to the THP isn't to its first page.
>
> transparent_hugepage_adjust() is meant to round the faulting pfn down to
> the start of the THP, but its mask is a no-op when the PMD level is
> folded, and has been since THP support was added. Before 6f745f1bb5bf2
> ("KVM: arm64: Convert user_mem_abort() to generic page-table API"), KVM
> mapped only the THP anyway, which is why the Fixes: tag is on that
> commit. Kernels before f583a53c2b8a ("KVM: arm64: Make fault_ipa
> immutable") round the IPA with PMD_MASK, so only the pfn line of the fix
> applies there.
>
> [...]

Applied to fixes, thanks!

[1/2] KVM: arm64: Fix THP block mapping when the PMD level is folded
commit: fb92b5981ae3c0c2ecea37c234c73d821cfff005
[2/2] KVM: arm64: selftests: Test a THP whose first fault is on a tail page
commit: fd7b77b7fdebab211d7b624b41e2a8e0dcfac859

Cheers,

M.
--
Without deviation from the norm, progress is not possible.