diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-02-06 19:37:18 -0500 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-02-06 19:37:18 -0500 |
commit | 7a5b2e2906fdc575bf7fc93f954419c5d54bb0a5 (patch) | |
tree | 3de4b5c7414bbb3503a346708116b4f193fc6b98 | |
parent | 6834f41a1aa2f92e5b7ca6ae8c80b6fee0fa1208 (diff) |
Bugfix: [x86_64] missing clobbered register in feather_trace_64
In feather_trace_64 with optimized gcc kernel code we must force the
reloading of additional (non very obvious :) registers.
Fixes the following BUG:
[ 66.288413] BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
[ 66.289276] IP: [<ffffffff81208a8b>] requeue+0x1b/0x90
[ 66.289276] PGD 7b8cf067 PUD 7ad9e067 PMD 0
[ 66.289276] Oops: 0000 [#1] PREEMPT SMP
[ 66.289276] last sysfs file: /sys/devices/pci0000:00/0000:00:01.1/ide0/0.0/block/hda/size
[ 66.289276] CPU 3
[ 66.289276] Modules linked in:
[ 66.289276] Pid: 1485, comm: release_ts Not tainted 2.6.32-litmus2010 #172
[ 66.289276] RIP: 0010:[<ffffffff81208a8b>] [<ffffffff81208a8b>] requeue+0x1b/0x90
[ 66.289276] RSP: 0018:ffff88007b47fdc8 EFLAGS: 00010086
[ 66.289276] RAX: 0000000000000000 RBX: ffff88007b47ffd8 RCX: ffff8800063d1560
[ 66.289276] RDX: 0000000000000000 RSI: 0000000000000018 RDI: ffff88007b47ffd8
[ 66.289276] RBP: ffff88007b47fdd8 R08: 0000000000000001 R09: 0000000000000000
[ 66.289276] R10: 0000000000000003 R11: 0000000000000000 R12: ffff88007b47ffd8
[ 66.289276] R13: ffff880005fed240 R14: 0000000000000003 R15: ffff88007b47fe88
[ 66.289276] FS: 000000000077b850(0063) GS:ffff880006200000(0000) knlGS:0000000000000000
[ 66.289276] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[ 66.289276] CR2: 0000000000000018 CR3: 000000007bb5d000 CR4: 00000000000006a0
[ 66.289276] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 66.289276] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 66.289276] Process release_ts (pid: 1485, threadinfo ffff88007b47e000, task ffff88007ba71320)
[ 66.289276] Stack:
[ 66.289276] ffff88007b47ffd8 0000000000000082 ffff88007b47fde8 ffffffff81208ec3
[ 66.289276] <0> ffff88007b47fe08 ffffffff8120968f ffff880005fed240 ffff88007b725fa0
[ 66.289276] <0> ffff88007b47fe28 ffffffff810332ed ffff88007b47fe38 ffff88007b725fa0
[ 66.289276] Call Trace:
[ 66.289276] [<ffffffff81208ec3>] gsnedf_job_arrival+0x13/0x20
[ 66.289276] [<ffffffff8120968f>] gsnedf_task_wake_up+0x8f/0xd0
[ 66.289276] [<ffffffff810332ed>] enqueue_task_litmus+0x3d/0x90
[ 66.289276] [<ffffffff8102c48d>] enqueue_task+0x2d/0x40
[ 66.289276] [<ffffffff8102c55e>] activate_task+0x2e/0x40
[ 66.289276] [<ffffffff8103646b>] try_to_wake_up+0x1db/0x360
[ 66.289276] [<ffffffff81036602>] default_wake_function+0x12/0x20
[ 66.289276] [<ffffffff8102c96b>] __wake_up_common+0x5b/0x90
[ 66.289276] [<ffffffff81030ddd>] complete_n+0x4d/0x70
[ 66.289276] [<ffffffff81205634>] sys_release_ts+0x104/0x120
[ 66.289276] [<ffffffff8100b2eb>] system_call_fastpath+0x16/0x1b
[ 66.289276] Code: c7 40 04 01 00 00 00 e9 89 fe ff ff 0f 1f 40 00 55 48 89 e5 41 54 53 0f 1f 44 00 00 48 85 ff 49 89 fc 74 64 48 8b 87 c0 12 00 00 <83> 78 18 ff 75 5f 48 8b 9f 70 12 00 00 e8 e3 d1 e5 ff 48 39 d8
[ 66.289276] RIP [<ffffffff81208a8b>] requeue+0x1b/0x90
[ 66.289276] RSP <ffff88007b47fdc8>
[ 66.289276] CR2: 0000000000000018
[ 66.289276] ---[ end trace 1475fc2061a1b4b5 ]---
-rw-r--r-- | arch/x86/include/asm/feather_trace_64.h | 2 | ||||
-rw-r--r-- | include/litmus/rt_domain.h | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/include/asm/feather_trace_64.h b/arch/x86/include/asm/feather_trace_64.h index 030622daa809..1cffa4eec5f4 100644 --- a/arch/x86/include/asm/feather_trace_64.h +++ b/arch/x86/include/asm/feather_trace_64.h | |||
@@ -14,7 +14,7 @@ | |||
14 | * the called can freely modify the others | 14 | * the called can freely modify the others |
15 | */ | 15 | */ |
16 | #define CLOBBER_LIST "memory", "cc", "rdi", "rsi", "rdx", "rcx", \ | 16 | #define CLOBBER_LIST "memory", "cc", "rdi", "rsi", "rdx", "rcx", \ |
17 | "r8", "r9", "r10", "r11" | 17 | "r8", "r9", "r10", "r11", "rax" |
18 | 18 | ||
19 | #define ft_event(id, callback) \ | 19 | #define ft_event(id, callback) \ |
20 | __asm__ __volatile__( \ | 20 | __asm__ __volatile__( \ |
diff --git a/include/litmus/rt_domain.h b/include/litmus/rt_domain.h index c780fdfcccae..b452be1d2256 100644 --- a/include/litmus/rt_domain.h +++ b/include/litmus/rt_domain.h | |||
@@ -96,6 +96,7 @@ static inline struct task_struct* __peek_ready(rt_domain_t* rt) | |||
96 | 96 | ||
97 | static inline int is_queued(struct task_struct *t) | 97 | static inline int is_queued(struct task_struct *t) |
98 | { | 98 | { |
99 | BUG_ON(!tsk_rt(t)->heap_node); | ||
99 | return bheap_node_in_heap(tsk_rt(t)->heap_node); | 100 | return bheap_node_in_heap(tsk_rt(t)->heap_node); |
100 | } | 101 | } |
101 | 102 | ||