ia64/xen-unstable

changeset 7336:f1dc942257e5

Add fault debug feature (assuming guest doesn't use kr2), by Tristan Gingold
author djm@kirby.fc.hp.com
date Fri Oct 14 12:33:37 2005 -0600 (2005-10-14)
parents 70de2b71f439
children d61142fc7480
files xen/arch/ia64/xen/ivt.S
line diff
     1.1 --- a/xen/arch/ia64/xen/ivt.S	Fri Oct 14 11:56:18 2005 -0600
     1.2 +++ b/xen/arch/ia64/xen/ivt.S	Fri Oct 14 12:33:37 2005 -0600
     1.3 @@ -484,6 +484,7 @@ END(alt_dtlb_miss)
     1.4  /////////////////////////////////////////////////////////////////////////////////////////
     1.5  // 0x1400 Entry 5 (size 64 bundles) Data nested TLB (6,45)
     1.6  ENTRY(nested_dtlb_miss)
     1.7 +	DBG_FAULT(5)
     1.8  	/*
     1.9  	 * In the absence of kernel bugs, we get here when the virtually mapped linear
    1.10  	 * page table is accessed non-speculatively (e.g., in the Dirty-bit, Instruction
    1.11 @@ -552,10 +553,10 @@ END(nested_dtlb_miss)
    1.12  /////////////////////////////////////////////////////////////////////////////////////////
    1.13  // 0x1800 Entry 6 (size 64 bundles) Instruction Key Miss (24)
    1.14  ENTRY(ikey_miss)
    1.15 +	DBG_FAULT(6)
    1.16  #ifdef XEN
    1.17  	REFLECT(6)
    1.18  #endif
    1.19 -	DBG_FAULT(6)
    1.20  	FAULT(6)
    1.21  END(ikey_miss)
    1.22  
    1.23 @@ -597,10 +598,10 @@ END(page_fault)
    1.24  /////////////////////////////////////////////////////////////////////////////////////////
    1.25  // 0x1c00 Entry 7 (size 64 bundles) Data Key Miss (12,51)
    1.26  ENTRY(dkey_miss)
    1.27 +	DBG_FAULT(7)
    1.28  #ifdef XEN
    1.29  	REFLECT(7)
    1.30  #endif
    1.31 -	DBG_FAULT(7)
    1.32  	FAULT(7)
    1.33  END(dkey_miss)
    1.34  
    1.35 @@ -608,10 +609,10 @@ END(dkey_miss)
    1.36  /////////////////////////////////////////////////////////////////////////////////////////
    1.37  // 0x2000 Entry 8 (size 64 bundles) Dirty-bit (54)
    1.38  ENTRY(dirty_bit)
    1.39 +	DBG_FAULT(8)
    1.40  #ifdef XEN
    1.41  	REFLECT(8)
    1.42  #endif
    1.43 -	DBG_FAULT(8)
    1.44  	/*
    1.45  	 * What we do here is to simply turn on the dirty bit in the PTE.  We need to
    1.46  	 * update both the page-table and the TLB entry.  To efficiently access the PTE,
    1.47 @@ -673,6 +674,7 @@ END(dirty_bit)
    1.48  /////////////////////////////////////////////////////////////////////////////////////////
    1.49  // 0x2400 Entry 9 (size 64 bundles) Instruction Access-bit (27)
    1.50  ENTRY(iaccess_bit)
    1.51 +	DBG_FAULT(9)
    1.52  #ifdef XEN
    1.53  	mov r31=pr;
    1.54  	mov r16=cr.isr
    1.55 @@ -681,7 +683,6 @@ ENTRY(iaccess_bit)
    1.56  	movl r20=0x2400
    1.57  	br.sptk.many fast_access_reflect;;
    1.58  #endif
    1.59 -	DBG_FAULT(9)
    1.60  	// Like Entry 8, except for instruction access
    1.61  	mov r16=cr.ifa				// get the address that caused the fault
    1.62  	movl r30=1f				// load continuation point in case of nested fault
    1.63 @@ -746,6 +747,7 @@ END(iaccess_bit)
    1.64  /////////////////////////////////////////////////////////////////////////////////////////
    1.65  // 0x2800 Entry 10 (size 64 bundles) Data Access-bit (15,55)
    1.66  ENTRY(daccess_bit)
    1.67 +	DBG_FAULT(10)
    1.68  #ifdef XEN
    1.69  	mov r31=pr;
    1.70  	mov r16=cr.isr
    1.71 @@ -754,7 +756,6 @@ ENTRY(daccess_bit)
    1.72  	movl r20=0x2800
    1.73  	br.sptk.many fast_access_reflect;;
    1.74  #endif
    1.75 -	DBG_FAULT(10)
    1.76  	// Like Entry 8, except for data access
    1.77  	mov r16=cr.ifa				// get the address that caused the fault
    1.78  	movl r30=1f				// load continuation point in case of nested fault
    1.79 @@ -971,8 +972,10 @@ slow_interrupt:
    1.80  	mov out0=cr.ivr		// pass cr.ivr as first arg
    1.81  #endif
    1.82  	add out1=16,sp		// pass pointer to pt_regs as second arg
    1.83 +#ifndef XEN
    1.84  	;;
    1.85  	srlz.d			// make sure we see the effect of cr.ivr
    1.86 +#endif
    1.87  	movl r14=ia64_leave_kernel
    1.88  	;;
    1.89  	mov rp=r14
    1.90 @@ -1363,10 +1366,10 @@ END(dispatch_to_fault_handler)
    1.91  /////////////////////////////////////////////////////////////////////////////////////////
    1.92  // 0x5000 Entry 20 (size 16 bundles) Page Not Present (10,22,49)
    1.93  ENTRY(page_not_present)
    1.94 +	DBG_FAULT(20)
    1.95  #ifdef XEN
    1.96  	REFLECT(20)
    1.97  #endif
    1.98 -	DBG_FAULT(20)
    1.99  	mov r16=cr.ifa
   1.100  	rsm psr.dt
   1.101  	/*
   1.102 @@ -1386,10 +1389,10 @@ END(page_not_present)
   1.103  /////////////////////////////////////////////////////////////////////////////////////////
   1.104  // 0x5100 Entry 21 (size 16 bundles) Key Permission (13,25,52)
   1.105  ENTRY(key_permission)
   1.106 +	DBG_FAULT(21)
   1.107  #ifdef XEN
   1.108  	REFLECT(21)
   1.109  #endif
   1.110 -	DBG_FAULT(21)
   1.111  	mov r16=cr.ifa
   1.112  	rsm psr.dt
   1.113  	mov r31=pr
   1.114 @@ -1402,10 +1405,10 @@ END(key_permission)
   1.115  /////////////////////////////////////////////////////////////////////////////////////////
   1.116  // 0x5200 Entry 22 (size 16 bundles) Instruction Access Rights (26)
   1.117  ENTRY(iaccess_rights)
   1.118 +	DBG_FAULT(22)
   1.119  #ifdef XEN
   1.120  	REFLECT(22)
   1.121  #endif
   1.122 -	DBG_FAULT(22)
   1.123  	mov r16=cr.ifa
   1.124  	rsm psr.dt
   1.125  	mov r31=pr
   1.126 @@ -1418,6 +1421,7 @@ END(iaccess_rights)
   1.127  /////////////////////////////////////////////////////////////////////////////////////////
   1.128  // 0x5300 Entry 23 (size 16 bundles) Data Access Rights (14,53)
   1.129  ENTRY(daccess_rights)
   1.130 +	DBG_FAULT(23)
   1.131  #ifdef XEN
   1.132  	mov r31=pr;
   1.133  	mov r16=cr.isr
   1.134 @@ -1426,7 +1430,6 @@ ENTRY(daccess_rights)
   1.135  	movl r20=0x5300
   1.136  	br.sptk.many fast_access_reflect;;
   1.137  #endif
   1.138 -	DBG_FAULT(23)
   1.139  	mov r16=cr.ifa
   1.140  	rsm psr.dt
   1.141  	mov r31=pr
   1.142 @@ -1459,6 +1462,7 @@ END(general_exception)
   1.143  /////////////////////////////////////////////////////////////////////////////////////////
   1.144  // 0x5500 Entry 25 (size 16 bundles) Disabled FP-Register (35)
   1.145  ENTRY(disabled_fp_reg)
   1.146 +	DBG_FAULT(25)
   1.147  #ifdef XEN
   1.148  #if 0
   1.149  	mov r20=pr
   1.150 @@ -1483,7 +1487,6 @@ ENTRY(disabled_fp_reg)
   1.151  //	br.sptk.many floating_panic
   1.152  	;;
   1.153  #endif
   1.154 -	DBG_FAULT(25)
   1.155  	rsm psr.dfh		// ensure we can access fph
   1.156  	;;
   1.157  	srlz.d
   1.158 @@ -1496,10 +1499,10 @@ END(disabled_fp_reg)
   1.159  /////////////////////////////////////////////////////////////////////////////////////////
   1.160  // 0x5600 Entry 26 (size 16 bundles) Nat Consumption (11,23,37,50)
   1.161  ENTRY(nat_consumption)
   1.162 +	DBG_FAULT(26)
   1.163  #ifdef XEN
   1.164  	REFLECT(26)
   1.165  #endif
   1.166 -	DBG_FAULT(26)
   1.167  	FAULT(26)
   1.168  END(nat_consumption)
   1.169  
   1.170 @@ -1507,11 +1510,11 @@ END(nat_consumption)
   1.171  /////////////////////////////////////////////////////////////////////////////////////////
   1.172  // 0x5700 Entry 27 (size 16 bundles) Speculation (40)
   1.173  ENTRY(speculation_vector)
   1.174 +	DBG_FAULT(27)
   1.175  #ifdef XEN
   1.176  	// this probably need not reflect...
   1.177  	REFLECT(27)
   1.178  #endif
   1.179 -	DBG_FAULT(27)
   1.180  	/*
   1.181  	 * A [f]chk.[as] instruction needs to take the branch to the recovery code but
   1.182  	 * this part of the architecture is not implemented in hardware on some CPUs, such
   1.183 @@ -1554,10 +1557,10 @@ END(speculation_vector)
   1.184  /////////////////////////////////////////////////////////////////////////////////////////
   1.185  // 0x5900 Entry 29 (size 16 bundles) Debug (16,28,56)
   1.186  ENTRY(debug_vector)
   1.187 +	DBG_FAULT(29)
   1.188  #ifdef XEN
   1.189  	REFLECT(29)
   1.190  #endif
   1.191 -	DBG_FAULT(29)
   1.192  	FAULT(29)
   1.193  END(debug_vector)
   1.194  
   1.195 @@ -1565,10 +1568,10 @@ END(debug_vector)
   1.196  /////////////////////////////////////////////////////////////////////////////////////////
   1.197  // 0x5a00 Entry 30 (size 16 bundles) Unaligned Reference (57)
   1.198  ENTRY(unaligned_access)
   1.199 +	DBG_FAULT(30)
   1.200  #ifdef XEN
   1.201  	REFLECT(30)
   1.202  #endif
   1.203 -	DBG_FAULT(30)
   1.204  	mov r16=cr.ipsr
   1.205  	mov r31=pr		// prepare to save predicates
   1.206  	;;
   1.207 @@ -1579,10 +1582,10 @@ END(unaligned_access)
   1.208  /////////////////////////////////////////////////////////////////////////////////////////
   1.209  // 0x5b00 Entry 31 (size 16 bundles) Unsupported Data Reference (57)
   1.210  ENTRY(unsupported_data_reference)
   1.211 +	DBG_FAULT(31)
   1.212  #ifdef XEN
   1.213  	REFLECT(31)
   1.214  #endif
   1.215 -	DBG_FAULT(31)
   1.216  	FAULT(31)
   1.217  END(unsupported_data_reference)
   1.218  
   1.219 @@ -1590,10 +1593,10 @@ END(unsupported_data_reference)
   1.220  /////////////////////////////////////////////////////////////////////////////////////////
   1.221  // 0x5c00 Entry 32 (size 16 bundles) Floating-Point Fault (64)
   1.222  ENTRY(floating_point_fault)
   1.223 +	DBG_FAULT(32)
   1.224  #ifdef XEN
   1.225  	REFLECT(32)
   1.226  #endif
   1.227 -	DBG_FAULT(32)
   1.228  	FAULT(32)
   1.229  END(floating_point_fault)
   1.230  
   1.231 @@ -1601,10 +1604,10 @@ END(floating_point_fault)
   1.232  /////////////////////////////////////////////////////////////////////////////////////////
   1.233  // 0x5d00 Entry 33 (size 16 bundles) Floating Point Trap (66)
   1.234  ENTRY(floating_point_trap)
   1.235 +	DBG_FAULT(33)
   1.236  #ifdef XEN
   1.237  	REFLECT(33)
   1.238  #endif
   1.239 -	DBG_FAULT(33)
   1.240  	FAULT(33)
   1.241  END(floating_point_trap)
   1.242  
   1.243 @@ -1612,10 +1615,10 @@ END(floating_point_trap)
   1.244  /////////////////////////////////////////////////////////////////////////////////////////
   1.245  // 0x5e00 Entry 34 (size 16 bundles) Lower Privilege Transfer Trap (66)
   1.246  ENTRY(lower_privilege_trap)
   1.247 +	DBG_FAULT(34)
   1.248  #ifdef XEN
   1.249  	REFLECT(34)
   1.250  #endif
   1.251 -	DBG_FAULT(34)
   1.252  	FAULT(34)
   1.253  END(lower_privilege_trap)
   1.254  
   1.255 @@ -1623,10 +1626,10 @@ END(lower_privilege_trap)
   1.256  /////////////////////////////////////////////////////////////////////////////////////////
   1.257  // 0x5f00 Entry 35 (size 16 bundles) Taken Branch Trap (68)
   1.258  ENTRY(taken_branch_trap)
   1.259 +	DBG_FAULT(35)
   1.260  #ifdef XEN
   1.261  	REFLECT(35)
   1.262  #endif
   1.263 -	DBG_FAULT(35)
   1.264  	FAULT(35)
   1.265  END(taken_branch_trap)
   1.266  
   1.267 @@ -1634,10 +1637,10 @@ END(taken_branch_trap)
   1.268  /////////////////////////////////////////////////////////////////////////////////////////
   1.269  // 0x6000 Entry 36 (size 16 bundles) Single Step Trap (69)
   1.270  ENTRY(single_step_trap)
   1.271 +	DBG_FAULT(36)
   1.272  #ifdef XEN
   1.273  	REFLECT(36)
   1.274  #endif
   1.275 -	DBG_FAULT(36)
   1.276  	FAULT(36)
   1.277  END(single_step_trap)
   1.278  
   1.279 @@ -1693,10 +1696,10 @@ END(single_step_trap)
   1.280  /////////////////////////////////////////////////////////////////////////////////////////
   1.281  // 0x6900 Entry 45 (size 16 bundles) IA-32 Exeception (17,18,29,41,42,43,44,58,60,61,62,72,73,75,76,77)
   1.282  ENTRY(ia32_exception)
   1.283 +	DBG_FAULT(45)
   1.284  #ifdef XEN
   1.285  	REFLECT(45)
   1.286  #endif
   1.287 -	DBG_FAULT(45)
   1.288  	FAULT(45)
   1.289  END(ia32_exception)
   1.290  
   1.291 @@ -1704,10 +1707,10 @@ END(ia32_exception)
   1.292  /////////////////////////////////////////////////////////////////////////////////////////
   1.293  // 0x6a00 Entry 46 (size 16 bundles) IA-32 Intercept  (30,31,59,70,71)
   1.294  ENTRY(ia32_intercept)
   1.295 +	DBG_FAULT(46)
   1.296  #ifdef XEN
   1.297  	REFLECT(46)
   1.298  #endif
   1.299 -	DBG_FAULT(46)
   1.300  #ifdef	CONFIG_IA32_SUPPORT
   1.301  	mov r31=pr
   1.302  	mov r16=cr.isr
   1.303 @@ -1737,10 +1740,10 @@ END(ia32_intercept)
   1.304  /////////////////////////////////////////////////////////////////////////////////////////
   1.305  // 0x6b00 Entry 47 (size 16 bundles) IA-32 Interrupt  (74)
   1.306  ENTRY(ia32_interrupt)
   1.307 +	DBG_FAULT(47)
   1.308  #ifdef XEN
   1.309  	REFLECT(47)
   1.310  #endif
   1.311 -	DBG_FAULT(47)
   1.312  #ifdef CONFIG_IA32_SUPPORT
   1.313  	mov r31=pr
   1.314  	br.sptk.many dispatch_to_ia32_handler