WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Fix uninitialized variable causing early NaT fault

To: xen-changelog@xxxxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix uninitialized variable causing early NaT fault
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Tue, 15 Mar 2005 23:27:30 +0000
Delivery-date: Sat, 26 Mar 2005 00:04:16 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-changelog>
List-help: <mailto:xen-changelog-request@lists.sourceforge.net?subject=help>
List-id: <xen-changelog.lists.sourceforge.net>
List-post: <mailto:xen-changelog@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.sourceforge.net?subject=unsubscribe>
Reply-to: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-admin@xxxxxxxxxxxxxxxxxxxxx
ChangeSet 1.1305.1.3, 2005/03/15 16:27:30-07:00, djm@xxxxxxxxxxxxxxx

        Fix uninitialized variable causing early NaT fault



 arch/ia64/domain.c                  |    1 
 arch/ia64/process.c                 |    5 ++-
 arch/ia64/tools/README.xenia64linux |   50 ++++++++++++++++++++++++++++++++++++
 arch/ia64/vcpu.c                    |   27 ++++++++++++++++++-
 arch/ia64/xenmisc.c                 |    2 +
 include/asm-ia64/config.h           |    3 --
 6 files changed, 83 insertions(+), 5 deletions(-)


diff -Nru a/xen/arch/ia64/domain.c b/xen/arch/ia64/domain.c
--- a/xen/arch/ia64/domain.c    2005-03-25 19:03:32 -05:00
+++ b/xen/arch/ia64/domain.c    2005-03-25 19:03:32 -05:00
@@ -248,6 +248,7 @@
        regs->pr = 0;
        sw->pr = 0;
        regs->ar_pfs = 0;
+       sw->caller_unat = 0;
        sw->ar_pfs = 0;
        sw->ar_bspstore = new_rbs;
        //regs->r13 = (unsigned long) ed;
diff -Nru a/xen/arch/ia64/process.c b/xen/arch/ia64/process.c
--- a/xen/arch/ia64/process.c   2005-03-25 19:03:32 -05:00
+++ b/xen/arch/ia64/process.c   2005-03-25 19:03:32 -05:00
@@ -204,10 +204,11 @@
        struct exec_domain *ed = current;
        // FIXME: Will this work properly if doing an RFI???
        if (!is_idle_task(d) && user_mode(regs)) {
-               vcpu_poke_timer(ed);
+               //vcpu_poke_timer(ed);
                if (vcpu_deliverable_interrupts(ed)) {
                        unsigned long isr = regs->cr_ipsr & IA64_PSR_RI;
-                       foodpi();
+                       if (vcpu_timer_pending_early(ed))
+printf("*#*#*#* about to deliver early timer to domain 
%d!!!\n",ed->domain->id);
                        reflect_interruption(0,isr,0,regs,IA64_EXTINT_VECTOR);
                }
        }
diff -Nru a/xen/arch/ia64/tools/README.xenia64linux 
b/xen/arch/ia64/tools/README.xenia64linux
--- /dev/null   Wed Dec 31 16:00:00 196900
+++ b/xen/arch/ia64/tools/README.xenia64linux   2005-03-25 19:03:32 -05:00
@@ -0,0 +1,50 @@
+INSTRUCTIONS FOR BUILDING XENLINUX/IA64
+
+1) In linux-2.6.9: (also tested with 2.6.10, 2.6.11.2)
+       cp arch/ia64/configs/zx1_defconfig .config
+2) vi .config
+       unset CONFIG_IA32_SUPPORT
+       unset CONFIG_IDE [for now, need to fix later]
+       unset CONFIG_VIRTUAL_MEM_MAP [for now, need to fix later]
+       set CONFIG_DISABLE_VHPT
+3) if running on ski, it is useful to make the following change:
+   a) at the beginning of drivers/acpi/motherboard.c:acpi_reserve_resources()
+      add the line:
+       if (!acpi_gbl_FADT) return;
+4) Build linux.
+   a) yes "" | make oldconfig
+   b) check the resulting .config to ensure there are no modules used (because
+      Xen/ia64 doesn't support them yet).  Change '=m' to '=n' and remake
+   c) yes "" | make oldconfig
+   d) make
+5) Linux must be "privified" to run on Xen/ia64.  This process converts all
+   privilege-sensitive instructions into privileged instructions.
+       Usage: privify infile outfile
+   Privify is very dumb... it will not overwrite outfile.  It also prints
+   out a bunch of useless info that can be safely ignored (except for "panic").
+   The privify program can be obtained from:
+       ftp://ftp.hpl.hp.com/pub/xen-ia64/privify
+6) debug fixes:
+   a) periodically xenlinux/ia64 goes into a fit of printing
+      "Oops: timer tick before it is due..."  This can be changed
+      in arch/ia64/kernel/time.c to either ignore it or print something
+      shorter
+   b) The hp simulator (ski) console drivers can be turned on to allow
+      output of early boot information from xenlinux.  This results
+      in some duplication of later output (which can be ignored).
+      i) in linux/arch/ia64/Makefile, force the sim drivers by changing
+               drivers-$(CONFIG_IA64_HP_SIM) += arch/ia64/hp/sim to
+               drivers-y += arch/ia64/hp/sim
+      ii) in linux/arch/ia64/hp/sim/Makefile, force the sim drivers
+         by changing obj-$(CONFIG_HP_SIMSERIAL) to obj-y and
+          obj-$(CONFIG_HP_SIM_SERIAL_CONSOLE) to obj-y
+      iii) in arch/ia64/kernel/setup.c:early_console_setup(), replace
+           the contents of the routine with:
+               extern struct console hpsim_cons;
+               register_console(&hpsim_cons);
+               return 0;
+           (It may be necessary also to un-inline the routine, not sure.)
+   c) It can be useful to modify linux/init/main.c to add a printf before
+      or after a lot of the init calls
+6) NOTE: mca currently has a problem with binary translation,
+   must run with "nomca" as a kernel argument
diff -Nru a/xen/arch/ia64/vcpu.c b/xen/arch/ia64/vcpu.c
--- a/xen/arch/ia64/vcpu.c      2005-03-25 19:03:32 -05:00
+++ b/xen/arch/ia64/vcpu.c      2005-03-25 19:03:32 -05:00
@@ -572,6 +572,12 @@
                vcpu_check_pending_interrupts(vcpu) != SPURIOUS_VECTOR);
 }
 
