From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org,
Markos Chandras <markos.chandras@imgtec.com>,
linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH 3.18 071/151] MIPS: asm: pgtable: Add c0 hazards on HTW start/stop sequences
Date: Tue, 3 Mar 2015 22:13:25 -0800 [thread overview]
Message-ID: <20150304055509.131103263@linuxfoundation.org> (raw)
In-Reply-To: <20150304055457.084276421@linuxfoundation.org>
3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Markos Chandras <markos.chandras@imgtec.com>
commit 461d1597ffad7a826f8aaa63ab0727c37b632e34 upstream.
When we use htw_{start,stop}() outside of htw_reset(), we need
to ensure that c0 changes have been propagated properly before
we attempt to continue with subsequence memory operations.
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9114/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/mips/include/asm/pgtable.h | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
--- a/arch/mips/include/asm/pgtable.h
+++ b/arch/mips/include/asm/pgtable.h
@@ -99,16 +99,20 @@ extern void paging_init(void);
#define htw_stop() \
do { \
- if (cpu_has_htw) \
+ if (cpu_has_htw) { \
write_c0_pwctl(read_c0_pwctl() & \
~(1 << MIPS_PWCTL_PWEN_SHIFT)); \
+ back_to_back_c0_hazard(); \
+ } \
} while(0)
#define htw_start() \
do { \
- if (cpu_has_htw) \
+ if (cpu_has_htw) { \
write_c0_pwctl(read_c0_pwctl() | \
(1 << MIPS_PWCTL_PWEN_SHIFT)); \
+ back_to_back_c0_hazard(); \
+ } \
} while(0)
@@ -116,9 +120,7 @@ do { \
do { \
if (cpu_has_htw) { \
htw_stop(); \
- back_to_back_c0_hazard(); \
htw_start(); \
- back_to_back_c0_hazard(); \
} \
} while(0)
next prev parent reply other threads:[~2015-03-04 6:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20150304055457.084276421@linuxfoundation.org>
2015-03-04 6:13 ` [PATCH 3.18 066/151] KVM: MIPS: Disable HTW while in guest Greg Kroah-Hartman
2015-03-04 6:13 ` [PATCH 3.18 067/151] KVM: MIPS: Dont leak FPU/DSP to guest Greg Kroah-Hartman
2015-03-04 6:13 ` [PATCH 3.18 068/151] MIPS: Alchemy: Fix cpu clock calculation Greg Kroah-Hartman
2015-03-04 6:13 ` Greg Kroah-Hartman [this message]
2015-03-04 6:13 ` [PATCH 3.18 072/151] MIPS: asm: pgtable: Prevent HTW race when updating PTEs Greg Kroah-Hartman
2015-03-04 6:13 ` [PATCH 3.18 073/151] MIPS: Export FP functions used by lose_fpu(1) for KVM Greg Kroah-Hartman
2015-03-04 6:13 ` [PATCH 3.18 074/151] MIPS: Export MSA " Greg Kroah-Hartman
2015-03-04 6:14 ` [PATCH 3.18 121/151] MIPS: HTW: Prevent accidental HTW start due to nested htw_{start, stop} Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150304055509.131103263@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=markos.chandras@imgtec.com \
--cc=ralf@linux-mips.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox