This is a note to let you know that I've just added the patch titled
MIPS: asm: pgtable: Prevent HTW race when updating PTEs
to the 3.18-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:
mips-asm-pgtable-prevent-htw-race-when-updating-ptes.patch
and it can be found in the queue-3.18 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From fde3538a8a711aedf1173ecb2d45aed868f51c97 Mon Sep 17 00:00:00 2001
From: Markos Chandras <[email protected]>
Date: Mon, 26 Jan 2015 09:40:36 +0000
Subject: MIPS: asm: pgtable: Prevent HTW race when updating PTEs
From: Markos Chandras <[email protected]>
commit fde3538a8a711aedf1173ecb2d45aed868f51c97 upstream.
Whenever we modify a page table entry, we need to ensure that the HTW
will not fetch a stable entry. And for that to happen we need to ensure
that HTW is stopped before we modify the said entry otherwise the HTW
may already be in the process of reading that entry and fetching the
old information. As a result of which, we replace the htw_reset() calls
with htw_{stop,start} in more appropriate places. This also removes the
remaining users of htw_reset() and as a result we drop that macro
Signed-off-by: Markos Chandras <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/9116/
Signed-off-by: Ralf Baechle <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
arch/mips/include/asm/pgtable.h | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
--- a/arch/mips/include/asm/pgtable.h
+++ b/arch/mips/include/asm/pgtable.h
@@ -116,14 +116,6 @@ do {
\
} while(0)
-#define htw_reset() \
-do { \
- if (cpu_has_htw) { \
- htw_stop(); \
- htw_start(); \
- } \
-} while(0)
-
extern void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep,
pte_t pteval);
@@ -155,12 +147,13 @@ static inline void pte_clear(struct mm_s
{
pte_t null = __pte(0);
+ htw_stop();
/* Preserve global status for the pair */
if (ptep_buddy(ptep)->pte_low & _PAGE_GLOBAL)
null.pte_low = null.pte_high = _PAGE_GLOBAL;
set_pte_at(mm, addr, ptep, null);
- htw_reset();
+ htw_start();
}
#else
@@ -190,6 +183,7 @@ static inline void set_pte(pte_t *ptep,
static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t
*ptep)
{
+ htw_stop();
#if !defined(CONFIG_CPU_R3000) && !defined(CONFIG_CPU_TX39XX)
/* Preserve global status for the pair */
if (pte_val(*ptep_buddy(ptep)) & _PAGE_GLOBAL)
@@ -197,7 +191,7 @@ static inline void pte_clear(struct mm_s
else
#endif
set_pte_at(mm, addr, ptep, __pte(0));
- htw_reset();
+ htw_start();
}
#endif
Patches currently in stable-queue which might be from
[email protected] are
queue-3.18/mips-kernel-cps-vec-replace-addi-with-addiu.patch
queue-3.18/kvm-mips-disable-htw-while-in-guest.patch
queue-3.18/mips-asm-pgtable-prevent-htw-race-when-updating-ptes.patch
queue-3.18/mips-asm-pgtable-add-c0-hazards-on-htw-start-stop-sequences.patch
queue-3.18/mips-asm-asmmacro-replace-add-instructions-with-addu.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html