History

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.

Mingwei Zhang committed 4 years ago

Commit ebdec851 parent 6945b211 file · +2 −2Browse files

Unified · Split

arch/x86/kvm/svm/sev.c+2−2
@@ -844,7 +844,7 @@ static int __sev_dbg_encrypt_user(struct kvm *kvm, unsigned long paddr, · 843 unmodified lines
844 844
845 /* If source buffer is not aligned then use an intermediate buffer */845 /* If source buffer is not aligned then use an intermediate buffer */
846 if (!IS_ALIGNED((unsigned long)vaddr, 16)) {846 if (!IS_ALIGNED((unsigned long)vaddr, 16)) {
847 src_tpage = alloc_page(GFP_KERNEL);847 src_tpage = alloc_page(GFP_KERNEL_ACCOUNT);
848 if (!src_tpage)848 if (!src_tpage)
849 return -ENOMEM;849 return -ENOMEM;
850 850
@@ -865,7 +865,7 @@ static int __sev_dbg_encrypt_user(struct kvm *kvm, unsigned long paddr, · 14 unmodified lines
865 if (!IS_ALIGNED((unsigned long)dst_vaddr, 16) || !IS_ALIGNED(size, 16)) {865 if (!IS_ALIGNED((unsigned long)dst_vaddr, 16) || !IS_ALIGNED(size, 16)) {
866 int dst_offset;866 int dst_offset;
867 867
868 dst_tpage = alloc_page(GFP_KERNEL);868 dst_tpage = alloc_page(GFP_KERNEL_ACCOUNT);
869 if (!dst_tpage) {869 if (!dst_tpage) {
870 ret = -ENOMEM;870 ret = -ENOMEM;
871 goto e_free;871 goto e_free;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t