KVM: arm64: nv: Use GFP_KERNEL_ACCOUNT for sysreg_masks allocation
PATCH 1/1 KVM: arm64: nv: Use GFP_KERNEL_ACCOUNT for sysreg_masks allocation
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.
--- arch/arm64/kvm/nested.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kvm/nested.c +1 -1
@@ -196,7 +196,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;
base-commit: 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0
Signature · 1 line
2.45.2.627.g7a2c4fd464-goog
Quoted 24 lines · Oliver Upton
Of course, userspace is in the driver's seat for struct kvm and associated allocations. Make sure the
sysreg_masksallocation participates in kmem accounting.Signed-off-by Oliver Upton <[email protected]>--- arch/arm64/kvm/nested.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm64/kvm/nested.c +1
-1@@ -196,7 +196,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;
Quoted 1 line
base-commit:
1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0
Ah, well spotted.
M.
Signature · 1 line
Without deviation from the norm, progress is not possible.
Oliver Upton
AppliedQuoted 5 lines · Oliver Upton
Of course, userspace is in the driver's seat for struct kvm and associated allocations. Make sure the
sysreg_masksallocation participates in kmem accounting.
Applied to kvmarm/next, thanks!
[1/1] KVM: arm64: nv: Use GFP_KERNEL_ACCOUNT for sysreg_masks allocation
https://git.kernel.org/kvmarm/kvmarm/c/3dc14eefa504
--
Best,
Oliver