Commit e3d2adaa authored by Helge Deller's avatar Helge Deller Committed by Greg Kroah-Hartman

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

commit 649aa242 upstream.

This is because of commit f98db601 ("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().
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8ed89cfc
...@@ -49,15 +49,26 @@ static inline void load_context(mm_context_t context) ...@@ -49,15 +49,26 @@ static inline void load_context(mm_context_t context)
mtctl(__space_to_prot(context), 8); 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) { if (prev != next) {
mtctl(__pa(next->pgd), 25); mtctl(__pa(next->pgd), 25);
load_context(next->context); 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) #define deactivate_mm(tsk,mm) do { } while (0)
static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next) static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment