Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3073890imm; Sun, 1 Jul 2018 11:38:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcRjxyFOBjR/8u2u06aIaXKBPv1m2piwFO9vGz1EIZh/owcqheBreSmc1F90y8y9Q68cEq3 X-Received: by 2002:a62:2785:: with SMTP id n127-v6mr22614572pfn.129.1530470306557; Sun, 01 Jul 2018 11:38:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530470306; cv=none; d=google.com; s=arc-20160816; b=vNJTQ0Sw0PRP1xumdiwp24BflpEJfcLjxlHLJZN8KP5/AUI02aAoMFLlNVB2x+p7Sn JjMFrPqx24JuXh9jRiBLhLrxbvfiM4jh0gyxbI8IyKvIWUPjmxTa9Aw4cSDD+5DK5H0e XuP/dtd+0rLW6mwfu76hUfM/1xLW12T8PMIuzaJ4a0ex1ito3scWKgAQWbJUHyvoduC5 lGfHJElqMZhqENUfPidAqZJ2GvAE7Zy27b/5h4Xly72NV6UmxRkIDG/UadYGeu8rpa8O e6qIatx7jN/pl+7aK2PhnkHPDjn09lHCncag9Kv3bkrRT9SzwPkM5mcuoqW2lckePqQ+ DErQ== 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=sr4LMY/CXH9yfoNYi0cAIwqvQ4AHu4hug8yI5oaYg48=; b=h9vlSgYQeQNVzWZGAuFaQQ7FH8c8v/PJ853RccI3SJCZvaJ9kkVx14e7ptkZ0c/Mr5 PNeXgtOt2sVfQaXP5kWzKQJo0eD5JWF7Fzi6HHp27SV2mCxFtDCwxtalwvsGbbdozjBi YmYbuLKq7YMGIT9n9g1tyFVoxhj8fjP1ZqzUc3orodzXr5UFzflrgQSagT3TarrBMvEr 0zw8iszNjDoEMTKamNsibIjnqEUkZJj+mQt09c/5A9FC52gdztBATTgX1WiuSpS27eGJ Em5ZFMLx1QKKwGyN41f1LFpHT1kSgp372AJKoX0pYNNS2u+juVFLxL07jfU7P3tZlbZz kHLA== 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 t22-v6si13887927plo.263.2018.07.01.11.38.12; Sun, 01 Jul 2018 11:38:26 -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 S932908AbeGAQPB (ORCPT + 99 others); Sun, 1 Jul 2018 12:15:01 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60428 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932811AbeGAQOu (ORCPT ); Sun, 1 Jul 2018 12:14:50 -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 23DCC4A3; Sun, 1 Jul 2018 16:14:48 +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 3.18 58/85] powerpc/mm/hash: Add missing isync prior to kernel stack SLB switch Date: Sun, 1 Jul 2018 18:02:16 +0200 Message-Id: <20180701153124.670441820@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701153122.365061142@linuxfoundation.org> References: <20180701153122.365061142@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 3.18-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 @@ -521,6 +521,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