Re: [PATCH v6 5/9] KVM: guest_memfd: Add helpers to query SHARED vs. PRIVATE for a given page

From: Xiaoyao Li

Date: Mon Jul 27 2026 - 04:55:19 EST


On 7/24/2026 5:08 AM, Sean Christopherson wrote:
Add helpers to check if a given page in a guest_memfd instance is PRIVATE
versus SHARED, and use the "is shared" helper instead of an open-coded
equivalent in the user pagefault handler. In addition to the immediate
usage, providing an "is private" helper will allow cleaning up the so
called prepare() code, and eventually will be heavily used once in-place
conversion support comes along.

No functional change intended.

Signed-off-by: Sean Christopherson<seanjc@xxxxxxxxxx>

Reviewed-by: Xiaoyao Li <xiaoyao.li@xxxxxxxxx>