ia64/xen-unstable
changeset 4168:5cd82956dca3
bitkeeper revision 1.1236.31.3 (42376f62DcjuC-_BFPp328kWnfyo1w)
Fix uninitialized variable causing early NaT fault
Fix uninitialized variable causing early NaT fault
author | djm@kirby.fc.hp.com |
---|---|
date | Tue Mar 15 23:27:30 2005 +0000 (2005-03-15) |
parents | 0c846e77cca4 |
children | 3fa7a9355f99 a0b28acf0dcd |
files | .rootkeys xen/arch/ia64/domain.c xen/arch/ia64/process.c xen/arch/ia64/tools/README.xenia64linux xen/arch/ia64/vcpu.c xen/arch/ia64/xenmisc.c xen/include/asm-ia64/config.h |
line diff
1.1 --- a/.rootkeys Mon Mar 14 22:54:43 2005 +0000 1.2 +++ b/.rootkeys Tue Mar 15 23:27:30 2005 +0000 1.3 @@ -945,6 +945,7 @@ 41a26ebcJ30TFl1v2kR8rqpEBvOtVw xen/arch/ 1.4 421098b69pUiIJrqu_w0JMUnZ2uc2A xen/arch/ia64/smp.c 1.5 421098b6_ToSGrf6Pk1Uwg5aMAIBxg xen/arch/ia64/smpboot.c 1.6 421098b6AUdbxR3wyn1ATcmNuTao_Q xen/arch/ia64/tools/README.xenia64 1.7 +42376c6dfyY0eq8MS2dK3BW2rFuEGg xen/arch/ia64/tools/README.xenia64linux 1.8 421098b6rQ2BQ103qu1n1HNofbS2Og xen/arch/ia64/tools/mkbuildtree 1.9 41a26ebc--sjlYZQxmIxyCx3jw70qA xen/arch/ia64/vcpu.c 1.10 421098b6M2WhsJ_ZMzFamAQcdc5gzw xen/arch/ia64/vhpt.c
2.1 --- a/xen/arch/ia64/domain.c Mon Mar 14 22:54:43 2005 +0000 2.2 +++ b/xen/arch/ia64/domain.c Tue Mar 15 23:27:30 2005 +0000 2.3 @@ -248,6 +248,7 @@ void new_thread(struct exec_domain *ed, 2.4 regs->pr = 0; 2.5 sw->pr = 0; 2.6 regs->ar_pfs = 0; 2.7 + sw->caller_unat = 0; 2.8 sw->ar_pfs = 0; 2.9 sw->ar_bspstore = new_rbs; 2.10 //regs->r13 = (unsigned long) ed;
3.1 --- a/xen/arch/ia64/process.c Mon Mar 14 22:54:43 2005 +0000 3.2 +++ b/xen/arch/ia64/process.c Tue Mar 15 23:27:30 2005 +0000 3.3 @@ -204,10 +204,11 @@ void deliver_pending_interrupt(struct pt 3.4 struct exec_domain *ed = current; 3.5 // FIXME: Will this work properly if doing an RFI??? 3.6 if (!is_idle_task(d) && user_mode(regs)) { 3.7 - vcpu_poke_timer(ed); 3.8 + //vcpu_poke_timer(ed); 3.9 if (vcpu_deliverable_interrupts(ed)) { 3.10 unsigned long isr = regs->cr_ipsr & IA64_PSR_RI; 3.11 - foodpi(); 3.12 + if (vcpu_timer_pending_early(ed)) 3.13 +printf("*#*#*#* about to deliver early timer to domain %d!!!\n",ed->domain->id); 3.14 reflect_interruption(0,isr,0,regs,IA64_EXTINT_VECTOR); 3.15 } 3.16 }
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/xen/arch/ia64/tools/README.xenia64linux Tue Mar 15 23:27:30 2005 +0000 4.3 @@ -0,0 +1,50 @@ 4.4 +INSTRUCTIONS FOR BUILDING XENLINUX/IA64 4.5 + 4.6 +1) In linux-2.6.9: (also tested with 2.6.10, 2.6.11.2) 4.7 + cp arch/ia64/configs/zx1_defconfig .config 4.8 +2) vi .config 4.9 + unset CONFIG_IA32_SUPPORT 4.10 + unset CONFIG_IDE [for now, need to fix later] 4.11 + unset CONFIG_VIRTUAL_MEM_MAP [for now, need to fix later] 4.12 + set CONFIG_DISABLE_VHPT 4.13 +3) if running on ski, it is useful to make the following change: 4.14 + a) at the beginning of drivers/acpi/motherboard.c:acpi_reserve_resources() 4.15 + add the line: 4.16 + if (!acpi_gbl_FADT) return; 4.17 +4) Build linux. 4.18 + a) yes "" | make oldconfig 4.19 + b) check the resulting .config to ensure there are no modules used (because 4.20 + Xen/ia64 doesn't support them yet). Change '=m' to '=n' and remake 4.21 + c) yes "" | make oldconfig 4.22 + d) make 4.23 +5) Linux must be "privified" to run on Xen/ia64. This process converts all 4.24 + privilege-sensitive instructions into privileged instructions. 4.25 + Usage: privify infile outfile 4.26 + Privify is very dumb... it will not overwrite outfile. It also prints 4.27 + out a bunch of useless info that can be safely ignored (except for "panic"). 4.28 + The privify program can be obtained from: 4.29 + ftp://ftp.hpl.hp.com/pub/xen-ia64/privify 4.30 +6) debug fixes: 4.31 + a) periodically xenlinux/ia64 goes into a fit of printing 4.32 + "Oops: timer tick before it is due..." This can be changed 4.33 + in arch/ia64/kernel/time.c to either ignore it or print something 4.34 + shorter 4.35 + b) The hp simulator (ski) console drivers can be turned on to allow 4.36 + output of early boot information from xenlinux. This results 4.37 + in some duplication of later output (which can be ignored). 4.38 + i) in linux/arch/ia64/Makefile, force the sim drivers by changing 4.39 + drivers-$(CONFIG_IA64_HP_SIM) += arch/ia64/hp/sim to 4.40 + drivers-y += arch/ia64/hp/sim 4.41 + ii) in linux/arch/ia64/hp/sim/Makefile, force the sim drivers 4.42 + by changing obj-$(CONFIG_HP_SIMSERIAL) to obj-y and 4.43 + obj-$(CONFIG_HP_SIM_SERIAL_CONSOLE) to obj-y 4.44 + iii) in arch/ia64/kernel/setup.c:early_console_setup(), replace 4.45 + the contents of the routine with: 4.46 + extern struct console hpsim_cons; 4.47 + register_console(&hpsim_cons); 4.48 + return 0; 4.49 + (It may be necessary also to un-inline the routine, not sure.) 4.50 + c) It can be useful to modify linux/init/main.c to add a printf before 4.51 + or after a lot of the init calls 4.52 +6) NOTE: mca currently has a problem with binary translation, 4.53 + must run with "nomca" as a kernel argument
5.1 --- a/xen/arch/ia64/vcpu.c Mon Mar 14 22:54:43 2005 +0000 5.2 +++ b/xen/arch/ia64/vcpu.c Tue Mar 15 23:27:30 2005 +0000 5.3 @@ -572,6 +572,12 @@ UINT64 vcpu_deliverable_interrupts(VCPU 5.4 vcpu_check_pending_interrupts(vcpu) != SPURIOUS_VECTOR); 5.5 } 5.6 5.7 +UINT64 vcpu_deliverable_timer(VCPU *vcpu) 5.8 +{ 5.9 + return (vcpu_get_psr_i(vcpu) && 5.10 + vcpu_check_pending_interrupts(vcpu) == PSCB(vcpu,itv)); 5.11 +} 5.12 + 5.13 IA64FAULT vcpu_get_lid(VCPU *vcpu, UINT64 *pval) 5.14 { 5.15 extern unsigned long privop_trace; 5.16 @@ -950,9 +956,28 @@ void vcpu_pend_timer(VCPU *vcpu) 5.17 UINT64 itv = PSCB(vcpu,itv) & 0xff; 5.18 5.19 if (vcpu_timer_disabled(vcpu)) return; 5.20 +#if 1 5.21 + // attempt to flag "timer tick before its due" source 5.22 + { 5.23 + UINT64 itm = PSCB(vcpu,domain_itm); 5.24 + UINT64 now = ia64_get_itc(); 5.25 + if (now < itm) printf("******* vcpu_pend_timer: pending before due!\n"); 5.26 + } 5.27 +#endif 5.28 vcpu_pend_interrupt(vcpu, itv); 5.29 } 5.30 5.31 +// returns true if ready to deliver a timer interrupt too early 5.32 +UINT64 vcpu_timer_pending_early(VCPU *vcpu) 5.33 +{ 5.34 + UINT64 now = ia64_get_itc(); 5.35 + UINT64 itm = PSCB(vcpu,domain_itm); 5.36 + 5.37 + if (vcpu_timer_disabled(vcpu)) return 0; 5.38 + if (!itm) return 0; 5.39 + return (vcpu_deliverable_timer(vcpu) && (now < itm)); 5.40 +} 5.41 + 5.42 //FIXME: This is a hack because everything dies if a timer tick is lost 5.43 void vcpu_poke_timer(VCPU *vcpu) 5.44 { 5.45 @@ -974,7 +999,7 @@ void vcpu_poke_timer(VCPU *vcpu) 5.46 if (irr & (1L<<(0xef-0xc0))) return; 5.47 if (now-itm>0x800000) 5.48 printf("*** poking timer: now=%lx,vitm=%lx,xitm=%lx,itm=%lx\n",now,itm,local_cpu_data->itm_next,ia64_get_itm()); 5.49 - vcpu_pend_interrupt(vcpu, 0xefL); 5.50 + vcpu_pend_timer(vcpu); 5.51 } 5.52 } 5.53 }
6.1 --- a/xen/arch/ia64/xenmisc.c Mon Mar 14 22:54:43 2005 +0000 6.2 +++ b/xen/arch/ia64/xenmisc.c Tue Mar 15 23:27:30 2005 +0000 6.3 @@ -257,6 +257,7 @@ void context_switch(struct exec_domain * 6.4 //if (!is_idle_task(next->domain) ) 6.5 //send_guest_virq(next, VIRQ_TIMER); 6.6 load_region_regs(current); 6.7 + if (vcpu_timer_expired(current)) vcpu_pend_timer(current); 6.8 } 6.9 6.10 void panic_domain(struct pt_regs *regs, const char *fmt, ...) 6.11 @@ -276,5 +277,6 @@ void panic_domain(struct pt_regs *regs, 6.12 printf(buf); 6.13 if (regs) show_registers(regs); 6.14 domain_pause_by_systemcontroller(current->domain); 6.15 + set_bit(DF_CRASHED, ed->domain->d_flags); 6.16 //while(test); 6.17 }
7.1 --- a/xen/include/asm-ia64/config.h Mon Mar 14 22:54:43 2005 +0000 7.2 +++ b/xen/include/asm-ia64/config.h Tue Mar 15 23:27:30 2005 +0000 7.3 @@ -1,7 +1,6 @@ 7.4 // control flags for turning on/off features under test 7.5 #undef CLONE_DOMAIN0 7.6 -//#define CLONE_DOMAIN0 3 7.7 -#define USER_ACCESS 7.8 +//#define CLONE_DOMAIN0 1 7.9 7.10 // manufactured from component pieces 7.11