ia64/xen-unstable

changeset 9619:8c27368b12ad

Rename and clean up 'error_code' path in entry.S.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Apr 06 17:32:47 2006 +0100 (2006-04-06)
parents db44b783fe09
children 9e13e1d4b33f c5e80cb40c46
files xen/arch/x86/x86_32/entry.S xen/arch/x86/x86_64/entry.S
line diff
     1.1 --- a/xen/arch/x86/x86_32/entry.S	Thu Apr 06 17:25:24 2006 +0100
     1.2 +++ b/xen/arch/x86/x86_32/entry.S	Thu Apr 06 17:32:47 2006 +0100
     1.3 @@ -119,7 +119,7 @@ FIX1:   SET_XEN_SEGMENTS(a)
     1.4          movl  $DBLFLT1,%eax
     1.5          pushl %eax                     # EIP
     1.6          pushl %esi                     # error_code/entry_vector
     1.7 -        jmp   error_code
     1.8 +        jmp   handle_exception
     1.9  DBLFLT1:GET_CURRENT(%ebx)
    1.10          jmp   test_all_events
    1.11  failsafe_callback:
    1.12 @@ -381,14 +381,6 @@ domain_crash_synchronous:
    1.13          jmp   __domain_crash_synchronous
    1.14  
    1.15          ALIGN
    1.16 -process_guest_exception_and_events:
    1.17 -        leal VCPU_trap_bounce(%ebx),%edx
    1.18 -        testb $TBF_EXCEPTION,TRAPBOUNCE_flags(%edx)
    1.19 -        jz   test_all_events
    1.20 -        call create_bounce_frame
    1.21 -        jmp  test_all_events
    1.22 -
    1.23 -        ALIGN
    1.24  ENTRY(ret_from_intr)
    1.25          GET_CURRENT(%ebx)
    1.26          movl  UREGS_eflags(%esp),%eax
    1.27 @@ -400,7 +392,7 @@ ENTRY(ret_from_intr)
    1.28  ENTRY(divide_error)
    1.29  	pushl $TRAP_divide_error<<16
    1.30  	ALIGN
    1.31 -error_code:
    1.32 +handle_exception:
    1.33          FIXUP_RING0_GUEST_STACK
    1.34          SAVE_ALL_NOSEGREGS(a)
    1.35          SET_XEN_SEGMENTS(a)
    1.36 @@ -419,7 +411,11 @@ error_code:
    1.37          movb  UREGS_cs(%esp),%al
    1.38          testl $(3|X86_EFLAGS_VM),%eax
    1.39  	jz    restore_all_xen
    1.40 -        jmp   process_guest_exception_and_events
    1.41 +        leal  VCPU_trap_bounce(%ebx),%edx
    1.42 +        testb $TBF_EXCEPTION,TRAPBOUNCE_flags(%edx)
    1.43 +        jz    test_all_events
    1.44 +        call  create_bounce_frame
    1.45 +        jmp   test_all_events
    1.46  
    1.47  exception_with_ints_disabled:
    1.48          movl  UREGS_eflags(%esp),%eax
    1.49 @@ -452,71 +448,71 @@ FATAL_exception_with_ints_disabled:
    1.50                                          
    1.51  ENTRY(coprocessor_error)
    1.52  	pushl $TRAP_copro_error<<16
    1.53 -	jmp error_code
    1.54 +	jmp   handle_exception
    1.55  
    1.56  ENTRY(simd_coprocessor_error)
    1.57  	pushl $TRAP_simd_error<<16
    1.58 -	jmp error_code
    1.59 +	jmp   handle_exception
    1.60  
    1.61  ENTRY(device_not_available)
    1.62  	pushl $TRAP_no_device<<16
    1.63 -        jmp   error_code
    1.64 +        jmp   handle_exception
    1.65  
    1.66  ENTRY(debug)
    1.67  	pushl $TRAP_debug<<16
    1.68 -	jmp error_code
    1.69 +	jmp   handle_exception
    1.70  
    1.71  ENTRY(int3)
    1.72  	pushl $TRAP_int3<<16
    1.73 -	jmp error_code
    1.74 +	jmp   handle_exception
    1.75  
    1.76  ENTRY(overflow)
    1.77  	pushl $TRAP_overflow<<16
    1.78 -	jmp error_code
    1.79 +	jmp   handle_exception
    1.80  
    1.81  ENTRY(bounds)
    1.82  	pushl $TRAP_bounds<<16
    1.83 -	jmp error_code
    1.84 +	jmp   handle_exception
    1.85  
    1.86  ENTRY(invalid_op)
    1.87  	pushl $TRAP_invalid_op<<16
    1.88 -	jmp error_code
    1.89 +	jmp   handle_exception
    1.90  
    1.91  ENTRY(coprocessor_segment_overrun)
    1.92  	pushl $TRAP_copro_seg<<16
    1.93 -	jmp error_code
    1.94 +	jmp   handle_exception
    1.95  
    1.96  ENTRY(invalid_TSS)
    1.97 -        movw $TRAP_invalid_tss,2(%esp)
    1.98 -	jmp error_code
    1.99 +        movw  $TRAP_invalid_tss,2(%esp)
   1.100 +	jmp   handle_exception
   1.101  
   1.102  ENTRY(segment_not_present)
   1.103 -        movw $TRAP_no_segment,2(%esp)
   1.104 -	jmp error_code
   1.105 +        movw  $TRAP_no_segment,2(%esp)
   1.106 +	jmp   handle_exception
   1.107  
   1.108  ENTRY(stack_segment)
   1.109 -        movw $TRAP_stack_error,2(%esp)
   1.110 -	jmp error_code
   1.111 +        movw  $TRAP_stack_error,2(%esp)
   1.112 +	jmp   handle_exception
   1.113  
   1.114  ENTRY(general_protection)
   1.115 -        movw $TRAP_gp_fault,2(%esp)
   1.116 -	jmp error_code
   1.117 +        movw  $TRAP_gp_fault,2(%esp)
   1.118 +	jmp   handle_exception
   1.119  
   1.120  ENTRY(alignment_check)
   1.121 -        movw $TRAP_alignment_check,2(%esp)
   1.122 -	jmp error_code
   1.123 +        movw  $TRAP_alignment_check,2(%esp)
   1.124 +	jmp   handle_exception
   1.125  
   1.126  ENTRY(page_fault)
   1.127 -        movw $TRAP_page_fault,2(%esp)
   1.128 -	jmp error_code
   1.129 +        movw  $TRAP_page_fault,2(%esp)
   1.130 +	jmp   handle_exception
   1.131  
   1.132  ENTRY(machine_check)
   1.133          pushl $TRAP_machine_check<<16
   1.134 -	jmp error_code
   1.135 +	jmp   handle_exception
   1.136  
   1.137  ENTRY(spurious_interrupt_bug)
   1.138          pushl $TRAP_spurious_int<<16
   1.139 -	jmp error_code
   1.140 +	jmp   handle_exception
   1.141  
   1.142  ENTRY(nmi)
   1.143  #ifdef CONFIG_X86_SUPERVISOR_MODE_KERNEL
     2.1 --- a/xen/arch/x86/x86_64/entry.S	Thu Apr 06 17:25:24 2006 +0100
     2.2 +++ b/xen/arch/x86/x86_64/entry.S	Thu Apr 06 17:32:47 2006 +0100
     2.3 @@ -68,7 +68,7 @@ FIX1:   popq  -15*8-8(%rsp)            #
     2.4          leaq  DBLFLT1(%rip),%rax
     2.5          pushq %rax                     # RIP
     2.6          pushq %rsi                     # error_code/entry_vector
     2.7 -        jmp   error_code
     2.8 +        jmp   handle_exception
     2.9  DBLFLT1:GET_CURRENT(%rbx)
    2.10          jmp   test_all_events
    2.11  failsafe_callback:
    2.12 @@ -320,15 +320,6 @@ domain_crash_synchronous:
    2.13          jmp  __domain_crash_synchronous
    2.14  
    2.15          ALIGN
    2.16 -/* %rbx: struct vcpu */
    2.17 -process_guest_exception_and_events:
    2.18 -        leaq  VCPU_trap_bounce(%rbx),%rdx
    2.19 -        testb $TBF_EXCEPTION,TRAPBOUNCE_flags(%rdx)
    2.20 -        jz    test_all_events
    2.21 -        call  create_bounce_frame
    2.22 -        jmp   test_all_events
    2.23 -
    2.24 -        ALIGN
    2.25  /* No special register assumptions. */
    2.26  ENTRY(ret_from_intr)
    2.27          GET_CURRENT(%rbx)
    2.28 @@ -338,7 +329,7 @@ ENTRY(ret_from_intr)
    2.29  
    2.30          ALIGN
    2.31  /* No special register assumptions. */
    2.32 -error_code:
    2.33 +handle_exception:
    2.34          SAVE_ALL
    2.35          testb $X86_EFLAGS_IF>>8,UREGS_eflags+1(%rsp)
    2.36          jz    exception_with_ints_disabled
    2.37 @@ -351,7 +342,11 @@ error_code:
    2.38          callq *(%rdx,%rax,8)
    2.39          testb $3,UREGS_cs(%rsp)
    2.40          jz    restore_all_xen
    2.41 -        jmp   process_guest_exception_and_events
    2.42 +        leaq  VCPU_trap_bounce(%rbx),%rdx
    2.43 +        testb $TBF_EXCEPTION,TRAPBOUNCE_flags(%rdx)
    2.44 +        jz    test_all_events
    2.45 +        call  create_bounce_frame
    2.46 +        jmp   test_all_events
    2.47  
    2.48  /* No special register assumptions. */
    2.49  exception_with_ints_disabled:
    2.50 @@ -384,90 +379,90 @@ FATAL_exception_with_ints_disabled:
    2.51  ENTRY(divide_error)
    2.52          pushq $0
    2.53          movl  $TRAP_divide_error,4(%rsp)
    2.54 -        jmp   error_code
    2.55 +        jmp   handle_exception
    2.56  
    2.57  ENTRY(coprocessor_error)
    2.58          pushq $0
    2.59          movl  $TRAP_copro_error,4(%rsp)
    2.60 -	jmp   error_code
    2.61 +	jmp   handle_exception
    2.62  
    2.63  ENTRY(simd_coprocessor_error)
    2.64          pushq $0
    2.65          movl  $TRAP_simd_error,4(%rsp)
    2.66 -	jmp error_code
    2.67 +	jmp   handle_exception
    2.68  
    2.69  ENTRY(device_not_available)
    2.70          pushq $0
    2.71          movl  $TRAP_no_device,4(%rsp)
    2.72 -        jmp   error_code
    2.73 +        jmp   handle_exception
    2.74  
    2.75  ENTRY(debug)
    2.76          pushq $0
    2.77          movl  $TRAP_debug,4(%rsp)
    2.78 -	jmp   error_code
    2.79 +	jmp   handle_exception
    2.80  
    2.81  ENTRY(int3)
    2.82          pushq $0
    2.83  	movl  $TRAP_int3,4(%rsp)
    2.84 -	jmp   error_code
    2.85 +	jmp   handle_exception
    2.86  
    2.87  ENTRY(overflow)
    2.88          pushq $0
    2.89  	movl  $TRAP_overflow,4(%rsp)
    2.90 -	jmp   error_code
    2.91 +	jmp   handle_exception
    2.92  
    2.93  ENTRY(bounds)
    2.94          pushq $0
    2.95  	movl  $TRAP_bounds,4(%rsp)
    2.96 -	jmp   error_code
    2.97 +	jmp   handle_exception
    2.98  
    2.99  ENTRY(invalid_op)
   2.100          pushq $0
   2.101  	movl  $TRAP_invalid_op,4(%rsp)
   2.102 -	jmp   error_code
   2.103 +	jmp   handle_exception
   2.104  
   2.105  ENTRY(coprocessor_segment_overrun)
   2.106          pushq $0
   2.107  	movl  $TRAP_copro_seg,4(%rsp)
   2.108 -	jmp   error_code
   2.109 +	jmp   handle_exception
   2.110  
   2.111  ENTRY(invalid_TSS)
   2.112          movl  $TRAP_invalid_tss,4(%rsp)
   2.113 -	jmp   error_code
   2.114 +	jmp   handle_exception
   2.115  
   2.116  ENTRY(segment_not_present)
   2.117          movl  $TRAP_no_segment,4(%rsp)
   2.118 -	jmp   error_code
   2.119 +	jmp   handle_exception
   2.120  
   2.121  ENTRY(stack_segment)
   2.122          movl  $TRAP_stack_error,4(%rsp)
   2.123 -	jmp   error_code
   2.124 +	jmp   handle_exception
   2.125  
   2.126  ENTRY(general_protection)
   2.127          movl  $TRAP_gp_fault,4(%rsp)
   2.128 -	jmp   error_code
   2.129 +	jmp   handle_exception
   2.130  
   2.131  ENTRY(alignment_check)
   2.132          movl  $TRAP_alignment_check,4(%rsp)
   2.133 -	jmp   error_code
   2.134 +	jmp   handle_exception
   2.135  
   2.136  ENTRY(page_fault)
   2.137          movl  $TRAP_page_fault,4(%rsp)
   2.138 -	jmp   error_code
   2.139 +	jmp   handle_exception
   2.140  
   2.141  ENTRY(machine_check)
   2.142          pushq $0
   2.143          movl  $TRAP_machine_check,4(%rsp)
   2.144 -	jmp   error_code
   2.145 +	jmp   handle_exception
   2.146  
   2.147  ENTRY(spurious_interrupt_bug)
   2.148          pushq $0
   2.149          movl  $TRAP_spurious_int,4(%rsp)
   2.150 -	jmp   error_code
   2.151 +	jmp   handle_exception
   2.152  
   2.153  ENTRY(double_fault)
   2.154          movl  $TRAP_double_fault,4(%rsp)
   2.155 -        jmp   error_code
   2.156 +        jmp   handle_exception
   2.157  
   2.158  ENTRY(nmi)
   2.159          pushq $0