Re: [PATCH v6 3/5] kvm: arm64: New memslot flag to indicate cacheable mapping

Jason Gunthorpe
2025-05-27T00:26:56Z

On Sat, May 24, 2025 at 01:39:41AM +0000, ankita@nvidia.com wrote:
> From: Ankit Agrawal <ankita@nvidia.com>
>
> Introduce a new memslot flag KVM_MEM_ENABLE_CACHEABLE_PFNMAP
> as a tool for userspace to indicate that it expects a particular
> PFN range to be mapped cacheable.
>
> This will serve as a guide for the KVM to activate the code that
> allows cacheable PFNMAP.
>
> CC: Oliver Upton <oliver.upton@linux.dev>
> CC: Catalin Marinas <catalin.marinas@arm.com>
> CC: Jason Gunthorpe <jgg@nvidia.com>
> Suggested-by: Marc Zyngier <maz@kernel.org>
> Signed-off-by: Ankit Agrawal <ankita@nvidia.com>
> ---
> include/uapi/linux/kvm.h | 1 +
> virt/kvm/kvm_main.c | 3 ++-
> 2 files changed, 3 insertions(+), 1 deletion(-)

I thought we agreed not to do this? Sean was strongly against it
right?

There is no easy way for VFIO to know to set it, and the kernel will
not allow switching a cachable VMA to non-cachable anyhow.

So all it does is make it harder to create a memslot.

Jason