]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'linus' into x86/xen
authorIngo Molnar <mingo@elte.hu>
Thu, 31 Jul 2008 10:38:04 +0000 (12:38 +0200)
committerIngo Molnar <mingo@elte.hu>
Thu, 31 Jul 2008 10:38:04 +0000 (12:38 +0200)
1  2 
arch/x86/kernel/ldt.c

diff --combined arch/x86/kernel/ldt.c
index 4895e0634d22bf83b1937777a6a15dbf4c93900d,b68e21f06f4f84615baf2fbc47179fd437bea321..6e388412a854ece43f2ce41f8831840c3f31a221
@@@ -51,8 -51,6 +51,8 @@@ static int alloc_ldt(mm_context_t *pc, 
        memset(newldt + oldsize * LDT_ENTRY_SIZE, 0,
               (mincount - oldsize) * LDT_ENTRY_SIZE);
  
 +      paravirt_alloc_ldt(newldt, mincount);
 +
  #ifdef CONFIG_X86_64
        /* CHECKME: Do we really need this ? */
        wmb();
  
        if (reload) {
  #ifdef CONFIG_SMP
-               cpumask_of_cpu_ptr_declare(mask);
                preempt_disable();
                load_LDT(pc);
-               cpumask_of_cpu_ptr_next(mask, smp_processor_id());
-               if (!cpus_equal(current->mm->cpu_vm_mask, *mask))
+               if (!cpus_equal(current->mm->cpu_vm_mask,
+                               cpumask_of_cpu(smp_processor_id())))
                        smp_call_function(flush_ldt, current->mm, 1);
                preempt_enable();
  #else
@@@ -77,7 -73,6 +75,7 @@@
  #endif
        }
        if (oldsize) {
 +              paravirt_free_ldt(oldldt, oldsize);
                if (oldsize * LDT_ENTRY_SIZE > PAGE_SIZE)
                        vfree(oldldt);
                else
  static inline int copy_ldt(mm_context_t *new, mm_context_t *old)
  {
        int err = alloc_ldt(new, old->size, 0);
 +      int i;
  
        if (err < 0)
                return err;
 -      memcpy(new->ldt, old->ldt, old->size * LDT_ENTRY_SIZE);
 +
 +      for(i = 0; i < old->size; i++)
 +              write_ldt_entry(new->ldt, i, old->ldt + i * LDT_ENTRY_SIZE);
        return 0;
  }
  
@@@ -132,7 -124,6 +130,7 @@@ void destroy_context(struct mm_struct *
                if (mm == current->active_mm)
                        clear_LDT();
  #endif
 +              paravirt_free_ldt(mm->context.ldt, mm->context.size);
                if (mm->context.size * LDT_ENTRY_SIZE > PAGE_SIZE)
                        vfree(mm->context.ldt);
                else