ia64/xen-unstable

changeset 477:55e51e0a289f

bitkeeper revision 1.252 (3eddffe6IQ1eZ1bHUcbBhwG8ApEXrA)

processor.h, setup.c, process.c:
Further IOPL fix -- also initial idle thread has current->thread.esp0 initialised to a non-zero value.
author kaf24@scramble.cl.cam.ac.uk
date Wed Jun 04 14:19:18 2003 +0000 (2003-06-04)
parents 72cb1d2c2449
children 61ce1c1ec79e
files xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/setup.c xenolinux-2.4.21-pre4-sparse/include/asm-xeno/processor.h
line diff
     1.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c	Wed Jun 04 12:24:19 2003 +0000
     1.2 +++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c	Wed Jun 04 14:19:18 2003 +0000
     1.3 @@ -365,14 +365,11 @@ void __switch_to(struct task_struct *pre
     1.4          queue_multicall0(__HYPERVISOR_fpu_taskswitch);
     1.5      }
     1.6  
     1.7 -    if ( next->esp0 != 0 )
     1.8 -    {
     1.9 -        queue_multicall2(__HYPERVISOR_stack_switch, __KERNEL_DS, next->esp0);
    1.10 -        /* Next call will silently fail if we are a non-privileged guest OS. */
    1.11 -        queue_multicall2(__HYPERVISOR_set_priv_levels,
    1.12 -                         ((((struct pt_regs *)next->esp0)-1)->eflags>>12)&3,
    1.13 -                         next->hypercall_pl);
    1.14 -    }
    1.15 +    queue_multicall2(__HYPERVISOR_stack_switch, __KERNEL_DS, next->esp0);
    1.16 +    /* Next call will silently fail if we are a non-privileged guest OS. */
    1.17 +    queue_multicall2(__HYPERVISOR_set_priv_levels,
    1.18 +                     ((((struct pt_regs *)next->esp0)-1)->eflags>>12)&3,
    1.19 +                     next->hypercall_pl);
    1.20  
    1.21      /* EXECUTE ALL TASK SWITCH XEN SYSCALLS AT THIS POINT. */
    1.22      execute_multicall_list();
     2.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/setup.c	Wed Jun 04 12:24:19 2003 +0000
     2.2 +++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/setup.c	Wed Jun 04 14:19:18 2003 +0000
     2.3 @@ -302,7 +302,6 @@ void __init setup_arch(char **cmdline_p)
     2.4  
     2.5      paging_init();
     2.6  
     2.7 -    /* Set privilege level gubbins. */
     2.8      regs->eflags &= ~(3<<12);
     2.9      if ( start_info.flags & SIF_PRIVILEGED ) {
    2.10          /* We are privileged guest os - should have IO privileges. */
    2.11 @@ -310,7 +309,6 @@ void __init setup_arch(char **cmdline_p)
    2.12              panic("Unable to obtain IOPL, despite being SIF_PRIVILEGED");
    2.13          regs->eflags |= 1<<12;
    2.14      }
    2.15 -    current->thread.hypercall_pl = 1;
    2.16  
    2.17      if(start_info.flags & SIF_CONSOLE)
    2.18      {
     3.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/processor.h	Wed Jun 04 12:24:19 2003 +0000
     3.2 +++ b/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/processor.h	Wed Jun 04 14:19:18 2003 +0000
     3.3 @@ -369,7 +369,8 @@ struct thread_struct {
     3.4  	unsigned long		v86flags, v86mask, saved_esp0;
     3.5  };
     3.6  
     3.7 -#define INIT_THREAD  { 0, 0, 0, 0, 0, 1, {0}, 0, 0, 0, {0}, 0, 0, 0, 0, 0 }
     3.8 +#define INIT_THREAD  { sizeof(init_stack) + (long) &init_stack, \
     3.9 +                       0, 0, 0, 0, 1, {0}, 0, 0, 0, {0}, 0, 0, 0, 0, 0 }
    3.10  
    3.11  #define INIT_TSS  {						\
    3.12  	0,0, /* back_link, __blh */				\