ia64/xen-unstable

changeset 5171:1f630bfd83f5

bitkeeper revision 1.1564.1.1 (4295f12eiFrDNUdC-D7-zJOe_Af1fA)

Merge bk://xen.bkbits.net/xeno-unstable.bk
into bkbits.net:/repos/x/xen-ia64/xeno-unstable-ia64.bk
author xen-ia64.adm@bkbits.net
date Thu May 26 15:54:22 2005 +0000 (2005-05-26)
parents 41a5c6143c83 ebdeb9b86189
children 34b95079edb9
files xen/arch/ia64/Makefile xen/arch/ia64/domain.c xen/arch/ia64/hypercall.c xen/arch/ia64/ivt.S xen/arch/ia64/patch/linux-2.6.11/entry.S xen/arch/ia64/patch/linux-2.6.11/kregs.h 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/tools/mkbuildtree xen/arch/ia64/vcpu.c xen/arch/ia64/xenmisc.c
line diff
     1.1 --- a/xen/arch/ia64/Makefile	Thu May 26 15:35:14 2005 +0000
     1.2 +++ b/xen/arch/ia64/Makefile	Thu May 26 15:54:22 2005 +0000
     1.3 @@ -29,6 +29,9 @@ default: $(OBJS) head.o ia64lib.o xen.ld
     1.4  	$(LD) $(LDFLAGS) -T $(BASEDIR)/arch/$(TARGET_ARCH)/xen.lds.s -N \
     1.5  		-Map map.out head.o $(ALL_OBJS) -o $(TARGET)-syms
     1.6  	$(OBJCOPY) -R .note -R .comment -S $(TARGET)-syms $(TARGET)
     1.7 +	$(NM) -n $(TARGET)-syms | grep -v '\( [aUw] \)\|\(__crc_\)\|\( \$[adt]\)'\
     1.8 +		 > $(BASEDIR)/System.map
     1.9 +
    1.10  
    1.11  asm-offsets.s: asm-offsets.c $(BASEDIR)/include/asm-ia64/.offsets.h.stamp
    1.12  	$(CC) $(CFLAGS) -S -o $@ $<
     2.1 --- a/xen/arch/ia64/domain.c	Thu May 26 15:35:14 2005 +0000
     2.2 +++ b/xen/arch/ia64/domain.c	Thu May 26 15:54:22 2005 +0000
     2.3 @@ -116,6 +116,7 @@ void continue_cpu_idle_loop(void)
     2.4  #endif
     2.5  	    while ( !softirq_pending(cpu) )
     2.6  	        default_idle();
     2.7 +	    raise_softirq(SCHEDULE_SOFTIRQ);
     2.8  	    do_softirq();
     2.9  	}
    2.10  }
     3.1 --- a/xen/arch/ia64/hypercall.c	Thu May 26 15:35:14 2005 +0000
     3.2 +++ b/xen/arch/ia64/hypercall.c	Thu May 26 15:54:22 2005 +0000
     3.3 @@ -41,6 +41,10 @@ ia64_hypercall (struct pt_regs *regs)
     3.4  		ed->vcpu_info->arch.pending_interruption = 1;
     3.5  #endif
     3.6  		x = pal_emulator_static(regs->r28);
     3.7 +		if (regs->r28 == PAL_HALT_LIGHT) {
     3.8 +			do_sched_op(SCHEDOP_yield);
     3.9 +			//break;
    3.10 +		}
    3.11  		regs->r8 = x.status; regs->r9 = x.v0;
    3.12  		regs->r10 = x.v1; regs->r11 = x.v2;
    3.13  		break;
     4.1 --- a/xen/arch/ia64/ivt.S	Thu May 26 15:35:14 2005 +0000
     4.2 +++ b/xen/arch/ia64/ivt.S	Thu May 26 15:54:22 2005 +0000
     4.3 @@ -785,14 +785,18 @@ ENTRY(break_fault)
     4.4  	cmp.eq p7,p0=r0,r17			// is this a psuedo-cover?
     4.5  (p7)	br.sptk.many dispatch_privop_fault
     4.6  	;;
     4.7 -	cmp.ne p7,p0=r0,r19
     4.8 +	cmp4.ne p7,p0=r0,r19
     4.9  (p7)	br.sptk.many dispatch_break_fault
    4.10  	// If we get to here, we have a hyperprivop
    4.11  	// For now, hyperprivops are handled through the break mechanism
    4.12  	// Later, they will be fast hand-coded assembly with psr.ic off
    4.13  	// which means no calls, no use of r1-r15 and no memory accesses
    4.14  	// except to pinned addresses!
    4.15 +#ifdef FAST_HYPERPRIVOPS
    4.16 +	br.sptk.many fast_hyperprivop
    4.17 +#else
    4.18  	br.sptk.many dispatch_break_fault
    4.19 +#endif
    4.20  	;;
    4.21  #endif
    4.22  	mov r16=IA64_KR(CURRENT)		// r16 = current task; 12 cycle read lat.
     5.1 --- a/xen/arch/ia64/patch/linux-2.6.11/entry.S	Thu May 26 15:35:14 2005 +0000
     5.2 +++ b/xen/arch/ia64/patch/linux-2.6.11/entry.S	Thu May 26 15:54:22 2005 +0000
     5.3 @@ -1,5 +1,5 @@
     5.4 ---- /home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/../../linux-2.6.11/arch/ia64/kernel/entry.S	2005-03-01 23:37:50.000000000 -0800
     5.5 -+++ /home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/arch/ia64/entry.S	2005-05-18 12:40:51.000000000 -0700
     5.6 +--- ../../linux-2.6.11/arch/ia64/kernel/entry.S	2005-03-02 00:37:50.000000000 -0700
     5.7 ++++ arch/ia64/entry.S	2005-05-23 16:49:23.000000000 -0600
     5.8  @@ -46,6 +46,7 @@
     5.9   
    5.10   #include "minstate.h"
    5.11 @@ -97,11 +97,13 @@
    5.12   	;;					// added stop bits to prevent r8 dependency
    5.13   END(ia64_ret_from_clone)
    5.14   	// fall through
    5.15 -@@ -700,19 +732,25 @@
    5.16 +@@ -700,19 +732,27 @@
    5.17   .work_processed_syscall:
    5.18   	adds r2=PT(LOADRS)+16,r12
    5.19   	adds r3=PT(AR_BSPSTORE)+16,r12
    5.20 -+#ifndef XEN
    5.21 ++#ifdef XEN
    5.22 ++	;;
    5.23 ++#else
    5.24   	adds r18=TI_FLAGS+IA64_TASK_SIZE,r13
    5.25   	;;
    5.26   (p6)	ld4 r31=[r18]				// load current_thread_info()->flags
    5.27 @@ -123,7 +125,7 @@
    5.28   	;;
    5.29   	// start restoring the state saved on the kernel stack (struct pt_regs):
    5.30   	ld8 r9=[r2],PT(CR_IPSR)-PT(R9)
    5.31 -@@ -757,7 +795,11 @@
    5.32 +@@ -757,7 +797,11 @@
    5.33   	;;
    5.34   	ld8.fill r12=[r2]	// restore r12 (sp)
    5.35   	ld8.fill r15=[r3]	// restore r15
    5.36 @@ -135,7 +137,7 @@
    5.37   	;;
    5.38   (pUStk)	ld4 r3=[r3]		// r3 = cpu_data->phys_stacked_size_p8
    5.39   (pUStk) st1 [r14]=r17
    5.40 -@@ -814,9 +856,18 @@
    5.41 +@@ -814,9 +858,18 @@
    5.42   (pUStk)	cmp.eq.unc p6,p0=r0,r0		// p6 <- pUStk
    5.43   #endif
    5.44   .work_processed_kernel:
    5.45 @@ -154,7 +156,7 @@
    5.46   	adds r21=PT(PR)+16,r12
    5.47   	;;
    5.48   
    5.49 -@@ -828,17 +879,20 @@
    5.50 +@@ -828,17 +881,20 @@
    5.51   	ld8 r28=[r2],8		// load b6
    5.52   	adds r29=PT(R24)+16,r12
    5.53   
    5.54 @@ -176,7 +178,7 @@
    5.55   	;;
    5.56   	ld8 r31=[r2],16		// load ar.ssd
    5.57   	ld8.fill r8=[r3],16
    5.58 -@@ -934,7 +988,11 @@
    5.59 +@@ -934,7 +990,11 @@
    5.60   	shr.u r18=r19,16	// get byte size of existing "dirty" partition
    5.61   	;;
    5.62   	mov r16=ar.bsp		// get existing backing store pointer
    5.63 @@ -188,7 +190,7 @@
    5.64   	;;
    5.65   	ld4 r17=[r17]		// r17 = cpu_data->phys_stacked_size_p8
    5.66   (pKStk)	br.cond.dpnt skip_rbs_switch
    5.67 -@@ -1069,6 +1127,7 @@
    5.68 +@@ -1069,6 +1129,7 @@
    5.69   	mov pr=r31,-1		// I0
    5.70   	rfi			// B
    5.71   
    5.72 @@ -196,7 +198,7 @@
    5.73   	/*
    5.74   	 * On entry:
    5.75   	 *	r20 = &current->thread_info->pre_count (if CONFIG_PREEMPT)
    5.76 -@@ -1130,6 +1189,7 @@
    5.77 +@@ -1130,6 +1191,7 @@
    5.78   	ld8 r8=[r2]
    5.79   	ld8 r10=[r3]
    5.80   	br.cond.sptk.many .work_processed_syscall	// re-check
    5.81 @@ -204,7 +206,7 @@
    5.82   
    5.83   END(ia64_leave_kernel)
    5.84   
    5.85 -@@ -1166,6 +1226,7 @@
    5.86 +@@ -1166,6 +1228,7 @@
    5.87   	br.ret.sptk.many rp
    5.88   END(ia64_invoke_schedule_tail)
    5.89   
    5.90 @@ -212,7 +214,7 @@
    5.91   	/*
    5.92   	 * Setup stack and call do_notify_resume_user().  Note that pSys and pNonSys need to
    5.93   	 * be set up by the caller.  We declare 8 input registers so the system call
    5.94 -@@ -1264,6 +1325,7 @@
    5.95 +@@ -1264,6 +1327,7 @@
    5.96   	mov ar.unat=r9
    5.97   	br.many b7
    5.98   END(sys_rt_sigreturn)
    5.99 @@ -220,7 +222,7 @@
   5.100   
   5.101   GLOBAL_ENTRY(ia64_prepare_handle_unaligned)
   5.102   	.prologue
   5.103 -@@ -1278,6 +1340,7 @@
   5.104 +@@ -1278,6 +1342,7 @@
   5.105   	br.cond.sptk.many rp				// goes to ia64_leave_kernel
   5.106   END(ia64_prepare_handle_unaligned)
   5.107   
   5.108 @@ -228,7 +230,7 @@
   5.109   	//
   5.110   	// unw_init_running(void (*callback)(info, arg), void *arg)
   5.111   	//
   5.112 -@@ -1585,3 +1648,4 @@
   5.113 +@@ -1585,3 +1650,4 @@
   5.114   	data8 sys_ni_syscall
   5.115   
   5.116   	.org sys_call_table + 8*NR_syscalls	// guard against failures to increase NR_syscalls
     6.1 --- a/xen/arch/ia64/patch/linux-2.6.11/kregs.h	Thu May 26 15:35:14 2005 +0000
     6.2 +++ b/xen/arch/ia64/patch/linux-2.6.11/kregs.h	Thu May 26 15:54:22 2005 +0000
     6.3 @@ -45,7 +45,7 @@
     6.4   #define IA64_ISR_CODE_LFETCH	4
     6.5   #define IA64_ISR_CODE_PROBEF	5
     6.6   
     6.7 -+#ifdef CONFIG_VTI
     6.8 ++#ifdef XEN
     6.9  +/* Interruption Function State */
    6.10  +#define IA64_IFS_V_BIT		63
    6.11  +#define IA64_IFS_V	(__IA64_UL(1) << IA64_IFS_V_BIT)
    6.12 @@ -60,6 +60,6 @@
    6.13  +#define IA64_PTA_SIZE   (__IA64_UL(0x3f) << IA64_PTA_SIZE_BIT)
    6.14  +#define IA64_PTA_VF     (__IA64_UL(1) << IA64_PTA_VF_BIT)
    6.15  +#define IA64_PTA_BASE   (__IA64_UL(0) - ((__IA64_UL(1) << IA64_PTA_BASE_BIT)))
    6.16 -+#endif // CONFIG_VTI
    6.17 ++#endif
    6.18  +
    6.19   #endif /* _ASM_IA64_kREGS_H */
     7.1 --- a/xen/arch/ia64/privop.c	Thu May 26 15:35:14 2005 +0000
     7.2 +++ b/xen/arch/ia64/privop.c	Thu May 26 15:54:22 2005 +0000
     7.3 @@ -569,7 +569,7 @@ priv_handle_op(VCPU *vcpu, REGS *regs, i
     7.4  #endif
     7.5  	{
     7.6  //printf("*** priv_handle_op: privop bundle @%p not mapped, retrying\n",iip);
     7.7 -		return IA64_RETRY;
     7.8 +		return vcpu_force_data_miss(vcpu,regs->cr_iip);
     7.9  	}
    7.10  #if 0
    7.11  	if (iip==0xa000000100001820) {
    7.12 @@ -732,30 +732,10 @@ priv_emulate(VCPU *vcpu, REGS *regs, UIN
    7.13  	privlvl = (ipsr & IA64_PSR_CPL) >> IA64_PSR_CPL0_BIT;
    7.14  	// its OK for a privified-cover to be executed in user-land
    7.15  	fault = priv_handle_op(vcpu,regs,privlvl);
    7.16 -	if (fault == IA64_NO_FAULT) { // success!!
    7.17 +	if ((fault == IA64_NO_FAULT) || (fault == IA64_EXTINT_VECTOR)) { // success!!
    7.18  		// update iip/ipsr to point to the next instruction
    7.19  		(void)vcpu_increment_iip(vcpu);
    7.20  	}
    7.21 -	else if (fault == IA64_EXTINT_VECTOR) {
    7.22 -		// update iip/ipsr before delivering interrupt
    7.23 -		(void)vcpu_increment_iip(vcpu);
    7.24 -	}
    7.25 -	else if (fault == IA64_RFI_IN_PROGRESS) return fault;
    7.26 -		// success but don't update to next instruction
    7.27 -        else if (fault == IA64_RETRY) {
    7.28 -            //printf("Priv emulate gets IA64_RETRY\n");
    7.29 -	    //printf("priv_emulate: returning RETRY, not implemented!\n");
    7.30 -	    //while (1);
    7.31 -	    // don't update iip/ipsr, deliver 
    7.32 -	
    7.33 -            vcpu_force_data_miss(vcpu,regs->cr_iip);
    7.34 -	    return IA64_RETRY;
    7.35 -        }
    7.36 -	else if (priv_verbose) printf("unhandled operation from handle_op\n");
    7.37 -//	if (fault == IA64_ILLOP_FAULT) {
    7.38 -//		printf("priv_emulate: returning ILLOP, not implemented!\n");
    7.39 -//		while (1);
    7.40 -//	}
    7.41  	return fault;
    7.42  }
    7.43  
     8.1 --- a/xen/arch/ia64/process.c	Thu May 26 15:35:14 2005 +0000
     8.2 +++ b/xen/arch/ia64/process.c	Thu May 26 15:54:22 2005 +0000
     8.3 @@ -153,7 +153,8 @@ void reflect_interruption(unsigned long 
     8.4  		}
     8.5  		vector &= ~0xf;
     8.6  		if (vector != IA64_DATA_TLB_VECTOR &&
     8.7 -		    vector != IA64_ALT_DATA_TLB_VECTOR) {
     8.8 +		    vector != IA64_ALT_DATA_TLB_VECTOR &&
     8.9 +		    vector != IA64_VHPT_TRANS_VECTOR) {
    8.10  panic_domain(regs,"psr.ic off, delivering fault=%lx,iip=%p,ifa=%p,isr=%p,PSCB.iip=%p\n",
    8.11  	vector,regs->cr_iip,ifa,isr,PSCB(ed,iip));
    8.12  			
    8.13 @@ -167,20 +168,12 @@ panic_domain(regs,"psr.ic off, deliverin
    8.14  		return;
    8.15  
    8.16  	}
    8.17 -	if ((vector & 0xf) != IA64_FORCED_IFA) PSCB(ed,ifa) = ifa;
    8.18 -	else ifa = PSCB(ed,ifa);
    8.19 +	if ((vector & 0xf) == IA64_FORCED_IFA)
    8.20 +		ifa = PSCB(ed,tmp[0]);
    8.21  	vector &= ~0xf;
    8.22 -//	always deliver on ALT vector (for now?) because no VHPT
    8.23 -//	if (!vcpu_get_rr_ve(ed,ifa)) {
    8.24 -		if (vector == IA64_DATA_TLB_VECTOR)
    8.25 -			vector = IA64_ALT_DATA_TLB_VECTOR;
    8.26 -		else if (vector == IA64_INST_TLB_VECTOR)
    8.27 -			vector = IA64_ALT_INST_TLB_VECTOR;
    8.28 -//	}
    8.29 -	if (vector == IA64_ALT_DATA_TLB_VECTOR ||
    8.30 -	    vector == IA64_ALT_INST_TLB_VECTOR) {
    8.31 -		vcpu_thash(ed,ifa,&PSCB(ed,iha));
    8.32 -	}
    8.33 +	PSCB(ed,ifa) = ifa;
    8.34 +	if (vector < IA64_DATA_NESTED_TLB_VECTOR) /* VHPT miss, TLB miss, Alt TLB miss */
    8.35 +		vcpu_thash(ed,ifa,&PSCB(current,iha));
    8.36  	PSCB(ed,unat) = regs->ar_unat;  // not sure if this is really needed?
    8.37  	PSCB(ed,precover_ifs) = regs->cr_ifs;
    8.38  	vcpu_bsw0(ed);
    8.39 @@ -325,7 +318,7 @@ void ia64_do_page_fault (unsigned long a
    8.40  	unsigned long psr = regs->cr_ipsr, mask, flags;
    8.41  	unsigned long iip = regs->cr_iip;
    8.42  	// FIXME should validate address here
    8.43 -	unsigned long pteval, mpaddr;
    8.44 +	unsigned long iha, pteval, mpaddr;
    8.45  	unsigned long lookup_domain_mpa(struct domain *,unsigned long);
    8.46  	unsigned long is_data = !((isr >> IA64_ISR_X_BIT) & 1UL);
    8.47  	unsigned long vector;
    8.48 @@ -351,8 +344,8 @@ void ia64_do_page_fault (unsigned long a
    8.49  		// FIXME should validate mpaddr here
    8.50  		if (d == dom0) {
    8.51  			if (address < dom0_start || address >= dom0_start + dom0_size) {
    8.52 -				//printk("ia64_do_page_fault: out-of-bounds dom0 mpaddr %p, iip=%p! continuing...\n",address,iip);
    8.53 -				//printk("ia64_do_page_fault: out-of-bounds dom0 mpaddr %p, old iip=%p!\n",address,current->vcpu_info->arch.iip);
    8.54 +				printk("ia64_do_page_fault: out-of-bounds dom0 mpaddr %p, iip=%p! continuing...\n",address,iip);
    8.55 +				printk("ia64_do_page_fault: out-of-bounds dom0 mpaddr %p, old iip=%p!\n",address,current->vcpu_info->arch.iip);
    8.56  				tdpfoo();
    8.57  			}
    8.58  		}
    8.59 @@ -367,10 +360,10 @@ void ia64_do_page_fault (unsigned long a
    8.60  		vcpu_itc_no_srlz(current,is_data?2:1,address,pteval,-1UL,(trp->itir>>2)&0x3f);
    8.61  		return;
    8.62  	}
    8.63 -	vector = is_data ? IA64_DATA_TLB_VECTOR : IA64_INST_TLB_VECTOR;
    8.64 +
    8.65  	if (handle_lazy_cover(current, isr, regs)) return;
    8.66  if (!(address>>61)) {
    8.67 -panic_domain(0,"ia64_do_page_fault: @%p???, iip=%p, itc=%p (spinning...)\n",address,iip,ia64_get_itc());
    8.68 +panic_domain(0,"ia64_do_page_fault: @%p???, iip=%p, b0=%p, itc=%p (spinning...)\n",address,iip,regs->b0,ia64_get_itc());
    8.69  }
    8.70  	if ((isr & IA64_ISR_SP)
    8.71  	    || ((isr & IA64_ISR_NA) && (isr & IA64_ISR_CODE_MASK) == IA64_ISR_CODE_LFETCH))
    8.72 @@ -383,6 +376,37 @@ panic_domain(0,"ia64_do_page_fault: @%p?
    8.73  		ia64_psr(regs)->ed = 1;
    8.74  		return;
    8.75  	}
    8.76 +
    8.77 +	if (vcpu_get_rr_ve(current, address) && (PSCB(current,pta) & IA64_PTA_VE))
    8.78 +	{
    8.79 +		if (PSCB(current,pta) & IA64_PTA_VF)
    8.80 +		{
    8.81 +			/* long format VHPT - not implemented */
    8.82 +			vector = is_data ? IA64_DATA_TLB_VECTOR : IA64_INST_TLB_VECTOR;
    8.83 +		}
    8.84 +		else
    8.85 +		{
    8.86 +			/* short format VHPT */
    8.87 +			vcpu_thash(current, address, &iha);
    8.88 +			if (__copy_from_user(&pteval, iha, sizeof(pteval)) == 0)
    8.89 +			{
    8.90 +				/* 
    8.91 +				 * Optimisation: this VHPT walker aborts on not-present pages
    8.92 +				 * instead of inserting a not-present translation, this allows
    8.93 +				 * vectoring directly to the miss handler.
    8.94 +	\			 */
    8.95 +				if (pteval & _PAGE_P)
    8.96 +				{
    8.97 +					pteval = translate_domain_pte(pteval,address,itir);
    8.98 +					vcpu_itc_no_srlz(current,is_data?2:1,address,pteval,-1UL,(itir>>2)&0x3f);
    8.99 +					return;
   8.100 +				}
   8.101 +				else vector = is_data ? IA64_DATA_TLB_VECTOR : IA64_INST_TLB_VECTOR;
   8.102 +			}
   8.103 +			else vector = IA64_VHPT_TRANS_VECTOR;
   8.104 +		}
   8.105 +	}
   8.106 +	else vector = is_data ? IA64_ALT_DATA_TLB_VECTOR : IA64_ALT_INST_TLB_VECTOR;
   8.107  	reflect_interruption(address, isr, itir, regs, vector);
   8.108  }
   8.109  
   8.110 @@ -746,11 +770,7 @@ ia64_handle_privop (unsigned long ifa, s
   8.111  	// AND ACTUALLY reflect_interruption doesn't use it anyway!
   8.112  	itir = vcpu_get_itir_on_fault(ed,ifa);
   8.113  	vector = priv_emulate(current,regs,isr);
   8.114 -	if (vector == IA64_RETRY) {
   8.115 -		reflect_interruption(ifa,isr,itir,regs,
   8.116 -			IA64_ALT_DATA_TLB_VECTOR | IA64_FORCED_IFA);
   8.117 -	}
   8.118 -	else if (vector != IA64_NO_FAULT && vector != IA64_RFI_IN_PROGRESS) {
   8.119 +	if (vector != IA64_NO_FAULT && vector != IA64_RFI_IN_PROGRESS) {
   8.120  		reflect_interruption(ifa,isr,itir,regs,vector);
   8.121  	}
   8.122  }
     9.1 --- a/xen/arch/ia64/tools/README.xenia64	Thu May 26 15:35:14 2005 +0000
     9.2 +++ b/xen/arch/ia64/tools/README.xenia64	Thu May 26 15:54:22 2005 +0000
     9.3 @@ -6,18 +6,16 @@
     9.4  
     9.5  # unpack linux-2.6.11 in the xenXXX.bk/.. directory
     9.6  tar xzf linux-2.6.11.tar.gz
     9.7 -cd linux-2.6.11
     9.8  
     9.9  # go back to the xen subdirectory of xenXXX.bk
    9.10  cd xenXXX.bk/xen
    9.11  
    9.12  # create and patch the linux/ia64 files
    9.13 -bash arch/ia64/tools/mkbuildtree
    9.14  # this should print out many patch messages but no errors
    9.15  bash arch/ia64/tools/mkbuildtree
    9.16  
    9.17  # build xen/ia64
    9.18  # if using cross-compiler
    9.19 -make TARGET_ARCH=ia64
    9.20 +make XEN_TARGET_ARCH=ia64
    9.21  # else if native
    9.22  make
    10.1 --- a/xen/arch/ia64/tools/README.xenia64linux	Thu May 26 15:35:14 2005 +0000
    10.2 +++ b/xen/arch/ia64/tools/README.xenia64linux	Thu May 26 15:54:22 2005 +0000
    10.3 @@ -6,7 +6,6 @@ 2) vi .config
    10.4  	unset CONFIG_IA32_SUPPORT
    10.5  	unset CONFIG_IDE [for now, need to fix later]
    10.6  	unset CONFIG_VIRTUAL_MEM_MAP [for now, need to fix later]
    10.7 -	set CONFIG_DISABLE_VHPT
    10.8  3) if running on ski, it is useful to make the following change:
    10.9     a) at the beginning of drivers/acpi/motherboard.c:acpi_reserve_resources()
   10.10        add the line:
   10.11 @@ -46,5 +45,6 @@ 6) debug fixes:
   10.12             (It may be necessary also to un-inline the routine, not sure.)
   10.13     c) It can be useful to modify linux/init/main.c to add a printf before
   10.14        or after a lot of the init calls
   10.15 -6) NOTE: mca currently has a problem with binary translation,
   10.16 +6) Start Xen from elilo, passing the Linux kernel as an initrd.
   10.17 +   NOTE: mca currently has a problem with binary translation,
   10.18     must run with "nomca" as a kernel argument
    11.1 --- a/xen/arch/ia64/tools/mkbuildtree	Thu May 26 15:35:14 2005 +0000
    11.2 +++ b/xen/arch/ia64/tools/mkbuildtree	Thu May 26 15:54:22 2005 +0000
    11.3 @@ -307,7 +307,6 @@ softlink include/linux/timex.h include/a
    11.4  softlink include/linux/topology.h include/asm-ia64/linux/topology.h
    11.5  softlink include/linux/seqlock.h include/asm-ia64/linux/seqlock.h
    11.6  softlink include/linux/jiffies.h include/asm-ia64/linux/jiffies.h
    11.7 -softlink include/linux/jiffies.h include/asm-ia64/linux/jiffies.h
    11.8  
    11.9  null include/asm-ia64/linux/file.h
   11.10  null include/asm-ia64/linux/module.h
    12.1 --- a/xen/arch/ia64/vcpu.c	Thu May 26 15:35:14 2005 +0000
    12.2 +++ b/xen/arch/ia64/vcpu.c	Thu May 26 15:54:22 2005 +0000
    12.3 @@ -638,7 +638,15 @@ IA64FAULT vcpu_get_ivr(VCPU *vcpu, UINT6
    12.4  {
    12.5  	int i;
    12.6  	UINT64 vector, mask;
    12.7 -#if 1
    12.8 +
    12.9 +#define HEARTBEAT_FREQ 16	// period in seconds
   12.10 +#ifdef HEARTBEAT_FREQ
   12.11 +#define N_DOMS 16	// period in seconds
   12.12 +	static long count[N_DOMS] = { 0 };
   12.13 +	REGS *regs = vcpu_regs(vcpu);
   12.14 +	unsigned domid = vcpu->domain->domain_id;
   12.15 +#endif
   12.16 +#ifdef IRQ_DEBUG
   12.17  	static char firstivr = 1;
   12.18  	static char firsttime[256];
   12.19  	if (firstivr) {
   12.20 @@ -654,9 +662,21 @@ IA64FAULT vcpu_get_ivr(VCPU *vcpu, UINT6
   12.21  		*pval = vector;
   12.22  		return IA64_NO_FAULT;
   12.23  	}
   12.24 +#ifdef HEARTBEAT_FREQ
   12.25 +	if (domid >= N_DOMS) domid = N_DOMS-1;
   12.26 +	if (vector == (PSCB(vcpu,itv) & 0xff) &&
   12.27 +	    !(++count[domid] & ((HEARTBEAT_FREQ*1024)-1))) {
   12.28 +		printf("Dom%d heartbeat... iip=%p,psr.i=%d,pend=%d\n",
   12.29 +			domid, regs->cr_iip,
   12.30 +			current->vcpu_info->arch.interrupt_delivery_enabled,
   12.31 +			current->vcpu_info->arch.pending_interruption);
   12.32 +		count[domid] = 0;
   12.33 +		dump_runq();
   12.34 +	}
   12.35 +#endif
   12.36  	// now have an unmasked, pending, deliverable vector!
   12.37  	// getting ivr has "side effects"
   12.38 -#if 0
   12.39 +#ifdef IRQ_DEBUG
   12.40  	if (firsttime[vector]) {
   12.41  		printf("*** First get_ivr on vector=%d,itc=%lx\n",
   12.42  			vector,ia64_get_itc());
   12.43 @@ -989,6 +1009,10 @@ IA64FAULT vcpu_set_itc(VCPU *vcpu, UINT6
   12.44  
   12.45  	UINT64 newnow = val, min_delta;
   12.46  
   12.47 +#define DISALLOW_SETTING_ITC_FOR_NOW
   12.48 +#ifdef DISALLOW_SETTING_ITC_FOR_NOW
   12.49 +printf("vcpu_set_itc: Setting ar.itc is currently disabled\n");
   12.50 +#else
   12.51  	local_irq_disable();
   12.52  	if (olditm) {
   12.53  printf("**** vcpu_set_itc(%lx): vitm changed to %lx\n",val,newnow+d);
   12.54 @@ -1008,6 +1032,7 @@ printf("**** vcpu_set_itc(%lx): vitm cha
   12.55  		//using_xen_as_itm++;
   12.56  	}
   12.57  	local_irq_enable();
   12.58 +#endif
   12.59  	return (IA64_NO_FAULT);
   12.60  }
   12.61  
   12.62 @@ -1092,8 +1117,8 @@ Privileged operation emulation routines
   12.63  
   12.64  IA64FAULT vcpu_force_data_miss(VCPU *vcpu, UINT64 ifa)
   12.65  {
   12.66 -	PSCB(vcpu,ifa) = ifa;	// privop traps don't set ifa so do it here
   12.67 -	return (IA64_DATA_TLB_VECTOR | IA64_FORCED_IFA);
   12.68 +	PSCB(vcpu,tmp[0]) = ifa;	// save ifa in vcpu structure, then specify IA64_FORCED_IFA
   12.69 +	return (vcpu_get_rr_ve(vcpu,ifa) ? IA64_DATA_TLB_VECTOR : IA64_ALT_DATA_TLB_VECTOR) | IA64_FORCED_IFA;
   12.70  }
   12.71  
   12.72  
   12.73 @@ -1181,7 +1206,7 @@ IA64FAULT vcpu_thash(VCPU *vcpu, UINT64 
   12.74  		((pta_base >> 15) & 0x3fffffffffff) & compMask_60_15;
   12.75  	UINT64 VHPT_addr2b =
   12.76  		((VHPT_offset >> 15) & 0x3fffffffffff) & Mask_60_15;;
   12.77 -	UINT64 VHPT_addr3 = VHPT_offset & 0x3fff;
   12.78 +	UINT64 VHPT_addr3 = VHPT_offset & 0x7fff;
   12.79  	UINT64 VHPT_addr = VHPT_addr1 | ((VHPT_addr2a | VHPT_addr2b) << 15) |
   12.80  			VHPT_addr3;
   12.81  
   12.82 @@ -1592,7 +1617,7 @@ IA64FAULT vcpu_itc_d(VCPU *vcpu, UINT64 
   12.83  	unsigned long pteval, logps = (itir >> 2) & 0x3f;
   12.84  	unsigned long translate_domain_pte(UINT64,UINT64,UINT64);
   12.85  
   12.86 -	if (((itir & 0xfcL) >> 2) < PAGE_SHIFT) {
   12.87 +	if (logps < PAGE_SHIFT) {
   12.88  		printf("vcpu_itc_d: domain trying to use smaller page size!\n");
   12.89  		//FIXME: kill domain here
   12.90  		while(1);
   12.91 @@ -1610,7 +1635,7 @@ IA64FAULT vcpu_itc_i(VCPU *vcpu, UINT64 
   12.92  	unsigned long translate_domain_pte(UINT64,UINT64,UINT64);
   12.93  
   12.94  	// FIXME: validate ifa here (not in Xen space), COULD MACHINE CHECK!
   12.95 -	if (((itir & 0xfcL) >> 2) < PAGE_SHIFT) {
   12.96 +	if (logps < PAGE_SHIFT) {
   12.97  		printf("vcpu_itc_i: domain trying to use smaller page size!\n");
   12.98  		//FIXME: kill domain here
   12.99  		while(1);
    13.1 --- a/xen/arch/ia64/xenmisc.c	Thu May 26 15:35:14 2005 +0000
    13.2 +++ b/xen/arch/ia64/xenmisc.c	Thu May 26 15:54:22 2005 +0000
    13.3 @@ -262,8 +262,8 @@ void context_switch(struct exec_domain *
    13.4  static long cnt[16] = { 50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50};
    13.5  static int i = 100;
    13.6  int id = ((struct exec_domain *)current)->domain->domain_id & 0xf;
    13.7 -if (!cnt[id]--) { printk("%x",id); cnt[id] = 50; }
    13.8 -if (!i--) { printk("+",id); cnt[id] = 100; }
    13.9 +if (!cnt[id]--) { printk("%x",id); cnt[id] = 500; }
   13.10 +if (!i--) { printk("+",id); cnt[id] = 1000; }
   13.11  }
   13.12  	clear_bit(_VCPUF_running, &prev->vcpu_flags);
   13.13  	//if (!is_idle_task(next->domain) )
   13.14 @@ -273,7 +273,10 @@ if (!i--) { printk("+",id); cnt[id] = 10
   13.15  		vmx_load_all_rr(current);
   13.16  	return;
   13.17  #else // CONFIG_VTI
   13.18 -	load_region_regs(current);
   13.19 +	if (!is_idle_task(current->domain)) {
   13.20 +		load_region_regs(current);
   13.21 +		if (vcpu_timer_expired(current)) vcpu_pend_timer(current);
   13.22 +	}
   13.23  	if (vcpu_timer_expired(current)) vcpu_pend_timer(current);
   13.24  #endif // CONFIG_VTI
   13.25  }