# HG changeset patch
# User yamahata@xxxxxxxxxxxxx
# Date 1190860381 -32400
# Node ID a734b0e01f127f6fe8466c49b325e95347219fc1
# Parent 53dc1cf505060a06e5b34a4812fce4312743ca26
make VTI_DEBUG configurable and make IVT_DEBUG_MAX changable.
PATCHNAME: debug_vti_debug_configurable
Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
diff -r 53dc1cf50506 -r a734b0e01f12 xen/arch/ia64/Rules.mk
--- a/xen/arch/ia64/Rules.mk Wed Nov 21 09:12:06 2007 -0700
+++ 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 53dc1cf50506 -r a734b0e01f12 xen/arch/ia64/asm-offsets.c
--- a/xen/arch/ia64/asm-offsets.c Wed Nov 21 09:12:06 2007 -0700
+++ 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 53dc1cf50506 -r a734b0e01f12 xen/arch/ia64/vmx/vmx_ivt.S
--- a/xen/arch/ia64/vmx/vmx_ivt.S Wed Nov 21 09:12:06 2007 -0700
+++ b/xen/arch/ia64/vmx/vmx_ivt.S Thu Sep 27 11:33:01 2007 +0900
@@ -74,6 +74,7 @@
* This lets you track the last eight faults that occurred on the CPU. Make
sure ar.k2 isn't
* needed for something else before enabling this...
*/
+#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;; \
@@ -84,9 +85,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 53dc1cf50506 -r a734b0e01f12 xen/arch/ia64/vmx/vmx_vcpu.c
--- a/xen/arch/ia64/vmx/vmx_vcpu.c Wed Nov 21 09:12:06 2007 -0700
+++ b/xen/arch/ia64/vmx/vmx_vcpu.c Thu Sep 27 11:33:01 2007 +0900
@@ -105,13 +105,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 53dc1cf50506 -r a734b0e01f12 xen/include/asm-ia64/vmx_vpd.h
--- a/xen/include/asm-ia64/vmx_vpd.h Wed Nov 21 09:12:06 2007 -0700
+++ 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 {
16418_a734b0e01f12_debug_vti_debug_configurable.patch
Description: Text Data
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
|