+UINT64 vcpu_deliverable_timer(VCPU *vcpu)
+{
+       return (vcpu_get_psr_i(vcpu) &&
+               vcpu_check_pending_interrupts(vcpu) == PSCB(vcpu,itv));
+}
+
 IA64FAULT vcpu_get_lid(VCPU *vcpu, UINT64 *pval)
 {
 extern unsigned long privop_trace;
@@ -950,9 +956,28 @@
        UINT64 itv = PSCB(vcpu,itv) & 0xff;
 
        if (vcpu_timer_disabled(vcpu)) return;
+#if 1
+       // attempt to flag "timer tick before its due" source
+       {
+       UINT64 itm = PSCB(vcpu,domain_itm);
+       UINT64 now = ia64_get_itc();
+       if (now < itm) printf("******* vcpu_pend_timer: pending before due!\n");
+       }
+#endif
        vcpu_pend_interrupt(vcpu, itv);
 }
 
+// returns true if ready to deliver a timer interrupt too early
+UINT64 vcpu_timer_pending_early(VCPU *vcpu)
+{
+       UINT64 now = ia64_get_itc();
+       UINT64 itm = PSCB(vcpu,domain_itm);
+
+       if (vcpu_timer_disabled(vcpu)) return 0;
+       if (!itm) return 0;
+       return (vcpu_deliverable_timer(vcpu) && (now < itm));
+}
+
 //FIXME: This is a hack because everything dies if a timer tick is lost
 void vcpu_poke_timer(VCPU *vcpu)
 {
@@ -974,7 +999,7 @@
                        if (irr & (1L<<(0xef-0xc0))) return;
 if (now-itm>0x800000)
 printf("*** poking timer: 
now=%lx,vitm=%lx,xitm=%lx,itm=%lx\n",now,itm,local_cpu_data->itm_next,ia64_get_itm());
-                       vcpu_pend_interrupt(vcpu, 0xefL);
+                       vcpu_pend_timer(vcpu);
                }
        }
 }
diff -Nru a/xen/arch/ia64/xenmisc.c b/xen/arch/ia64/xenmisc.c
--- a/xen/arch/ia64/xenmisc.c   2005-03-25 19:03:32 -05:00
+++ b/xen/arch/ia64/xenmisc.c   2005-03-25 19:03:32 -05:00
@@ -257,6 +257,7 @@
        //if (!is_idle_task(next->domain) )
                //send_guest_virq(next, VIRQ_TIMER);
        load_region_regs(current);
+       if (vcpu_timer_expired(current)) vcpu_pend_timer(current);
 }
 
 void panic_domain(struct pt_regs *regs, const char *fmt, ...)
@@ -276,5 +277,6 @@
        printf(buf);
        if (regs) show_registers(regs);
        domain_pause_by_systemcontroller(current->domain);
+       set_bit(DF_CRASHED, ed->domain->d_flags);
        //while(test);
 }
diff -Nru a/xen/include/asm-ia64/config.h b/xen/include/asm-ia64/config.h
--- a/xen/include/asm-ia64/config.h     2005-03-25 19:03:32 -05:00
+++ b/xen/include/asm-ia64/config.h     2005-03-25 19:03:32 -05:00
@@ -1,7 +1,6 @@
 // control flags for turning on/off features under test
 #undef CLONE_DOMAIN0
-//#define CLONE_DOMAIN0 3
-#define USER_ACCESS
+//#define CLONE_DOMAIN0 1
 
 // manufactured from component pieces
 


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix uninitialized variable causing early NaT fault, BitKeeper Bot <=