aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/sys-i386
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2008-02-05 01:30:51 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-05 12:44:27 -0500
commitb8bec829c90d45a2d115a52f3a928ce841afc3d4 (patch)
tree3e14d986c5e8491c62c2a41bc26ae8f5e6b6142a /arch/um/sys-i386
parent6b7e967484f4197d799e14b844b78118e93192c6 (diff)
uml: host TLS diagnostics
Add some diagnostics when TLS operations on the host fail. Also spit out more information about the TLS environment on the host at boot time. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/sys-i386')
-rw-r--r--arch/um/sys-i386/tls.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/arch/um/sys-i386/tls.c b/arch/um/sys-i386/tls.c
index f29b8a8fc1e..c6c7131e563 100644
--- a/arch/um/sys-i386/tls.c
+++ b/arch/um/sys-i386/tls.c
@@ -26,6 +26,11 @@ int do_set_thread_area(struct user_desc *info)
26 cpu = get_cpu(); 26 cpu = get_cpu();
27 ret = os_set_thread_area(info, userspace_pid[cpu]); 27 ret = os_set_thread_area(info, userspace_pid[cpu]);
28 put_cpu(); 28 put_cpu();
29
30 if (ret)
31 printk(KERN_ERR "PTRACE_SET_THREAD_AREA failed, err = %d, "
32 "index = %d\n", ret, info->entry_number);
33
29 return ret; 34 return ret;
30} 35}
31 36
@@ -37,6 +42,11 @@ int do_get_thread_area(struct user_desc *info)
37 cpu = get_cpu(); 42 cpu = get_cpu();
38 ret = os_get_thread_area(info, userspace_pid[cpu]); 43 ret = os_get_thread_area(info, userspace_pid[cpu]);
39 put_cpu(); 44 put_cpu();
45
46 if (ret)
47 printk(KERN_ERR "PTRACE_GET_THREAD_AREA failed, err = %d, "
48 "index = %d\n", ret, info->entry_number);
49
40 return ret; 50 return ret;
41} 51}
42 52
@@ -356,10 +366,9 @@ out:
356 return ret; 366 return ret;
357} 367}
358 368
359
360/* 369/*
361 * XXX: This part is probably common to i386 and x86-64. Don't create a common 370 * This code is really i386-only, but it detects and logs x86_64 GDT indexes
362 * file for now, do that when implementing x86-64 support. 371 * if a 32-bit UML is running on a 64-bit host.
363 */ 372 */
364static int __init __setup_host_supports_tls(void) 373static int __init __setup_host_supports_tls(void)
365{ 374{
@@ -368,13 +377,16 @@ static int __init __setup_host_supports_tls(void)
368 printk(KERN_INFO "Host TLS support detected\n"); 377 printk(KERN_INFO "Host TLS support detected\n");
369 printk(KERN_INFO "Detected host type: "); 378 printk(KERN_INFO "Detected host type: ");
370 switch (host_gdt_entry_tls_min) { 379 switch (host_gdt_entry_tls_min) {
371 case GDT_ENTRY_TLS_MIN_I386: 380 case GDT_ENTRY_TLS_MIN_I386:
372 printk("i386\n"); 381 printk(KERN_CONT "i386");
373 break; 382 break;
374 case GDT_ENTRY_TLS_MIN_X86_64: 383 case GDT_ENTRY_TLS_MIN_X86_64:
375 printk("x86_64\n"); 384 printk(KERN_CONT "x86_64");
376 break; 385 break;
377 } 386 }
387 printk(KERN_CONT " (GDT indexes %d to %d)\n",
388 host_gdt_entry_tls_min,
389 host_gdt_entry_tls_min + GDT_ENTRY_TLS_ENTRIES);
378 } else 390 } else
379 printk(KERN_ERR " Host TLS support NOT detected! " 391 printk(KERN_ERR " Host TLS support NOT detected! "
380 "TLS support inside UML will not work\n"); 392 "TLS support inside UML will not work\n");