debuggers.hg
changeset 16836:ba569af64b44
[IA64] vti fault handler clean up: make VTI_DEBUG configurable
And make IVT_DEBUG_MAX changable.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
And make IVT_DEBUG_MAX changable.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author | Alex Williamson <alex.williamson@hp.com> |
---|---|
date | Fri Dec 14 13:09:02 2007 -0700 (2007-12-14) |
parents | 0f5926ba1d28 |
children | 40f15062d188 |
files | xen/arch/ia64/Rules.mk xen/arch/ia64/asm-offsets.c xen/arch/ia64/vmx/vmx_ivt.S xen/arch/ia64/vmx/vmx_vcpu.c xen/include/asm-ia64/vmx_vpd.h |
line diff
1.1 --- a/xen/arch/ia64/Rules.mk Fri Dec 14 13:07:01 2007 -0700 1.2 +++ b/xen/arch/ia64/Rules.mk Fri Dec 14 13:09:02 2007 -0700 1.3 @@ -6,6 +6,7 @@ HAS_ACPI := y 1.4 HAS_VGA := y 1.5 xenoprof := y 1.6 no_warns ?= n 1.7 +vti_debug ?= n 1.8 xen_ia64_expose_p2m ?= y 1.9 xen_ia64_pervcpu_vhpt ?= y 1.10 xen_ia64_tlb_track ?= y 1.11 @@ -36,7 +37,9 @@ CFLAGS += $(CPPFLAGS) 1.12 CFLAGS += -DIA64 -DXEN -DLINUX_2_6 1.13 CFLAGS += -ffixed-r13 -mfixed-range=f2-f5,f12-f127,b2-b5 1.14 CFLAGS += -g 1.15 -#CFLAGS += -DVTI_DEBUG 1.16 +ifeq ($(vti_debug),y) 1.17 +CFLAGS += -DVTI_DEBUG 1.18 +endif 1.19 ifeq ($(xen_ia64_expose_p2m),y) 1.20 CFLAGS += -DCONFIG_XEN_IA64_EXPOSE_P2M 1.21 endif
2.1 --- a/xen/arch/ia64/asm-offsets.c Fri Dec 14 13:07:01 2007 -0700 2.2 +++ b/xen/arch/ia64/asm-offsets.c Fri Dec 14 13:09:02 2007 -0700 2.3 @@ -46,6 +46,7 @@ void foo(void) 2.4 #ifdef VTI_DEBUG 2.5 DEFINE(IVT_CUR_OFS, offsetof(struct vcpu, arch.arch_vmx.ivt_current)); 2.6 DEFINE(IVT_DBG_OFS, offsetof(struct vcpu, arch.arch_vmx.ivt_debug)); 2.7 + DEFINE(IVT_DEBUG_SIZE, sizeof(struct ivt_debug)); 2.8 #endif 2.9 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); 2.10 DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count));
3.1 --- a/xen/arch/ia64/vmx/vmx_ivt.S Fri Dec 14 13:07:01 2007 -0700 3.2 +++ b/xen/arch/ia64/vmx/vmx_ivt.S Fri Dec 14 13:09:02 2007 -0700 3.3 @@ -70,6 +70,7 @@ 3.4 3.5 3.6 #ifdef VTI_DEBUG 3.7 +#define IVT_DEBUG_MASK (IVT_DEBUG_SIZE * (IVT_DEBUG_MAX - 1)) 3.8 #define VMX_DBG_FAULT(i) \ 3.9 add r16=IVT_CUR_OFS,r21; \ 3.10 add r17=IVT_DBG_OFS,r21;; \ 3.11 @@ -80,9 +81,9 @@ 3.12 mov r22=cr.ifa; \ 3.13 mov r23=i;; \ 3.14 st8 [r17]=r19,8; \ 3.15 - add r18=32,r18;; \ 3.16 + add r18=IVT_DEBUG_SIZE,r18;; \ 3.17 st8 [r17]=r20,8; \ 3.18 - mov r19=0xfe0;; \ 3.19 + mov r19=IVT_DEBUG_MASK;; \ 3.20 st8 [r17]=r22,8; \ 3.21 and r18=r19,r18;; \ 3.22 st8 [r17]=r23; \
4.1 --- a/xen/arch/ia64/vmx/vmx_vcpu.c Fri Dec 14 13:07:01 2007 -0700 4.2 +++ b/xen/arch/ia64/vmx/vmx_vcpu.c Fri Dec 14 13:09:02 2007 -0700 4.3 @@ -111,13 +111,10 @@ vmx_vcpu_set_psr(VCPU *vcpu, unsigned lo 4.4 } 4.5 new_psr.val=VCPU(vcpu, vpsr); 4.6 #ifdef VTI_DEBUG 4.7 - { 4.8 - struct pt_regs *regs = vcpu_regs(vcpu); 4.9 guest_psr_buf[guest_psr_index].ip = regs->cr_iip; 4.10 guest_psr_buf[guest_psr_index].psr = new_psr.val; 4.11 if (++guest_psr_index >= 100) 4.12 guest_psr_index = 0; 4.13 - } 4.14 #endif 4.15 #if 0 4.16 if (old_psr.i != new_psr.i) {
5.1 --- a/xen/include/asm-ia64/vmx_vpd.h Fri Dec 14 13:07:01 2007 -0700 5.2 +++ b/xen/include/asm-ia64/vmx_vpd.h Fri Dec 14 13:09:02 2007 -0700 5.3 @@ -22,6 +22,17 @@ 5.4 #ifndef _ASM_IA64_VMX_VPD_H_ 5.5 #define _ASM_IA64_VMX_VPD_H_ 5.6 5.7 +#ifdef VTI_DEBUG 5.8 +/* 5.9 + * must be power of 2. 5.10 + * Be carefull to avoid stack over flow keeping 5.11 + * struct arch_vmx_struct(i.e. struct vcpu) small enough. 5.12 + * sizeof(struct ivt_debug) * IVT_DEBUG_MAX = 32 * IVT_DEBUG_MAX 5.13 + */ 5.14 +//#define IVT_DEBUG_MAX 128 /* 4096 bytes */ 5.15 +#define IVT_DEBUG_MAX 16 /* 512 bytes */ 5.16 +#endif 5.17 + 5.18 #ifndef __ASSEMBLY__ 5.19 5.20 #include <asm/vtm.h> 5.21 @@ -39,7 +50,6 @@ struct ivt_debug{ 5.22 unsigned long ifa; 5.23 unsigned long vector; 5.24 }; 5.25 -#define IVT_DEBUG_MAX 128 5.26 #endif 5.27 5.28 struct arch_vmx_struct {