Skip to contentSkip to conversation

Patch "parisc/mm: Ensure IRQs are off in switch_mm()" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Jul 18, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

parisc/mm: Ensure IRQs are off in switch_mm()

to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
parisc-mm-ensure-irqs-are-off-in-switch_mm.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 649aa24254e85bf6bd7807dd372d083707852b1f Mon Sep 17 00:00:00 2001

From: Helge Deller <[email protected]>
Date: Mon, 29 May 2017 17:14:16 +0200
Subject: parisc/mm: Ensure IRQs are off in switch_mm()

From: Helge Deller <[email protected]>

commit 649aa24254e85bf6bd7807dd372d083707852b1f upstream.

This is because of commit f98db6013c55 ("sched/core: Add switch_mm_irqs_off() and use it in the scheduler") in which switch_mm_irqs_off() is called by the scheduler, vs switch_mm() which is used by use_mm().

This patch lets the parisc code mirror the x86 and powerpc code, ie. it disables interrupts in switch_mm(), and optimises the scheduler case by defining switch_mm_irqs_off().

---
 arch/parisc/include/asm/mmu_context.h |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
arch/parisc/include/asm/mmu_context.h +13 -2
@@ -49,15 +49,26 @@ static inline void load_context(mm_conte
 	mtctl(__space_to_prot(context), 8);
 }
 
-static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
+static inline void switch_mm_irqs_off(struct mm_struct *prev,
+		struct mm_struct *next, struct task_struct *tsk)
 {
-
 	if (prev != next) {
 		mtctl(__pa(next->pgd), 25);
 		load_context(next->context);
 	}
 }
 
+static inline void switch_mm(struct mm_struct *prev,
+		struct mm_struct *next, struct task_struct *tsk)
+{
+	unsigned long flags;
+
+	local_irq_save(flags);
+	switch_mm_irqs_off(prev, next, tsk);
+	local_irq_restore(flags);
+}
+#define switch_mm_irqs_off switch_mm_irqs_off
+
 #define deactivate_mm(tsk,mm)	do { } while (0)
 
 static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/parisc-use-compat_sys_keyctl.patch queue-4.9/mm-fix-overflow-check-in-expand_upwards.patch queue-4.9/parisc-dma-api-return-error-instead-of-bug_on-for-dma-ops-on-non-dma-devs.patch queue-4.9/parisc-mm-ensure-irqs-are-off-in-switch_mm.patch queue-4.9/parisc-report-sigsegv-instead-of-sigbus-when-running-out-of-stack.patch