diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-21 09:25:41 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-21 09:25:41 -0400 |
commit | 6e0c5c609ad02f49d7e3e5edc3d65db1e233d857 (patch) | |
tree | 62517b45689b743e9976721df89634267e165011 /arch | |
parent | e40152ee1e1c7a63f4777791863215e3faa37a86 (diff) | |
parent | 960145eb829ae7a7b2d029e987f99a6be7a78d6b (diff) |
Merge branch 'master' into wip-2.6.34
Merge LitmusRT master and 2.6.34. This commit is just the plain merge
with conflicts resolved. It won't compile.
Conflicts solved:
Makefile
arch/x86/include/asm/hw_irq.h
arch/x86/include/asm/unistd_32.h
arch/x86/kernel/syscall_table_32.S
include/linux/hrtimer.h
kernel/sched.c
kernel/sched_fair.c
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/Kconfig | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/entry_arch.h | 1 | ||||
-rw-r--r-- | arch/x86/include/asm/feather_trace.h | 17 | ||||
-rw-r--r-- | arch/x86/include/asm/feather_trace_32.h | 80 | ||||
-rw-r--r-- | arch/x86/include/asm/feather_trace_64.h | 69 | ||||
-rw-r--r-- | arch/x86/include/asm/hw_irq.h | 3 | ||||
-rw-r--r-- | arch/x86/include/asm/irq_vectors.h | 5 | ||||
-rw-r--r-- | arch/x86/include/asm/processor.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/unistd_32.h | 6 | ||||
-rw-r--r-- | arch/x86/include/asm/unistd_64.h | 4 | ||||
-rw-r--r-- | arch/x86/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/intel_cacheinfo.c | 17 | ||||
-rw-r--r-- | arch/x86/kernel/entry_64.S | 2 | ||||
-rw-r--r-- | arch/x86/kernel/ft_event.c | 112 | ||||
-rw-r--r-- | arch/x86/kernel/irqinit.c | 3 | ||||
-rw-r--r-- | arch/x86/kernel/smp.c | 28 | ||||
-rw-r--r-- | arch/x86/kernel/syscall_table_32.S | 14 |
17 files changed, 366 insertions, 1 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 9458685902bd..12fbd5b65f1f 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -2125,3 +2125,5 @@ source "crypto/Kconfig" | |||
2125 | source "arch/x86/kvm/Kconfig" | 2125 | source "arch/x86/kvm/Kconfig" |
2126 | 2126 | ||
2127 | source "lib/Kconfig" | 2127 | source "lib/Kconfig" |
2128 | |||
2129 | source "litmus/Kconfig" | ||
diff --git a/arch/x86/include/asm/entry_arch.h b/arch/x86/include/asm/entry_arch.h index 8e8ec663a98f..5d07dea2ebb8 100644 --- a/arch/x86/include/asm/entry_arch.h +++ b/arch/x86/include/asm/entry_arch.h | |||
@@ -13,6 +13,7 @@ | |||
13 | BUILD_INTERRUPT(reschedule_interrupt,RESCHEDULE_VECTOR) | 13 | BUILD_INTERRUPT(reschedule_interrupt,RESCHEDULE_VECTOR) |
14 | BUILD_INTERRUPT(call_function_interrupt,CALL_FUNCTION_VECTOR) | 14 | BUILD_INTERRUPT(call_function_interrupt,CALL_FUNCTION_VECTOR) |
15 | BUILD_INTERRUPT(call_function_single_interrupt,CALL_FUNCTION_SINGLE_VECTOR) | 15 | BUILD_INTERRUPT(call_function_single_interrupt,CALL_FUNCTION_SINGLE_VECTOR) |
16 | BUILD_INTERRUPT(pull_timers_interrupt,PULL_TIMERS_VECTOR) | ||
16 | BUILD_INTERRUPT(irq_move_cleanup_interrupt,IRQ_MOVE_CLEANUP_VECTOR) | 17 | BUILD_INTERRUPT(irq_move_cleanup_interrupt,IRQ_MOVE_CLEANUP_VECTOR) |
17 | BUILD_INTERRUPT(reboot_interrupt,REBOOT_VECTOR) | 18 | BUILD_INTERRUPT(reboot_interrupt,REBOOT_VECTOR) |
18 | 19 | ||
diff --git a/arch/x86/include/asm/feather_trace.h b/arch/x86/include/asm/feather_trace.h new file mode 100644 index 000000000000..4fd31633405d --- /dev/null +++ b/arch/x86/include/asm/feather_trace.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #ifndef _ARCH_FEATHER_TRACE_H | ||
2 | #define _ARCH_FEATHER_TRACE_H | ||
3 | |||
4 | #include <asm/msr.h> | ||
5 | |||
6 | static inline unsigned long long ft_timestamp(void) | ||
7 | { | ||
8 | return __native_read_tsc(); | ||
9 | } | ||
10 | |||
11 | #ifdef CONFIG_X86_32 | ||
12 | #include "feather_trace_32.h" | ||
13 | #else | ||
14 | #include "feather_trace_64.h" | ||
15 | #endif | ||
16 | |||
17 | #endif | ||
diff --git a/arch/x86/include/asm/feather_trace_32.h b/arch/x86/include/asm/feather_trace_32.h new file mode 100644 index 000000000000..192cd09b7850 --- /dev/null +++ b/arch/x86/include/asm/feather_trace_32.h | |||
@@ -0,0 +1,80 @@ | |||
1 | /* Do not directly include this file. Include feather_trace.h instead */ | ||
2 | |||
3 | #define feather_callback __attribute__((regparm(0))) | ||
4 | |||
5 | /* | ||
6 | * make the compiler reload any register that is not saved in | ||
7 | * a cdecl function call | ||
8 | */ | ||
9 | #define CLOBBER_LIST "memory", "cc", "eax", "ecx", "edx" | ||
10 | |||
11 | #define ft_event(id, callback) \ | ||
12 | __asm__ __volatile__( \ | ||
13 | "1: jmp 2f \n\t" \ | ||
14 | " call " #callback " \n\t" \ | ||
15 | ".section __event_table, \"aw\" \n\t" \ | ||
16 | ".long " #id ", 0, 1b, 2f \n\t" \ | ||
17 | ".previous \n\t" \ | ||
18 | "2: \n\t" \ | ||
19 | : : : CLOBBER_LIST) | ||
20 | |||
21 | #define ft_event0(id, callback) \ | ||
22 | __asm__ __volatile__( \ | ||
23 | "1: jmp 2f \n\t" \ | ||
24 | " subl $4, %%esp \n\t" \ | ||
25 | " movl $" #id ", (%%esp) \n\t" \ | ||
26 | " call " #callback " \n\t" \ | ||
27 | " addl $4, %%esp \n\t" \ | ||
28 | ".section __event_table, \"aw\" \n\t" \ | ||
29 | ".long " #id ", 0, 1b, 2f \n\t" \ | ||
30 | ".previous \n\t" \ | ||
31 | "2: \n\t" \ | ||
32 | : : : CLOBBER_LIST) | ||
33 | |||
34 | #define ft_event1(id, callback, param) \ | ||
35 | __asm__ __volatile__( \ | ||
36 | "1: jmp 2f \n\t" \ | ||
37 | " subl $8, %%esp \n\t" \ | ||
38 | " movl %0, 4(%%esp) \n\t" \ | ||
39 | " movl $" #id ", (%%esp) \n\t" \ | ||
40 | " call " #callback " \n\t" \ | ||
41 | " addl $8, %%esp \n\t" \ | ||
42 | ".section __event_table, \"aw\" \n\t" \ | ||
43 | ".long " #id ", 0, 1b, 2f \n\t" \ | ||
44 | ".previous \n\t" \ | ||
45 | "2: \n\t" \ | ||
46 | : : "r" (param) : CLOBBER_LIST) | ||
47 | |||
48 | #define ft_event2(id, callback, param, param2) \ | ||
49 | __asm__ __volatile__( \ | ||
50 | "1: jmp 2f \n\t" \ | ||
51 | " subl $12, %%esp \n\t" \ | ||
52 | " movl %1, 8(%%esp) \n\t" \ | ||
53 | " movl %0, 4(%%esp) \n\t" \ | ||
54 | " movl $" #id ", (%%esp) \n\t" \ | ||
55 | " call " #callback " \n\t" \ | ||
56 | " addl $12, %%esp \n\t" \ | ||
57 | ".section __event_table, \"aw\" \n\t" \ | ||
58 | ".long " #id ", 0, 1b, 2f \n\t" \ | ||
59 | ".previous \n\t" \ | ||
60 | "2: \n\t" \ | ||
61 | : : "r" (param), "r" (param2) : CLOBBER_LIST) | ||
62 | |||
63 | |||
64 | #define ft_event3(id, callback, p, p2, p3) \ | ||
65 | __asm__ __volatile__( \ | ||
66 | "1: jmp 2f \n\t" \ | ||
67 | " subl $16, %%esp \n\t" \ | ||
68 | " movl %2, 12(%%esp) \n\t" \ | ||
69 | " movl %1, 8(%%esp) \n\t" \ | ||
70 | " movl %0, 4(%%esp) \n\t" \ | ||
71 | " movl $" #id ", (%%esp) \n\t" \ | ||
72 | " call " #callback " \n\t" \ | ||
73 | " addl $16, %%esp \n\t" \ | ||
74 | ".section __event_table, \"aw\" \n\t" \ | ||
75 | ".long " #id ", 0, 1b, 2f \n\t" \ | ||
76 | ".previous \n\t" \ | ||
77 | "2: \n\t" \ | ||
78 | : : "r" (p), "r" (p2), "r" (p3) : CLOBBER_LIST) | ||
79 | |||
80 | #define __ARCH_HAS_FEATHER_TRACE | ||
diff --git a/arch/x86/include/asm/feather_trace_64.h b/arch/x86/include/asm/feather_trace_64.h new file mode 100644 index 000000000000..1cffa4eec5f4 --- /dev/null +++ b/arch/x86/include/asm/feather_trace_64.h | |||
@@ -0,0 +1,69 @@ | |||
1 | /* Do not directly include this file. Include feather_trace.h instead */ | ||
2 | |||
3 | /* regparm is the default on x86_64 */ | ||
4 | #define feather_callback | ||
5 | |||
6 | # define _EVENT_TABLE(id,from,to) \ | ||
7 | ".section __event_table, \"aw\"\n\t" \ | ||
8 | ".balign 8\n\t" \ | ||
9 | ".quad " #id ", 0, " #from ", " #to " \n\t" \ | ||
10 | ".previous \n\t" | ||
11 | |||
12 | /* | ||
13 | * x86_64 callee only owns rbp, rbx, r12 -> r15 | ||
14 | * the called can freely modify the others | ||
15 | */ | ||
16 | #define CLOBBER_LIST "memory", "cc", "rdi", "rsi", "rdx", "rcx", \ | ||
17 | "r8", "r9", "r10", "r11", "rax" | ||
18 | |||
19 | #define ft_event(id, callback) \ | ||
20 | __asm__ __volatile__( \ | ||
21 | "1: jmp 2f \n\t" \ | ||
22 | " call " #callback " \n\t" \ | ||
23 | _EVENT_TABLE(id,1b,2f) \ | ||
24 | "2: \n\t" \ | ||
25 | : : : CLOBBER_LIST) | ||
26 | |||
27 | #define ft_event0(id, callback) \ | ||
28 | __asm__ __volatile__( \ | ||
29 | "1: jmp 2f \n\t" \ | ||
30 | " movq $" #id ", %%rdi \n\t" \ | ||
31 | " call " #callback " \n\t" \ | ||
32 | _EVENT_TABLE(id,1b,2f) \ | ||
33 | "2: \n\t" \ | ||
34 | : : : CLOBBER_LIST) | ||
35 | |||
36 | #define ft_event1(id, callback, param) \ | ||
37 | __asm__ __volatile__( \ | ||
38 | "1: jmp 2f \n\t" \ | ||
39 | " movq %0, %%rsi \n\t" \ | ||
40 | " movq $" #id ", %%rdi \n\t" \ | ||
41 | " call " #callback " \n\t" \ | ||
42 | _EVENT_TABLE(id,1b,2f) \ | ||
43 | "2: \n\t" \ | ||
44 | : : "r" (param) : CLOBBER_LIST) | ||
45 | |||
46 | #define ft_event2(id, callback, param, param2) \ | ||
47 | __asm__ __volatile__( \ | ||
48 | "1: jmp 2f \n\t" \ | ||
49 | " movq %1, %%rdx \n\t" \ | ||
50 | " movq %0, %%rsi \n\t" \ | ||
51 | " movq $" #id ", %%rdi \n\t" \ | ||
52 | " call " #callback " \n\t" \ | ||
53 | _EVENT_TABLE(id,1b,2f) \ | ||
54 | "2: \n\t" \ | ||
55 | : : "r" (param), "r" (param2) : CLOBBER_LIST) | ||
56 | |||
57 | #define ft_event3(id, callback, p, p2, p3) \ | ||
58 | __asm__ __volatile__( \ | ||
59 | "1: jmp 2f \n\t" \ | ||
60 | " movq %2, %%rcx \n\t" \ | ||
61 | " movq %1, %%rdx \n\t" \ | ||
62 | " movq %0, %%rsi \n\t" \ | ||
63 | " movq $" #id ", %%rdi \n\t" \ | ||
64 | " call " #callback " \n\t" \ | ||
65 | _EVENT_TABLE(id,1b,2f) \ | ||
66 | "2: \n\t" \ | ||
67 | : : "r" (p), "r" (p2), "r" (p3) : CLOBBER_LIST) | ||
68 | |||
69 | #define __ARCH_HAS_FEATHER_TRACE | ||
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h index 46c0fe05f230..c17411503f28 100644 --- a/arch/x86/include/asm/hw_irq.h +++ b/arch/x86/include/asm/hw_irq.h | |||
@@ -53,6 +53,8 @@ extern void threshold_interrupt(void); | |||
53 | extern void call_function_interrupt(void); | 53 | extern void call_function_interrupt(void); |
54 | extern void call_function_single_interrupt(void); | 54 | extern void call_function_single_interrupt(void); |
55 | 55 | ||
56 | extern void pull_timers_interrupt(void); | ||
57 | |||
56 | /* IOAPIC */ | 58 | /* IOAPIC */ |
57 | #define IO_APIC_IRQ(x) (((x) >= NR_IRQS_LEGACY) || ((1<<(x)) & io_apic_irqs)) | 59 | #define IO_APIC_IRQ(x) (((x) >= NR_IRQS_LEGACY) || ((1<<(x)) & io_apic_irqs)) |
58 | extern unsigned long io_apic_irqs; | 60 | extern unsigned long io_apic_irqs; |
@@ -122,6 +124,7 @@ extern asmlinkage void smp_irq_move_cleanup_interrupt(void); | |||
122 | extern void smp_reschedule_interrupt(struct pt_regs *); | 124 | extern void smp_reschedule_interrupt(struct pt_regs *); |
123 | extern void smp_call_function_interrupt(struct pt_regs *); | 125 | extern void smp_call_function_interrupt(struct pt_regs *); |
124 | extern void smp_call_function_single_interrupt(struct pt_regs *); | 126 | extern void smp_call_function_single_interrupt(struct pt_regs *); |
127 | extern void smp_pull_timers_interrupt(struct pt_regs *); | ||
125 | #ifdef CONFIG_X86_32 | 128 | #ifdef CONFIG_X86_32 |
126 | extern void smp_invalidate_interrupt(struct pt_regs *); | 129 | extern void smp_invalidate_interrupt(struct pt_regs *); |
127 | #else | 130 | #else |
diff --git a/arch/x86/include/asm/irq_vectors.h b/arch/x86/include/asm/irq_vectors.h index 8767d99c4f64..bb5318bbe0e4 100644 --- a/arch/x86/include/asm/irq_vectors.h +++ b/arch/x86/include/asm/irq_vectors.h | |||
@@ -109,6 +109,11 @@ | |||
109 | #define LOCAL_TIMER_VECTOR 0xef | 109 | #define LOCAL_TIMER_VECTOR 0xef |
110 | 110 | ||
111 | /* | 111 | /* |
112 | * LITMUS^RT pull timers IRQ vector | ||
113 | */ | ||
114 | #define PULL_TIMERS_VECTOR 0xee | ||
115 | |||
116 | /* | ||
112 | * Generic system vector for platform specific use | 117 | * Generic system vector for platform specific use |
113 | */ | 118 | */ |
114 | #define X86_PLATFORM_IPI_VECTOR 0xed | 119 | #define X86_PLATFORM_IPI_VECTOR 0xed |
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index b753ea59703a..91d323f47364 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -173,6 +173,8 @@ extern void print_cpu_info(struct cpuinfo_x86 *); | |||
173 | extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c); | 173 | extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c); |
174 | extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); | 174 | extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); |
175 | extern unsigned short num_cache_leaves; | 175 | extern unsigned short num_cache_leaves; |
176 | extern int get_shared_cpu_map(cpumask_var_t mask, | ||
177 | unsigned int cpu, int index); | ||
176 | 178 | ||
177 | extern void detect_extended_topology(struct cpuinfo_x86 *c); | 179 | extern void detect_extended_topology(struct cpuinfo_x86 *c); |
178 | extern void detect_ht(struct cpuinfo_x86 *c); | 180 | extern void detect_ht(struct cpuinfo_x86 *c); |
diff --git a/arch/x86/include/asm/unistd_32.h b/arch/x86/include/asm/unistd_32.h index beb9b5f8f8a4..4f61e8b0715a 100644 --- a/arch/x86/include/asm/unistd_32.h +++ b/arch/x86/include/asm/unistd_32.h | |||
@@ -344,9 +344,13 @@ | |||
344 | #define __NR_perf_event_open 336 | 344 | #define __NR_perf_event_open 336 |
345 | #define __NR_recvmmsg 337 | 345 | #define __NR_recvmmsg 337 |
346 | 346 | ||
347 | #define __NR_LITMUS 338 | ||
348 | |||
349 | #include "litmus/unistd_32.h" | ||
350 | |||
347 | #ifdef __KERNEL__ | 351 | #ifdef __KERNEL__ |
348 | 352 | ||
349 | #define NR_syscalls 338 | 353 | #define NR_syscalls 339 + NR_litmus_syscalls |
350 | 354 | ||
351 | #define __ARCH_WANT_IPC_PARSE_VERSION | 355 | #define __ARCH_WANT_IPC_PARSE_VERSION |
352 | #define __ARCH_WANT_OLD_READDIR | 356 | #define __ARCH_WANT_OLD_READDIR |
diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h index ff4307b0e81e..b21c3b269aac 100644 --- a/arch/x86/include/asm/unistd_64.h +++ b/arch/x86/include/asm/unistd_64.h | |||
@@ -664,6 +664,10 @@ __SYSCALL(__NR_perf_event_open, sys_perf_event_open) | |||
664 | #define __NR_recvmmsg 299 | 664 | #define __NR_recvmmsg 299 |
665 | __SYSCALL(__NR_recvmmsg, sys_recvmmsg) | 665 | __SYSCALL(__NR_recvmmsg, sys_recvmmsg) |
666 | 666 | ||
667 | #define __NR_LITMUS 299 | ||
668 | |||
669 | #include "litmus/unistd_64.h" | ||
670 | |||
667 | #ifndef __NO_STUBS | 671 | #ifndef __NO_STUBS |
668 | #define __ARCH_WANT_OLD_READDIR | 672 | #define __ARCH_WANT_OLD_READDIR |
669 | #define __ARCH_WANT_OLD_STAT | 673 | #define __ARCH_WANT_OLD_STAT |
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 4c58352209e0..d09934e22ca5 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile | |||
@@ -117,6 +117,8 @@ obj-$(CONFIG_X86_CHECK_BIOS_CORRUPTION) += check.o | |||
117 | 117 | ||
118 | obj-$(CONFIG_SWIOTLB) += pci-swiotlb.o | 118 | obj-$(CONFIG_SWIOTLB) += pci-swiotlb.o |
119 | 119 | ||
120 | obj-$(CONFIG_FEATHER_TRACE) += ft_event.o | ||
121 | |||
120 | ### | 122 | ### |
121 | # 64 bit specific files | 123 | # 64 bit specific files |
122 | ifeq ($(CONFIG_X86_64),y) | 124 | ifeq ($(CONFIG_X86_64),y) |
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index 95962a93f99a..94d8e475744c 100644 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c | |||
@@ -632,6 +632,23 @@ unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c) | |||
632 | static DEFINE_PER_CPU(struct _cpuid4_info *, ici_cpuid4_info); | 632 | static DEFINE_PER_CPU(struct _cpuid4_info *, ici_cpuid4_info); |
633 | #define CPUID4_INFO_IDX(x, y) (&((per_cpu(ici_cpuid4_info, x))[y])) | 633 | #define CPUID4_INFO_IDX(x, y) (&((per_cpu(ici_cpuid4_info, x))[y])) |
634 | 634 | ||
635 | /* returns CPUs that share the index cache with cpu */ | ||
636 | int get_shared_cpu_map(cpumask_var_t mask, unsigned int cpu, int index) | ||
637 | { | ||
638 | int ret = 0; | ||
639 | struct _cpuid4_info *this_leaf; | ||
640 | |||
641 | if (index >= num_cache_leaves) { | ||
642 | index = num_cache_leaves - 1; | ||
643 | ret = index; | ||
644 | } | ||
645 | |||
646 | this_leaf = CPUID4_INFO_IDX(cpu,index); | ||
647 | cpumask_copy(mask, to_cpumask(this_leaf->shared_cpu_map)); | ||
648 | |||
649 | return ret; | ||
650 | } | ||
651 | |||
635 | #ifdef CONFIG_SMP | 652 | #ifdef CONFIG_SMP |
636 | static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index) | 653 | static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index) |
637 | { | 654 | { |
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 0697ff139837..b9ec6cd7796f 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S | |||
@@ -1016,6 +1016,8 @@ apicinterrupt CALL_FUNCTION_VECTOR \ | |||
1016 | call_function_interrupt smp_call_function_interrupt | 1016 | call_function_interrupt smp_call_function_interrupt |
1017 | apicinterrupt RESCHEDULE_VECTOR \ | 1017 | apicinterrupt RESCHEDULE_VECTOR \ |
1018 | reschedule_interrupt smp_reschedule_interrupt | 1018 | reschedule_interrupt smp_reschedule_interrupt |
1019 | apicinterrupt PULL_TIMERS_VECTOR \ | ||
1020 | pull_timers_interrupt smp_pull_timers_interrupt | ||
1019 | #endif | 1021 | #endif |
1020 | 1022 | ||
1021 | apicinterrupt ERROR_APIC_VECTOR \ | 1023 | apicinterrupt ERROR_APIC_VECTOR \ |
diff --git a/arch/x86/kernel/ft_event.c b/arch/x86/kernel/ft_event.c new file mode 100644 index 000000000000..e07ee30dfff9 --- /dev/null +++ b/arch/x86/kernel/ft_event.c | |||
@@ -0,0 +1,112 @@ | |||
1 | #include <linux/types.h> | ||
2 | |||
3 | #include <litmus/feather_trace.h> | ||
4 | |||
5 | #ifdef __ARCH_HAS_FEATHER_TRACE | ||
6 | /* the feather trace management functions assume | ||
7 | * exclusive access to the event table | ||
8 | */ | ||
9 | |||
10 | |||
11 | #define BYTE_JUMP 0xeb | ||
12 | #define BYTE_JUMP_LEN 0x02 | ||
13 | |||
14 | /* for each event, there is an entry in the event table */ | ||
15 | struct trace_event { | ||
16 | long id; | ||
17 | long count; | ||
18 | long start_addr; | ||
19 | long end_addr; | ||
20 | }; | ||
21 | |||
22 | extern struct trace_event __start___event_table[]; | ||
23 | extern struct trace_event __stop___event_table[]; | ||
24 | |||
25 | int ft_enable_event(unsigned long id) | ||
26 | { | ||
27 | struct trace_event* te = __start___event_table; | ||
28 | int count = 0; | ||
29 | char* delta; | ||
30 | unsigned char* instr; | ||
31 | |||
32 | while (te < __stop___event_table) { | ||
33 | if (te->id == id && ++te->count == 1) { | ||
34 | instr = (unsigned char*) te->start_addr; | ||
35 | /* make sure we don't clobber something wrong */ | ||
36 | if (*instr == BYTE_JUMP) { | ||
37 | delta = (((unsigned char*) te->start_addr) + 1); | ||
38 | *delta = 0; | ||
39 | } | ||
40 | } | ||
41 | if (te->id == id) | ||
42 | count++; | ||
43 | te++; | ||
44 | } | ||
45 | |||
46 | printk(KERN_DEBUG "ft_enable_event: enabled %d events\n", count); | ||
47 | return count; | ||
48 | } | ||
49 | |||
50 | int ft_disable_event(unsigned long id) | ||
51 | { | ||
52 | struct trace_event* te = __start___event_table; | ||
53 | int count = 0; | ||
54 | char* delta; | ||
55 | unsigned char* instr; | ||
56 | |||
57 | while (te < __stop___event_table) { | ||
58 | if (te->id == id && --te->count == 0) { | ||
59 | instr = (unsigned char*) te->start_addr; | ||
60 | if (*instr == BYTE_JUMP) { | ||
61 | delta = (((unsigned char*) te->start_addr) + 1); | ||
62 | *delta = te->end_addr - te->start_addr - | ||
63 | BYTE_JUMP_LEN; | ||
64 | } | ||
65 | } | ||
66 | if (te->id == id) | ||
67 | count++; | ||
68 | te++; | ||
69 | } | ||
70 | |||
71 | printk(KERN_DEBUG "ft_disable_event: disabled %d events\n", count); | ||
72 | return count; | ||
73 | } | ||
74 | |||
75 | int ft_disable_all_events(void) | ||
76 | { | ||
77 | struct trace_event* te = __start___event_table; | ||
78 | int count = 0; | ||
79 | char* delta; | ||
80 | unsigned char* instr; | ||
81 | |||
82 | while (te < __stop___event_table) { | ||
83 | if (te->count) { | ||
84 | instr = (unsigned char*) te->start_addr; | ||
85 | if (*instr == BYTE_JUMP) { | ||
86 | delta = (((unsigned char*) te->start_addr) | ||
87 | + 1); | ||
88 | *delta = te->end_addr - te->start_addr - | ||
89 | BYTE_JUMP_LEN; | ||
90 | te->count = 0; | ||
91 | count++; | ||
92 | } | ||
93 | } | ||
94 | te++; | ||
95 | } | ||
96 | return count; | ||
97 | } | ||
98 | |||
99 | int ft_is_event_enabled(unsigned long id) | ||
100 | { | ||
101 | struct trace_event* te = __start___event_table; | ||
102 | |||
103 | while (te < __stop___event_table) { | ||
104 | if (te->id == id) | ||
105 | return te->count; | ||
106 | te++; | ||
107 | } | ||
108 | return 0; | ||
109 | } | ||
110 | |||
111 | #endif | ||
112 | |||
diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c index 0ed2d300cd46..a760ce1a2c0d 100644 --- a/arch/x86/kernel/irqinit.c +++ b/arch/x86/kernel/irqinit.c | |||
@@ -189,6 +189,9 @@ static void __init smp_intr_init(void) | |||
189 | alloc_intr_gate(CALL_FUNCTION_SINGLE_VECTOR, | 189 | alloc_intr_gate(CALL_FUNCTION_SINGLE_VECTOR, |
190 | call_function_single_interrupt); | 190 | call_function_single_interrupt); |
191 | 191 | ||
192 | /* IPI for hrtimer pulling on remote cpus */ | ||
193 | alloc_intr_gate(PULL_TIMERS_VECTOR, pull_timers_interrupt); | ||
194 | |||
192 | /* Low priority IPI to cleanup after moving an irq */ | 195 | /* Low priority IPI to cleanup after moving an irq */ |
193 | set_intr_gate(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt); | 196 | set_intr_gate(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt); |
194 | set_bit(IRQ_MOVE_CLEANUP_VECTOR, used_vectors); | 197 | set_bit(IRQ_MOVE_CLEANUP_VECTOR, used_vectors); |
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c index d801210945d6..97af589a5c0c 100644 --- a/arch/x86/kernel/smp.c +++ b/arch/x86/kernel/smp.c | |||
@@ -23,6 +23,9 @@ | |||
23 | #include <linux/cpu.h> | 23 | #include <linux/cpu.h> |
24 | #include <linux/gfp.h> | 24 | #include <linux/gfp.h> |
25 | 25 | ||
26 | #include <litmus/litmus.h> | ||
27 | #include <litmus/trace.h> | ||
28 | |||
26 | #include <asm/mtrr.h> | 29 | #include <asm/mtrr.h> |
27 | #include <asm/tlbflush.h> | 30 | #include <asm/tlbflush.h> |
28 | #include <asm/mmu_context.h> | 31 | #include <asm/mmu_context.h> |
@@ -118,6 +121,7 @@ static void native_smp_send_reschedule(int cpu) | |||
118 | WARN_ON(1); | 121 | WARN_ON(1); |
119 | return; | 122 | return; |
120 | } | 123 | } |
124 | TS_SEND_RESCHED_START(cpu); | ||
121 | apic->send_IPI_mask(cpumask_of(cpu), RESCHEDULE_VECTOR); | 125 | apic->send_IPI_mask(cpumask_of(cpu), RESCHEDULE_VECTOR); |
122 | } | 126 | } |
123 | 127 | ||
@@ -147,6 +151,16 @@ void native_send_call_func_ipi(const struct cpumask *mask) | |||
147 | free_cpumask_var(allbutself); | 151 | free_cpumask_var(allbutself); |
148 | } | 152 | } |
149 | 153 | ||
154 | /* trigger timers on remote cpu */ | ||
155 | void smp_send_pull_timers(int cpu) | ||
156 | { | ||
157 | if (unlikely(cpu_is_offline(cpu))) { | ||
158 | WARN_ON(1); | ||
159 | return; | ||
160 | } | ||
161 | apic->send_IPI_mask(cpumask_of(cpu), PULL_TIMERS_VECTOR); | ||
162 | } | ||
163 | |||
150 | /* | 164 | /* |
151 | * this function calls the 'stop' function on all other CPUs in the system. | 165 | * this function calls the 'stop' function on all other CPUs in the system. |
152 | */ | 166 | */ |
@@ -198,7 +212,12 @@ static void native_smp_send_stop(void) | |||
198 | void smp_reschedule_interrupt(struct pt_regs *regs) | 212 | void smp_reschedule_interrupt(struct pt_regs *regs) |
199 | { | 213 | { |
200 | ack_APIC_irq(); | 214 | ack_APIC_irq(); |
215 | /* LITMUS^RT needs this interrupt to proper reschedule | ||
216 | * on this cpu | ||
217 | */ | ||
218 | set_tsk_need_resched(current); | ||
201 | inc_irq_stat(irq_resched_count); | 219 | inc_irq_stat(irq_resched_count); |
220 | TS_SEND_RESCHED_END; | ||
202 | /* | 221 | /* |
203 | * KVM uses this interrupt to force a cpu out of guest mode | 222 | * KVM uses this interrupt to force a cpu out of guest mode |
204 | */ | 223 | */ |
@@ -222,6 +241,15 @@ void smp_call_function_single_interrupt(struct pt_regs *regs) | |||
222 | irq_exit(); | 241 | irq_exit(); |
223 | } | 242 | } |
224 | 243 | ||
244 | extern void hrtimer_pull(void); | ||
245 | |||
246 | void smp_pull_timers_interrupt(struct pt_regs *regs) | ||
247 | { | ||
248 | ack_APIC_irq(); | ||
249 | TRACE("pull timer interrupt\n"); | ||
250 | hrtimer_pull(); | ||
251 | } | ||
252 | |||
225 | struct smp_ops smp_ops = { | 253 | struct smp_ops smp_ops = { |
226 | .smp_prepare_boot_cpu = native_smp_prepare_boot_cpu, | 254 | .smp_prepare_boot_cpu = native_smp_prepare_boot_cpu, |
227 | .smp_prepare_cpus = native_smp_prepare_cpus, | 255 | .smp_prepare_cpus = native_smp_prepare_cpus, |
diff --git a/arch/x86/kernel/syscall_table_32.S b/arch/x86/kernel/syscall_table_32.S index 8b3729341216..5da9a68546b7 100644 --- a/arch/x86/kernel/syscall_table_32.S +++ b/arch/x86/kernel/syscall_table_32.S | |||
@@ -337,3 +337,17 @@ ENTRY(sys_call_table) | |||
337 | .long sys_rt_tgsigqueueinfo /* 335 */ | 337 | .long sys_rt_tgsigqueueinfo /* 335 */ |
338 | .long sys_perf_event_open | 338 | .long sys_perf_event_open |
339 | .long sys_recvmmsg | 339 | .long sys_recvmmsg |
340 | .long sys_set_rt_task_param /* LITMUS^RT 338 */ | ||
341 | .long sys_get_rt_task_param | ||
342 | .long sys_complete_job | ||
343 | .long sys_od_open | ||
344 | .long sys_od_close | ||
345 | .long sys_fmlp_down | ||
346 | .long sys_fmlp_up | ||
347 | .long sys_srp_down | ||
348 | .long sys_srp_up | ||
349 | .long sys_query_job_no | ||
350 | .long sys_wait_for_job_release | ||
351 | .long sys_wait_for_ts_release | ||
352 | .long sys_release_ts | ||
353 | .long sys_null_call | ||