Re: [PATCH] KVM: SEV: drop FOLL_LONGTERM for encrypted region registration

From: Gupta, Pankaj

Date: Wed Jul 15 2026 - 02:38:57 EST



On 7/10/2026 6:38 PM, David Hildenbrand (Arm) wrote:
How long ago did I break this though? Why has it taken until now for this to be
reported? :) commit 8ac268436e6d ("mm/gup: disallow FOLL_LONGTERM GUP-nonfast
writing to file-backed mappings") is from May 2023 :)
The break didn't come from your changes, it came from commit 7e066cb9b71a ("KVM:
SEV: Use long-term pin when registering encrypted memory regions"). I suggested
falling back to a non-longterm pin, but David didn't like that idea :-)
Yes, a longterm pin is a longterm pin.

If we don't write to the memory, why do we need a write pin? To make sure that
what we pin was actually unshared?

Well, FOLL_LONGTERM does that nowadays.


... so is maybe dropping the FOLL_WRITE sufficient?

Yes, All that is correct. Sent a v2.

Thank you!

Pankaj