ia64/xen-unstable

changeset 9622:c5e80cb40c46

Merge.
author smh22@firebug.cl.cam.ac.uk
date Thu Apr 06 17:47:37 2006 +0100 (2006-04-06)
parents 71f938468929 8c27368b12ad
children 388c59fefaa6
files
line diff
     1.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypercall.h	Thu Apr 06 17:34:54 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypercall.h	Thu Apr 06 17:47:37 2006 +0100
     1.3 @@ -331,8 +331,7 @@ HYPERVISOR_nmi_op(
     1.4  
     1.5  static inline int
     1.6  HYPERVISOR_callback_op(
     1.7 -	int cmd,
     1.8 -	void *arg)
     1.9 +	int cmd, void *arg)
    1.10  {
    1.11  	return _hypercall2(int, callback_op, cmd, arg);
    1.12  }
     2.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h	Thu Apr 06 17:34:54 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h	Thu Apr 06 17:47:37 2006 +0100
     2.3 @@ -25,11 +25,11 @@ extern void nmi(void);
     2.4  static void __init machine_specific_arch_setup(void)
     2.5  {
     2.6  	struct xen_platform_parameters pp;
     2.7 -	callback_register_t event = {
     2.8 +	struct callback_register event = {
     2.9  		.type = CALLBACKTYPE_event,
    2.10  		.address = { __KERNEL_CS, (unsigned long)hypervisor_callback },
    2.11  	};
    2.12 -	callback_register_t failsafe = {
    2.13 +	struct callback_register failsafe = {
    2.14  		.type = CALLBACKTYPE_failsafe,
    2.15  		.address = { __KERNEL_CS, (unsigned long)failsafe_callback },
    2.16  	};
     3.1 --- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/setup_arch_post.h	Thu Apr 06 17:34:54 2006 +0100
     3.2 +++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/setup_arch_post.h	Thu Apr 06 17:47:37 2006 +0100
     3.3 @@ -14,15 +14,15 @@ extern void nmi(void);
     3.4  
     3.5  static void __init machine_specific_arch_setup(void)
     3.6  {
     3.7 -	callback_register_t event = {
     3.8 +	struct callback_register event = {
     3.9  		.type = CALLBACKTYPE_event,
    3.10  		.address = (unsigned long) hypervisor_callback,
    3.11  	};
    3.12 -	callback_register_t failsafe = {
    3.13 +	struct callback_register failsafe = {
    3.14  		.type = CALLBACKTYPE_failsafe,
    3.15  		.address = (unsigned long)failsafe_callback,
    3.16  	};
    3.17 -	callback_register_t syscall = {
    3.18 +	struct callback_register syscall = {
    3.19  		.type = CALLBACKTYPE_syscall,
    3.20  		.address = (unsigned long)system_call,
    3.21  	};
     4.1 --- a/xen/arch/x86/shutdown.c	Thu Apr 06 17:34:54 2006 +0100
     4.2 +++ b/xen/arch/x86/shutdown.c	Thu Apr 06 17:47:37 2006 +0100
     4.3 @@ -44,7 +44,7 @@ static inline void kb_wait(void)
     4.4  void __attribute__((noreturn)) __machine_halt(void *unused)
     4.5  {
     4.6      for ( ; ; )
     4.7 -        safe_halt();
     4.8 +        __asm__ __volatile__ ( "hlt" );
     4.9  }
    4.10  
    4.11  void machine_halt(void)
     5.1 --- a/xen/arch/x86/traps.c	Thu Apr 06 17:34:54 2006 +0100
     5.2 +++ b/xen/arch/x86/traps.c	Thu Apr 06 17:47:37 2006 +0100
     5.3 @@ -32,6 +32,7 @@
     5.4  #include <xen/errno.h>
     5.5  #include <xen/mm.h>
     5.6  #include <xen/console.h>
     5.7 +#include <xen/reboot.h>
     5.8  #include <asm/regs.h>
     5.9  #include <xen/delay.h>
    5.10  #include <xen/event.h>
    5.11 @@ -318,8 +319,7 @@ asmlinkage void fatal_trap(int trapnr, s
    5.12      console_force_lock();
    5.13  
    5.14      /* Wait for manual reset. */
    5.15 -    for ( ; ; )
    5.16 -        __asm__ __volatile__ ( "hlt" );
    5.17 +    machine_halt();
    5.18  }
    5.19  
    5.20  static inline int do_trap(int trapnr, char *str,
     6.1 --- a/xen/arch/x86/x86_32/entry.S	Thu Apr 06 17:34:54 2006 +0100
     6.2 +++ b/xen/arch/x86/x86_32/entry.S	Thu Apr 06 17:47:37 2006 +0100
     6.3 @@ -119,7 +119,7 @@ FIX1:   SET_XEN_SEGMENTS(a)
     6.4          movl  $DBLFLT1,%eax
     6.5          pushl %eax                     # EIP
     6.6          pushl %esi                     # error_code/entry_vector
     6.7 -        jmp   error_code
     6.8 +        jmp   handle_exception
     6.9  DBLFLT1:GET_CURRENT(%ebx)
    6.10          jmp   test_all_events
    6.11  failsafe_callback:
    6.12 @@ -381,14 +381,6 @@ domain_crash_synchronous:
    6.13          jmp   __domain_crash_synchronous
    6.14  
    6.15          ALIGN
    6.16 -process_guest_exception_and_events:
    6.17 -        leal VCPU_trap_bounce(%ebx),%edx
    6.18 -        testb $TBF_EXCEPTION,TRAPBOUNCE_flags(%edx)
    6.19 -        jz   test_all_events
    6.20 -        call create_bounce_frame
    6.21 -        jmp  test_all_events
    6.22 -
    6.23 -        ALIGN
    6.24  ENTRY(ret_from_intr)
    6.25          GET_CURRENT(%ebx)
    6.26          movl  UREGS_eflags(%esp),%eax
    6.27 @@ -400,7 +392,7 @@ ENTRY(ret_from_intr)
    6.28  ENTRY(divide_error)
    6.29  	pushl $TRAP_divide_error<<16
    6.30  	ALIGN
    6.31 -error_code:
    6.32 +handle_exception:
    6.33          FIXUP_RING0_GUEST_STACK
    6.34          SAVE_ALL_NOSEGREGS(a)
    6.35          SET_XEN_SEGMENTS(a)
    6.36 @@ -419,7 +411,11 @@ error_code:
    6.37          movb  UREGS_cs(%esp),%al
    6.38          testl $(3|X86_EFLAGS_VM),%eax
    6.39  	jz    restore_all_xen
    6.40 -        jmp   process_guest_exception_and_events
    6.41 +        leal  VCPU_trap_bounce(%ebx),%edx
    6.42 +        testb $TBF_EXCEPTION,TRAPBOUNCE_flags(%edx)
    6.43 +        jz    test_all_events
    6.44 +        call  create_bounce_frame
    6.45 +        jmp   test_all_events
    6.46  
    6.47  exception_with_ints_disabled:
    6.48          movl  UREGS_eflags(%esp),%eax
    6.49 @@ -452,71 +448,71 @@ FATAL_exception_with_ints_disabled:
    6.50                                          
    6.51  ENTRY(coprocessor_error)
    6.52  	pushl $TRAP_copro_error<<16
    6.53 -	jmp error_code
    6.54 +	jmp   handle_exception
    6.55  
    6.56  ENTRY(simd_coprocessor_error)
    6.57  	pushl $TRAP_simd_error<<16
    6.58 -	jmp error_code
    6.59 +	jmp   handle_exception
    6.60  
    6.61  ENTRY(device_not_available)
    6.62  	pushl $TRAP_no_device<<16
    6.63 -        jmp   error_code
    6.64 +        jmp   handle_exception
    6.65  
    6.66  ENTRY(debug)
    6.67  	pushl $TRAP_debug<<16
    6.68 -	jmp error_code
    6.69 +	jmp   handle_exception
    6.70  
    6.71  ENTRY(int3)
    6.72  	pushl $TRAP_int3<<16
    6.73 -	jmp error_code
    6.74 +	jmp   handle_exception
    6.75  
    6.76  ENTRY(overflow)
    6.77  	pushl $TRAP_overflow<<16
    6.78 -	jmp error_code
    6.79 +	jmp   handle_exception
    6.80  
    6.81  ENTRY(bounds)
    6.82  	pushl $TRAP_bounds<<16
    6.83 -	jmp error_code
    6.84 +	jmp   handle_exception
    6.85  
    6.86  ENTRY(invalid_op)
    6.87  	pushl $TRAP_invalid_op<<16
    6.88 -	jmp error_code
    6.89 +	jmp   handle_exception
    6.90  
    6.91  ENTRY(coprocessor_segment_overrun)
    6.92  	pushl $TRAP_copro_seg<<16
    6.93 -	jmp error_code
    6.94 +	jmp   handle_exception
    6.95  
    6.96  ENTRY(invalid_TSS)
    6.97 -        movw $TRAP_invalid_tss,2(%esp)
    6.98 -	jmp error_code
    6.99 +        movw  $TRAP_invalid_tss,2(%esp)
   6.100 +	jmp   handle_exception
   6.101  
   6.102  ENTRY(segment_not_present)
   6.103 -        movw $TRAP_no_segment,2(%esp)
   6.104 -	jmp error_code
   6.105 +        movw  $TRAP_no_segment,2(%esp)
   6.106 +	jmp   handle_exception
   6.107  
   6.108  ENTRY(stack_segment)
   6.109 -        movw $TRAP_stack_error,2(%esp)
   6.110 -	jmp error_code
   6.111 +        movw  $TRAP_stack_error,2(%esp)
   6.112 +	jmp   handle_exception
   6.113  
   6.114  ENTRY(general_protection)
   6.115 -        movw $TRAP_gp_fault,2(%esp)
   6.116 -	jmp error_code
   6.117 +        movw  $TRAP_gp_fault,2(%esp)
   6.118 +	jmp   handle_exception
   6.119  
   6.120  ENTRY(alignment_check)
   6.121 -        movw $TRAP_alignment_check,2(%esp)
   6.122 -	jmp error_code
   6.123 +        movw  $TRAP_alignment_check,2(%esp)
   6.124 +	jmp   handle_exception
   6.125  
   6.126  ENTRY(page_fault)
   6.127 -        movw $TRAP_page_fault,2(%esp)
   6.128 -	jmp error_code
   6.129 +        movw  $TRAP_page_fault,2(%esp)
   6.130 +	jmp   handle_exception
   6.131  
   6.132  ENTRY(machine_check)
   6.133          pushl $TRAP_machine_check<<16
   6.134 -	jmp error_code
   6.135 +	jmp   handle_exception
   6.136  
   6.137  ENTRY(spurious_interrupt_bug)
   6.138          pushl $TRAP_spurious_int<<16
   6.139 -	jmp error_code
   6.140 +	jmp   handle_exception
   6.141  
   6.142  ENTRY(nmi)
   6.143  #ifdef CONFIG_X86_SUPERVISOR_MODE_KERNEL
     7.1 --- a/xen/arch/x86/x86_32/traps.c	Thu Apr 06 17:34:54 2006 +0100
     7.2 +++ b/xen/arch/x86/x86_32/traps.c	Thu Apr 06 17:47:37 2006 +0100
     7.3 @@ -9,6 +9,7 @@
     7.4  #include <xen/mm.h>
     7.5  #include <xen/irq.h>
     7.6  #include <xen/symbols.h>
     7.7 +#include <xen/reboot.h>
     7.8  #include <asm/current.h>
     7.9  #include <asm/flushtlb.h>
    7.10  #include <asm/hvm/hvm.h>
    7.11 @@ -180,8 +181,7 @@ asmlinkage void do_double_fault(void)
    7.12      console_force_lock();
    7.13  
    7.14      /* Wait for manual reset. */
    7.15 -    for ( ; ; )
    7.16 -        __asm__ __volatile__ ( "hlt" );
    7.17 +    machine_halt();
    7.18  }
    7.19  
    7.20  unsigned long do_iret(void)
    7.21 @@ -322,8 +322,7 @@ static long register_guest_callback(stru
    7.22      long ret = 0;
    7.23      struct vcpu *v = current;
    7.24  
    7.25 -    if ( reg->address.cs )
    7.26 -        fixup_guest_code_selector(reg->address.cs);
    7.27 +    fixup_guest_code_selector(reg->address.cs);
    7.28  
    7.29      switch ( reg->type )
    7.30      {
    7.31 @@ -355,6 +354,7 @@ static long unregister_guest_callback(st
    7.32          ret = -EINVAL;
    7.33          break;
    7.34      }
    7.35 +
    7.36      return ret;
    7.37  }
    7.38  
    7.39 @@ -370,7 +370,7 @@ long do_callback_op(int cmd, GUEST_HANDL
    7.40          struct callback_register reg;
    7.41  
    7.42          ret = -EFAULT;
    7.43 -        if ( copy_from_guest( &reg, arg, 1 ) )
    7.44 +        if ( copy_from_guest(&reg, arg, 1) )
    7.45              break;
    7.46  
    7.47          ret = register_guest_callback(&reg);
    7.48 @@ -382,7 +382,7 @@ long do_callback_op(int cmd, GUEST_HANDL
    7.49          struct callback_unregister unreg;
    7.50  
    7.51          ret = -EFAULT;
    7.52 -        if ( copy_from_guest( &unreg, arg, 1 ) )
    7.53 +        if ( copy_from_guest(&unreg, arg, 1) )
    7.54              break;
    7.55  
    7.56          ret = unregister_guest_callback(&unreg);
     8.1 --- a/xen/arch/x86/x86_64/entry.S	Thu Apr 06 17:34:54 2006 +0100
     8.2 +++ b/xen/arch/x86/x86_64/entry.S	Thu Apr 06 17:47:37 2006 +0100
     8.3 @@ -68,7 +68,7 @@ FIX1:   popq  -15*8-8(%rsp)            #
     8.4          leaq  DBLFLT1(%rip),%rax
     8.5          pushq %rax                     # RIP
     8.6          pushq %rsi                     # error_code/entry_vector
     8.7 -        jmp   error_code
     8.8 +        jmp   handle_exception
     8.9  DBLFLT1:GET_CURRENT(%rbx)
    8.10          jmp   test_all_events
    8.11  failsafe_callback:
    8.12 @@ -320,15 +320,6 @@ domain_crash_synchronous:
    8.13          jmp  __domain_crash_synchronous
    8.14  
    8.15          ALIGN
    8.16 -/* %rbx: struct vcpu */
    8.17 -process_guest_exception_and_events:
    8.18 -        leaq  VCPU_trap_bounce(%rbx),%rdx
    8.19 -        testb $TBF_EXCEPTION,TRAPBOUNCE_flags(%rdx)
    8.20 -        jz    test_all_events
    8.21 -        call  create_bounce_frame
    8.22 -        jmp   test_all_events
    8.23 -
    8.24 -        ALIGN
    8.25  /* No special register assumptions. */
    8.26  ENTRY(ret_from_intr)
    8.27          GET_CURRENT(%rbx)
    8.28 @@ -338,7 +329,7 @@ ENTRY(ret_from_intr)
    8.29  
    8.30          ALIGN
    8.31  /* No special register assumptions. */
    8.32 -error_code:
    8.33 +handle_exception:
    8.34          SAVE_ALL
    8.35          testb $X86_EFLAGS_IF>>8,UREGS_eflags+1(%rsp)
    8.36          jz    exception_with_ints_disabled
    8.37 @@ -351,7 +342,11 @@ error_code:
    8.38          callq *(%rdx,%rax,8)
    8.39          testb $3,UREGS_cs(%rsp)
    8.40          jz    restore_all_xen
    8.41 -        jmp   process_guest_exception_and_events
    8.42 +        leaq  VCPU_trap_bounce(%rbx),%rdx
    8.43 +        testb $TBF_EXCEPTION,TRAPBOUNCE_flags(%rdx)
    8.44 +        jz    test_all_events
    8.45 +        call  create_bounce_frame
    8.46 +        jmp   test_all_events
    8.47  
    8.48  /* No special register assumptions. */
    8.49  exception_with_ints_disabled:
    8.50 @@ -384,90 +379,90 @@ FATAL_exception_with_ints_disabled:
    8.51  ENTRY(divide_error)
    8.52          pushq $0
    8.53          movl  $TRAP_divide_error,4(%rsp)
    8.54 -        jmp   error_code
    8.55 +        jmp   handle_exception
    8.56  
    8.57  ENTRY(coprocessor_error)
    8.58          pushq $0
    8.59          movl  $TRAP_copro_error,4(%rsp)
    8.60 -	jmp   error_code
    8.61 +	jmp   handle_exception
    8.62  
    8.63  ENTRY(simd_coprocessor_error)
    8.64          pushq $0
    8.65          movl  $TRAP_simd_error,4(%rsp)
    8.66 -	jmp error_code
    8.67 +	jmp   handle_exception
    8.68  
    8.69  ENTRY(device_not_available)
    8.70          pushq $0
    8.71          movl  $TRAP_no_device,4(%rsp)
    8.72 -        jmp   error_code
    8.73 +        jmp   handle_exception
    8.74  
    8.75  ENTRY(debug)
    8.76          pushq $0
    8.77          movl  $TRAP_debug,4(%rsp)
    8.78 -	jmp   error_code
    8.79 +	jmp   handle_exception
    8.80  
    8.81  ENTRY(int3)
    8.82          pushq $0
    8.83  	movl  $TRAP_int3,4(%rsp)
    8.84 -	jmp   error_code
    8.85 +	jmp   handle_exception
    8.86  
    8.87  ENTRY(overflow)
    8.88          pushq $0
    8.89  	movl  $TRAP_overflow,4(%rsp)
    8.90 -	jmp   error_code
    8.91 +	jmp   handle_exception
    8.92  
    8.93  ENTRY(bounds)
    8.94          pushq $0
    8.95  	movl  $TRAP_bounds,4(%rsp)
    8.96 -	jmp   error_code
    8.97 +	jmp   handle_exception
    8.98  
    8.99  ENTRY(invalid_op)
   8.100          pushq $0
   8.101  	movl  $TRAP_invalid_op,4(%rsp)
   8.102 -	jmp   error_code
   8.103 +	jmp   handle_exception
   8.104  
   8.105  ENTRY(coprocessor_segment_overrun)
   8.106          pushq $0
   8.107  	movl  $TRAP_copro_seg,4(%rsp)
   8.108 -	jmp   error_code
   8.109 +	jmp   handle_exception
   8.110  
   8.111  ENTRY(invalid_TSS)
   8.112          movl  $TRAP_invalid_tss,4(%rsp)
   8.113 -	jmp   error_code
   8.114 +	jmp   handle_exception
   8.115  
   8.116  ENTRY(segment_not_present)
   8.117          movl  $TRAP_no_segment,4(%rsp)
   8.118 -	jmp   error_code
   8.119 +	jmp   handle_exception
   8.120  
   8.121  ENTRY(stack_segment)
   8.122          movl  $TRAP_stack_error,4(%rsp)
   8.123 -	jmp   error_code
   8.124 +	jmp   handle_exception
   8.125  
   8.126  ENTRY(general_protection)
   8.127          movl  $TRAP_gp_fault,4(%rsp)
   8.128 -	jmp   error_code
   8.129 +	jmp   handle_exception
   8.130  
   8.131  ENTRY(alignment_check)
   8.132          movl  $TRAP_alignment_check,4(%rsp)
   8.133 -	jmp   error_code
   8.134 +	jmp   handle_exception
   8.135  
   8.136  ENTRY(page_fault)
   8.137          movl  $TRAP_page_fault,4(%rsp)
   8.138 -	jmp   error_code
   8.139 +	jmp   handle_exception
   8.140  
   8.141  ENTRY(machine_check)
   8.142          pushq $0
   8.143          movl  $TRAP_machine_check,4(%rsp)
   8.144 -	jmp   error_code
   8.145 +	jmp   handle_exception
   8.146  
   8.147  ENTRY(spurious_interrupt_bug)
   8.148          pushq $0
   8.149          movl  $TRAP_spurious_int,4(%rsp)
   8.150 -	jmp   error_code
   8.151 +	jmp   handle_exception
   8.152  
   8.153  ENTRY(double_fault)
   8.154          movl  $TRAP_double_fault,4(%rsp)
   8.155 -        jmp   error_code
   8.156 +        jmp   handle_exception
   8.157  
   8.158  ENTRY(nmi)
   8.159          pushq $0
     9.1 --- a/xen/arch/x86/x86_64/traps.c	Thu Apr 06 17:34:54 2006 +0100
     9.2 +++ b/xen/arch/x86/x86_64/traps.c	Thu Apr 06 17:47:37 2006 +0100
     9.3 @@ -10,6 +10,7 @@
     9.4  #include <xen/symbols.h>
     9.5  #include <xen/console.h>
     9.6  #include <xen/sched.h>
     9.7 +#include <xen/reboot.h>
     9.8  #include <asm/current.h>
     9.9  #include <asm/flushtlb.h>
    9.10  #include <asm/msr.h>
    9.11 @@ -166,8 +167,7 @@ asmlinkage void do_double_fault(struct c
    9.12      console_force_lock();
    9.13  
    9.14      /* Wait for manual reset. */
    9.15 -    for ( ; ; )
    9.16 -        __asm__ __volatile__ ( "hlt" );
    9.17 +    machine_halt();
    9.18  }
    9.19  
    9.20  void toggle_guest_mode(struct vcpu *v)
    9.21 @@ -357,6 +357,7 @@ static long unregister_guest_callback(st
    9.22          ret = -EINVAL;
    9.23          break;
    9.24      }
    9.25 +
    9.26      return ret;
    9.27  }
    9.28  
    9.29 @@ -372,7 +373,7 @@ long do_callback_op(int cmd, GUEST_HANDL
    9.30          struct callback_register reg;
    9.31  
    9.32          ret = -EFAULT;
    9.33 -        if ( copy_from_guest( &reg, arg, 1 ) )
    9.34 +        if ( copy_from_guest(&reg, arg, 1) )
    9.35              break;
    9.36  
    9.37          ret = register_guest_callback(&reg);
    9.38 @@ -384,7 +385,7 @@ long do_callback_op(int cmd, GUEST_HANDL
    9.39          struct callback_unregister unreg;
    9.40  
    9.41          ret = -EFAULT;
    9.42 -        if ( copy_from_guest( &unreg, arg, 1 ) )
    9.43 +        if ( copy_from_guest(&unreg, arg, 1) )
    9.44              break;
    9.45  
    9.46          ret = unregister_guest_callback(&unreg);
    9.47 @@ -403,15 +404,15 @@ long do_set_callbacks(unsigned long even
    9.48                        unsigned long failsafe_address,
    9.49                        unsigned long syscall_address)
    9.50  {
    9.51 -    callback_register_t event = {
    9.52 +    struct callback_register event = {
    9.53          .type = CALLBACKTYPE_event,
    9.54          .address = event_address,
    9.55      };
    9.56 -    callback_register_t failsafe = {
    9.57 +    struct callback_register failsafe = {
    9.58          .type = CALLBACKTYPE_failsafe,
    9.59          .address = failsafe_address,
    9.60      };
    9.61 -    callback_register_t syscall = {
    9.62 +    struct callback_register syscall = {
    9.63          .type = CALLBACKTYPE_syscall,
    9.64          .address = syscall_address,
    9.65      };
    10.1 --- a/xen/drivers/char/console.c	Thu Apr 06 17:34:54 2006 +0100
    10.2 +++ b/xen/drivers/char/console.c	Thu Apr 06 17:47:37 2006 +0100
    10.3 @@ -520,6 +520,7 @@ void console_force_unlock(void)
    10.4  {
    10.5      console_lock = SPIN_LOCK_UNLOCKED;
    10.6      serial_force_unlock(sercon_handle);
    10.7 +    console_start_sync();
    10.8  }
    10.9  
   10.10  void console_force_lock(void)