#include "irq.h"
 #include "fpu.h"
 
-#define KVM_HV_MAX_SPARSE_VCPU_SET_BITS DIV_ROUND_UP(KVM_MAX_VCPUS, 64)
+#define KVM_HV_MAX_SPARSE_VCPU_SET_BITS DIV_ROUND_UP(KVM_MAX_VCPUS, HV_VCPUS_PER_SPARSE_BANK)
 
 static void stimer_mark_pending(struct kvm_vcpu_hv_stimer *stimer,
                                bool vcpu_kick);
                                 u64 *sparse_banks, int consumed_xmm_halves,
                                 gpa_t offset)
 {
-       if (hc->var_cnt > 64)
+       if (hc->var_cnt > HV_MAX_SPARSE_VCPU_BANKS)
                return -EINVAL;
 
        /* Cap var_cnt to ignore banks that cannot contain a legal VP index. */
        gpa_t data_offset;
 
        /*
-        * The Hyper-V TLFS doesn't allow more than 64 sparse banks, e.g. the
-        * valid mask is a u64.  Fail the build if KVM's max allowed number of
-        * vCPUs (>4096) would exceed this limit, KVM will additional changes
-        * for Hyper-V support to avoid setting the guest up to fail.
+        * The Hyper-V TLFS doesn't allow more than HV_MAX_SPARSE_VCPU_BANKS
+        * sparse banks. Fail the build if KVM's max allowed number of
+        * vCPUs (>4096) exceeds this limit.
         */
-       BUILD_BUG_ON(KVM_HV_MAX_SPARSE_VCPU_SET_BITS > 64);
+       BUILD_BUG_ON(KVM_HV_MAX_SPARSE_VCPU_SET_BITS > HV_MAX_SPARSE_VCPU_BANKS);
 
        /*
         * 'Slow' hypercall's first parameter is the address in guest's memory