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] [IA64] fixed switch to idle domain bug

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [IA64] fixed switch to idle domain bug
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 02 Mar 2006 12:16:17 +0000
Delivery-date: Thu, 02 Mar 2006 12:18:41 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID dcbe36ee21718d5f423c6415ed79ce6a8d0ab4f9
# Parent  3c091740f6ff3abe77ffd4ef0610a05b0fd98f6f
[IA64] fixed switch to idle domain bug

Previously when switching to idle domain, cr.pta is set to dom0's VHPT,
then when switching from VTIdomain to idle domain, cr.pta is set to
dom0's VHPT, and in idle domain, VHPT will be not remapped by TR, so
there may be unexpected vhpt fault in idle domain, which may cause
domain crash. Above only happens in host smp platform not host up
platform. This patch is intended to fix this bug.

Signed-off-by: Kevin Tian <kevin.tian@xxxxxxxxx>
Signed-off-by: Anthony Xu <anthony.xu@xxxxxxxxx>

diff -r 3c091740f6ff -r dcbe36ee2171 xen/arch/ia64/xen/xenmisc.c
--- a/xen/arch/ia64/xen/xenmisc.c       Fri Feb 17 21:57:19 2006
+++ b/xen/arch/ia64/xen/xenmisc.c       Fri Feb 17 22:02:40 2006
@@ -295,6 +295,7 @@
 void context_switch(struct vcpu *prev, struct vcpu *next)
 {
     uint64_t spsr;
+    uint64_t pta;
 
     local_irq_save(spsr);
     if(VMX_DOMAIN(prev)){
@@ -302,9 +303,9 @@
     }
        context_switch_count++;
        switch_to(prev,next,prev);
-    if(VMX_DOMAIN(current)){
-        vtm_domain_in(current);
-    }
+//    if(VMX_DOMAIN(current)){
+//        vtm_domain_in(current);
+//    }
 
 // leave this debug for now: it acts as a heartbeat when more than
 // one domain is active
@@ -317,18 +318,26 @@
 }
 
     if (VMX_DOMAIN(current)){
+        vtm_domain_in(current);
                vmx_load_all_rr(current);
     }else{
-       extern char ia64_ivt;
-       ia64_set_iva(&ia64_ivt);
-       ia64_set_pta(VHPT_ADDR | (1 << 8) | (VHPT_SIZE_LOG2 << 2) |
-               VHPT_ENABLED);
+       extern char ia64_ivt;
+       ia64_set_iva(&ia64_ivt);
        if (!is_idle_domain(current->domain)) {
+               ia64_set_pta(VHPT_ADDR | (1 << 8) | (VHPT_SIZE_LOG2 << 2) |
+                       VHPT_ENABLED);
                load_region_regs(current);
                vcpu_load_kernel_regs(current);
-                   if (vcpu_timer_expired(current)) vcpu_pend_timer(current);
-       }
-           if (vcpu_timer_expired(current)) vcpu_pend_timer(current);
+                   if (vcpu_timer_expired(current))
+                vcpu_pend_timer(current);
+       }else {
+        /* When switching to idle domain, only need to disable vhpt
+        * walker. Then all accesses happen within idle context will
+        * be handled by TR mapping and identity mapping.
+        */
+           pta = ia64_get_pta();
+           ia64_set_pta(pta & ~VHPT_ENABLED);
+        }
     }
 
     local_irq_restore(spsr);
diff -r 3c091740f6ff -r dcbe36ee2171 
xen/include/asm-ia64/linux-xen/asm/processor.h
--- a/xen/include/asm-ia64/linux-xen/asm/processor.h    Fri Feb 17 21:57:19 2006
+++ b/xen/include/asm-ia64/linux-xen/asm/processor.h    Fri Feb 17 22:02:40 2006
@@ -639,6 +639,19 @@
        return r;
 }
 
+#ifdef XEN
+/* Get the page table address and control bits.  */
+static inline __u64
+ia64_get_pta (void)
+{
+   __u64 r;
+   ia64_srlz_d();
+   r = ia64_getreg(_IA64_REG_CR_PTA);
+   ia64_srlz_d();
+   return r;
+}
+#endif
+
 static inline void
 ia64_set_dbr (__u64 regnum, __u64 value)
 {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [IA64] fixed switch to idle domain bug, Xen patchbot -unstable <=