• David Stevens's avatar
    KVM: x86: only allocate gfn_track when necessary · deae4a10
    David Stevens authored
    Avoid allocating the gfn_track arrays if nothing needs them. If there
    are no external to KVM users of the API (i.e. no GVT-g), then page
    tracking is only needed for shadow page tables. This means that when tdp
    is enabled and there are no external users, then the gfn_track arrays
    can be lazily allocated when the shadow MMU is actually used. This avoid
    allocations equal to .05% of guest memory when nested virtualization is
    not used, if the kernel is compiled without GVT-g.
    Signed-off-by: default avatarDavid Stevens <stevensd@chromium.org>
    Message-Id: <20210922045859.2011227-3-stevensd@google.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    deae4a10
kvm_page_track.h 2.57 KB