/* INPUT: in: TLB format for both VHPT & TLB.  */
struct thash_data* vtlb_lookup(struct kvm_vcpu *v, u64 va, int is_data)
/* INPUT: in: TLB format for both VHPT & TLB.  */
struct thash_data* vtlb_lookup(struct kvm_vcpu *v, u64 va, int is_data)
{
	struct thash_data  *cch;
	u64    psbits, ps, tag;
	union ia64_rr vrr;
	struct thash_cb *hcb = &v->arch.vtlb;
	cch = __vtr_lookup(v, va, is_data);
	if (cch)
		return cch;
	if (vcpu_quick_region_check(v->arch.tc_regions, va) == 0)
		return NULL;
	psbits = VMX(v, psbits[(va >> 61)]);
	vrr.val = vcpu_get_rr(v, va);
	while (psbits) {
		ps = __ffs(psbits);
		psbits &= ~(1UL << ps);
		vrr.ps = ps;
		cch = vsa_thash(hcb->pta, va, vrr.val, &tag);
		if (cch->etag == tag && cch->ps == ps)
			return cch;
	}
	return NULL;
}