Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3066670imm; Sun, 1 Jul 2018 11:27:58 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJHNejRFtdyrp5BicM+GQerK6jKeXmVOtKTqTowUx6qJ7rVWRamypDvQRHqLy0IfHzbNMDH X-Received: by 2002:a17:902:43a4:: with SMTP id j33-v6mr23004018pld.118.1530469678814; Sun, 01 Jul 2018 11:27:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530469678; cv=none; d=google.com; s=arc-20160816; b=1A6MTlOIh7lNzWm0iQaiRpuVy5Nt/pY+Rgm4yCt7tFBKb8kMy15E0NhCkltDqKx07w C5Xnk0RN6BZxQpD9sptvkFmmZaZjnsj7u/HF/WXZuYO3Cp4lqWECvpUCwcuac0DTf4oj 0KI/onucio6VeEqtXOzVXTXWHW6Lvm1iz5HDCfEL1pUNiW2+bSp+CjWHutpighk1Mkw9 Iq73GGx73f/sh8j/1TX/2T2ZNG4f+XUy7+SKliJBauObtTGX6DnRCchC+/p19dJt4Cbc ZEOqMMZvZsPgIYcRznVH40ipvklsACWS48/9cs72sziYaIVTgRbpfFum52mnQ6CokXez 0Rqg== 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=uvJOlmCgvavz5KUOWVNRsKpBTjOY4gmIiIsefC/AY5w=; b=I2RoPV+uCJ5aejmtc13h3yF0S0dCXGfdnFsc7pv6gyX3G3wAYvOKRz2vZorjxP/Rsh 0srsg3GT+qfOHlty37kVpMmbMcefdCpeOL3Qm3H4SwV6fDhZFW51U5b7fBeQW1Immz48 rvxRExIssh+MvscvJ3dtwIOO6aFjB6cSf0ipioHxCB69VCtgFbzPL4vKdJl+rAVmntvy 7GiCZJxesqaLtipWgz+GJ03nMZ+bPSgDfG2gLcLfqK5uNENd8ft2ToCsS1Fwna8gqcB8 mu7NB/TNwz5jxNqE2rqaIOF2gmr+KIVDkR5po1jv5wm0sAoab+gH4Y3xncBiduuia47j fWqw== 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 c11-v6si12812126pgt.686.2018.07.01.11.27.44; Sun, 01 Jul 2018 11:27:58 -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 S965325AbeGASZw (ORCPT + 99 others); Sun, 1 Jul 2018 14:25:52 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33024 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753334AbeGAQSb (ORCPT ); Sun, 1 Jul 2018 12:18:31 -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 E54EB92B; Sun, 1 Jul 2018 16:18:30 +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.4 043/105] powerpc/mm/hash: Add missing isync prior to kernel stack SLB switch Date: Sun, 1 Jul 2018 18:01:53 +0200 Message-Id: <20180701153152.368272091@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701153149.382300170@linuxfoundation.org> References: <20180701153149.382300170@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.4-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 @@ -574,6 +574,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