stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] arm64: Avoid Cavium TX2 erratum 219 when switching TTBR" failed to apply to 4.19-stable tree
@ 2019-10-27 13:53 gregkh
  2019-10-28  9:12 ` Sasha Levin
  0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2019-10-27 13:53 UTC (permalink / raw)
  To: maz, marc.zyngier, stable, will; +Cc: stable


The patch below does not apply to the 4.19-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 9405447ef79bc93101373e130f72e9e6cbf17dbb Mon Sep 17 00:00:00 2001
From: Marc Zyngier <maz@kernel.org>
Date: Tue, 9 Apr 2019 16:22:24 +0100
Subject: [PATCH] arm64: Avoid Cavium TX2 erratum 219 when switching TTBR

As a PRFM instruction racing against a TTBR update can have undesirable
effects on TX2, NOP-out such PRFM on cores that are affected by
the TX2-219 erratum.

Cc: <stable@vger.kernel.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>

diff --git a/arch/arm64/include/asm/cpucaps.h b/arch/arm64/include/asm/cpucaps.h
index e81e0cbd728f..ac1dbca3d0cd 100644
--- a/arch/arm64/include/asm/cpucaps.h
+++ b/arch/arm64/include/asm/cpucaps.h
@@ -53,7 +53,8 @@
 #define ARM64_HAS_DCPODP			43
 #define ARM64_WORKAROUND_1463225		44
 #define ARM64_WORKAROUND_CAVIUM_TX2_219_TVM	45
+#define ARM64_WORKAROUND_CAVIUM_TX2_219_PRFM	46
 
-#define ARM64_NCAPS				46
+#define ARM64_NCAPS				47
 
 #endif /* __ASM_CPUCAPS_H */
diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
index d999ca2dd760..a19bb3e4bcfb 100644
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -884,6 +884,11 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
 		ERRATA_MIDR_RANGE_LIST(tx2_family_cpus),
 		.matches = needs_tx2_tvm_workaround,
 	},
+	{
+		.desc = "Cavium ThunderX2 erratum 219 (PRFM removal)",
+		.capability = ARM64_WORKAROUND_CAVIUM_TX2_219_PRFM,
+		ERRATA_MIDR_RANGE_LIST(tx2_family_cpus),
+	},
 #endif
 	{
 	}
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index 84a822748c84..109894bd3194 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -1070,7 +1070,9 @@ alternative_insn isb, nop, ARM64_WORKAROUND_QCOM_FALKOR_E1003
 #else
 	ldr	x30, =vectors
 #endif
+alternative_if_not ARM64_WORKAROUND_CAVIUM_TX2_219_PRFM
 	prfm	plil1strm, [x30, #(1b - tramp_vectors)]
+alternative_else_nop_endif
 	msr	vbar_el1, x30
 	add	x30, x30, #(1b - tramp_vectors)
 	isb


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: FAILED: patch "[PATCH] arm64: Avoid Cavium TX2 erratum 219 when switching TTBR" failed to apply to 4.19-stable tree
  2019-10-27 13:53 FAILED: patch "[PATCH] arm64: Avoid Cavium TX2 erratum 219 when switching TTBR" failed to apply to 4.19-stable tree gregkh
@ 2019-10-28  9:12 ` Sasha Levin
  2019-10-28 10:53   ` Marc Zyngier
  0 siblings, 1 reply; 3+ messages in thread
From: Sasha Levin @ 2019-10-28  9:12 UTC (permalink / raw)
  To: gregkh; +Cc: maz, marc.zyngier, stable, will

On Sun, Oct 27, 2019 at 02:53:33PM +0100, gregkh@linuxfoundation.org wrote:
>
>The patch below does not apply to the 4.19-stable tree.
>If someone wants it applied there, or to any other stable or longterm
>tree, then please email the backport, including the original git commit
>id to <stable@vger.kernel.org>.
>
>thanks,
>
>greg k-h
>
>------------------ original commit in Linus's tree ------------------
>
>From 9405447ef79bc93101373e130f72e9e6cbf17dbb Mon Sep 17 00:00:00 2001
>From: Marc Zyngier <maz@kernel.org>
>Date: Tue, 9 Apr 2019 16:22:24 +0100
>Subject: [PATCH] arm64: Avoid Cavium TX2 erratum 219 when switching TTBR
>
>As a PRFM instruction racing against a TTBR update can have undesirable
>effects on TX2, NOP-out such PRFM on cores that are affected by
>the TX2-219 erratum.
>
>Cc: <stable@vger.kernel.org>
>Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>Signed-off-by: Will Deacon <will@kernel.org>

Rather than backporting this, we need to look into backporting the rest
of the errata fixes. I'll look into that...

-- 
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: FAILED: patch "[PATCH] arm64: Avoid Cavium TX2 erratum 219 when switching TTBR" failed to apply to 4.19-stable tree
  2019-10-28  9:12 ` Sasha Levin
@ 2019-10-28 10:53   ` Marc Zyngier
  0 siblings, 0 replies; 3+ messages in thread
From: Marc Zyngier @ 2019-10-28 10:53 UTC (permalink / raw)
  To: Sasha Levin; +Cc: gregkh, marc.zyngier, stable, will

On Mon, 28 Oct 2019 09:12:07 +0000,
Sasha Levin <sashal@kernel.org> wrote:
> 
> On Sun, Oct 27, 2019 at 02:53:33PM +0100, gregkh@linuxfoundation.org wrote:
> > 
> > The patch below does not apply to the 4.19-stable tree.
> > If someone wants it applied there, or to any other stable or longterm
> > tree, then please email the backport, including the original git commit
> > id to <stable@vger.kernel.org>.
> > 
> > thanks,
> > 
> > greg k-h
> > 
> > ------------------ original commit in Linus's tree ------------------
> > 
> > From 9405447ef79bc93101373e130f72e9e6cbf17dbb Mon Sep 17 00:00:00 2001
> > From: Marc Zyngier <maz@kernel.org>
> > Date: Tue, 9 Apr 2019 16:22:24 +0100
> > Subject: [PATCH] arm64: Avoid Cavium TX2 erratum 219 when switching TTBR
> > 
> > As a PRFM instruction racing against a TTBR update can have undesirable
> > effects on TX2, NOP-out such PRFM on cores that are affected by
> > the TX2-219 erratum.
> > 
> > Cc: <stable@vger.kernel.org>
> > Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> > Signed-off-by: Will Deacon <will@kernel.org>
> 
> Rather than backporting this, we need to look into backporting the rest
> of the errata fixes. I'll look into that...

Yup. On its own, this workaround is pretty useless.

I have a 4.19 backport [1] that needs some testing (I don't have access to
a TX2 at the moment). 4.14 is "interesting" to backport (weird and
wonderful dependencies), but I'm not sure 4.9 has any value for this
HW (did it ever run 4.9?).

Thanks,

	M.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/log/?h=stable-4.19/tx2-219

-- 
Jazz is not dead, it just smells funny.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-28 10:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-27 13:53 FAILED: patch "[PATCH] arm64: Avoid Cavium TX2 erratum 219 when switching TTBR" failed to apply to 4.19-stable tree gregkh
2019-10-28  9:12 ` Sasha Levin
2019-10-28 10:53   ` Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).