aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch/x86/kvm/svm/sev.c
diff options
context:
space:
mode:
authorAnish Ghulati <aghulati@google.com>2023-01-13 22:09:23 +0000
committerSean Christopherson <seanjc@google.com>2023-01-24 10:06:48 -0800
commita31b531cd2fa2e6b2a736833a94b990d5cf56b40 (patch)
treea49c6a86c5e1d7504e83aeed7abb7ee83a47df02 /arch/x86/kvm/svm/sev.c
parentKVM: svm/avic: Drop "struct kvm_x86_ops" for avic_hardware_setup() (diff)
downloadwireguard-linux-a31b531cd2fa2e6b2a736833a94b990d5cf56b40.tar.xz
wireguard-linux-a31b531cd2fa2e6b2a736833a94b990d5cf56b40.zip
KVM: SVM: Account scratch allocations used to decrypt SEV guest memory
Account the temp/scratch allocation used to decrypt unaligned debug accesses to SEV guest memory, the allocation is very much tied to the target VM. Reported-by: Mingwei Zhang <mizhang@google.com> Signed-off-by: Anish Ghulati <aghulati@google.com> Link: https://lore.kernel.org/r/20230113220923.2834699-1-aghulati@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'arch/x86/kvm/svm/sev.c')
-rw-r--r--arch/x86/kvm/svm/sev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
index 273cba809328..a5e4c5ef7c9e 100644
--- a/arch/x86/kvm/svm/sev.c
+++ b/arch/x86/kvm/svm/sev.c
@@ -813,7 +813,7 @@ static int __sev_dbg_decrypt_user(struct kvm *kvm, unsigned long paddr,
if (!IS_ALIGNED(dst_paddr, 16) ||
!IS_ALIGNED(paddr, 16) ||
!IS_ALIGNED(size, 16)) {
- tpage = (void *)alloc_page(GFP_KERNEL | __GFP_ZERO);
+ tpage = (void *)alloc_page(GFP_KERNEL_ACCOUNT | __GFP_ZERO);
if (!tpage)
return -ENOMEM;