}
 }
 
-static inline void set_32bit_tls(struct task_struct *t, int tls, u32 addr)
-{
-       struct user_desc ud = {
-               .base_addr = addr,
-               .limit = 0xfffff,
-               .seg_32bit = 1,
-               .limit_in_pages = 1,
-               .useable = 1,
-       };
-       struct desc_struct *desc = t->thread.tls_array;
-       desc += tls;
-       fill_ldt(desc, &ud);
-}
-
-static inline u32 read_32bit_tls(struct task_struct *t, int tls)
-{
-       return get_desc_base(&t->thread.tls_array[tls]);
-}
-
 int copy_thread_tls(unsigned long clone_flags, unsigned long sp,
                unsigned long arg, struct task_struct *p, unsigned long tls)
 {
                if (addr >= TASK_SIZE_OF(task))
                        return -EPERM;
                cpu = get_cpu();
-               /* handle small bases via the GDT because that's faster to
-                  switch. */
-               if (addr <= 0xffffffff) {
-                       set_32bit_tls(task, GS_TLS, addr);
-                       if (doit) {
-                               load_TLS(&task->thread, cpu);
-                               load_gs_index(GS_TLS_SEL);
-                       }
-                       task->thread.gsindex = GS_TLS_SEL;
-                       task->thread.gs = 0;
-               } else {
-                       task->thread.gsindex = 0;
-                       task->thread.gs = addr;
-                       if (doit) {
-                               load_gs_index(0);
-                               ret = wrmsrl_safe(MSR_KERNEL_GS_BASE, addr);
-                       }
+               task->thread.gsindex = 0;
+               task->thread.gs = addr;
+               if (doit) {
+                       load_gs_index(0);
+                       ret = wrmsrl_safe(MSR_KERNEL_GS_BASE, addr);
                }
-               put_cpu();
                break;
        case ARCH_SET_FS:
                /* Not strictly needed for fs, but do it for symmetry
                if (addr >= TASK_SIZE_OF(task))
                        return -EPERM;
                cpu = get_cpu();
-               /* handle small bases via the GDT because that's faster to
-                  switch. */
-               if (addr <= 0xffffffff) {
-                       set_32bit_tls(task, FS_TLS, addr);
-                       if (doit) {
-                               load_TLS(&task->thread, cpu);
-                               loadsegment(fs, FS_TLS_SEL);
-                       }
-                       task->thread.fsindex = FS_TLS_SEL;
-                       task->thread.fs = 0;
-               } else {
-                       task->thread.fsindex = 0;
-                       task->thread.fs = addr;
-                       if (doit) {
-                               /* set the selector to 0 to not confuse
-                                  __switch_to */
-                               loadsegment(fs, 0);
-                               ret = wrmsrl_safe(MSR_FS_BASE, addr);
-                       }
+               task->thread.fsindex = 0;
+               task->thread.fs = addr;
+               if (doit) {
+                       /* set the selector to 0 to not confuse __switch_to */
+                       loadsegment(fs, 0);
+                       ret = wrmsrl_safe(MSR_FS_BASE, addr);
                }
                put_cpu();
                break;
                unsigned long base;
                if (doit)
                        rdmsrl(MSR_FS_BASE, base);
-               else if (task->thread.fsindex == FS_TLS_SEL)
-                       base = read_32bit_tls(task, FS_TLS);
                else
                        base = task->thread.fs;
                ret = put_user(base, (unsigned long __user *)addr);
                unsigned long base;
                if (doit)
                        rdmsrl(MSR_KERNEL_GS_BASE, base);
-               else if (task->thread.gsindex == GS_TLS_SEL)
-                       base = read_32bit_tls(task, GS_TLS);
                else
                        base = task->thread.gs;
                ret = put_user(base, (unsigned long __user *)addr);
 
 
        switch (offset) {
        case offsetof(struct user_regs_struct,fs):
-               /*
-                * If this is setting fs as for normal 64-bit use but
-                * setting fs_base has implicitly changed it, leave it.
-                */
-               if ((value == FS_TLS_SEL && task->thread.fsindex == 0 &&
-                    task->thread.fs != 0) ||
-                   (value == 0 && task->thread.fsindex == FS_TLS_SEL &&
-                    task->thread.fs == 0))
-                       break;
                task->thread.fsindex = value;
                if (task == current)
                        loadsegment(fs, task->thread.fsindex);
                break;
        case offsetof(struct user_regs_struct,gs):
-               /*
-                * If this is setting gs as for normal 64-bit use but
-                * setting gs_base has implicitly changed it, leave it.
-                */
-               if ((value == GS_TLS_SEL && task->thread.gsindex == 0 &&
-                    task->thread.gs != 0) ||
-                   (value == 0 && task->thread.gsindex == GS_TLS_SEL &&
-                    task->thread.gs == 0))
-                       break;
                task->thread.gsindex = value;
                if (task == current)
                        load_gs_index(task->thread.gsindex);
 #ifdef CONFIG_X86_64
        case offsetof(struct user_regs_struct, fs_base): {
                /*
-                * do_arch_prctl may have used a GDT slot instead of
-                * the MSR.  To userland, it appears the same either
-                * way, except the %fs segment selector might not be 0.
+                * XXX: This will not behave as expected if called on
+                * current or if fsindex != 0.
                 */
-               unsigned int seg = task->thread.fsindex;
-               if (task->thread.fs != 0)
-                       return task->thread.fs;
-               if (task == current)
-                       asm("movl %%fs,%0" : "=r" (seg));
-               if (seg != FS_TLS_SEL)
-                       return 0;
-               return get_desc_base(&task->thread.tls_array[FS_TLS]);
+               return task->thread.fs;
        }
        case offsetof(struct user_regs_struct, gs_base): {
                /*
-                * Exactly the same here as the %fs handling above.
+                * XXX: This will not behave as expected if called on
+                * current or if fsindex != 0.
                 */
-               unsigned int seg = task->thread.gsindex;
-               if (task->thread.gs != 0)
-                       return task->thread.gs;
-               if (task == current)
-                       asm("movl %%gs,%0" : "=r" (seg));
-               if (seg != GS_TLS_SEL)
-                       return 0;
-               return get_desc_base(&task->thread.tls_array[GS_TLS]);
+               return task->thread.gs;
        }
 #endif
        }