ia64/xen-unstable

changeset 137:4c6ae683ed61

bitkeeper revision 1.22.2.13 (3e47a8faCADIagB6c2I4F2E1dGdRyw)

processor.h, traps.c, smpboot.c, process.c:
Fix bug in fast-trap handling.
author kaf24@labyrinth.cl.cam.ac.uk
date Mon Feb 10 13:28:26 2003 +0000 (2003-02-10)
parents 0e7853339ecd
children 2f78322be16a 2c1ef70cc49f e18322478a0f f86685fc9147
files xen-2.4.16/arch/i386/process.c xen-2.4.16/arch/i386/smpboot.c xen-2.4.16/arch/i386/traps.c xen-2.4.16/include/asm-i386/processor.h
line diff
     1.1 --- a/xen-2.4.16/arch/i386/process.c	Sun Feb 09 20:48:15 2003 +0000
     1.2 +++ b/xen-2.4.16/arch/i386/process.c	Mon Feb 10 13:28:26 2003 +0000
     1.3 @@ -326,9 +326,7 @@ void new_thread(struct task_struct *p,
     1.4      regs->eflags |= X86_EFLAGS_IF;
     1.5  
     1.6      /* No fast trap at start of day. */
     1.7 -    p->thread.fast_trap_idx    = 0x20;
     1.8 -    p->thread.fast_trap_desc.a = 0;
     1.9 -    p->thread.fast_trap_desc.b = 0;
    1.10 +    SET_DEFAULT_FAST_TRAP(&p->thread);
    1.11  }
    1.12  
    1.13  
     2.1 --- a/xen-2.4.16/arch/i386/smpboot.c	Sun Feb 09 20:48:15 2003 +0000
     2.2 +++ b/xen-2.4.16/arch/i386/smpboot.c	Mon Feb 10 13:28:26 2003 +0000
     2.3 @@ -685,6 +685,8 @@ static void __init do_boot_cpu (int apic
     2.4      idle->thread.esp = idle->thread.esp0 = (unsigned long)idle + THREAD_SIZE;
     2.5      idle->thread.eip = (unsigned long) start_secondary;
     2.6  
     2.7 +    SET_DEFAULT_FAST_TRAP(&idle->thread);
     2.8 +
     2.9      /* start_eip had better be page-aligned! */
    2.10      start_eip = setup_trampoline();
    2.11  
     3.1 --- a/xen-2.4.16/arch/i386/traps.c	Sun Feb 09 20:48:15 2003 +0000
     3.2 +++ b/xen-2.4.16/arch/i386/traps.c	Mon Feb 10 13:28:26 2003 +0000
     3.3 @@ -580,10 +580,7 @@ long do_set_fast_trap(int idx)
     3.4      if ( idx == 0 )
     3.5      {
     3.6          CLEAR_FAST_TRAP(&current->thread);
     3.7 -        memset(idt_table+current->thread.fast_trap_idx, 0, 8);
     3.8 -        current->thread.fast_trap_idx    = 0x20;
     3.9 -        current->thread.fast_trap_desc.a = 0;
    3.10 -        current->thread.fast_trap_desc.b = 0;
    3.11 +        SET_DEFAULT_FAST_TRAP(&current->thread);
    3.12          return 0;
    3.13      }
    3.14  
     4.1 --- a/xen-2.4.16/include/asm-i386/processor.h	Sun Feb 09 20:48:15 2003 +0000
     4.2 +++ b/xen-2.4.16/include/asm-i386/processor.h	Mon Feb 10 13:28:26 2003 +0000
     4.3 @@ -358,8 +358,14 @@ struct thread_struct {
     4.4      trap_info_t         traps[256];
     4.5  };
     4.6  
     4.7 +#define SET_DEFAULT_FAST_TRAP(_p) \
     4.8 +    (_p)->fast_trap_idx = 0x20;   \
     4.9 +    (_p)->fast_trap_desc.a = 0;   \
    4.10 +    (_p)->fast_trap_desc.b = 0;
    4.11 +
    4.12  #define CLEAR_FAST_TRAP(_p) \
    4.13      (memset(idt_table + (_p)->fast_trap_idx, 0, 8))
    4.14 +
    4.15  #define SET_FAST_TRAP(_p)   \
    4.16      (memcpy(idt_table + (_p)->fast_trap_idx, &((_p)->fast_trap_desc), 8))
    4.17  
    4.18 @@ -369,7 +375,7 @@ struct thread_struct {
    4.19  	{ [0 ... 7] = 0 },	/* debugging registers */	\
    4.20  	0, 0, 0,						\
    4.21  	{ { 0, }, },		/* 387 state */			\
    4.22 -	0, { 0, 0 },						\
    4.23 +	0x20, { 0, 0 },		/* DEFAULT_FAST_TRAP */		\
    4.24  	{ {0} }			/* io permissions */		\
    4.25  }
    4.26