Skip to content
  • Peter Xu's avatar
    KVM: X86: Force ASYNC_PF_PER_VCPU to be power of two · dd03bcaa
    Peter Xu authored
    
    
    Forcing the ASYNC_PF_PER_VCPU to be power of two is much easier to be
    used rather than calling roundup_pow_of_two() from time to time.  Do
    this by adding a BUILD_BUG_ON() inside the hash function.
    
    Another point is that generally async pf does not allow concurrency
    over ASYNC_PF_PER_VCPU after all (see kvm_setup_async_pf()), so it
    does not make much sense either to have it not a power of two or some
    of the entries will definitely be wasted.
    
    Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
    Message-Id: <20200416155859.267366-1-peterx@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    dd03bcaa