/* Return the pointer to the largepage write count for a given gfn, handling slots that are not large page aligned.  */
static int* slot_largepage_idx(gfn_t gfn, struct kvm_memory_slot *slot, int level)
/* Return the pointer to the largepage write count for a given gfn, handling slots that are not large page aligned.  */
static int* slot_largepage_idx(gfn_t gfn, struct kvm_memory_slot *slot, int level)
{
	unsigned long idx;
	idx = (gfn / KVM_PAGES_PER_HPAGE(level)) -
	      (slot->base_gfn / KVM_PAGES_PER_HPAGE(level));
	return &slot->lpage_info[level - 2][idx].write_count;
}