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

From: David Hildenbrand (Arm)

Date: Fri Jul 10 2026 - 12:40:54 EST


>>
>> 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?

--
Cheers,

David