[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] config.h, xenmisc.c, xenasm.S, process.c, domain.c:



ChangeSet 1.1305.1.1, 2005/03/14 11:28:54-07:00, djm@djmnc4000.(none)

        config.h, xenmisc.c, xenasm.S, process.c, domain.c:
          cleanup



 arch/ia64/domain.c        |    2 ++
 arch/ia64/process.c       |   34 +++++++---------------------------
 arch/ia64/xenasm.S        |   19 -------------------
 arch/ia64/xenmisc.c       |   30 +++++++++++++++++++++++++++---
 include/asm-ia64/config.h |    4 ++--
 5 files changed, 38 insertions(+), 51 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:02:53 -05:00
+++ b/xen/arch/ia64/domain.c    2005-03-25 19:02:53 -05:00
@@ -670,6 +670,7 @@
 }
 
 
+#if 0
 void switch_to(struct exec_domain *prev, struct exec_domain *next)
 {
        struct exec_domain *last;
@@ -677,6 +678,7 @@
        __switch_to(prev,next,last);
        //set_current(next);
 }
+#endif
 
 void domain_pend_keyboard_interrupt(int irq)
 {
diff -Nru a/xen/arch/ia64/process.c b/xen/arch/ia64/process.c
--- a/xen/arch/ia64/process.c   2005-03-25 19:02:53 -05:00
+++ b/xen/arch/ia64/process.c   2005-03-25 19:02:53 -05:00
@@ -143,15 +143,13 @@
        }
        if (!PSCB(ed,interrupt_collection_enabled)) {
                if (!(PSCB(ed,ipsr) & IA64_PSR_DT)) {
-                       printf("psr.dt off, trying to deliver nested dtlb!\n");
-                       while(1);
+                       panic_domain(regs,"psr.dt off, trying to deliver nested 
dtlb!\n");
                }
                vector &= ~0xf;
                if (vector != IA64_DATA_TLB_VECTOR &&
                    vector != IA64_DATA_TLB_VECTOR) {
-printf("psr.ic off, delivering fault=%lx,iip=%p,isr=%p,PSCB.iip=%p\n",
+panic_domain(regs,"psr.ic off, delivering 
fault=%lx,iip=%p,isr=%p,PSCB.iip=%p\n",
        vector,regs->cr_iip,isr,PSCB(ed,iip));
-                       while(1);
                        
                }
 //printf("Delivering NESTED DATA TLB fault\n");
@@ -243,9 +241,6 @@
        unsigned long lookup_domain_mpa(struct domain *,unsigned long);
        unsigned long match_dtlb(struct exec_domain *,unsigned long, unsigned 
long *, unsigned long *);
        IA64FAULT fault;
-#ifndef USER_ACCESS
-       extern void __get_domain_bundle(void);
-#endif
 
 // NEED TO HANDLE THREE CASES:
 // 1) domain is in metaphysical mode
@@ -268,13 +263,6 @@
                vcpu_itc_no_srlz(ed,2,address,pteval,-1UL,PAGE_SHIFT);
                return;
        }
-#ifndef USER_ACCESS
-       if (*(unsigned long *)__get_domain_bundle != iip) {
-               printf("Bad user space access @%p ",address);
-               printf("iip=%p, ipsr=%p, b0=%p\n",iip,psr,regs->b0);
-               while(1);
-       }
-#endif
 if (address < 0x4000) printf("WARNING: page_fault @%p, iip=%p\n",address,iip);
                
        // if we are fortunate enough to have it in the 1-entry TLB...
@@ -285,13 +273,6 @@
        // look in the TRs
        fault = vcpu_tpa(ed,address,&mpaddr);
        if (fault != IA64_NO_FAULT) {
-#ifndef USER_ACCESS
-               // this is hardcoded to handle __get_domain_bundle only
-               regs->r8 = 0; regs->r9 = 0;
-               regs->cr_iip += 0x20;
-               //regs->cr_iip |= (2UL << IA64_PSR_RI_BIT);
-               return;
-#else /* USER_ACCESS */
                static int uacnt = 0;
                // can't translate it, just fail (poor man's exception)
                // which results in retrying execution
@@ -303,12 +284,10 @@
                else {
                        // should never happen.  If it does, region 0 addr may
                        // indicate a bad xen pointer
-                       printk("*** xen_handle_domain_access: exception table"
+                       panic_domain(regs,"*** xen_handle_domain_access: 
exception table"
                                " lookup failed, iip=%p, addr=%p, 
spinning...\n",
                                iip,address);
-                       while(1);
                }
-#endif /* USER_ACCESS */
        }
        if (d == dom0) {
                if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) {
@@ -375,7 +354,9 @@
        }
        vector = is_data ? IA64_DATA_TLB_VECTOR : IA64_INST_TLB_VECTOR;
        if (handle_lazy_cover(current, isr, regs)) return;
-if (!(address>>61)) { printf("ia64_do_page_fault: @%p???, iip=%p, itc=%p 
(spinning...)\n",address,iip,ia64_get_itc()); while(1); }
+if (!(address>>61)) {
+panic_domain(0,"ia64_do_page_fault: @%p???, iip=%p, itc=%p 
(spinning...)\n",address,iip,ia64_get_itc());
+}
        if ((isr & IA64_ISR_SP)
            || ((isr & IA64_ISR_NA) && (isr & IA64_ISR_CODE_MASK) == 
IA64_ISR_CODE_LFETCH))
        {
@@ -835,8 +816,7 @@
        unsigned long itir = vcpu_get_itir_on_fault(ed,ifa);
 
        if (!(psr & IA64_PSR_CPL)) {
-               printf("ia64_handle_reflection: reflecting with priv=0!!\n");
-               while(1);
+               panic_domain(regs,"ia64_handle_reflection: reflecting with 
priv=0!!\n");
        }
        // FIXME: no need to pass itir in to this routine as we need to
        // compute the virtual itir anyway (based on domain's RR.ps)
diff -Nru a/xen/arch/ia64/xenasm.S b/xen/arch/ia64/xenasm.S
--- a/xen/arch/ia64/xenasm.S    2005-03-25 19:02:53 -05:00
+++ b/xen/arch/ia64/xenasm.S    2005-03-25 19:02:53 -05:00
@@ -261,24 +261,6 @@
        br.cond.sptk.many rp                    // goes to ia64_leave_kernel
 END(ia64_prepare_handle_reflection)
 
-#ifndef USER_ACCESS
-// REMOVE: replaced with get_user
-// NOTE: instruction spacing must be explicit for recovery on miss
-GLOBAL_ENTRY(__get_domain_bundle)
-       ld8 r8=[r32],8
-       nop 0
-       nop 0
-       ;;
-       ld8 r9=[r32]
-       nop 0
-       nop 0
-       ;;
-       br.ret.sptk.many rp
-       nop 0
-       nop 0
-       ;;
-END(__get_domain_bundle)
-#else
 GLOBAL_ENTRY(__get_domain_bundle)
        EX(.failure_in_get_bundle,ld8 r8=[r32],8)
        ;;
@@ -294,7 +276,6 @@
        br.ret.sptk.many rp
        ;;
 END(__get_domain_bundle)
-#endif
 
 GLOBAL_ENTRY(dorfirfi)
 #define SI_CR_IIP_OFFSET 0x10
diff -Nru a/xen/arch/ia64/xenmisc.c b/xen/arch/ia64/xenmisc.c
--- a/xen/arch/ia64/xenmisc.c   2005-03-25 19:02:53 -05:00
+++ b/xen/arch/ia64/xenmisc.c   2005-03-25 19:02:53 -05:00
@@ -203,7 +203,7 @@
 
 void show_registers(struct pt_regs *regs)
 {
-       dummy();
+       printf("*** ADD REGISTER DUMP HERE FOR DEBUGGING\n");
 }      
 
 ///////////////////////////////
@@ -240,12 +240,36 @@
        return NULL;
 }
 
+void cs10foo(void) {}
+void cs01foo(void) {}
+
 // context_switch
 void context_switch(struct exec_domain *prev, struct exec_domain *next)
 {
-       switch_to(prev,next);
+printk("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
+printk("@@@@@@ context switch from domain %d (%x) to domain %d (%x)\n",
+prev->domain->id,(long)prev&0xffffff,next->domain->id,(long)next&0xffffff);
+printk("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
+if (prev->domain->id == 1 && next->domain->id == 0) cs10foo();
+if (prev->domain->id == 0 && next->domain->id == 1) cs01foo();
+       switch_to(prev,next,prev);
        clear_bit(EDF_RUNNING, &prev->ed_flags);
        //if (!is_idle_task(next->domain) )
                //send_guest_virq(next, VIRQ_TIMER);
-       schedule_tail(next);
+       load_region_regs(current);
+}
+
+void panic_domain(struct pt_regs *regs, const char *fmt, ...)
+{
+       va_list args;
+       char buf[128];
+       struct exec_domain *ed = current;
+       static volatile int test = 1;   // so can continue easily in debug
+    
+       printf("$$$$$ PANIC in domain %d:",ed->domain->id);
+       va_start(args, fmt);
+       (void)vsnprintf(buf, sizeof(buf), fmt, args);
+       va_end(args);
+       if (regs) show_registers(regs);
+       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:02:53 -05:00
+++ b/xen/include/asm-ia64/config.h     2005-03-25 19:02:53 -05:00
@@ -1,6 +1,6 @@
 // control flags for turning on/off features under test
-#undef CLONE_DOMAIN0
-//#define CLONE_DOMAIN0 1
+//#undef CLONE_DOMAIN0
+#define CLONE_DOMAIN0 1
 //#undef CLONE_DOMAIN0
 #define USER_ACCESS
 


-------------------------------------------------------
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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.