• Marc Orr's avatar
    kvm: Make VM ioctl do valloc for some archs · d1e5b0e9
    Marc Orr authored
    The kvm struct has been bloating. For example, it's tens of kilo-bytes
    for x86, which turns out to be a large amount of memory to allocate
    contiguously via kzalloc. Thus, this patch does the following:
    1. Uses architecture-specific routines to allocate the kvm struct via
       vzalloc for x86.
    2. Switches arm to __KVM_HAVE_ARCH_VM_ALLOC so that it can use vzalloc
       when has_vhe() is true.
    
    Other architectures continue to default to kalloc, as they have a
    dependency on kalloc or have a small-enough struct kvm.
    Signed-off-by: default avatarMarc Orr <marcorr@google.com>
    Reviewed-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    d1e5b0e9
kvm_host.h 9.97 KB