ia64/xen-unstable
changeset 8382:3d379e5f3d7f
Facilitate to debug VTI-domain issue.
Signed-off-by Anthony Xu <anthony.xu@intel.com>
Signed-off-by Anthony Xu <anthony.xu@intel.com>
author | djm@kirby.fc.hp.com |
---|---|
date | Wed Dec 21 09:33:45 2005 -0600 (2005-12-21) |
parents | 724f412d81ab |
children | 2c75070e41a0 |
files | xen/arch/ia64/Rules.mk xen/arch/ia64/asm-offsets.c xen/arch/ia64/vmx/vmx_ivt.S xen/include/asm-ia64/vmx_vpd.h |
line diff
1.1 --- a/xen/arch/ia64/Rules.mk Wed Dec 21 09:31:05 2005 -0600 1.2 +++ b/xen/arch/ia64/Rules.mk Wed Dec 21 09:33:45 2005 -0600 1.3 @@ -27,6 +27,7 @@ CFLAGS += -Wno-pointer-arith -Wredundan 1.4 CFLAGS += -DIA64 -DXEN -DLINUX_2_6 -DV_IOSAPIC_READY 1.5 CFLAGS += -ffixed-r13 -mfixed-range=f12-f15,f32-f127 1.6 CFLAGS += -w -g 1.7 +#CFLAGS += -DVTI_DEBUG 1.8 ifeq ($(VALIDATE_VT),y) 1.9 CFLAGS += -DVALIDATE_VT 1.10 endif
2.1 --- a/xen/arch/ia64/asm-offsets.c Wed Dec 21 09:31:05 2005 -0600 2.2 +++ b/xen/arch/ia64/asm-offsets.c Wed Dec 21 09:33:45 2005 -0600 2.3 @@ -34,7 +34,10 @@ void foo(void) 2.4 DEFINE(UNW_FRAME_INFO_SIZE, sizeof (struct unw_frame_info)); 2.5 2.6 BLANK(); 2.7 - 2.8 +#ifdef VTI_DEBUG 2.9 + DEFINE(IVT_CUR_OFS, offsetof(struct vcpu, arch.arch_vmx.ivt_current)); 2.10 + DEFINE(IVT_DBG_OFS, offsetof(struct vcpu, arch.arch_vmx.ivt_debug)); 2.11 +#endif 2.12 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); 2.13 DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count)); 2.14
3.1 --- a/xen/arch/ia64/vmx/vmx_ivt.S Wed Dec 21 09:31:05 2005 -0600 3.2 +++ b/xen/arch/ia64/vmx/vmx_ivt.S Wed Dec 21 09:33:45 2005 -0600 3.3 @@ -59,13 +59,29 @@ 3.4 #include <asm/unistd.h> 3.5 #include <asm/vhpt.h> 3.6 3.7 - 3.8 -#if 0 3.9 +#ifdef VTI_DEBUG 3.10 /* 3.11 * This lets you track the last eight faults that occurred on the CPU. Make sure ar.k2 isn't 3.12 * needed for something else before enabling this... 3.13 */ 3.14 -# define VMX_DBG_FAULT(i) mov r16=ar.k2;; shl r16=r16,8;; add r16=(i),r16;;mov ar.k2=r16 3.15 +#define VMX_DBG_FAULT(i) \ 3.16 + add r16=IVT_CUR_OFS,r21; \ 3.17 + add r17=IVT_DBG_OFS,r21;; \ 3.18 + ld8 r18=[r16];; \ 3.19 + add r17=r18,r17; \ 3.20 + mov r19=cr.iip; \ 3.21 + mov r20=cr.ipsr; \ 3.22 + mov r22=cr.ifa; \ 3.23 + mov r23=i;; \ 3.24 + st8 [r17]=r19,8; \ 3.25 + add r18=32,r18;; \ 3.26 + st8 [r17]=r20,8; \ 3.27 + mov r19=0xfe0;; \ 3.28 + st8 [r17]=r22,8; \ 3.29 + and r18=r19,r18;; \ 3.30 + st8 [r17]=r23; \ 3.31 + st8 [r16]=r18;; \ 3.32 +//# define VMX_DBG_FAULT(i) mov r16=ar.k2;; shl r16=r16,8;; add r16=(i),r16;;mov ar.k2=r16 3.33 #else 3.34 # define VMX_DBG_FAULT(i) 3.35 #endif 3.36 @@ -107,6 +123,7 @@ vmx_ia64_ivt: 3.37 ///////////////////////////////////////////////////////////////////////////////////////// 3.38 // 0x0000 Entry 0 (size 64 bundles) VHPT Translation (8,20,47) 3.39 ENTRY(vmx_vhpt_miss) 3.40 + VMX_DBG_FAULT(0) 3.41 VMX_FAULT(0) 3.42 END(vmx_vhpt_miss) 3.43 3.44 @@ -114,6 +131,7 @@ END(vmx_vhpt_miss) 3.45 ///////////////////////////////////////////////////////////////////////////////////////// 3.46 // 0x0400 Entry 1 (size 64 bundles) ITLB (21) 3.47 ENTRY(vmx_itlb_miss) 3.48 + VMX_DBG_FAULT(1) 3.49 mov r31 = pr 3.50 mov r29=cr.ipsr; 3.51 ;; 3.52 @@ -178,6 +196,7 @@ END(vmx_itlb_miss) 3.53 ///////////////////////////////////////////////////////////////////////////////////////// 3.54 // 0x0800 Entry 2 (size 64 bundles) DTLB (9,48) 3.55 ENTRY(vmx_dtlb_miss) 3.56 + VMX_DBG_FAULT(2) 3.57 mov r31 = pr 3.58 mov r29=cr.ipsr; 3.59 ;; 3.60 @@ -242,6 +261,7 @@ END(vmx_dtlb_miss) 3.61 ///////////////////////////////////////////////////////////////////////////////////////// 3.62 // 0x0c00 Entry 3 (size 64 bundles) Alt ITLB (19) 3.63 ENTRY(vmx_alt_itlb_miss) 3.64 + VMX_DBG_FAULT(3) 3.65 mov r31 = pr 3.66 mov r29=cr.ipsr; 3.67 ;; 3.68 @@ -272,6 +292,7 @@ END(vmx_alt_itlb_miss) 3.69 ///////////////////////////////////////////////////////////////////////////////////////// 3.70 // 0x1000 Entry 4 (size 64 bundles) Alt DTLB (7,46) 3.71 ENTRY(vmx_alt_dtlb_miss) 3.72 + VMX_DBG_FAULT(4) 3.73 mov r31=pr 3.74 mov r29=cr.ipsr; 3.75 ;; 3.76 @@ -308,6 +329,7 @@ END(vmx_alt_dtlb_miss) 3.77 ///////////////////////////////////////////////////////////////////////////////////////// 3.78 // 0x1400 Entry 5 (size 64 bundles) Data nested TLB (6,45) 3.79 ENTRY(vmx_nested_dtlb_miss) 3.80 + VMX_DBG_FAULT(5) 3.81 VMX_FAULT(5) 3.82 END(vmx_nested_dtlb_miss) 3.83 3.84 @@ -315,6 +337,7 @@ END(vmx_nested_dtlb_miss) 3.85 ///////////////////////////////////////////////////////////////////////////////////////// 3.86 // 0x1800 Entry 6 (size 64 bundles) Instruction Key Miss (24) 3.87 ENTRY(vmx_ikey_miss) 3.88 + VMX_DBG_FAULT(6) 3.89 VMX_REFLECT(6) 3.90 END(vmx_ikey_miss) 3.91 3.92 @@ -322,6 +345,7 @@ END(vmx_ikey_miss) 3.93 ///////////////////////////////////////////////////////////////////////////////////////// 3.94 // 0x1c00 Entry 7 (size 64 bundles) Data Key Miss (12,51) 3.95 ENTRY(vmx_dkey_miss) 3.96 + VMX_DBG_FAULT(7) 3.97 VMX_REFLECT(7) 3.98 END(vmx_dkey_miss) 3.99 3.100 @@ -329,6 +353,7 @@ END(vmx_dkey_miss) 3.101 ///////////////////////////////////////////////////////////////////////////////////////// 3.102 // 0x2000 Entry 8 (size 64 bundles) Dirty-bit (54) 3.103 ENTRY(vmx_dirty_bit) 3.104 + VMX_DBG_FAULT(8) 3.105 VMX_REFLECT(8) 3.106 END(vmx_idirty_bit) 3.107 3.108 @@ -336,6 +361,7 @@ END(vmx_idirty_bit) 3.109 ///////////////////////////////////////////////////////////////////////////////////////// 3.110 // 0x2400 Entry 9 (size 64 bundles) Instruction Access-bit (27) 3.111 ENTRY(vmx_iaccess_bit) 3.112 + VMX_DBG_FAULT(9) 3.113 VMX_REFLECT(9) 3.114 END(vmx_iaccess_bit) 3.115 3.116 @@ -343,6 +369,7 @@ END(vmx_iaccess_bit) 3.117 ///////////////////////////////////////////////////////////////////////////////////////// 3.118 // 0x2800 Entry 10 (size 64 bundles) Data Access-bit (15,55) 3.119 ENTRY(vmx_daccess_bit) 3.120 + VMX_DBG_FAULT(10) 3.121 VMX_REFLECT(10) 3.122 END(vmx_daccess_bit) 3.123 3.124 @@ -350,6 +377,7 @@ END(vmx_daccess_bit) 3.125 ///////////////////////////////////////////////////////////////////////////////////////// 3.126 // 0x2c00 Entry 11 (size 64 bundles) Break instruction (33) 3.127 ENTRY(vmx_break_fault) 3.128 + VMX_DBG_FAULT(11) 3.129 mov r31=pr 3.130 mov r19=11 3.131 mov r30=cr.iim 3.132 @@ -369,6 +397,7 @@ END(vmx_break_fault) 3.133 ///////////////////////////////////////////////////////////////////////////////////////// 3.134 // 0x3000 Entry 12 (size 64 bundles) External Interrupt (4) 3.135 ENTRY(vmx_interrupt) 3.136 + VMX_DBG_FAULT(12) 3.137 mov r31=pr // prepare to save predicates 3.138 mov r19=12 3.139 mov r29=cr.ipsr 3.140 @@ -531,45 +560,46 @@ END(vmx_virtual_exirq) 3.141 .org vmx_ia64_ivt+0x3800 3.142 ///////////////////////////////////////////////////////////////////////////////////////// 3.143 // 0x3800 Entry 14 (size 64 bundles) Reserved 3.144 - VMX_DBG_FAULT(14) 3.145 + VMX_DBG_FAULT(14) 3.146 VMX_FAULT(14) 3.147 3.148 3.149 .org vmx_ia64_ivt+0x3c00 3.150 ///////////////////////////////////////////////////////////////////////////////////////// 3.151 // 0x3c00 Entry 15 (size 64 bundles) Reserved 3.152 - VMX_DBG_FAULT(15) 3.153 + VMX_DBG_FAULT(15) 3.154 VMX_FAULT(15) 3.155 3.156 3.157 .org vmx_ia64_ivt+0x4000 3.158 ///////////////////////////////////////////////////////////////////////////////////////// 3.159 // 0x4000 Entry 16 (size 64 bundles) Reserved 3.160 - VMX_DBG_FAULT(16) 3.161 + VMX_DBG_FAULT(16) 3.162 VMX_FAULT(16) 3.163 3.164 .org vmx_ia64_ivt+0x4400 3.165 ///////////////////////////////////////////////////////////////////////////////////////// 3.166 // 0x4400 Entry 17 (size 64 bundles) Reserved 3.167 - VMX_DBG_FAULT(17) 3.168 + VMX_DBG_FAULT(17) 3.169 VMX_FAULT(17) 3.170 3.171 .org vmx_ia64_ivt+0x4800 3.172 ///////////////////////////////////////////////////////////////////////////////////////// 3.173 // 0x4800 Entry 18 (size 64 bundles) Reserved 3.174 - VMX_DBG_FAULT(18) 3.175 + VMX_DBG_FAULT(18) 3.176 VMX_FAULT(18) 3.177 3.178 .org vmx_ia64_ivt+0x4c00 3.179 ///////////////////////////////////////////////////////////////////////////////////////// 3.180 // 0x4c00 Entry 19 (size 64 bundles) Reserved 3.181 - VMX_DBG_FAULT(19) 3.182 + VMX_DBG_FAULT(19) 3.183 VMX_FAULT(19) 3.184 3.185 .org vmx_ia64_ivt+0x5000 3.186 ///////////////////////////////////////////////////////////////////////////////////////// 3.187 // 0x5000 Entry 20 (size 16 bundles) Page Not Present 3.188 ENTRY(vmx_page_not_present) 3.189 + VMX_DBG_FAULT(20) 3.190 VMX_REFLECT(20) 3.191 END(vmx_page_not_present) 3.192 3.193 @@ -577,6 +607,7 @@ END(vmx_page_not_present) 3.194 ///////////////////////////////////////////////////////////////////////////////////////// 3.195 // 0x5100 Entry 21 (size 16 bundles) Key Permission vector 3.196 ENTRY(vmx_key_permission) 3.197 + VMX_DBG_FAULT(21) 3.198 VMX_REFLECT(21) 3.199 END(vmx_key_permission) 3.200 3.201 @@ -584,6 +615,7 @@ END(vmx_key_permission) 3.202 ///////////////////////////////////////////////////////////////////////////////////////// 3.203 // 0x5200 Entry 22 (size 16 bundles) Instruction Access Rights (26) 3.204 ENTRY(vmx_iaccess_rights) 3.205 + VMX_DBG_FAULT(22) 3.206 VMX_REFLECT(22) 3.207 END(vmx_iaccess_rights) 3.208 3.209 @@ -591,6 +623,7 @@ END(vmx_iaccess_rights) 3.210 ///////////////////////////////////////////////////////////////////////////////////////// 3.211 // 0x5300 Entry 23 (size 16 bundles) Data Access Rights (14,53) 3.212 ENTRY(vmx_daccess_rights) 3.213 + VMX_DBG_FAULT(23) 3.214 VMX_REFLECT(23) 3.215 END(vmx_daccess_rights) 3.216 3.217 @@ -598,6 +631,7 @@ END(vmx_daccess_rights) 3.218 ///////////////////////////////////////////////////////////////////////////////////////// 3.219 // 0x5400 Entry 24 (size 16 bundles) General Exception (5,32,34,36,38,39) 3.220 ENTRY(vmx_general_exception) 3.221 + VMX_DBG_FAULT(24) 3.222 VMX_FAULT(24) 3.223 // VMX_REFLECT(24) 3.224 END(vmx_general_exception) 3.225 @@ -606,6 +640,7 @@ END(vmx_general_exception) 3.226 ///////////////////////////////////////////////////////////////////////////////////////// 3.227 // 0x5500 Entry 25 (size 16 bundles) Disabled FP-Register (35) 3.228 ENTRY(vmx_disabled_fp_reg) 3.229 + VMX_DBG_FAULT(25) 3.230 VMX_REFLECT(25) 3.231 END(vmx_disabled_fp_reg) 3.232 3.233 @@ -613,6 +648,7 @@ END(vmx_disabled_fp_reg) 3.234 ///////////////////////////////////////////////////////////////////////////////////////// 3.235 // 0x5600 Entry 26 (size 16 bundles) Nat Consumption (11,23,37,50) 3.236 ENTRY(vmx_nat_consumption) 3.237 + VMX_DBG_FAULT(26) 3.238 VMX_REFLECT(26) 3.239 END(vmx_nat_consumption) 3.240 3.241 @@ -620,20 +656,21 @@ END(vmx_nat_consumption) 3.242 ///////////////////////////////////////////////////////////////////////////////////////// 3.243 // 0x5700 Entry 27 (size 16 bundles) Speculation (40) 3.244 ENTRY(vmx_speculation_vector) 3.245 + VMX_DBG_FAULT(27) 3.246 VMX_REFLECT(27) 3.247 END(vmx_speculation_vector) 3.248 3.249 .org vmx_ia64_ivt+0x5800 3.250 ///////////////////////////////////////////////////////////////////////////////////////// 3.251 // 0x5800 Entry 28 (size 16 bundles) Reserved 3.252 - VMX_DBG_FAULT(28) 3.253 + VMX_DBG_FAULT(28) 3.254 VMX_FAULT(28) 3.255 3.256 .org vmx_ia64_ivt+0x5900 3.257 ///////////////////////////////////////////////////////////////////////////////////////// 3.258 // 0x5900 Entry 29 (size 16 bundles) Debug (16,28,56) 3.259 ENTRY(vmx_debug_vector) 3.260 - VMX_DBG_FAULT(29) 3.261 + VMX_DBG_FAULT(29) 3.262 VMX_FAULT(29) 3.263 END(vmx_debug_vector) 3.264 3.265 @@ -641,6 +678,7 @@ END(vmx_debug_vector) 3.266 ///////////////////////////////////////////////////////////////////////////////////////// 3.267 // 0x5a00 Entry 30 (size 16 bundles) Unaligned Reference (57) 3.268 ENTRY(vmx_unaligned_access) 3.269 + VMX_DBG_FAULT(30) 3.270 VMX_REFLECT(30) 3.271 END(vmx_unaligned_access) 3.272 3.273 @@ -648,6 +686,7 @@ END(vmx_unaligned_access) 3.274 ///////////////////////////////////////////////////////////////////////////////////////// 3.275 // 0x5b00 Entry 31 (size 16 bundles) Unsupported Data Reference (57) 3.276 ENTRY(vmx_unsupported_data_reference) 3.277 + VMX_DBG_FAULT(31) 3.278 VMX_REFLECT(31) 3.279 END(vmx_unsupported_data_reference) 3.280 3.281 @@ -655,6 +694,7 @@ END(vmx_unsupported_data_reference) 3.282 ///////////////////////////////////////////////////////////////////////////////////////// 3.283 // 0x5c00 Entry 32 (size 16 bundles) Floating-Point Fault (64) 3.284 ENTRY(vmx_floating_point_fault) 3.285 + VMX_DBG_FAULT(32) 3.286 VMX_REFLECT(32) 3.287 END(vmx_floating_point_fault) 3.288 3.289 @@ -662,6 +702,7 @@ END(vmx_floating_point_fault) 3.290 ///////////////////////////////////////////////////////////////////////////////////////// 3.291 // 0x5d00 Entry 33 (size 16 bundles) Floating Point Trap (66) 3.292 ENTRY(vmx_floating_point_trap) 3.293 + VMX_DBG_FAULT(33) 3.294 VMX_REFLECT(33) 3.295 END(vmx_floating_point_trap) 3.296 3.297 @@ -669,6 +710,7 @@ END(vmx_floating_point_trap) 3.298 ///////////////////////////////////////////////////////////////////////////////////////// 3.299 // 0x5e00 Entry 34 (size 16 bundles) Lower Privilege Transfer Trap (66) 3.300 ENTRY(vmx_lower_privilege_trap) 3.301 + VMX_DBG_FAULT(34) 3.302 VMX_REFLECT(34) 3.303 END(vmx_lower_privilege_trap) 3.304 3.305 @@ -676,6 +718,7 @@ END(vmx_lower_privilege_trap) 3.306 ///////////////////////////////////////////////////////////////////////////////////////// 3.307 // 0x5f00 Entry 35 (size 16 bundles) Taken Branch Trap (68) 3.308 ENTRY(vmx_taken_branch_trap) 3.309 + VMX_DBG_FAULT(35) 3.310 VMX_REFLECT(35) 3.311 END(vmx_taken_branch_trap) 3.312 3.313 @@ -683,6 +726,7 @@ END(vmx_taken_branch_trap) 3.314 ///////////////////////////////////////////////////////////////////////////////////////// 3.315 // 0x6000 Entry 36 (size 16 bundles) Single Step Trap (69) 3.316 ENTRY(vmx_single_step_trap) 3.317 + VMX_DBG_FAULT(36) 3.318 VMX_REFLECT(36) 3.319 END(vmx_single_step_trap) 3.320 3.321 @@ -690,6 +734,7 @@ END(vmx_single_step_trap) 3.322 ///////////////////////////////////////////////////////////////////////////////////////// 3.323 // 0x6100 Entry 37 (size 16 bundles) Virtualization Fault 3.324 ENTRY(vmx_virtualization_fault) 3.325 + VMX_DBG_FAULT(37) 3.326 mov r31=pr 3.327 mov r19=37 3.328 adds r16 = IA64_VCPU_CAUSE_OFFSET,r21
4.1 --- a/xen/include/asm-ia64/vmx_vpd.h Wed Dec 21 09:31:05 2005 -0600 4.2 +++ b/xen/include/asm-ia64/vmx_vpd.h Wed Dec 21 09:33:45 2005 -0600 4.3 @@ -63,8 +63,16 @@ typedef struct { 4.4 unsigned long rsv6[46]; 4.5 } cr_t; 4.6 4.7 +#ifdef VTI_DEBUG 4.8 +struct ivt_debug{ 4.9 + unsigned long iip; 4.10 + unsigned long ipsr; 4.11 + unsigned long ifa; 4.12 + unsigned long vector; 4.13 +}; 4.14 +#define IVT_DEBUG_MAX 128 4.15 +#endif 4.16 struct arch_vmx_struct { 4.17 -// struct virutal_platform_def vmx_platform; 4.18 // vpd_t *vpd; 4.19 vtime_t vtm; 4.20 struct vlapic vlapic; 4.21 @@ -85,6 +93,10 @@ struct arch_vmx_struct { 4.22 // unsigned long rfi_ifs; 4.23 // unsigned long in_service[4]; // vLsapic inservice IRQ bits 4.24 unsigned long flags; 4.25 +#ifdef VTI_DEBUG 4.26 + unsigned long ivt_current; 4.27 + struct ivt_debug ivt_debug[IVT_DEBUG_MAX]; 4.28 +#endif 4.29 }; 4.30 4.31 #define vmx_schedule_tail(next) \