summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kvm/arm.c
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2021-10-17 12:29:36 +0200
committerMarc Zyngier <maz@kernel.org>2021-10-17 12:29:36 +0200
commit5f8b2591decb8920ba907373aee3aa48e7cc0d78 (patch)
treee309e5055f620da41288fb34265979abdf249d7f /arch/arm64/kvm/arm.c
parentMerge branch kvm-arm64/selftest/timer into kvmarm-master/next (diff)
parentKVM: arm64: Add memcg accounting to KVM allocations (diff)
downloadlinux-5f8b2591decb8920ba907373aee3aa48e7cc0d78.tar.xz
linux-5f8b2591decb8920ba907373aee3aa48e7cc0d78.zip
Merge branch kvm-arm64/memory-accounting into kvmarm-master/next
* kvm-arm64/memory-accounting: : . : Sprinkle a bunch of GFP_KERNEL_ACCOUNT all over the code base : to better track memory allocation made on behalf of a VM. : . KVM: arm64: Add memcg accounting to KVM allocations KVM: arm64: vgic: Add memcg accounting to vgic allocations Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'arch/arm64/kvm/arm.c')
-rw-r--r--arch/arm64/kvm/arm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
index 3724dc55737a..a469a817ca86 100644
--- a/arch/arm64/kvm/arm.c
+++ b/arch/arm64/kvm/arm.c
@@ -291,10 +291,12 @@ long kvm_arch_dev_ioctl(struct file *filp,
struct kvm *kvm_arch_alloc_vm(void)
{
+ size_t sz = sizeof(struct kvm);
+
if (!has_vhe())
- return kzalloc(sizeof(struct kvm), GFP_KERNEL);
+ return kzalloc(sz, GFP_KERNEL_ACCOUNT);
- return vzalloc(sizeof(struct kvm));
+ return __vmalloc(sz, GFP_KERNEL_ACCOUNT | __GFP_HIGHMEM | __GFP_ZERO);
}
void kvm_arch_free_vm(struct kvm *kvm)