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 3/12] vti fault handler clean up take 2: make VT

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH 3/12] vti fault handler clean up take 2: make VTI_DEBUG configurable
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Mon, 3 Dec 2007 15:02:18 +0900
Cc: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Delivery-date: Sun, 02 Dec 2007 22:02:59 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
# HG changeset patch
# User yamahata@xxxxxxxxxxxxx
# Date 1190860381 -32400
# Node ID e14aa5c2f2db87e9421630e9ed74d6540f65f7ec
# Parent  d56b759c58c2fc932cd17a0b0a35825356d1cabd
make VTI_DEBUG configurable and make IVT_DEBUG_MAX changable.
PATCHNAME: debug_vti_debug_configurable

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff -r d56b759c58c2 -r e14aa5c2f2db xen/arch/ia64/Rules.mk
--- a/xen/arch/ia64/Rules.mk    Thu Nov 22 12:35:52 2007 +0900
+++ b/xen/arch/ia64/Rules.mk    Thu Sep 27 11:33:01 2007 +0900
@@ -6,6 +6,7 @@ HAS_VGA  := y
 HAS_VGA  := y
 xenoprof := y
 no_warns ?= n
+vti_debug ?= n
 xen_ia64_expose_p2m    ?= y
 xen_ia64_pervcpu_vhpt  ?= y
 xen_ia64_tlb_track     ?= y
@@ -36,7 +37,9 @@ CFLAGS        += -DIA64 -DXEN -DLINUX_2_6
 CFLAGS += -DIA64 -DXEN -DLINUX_2_6
 CFLAGS += -ffixed-r13 -mfixed-range=f2-f5,f12-f127,b2-b5
 CFLAGS += -g
-#CFLAGS  += -DVTI_DEBUG
+ifeq ($(vti_debug),y)
+CFLAGS  += -DVTI_DEBUG
+endif
 ifeq ($(xen_ia64_expose_p2m),y)
 CFLAGS += -DCONFIG_XEN_IA64_EXPOSE_P2M
 endif
diff -r d56b759c58c2 -r e14aa5c2f2db xen/arch/ia64/asm-offsets.c
--- a/xen/arch/ia64/asm-offsets.c       Thu Nov 22 12:35:52 2007 +0900
+++ b/xen/arch/ia64/asm-offsets.c       Thu Sep 27 11:33:01 2007 +0900
@@ -46,6 +46,7 @@ void foo(void)
 #ifdef   VTI_DEBUG
        DEFINE(IVT_CUR_OFS, offsetof(struct vcpu, arch.arch_vmx.ivt_current));
        DEFINE(IVT_DBG_OFS, offsetof(struct vcpu, arch.arch_vmx.ivt_debug));
+       DEFINE(IVT_DEBUG_SIZE, sizeof(struct ivt_debug));
 #endif
        DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
        DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count));
diff -r d56b759c58c2 -r e14aa5c2f2db xen/arch/ia64/vmx/vmx_ivt.S
--- a/xen/arch/ia64/vmx/vmx_ivt.S       Thu Nov 22 12:35:52 2007 +0900
+++ b/xen/arch/ia64/vmx/vmx_ivt.S       Thu Sep 27 11:33:01 2007 +0900
@@ -70,6 +70,7 @@
 
 
 #ifdef VTI_DEBUG
+#define IVT_DEBUG_MASK  (IVT_DEBUG_SIZE * (IVT_DEBUG_MAX - 1))
 #define VMX_DBG_FAULT(i)                \
     add r16=IVT_CUR_OFS,r21;            \
     add r17=IVT_DBG_OFS,r21;;           \
@@ -80,9 +81,9 @@
     mov r22=cr.ifa;                     \
     mov r23=i;;                         \
     st8 [r17]=r19,8;                    \
-    add r18=32,r18;;                    \
+    add r18=IVT_DEBUG_SIZE,r18;;        \
     st8 [r17]=r20,8;                    \
-    mov r19=0xfe0;;                     \
+    mov r19=IVT_DEBUG_MASK;;            \
     st8 [r17]=r22,8;                    \
     and r18=r19,r18;;                   \
     st8 [r17]=r23;                      \
diff -r d56b759c58c2 -r e14aa5c2f2db xen/arch/ia64/vmx/vmx_vcpu.c
--- a/xen/arch/ia64/vmx/vmx_vcpu.c      Thu Nov 22 12:35:52 2007 +0900
+++ b/xen/arch/ia64/vmx/vmx_vcpu.c      Thu Sep 27 11:33:01 2007 +0900
@@ -106,13 +106,10 @@ vmx_vcpu_set_psr(VCPU *vcpu, unsigned lo
     }
     new_psr.val=VCPU(vcpu, vpsr);
 #ifdef VTI_DEBUG    
-    {
-    struct pt_regs *regs = vcpu_regs(vcpu);
     guest_psr_buf[guest_psr_index].ip = regs->cr_iip;
     guest_psr_buf[guest_psr_index].psr = new_psr.val;
     if (++guest_psr_index >= 100)
         guest_psr_index = 0;
-    }
 #endif    
 #if 0
     if (old_psr.i != new_psr.i) {
diff -r d56b759c58c2 -r e14aa5c2f2db xen/include/asm-ia64/vmx_vpd.h
--- a/xen/include/asm-ia64/vmx_vpd.h    Thu Nov 22 12:35:52 2007 +0900
+++ b/xen/include/asm-ia64/vmx_vpd.h    Thu Sep 27 11:33:01 2007 +0900
@@ -22,6 +22,17 @@
 #ifndef _ASM_IA64_VMX_VPD_H_
 #define _ASM_IA64_VMX_VPD_H_
 
+#ifdef VTI_DEBUG
+/*
+ * must be power of 2.
+ * Be carefull to avoid stack over flow keeping
+ * struct arch_vmx_struct(i.e. struct vcpu) small enough.
+ * sizeof(struct ivt_debug) * IVT_DEBUG_MAX = 32 * IVT_DEBUG_MAX
+ */
+//#define IVT_DEBUG_MAX 128     /* 4096 bytes */
+#define IVT_DEBUG_MAX 16        /*  512 bytes */
+#endif
+
 #ifndef __ASSEMBLY__
 
 #include <asm/vtm.h>
@@ -39,7 +50,6 @@ struct ivt_debug{
     unsigned long ifa;
     unsigned long vector;
 };
-#define IVT_DEBUG_MAX 128
 #endif
 
 struct arch_vmx_struct {

Attachment: 16504_e14aa5c2f2db_debug_vti_debug_configurable.patch
Description: Text Data

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-ia64-devel] [PATCH 3/12] vti fault handler clean up take 2: make VTI_DEBUG configurable, Isaku Yamahata <=