diff mbox series

KVM: SVM: Account scratch allocations used to decrypt SEV guest memory

Message ID 20230113220923.2834699-1-aghulati@google.com (mailing list archive)
State New, archived
Headers show
Series KVM: SVM: Account scratch allocations used to decrypt SEV guest memory | expand

Commit Message

Anish Ghulati Jan. 13, 2023, 10:09 p.m. UTC
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>
---
 arch/x86/kvm/svm/sev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sean Christopherson Jan. 19, 2023, 9:03 p.m. UTC | #1
On Fri, 13 Jan 2023 22:09:23 +0000, Anish Ghulati wrote:
> 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.
> 
> 

Applied to kvm-x86 svm, thanks!

[1/1] KVM: SVM: Account scratch allocations used to decrypt SEV guest memory
      https://github.com/kvm-x86/linux/commit/e78dfc2b6ff0

--
https://github.com/kvm-x86/linux/tree/next
https://github.com/kvm-x86/linux/tree/fixes
diff mbox series

Patch

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;