Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3063240imm; Sun, 1 Jul 2018 11:22:48 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIP4OWgHJdfuzy+/7ePVbawbI7HMO9KrmRIYUhB3leZZlKiWh3xXXbyHfMKqk9G5h2WWVvf X-Received: by 2002:a65:6657:: with SMTP id z23-v6mr19640798pgv.257.1530469368598; Sun, 01 Jul 2018 11:22:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530469368; cv=none; d=google.com; s=arc-20160816; b=sXCfT3g7XF+DSDiz162hUfkqYmvUGBvPTaT8uHaO/jTWMKn03CuziqshUMkIdL78kv b4EnepUaQMrQKbLDSw8BX69NCJDxRfAA6wVXjfFl2FqCc7o20Pso/OZjgi27/dapqx0S hKxK1yCrnIoiSVeILYXLeTz3Yt1jh3dVBR1Ork2RyZdRZxaGK1LnRJ9PyxToU2w6z3M+ Sderlib6HwlSno5dR6aKSmGY4WYOKuR5HB9j0rdyVQ2II/9wTqFmvt6O4V/5+n5qxXR6 hkX0xC6DJeT4lQuZaX7vnClJNPHRMW8KVlxd7ouIkddZlAWspqqAZp6GpN++xaxvk8ff DupA== 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=BcE3okNtK3QRWi7AvAe32wAIlsOuCWvNYpzNVOFwa38=; b=oBbMBBv9ZQ8rXhwn0iPLLqqSWFdCIDgjbIRCDGr4H+BbliaRPwMGCz326lrxc6jUOO /bbW0RE57fQs/Q5He9IhFLU2EZLoQn9qfo+GapLVhDqw1L5yxErJ8WwRhr6y96c2T9UI EjFpkEd0zdAkmfWESd30scI/ZpWDtNqOhsGYeiAMC5SHz9okSNDGpl8wT2+ObY1/AoE0 ApTUb4+vTzfTtLLwKBEj3Hw/ZVKNjthgoZBAhRhAqZdF6B9c40LgvVoE87wMcSFmhQxs kIufLfgcv5tdpWumxDQmXhwQ9bIOQ8BqrX/1jZaAQnjPShssZSgbunQoXq7uUYYMBOxD f1bQ== 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 o1-v6si14041044pld.424.2018.07.01.11.22.34; Sun, 01 Jul 2018 11:22:48 -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 S965234AbeGASUc (ORCPT + 99 others); Sun, 1 Jul 2018 14:20:32 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33614 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964872AbeGAQZF (ORCPT ); Sun, 1 Jul 2018 12:25:05 -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 F043DAEF; Sun, 1 Jul 2018 16:25:04 +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.9 024/101] powerpc/mm/hash: Add missing isync prior to kernel stack SLB switch Date: Sun, 1 Jul 2018 18:21:10 +0200 Message-Id: <20180701160758.113610393@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160757.138608453@linuxfoundation.org> References: <20180701160757.138608453@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.9-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 @@ -586,6 +586,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