KVM: arm64: nv: Use GFP_KERNEL_ACCOUNT for sysreg_masks allocation
authorOliver Upton <oliver.upton@linux.dev>
Mon, 17 Jun 2024 18:10:18 +0000 (18:10 +0000)
committerOliver Upton <oliver.upton@linux.dev>
Wed, 19 Jun 2024 08:42:39 +0000 (08:42 +0000)
Of course, userspace is in the driver's seat for struct kvm and
associated allocations. Make sure the sysreg_masks allocation
participates in kmem accounting.

Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20240617181018.2054332-1-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/nested.c

index 0acb602734826a092769e41de08b21dedc1a3d06..913018e4cdae3a4466bde536aa4e864aee25609a 100644 (file)
@@ -198,7 +198,7 @@ int kvm_init_nv_sysregs(struct kvm *kvm)
                goto out;
 
        kvm->arch.sysreg_masks = kzalloc(sizeof(*(kvm->arch.sysreg_masks)),
-                                        GFP_KERNEL);
+                                        GFP_KERNEL_ACCOUNT);
        if (!kvm->arch.sysreg_masks) {
                ret = -ENOMEM;
                goto out;