]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/blob - rt-patches/0110-softirq-Disable-softirq-stacks-for-RT.patch
Fix memguard and related syscalls
[hercules2020/nv-tegra/linux-4.4.git] / rt-patches / 0110-softirq-Disable-softirq-stacks-for-RT.patch
1 From 8967b193c05d8862dec216c6d90f524f2642da70 Mon Sep 17 00:00:00 2001
2 From: Thomas Gleixner <tglx@linutronix.de>
3 Date: Mon, 18 Jul 2011 13:59:17 +0200
4 Subject: [PATCH 110/366] softirq: Disable softirq stacks for RT
5
6 Disable extra stacks for softirqs. We want to preempt softirqs and
7 having them on special IRQ-stack does not make this easier.
8
9 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
10 ---
11  arch/powerpc/kernel/irq.c     | 2 ++
12  arch/powerpc/kernel/misc_32.S | 2 ++
13  arch/powerpc/kernel/misc_64.S | 2 ++
14  arch/sh/kernel/irq.c          | 2 ++
15  arch/sparc/kernel/irq_64.c    | 2 ++
16  arch/x86/entry/entry_64.S     | 2 ++
17  arch/x86/kernel/irq_32.c      | 2 ++
18  include/linux/interrupt.h     | 2 +-
19  8 files changed, 15 insertions(+), 1 deletion(-)
20
21 diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
22 index 290559d..070afa6 100644
23 --- a/arch/powerpc/kernel/irq.c
24 +++ b/arch/powerpc/kernel/irq.c
25 @@ -614,6 +614,7 @@ void irq_ctx_init(void)
26         }
27  }
28  
29 +#ifndef CONFIG_PREEMPT_RT_FULL
30  void do_softirq_own_stack(void)
31  {
32         struct thread_info *curtp, *irqtp;
33 @@ -631,6 +632,7 @@ void do_softirq_own_stack(void)
34         if (irqtp->flags)
35                 set_bits(irqtp->flags, &curtp->flags);
36  }
37 +#endif
38  
39  irq_hw_number_t virq_to_hw(unsigned int virq)
40  {
41 diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S
42 index ed3ab50..8b26141 100644
43 --- a/arch/powerpc/kernel/misc_32.S
44 +++ b/arch/powerpc/kernel/misc_32.S
45 @@ -40,6 +40,7 @@
46   * We store the saved ksp_limit in the unused part
47   * of the STACK_FRAME_OVERHEAD
48   */
49 +#ifndef CONFIG_PREEMPT_RT_FULL
50  _GLOBAL(call_do_softirq)
51         mflr    r0
52         stw     r0,4(r1)
53 @@ -56,6 +57,7 @@ _GLOBAL(call_do_softirq)
54         stw     r10,THREAD+KSP_LIMIT(r2)
55         mtlr    r0
56         blr
57 +#endif
58  
59  /*
60   * void call_do_irq(struct pt_regs *regs, struct thread_info *irqtp);
61 diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
62 index db475d4..96b7ef8 100644
63 --- a/arch/powerpc/kernel/misc_64.S
64 +++ b/arch/powerpc/kernel/misc_64.S
65 @@ -30,6 +30,7 @@
66  
67         .text
68  
69 +#ifndef CONFIG_PREEMPT_RT_FULL
70  _GLOBAL(call_do_softirq)
71         mflr    r0
72         std     r0,16(r1)
73 @@ -40,6 +41,7 @@ _GLOBAL(call_do_softirq)
74         ld      r0,16(r1)
75         mtlr    r0
76         blr
77 +#endif
78  
79  _GLOBAL(call_do_irq)
80         mflr    r0
81 diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c
82 index 6c0378c..abd58b4 100644
83 --- a/arch/sh/kernel/irq.c
84 +++ b/arch/sh/kernel/irq.c
85 @@ -147,6 +147,7 @@ void irq_ctx_exit(int cpu)
86         hardirq_ctx[cpu] = NULL;
87  }
88  
89 +#ifndef CONFIG_PREEMPT_RT_FULL
90  void do_softirq_own_stack(void)
91  {
92         struct thread_info *curctx;
93 @@ -174,6 +175,7 @@ void do_softirq_own_stack(void)
94                   "r5", "r6", "r7", "r8", "r9", "r15", "t", "pr"
95         );
96  }
97 +#endif
98  #else
99  static inline void handle_one_irq(unsigned int irq)
100  {
101 diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c
102 index e22416c..d359de7 100644
103 --- a/arch/sparc/kernel/irq_64.c
104 +++ b/arch/sparc/kernel/irq_64.c
105 @@ -854,6 +854,7 @@ void __irq_entry handler_irq(int pil, struct pt_regs *regs)
106         set_irq_regs(old_regs);
107  }
108  
109 +#ifndef CONFIG_PREEMPT_RT_FULL
110  void do_softirq_own_stack(void)
111  {
112         void *orig_sp, *sp = softirq_stack[smp_processor_id()];
113 @@ -868,6 +869,7 @@ void do_softirq_own_stack(void)
114         __asm__ __volatile__("mov %0, %%sp"
115                              : : "r" (orig_sp));
116  }
117 +#endif
118  
119  #ifdef CONFIG_HOTPLUG_CPU
120  void fixup_irqs(void)
121 diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
122 index a55697d..5783f8f 100644
123 --- a/arch/x86/entry/entry_64.S
124 +++ b/arch/x86/entry/entry_64.S
125 @@ -867,6 +867,7 @@ bad_gs:
126         jmp     2b
127         .previous
128  
129 +#ifndef CONFIG_PREEMPT_RT_FULL
130  /* Call softirq on interrupt stack. Interrupts are off. */
131  ENTRY(do_softirq_own_stack)
132         pushq   %rbp
133 @@ -879,6 +880,7 @@ ENTRY(do_softirq_own_stack)
134         decl    PER_CPU_VAR(irq_count)
135         ret
136  END(do_softirq_own_stack)
137 +#endif
138  
139  #ifdef CONFIG_XEN
140  idtentry xen_hypervisor_callback xen_do_hypervisor_callback has_error_code=0
141 diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c
142 index 38da8f2..ce71f70 100644
143 --- a/arch/x86/kernel/irq_32.c
144 +++ b/arch/x86/kernel/irq_32.c
145 @@ -128,6 +128,7 @@ void irq_ctx_init(int cpu)
146                cpu, per_cpu(hardirq_stack, cpu),  per_cpu(softirq_stack, cpu));
147  }
148  
149 +#ifndef CONFIG_PREEMPT_RT_FULL
150  void do_softirq_own_stack(void)
151  {
152         struct thread_info *curstk;
153 @@ -146,6 +147,7 @@ void do_softirq_own_stack(void)
154  
155         call_on_stack(__do_softirq, isp);
156  }
157 +#endif
158  
159  bool handle_irq(struct irq_desc *desc, struct pt_regs *regs)
160  {
161 diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
162 index 8564dba..44f401a 100644
163 --- a/include/linux/interrupt.h
164 +++ b/include/linux/interrupt.h
165 @@ -446,7 +446,7 @@ struct softirq_action
166  asmlinkage void do_softirq(void);
167  asmlinkage void __do_softirq(void);
168  
169 -#ifdef __ARCH_HAS_DO_SOFTIRQ
170 +#if defined(__ARCH_HAS_DO_SOFTIRQ) && !defined(CONFIG_PREEMPT_RT_FULL)
171  void do_softirq_own_stack(void);
172  #else
173  static inline void do_softirq_own_stack(void)
174 -- 
175 1.9.1
176