KVM: Add support for read-only usage of gfn_to_page()
authorSean Christopherson <seanjc@google.com>
Thu, 10 Oct 2024 18:24:18 +0000 (11:24 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 25 Oct 2024 17:00:50 +0000 (13:00 -0400)
commitf42e289a2095f61755e6ca5fd1370d441bf589d5
treefce15b66ea8ee18be28f3e409a1748bdcd20c5c2
parentce6bf70346891f75e400f93193773fcbf72c27fc
KVM: Add support for read-only usage of gfn_to_page()

Rework gfn_to_page() to support read-only accesses so that it can be used
by arm64 to get MTE tags out of guest memory.

Opportunistically rewrite the comment to be even more stern about using
gfn_to_page(), as there are very few scenarios where requiring a struct
page is actually the right thing to do (though there are such scenarios).
Add a FIXME to call out that KVM probably should be pinning pages, not
just getting pages.

Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-ID: <20241010182427.1434605-77-seanjc@google.com>
include/linux/kvm_host.h
virt/kvm/kvm_main.c