[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#868887: POWER9 : random segvs and illegal instructions



Source: linux
Source-Version: 4.9.30-2+deb9u1
Severity: important
Tags: patch

--

Hi,
I'm forwarding the attached patch for POWER9 (dd2.00 hardware), that it would be
nice to have in Stretch. As explained in it :

"
On POWER9 the ERAT may be incorrect on wakeup from some stop states
that lose state. This causes random segvs and illegal instructions
when these stop states are enabled.

This patch invalidates the ERAT on wakeup on POWER9 to prevent this
from causing a problem.
"

Here is the original patch :
https://patchwork.ozlabs.org/patch/780365/
It got backported and applied in Ubuntu Zesty and Artfull:
https://lists.ubuntu.com/archives/kernel-team/2017-June/085197.html
and it reached upstream as well :
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ba6d334ac230065243a92bb7cb3fd6a5f6a7f8ac

The attached patch has been backported to Debian's 4.9.30 by Michael
Neuling.

Thanks,

F.

Attachment: pgp7WnRCGpChV.pgp
Description: PGP signature

commit 557e402e5707f771b8bdd51e0f210227af30c254
Author: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date:   Sat Jun 24 12:29:01 2017 -0500

    powerpc/64s: Invalidate ERAT on powersave wakeup for POWER9
    
    On POWER9 the ERAT may be incorrect on wakeup from some stop states
    that lose state. This causes random segvs and illegal instructions
    when these stop states are enabled.
    
    This patch invalidates the ERAT on wakeup on POWER9 to prevent this
    from causing a problem.
    
    (cherry picked from commit ba6d334ac230065243a92bb7cb3fd6a5f6a7f8ac)
    
    Signed-off-by: Michael Neuling <mikey@neuling.org>
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
    [mpe: Merge comment change with upstream changes]
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

diff --git a/arch/powerpc/kernel/idle_book3s.S b/arch/powerpc/kernel/idle_book3s.S
index b350ac5e31..9adf3ba9ab 100644
--- a/arch/powerpc/kernel/idle_book3s.S
+++ b/arch/powerpc/kernel/idle_book3s.S
@@ -375,6 +375,13 @@ _GLOBAL(power9_idle_stop)
  */
 _GLOBAL(pnv_restore_hyp_resource)
 BEGIN_FTR_SECTION
+	/*
+	 * Workaround for POWER9, if we lost resources, the ERAT
+	 * might have been mixed up and needs flushing.
+	 */
+	blt	cr3,1f
+	PPC_INVALIDATE_ERAT
+1:
 	ld	r2,PACATOC(r13);
 	/*
 	 * POWER ISA 3. Use PSSCR to determine if we




Attachment: pgpoxf_RjTowf.pgp
Description: PGP signature


Reply to: