7 #include <linux/sched.h>
8 #include <asm/uaccess.h>
18 static int host_supports_tls = -1;
66 if (!t->
arch.tls_array)
70 if (!t->
arch.tls_array[idx].present)
78 memset(info, 0,
sizeof(*info));
105 clear_user_desc(&curr->
tls);
106 curr->
tls.entry_number =
idx;
130 static inline int needs_TLS_update(
struct task_struct *task)
187 if (!host_supports_tls)
206 if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX)
232 ret = set_tls_entry(
new, &info, idx, 0);
243 if (!t->
arch.tls_array)
246 if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX)
262 "without flushed TLS.",
current->pid);
272 clear_user_desc(info);
279 struct user_desc info;
282 if (!host_supports_tls)
296 if (
put_user(idx, &user_desc->entry_number))
303 return set_tls_entry(
current, &info, idx, 1);
314 struct user_desc info;
316 if (!host_supports_tls)
322 return set_tls_entry(child, &info, idx, 0);
327 struct user_desc info;
330 if (!host_supports_tls)
333 if (
get_user(idx, &user_desc->entry_number))
336 ret = get_tls_entry(
current, &info, idx);
353 struct user_desc info;
356 if (!host_supports_tls)
359 ret = get_tls_entry(child, &info, idx);
373 static int __init __setup_host_supports_tls(
void)
376 if (host_supports_tls) {
380 case GDT_ENTRY_TLS_MIN_I386:
383 case GDT_ENTRY_TLS_MIN_X86_64:
392 "TLS support inside UML will not work\n");