Skip to content

Commit 28a4573

Browse files
author
Alex Shi
committed
Merge tag 'v4.4.62' into linux-linaro-lsk-v4.4
This is the 4.4.62 stable release
2 parents 4f380dc + a80c068 commit 28a4573

22 files changed

Lines changed: 293 additions & 96 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION = 4
22
PATCHLEVEL = 4
3-
SUBLEVEL = 61
3+
SUBLEVEL = 62
44
EXTRAVERSION =
55
NAME = Blurry Fish Butt
66

arch/mips/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ config MIPS
99
select HAVE_CONTEXT_TRACKING
1010
select HAVE_GENERIC_DMA_COHERENT
1111
select HAVE_IDE
12+
select HAVE_IRQ_EXIT_ON_IRQ_STACK
1213
select HAVE_OPROFILE
1314
select HAVE_PERF_EVENTS
1415
select PERF_USE_VMALLOC

arch/mips/include/asm/irq.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@
1717

1818
#include <irq.h>
1919

20+
#define IRQ_STACK_SIZE THREAD_SIZE
21+
22+
extern void *irq_stack[NR_CPUS];
23+
24+
static inline bool on_irq_stack(int cpu, unsigned long sp)
25+
{
26+
unsigned long low = (unsigned long)irq_stack[cpu];
27+
unsigned long high = low + IRQ_STACK_SIZE;
28+
29+
return (low <= sp && sp <= high);
30+
}
31+
2032
#ifdef CONFIG_I8259
2133
static inline int irq_canonicalize(int irq)
2234
{

arch/mips/include/asm/stackframe.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,19 @@
216216
LONG_S $25, PT_R25(sp)
217217
LONG_S $28, PT_R28(sp)
218218
LONG_S $31, PT_R31(sp)
219+
220+
/* Set thread_info if we're coming from user mode */
221+
mfc0 k0, CP0_STATUS
222+
sll k0, 3 /* extract cu0 bit */
223+
bltz k0, 9f
224+
219225
ori $28, sp, _THREAD_MASK
220226
xori $28, _THREAD_MASK
221227
#ifdef CONFIG_CPU_CAVIUM_OCTEON
222228
.set mips64
223229
pref 0, 0($28) /* Prefetch the current pointer */
224230
#endif
231+
9:
225232
.set pop
226233
.endm
227234

arch/mips/kernel/asm-offsets.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ void output_thread_info_defines(void)
101101
OFFSET(TI_REGS, thread_info, regs);
102102
DEFINE(_THREAD_SIZE, THREAD_SIZE);
103103
DEFINE(_THREAD_MASK, THREAD_MASK);
104+
DEFINE(_IRQ_STACK_SIZE, IRQ_STACK_SIZE);
104105
BLANK();
105106
}
106107

arch/mips/kernel/genex.S

Lines changed: 76 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,44 @@ NESTED(handle_int, PT_SIZE, sp)
188188

189189
LONG_L s0, TI_REGS($28)
190190
LONG_S sp, TI_REGS($28)
191-
PTR_LA ra, ret_from_irq
192-
PTR_LA v0, plat_irq_dispatch
193-
jr v0
191+
192+
/*
193+
* SAVE_ALL ensures we are using a valid kernel stack for the thread.
194+
* Check if we are already using the IRQ stack.
195+
*/
196+
move s1, sp # Preserve the sp
197+
198+
/* Get IRQ stack for this CPU */
199+
ASM_CPUID_MFC0 k0, ASM_SMP_CPUID_REG
200+
#if defined(CONFIG_32BIT) || defined(KBUILD_64BIT_SYM32)
201+
lui k1, %hi(irq_stack)
202+
#else
203+
lui k1, %highest(irq_stack)
204+
daddiu k1, %higher(irq_stack)
205+
dsll k1, 16
206+
daddiu k1, %hi(irq_stack)
207+
dsll k1, 16
208+
#endif
209+
LONG_SRL k0, SMP_CPUID_PTRSHIFT
210+
LONG_ADDU k1, k0
211+
LONG_L t0, %lo(irq_stack)(k1)
212+
213+
# Check if already on IRQ stack
214+
PTR_LI t1, ~(_THREAD_SIZE-1)
215+
and t1, t1, sp
216+
beq t0, t1, 2f
217+
218+
/* Switch to IRQ stack */
219+
li t1, _IRQ_STACK_SIZE
220+
PTR_ADD sp, t0, t1
221+
222+
2:
223+
jal plat_irq_dispatch
224+
225+
/* Restore sp */
226+
move sp, s1
227+
228+
j ret_from_irq
194229
#ifdef CONFIG_CPU_MICROMIPS
195230
nop
196231
#endif
@@ -263,8 +298,44 @@ NESTED(except_vec_vi_handler, 0, sp)
263298

