Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
[pandora-kernel.git] / arch / x86 / kernel / process_64.c
index bd387e8..6c9dd92 100644 (file)
@@ -501,6 +501,10 @@ void set_personality_64bit(void)
        /* Make sure to be in 64bit mode */
        clear_thread_flag(TIF_IA32);
 
+       /* Ensure the corresponding mm is not marked. */
+       if (current->mm)
+               current->mm->context.ia32_compat = 0;
+
        /* TBD: overwrites user setup. Should have two bits.
           But 64bit processes have always behaved this way,
           so it's not too bad. The main problem is just that
@@ -516,6 +520,10 @@ void set_personality_ia32(void)
        set_thread_flag(TIF_IA32);
        current->personality |= force_personality32;
 
+       /* Mark the associated mm as containing 32-bit tasks. */
+       if (current->mm)
+               current->mm->context.ia32_compat = 1;
+
        /* Prepare the first "return" to user space */
        current_thread_info()->status |= TS_COMPAT;
 }