]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: SEV: Use long-term pin when registering encrypted memory regions
authorGe Yang <yangge1116@126.com>
Tue, 11 Feb 2025 02:37:03 +0000 (10:37 +0800)
committerSean Christopherson <seanjc@google.com>
Wed, 12 Feb 2025 18:50:42 +0000 (10:50 -0800)
commit7e066cb9b71a22c3e5ef233de63ff14525baf6f0
tree1afbb2fa00453556691a1979e9b40d6b70a01b0d
parenta6136669da6314691d4d8d1139ea19346c68d2cf
KVM: SEV: Use long-term pin when registering encrypted memory regions

When registering an encrypted memory region for SEV-MEM/SEV-ES guests,
pin the pages with FOLL_TERM so that the pages are migrated out of
MIGRATE_CMA/ZONE_MOVABLE.  Failure to do so violates the CMA/MOVABLE
mechanisms and can result in fragmentation due to unmovable pages, e.g.
can make CMA allocations fail.

Signed-off-by: Ge Yang <yangge1116@126.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Acked-by: David Hildenbrand <david@redhat.com>
Link: https://lore.kernel.org/r/1739241423-14326-1-git-send-email-yangge1116@126.com
[sean: massage changelog, make @flags an unsigned int]
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/sev.c