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

[Xen-ia64-devel] [PATCH] fix INIT injection

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH] fix INIT injection
From: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Date: Wed, 17 Sep 2008 15:59:47 +0900
Delivery-date: Tue, 16 Sep 2008 23:59:57 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
xm trigger command sometimes causes an unexpected domain panic.
There are several symptoms:
 * Guest nested fault (INIT handler runs with vpsr.cpl != 0)
 * Interrupt when IC=0
 * Unexpected virtual <--> physical mode transition

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Signed-off-by: Kazuhiro Suzuki <kaz@xxxxxxxxxxxxxx>

diff -r 4a381ddc764a xen/arch/ia64/vmx/vlsapic.c
--- a/xen/arch/ia64/vmx/vlsapic.c       Tue Sep 16 21:25:30 2008 +0900
+++ b/xen/arch/ia64/vmx/vlsapic.c       Wed Sep 17 11:44:04 2008 +0900
@@ -43,6 +43,7 @@
 #include <asm/vmx_platform.h>
 #include <asm/viosapic.h>
 #include <asm/vlsapic.h>
+#include <asm/vmx_phy_mode.h>
 #include <asm/linux/jiffies.h>
 #include <xen/domain.h>
 #include <asm/hvm/support.h>
@@ -614,9 +615,8 @@ struct vcpu *lid_to_vcpu(struct domain *
  * To inject INIT to guest, we must set the PAL_INIT entry 
  * and set psr to switch to physical mode
  */
-#define PAL_INIT_ENTRY 0x80000000ffffffa0
 #define PSR_SET_BITS (IA64_PSR_DT | IA64_PSR_IT | IA64_PSR_RT | \
-                      IA64_PSR_IC | IA64_PSR_RI)
+                      IA64_PSR_IC | IA64_PSR_RI | IA64_PSR_I | IA64_PSR_CPL)
 
 static void vmx_inject_guest_pal_init(VCPU *vcpu)
 {
diff -r 4a381ddc764a xen/arch/ia64/vmx/vmx_phy_mode.c
--- a/xen/arch/ia64/vmx/vmx_phy_mode.c  Tue Sep 16 21:25:30 2008 +0900
+++ b/xen/arch/ia64/vmx/vmx_phy_mode.c  Wed Sep 17 11:44:04 2008 +0900
@@ -283,6 +283,13 @@ switch_mm_mode(VCPU *vcpu, IA64_PSR old_
 //               old_psr.val, new_psr.val);
         break;
     default:
+        /* Switch to physical mode when injecting PAL_INIT */
+        if (MODE_IND(new_psr) == 0 &&
+            vcpu_regs(vcpu)->cr_iip == PAL_INIT_ENTRY) {
+            vcpu->arch.arch_vmx.mmu_mode = VMX_MMU_PHY_DT;
+            switch_to_physical_rid(vcpu);
+            break;
+        }
         /* Sanity check */
         panic_domain(vcpu_regs(vcpu),
                      "Unexpected virtual <--> physical mode transition, "
diff -r 4a381ddc764a xen/include/asm-ia64/vmx_phy_mode.h
--- a/xen/include/asm-ia64/vmx_phy_mode.h       Tue Sep 16 21:25:30 2008 +0900
+++ b/xen/include/asm-ia64/vmx_phy_mode.h       Wed Sep 17 11:44:04 2008 +0900
@@ -96,4 +96,6 @@ extern void physical_tlb_miss(VCPU *vcpu
 #define VMX_MMU_PHY_D      1    /* Half physical: it=1,dt=0  */
 #define VMX_MMU_PHY_DT     3    /* Full physical mode: it=0,dt=0  */
 
+#define PAL_INIT_ENTRY 0x80000000ffffffa0
+
 #endif /* _PHY_MODE_H_ */
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>