@@ -139,6 +139,9 @@ static void orc_dump(ulong);
139
139
140
140
struct machine_specific x86_64_machine_specific = { 0 };
141
141
142
+ static const char * exception_functions_orig [];
143
+ static const char * exception_functions_5_8 [];
144
+
142
145
/*
143
146
* Do all necessary machine-specific setup here. This is called several
144
147
* times during initialization.
@@ -735,6 +738,12 @@ x86_64_init(int when)
735
738
STRUCT_SIZE_INIT (percpu_data , "percpu_data" );
736
739
737
740
GART_init ();
741
+
742
+ if (kernel_symbol_exists ("asm_exc_divide_error" ))
743
+ machdep -> machspec -> exception_functions = (char * * )exception_functions_5_8 ;
744
+ else
745
+ machdep -> machspec -> exception_functions = (char * * )exception_functions_orig ;
746
+
738
747
break ;
739
748
740
749
case POST_VM :
@@ -1104,6 +1113,12 @@ x86_64_dump_machdep_table(ulong arg)
1104
1113
fprintf (fp , "%016lx\n" , (ulong )ms -> cpu_entry_area_end );
1105
1114
else
1106
1115
fprintf (fp , "(unused)\n" );
1116
+
1117
+ fprintf (fp , " excpetion_functions: " );
1118
+ if (ms -> exception_functions == (char * * )exception_functions_5_8 )
1119
+ fprintf (fp , "excpetion_functions_5_8\n" );
1120
+ else
1121
+ fprintf (fp , "excpetion_functions_orig\n" );
1107
1122
}
1108
1123
1109
1124
/*
@@ -3086,7 +3101,7 @@ text_lock_function(char *name, struct bt_info *bt, ulong locktext)
3086
3101
* zeroentry xen_debug do_debug
3087
3102
* zeroentry xen_int3 do_int3
3088
3103
*/
3089
- static const char * exception_functions [] = {
3104
+ static const char * exception_functions_orig [] = {
3090
3105
"invalid_TSS" ,
3091
3106
"segment_not_present" ,
3092
3107
"alignment_check" ,
@@ -3109,6 +3124,28 @@ static const char *exception_functions[] = {
3109
3124
NULL ,
3110
3125
};
3111
3126
3127
+ static const char * exception_functions_5_8 [] = {
3128
+ "asm_exc_invalid_tss" ,
3129
+ "asm_exc_segment_not_present" ,
3130
+ "asm_exc_alignment_check" ,
3131
+ "asm_exc_general_protection" ,
3132
+ "asm_exc_page_fault" ,
3133
+ "asm_exc_divide_error" ,
3134
+ "asm_exc_overflow" ,
3135
+ "asm_exc_bounds" ,
3136
+ "asm_exc_invalid_op" ,
3137
+ "asm_exc_device_not_available" ,
3138
+ "asm_exc_coproc_segment_overrun" ,
3139
+ "asm_exc_spurious_interrupt_bug" ,
3140
+ "asm_exc_coprocessor_error" ,
3141
+ "asm_exc_simd_coprocessor_error" ,
3142
+ "asm_exc_debug" ,
3143
+ "xen_asm_exc_stack_segment" ,
3144
+ "xen_asm_exc_xen_hypervisor_callback" ,
3145
+ "xen_asm_exc_int3" ,
3146
+ NULL ,
3147
+ };
3148
+
3112
3149
/*
3113
3150
* print one entry of a stack trace
3114
3151
*/
@@ -3185,8 +3222,8 @@ x86_64_print_stack_entry(struct bt_info *bt, FILE *ofp, int level,
3185
3222
if ((THIS_KERNEL_VERSION >= LINUX (2 ,6 ,29 )) &&
3186
3223
(eframe_check == -1 ) && offset &&
3187
3224
!(bt -> flags & (BT_EXCEPTION_FRAME |BT_START |BT_SCHEDULE ))) {
3188
- for (i = 0 ; exception_functions [i ]; i ++ ) {
3189
- if (STREQ (name , exception_functions [i ])) {
3225
+ for (i = 0 ; machdep -> machspec -> exception_functions [i ]; i ++ ) {
3226
+ if (STREQ (name , machdep -> machspec -> exception_functions [i ])) {
3190
3227
eframe_check = 8 ;
3191
3228
break ;
3192
3229
}
0 commit comments