From: Isaku Yamahata Date: Mon, 5 Jan 2009 03:24:58 +0000 (+0900) Subject: [IA64] fix mis-setting ed bit for itlb entry for hvm domain. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14023 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d77e8b2664b19f16bdb90be4e7eca1ca04a2ba31;p=xen.git [IA64] fix mis-setting ed bit for itlb entry for hvm domain. This patch fixes a windows BSOD issue caused by mis-setting pte's ED bit for itlb entry. For hash vTLB, it uses unified tlb and doesn't differentiate itc and dtc in its implementation, so itlb_miss handler may reference dtlb entry in hash vTLB. But it may result in issues, because dtlb's ED bit may be different with itlb's setting. Since the case is very rare, so just purge the corresponding entry in hash vTLB and let guest OS to determin how to set ED bit for itlb mapping once found it. Signed-off-by : Xiantao Zhang --- diff --git a/xen/arch/ia64/vmx/vtlb.c b/xen/arch/ia64/vmx/vtlb.c index f36580e323..74b0da7f41 100644 --- a/xen/arch/ia64/vmx/vtlb.c +++ b/xen/arch/ia64/vmx/vtlb.c @@ -678,11 +678,20 @@ thash_data_t *vtlb_lookup(VCPU *v, u64 va,int is_data) cch = vtlb_thash(hcb->pta, va, vrr.rrval, &tag); do { if (cch->etag == tag && cch->ps == ps) - return cch; + goto found; cch = cch->next; } while(cch); } return NULL; +found: + if (unlikely(!cch->ed && is_data == ISIDE_TLB)) { + /*The case is very rare, and it may lead to incorrect setting + for itlb's ed bit! Purge it from hash vTLB and let guest os + determin the ed bit of the itlb entry.*/ + vtlb_purge(v, va, ps); + cch = NULL; + } + return cch; }