/* Take gfn and return the reverse mapping to it. Note: gfn must be unaliased before this function get called  */
static unsigned long* gfn_to_rmap(struct kvm *kvm, gfn_t gfn, int level)
/* Take gfn and return the reverse mapping to it. Note: gfn must be unaliased before this function get called  */
static unsigned long* gfn_to_rmap(struct kvm *kvm, gfn_t gfn, int level)
{
	struct kvm_memory_slot *slot;
	unsigned long idx;
	slot = gfn_to_memslot(kvm, gfn);
	if (likely(level == PT_PAGE_TABLE_LEVEL))
		return &slot->rmap[gfn - slot->base_gfn];
	idx = (gfn / KVM_PAGES_PER_HPAGE(level)) -
		(slot->base_gfn / KVM_PAGES_PER_HPAGE(level));
	return &slot->lpage_info[level - 2][idx].rmap_pde;
}