/* Insert an entry into hash TLB or VHPT. NOTES: 1: When inserting VHPT to thash, "va" is a must covered address by the inserted machine VHPT entry. 2: The format of entry is always in TLB. 3: The caller need to make sure the new entry will not overlap with any existed entry.  */
void vtlb_insert(struct kvm_vcpu *v, u64 pte, u64 itir, u64 va)
/* Insert an entry into hash TLB or VHPT. NOTES: 1: When inserting VHPT to thash, "va" is a must covered address by the inserted machine VHPT entry. 2: The format of entry is always in TLB. 3: The caller need to make sure the new entry will not overlap with any existed entry.  */
void vtlb_insert(struct kvm_vcpu *v, u64 pte, u64 itir, u64 va)
{
	struct thash_data *head;
	union ia64_rr vrr;
	u64 tag;
	struct thash_cb *hcb = &v->arch.vtlb;
	vrr.val = vcpu_get_rr(v, va);
	vrr.ps = itir_ps(itir);
	VMX(v, psbits[va >> 61]) |= (1UL << vrr.ps);
	head = vsa_thash(hcb->pta, va, vrr.val, &tag);
	head->page_flags = pte;
	head->itir = itir;
	head->etag = tag;
}