Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2983761imm; Sun, 1 Jul 2018 09:41:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLz+N5BwOyBFIM7+5BCWh5UeRfsbTS1qq31vs3fF8E9jxDwR5C7pa54hY9NW5nNprCAXQpN X-Received: by 2002:a65:64cf:: with SMTP id t15-v6mr18912569pgv.79.1530463272807; Sun, 01 Jul 2018 09:41:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530463272; cv=none; d=google.com; s=arc-20160816; b=Y1rrYUKCWxkVTu1aQlBIGudEKpdDFEf+Z+wzGJb/srWWbu76fhoVs3fa4JWeJV3yKd 42Gw14FhR863ryQDmBO/GxFkuLyDN6TohnK5g1rKHX/7J/9QB8VgUFw5cuAaa+3Ebxrk nndtf6qN6nQ5vxvSDNyY88+ewgHLNGcrcusGOBQtjGiKsFcbFzXiCVJbH04BBNBsY3Kg 69fkkGjAiKfe1/IBmP37MQMYjVFt44plBDar/WcM1OoJ2bvA2MqDjE/PP1/XIjKl4fxZ T/4Ri04nJXK5XJOTIL6Erf9izgiQviuypGnxZB4GeqNuQcBubIIfLq5r8b2Ft3FNmP4k ROfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=n8xmKULNPcbd4e+7tyzrFtqzyLP/lBk3RfPhWheHYgY=; b=YeVlpJoyPdkSCIy/yos7mVYf1ejfGTJeC4xl/53j8BmjUde9epgLLTzxkMpLvtJlrX MVwAcWu808cKLKszCWWa1+nkzCsy/GdEOaUYnGroC4TQAnBLZYjTYhZG2xpAnORKzQeP XJdYrqwBY4PKbzSvU32zhH8+qtL+AywMvJs4Am0+4SWAHSP2g4SmdTG43OvLSa1nyZZi VSp8Sfi6qXWoi4VL7GuC0pOCwkD6zaA48oMTpuNMrm8lcoPUeTj/sAjO/XuVY5yD6jzl SwJbZvtPcu9mHpcGrY3kLSn8r5mL55qI1vPSy7L196lp14Bt9ruPYbSxAab+OtB6lidC UJPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 68-v6si14384624pfo.229.2018.07.01.09.40.58; Sun, 01 Jul 2018 09:41:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031285AbeGAQic (ORCPT + 99 others); Sun, 1 Jul 2018 12:38:32 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36710 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031365AbeGAQiZ (ORCPT ); Sun, 1 Jul 2018 12:38:25 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 95DAB92B; Sun, 1 Jul 2018 16:38:24 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Aneesh Kumar K.V" , Michael Ellerman Subject: [PATCH 4.17 044/220] powerpc/mm/hash: Add missing isync prior to kernel stack SLB switch Date: Sun, 1 Jul 2018 18:21:08 +0200 Message-Id: <20180701160910.163760677@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160908.272447118@linuxfoundation.org> References: <20180701160908.272447118@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Aneesh Kumar K.V commit 91d06971881f71d945910de128658038513d1b24 upstream. Currently we do not have an isync, or any other context synchronizing instruction prior to the slbie/slbmte in _switch() that updates the SLB entry for the kernel stack. However that is not correct as outlined in the ISA. >From Power ISA Version 3.0B, Book III, Chapter 11, page 1133: "Changing the contents of ... the contents of SLB entries ... can have the side effect of altering the context in which data addresses and instruction addresses are interpreted, and in which instructions are executed and data accesses are performed. ... These side effects need not occur in program order, and therefore may require explicit synchronization by software. ... The synchronizing instruction before the context-altering instruction ensures that all instructions up to and including that synchronizing instruction are fetched and executed in the context that existed before the alteration." And page 1136: "For data accesses, the context synchronizing instruction before the slbie, slbieg, slbia, slbmte, tlbie, or tlbiel instruction ensures that all preceding instructions that access data storage have completed to a point at which they have reported all exceptions they will cause." We're not aware of any bugs caused by this, but it should be fixed regardless. Add the missing isync when updating kernel stack SLB entry. Cc: stable@vger.kernel.org Signed-off-by: Aneesh Kumar K.V [mpe: Flesh out change log with more ISA text & explanation] Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/entry_64.S | 1 + 1 file changed, 1 insertion(+) --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S @@ -596,6 +596,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEG * actually hit this code path. */ + isync slbie r6 slbie r6 /* Workaround POWER5 < DD2.1 issue */ slbmte r7,r0