KVM: arm64: Assume non-PFNMAP/MIXEDMAP VMAs can be mapped cacheable
authorAnkit Agrawal <ankita@nvidia.com>
Sat, 5 Jul 2025 07:17:13 +0000 (07:17 +0000)
committerOliver Upton <oliver.upton@linux.dev>
Mon, 7 Jul 2025 14:50:20 +0000 (07:50 -0700)
commit216887f79d9878d9cb169729fea3bb16c56db465
treecf96722801cd97c433e1d03a1045e3445cd23e94
parent8cc9dc1ae4fb075e29e2d5cf2386761d3497049a
KVM: arm64: Assume non-PFNMAP/MIXEDMAP VMAs can be mapped cacheable

Despite its name, kvm_is_device_pfn() is actually used to determine if a
given PFN has a kernel mapping that can be used to perform cache
maintenance, as it calls pfn_is_map_memory() internally.

Expand the helper into its single callsite and further condition the
check on the VMA having either VM_PFNMAP or VM_MIXEDMAP set. VMAs that
set neither of these flags must always contain Normal, struct page
backed memory with valid aliases in the kernel address space.

Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Tested-by: Donald Dutile <ddutile@redhat.com>
Signed-off-by: Ankit Agrawal <ankita@nvidia.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20250705071717.5062-3-ankita@nvidia.com
[ Oliver: fixed typos, refined changelog ]
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/mmu.c