ia64/xen-unstable

changeset 5460:e9bf6cebd37d

bitkeeper revision 1.1709.2.1 (42b055c74fSyKGk_Y-GuAbNo-AI_ng)

ia64: Fix incorrect mapping bug; caused infrequent crashes
author djm@kirby.fc.hp.com
date Wed Jun 15 16:22:31 2005 +0000 (2005-06-15)
parents 01a9f1e50dd8
children 5da30c7f9999
files xen/arch/ia64/process.c
line diff
     1.1 --- a/xen/arch/ia64/process.c	Mon Jun 13 20:50:16 2005 +0000
     1.2 +++ b/xen/arch/ia64/process.c	Wed Jun 15 16:22:31 2005 +0000
     1.3 @@ -313,45 +313,31 @@ void xen_handle_domain_access(unsigned l
     1.4  	}
     1.5  if (address < 0x4000) printf("WARNING: page_fault @%p, iip=%p\n",address,iip);
     1.6  		
     1.7 +	if (trp = match_tr(current,address)) {
     1.8 +		// FIXME address had better be pre-validated on insert
     1.9 +		pteval = translate_domain_pte(trp->page_flags,address,trp->itir);
    1.10 +		vcpu_itc_no_srlz(current,6,address,pteval,-1UL,(trp->itir>>2)&0x3f);
    1.11 +		return;
    1.12 +	}
    1.13  	// if we are fortunate enough to have it in the 1-entry TLB...
    1.14  	if (pteval = match_dtlb(ed,address,&ps,NULL)) {
    1.15  		vcpu_itc_no_srlz(ed,6,address,pteval,-1UL,ps);
    1.16  		return;
    1.17  	}
    1.18 -	// look in the TRs
    1.19 -	fault = vcpu_tpa(ed,address,&mpaddr);
    1.20 -	if (fault != IA64_NO_FAULT) {
    1.21 -		static int uacnt = 0;
    1.22 -		// can't translate it, just fail (poor man's exception)
    1.23 -		// which results in retrying execution
    1.24 -//printk("*** xen_handle_domain_access: poor man's exception cnt=%i iip=%p, addr=%p...\n",uacnt++,iip,address);
    1.25 -		if (ia64_done_with_exception(regs)) {
    1.26 +	if (ia64_done_with_exception(regs)) {
    1.27  //if (!(uacnt++ & 0x3ff)) printk("*** xen_handle_domain_access: successfully handled cnt=%d iip=%p, addr=%p...\n",uacnt,iip,address);
    1.28  			return;
    1.29 -		}
    1.30 -		else {
    1.31 -			// should never happen.  If it does, region 0 addr may
    1.32 -			// indicate a bad xen pointer
    1.33 -			printk("*** xen_handle_domain_access: exception table"
    1.34 -                               " lookup failed, iip=%p, addr=%p, spinning...\n",
    1.35 -				iip,address);
    1.36 -			panic_domain(regs,"*** xen_handle_domain_access: exception table"
    1.37 -                               " lookup failed, iip=%p, addr=%p, spinning...\n",
    1.38 -				iip,address);
    1.39 -		}
    1.40  	}
    1.41 -	if (d == dom0) {
    1.42 -		if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) {
    1.43 -			printk("xen_handle_domain_access: vcpu_tpa returned out-of-bounds dom0 mpaddr %p! continuing...\n",mpaddr);
    1.44 -			tdpfoo();
    1.45 -		}
    1.46 +	else {
    1.47 +		// should never happen.  If it does, region 0 addr may
    1.48 +		// indicate a bad xen pointer
    1.49 +		printk("*** xen_handle_domain_access: exception table"
    1.50 +                       " lookup failed, iip=%p, addr=%p, spinning...\n",
    1.51 +			iip,address);
    1.52 +		panic_domain(regs,"*** xen_handle_domain_access: exception table"
    1.53 +                       " lookup failed, iip=%p, addr=%p, spinning...\n",
    1.54 +			iip,address);
    1.55  	}
    1.56 -//printk("*** xen_handle_domain_access: tpa resolved miss @%p...\n",address);
    1.57 -	pteval = lookup_domain_mpa(d,mpaddr);
    1.58 -	// would be nice to have a counter here
    1.59 -	//printf("Handling privop data TLB miss\n");
    1.60 -	// FIXME, must be inlined or potential for nested fault here!
    1.61 -	vcpu_itc_no_srlz(ed,2,address,pteval,-1UL,PAGE_SHIFT);
    1.62  }
    1.63  
    1.64  void ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *regs, unsigned long itir)
    1.65 @@ -441,7 +427,7 @@ panic_domain(0,"ia64_do_page_fault: @%p?
    1.66  				if (pteval & _PAGE_P)
    1.67  				{
    1.68  					pteval = translate_domain_pte(pteval,address,itir);
    1.69 -					vcpu_itc_no_srlz(current,is_data?2:1,address,pteval,-1UL,(itir>>2)&0x3f);
    1.70 +					vcpu_itc_no_srlz(current,is_data?6:1,address,pteval,-1UL,(itir>>2)&0x3f);
    1.71  					return;
    1.72  				}
    1.73  				else vector = is_data ? IA64_DATA_TLB_VECTOR : IA64_INST_TLB_VECTOR;