264299
LONG_L s0, TI_REGS($28)
265300
LONG_S sp, TI_REGS($28)
266-
PTR_LA ra, ret_from_irq
267-
jr v0
301+
302+
/*
303+
* SAVE_ALL ensures we are using a valid kernel stack for the thread.
304+
* Check if we are already using the IRQ stack.
305+
*/
306+
move s1, sp # Preserve the sp
307+
308+
/* Get IRQ stack for this CPU */
309+
ASM_CPUID_MFC0 k0, ASM_SMP_CPUID_REG
310+
#if defined(CONFIG_32BIT) || defined(KBUILD_64BIT_SYM32)
311+
lui k1, %hi(irq_stack)
312+
#else
313+
lui k1, %highest(irq_stack)
314+
daddiu k1, %higher(irq_stack)
315+
dsll k1, 16
316+
daddiu k1, %hi(irq_stack)
317+
dsll k1, 16
318+
#endif
319+
LONG_SRL k0, SMP_CPUID_PTRSHIFT
320+
LONG_ADDU k1, k0
321+
LONG_L t0, %lo(irq_stack)(k1)
322+
323+
# Check if already on IRQ stack
324+
PTR_LI t1, ~(_THREAD_SIZE-1)
325+
and t1, t1, sp
326+
beq t0, t1, 2f
327+
328+
/* Switch to IRQ stack */
329+
li t1, _IRQ_STACK_SIZE
330+
PTR_ADD sp, t0, t1
331+
332+
2:
333+
jalr v0
334+
335+
/* Restore sp */
336+
move sp, s1
337+
338+
j ret_from_irq
268339
END(except_vec_vi_handler)
269340

270341
/*

arch/mips/kernel/irq.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#include <linux/atomic.h>
2626
#include <asm/uaccess.h>
2727

28+
void *irq_stack[NR_CPUS];
29+
2830
/*
2931
* 'what should we do if we get a hw irq event on an illegal vector'.
3032
* each architecture has to answer this themselves.
@@ -55,6 +57,15 @@ void __init init_IRQ(void)
5557
irq_set_noprobe(i);
5658

5759
arch_init_irq();
60+
61+
for_each_possible_cpu(i) {
62+
int irq_pages = IRQ_STACK_SIZE / PAGE_SIZE;
63+
void *s = (void *)__get_free_pages(GFP_KERNEL, irq_pages);
64+
65+
irq_stack[i] = s;
66+
pr_debug("CPU%d IRQ stack at 0x%p - 0x%p\n", i,
67+
irq_stack[i], irq_stack[i] + IRQ_STACK_SIZE);
68+
}
5869
}
5970

6071
#ifdef CONFIG_DEBUG_STACKOVERFLOW

arch/mips/kernel/process.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <asm/cpu.h>
3333
#include <asm/dsp.h>
3434
#include <asm/fpu.h>
35+
#include <asm/irq.h>
3536
#include <asm/msa.h>
3637
#include <asm/pgtable.h>
3738
#include <asm/mipsregs.h>
@@ -552,7 +553,19 @@ EXPORT_SYMBOL(unwind_stack_by_address);
552553
unsigned long unwind_stack(struct task_struct *task, unsigned long *sp,
553554
unsigned long pc, unsigned long *ra)
554555
{
555-
unsigned long stack_page = (unsigned long)task_stack_page(task);
556+
unsigned long stack_page = 0;
557+
int cpu;
558+
559+
for_each_possible_cpu(cpu) {
560+
if (on_irq_stack(cpu, *sp)) {
561+
stack_page = (unsigned long)irq_stack[cpu];
562+
break;
563+
}
564+
}
565+
566+
if (!stack_page)
567+
stack_page = (unsigned long)task_stack_page(task);
568+
556569
return unwind_stack_by_address(stack_page, sp, pc, ra);
557570
}
558571
#endif

block/blk-mq.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,7 +1470,7 @@ static struct blk_mq_tags *blk_mq_init_rq_map(struct blk_mq_tag_set *set,
14701470
INIT_LIST_HEAD(&tags->page_list);
14711471

14721472
tags->rqs = kzalloc_node(set->queue_depth * sizeof(struct request *),
1473-
GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY,
1473+
GFP_NOIO | __GFP_NOWARN | __GFP_NORETRY,
14741474
set->numa_node);
14751475
if (!tags->rqs) {
14761476
blk_mq_free_tags(tags);
@@ -1496,7 +1496,7 @@ static struct blk_mq_tags *blk_mq_init_rq_map(struct blk_mq_tag_set *set,
14961496

14971497
do {
14981498
page = alloc_pages_node(set->numa_node,
1499-
GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY | __GFP_ZERO,
1499+
GFP_NOIO | __GFP_NOWARN | __GFP_NORETRY | __GFP_ZERO,
15001500
this_order);
15011501
if (page)
15021502
break;
@@ -1517,7 +1517,7 @@ static struct blk_mq_tags *blk_mq_init_rq_map(struct blk_mq_tag_set *set,
15171517
* Allow kmemleak to scan these pages as they contain pointers
15181518
* to additional allocations like via ops->init_request().
15191519
*/
1520-
kmemleak_alloc(p, order_to_size(this_order), 1, GFP_KERNEL);
1520+
kmemleak_alloc(p, order_to_size(this_order), 1, GFP_NOIO);
15211521
entries_per_page = order_to_size(this_order) / rq_size;
15221522
to_do = min(entries_per_page, set->queue_depth - i);
15231523
left -= to_do * rq_size;

drivers/crypto/caam/ctrl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@ static int deinstantiate_rng(struct device *ctrldev, int state_handle_mask)
278278
/* Try to run it through DECO0 */
279279
ret = run_descriptor_deco0(ctrldev, desc, &status);
280280

281-
if (ret || status) {
281+
if (ret ||
282+
(status && status != JRSTA_SSRC_JUMP_HALT_CC)) {
282283
dev_err(ctrldev,
283284
"Failed to deinstantiate RNG4 SH%d\n",
284285
sh_idx);

0 commit comments

Comments
 (0)