Skip to content

Commit ebdec85

Browse files
mzhang3579bonzini
authored andcommitted
KVM: x86/svm: add __GFP_ACCOUNT to __sev_dbg_{en,de}crypt_user()
Adding the accounting flag when allocating pages within the SEV function, since these memory pages should belong to individual VM. No functional change intended. Signed-off-by: Mingwei Zhang <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 6945b21 commit ebdec85

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/kvm/svm/sev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ static int __sev_dbg_encrypt_user(struct kvm *kvm, unsigned long paddr,
844844

845845
/* If source buffer is not aligned then use an intermediate buffer */
846846
if (!IS_ALIGNED((unsigned long)vaddr, 16)) {
847-
src_tpage = alloc_page(GFP_KERNEL);
847+
src_tpage = alloc_page(GFP_KERNEL_ACCOUNT);
848848
if (!src_tpage)
849849
return -ENOMEM;
850850

@@ -865,7 +865,7 @@ static int __sev_dbg_encrypt_user(struct kvm *kvm, unsigned long paddr,
865865
if (!IS_ALIGNED((unsigned long)dst_vaddr, 16) || !IS_ALIGNED(size, 16)) {
866866
int dst_offset;
867867

868-
dst_tpage = alloc_page(GFP_KERNEL);
868+
dst_tpage = alloc_page(GFP_KERNEL_ACCOUNT);
869869
if (!dst_tpage) {
870870
ret = -ENOMEM;
871871
goto e_free;

0 commit comments

Comments
 (0)