ia64/xen-unstable

changeset 5138:fa3c1c925b22

bitkeeper revision 1.1509.1.3 (42939f31KzK-SwtLziu7eM9buqA-bg)

Fix xen/xenlinux to work with CONFIG_DISABLE_VHPT off
and CONFIG_VIRTUAL_MEM_MAP=y

Signed-off-by: Matthew Chapman <matthewc@hp.com>
Signed-off by: Dan Magenheimer <dan.magenheimer@hp.com>
author djm@kirby.fc.hp.com
date Tue May 24 21:40:01 2005 +0000 (2005-05-24)
parents 775c8a5acfc8
children ebdeb9b86189
files xen/arch/ia64/ivt.S xen/arch/ia64/privop.c xen/arch/ia64/process.c xen/arch/ia64/tools/README.xenia64 xen/arch/ia64/tools/README.xenia64linux xen/arch/ia64/vcpu.c
line diff
     1.1 --- a/xen/arch/ia64/ivt.S	Mon May 23 23:05:04 2005 +0000
     1.2 +++ b/xen/arch/ia64/ivt.S	Tue May 24 21:40:01 2005 +0000
     1.3 @@ -785,14 +785,18 @@ ENTRY(break_fault)
     1.4  	cmp.eq p7,p0=r0,r17			// is this a psuedo-cover?
     1.5  (p7)	br.sptk.many dispatch_privop_fault
     1.6  	;;
     1.7 -	cmp.ne p7,p0=r0,r19
     1.8 +	cmp4.ne p7,p0=r0,r19
     1.9  (p7)	br.sptk.many dispatch_break_fault
    1.10  	// If we get to here, we have a hyperprivop
    1.11  	// For now, hyperprivops are handled through the break mechanism
    1.12  	// Later, they will be fast hand-coded assembly with psr.ic off
    1.13  	// which means no calls, no use of r1-r15 and no memory accesses
    1.14  	// except to pinned addresses!
    1.15 +#ifdef FAST_HYPERPRIVOPS
    1.16 +	br.sptk.many fast_hyperprivop
    1.17 +#else
    1.18  	br.sptk.many dispatch_break_fault
    1.19 +#endif
    1.20  	;;
    1.21  #endif
    1.22  	mov r16=IA64_KR(CURRENT)		// r16 = current task; 12 cycle read lat.
     2.1 --- a/xen/arch/ia64/privop.c	Mon May 23 23:05:04 2005 +0000
     2.2 +++ b/xen/arch/ia64/privop.c	Tue May 24 21:40:01 2005 +0000
     2.3 @@ -569,7 +569,7 @@ priv_handle_op(VCPU *vcpu, REGS *regs, i
     2.4  #endif
     2.5  	{
     2.6  //printf("*** priv_handle_op: privop bundle @%p not mapped, retrying\n",iip);
     2.7 -		return IA64_RETRY;
     2.8 +		return vcpu_force_data_miss(vcpu,regs->cr_iip);
     2.9  	}
    2.10  #if 0
    2.11  	if (iip==0xa000000100001820) {
    2.12 @@ -732,30 +732,10 @@ priv_emulate(VCPU *vcpu, REGS *regs, UIN
    2.13  	privlvl = (ipsr & IA64_PSR_CPL) >> IA64_PSR_CPL0_BIT;
    2.14  	// its OK for a privified-cover to be executed in user-land
    2.15  	fault = priv_handle_op(vcpu,regs,privlvl);
    2.16 -	if (fault == IA64_NO_FAULT) { // success!!
    2.17 +	if ((fault == IA64_NO_FAULT) || (fault == IA64_EXTINT_VECTOR)) { // success!!
    2.18  		// update iip/ipsr to point to the next instruction
    2.19  		(void)vcpu_increment_iip(vcpu);
    2.20  	}
    2.21 -	else if (fault == IA64_EXTINT_VECTOR) {
    2.22 -		// update iip/ipsr before delivering interrupt
    2.23 -		(void)vcpu_increment_iip(vcpu);
    2.24 -	}
    2.25 -	else if (fault == IA64_RFI_IN_PROGRESS) return fault;
    2.26 -		// success but don't update to next instruction
    2.27 -        else if (fault == IA64_RETRY) {
    2.28 -            //printf("Priv emulate gets IA64_RETRY\n");
    2.29 -	    //printf("priv_emulate: returning RETRY, not implemented!\n");
    2.30 -	    //while (1);
    2.31 -	    // don't update iip/ipsr, deliver 
    2.32 -	
    2.33 -            vcpu_force_data_miss(vcpu,regs->cr_iip);
    2.34 -	    return IA64_RETRY;
    2.35 -        }
    2.36 -	else if (priv_verbose) printf("unhandled operation from handle_op\n");
    2.37 -//	if (fault == IA64_ILLOP_FAULT) {
    2.38 -//		printf("priv_emulate: returning ILLOP, not implemented!\n");
    2.39 -//		while (1);
    2.40 -//	}
    2.41  	return fault;
    2.42  }
    2.43  
     3.1 --- a/xen/arch/ia64/process.c	Mon May 23 23:05:04 2005 +0000
     3.2 +++ b/xen/arch/ia64/process.c	Tue May 24 21:40:01 2005 +0000
     3.3 @@ -170,16 +170,11 @@ panic_domain(regs,"psr.ic off, deliverin
     3.4  	if ((vector & 0xf) != IA64_FORCED_IFA) PSCB(ed,ifa) = ifa;
     3.5  	else ifa = PSCB(ed,ifa);
     3.6  	vector &= ~0xf;
     3.7 -//	always deliver on ALT vector (for now?) because no VHPT
     3.8 -//	if (!vcpu_get_rr_ve(ed,ifa)) {
     3.9 -		if (vector == IA64_DATA_TLB_VECTOR)
    3.10 -			vector = IA64_ALT_DATA_TLB_VECTOR;
    3.11 -		else if (vector == IA64_INST_TLB_VECTOR)
    3.12 -			vector = IA64_ALT_INST_TLB_VECTOR;
    3.13 -//	}
    3.14 -	if (vector == IA64_ALT_DATA_TLB_VECTOR ||
    3.15 -	    vector == IA64_ALT_INST_TLB_VECTOR) {
    3.16 -		vcpu_thash(ed,ifa,&PSCB(ed,iha));
    3.17 +	if (vector == IA64_DATA_TLB_VECTOR
    3.18 +		|| vector == IA64_ALT_DATA_TLB_VECTOR
    3.19 +		|| vector == IA64_INST_TLB_VECTOR
    3.20 +		|| vector == IA64_ALT_INST_TLB_VECTOR) {
    3.21 +		vcpu_thash(ed,ifa,&PSCB(current,iha));
    3.22  	}
    3.23  	PSCB(ed,unat) = regs->ar_unat;  // not sure if this is really needed?
    3.24  	PSCB(ed,precover_ifs) = regs->cr_ifs;
    3.25 @@ -367,7 +362,7 @@ void ia64_do_page_fault (unsigned long a
    3.26  		vcpu_itc_no_srlz(current,is_data?2:1,address,pteval,-1UL,(trp->itir>>2)&0x3f);
    3.27  		return;
    3.28  	}
    3.29 -	vector = is_data ? IA64_DATA_TLB_VECTOR : IA64_INST_TLB_VECTOR;
    3.30 +
    3.31  	if (handle_lazy_cover(current, isr, regs)) return;
    3.32  if (!(address>>61)) {
    3.33  panic_domain(0,"ia64_do_page_fault: @%p???, iip=%p, itc=%p (spinning...)\n",address,iip,ia64_get_itc());
    3.34 @@ -383,6 +378,9 @@ panic_domain(0,"ia64_do_page_fault: @%p?
    3.35  		ia64_psr(regs)->ed = 1;
    3.36  		return;
    3.37  	}
    3.38 +	vector = vcpu_get_rr_ve(current, address) ? 
    3.39 +			(is_data ? IA64_DATA_TLB_VECTOR : IA64_INST_TLB_VECTOR)
    3.40 +			: (is_data ? IA64_ALT_DATA_TLB_VECTOR : IA64_ALT_INST_TLB_VECTOR);
    3.41  	reflect_interruption(address, isr, itir, regs, vector);
    3.42  }
    3.43  
     4.1 --- a/xen/arch/ia64/tools/README.xenia64	Mon May 23 23:05:04 2005 +0000
     4.2 +++ b/xen/arch/ia64/tools/README.xenia64	Tue May 24 21:40:01 2005 +0000
     4.3 @@ -6,18 +6,16 @@
     4.4  
     4.5  # unpack linux-2.6.11 in the xenXXX.bk/.. directory
     4.6  tar xzf linux-2.6.11.tar.gz
     4.7 -cd linux-2.6.11
     4.8  
     4.9  # go back to the xen subdirectory of xenXXX.bk
    4.10  cd xenXXX.bk/xen
    4.11  
    4.12  # create and patch the linux/ia64 files
    4.13 -bash arch/ia64/tools/mkbuildtree
    4.14  # this should print out many patch messages but no errors
    4.15  bash arch/ia64/tools/mkbuildtree
    4.16  
    4.17  # build xen/ia64
    4.18  # if using cross-compiler
    4.19 -make TARGET_ARCH=ia64
    4.20 +make XEN_TARGET_ARCH=ia64
    4.21  # else if native
    4.22  make
     5.1 --- a/xen/arch/ia64/tools/README.xenia64linux	Mon May 23 23:05:04 2005 +0000
     5.2 +++ b/xen/arch/ia64/tools/README.xenia64linux	Tue May 24 21:40:01 2005 +0000
     5.3 @@ -6,7 +6,6 @@ 2) vi .config
     5.4  	unset CONFIG_IA32_SUPPORT
     5.5  	unset CONFIG_IDE [for now, need to fix later]
     5.6  	unset CONFIG_VIRTUAL_MEM_MAP [for now, need to fix later]
     5.7 -	set CONFIG_DISABLE_VHPT
     5.8  3) if running on ski, it is useful to make the following change:
     5.9     a) at the beginning of drivers/acpi/motherboard.c:acpi_reserve_resources()
    5.10        add the line:
    5.11 @@ -46,5 +45,6 @@ 6) debug fixes:
    5.12             (It may be necessary also to un-inline the routine, not sure.)
    5.13     c) It can be useful to modify linux/init/main.c to add a printf before
    5.14        or after a lot of the init calls
    5.15 -6) NOTE: mca currently has a problem with binary translation,
    5.16 +6) Start Xen from elilo, passing the Linux kernel as an initrd.
    5.17 +   NOTE: mca currently has a problem with binary translation,
    5.18     must run with "nomca" as a kernel argument
     6.1 --- a/xen/arch/ia64/vcpu.c	Mon May 23 23:05:04 2005 +0000
     6.2 +++ b/xen/arch/ia64/vcpu.c	Tue May 24 21:40:01 2005 +0000
     6.3 @@ -1118,7 +1118,7 @@ Privileged operation emulation routines
     6.4  IA64FAULT vcpu_force_data_miss(VCPU *vcpu, UINT64 ifa)
     6.5  {
     6.6  	PSCB(vcpu,ifa) = ifa;	// privop traps don't set ifa so do it here
     6.7 -	return (IA64_DATA_TLB_VECTOR | IA64_FORCED_IFA);
     6.8 +	return (vcpu_get_rr_ve(vcpu,ifa) ? IA64_DATA_TLB_VECTOR : IA64_ALT_DATA_TLB_VECTOR) | IA64_FORCED_IFA;
     6.9  }
    6.10  
    6.11  
    6.12 @@ -1617,7 +1617,7 @@ IA64FAULT vcpu_itc_d(VCPU *vcpu, UINT64 
    6.13  	unsigned long pteval, logps = (itir >> 2) & 0x3f;
    6.14  	unsigned long translate_domain_pte(UINT64,UINT64,UINT64);
    6.15  
    6.16 -	if (((itir & 0xfcL) >> 2) < PAGE_SHIFT) {
    6.17 +	if (logps < PAGE_SHIFT) {
    6.18  		printf("vcpu_itc_d: domain trying to use smaller page size!\n");
    6.19  		//FIXME: kill domain here
    6.20  		while(1);
    6.21 @@ -1635,7 +1635,7 @@ IA64FAULT vcpu_itc_i(VCPU *vcpu, UINT64 
    6.22  	unsigned long translate_domain_pte(UINT64,UINT64,UINT64);
    6.23  
    6.24  	// FIXME: validate ifa here (not in Xen space), COULD MACHINE CHECK!
    6.25 -	if (((itir & 0xfcL) >> 2) < PAGE_SHIFT) {
    6.26 +	if (logps < PAGE_SHIFT) {
    6.27  		printf("vcpu_itc_i: domain trying to use smaller page size!\n");
    6.28  		//FIXME: kill domain here
    6.29  		while(1);